Guest User

External IP Grabber Script [ Python ]

a guest
Jun 19th, 2015
1,528
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. """
  2.  13lackD3mon
  3.  
  4. Simple External Ip Grabber.
  5. """
  6. import mechanize as browser
  7. url = "https://duckduckgo.com/?q=whats+my+ip&ia=answer";
  8. br = browser.Browser();
  9. br.set_handle_robots(False);
  10. br.set_handle_refresh(browser._http.HTTPRefreshProcessor(), max_time=1);
  11. visit = br.open(url);
  12. html = visit.read();
  13. if("Your IP address is" in html):
  14.  #found
  15.  html=html.split("Your IP address is")[1].strip();
  16.  html=html.split("in")[0].strip();
  17.  print "[+] Your External Ip is : %s"%html;
  18. else:
  19.  pass
RAW Paste Data