leebaird/discover

GitHub: leebaird/discover

一个基于 Bash 的渗透测试自动化脚本集,通过交互菜单整合侦察、扫描、枚举、载荷生成及报告解析等全流程任务。

Stars: 3834 | Forks: 874

``` Custom bash scripts used to automate various penetration testing tasks including recon, scanning, enumeration, and malicious payload creation using Metasploit. For use with Kali Linux or Ubuntu. ``` [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/leebaird/discover/blob/master/LICENSE) * [![Twitter 关注](https://img.shields.io/twitter/follow/discoverscripts.svg?style=social&label=Follow)](https://twitter.com/discoverscripts) Lee Baird @discoverscripts * [![Twitter 关注](https://img.shields.io/twitter/follow/jay_townsend1.svg?style=social&label=Follow)](https://twitter.com/jay_townsend1) Jay "L1ghtn1ng" Townsend @jay_townsend1 * [![Twitter 关注](https://img.shields.io/twitter/follow/ninewires.svg?style=social&label=Follow)](https://twitter.com/ninewires) Jason Ashton @ninewires ### 设置与使用 * 下载到你的主目录。 ``` cd ~ git clone https://github.com/leebaird/discover cd discover/ ./discover.sh ``` * 选择 'Update' 选项来更新操作系统并安装依赖项。 * 某些选项需要 root 权限才能运行。 ### 主菜单 ``` RECON 1. Domain 2. Person SCANNING 3. Generate target list 4. CIDR 5. List 6. IP, range, or URL 7. Rerun Nmap scripts and MSF aux WEB 8. Insecure direct object reference 9. Open multiple tabs in Firefox 10. Nikto 11. SSL MISC 12. Parse XML 13. Generate a malicious payload 14. Start a Metasploit listener 15. Update 16. Exit DEV 17. API Security 18. Cloud Security 19. Container Security 20. OAuth and JWT Security 21. Open Redirect Scanner 22. Sensitive Information 23. WAF Detection 24. Web and API Security ``` ## 侦察 (RECON) ### 域名 (Domain) ``` RECON 1. Passive 2. Find registered domains 3. Previous menu ``` 注意:被动模式无法以 root 身份运行。 使用 ARIN、DNSRecon、dnstwist、subfinder、sublist3r、 theHarvester、Metasploit、Whois 以及多个网站。 * 获取所有免费的 API 密钥,以在 theHarvester 中获得最大结果。 * 将 API 密钥添加到 $HOME/.theHarvester/api-keys.yaml ### 人员 (Person) ``` RECON First name: Last name: ``` * 结合来自多个网站的信息。 ## 扫描 (SCANNING) ### 生成目标列表 ``` SCANNING 1. ARP scan 2. Ping sweep 3. Previous menu ``` * 使用不同的工具来创建目标列表,包括 Angry IP Scanner、arp-scan、netdiscover 和 Nmap pingsweep。 ### CIDR、列表、IP、范围或 URL ``` Type of scan: 1. External 2. Internal 3. Previous menu ``` * 外部扫描会将 Nmap 的源端口设置为 53,并将 max-rrt-timeout 设置为 1500ms。 * 内部扫描会将 Nmap 的源端口设置为 88,并将 max-rrt-timeout 设置为 500ms。 * Nmap 用于执行主机发现、端口扫描、服务枚举和操作系统识别。 * Nmap 脚本和 Metasploit 辅助模块用于进行额外的枚举。 * 附加工具:enum4linux、smbclient 和 ike-scan。 ## WEB ### 不安全的直接对象引用 ``` Using Burp, authenticate to a site, map & Spider, then log out. Target > Site map > select the URL > right click > Copy URLs in this host. Paste the results into a new file. Enter the location of your file: ``` ### 在 Firefox 中打开多个标签页 ``` Open multiple tabs in Firefox with: 1. List 2. Files in a directory 3. Directories in robots.txt 4. Previous menu ``` 示例: * 包含多个 IP 和/或 URL 的列表。 * 你使用 Nikto 完成了对多个网站的扫描,并希望打开位于某个目录中的每个 htm 报告。 * 使用 wget 下载域名的 robot.txt 文件,然后打开所有目录。 ### Nikto ``` This option cannot be ran as root. Run multiple instances of Nikto in parallel. 1. List of IPs 2. List of IP:port 3. Previous menu ``` ### SSL ``` Check for SSL certificate issues. List of IP:port. Enter the location of your file: ``` * 使用 sslscan、sslyze 和 Nmap 来检查 SSL/TLS 证书问题。 ## 杂项 (MISC) ### 解析 XML ``` Parse XML to CSV. 1. Burp (Base64) 2. Nessus (.nessus) 3. Nexpose (XML 2.0) 4. Nmap 5. Qualys 6. Previous menu ``` ### 生成恶意 payload ``` Malicious Payloads 1. android/meterpreter/reverse_tcp (.apk) 2. cmd/windows/reverse_powershell (.bat) 3. java/jsp_shell_reverse_tcp (Linux) (.jsp) 4. java/jsp_shell_reverse_tcp (Windows) (.jsp) 5. java/shell_reverse_tcp (.war) 6. linux/x64/meterpreter_reverse_https (.elf) 7. linux/x64/meterpreter_reverse_tcp (.elf) 8. linux/x64/shell/reverse_tcp (.elf) 9. osx/x64/meterpreter_reverse_https (.macho) 10. osx/x64/meterpreter_reverse_tcp (.macho) 11. php/meterpreter_reverse_tcp (.php) 12. python/meterpreter_reverse_https (.py) 13. python/meterpreter_reverse_tcp (.py) 14. windows/x64/meterpreter_reverse_https (multi) 15. windows/x64/meterpreter_reverse_tcp (multi) 16. Previous menu ``` ### 启动 Metasploit 监听器 ``` Metasploit Listeners 1. android/meterpreter/reverse_tcp 2. cmd/windows/reverse_powershell 3. java/jsp_shell_reverse_tcp 4. linux/x64/meterpreter_reverse_https 5. linux/x64/meterpreter_reverse_tcp 6. linux/x64/shell/reverse_tcp 7. osx/x64/meterpreter_reverse_https 8. osx/x64/meterpreter_reverse_tcp 9. php/meterpreter/reverse_tcp 10. python/meterpreter_reverse_https 11. python/meterpreter_reverse_tcp 12. windows/x64/meterpreter_reverse_https 13. windows/x64/meterpreter_reverse_tcp 14. Previous menu ``` ### 更新 * 更新操作系统,从各种代码库执行 git pull,并更新 locate 数据库。 ## 开发 (DEV) ### 容器安全扫描器 ``` CONTAINER SECURITY 1. Docker Images 2. Docker Containers 3. Kubernetes Resources 4. All Container Resources 5. Previous menu ``` * 针对 Docker 和 Kubernetes 环境的综合安全扫描器。 * **Docker 镜像**:使用 Trivy 扫描 Docker 镜像的漏洞、错误配置和敏感信息。创建包含风险评分的详细安全配置文件,并分析 Dockerfile 的安全性。 * **Docker 容器**:对正在运行和已停止的容器执行深度安全分析。检测特权容器、具有敏感挂载的容器、暴露的端口以及安全配置错误。 * **Kubernetes 资源**:审计 Kubernetes 集群的安全问题,包括特权 Pod、过于宽松的 RBAC 角色、缺失的网络策略以及以 root 身份运行的容器。 * 生成包含安全评分和可操作建议的综合报告。 # 故障排除 一些用户报告称无法使用除 3、4 和 5 之外的任何选项。 选择其他选项(1、2、6 等)时没有任何反应。 ## 验证下载哈希 基于哈希的验证通过将文件的哈希值与先前计算的值进行比较,确保文件未被损坏。 如果这些值匹配,则认为文件未被修改。 ### macOS 1. 打开终端 2. shasum -a 256 /path/to/file 3. 将该值与网站上的校验和进行比较。 ### Windows 1. 打开 PowerShell 2. Get-FileHash C:\path\to\file 3. 将该值与网站上的校验和进行比较。 ## 在 VirtualBox 或 Windows Subsystem for Linux (WSL) 上运行 Kali 一些用户报告称,解决方法是使用 VMware 镜像代替 WSL。 其他用户注意到,运行预制好的 VirtualBox Kali 镜像,而不是通过 VirtualBox 运行 裸机 Kali ISO 时,会出现问题。 (https://www.kali.org/get-kali/#kali-bare-metal) 如果你不愿意或无法使用 VMware Workstation 运行 Kali,我们鼓励你尝试在 VirtualBox 中将 Kali ISO 作为客户虚拟机运行。 1. 下载 Kali 提供的裸机 ISO。 2. 验证 ISO 哈希(见上文)。 3. 在 VirtualBox 中使用裸机 Kali ISO 创建一个新的 Kali 虚拟机。 在安装过程中,你需要填写一些[基本安装说明](https://www.kali.org/docs/installation/hard-disk-install/)。 注意:如果你在设置裸机 ISO 后无法访问 root,请参考: https://linuxconfig.org/how-to-reset-kali-linux-root-password
标签:API安全, CISA项目, CTI, JSON输出, MIT许可, Nmap, Web安全, Web截图, 企业级侦察, 域名侦察, 子域名枚举, 实时处理, 容器安全, 密码管理, 应用安全, 恶意载荷生成, 插件系统, 数字取证, 系统安全, 网络信息收集, 网络安全, 自动化脚本, 蓝队分析, 虚拟驱动器, 隐私保护