Python的ico_hash计算脚本


本来python2,要用那个hash计算模块的。自己借了fofa的计算器。实现了python3也可以了。

脚本如下:

import requests,base64,fire
from lxml import etree

def icohash(s):
    s = (base64.b64encode(s.encode('utf-8'))).decode('utf-8')
    headers = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36',
    }
    url = "https://www.fofa.so/result?qbase64=%s" % s
    r = requests.get(url=url,headers=headers)
    soup = etree.HTML(r.text)
    result = soup.xpath('//*[@id="q"]/@value')
    for i in result:
        print("http.favicon.hash:%s" % i[11:-1])


if __name__ == '__main__':
    fire.Fire(icohash)

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM