Advertisement
Guest User

honey.py

a guest
Jul 28th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.47 KB | None | 0 0
  1. #!/usr/bin/env python3                                                                                                                                
  2. # encoding: utf-8                                                                                                                                    
  3.                                                                                                                                                      
  4. """                                                                                                                                                  
  5. An ill-advised way to amuse yourself at DEFCON                                                                                                        
  6.                                                                                                                                                      
  7. Run nmap against anyone who tries to telnet in                                                                                                        
  8.                                                                                                                                                      
  9. mi100hael - 2017/07/27                                                                                                                                
  10. """                                                                                                                                                  
  11.                                                                                                                                                      
  12. import time                                                                                                                                          
  13. import socket                                                                                                                                        
  14. import subprocess                                                                                                                                    
  15.                                                                                                                                                      
  16.                                                                                                                                                      
  17. HOST = ""                                                                                                                                            
  18. PORT = 23                                                                                                                                            
  19. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)                                                                                                
  20. s.bind((HOST, PORT))                                                                                                                                  
  21. s.listen(10)                                                                                                                                          
  22. print("Listening on {}:{}...".format(HOST, PORT))                                                                                                    
  23.                                                                                                                                                      
  24. while True:                                                                                                                                          
  25.     conn, addr = s.accept()                                                                                                                          
  26.     print("Received connection from {0[0]}:{0[1]}".format(addr))                                                                                      
  27.     subprocess.Popen("nohup nmap -A -T5 {0} > {0}.out 2>&1 &".format(addr[0]), shell=True)                                                            
  28.     conn.sendall(b"Initiating client exploit...\n")                                                                                                  
  29.     time.sleep(3)                                                                                                                                    
  30.     conn.sendall(b"Done! You've bene pwnd!\n")                                                                                                        
  31.     conn.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement