import urllib2
import requests
print "\n USAGE [ TARGET>>> target.com ]\n"
target = str(raw_input("TARGET>>> "))
domainlist = open("domain.txt", "rU")
for domain in domainlist:
domain = domain.rstrip() + target
url = urllib2.urlopen("http://%s" % domain)
if url.getcode != 404:
print "\n[%s]----->>>Status[%s]"%(domain,url.getcode())
else:
print "\n[%s]----->>>Status[%s]"%(domain,url.getcode())
url.close()
domainlist.close()
'''
#doing it with REQUESTS!!!!!
print "\n USAGE [ TARGET>>> target.com ]\n"
target = str(raw_input("TARGET>>> "))
domainlist = open("domain.txt", "rU")
for domain in domainlist:
domain = domain.rstrip() + target
url= requests.get("http://%s" % domain)
if url.status_code != 404:
print "\n[%s]----->>>Status[%s]"%(domain,url.status_code)
else:
print "\n[%s]----->>>Status[%s]"%(domain,url.status_code)
url.close()
domainlist.close()
'''
heres an example of the domain.txt:
Quote
test.
test1.
test2.
test3.
www1.
www2.
www3.
test1.
test2.
test3.
www1.
www2.
www3.
now when i try and run it against "bing.com" it runs but it doesnt seem too accurate heres the response:
Quote
C:\Users\*****\Desktop>subdom.py
USAGE [ TARGET>>> target.com ]
TARGET>>> bing.com
[www3.bing.com]----->>>Status[200]
USAGE [ TARGET>>> target.com ]
TARGET>>> bing.com
[www3.bing.com]----->>>Status[200]
now when i try and run it on "google.com" or most of the websites i get this error
for urllib2
Quote
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 11001] getaddrinfo failed>
the line its on
File "C:\Users\******\Desktop\subdom.py", line 10, in <module>
url = urllib2.urlopen("%s" % domain)
urllib2.URLError: <urlopen error [Errno 11001] getaddrinfo failed>
the line its on
File "C:\Users\******\Desktop\subdom.py", line 10, in <module>
url = urllib2.urlopen("%s" % domain)
for requests
Quote
raise Connectionerror(err, request=request)
requests.exceptions.Connectionerror: ('Connection aborted.', gaierror(11001, 'getaddrinfo failed'))
and same object..
File "C:\Users\dotszilla\Desktop\subdom.py", line 24, in <module>
url= requests.get("http://%s" % domain)
requests.exceptions.Connectionerror: ('Connection aborted.', gaierror(11001, 'getaddrinfo failed'))
and same object..
File "C:\Users\dotszilla\Desktop\subdom.py", line 24, in <module>
url= requests.get("http://%s" % domain)
can someone please help me understand what iam doing wrong please, i know its something to do with that object im making.. i know its a noobie question but i just started learning and am trying to teach myself, thanks in advance guys

New Topic/Question
Reply


MultiQuote



|