Advertisement
Guest User

Simple Python ProxyServer [ tanmay606 ]

a guest
Aug 15th, 2015
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.03 KB | None | 0 0
  1. """
  2.  Fake Proxy Server [ Python ]
  3.  
  4.  Writt3n By : Tanmay Upadhyay
  5.  Email : tanmay4035266@gmail.com
  6.  
  7.  When vitim request a website it first pass through our script. and this script tell attacker which site victim is visiting.
  8.  
  9.  
  10. To Make this script work, you need to first change proxy settings in your browser as script conf.
  11. """
  12.  
  13. import socket
  14.  
  15. local_ip="127.0.0.1"; #! local ip to bind server on.
  16. local_port=int(8080); #! port to install server on.
  17.  
  18. def server(server,lhost,lport):
  19.     server=server.socket(server.AF_INET,server.SOCK_STREAM);
  20.     server.bind((lhost,lport));
  21.     server.listen(80); #! listen max for 80 req.
  22.     print "\n\t[$] SERVER Installed ( %s : %s )\n\n"%(lhost,lport);
  23.     while True:
  24.         c,address=server.accept();
  25.         reqdata = c.recv(8080);
  26.         website=reqdata.split("Host:")[1];
  27.         website=website.split("User-Agent")[0]
  28.         print "[!] Server Request Website  ( %s )"%(website.strip());
  29.  
  30.  
  31. while True:
  32.     try:
  33.         server(socket,local_ip,local_port);
  34.     except KeyboardInterrupt:
  35.         print "\n[!] Ctrl + C Pressed By You.";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement