关于计算ico文件hash值脚本

本文提供了Python2和Python3的脚本代码,用于计算ICO文件的哈希值。通过运行脚本,可以得到ICO文件的哈希值,然后在安全搜索引擎如Shodan、ZoomEye或FOFA中进行搜索,以辅助识别和查找相关网站的IP地址。当搜索无结果时,可能需要结合其他方法进一步排查。
摘要由CSDN通过智能技术生成

如何利用ico文件查找出网站的真实IP地址,分享一个计算网站ico文件hash值的工具(python2和python3双版本代码)

python2的工具脚本代码

import mmh3
import requests
response = requests.get('https://www.xxxx.com/favicon.ico')
favicon = response.content.encode('base64')
hash = mmh3.hash(favicon)
int main(int argc, char *argv[]) { int i = 0; bool bOnce = true; char szPath[RH_MAX_PATH]; char szAbsPath[RH_MAX_PATH]; char szOrgPath[RH_MAX_PATH]; char szTemp[RH_MAX_BUFFER]; int iErrorCode = 0; CHashManager hashmgr; getcwd(szOrgPath, RH_MAX_PATH); //No arguments? if(argc == 1) { printInfo(); return(RH_NO_ARGS); } memset(szPath, 0, RH_MAX_PATH); bOnce = true; hashmgr.SelectAllAlgorithms(true); for(i = 1; i = RH_MAX_BUFFER) continue; // Non-parsable option argument, ignore fmtArgument(argv[i], szTemp); // Format the argument, i.e. remove all special chars if(strcmp(szTemp, "help" ) == 0) printInfo(); if(strcmp(szTemp, "h" ) == 0) printInfo(); if(strcmp(szTemp, "?" ) == 0) printInfo(); if(strcmp(szTemp, "version" ) == 0) printInfo(); if(strcmp(szTemp, "v" ) == 0) printInfo(); if(strcmp(szTemp, "fullpath") == 0) hashmgr.SetOption(OPT_FULLPATH, true); if(strcmp(szTemp, "f" ) == 0) hashmgr.SetOption(OPT_FULLPATH, true); if(strcmp(szTemp, "nopath" ) == 0) hashmgr.SetOption(OPT_FULLPATH, false); if(strcmp(szTemp, "rcrsv" ) == 0) hashmgr.SetOption(OPT_RECURSIVE, true); if(strcmp(szTemp, "norcrsv" ) == 0) hashmgr.SetOption(OPT_RECURSIVE, false); if(strcmp(szTemp, "recur" ) == 0) hashmgr.SetOption(OPT_RECURSIVE, true); if(strcmp(szTemp, "norecur" ) == 0) hashmgr.SetOption(OPT_RECURSIVE, false); if(strcmp(szTemp, "r" ) == 0) hashmgr.SetOption(OPT_RECURSIVE, true); if(strcmp(szTemp, "all" ) == 0) hashmgr.SelectAllAlgorithms(true); if(strcmp(szTemp, "a" ) == 0) hashmgr.SelectAllAlgorithms(true); if(strcmp(szTemp, "none" ) == 0) hashmgr.SelectAllAlgorithms(false); if(strcmp(s
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值