smziaurrashid icon

Reverse IP & Domain Details Script

smziaurrashid | PRO | 07/29/15 01:40:34 PM UTC | 0 ⭐ | 1636 👁️ | Never ⏰ | []
Python |

1.74 KB

|

None

|

0 👍

/

0 👎

#!/usr/bin/python
 
import urllib, urllib2
import cookielib
import re, sys, os
 
os.system('cls' if os == "nt" else "clear")
 
h = sys.argv[1]
 
demo = '''
|-------------------------------------------------
| Reverse IP & Domain Details Script 
| Love To: TiGER-M@TE, Ne0-h4ck3r, F0RTYS3V3N
| Use: python reverseip.py site.com
|-------------------------------------------------
''' 
 
print demo
print ""
print "1. Reverse IP "
print "2. Domain Information "
print ""
 
ans = raw_input('Select your Options: ')
print ""
 
def domain():
        
        try:
            if ans == "1":
                cj = cookielib.CookieJar()
                opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
                opener.addheader = [('User-Agent', 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0')]
                url = "http://viewdns.info/reverseip/?host="+h+"&t=1"
 
                uagent= {'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0'}
                ip = urllib2.Request(url, headers=uagent)
                site = opener.open(ip).read()
              
                reverse = re.findall('<tr><td>\S+</td><td', site)
                      
                for neo in reverse:
                    s = neo.replace('<tr><td>', "").replace('</td><td', "")
                    if s.startswith("http//"):
                        pass
                    else:
                        print "http://" + s
            
            elif ans == "2":
                Domain_Info = "http://www.viewdns.info/whois/?domain=" + h
                whoi = urllib2.urlopen(Domain_Info).read()
                
                yes = re.findall('<font size="2" face="Courier">(.*)><tr></tr>', whoi)
                
                for lucy in yes:
                    p = lucy.replace('<br>', "\n").replace("</td></tr", "")
                    if "DNSSEC" in p:
                        print p.split("DNSSEC")[0]
                    elif 'Disclaimer' in p:
                        print p.split("Disclaimer")[0]
            
                        
        except Exception, e:
                print e
                
 
domain()

Comments