Created
May 29, 2012 01:43
-
-
Save zhuzhuor/2822090 to your computer and use it in GitHub Desktop.
For brute-force searching sogou sub-domains
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
['h0.cmc.bj.ie.sogou.com', | |
'h0.cnc.bj.ie.sogou.com', | |
'h0.crc.bj.ie.sogou.com', | |
'h0.ctc.bj.ie.sogou.com', | |
'h0.dxt.bj.ie.sogou.com', | |
'h0.edu.bj.ie.sogou.com'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env pypy | |
from socket import gethostbyname | |
def does_exist(domain): | |
try: | |
ip = gethostbyname(domain) | |
except: | |
return None | |
return ip | |
import itertools | |
comb = itertools.product('abcdefghijklmnopqrstuvwxyz', repeat=3) | |
results = [] | |
for i in comb: | |
d = 'h0.' + ''.join(i) + '.bj.ie.sogou.com' | |
print d, | |
ip = does_exist(d) | |
if ip: | |
results.append(d) | |
print ip | |
else: | |
print 'no' | |
from pprint import pprint | |
pprint(results) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment