import urllib
import re
import os
search = (raw_input('[!]Search: '))
site = "http://www.exploit-db.com/list.php?description="+search+"&author=&platform=&type=&port=&osvdb=&cve="
print site
source = urllib.urlopen(site).read()
founds = re.findall("href='/exploits/\d+",source)
print "\n[+]Search",len(founds),"Results\n"
if len(founds) >=1:
for found in founds:
found = found.replace("href='","")
print "http://www.exploit-db.com"+found
else:
print "\nCouldnt find anything with your search\n"
當我搜索exploit-db.com網站時,我只得到了25個結果,我怎樣才能使它進入其他頁面或者傳遞25個結果。正在搜索一個網站
使用正則表達式來解析HTML是錯誤的。請參閱http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags以及討論此主題的其他許多主題。 – 2010-02-19 19:35:03