Chu

下载ghdb的小脚本

GHDB(又名谷歌黑客数据库)是HTML / JavaScript的封装应用,使用的先进的JavaScript技术搜索黑客所需的信息,而不借助于本地服务器端脚本。尽管数据库更新频率不高,但里边仍然可以找到黑客经常用于Web信息挖掘的Google搜索字符串。(此处省略800字,详情自己百度。。。)

前两天在freebuf看到一个下载ghdb的shell脚本(https://www.freebuf.com/articles/web/6846.html),正好最近在学正则,就自己写了个练练手。

## Download GHDB with Python
## Author: Chu
## Blog: www.chuhades.com

import re
import urllib2

record = open('record.html', 'w')

for i in xrange(1, 3825):
    html = urllib2.urlopen('https://www.exploit-db.com/ghdb/%d/' % i).read()
    record.write(str(i)+"."+re.search(r"Google search:(.+</a>)", html).group(1)+"<br>")
    print "Num %d ok..." % i
record.close()

print "Over, have fun~"


简单测试下前几项,输出:

C:\Users\Administrator\Desktop\codes>python ghdb.py
Num 1 ok...
Num 2 ok...
Num 3 ok...
Num 4 ok...
Num 5 ok...
Over, have fun~


评论
©Chu
Powered by LOFTER