旁注查询脚本(python)
本帖最后由 90_ 于 2015-8-22 23:33 编辑90sec@Joseph
# coding=utf-8
#author: 小续/Joseph
import urllib
import urllib2
import base64
import re
import sys
#填写供可以使用的key
AccountKey='OP8/b5S8imIbXfU1yOYpLbL7tcEgjJ/RJAJjJkTcrJo'
top=1000
skip=0
format='json'
def BingSearch(query):
payload={}
payload['$top']=top
payload['$skip']=skip
payload['$format']=format
payload['Query']="'"+query+"'"
url='https://api.datamarket.azure.com/Bing/Search/Web?' + urllib.urlencode(payload)
sAuth='Basic '+base64.b64encode(':'+AccountKey)
headers = { }
headers['Authorization']= sAuth
try:
req = urllib2.Request(url,headers=headers)
response = urllib2.urlopen(req)
data=response.read()
return data
except Exception as e:
print e
def main():
ip=raw_input('请输入你要查旁站的IP?127.0.0.1:'.decode('utf-8').encode('gbk'))
print u"use exploit...."
data=BingSearch("ip:"+ip)
#setile=re.compile(r'\"Title\":\"(.*?)\"') 网址标题
seurl=re.compile(r'\"Url\":\"(.*?)\"')
#titles=setile.findall(data)
filename=open('url.txt','a+')
urls=seurl.findall(data)
for i in xrange(0,len(urls)):
seturl=re.compile(r'//(.*?)\/')
url=seturl.findall(urls)
print url
filename.write(url+"\n")
print u"已成功导出url.txt"
pass
filename.close()
if __name__ == '__main__':
main()
收下了。。 还是不错的哦,顶了 感谢楼主的分享~ 感谢楼主的分享~ 支持中国红客联盟(ihonker.org) 支持,看起来不错呢! 学习学习技术,加油! 支持,看起来不错呢!
页:
[1]