当前位置: 首页 > news >正文

ihoneyBakFileScan (修改针对.net备份文件扫描)

ihoneyBakFileScan

ihoneyBakFileScan 工具扫描本份文件还是比较强大的,但是针对.net的备份文件扫描还是要修改一下的,.net代码审计只需要bin目录下的文件就行,经过大量测试发现.net的备份文件一般都是bin.rar、bin.zip。

安装依赖包

pip install -r requirements.txt

修改后的脚本

# -*- coding: UTF-8 -*-import requests
import logging
from argparse import ArgumentParser
from datetime import datetime
from hurry.filesize import size
from fake_headers import Headers
from concurrent.futures import ThreadPoolExecutorbanner = """_____________________________________________      ,' -> 警告...                                   `.   /  ->  ___  /_______ _________  /____________  /   \  |  ->   __  __ \  __ `/  ___/_  //_/  _ \  __  /     | | ->    _  / / / /_/ // /__ _  ,<  /  __/ /_/ /      | \  -> ./_/ /_/\__,_/ \___/ /_/|_| \___/\__,_/      /  `._______  _____________________________________,'   ############     /,'                                          ##############*##  /'                                            ################**#                                               ########  #  ####***#                                              ########       ###****#                                             ##########     ####*****#                                            ####   ##### #####   ***#                                            ###      #######      **#                                            ###   X   #####   X   **#                                            ####     ## # ##     ***#                                            ########## ### ##*******#                                            ### ############**# ###                                             ##-#-#-#-#-#-##                                                 | | | | | | |                                                  
"""
print(banner)requests.packages.urllib3.disable_warnings()logging.basicConfig(level=logging.WARNING, format="%(message)s")def vlun(urltarget):try:if proxies:r = requests.get(url=urltarget, headers=header.generate(), timeout=timeout, allow_redirects=False, stream=True, verify=False, proxies=proxies)else:r = requests.get(url=urltarget, headers=header.generate(), timeout=timeout, allow_redirects=False, stream=True, verify=False)if (r.status_code == 200) & ('html' not in r.headers.get('Content-Type')) & ('image' not in r.headers.get('Content-Type')) & ('xml' not in r.headers.get('Content-Type')) & ('text' not in r.headers.get('Content-Type')) & ('json' not in r.headers.get('Content-Type')) & ('javascript' not in r.headers.get('Content-Type')):tmp_rarsize = int(r.headers.get('Content-Length'))rarsize = str(size(tmp_rarsize))if (int(rarsize[0:-1]) > 0):logging.warning('[ 成功 ] {}  size:{}'.format(urltarget, rarsize))with open(outputfile, 'a') as f:try:f.write(str(urltarget) + '  ' + 'size:' + str(rarsize) + '\n')except:passelse:logging.warning('[ 失败] {}'.format(urltarget))else:logging.warning('[ 失败] {}'.format(urltarget))except Exception as e:logging.warning('[ 失败] {}'.format(urltarget))def urlcheck(target=None, ulist=None):if target is not None and ulist is not None:if target.startswith('http://') or target.startswith('https://'):if target.endswith('/'):clean_url = target[:-1]  # 移除末尾斜杠else:clean_url = targetulist.append(clean_url)else:line = 'http://' + targetif line.endswith('/'):clean_url = line[:-1]else:clean_url = lineulist.append(clean_url)return ulistdef dispatcher(url_file=None, url=None, max_thread=20):urllist = []if url_file is not None and url is None:with open(str(url_file)) as f:for line in f:line = line.strip()if line:urllist = urlcheck(line, urllist)elif url is not None and url_file is None:url = str(url.strip())urllist = urlcheck(url, urllist)else:passwith open(outputfile, 'a'):passtarget_files = ['/bin.rar', '/bin.zip']  # 直接指定目标文件for u in urllist:check_urllist = []for f in target_files:url = u + fcheck_urllist.append(url)print("[添加检查] " + url)with ThreadPoolExecutor(max_thread) as executor:for url in check_urllist:executor.submit(vlun, url)if __name__ == '__main__':usageexample = '\n       Example: python3 ihoneyBakFileScan_Modify.py -t 100 -f url.txt -o result.txt\n'usageexample += '                'usageexample += 'python3 ihoneyBakFileScan_Modify.py -u https://www.example.com/ -o result.txt'parser = ArgumentParser(add_help=True, usage=usageexample, description='A Website Backup File Leak Scan Tool.')parser.add_argument('-f', '--url-file', dest="url_file", help="Example: url.txt")parser.add_argument('-t', '--thread', dest="max_threads", nargs='?', type=int, default=1, help="Max threads")parser.add_argument('-u', '--url', dest='url', nargs='?', type=str, help="Example: http://www.example.com/")parser.add_argument('-o', '--output-file', dest="output_file", help="Example: result.txt")parser.add_argument('-p', '--proxy', dest="proxy", help="Example: socks5://127.0.0.1:1080")args = parser.parse_args()global outputfileoutputfile = args.output_file if args.output_file else 'result.txt'global proxiesproxies = {'http': args.proxy,'https': args.proxy} if args.proxy else Noneheader = Headers(headers=False)timeout = 10try:if args.url:dispatcher(url=args.url, max_thread=args.max_threads)elif args.url_file:dispatcher(url_file=args.url_file, max_thread=args.max_threads)else:print("[!] 请指定 URL 或 URL 文件名")except Exception as e:print(e)

 

运行效果

 

修改后的工具名

ihoneyBin.py

bat脚本运行

@echo off
python ihoneyBin.py -t 500 -f url.txt -o result.txt

 

http://www.xdnf.cn/news/621865.html

相关文章:

  • 配置文件,xml,json,yaml,我该选哪个?
  • SpringBoot多环境配置文件切换
  • 算法笔记·数学·最大公约数
  • 基于ZYNQ的LWIP网络TCP/IP调试
  • Spring AI 1.0.0 中文文档上线
  • 在WPF中添加动画背景
  • 道德经总结
  • Spring MVC深度解析:控制器与视图解析及RESTful API设计最佳实践
  • 1267: 【入门】鲜花方阵
  • 【PhysUnits】10 减一操作(sub1.rs)
  • Python学习心得:代码森林的冒险
  • SYN Flood攻击:原理、危害与防御指南
  • PostGIS实现栅格数据转二进制应用实践【ST_AsBinary】
  • 【esp32 WIFI连接】-STA模式
  • rce命令执行原理及靶场实战(详细)
  • Vue项目前后端交互大量数据的-之-前端优化方案
  • 前端流行框架Vue3教程:25. 组件保持存活
  • 湖北理元理律师事务所债务优化方案解析:如何科学规划还款保障生活质量
  • 0304考试通过-逻辑回归实战-机器学习-人工智能
  • Symbol、Set 与 Map:新数据结构探秘
  • uniapp-商城-66-shop(2-品牌信息显示,数据库读取的异步操作 放到vuex actions)
  • Perl单元测试实战指南:从Test::Class入门到精通的完整方案
  • Linux系统管理与编程23:巧用git资源一键部署LAMP
  • ShenNiusModularity项目源码学习(29:ShenNius.Admin.Mvc项目分析-14)
  • React整合【ECharts】教程001:柱状图的构建和基本设置
  • 【Python 中 lambda、map、filter 和 reduce】详细功能介绍及用法总结
  • Java三十而立:Java 的30岁与Spring AI 1.0正式发布
  • STC89C52RC/LE52RC
  • 嵌入式Openharmony系统应用开发与实现方法
  • (已开源-CVPR2024) RadarDistill---NuScenes数据集Radar检测第一名