Skip to content

Instantly share code, notes, and snippets.

@zhuzhuor
Created May 29, 2012 01:43
Show Gist options
  • Save zhuzhuor/2822090 to your computer and use it in GitHub Desktop.
Save zhuzhuor/2822090 to your computer and use it in GitHub Desktop.
For brute-force searching sogou sub-domains
['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']
#!/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