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