公开文集
0x01 SRC 资产管理系统
0x02 Web 漏洞案例库
0x03 小程序漏洞案例库
第一章:小程序渗透基础
1.1 微信小程序反编译与动态调试
1.2 微信小程序强制开启开发者模式
0x99 信息安全学习体系
01-网络安全基础
Day-001-TCP-IP协议栈安全分析
Day-002-DNS协议安全与DNS劫持攻防
Day-003-IPv6 安全基础与过渡
Day-004-HTTP-HTTPS协议深度解析
Day-005-网络嗅探与流量分析技术
Day-006-防火墙原理与配置实践
Day-007-网络地址转换 NAT 安全分析
Day-008-路由协议安全 RIP-OSPF-BGP
Day-009-VLAN 安全与 VLAN-Hopping
Day-010-无线网络基础与安全 802.11
Day-011-网络访问控制 802.1X-NAC
Day-012-网络分段与微隔离设计
Day-013-负载均衡器安全配置
Day-014-CDN安全与防护
Day-015-NTP安全
Day-016-DHCP安全与攻击防护
Day-017-ICMP协议安全分析
Day-018-网络协议模糊测试基础
Day-019-网络流量基线建立
Day-020-网络取证基础
Day-021-网络入侵检测系统 NIDS
Day-022-网络入侵防御系统 NIPS
Day-023-网络流量加密与解密
Day-024-网络协议逆向工程基础
Day-025-网络性能与安全权衡
Day-026-SDN 安全
Day-027-网络虚拟化安全
Day-028-网络欺骗技术
Day-029-网络威胁情报应用
Day-030-网络容量规划与安全
Day-031-网络安全架构设计实战
02-Web 安全
Day-032-OWASP-Top-10-2021详解
Day-033-SQL 注入原理与手工检测
Day-034-SQL注入进阶报错注入与盲注
Day-035-XSS跨站脚本攻击基础
Day-036-XSS 进阶绕过与利用
Day-037-XSS进阶绕过与利用
Day-038-CSRF 跨站请求伪造
Day-039-文件上传漏洞
Day-040-反序列化漏洞基础
Day-041-PHP反序列化深入
Day-042-Java反序列化深入
Day-043-SSTI 服务端模板注入
Day-044-文件包含漏洞 LFI-RFI
Day-045-命令注入漏洞
Day-046-XXE-XML 外部实体注入
Day-047-反序列化漏洞进阶
Day-048-API 安全基础
Day-049-API认证与授权安全
Day-050-API漏洞挖掘实战
Day-051-文件上传漏洞进阶
Day-052-反序列化漏洞实战
Day-053-Web 安全综合实战
Day-054-移动安全基础
Day-055-Android 应用安全测试
Day-056-iOS 应用安全测试
Day-057-移动应用综合实战
Day-058-云安全基础
Day-059-AWS 安全实战
Day-060-Azure 安全实战
Day-061-GCP 安全实战
Day-062-云安全综合实战
Day-063-容器安全基础
Day-064-Docker 安全实战
Day-065-Kubernetes 安全实战
Day-066-容器安全综合实战
Day-067-API 安全进阶
Day-068-服务端请求伪造 SSRF 深入
Day-069-文件上传漏洞进阶
Day-070-反序列化漏洞实战进阶
Day-071-业务逻辑漏洞深入
Day-072-前端安全深入
Day-073-Web 安全综合实战
Day-074-云安全进阶
Day-075-移动安全进阶
Day-076-API 安全进阶
Day-077-前端安全进阶
Day-078-业务逻辑漏洞进阶
Day-079-反序列化漏洞实战进阶
Day-080-文件上传漏洞实战进阶
Day-081-SSTI 服务端模板注入进阶
Day-082-XXE-XML 外部实体注入进阶
Day-083-SSRF 服务端请求伪造进阶
Day-084-命令注入漏洞进阶
Day-085-文件包含漏洞进阶
Day-086-反序列化漏洞实战进阶
Day-087-文件上传漏洞实战进阶
Day-088-SSTI 服务端模板注入实战进阶
Day-089-XXE-XML 外部实体注入实战进阶
Day-090-SSRF 服务端请求伪造实战进阶
Day-091-命令注入漏洞实战进阶
Day-092-Web 安全综合实战
Day-093-GraphQL 安全
Day-094-JWT 与 OAuth2 安全
03-系统安全
Day-095-系统监控与检测
Day-096-主机防火墙配置
Day-097-系统审计与合规
Day-098-Linux 系统安全进阶
Day-099-Windows 系统安全进阶
Day-100-容器安全进阶
Day-101-容器编排安全进阶
Day-102-Linux 内核安全
Day-103-Windows 内核安全
Day-104-系统安全总结与实战
Day-105-Linux 系统安全基础
Day-106-Windows 系统安全基础
Day-107-容器安全基础
Day-108-系统加固技术
Day-109-日志分析技术
Day-110-威胁狩猎技术
04-应用安全
Day-111-安全编码规范
Day-112-输入验证技术
Day-113-输出编码技术
Day-114-错误处理安全
Day-115-会话管理安全
Day-116-认证安全
Day-117-授权安全
Day-118-数据保护安全
Day-119-日志安全
Day-120-API 安全
Day-121-微服务安全
Day-122-新兴技术安全概论
Day-123-DevSecOps 流水线安全
Day-124-云原生安全架构
Day-125-API 安全最佳实践
Day-126-安全编码规范
Day-127-SDL 安全开发生命周期
Day-128-威胁建模实战
Day-129-安全需求分析
Day-130-安全架构设计
Day-131-安全编码实践Java
Day-132-安全编码实践Python
Day-133-代码审计方法论
Day-134-静态代码分析SAST
Day-135-动态应用测试DAST
Day-136-交互式测试IAST
Day-137-软件成分分析SCA
Day-138-依赖漏洞管理
Day-139-安全测试自动化
Day-140-漏洞管理与响应
Day-141-应用安全总结与展望
Day-142-OWASP-Top10-2024 详解
Day-143-CWE-Top25 分析
Day-144-漏洞挖掘方法论
Day-145-模糊测试技术
Day-146-逆向工程基础
Day-147-漏洞利用开发基础
Day-148-漏洞复现与验证
Day-149-漏洞披露流程
Day-150-CVE 申请与管理
Day-151-漏洞赏金计划
Day-152-等保2.0详解
Day-153-GDPR 合规实践
Day-154-数据安全法解读
Day-155-个人信息保护法与合规指南
Day-156-个人信息保护法解读
Day-157-ISO-27001 信息安全管理体系
Day-158-SOC-2 合规与审计
Day-159-PCI-DSS 支付卡行业数据安全标准
Day-160-网络安全审查办法解读
Day-161-数据出境安全评估办法
Day-162-应用安全评估实战
Day-163-红蓝对抗演练
Day-164-安全应急响应
Day-165-安全运营中心建设
Day-166-应用安全总结与展望
05-密码学
Day-167-密码学基础
Day-168-对称加密算法详解
Day-169-非对称加密算法详解
Day-170-哈希函数与数字签名
Day-171-密钥管理与PKI
Day-172-TLS-SSL 协议详解
Day-173-国密算法详解
Day-174-认证与密钥协议
Day-175-随机数生成与熵源
Day-176-椭圆曲线密码学详解
Day-177-后量子密码学详解
Day-178-高级密码学主题
Day-179-密码学行业应用精选
Day-180-常用加密算法原理与实现
Day-181-密码学总结与展望
Day-182-密码学系列总结与展望
06-渗透测试
Day-183-渗透测试方法论
Day-184-信息收集技术详解
Day-185-漏洞扫描技术详解
Day-186-漏洞利用技术详解
Day-187-渗透测试中的漏洞利用框架
Day-188-漏洞利用框架与 Metasploit 深入
Day-189-渗透测试中的 WAF 绕过技术
Day-190-渗透测试中的模糊测试技术
Day-191-渗透测试中的代码审计与静态分析
Day-192-渗透测试中的密码哈希破解技术
Day-193-渗透测试报告编写指南
Day-194-Web 应用渗透测试
Day-195-渗透测试中的 API 安全测试
Day-196-渗透测试中的 GraphQL 安全测试
Day-197-渗透测试中的前后端分离应用测试
Day-198-渗透测试中的小程序安全测试
Day-199-渗透测试中的浏览器安全测试
Day-200-OAuth-SSO安全测试
Day-201-渗透测试中的业务逻辑漏洞测试
Day-202-渗透测试中的厚客户端安全测试
Day-203-渗透测试综合实战演练
Day-204-内网渗透技术详解
Day-205-渗透测试中的内网信息收集进阶
Day-206-渗透测试中的域森林渗透技术
Day-207-渗透测试中的权限维持技术
Day-208-渗透测试中的横向移动技术
Day-209-渗透测试中的痕迹清理与反取证技术
Day-210-渗透测试中的数据窃取与 Exfiltration 技术
Day-211-渗透测试中的内部威胁与数据泄露测试
Day-212-渗透测试中的物理安全渗透
Day-213-社会工程学攻击技术
Day-214-移动应用渗透测试
Day-215-云安全渗透测试
Day-216-渗透测试中的容器与 Kubernetes 安全渗透
Day-217-渗透测试中的 Serverless 安全测试
Day-218-渗透测试中的微服务安全测试
Day-219-物联网安全渗透测试
Day-220-工业控制系统安全渗透测试
Day-221-无线网络安全渗透测试
Day-222-数据库安全渗透测试
Day-223-渗透测试中的供应链安全测试
Day-224-红队演练技术详解
Day-225-渗透测试中的红队基础设施搭建
Day-226-渗透测试中的威胁情报与狩猎
Day-227-渗透测试中的综合指纹识别技术
Day-228-自动化渗透测试技术
Day-229-渗透测试中的运维安全测试
Day-230-渗透测试中的区块链与智能合约安全测试
Day-231-渗透测试中的漏洞管理与修复验证
Day-232-渗透测试法律与合规
Day-233-后渗透攻击技术详解
Day-234-渗透测试中的人工智能应用
Day-235-漏洞利用开发深入
Day-236-云原生渗透测试深入
07-应急响应
Day-237-应急响应概述与核心概念
Day-238-应急响应流程框架
Day-239-CSIRT 团队组建与职责分工
Day-240-应急响应工具包准备
Day-241-应急响应法律与合规要求
Day-242-安全事件检测方法与指标
Day-243-云原生应急响应
Day-244-日志收集与分析技术
Day-245-网络流量分析与异常识别
Day-246-自动化响应与 SOAR
Day-247-端点监控与 EDR 技术
Day-248-威胁狩猎方法论
Day-249-威胁情报在检测中的应用
Day-250-数字取证基础与证据链管理
Day-251-内存取证技术
Day-252-磁盘取证与文件恢复
Day-253-网络取证与数据包分析
Day-254-云环境与容器取证
Day-255-恶意代码静态分析技术
Day-256-恶意代码动态分析技术
Day-257-恶意代码行为分析方法
Day-258-逆向工程基础与工具
Day-259-沙箱技术与自动化分析
Day-260-事件隔离与遏制策略
Day-261-威胁根除与系统修复
Day-262-系统恢复与数据重建
Day-263-业务连续性计划
Day-264-事件复盘与经验总结
Day-265-APT 攻击事件复盘分析
Day-266-勒索软件事件响应实战
Day-267-数据泄露事件处置流程
Day-268-内部威胁调查与取证
Day-269-综合应急响应演练
08-安全运维
Day-270-安全运营中心 SOC 概述
Day-271-安全监控指标体系
Day-272-安全告警管理
Day-273-安全可视化与仪表盘
Day-274-监控工具选型
Day-275-日志采集技术
Day-276-日志标准化与解析
Day-277-日志存储与归档
Day-278-日志分析技术
Day-279-日志合规要求
Day-280-SIEM 架构与设计
Day-281-关联规则引擎
Day-282-高级关联分析
Day-283-UEBA 用户实体行为分析
Day-284-威胁狩猎
Day-285-SOAR 基础概念
Day-286-剧本设计
Day-287-自动化响应技术
Day-288-安全工具集成
Day-289-SOAR 度量与优化
Day-290-安全基线管理
Day-291-漏洞管理流程
Day-292-补丁管理策略
Day-293-变更安全管理
Day-294-合规审计技术
Day-295-7x24 安全运营
Day-296-安全事件管理流程
Day-297-安全运营度量体系
Day-298-持续改进机制
Day-299-安全运维综合演练
Day-300-云原生安全运营
Day-301-AI 与机器学习安全运营
Day-302-安全自动化脚本实战
09-移动安全
Day-303-移动安全威胁概述
Day-304-移动设备安全架构
Day-305-移动操作系统安全模型
Day-306-移动应用权限管理
Day-307-移动端数据加密
Day-308-330-Android 安全合集
Day-309-Android 安全架构
Day-310-Android 组件安全
Day-311-Android 权限与隐私
Day-312-Android 逆向工程
Day-313-Android 应用加固
Day-314-iOS 安全架构
Day-315-iOS 应用沙盒机制
Day-316-越狱与反越狱
Day-317-iOS 逆向工程
Day-318-iOS 企业分发安全
Day-319-移动安全开发生命周期
Day-320-移动应用安全测试
Day-321-移动应用加固技术
Day-322-移动威胁防护
Day-323-移动安全合规
10-云安全
Day-324-云计算安全模型
Day-325-责任共担模型
Day-326-云安全威胁模型
Day-327-云安全合规框架
Day-328-云安全架构设计
Day-329-AWS IAM 安全
Day-330-AWS 网络安全
Day-331-AWS 存储安全
Day-332-AWS 安全监控
Day-333-AWS 安全最佳实践
Day-334-Azure AD 安全
Day-335-Azure 网络安全
Day-336-Azure 存储安全
Day-337-Azure 安全中心
Day-338-Azure 安全最佳实践
Day-339-容器安全基础
Day-340-Kubernetes 安全
Day-341-Serverless 安全
Day-342-云原生 DevSecOps
Day-343-云安全态势管理 CSPM
11-物联网工控
Day-344-物联网安全概述
Day-345-IoT 通信协议安全
Day-346-IoT 设备安全
Day-347-IoT 平台安全
Day-348-IoT 应用安全
Day-349-工业控制系统概述
Day-350-工控协议安全
Day-351-PLC 安全
Day-352-SCADA 系统安全
Day-353-工控安全防护
12-综合与总结
Day-354-安全职业发展路径
Day-355-安全技术趋势展望
Day-356-安全建设方法论
Day-357-经典攻防案例复盘
Day-358-安全学习资源指南
Day-359-信息安全行业求职指南
-
+
首页
Day-184-信息收集技术详解
# Day 212: 信息收集技术详解 > 渗透测试系列第 2 天 | 预计阅读时间:60 分钟 | 难度:★★★★☆ --- ## 清单 目录 1. [信息收集概述](#信息收集概述) 2. [信息收集的重要性](#信息收集的重要性) 3. [被动信息收集](#被动信息收集) 4. [主动信息收集](#主动信息收集) 5. [OSINT 开源情报](#osint 开源情报) 6. [域名与子域名枚举](#域名与子域名枚举) 7. [端口与服务扫描](#端口与服务扫描) 8. [Web 应用信息收集](#web 应用信息收集) 9. [社会工程学信息收集](#社会工程学信息收集) 10. [信息收集自动化框架](#信息收集自动化框架) 11. [实战案例:目标公司全面侦察](#实战案例目标公司全面侦察) 12. [信息收集最佳实践](#信息收集最佳实践) 13. [总结与思考](#总结与思考) 14. [参考资料](#参考资料) --- ## 信息收集概述 ### 什么是信息收集 信息收集(Reconnaissance),又称侦察,是渗透测试的第一个关键阶段。它的目标是尽可能多地收集目标系统、网络和人员的相关信息,为后续的漏洞分析和漏洞利用奠定基础。 **信息收集的核心定义**: ``` ┌─────────────────────────────────────────────────────────────┐ │ 信息收集定义 │ ├─────────────────────────────────────────────────────────────┤ │ │ │ 信息收集 = 被动收集 + 主动收集 + 情报分析 │ │ │ │ 关键要素: │ │ 1. 被动收集(Passive Collection) │ │ - 不直接接触目标系统 │ │ - 不留下访问痕迹 │ │ - 使用公开资源 │ │ - 风险:低 │ │ │ │ 2. 主动收集(Active Collection) │ │ - 直接与目标系统交互 │ │ - 可能留下日志记录 │ │ - 使用扫描工具 │ │ - 风险:中/高 │ │ │ │ 3. 情报分析(Intelligence Analysis) │ │ - 整理收集的信息 │ │ - 识别关键资产 │ │ - 发现攻击面 │ │ - 制定攻击策略 │ │ │ └─────────────────────────────────────────────────────────────┘ ``` ### 信息收集分类 **按收集方式分类**: ``` ┌─────────────────────────────────────────────────────────────┐ │ 信息收集分类 │ ├─────────────────────────────────────────────────────────────┤ │ │ │ 被动信息收集(Passive Reconnaissance) │ │ ├── 定义:不直接接触目标系统 │ │ ├── 特点:隐蔽、安全、合法 │ │ ├── 方法: │ │ │ ├── 搜索引擎查询(Google、Bing) │ │ │ ├── WHOIS 查询 │ │ │ ├── DNS 记录查询 │ │ │ ├── 社交媒体分析 │ │ │ ├── 网络空间测绘(Shodan、Censys) │ │ │ └── 公开文档/代码仓库 │ │ └── 适用:项目初期、隐蔽测试 │ │ │ │ 主动信息收集(Active Reconnaissance) │ │ ├── 定义:直接与目标系统交互 │ │ ├── 特点:准确、详细、可能被发现 │ │ ├── 方法: │ │ │ ├── 端口扫描(Nmap、Masscan) │ │ │ ├── 服务识别 │ │ │ ├── 漏洞扫描 │ │ │ ├── Web 应用扫描 │ │ │ └── 网络拓扑发现 │ │ └── 适用:获得授权后、深度测试 │ │ │ └─────────────────────────────────────────────────────────────┘ ``` **按信息类型分类**: | 信息类型 | 内容 | 用途 | |----------|------|------| | **网络信息** | IP 地址段、AS 号、网络拓扑 | 确定攻击范围 | | **域名信息** | 域名、子域名、DNS 记录 | 发现攻击入口 | | **主机信息** | 操作系统、开放端口、运行服务 | 识别漏洞目标 | | **应用信息** | Web 框架、CMS、API 接口 | 应用层攻击 | | **人员信息** | 员工姓名、邮箱、职位 | 社会工程学 | | **技术信息** | 技术栈、开发框架、云服务商 | 针对性攻击 | | **敏感信息** | 密码、密钥、配置文件 | 直接利用 | --- ## 信息收集的重要性 ### 为什么信息收集至关重要 根据我的经验,信息收集的质量直接决定渗透测试的成败: ``` ┌─────────────────────────────────────────────────────────────┐ │ 信息收集的重要性 │ ├─────────────────────────────────────────────────────────────┤ │ │ │ 1. 发现攻击面(Attack Surface Discovery) │ │ - 识别所有可能的入口点 │ │ - 发现隐藏的资产(影子 IT) │ │ - 评估攻击复杂度 │ │ │ │ 2. 降低测试风险(Risk Reduction) │ │ - 避免测试关键业务系统 │ │ - 识别可能引起故障的敏感设备 │ │ - 规划安全测试路径 │ │ │ │ 3. 提高测试效率(Efficiency Improvement) │ │ - 精准定位高价值目标 │ │ - 减少盲目扫描时间 │ │ - 制定针对性测试策略 │ │ │ │ 4. 发现深层漏洞(Deep Vulnerability Discovery) │ │ - 关联多个低危信息发现高危漏洞 │ │ - 发现业务逻辑漏洞 │ │ - 识别供应链攻击机会 │ │ │ │ 5. 模拟真实攻击(Realistic Attack Simulation) │ │ - 攻击者也会进行信息收集 │ │ - 评估防御方的侦察检测能力 │ │ - 测试威胁情报有效性 │ │ │ └─────────────────────────────────────────────────────────────┘ ``` ### 信息收集时间分配 我建议将渗透测试时间的 **20-30%** 用于信息收集: ``` ┌─────────────────────────────────────────────────────────────┐ │ 渗透测试时间分配建议 │ ├─────────────────────────────────────────────────────────────┤ │ │ │ 5 天渗透测试项目: │ │ │ │ 信息收集:1-1.5 天(20-30%) │ │ ├── 被动收集:4-6 小时 │ │ └── 主动收集:4-6 小时 │ │ │ │ 漏洞扫描:0.5-1 天(10-20%) │ │ │ │ 漏洞利用:1.5-2 天(30-40%) │ │ │ │ 后渗透:0.5-1 天(10-20%) │ │ │ │ 报告编写:0.5-1 天(10-20%) │ │ │ └─────────────────────────────────────────────────────────────┘ ``` **我的经验**:信息收集投入越多,后续漏洞发现越容易。不要急于开始扫描,充分的情报收集往往能发现意想不到的攻击路径。 --- ## 被动信息收集 ### 搜索引擎侦察 搜索引擎是信息收集的起点,使用高级搜索语法可以发现大量敏感信息。 **Google Hacking 语法**: | 语法 | 说明 | 示例 | |------|------|------| | `site:` | 限定域名 | `site:target.com` | | `intitle:` | 标题包含 | `intitle:"admin login"` | | `inurl:` | URL 包含 | `inurl:admin.php` | | `intext:` | 正文包含 | `intext:"password"` | | `filetype:` | 文件类型 | `filetype:pdf confidential` | | `ext:` | 文件扩展名 | `ext:sql database` | | `cache:` | 查看缓存 | `cache:target.com` | | `related:` | 相关网站 | `related:target.com` | | `link:` | 反向链接 | `link:target.com` | | `info:` | 站点信息 | `info:target.com` | **组合搜索示例**: ```bash # 查找目标网站的敏感文件 site:target.com filetype:sql OR filetype:db OR filetype:backup # 查找登录页面 site:target.com intitle:"login" OR intitle:"sign in" # 查找目录列表 site:target.com intitle:"index of" OR intitle:"directory listing" # 查找配置文件 site:target.com ext:xml OR ext:conf OR ext:ini OR ext:env # 查找公开文档 site:target.com filetype:pdf OR filetype:doc OR filetype:xls # 查找错误页面(可能泄露信息) site:target.com intext:"error" OR intext:"exception" OR intext:"stack trace" # 查找子域名 site:*.target.com -www # 查找 GitHub 上的敏感信息 site:github.com "target.com" password OR secret OR api_key ``` **Google Dorks 数据库**: 我推荐使用以下资源获取 Google Hacking 语法: - **GHDB**(Google Hacking Database):https://www.exploit-db.com/google-hacking-database - **Google Hacking for Penetration Testers** 书籍 ### WHOIS 查询 WHOIS 查询可以获取域名注册信息,包括注册人、联系方式、DNS 服务器等。 **在线 WHOIS 工具**: | 工具 | 网址 | 特点 | |------|------|------| | ICANN WHOIS | https://lookup.icann.org | 官方权威 | | Whois.com | https://www.whois.com | 界面友好 | | DomainTools | https://whois.domaintools.com | 历史记录 | | 阿里云 WHOIS | https://whois.aliyun.com | 国内域名 | **命令行 WHOIS**: ```bash # 基础 WHOIS 查询 $ whois target.com # 查询结果示例 Domain Name: TARGET.COM Registry Domain ID: 123456789_DOMAIN_COM-VRSN Registrar WHOIS Server: whois.registrar.com Registrar URL: http://www.registrar.com Updated Date: 2024-01-15T10:00:00Z Creation Date: 2010-01-15T10:00:00Z Registry Expiry Date: 2025-01-15T10:00:00Z Registrar: Example Registrar, LLC Registrar IANA ID: 1234 Registrar Abuse Contact Email: abuse@registrar.com Registrar Abuse Contact Phone: +1.1234567890 Domain Status: clientTransferProhibited Name Server: NS1.TARGET.COM Name Server: NS2.TARGET.COM DNSSEC: unsigned # 查询 IP 段 WHOIS $ whois 203.0.113.0 # 查询 AS 号信息 $ whois -h whois.radb.net -- '-i origin AS12345' ``` **WHOIS 信息利用**: ``` ┌─────────────────────────────────────────────────────────────┐ │ WHOIS 信息利用 │ ├─────────────────────────────────────────────────────────────┤ │ │ │ 注册人信息 │ │ ├── 姓名/组织名称 → 社会工程学目标 │ │ ├── 邮箱地址 → 钓鱼攻击、密码重置 │ │ ├── 电话号码 → 语音钓鱼、短信攻击 │ │ └── 地址 → 物理安全测试 │ │ │ │ 技术信息 │ │ ├── DNS 服务器 → 发现其他域名 │ │ ├── 注册日期 → 评估域名价值 │ │ └── 过期日期 → 域名劫持机会 │ │ │ │ 关联域名 │ │ ├── 同一注册人的其他域名 │ │ ├── 同一 DNS 服务器的域名 │ │ └── 同一 IP 段的域名 │ │ │ └─────────────────────────────────────────────────────────────┘ ``` ### DNS 信息收集 DNS 记录包含丰富的目标信息,是信息收集的重点。 **DNS 记录类型**: | 记录类型 | 用途 | 示例 | |----------|------|------| | **A** | 域名→IPv4 | `www.target.com → 203.0.113.10` | | **AAAA** | 域名→IPv6 | `www.target.com → 2001:db8::1` | | **CNAME** | 别名记录 | `blog.target.com → www.target.com` | | **MX** | 邮件服务器 | `target.com → mail.target.com` | | **NS** | 域名服务器 | `target.com → ns1.target.com` | | **TXT** | 文本记录 | SPF、DKIM、验证记录 | | **SOA** | 起始授权 | 区域管理信息 | | **PTR** | 反向解析 | `203.0.113.10 → www.target.com` | | **SRV** | 服务记录 | 服务发现 | | **CAA** | 证书授权 | SSL 证书限制 | **DNS 查询工具**: ```bash # dig 查询(推荐) $ dig target.com $ dig target.com ANY $ dig target.com MX $ dig target.com NS $ dig target.com TXT # nslookup 查询 $ nslookup target.com $ nslookup -type=MX target.com # host 查询 $ host target.com $ host -a target.com # 批量查询 $ for record in A AAAA MX NS TXT SOA; do dig target.com $record; done ``` **DNS 枚举工具**: | 工具 | 用途 | 命令示例 | |------|------|----------| | **dnsrecon** | DNS 枚举 | `dnsrecon -d target.com` | | **dnsenum** | DNS 枚举 | `dnsenum target.com` | | **fierce** | DNS 侦察 | `fierce -domain target.com` | | **sublist3r** | 子域名枚举 | `python3 sublist3r.py -d target.com` | --- ## 主动信息收集 ### 端口扫描 端口扫描是主动信息收集的核心,用于发现目标开放的端口和运行的服务。 **Nmap 扫描类型**: ```bash # TCP SYN 扫描(半开放,最常用) $ nmap -sS target.com # TCP Connect 扫描(全连接) $ nmap -sT target.com # UDP 扫描(慢但必要) $ nmap -sU target.com # 版本检测 $ nmap -sV target.com # 操作系统检测 $ nmap -O target.com # 脚本扫描 $ nmap -sC target.com # 综合扫描(推荐) $ nmap -sS -sV -O -sC target.com # 全端口扫描 $ nmap -p- target.com # 快速扫描 $ nmap -F target.com # 指定端口范围 $ nmap -p 1-1000 target.com $ nmap -p 80,443,8080,8443 target.com # 扫描整个网段 $ nmap -sS 203.0.113.0/24 # 避免防火墙检测(慢速扫描) $ nmap -sS -T1 target.com # 随机化扫描顺序 $ nmap -sS --randomize-hosts target.com ``` **Nmap 输出格式**: ```bash # 正常输出 $ nmap -oN output.txt target.com # XML 输出(便于解析) $ nmap -oX output.xml target.com # Grep 输出(便于处理) $ nmap -oG output.gnmap target.com # 所有格式 $ nmap -oA output target.com ``` **端口状态解读**: | 状态 | 说明 | 含义 | |------|------|------| | **open** | 开放 | 有服务监听,可连接 | | **closed** | 关闭 | 端口可访问但无服务 | | **filtered** | 过滤 | 防火墙阻止,无法确定 | | **unfiltered** | 未过滤 | 可访问但状态未知 | | **open|filtered** | 开放或过滤 | 无法确定具体状态 | | **closed|filtered** | 关闭或过滤 | 无法确定具体状态 | **常见端口与服务**: | 端口 | 服务 | 风险等级 | |------|------|----------| | 21 | FTP | 高危(明文传输) | | 22 | SSH | 中危(需弱密码检测) | | 23 | Telnet | 高危(明文) | | 25 | SMTP | 中危(开放中继) | | 53 | DNS | 中危(区域传输) | | 80 | HTTP | 中危(Web 漏洞) | | 110 | POP3 | 中危(明文) | | 139/445 | SMB | 高危(永恒之蓝) | | 443 | HTTPS | 中危(SSL 配置) | | 1433 | MSSQL | 高危(SA 弱密码) | | 1521 | Oracle | 高危(弱密码) | | 3306 | MySQL | 高危(弱密码) | | 3389 | RDP | 高危(弱密码/蓝屏) | | 5432 | PostgreSQL | 高危(弱密码) | | 6379 | Redis | 高危(未授权访问) | | 27017 | MongoDB | 高危(未授权访问) | ### 服务识别 发现开放端口后,需要进一步识别运行的服务及其版本。 **Nmap 版本检测**: ```bash # 基础版本检测 $ nmap -sV target.com # 强度检测(0-9,9 最强) $ nmap -sV --version-intensity 9 target.com # 所有探针 $ nmap -sV --version-all target.com # 指定端口 $ nmap -sV -p 80,443 target.com ``` **服务指纹分析**: ```bash # 获取服务 banner $ nc -v target.com 80 GET / HTTP/1.0 # SSL 服务 $ openssl s_client -connect target.com:443 # 获取 HTTP 头信息 $ curl -I https://target.com # 获取 SSH banner $ nc target.com 22 ``` **版本信息利用**: ``` ┌─────────────────────────────────────────────────────────────┐ │ 版本信息利用 │ ├─────────────────────────────────────────────────────────────┤ │ │ │ 1. CVE 匹配 │ │ - 使用 searchsploit 搜索已知漏洞 │ │ - 查询 NVD 数据库 │ │ - 检查厂商安全公告 │ │ │ │ 2. 配置分析 │ │ - 识别弱加密算法 │ │ - 发现默认配置 │ │ - 检查安全头缺失 │ │ │ │ 3. 漏洞验证 │ │ - 使用 Metasploit 验证漏洞 │ │ - 使用 PoC 代码测试 │ │ - 手动验证漏洞 │ │ │ └─────────────────────────────────────────────────────────────┘ ``` ### 漏洞扫描 在端口和服务识别基础上,进行漏洞扫描。 **Nessus 扫描**: ```bash # Nessus 命令行(需要授权) $ /opt/nessus/bin/nessuscli scan launch --policy "Basic Network Scan" --targets target.com # 通过 API 启动扫描 $ curl -X POST \ -H "X-Cookie: token=YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{"uuid":"policy-uuid","targets":"target.com"}' \ https://localhost:8834/scans ``` **OpenVAS 扫描**: ```bash # 使用 gvm-tools $ gvm-cli --gmp-username admin --gmp-password password socket \ --xml "<create_target><name>target</name><hosts>target.com</hosts></create_target>" ``` **Nuclei 扫描**(推荐): ```bash # 基础扫描 $ nuclei -u https://target.com # 使用特定模板 $ nuclei -u https://target.com -t exposures/ -t vulnerabilities/ # 严重程度过滤 $ nuclei -u https://target.com -s critical,high # 输出报告 $ nuclei -u https://target.com -o report.txt # 并发扫描 $ nuclei -u https://target.com -c 50 ``` --- ## OSINT 开源情报 ### 网络空间测绘 网络空间搜索引擎可以发现暴露在互联网上的设备和系统。 **Shodan**: ```bash # 搜索特定组织 $ shodan search "org:Target Company" # 搜索特定产品 $ shodan search "product:Apache" "org:Target Company" # 搜索特定端口 $ shodan search "port:22" "org:Target Company" # 搜索特定国家 $ shodan search "country:CN" "org:Target Company" # 搜索摄像头 $ shodan search "webcamxp" "org:Target Company" # 搜索数据库 $ shodan search "product:MongoDB" "org:Target Company" # 搜索工业控制系统 $ shodan search "port:502" "org:Target Company" # Modbus # 使用 Shodan CLI $ shodan init YOUR_API_KEY $ shodan host 203.0.113.10 $ shodan domain target.com ``` **Censys**: ```bash # 搜索 IPv4 $ censys search "services.port: 443 and ip: 203.0.113.0/24" # 搜索证书 $ censys search "services.tls.certificates.leaf_data.subject.common_name: target.com" # 搜索域名 $ censys search "services.dns.resolved_names: target.com" ``` **FOFA**(中国): ```bash # 搜索域名 $ fofa search "domain='target.com'" # 搜索 IP $ fofa search "ip='203.0.113.10'" # 搜索标题 $ fofa search "title='login' && domain='target.com'" # 搜索 body $ fofa search "body='target company' && country='CN'" # 搜索端口 $ fofa search "port='6379' && country='CN'" # Redis ``` **ZoomEye**(中国): ```bash # 搜索组件 $ zoomeye search "app:Apache" # 搜索设备 $ zoomeye search "device:router" # 搜索服务 $ zoomeye search "service:ssh" ``` ### 代码仓库信息收集 开发者经常在代码仓库中泄露敏感信息。 **GitHub 搜索**: ```bash # 搜索组织代码 site:github.com "target.com" # 搜索敏感文件 site:github.com "target.com" filename:config OR filename:settings # 搜索密码/密钥 site:github.com "target.com" password OR secret OR api_key # 搜索数据库配置 site:github.com "target.com" "DB_PASSWORD" OR "DATABASE_URL" # 搜索 AWS 密钥 site:github.com "target.com" "AKIA" OR "aws_access_key" # 搜索私有仓库(通过其他途径) site:gitlab.com "target.com" site:bitbucket.org "target.com" ``` **GitHub 侦察工具**: ```bash # GitLeaks - 扫描敏感信息 $ git clone https://github.com/target/repo.git $ gitleaks detect --source ./repo -v # TruffleHog - 扫描提交历史 $ trufflehog git file://./repo --branch main --since-commit HEAD --no-update # GitHub API 查询 $ curl -H "Authorization: token YOUR_TOKEN" \ https://api.github.com/search/code?q="target.com"+password ``` ### 社交媒体信息收集 **LinkedIn 侦察**: ``` 目标:获取员工信息、技术栈、组织架构 收集内容: - 员工姓名、职位、邮箱格式 - 使用的技术/工具 - 组织架构 - 近期动态(并购、扩张) 工具: - theHarvester - LinkedInt - ScrapedIn(需注意合规) ``` **Twitter/X 侦察**: ``` 目标:获取实时信息、技术讨论、员工动态 搜索语法: - from:@target_company - 官方账号 - "target.com" - 提及域名 - "working at target" - 员工提及 - filter:links "target.com" - 分享链接 ``` ### 文档元数据收集 公开文档中可能包含敏感元数据。 **元数据提取**: ```bash # 使用 exiftool $ exiftool document.pdf # 提取所有 PDF 元数据 $ exiftool -all document.pdf # 批量提取 $ exiftool -r -all ./documents/ # 搜索特定字段 $ exiftool -Author -Creator -Producer document.pdf ``` **常见泄露信息**: | 元数据字段 | 可能泄露的信息 | |------------|----------------| | Author | 内部员工姓名 | | Company | 公司内部名称 | | Last Modified By | 编辑者信息 | | Create Date | 文档创建时间 | | Software | 使用的软件版本 | | IP Address | 内网 IP 地址 | | Printer Name | 内网打印机名称 | | File Path | 内部文件路径 | --- ## 域名与子域名枚举 ### 子域名发现方法 **证书透明度日志**: ```bash # crt.sh 查询 $ curl -s "https://crt.sh/?q=%.target.com&output=json" | jq -r '.[].name_value' | sort -u # 使用 certspotter $ curl -s "https://api.certspotter.com/v1/issuances?domain=target.com&include_subdomains=true&expand=dns_names" | jq -r '.[].dns_names[]' # 使用 subfinder $ subfinder -d target.com ``` **DNS 暴力破解**: ```bash # 使用 gobuster $ gobuster dns -d target.com -w /usr/share/wordlists/subdomains.txt # 使用 dnsrecon $ dnsrecon -d target.com -D /usr/share/wordlists/subdomains.txt -t brt # 使用 fierce $ fierce -domain target.com -wordlist /usr/share/wordlists/subdomains.txt # 使用 massdns $ massdns -r resolvers.txt -t A -o S subdomains.txt > results.txt ``` **在线子域名工具**: | 工具 | 网址 | 特点 | |------|------|------| | Sublist3r | GitHub | Python 脚本,多引擎 | | Subfinder | ProjectDiscovery | 快速,多源 | | Amass | OWASP | 最全面,较慢 | | Assetnote | https://dnsdumpster.com | 在线工具 | | VirusTotal | https://virustotal.com | 被动收集 | **综合子域名枚举脚本**: ```bash #!/bin/bash # 子域名枚举综合脚本 DOMAIN=$1 OUTPUT="subdomains_${DOMAIN}.txt" echo "[*] 开始子域名枚举:$DOMAIN" # crt.sh echo "[+] 查询 crt.sh..." curl -s "https://crt.sh/?q=%.${DOMAIN}&output=json" | \ jq -r '.[].name_value' | sort -u >> $OUTPUT # Subfinder echo "[+] 运行 Subfinder..." subfinder -d $DOMAIN -o subfinder_${DOMAIN}.txt cat subfinder_${DOMAIN}.txt >> $OUTPUT # Amass(被动模式) echo "[+] 运行 Amass..." amass enum -passive -d $DOMAIN -o amass_${DOMAIN}.txt cat amass_${DOMAIN}.txt >> $OUTPUT # 去重 echo "[+] 去重..." sort -u $OUTPUT -o $OUTPUT # 验证 echo "[+] 验证活跃子域名..." cat $OUTPUT | httpx -silent -o active_${OUTPUT} echo "[*] 完成!结果保存在:$OUTPUT" echo "[*] 活跃子域名:active_${OUTPUT}" ``` ### 域名关联分析 **反向 WHOIS**: ```bash # 通过注册人邮箱查找关联域名 $ whoisxmlapi.com reverse-whois?searchType=current&mode=PREVIEW&keyword=email@example.com # 通过注册人姓名查找 $ domainbigdata.com reverse-whois?name=John%20Doe ``` **同一 DNS 服务器**: ```bash # 查找使用相同 NS 的域名 $ dig NS target.com $ # 然后搜索使用该 NS 的其他域名 ``` **同一 IP 段**: ```bash # 查找同一 C 段的其他域名 $ whois 203.0.113.10 $ # 获取网段信息后扫描 $ nmap -sS 203.0.113.0/24 ``` --- ## Web 应用信息收集 ### Web 技术栈识别 **Wappalyzer**(浏览器扩展/CLI): ```bash # 使用 wappalyzer CLI $ wappalyzer https://target.com # 输出示例 { "url": "https://target.com", "technologies": [ {"name": "Apache", "version": "2.4.41"}, {"name": "PHP", "version": "7.4.3"}, {"name": "WordPress", "version": "5.8.1"}, {"name": "MySQL", "version": null}, {"name": "jQuery", "version": "3.6.0"} ] } ``` **WhatWeb**: ```bash # 基础识别 $ whatweb target.com # 详细输出 $ whatweb -v target.com # 识别插件 $ whatweb --plugins=target.com # 批量扫描 $ whatweb -i targets.txt -o results.json ``` **BuiltWith**: ```bash # 在线查询 https://builtwith.com/target.com # API 查询 $ curl "https://api.builtwith.com/free1/api.json?KEY=YOUR_KEY&LOOKUP=target.com" ``` ### 目录与文件枚举 **Gobuster**: ```bash # 目录扫描 $ gobuster dir -u https://target.com -w /usr/share/wordlists/dirb/common.txt # 指定扩展名 $ gobuster dir -u https://target.com -w /usr/share/wordlists/dirb/common.txt -x php,txt,html # 多线程 $ gobuster dir -u https://target.com -w /usr/share/wordlists/dirb/common.txt -t 50 # 隐藏特定状态码 $ gobuster dir -u https://target.com -w /usr/share/wordlists/dirb/common.txt -b 404 # 输出结果 $ gobuster dir -u https://target.com -w /usr/share/wordlists/dirb/common.txt -o results.txt ``` **Dirb**: ```bash # 基础扫描 $ dirb https://target.com # 指定字典 $ dirb https://target.com /usr/share/wordlists/dirb/big.txt # 递归深度 $ dirb https://target.com -r 3 # 输出文件 $ dirb https://target.com -o results.txt ``` **常用字典**: | 字典 | 位置 | 用途 | |------|------|------| | dirb/common | `/usr/share/wordlists/dirb/common.txt` | 通用目录 | | dirb/big | `/usr/share/wordlists/dirb/big.txt` | 大型字典 | | SecLists | `/usr/share/wordlists/SecLists/` | 综合字典 | | raft | Burp Suite 自带 | Web 目录 | ### API 接口发现 **常见 API 路径**: ``` /api /api/v1 /api/v2 /api/v3 /v1 /v2 /graphql /graphiql /api/graphql /swagger /swagger.json /swagger-ui.html /api-docs /openapi.json /.well-known/openid-configuration ``` **API 扫描工具**: ```bash # Kiterunner $ kr scan https://target.com -l api-routes.txt # Arjun(参数发现) $ arjun -u https://target.com/api/login # Postman 收集 # 查找公开的 Postman 集合 site:github.com "target.com" postman ``` --- ## 社会工程学信息收集 ### 员工信息收集 **邮箱格式推断**: ``` 常见邮箱格式: - firstname@target.com - firstname.lastname@target.com - flastname@target.com - f_lastname@target.com - lastname@target.com 验证方法: 1. 通过已公开邮箱推断格式 2. 使用邮件验证工具 3. 尝试密码重置功能 ``` **邮箱验证工具**: ```bash # theHarvester $ theHarvester -d target.com -b google,linkedin # hunter.io $ curl "https://api.hunter.io/v2/domain-search?domain=target.com&api_key=YOUR_KEY" # email-format $ python3 email-format.py target.com ``` ### 组织架构分析 **信息收集点**: ``` ┌─────────────────────────────────────────────────────────────┐ │ 组织架构信息收集 │ ├─────────────────────────────────────────────────────────────┤ │ │ │ 高层管理人员 │ │ ├── CEO、CTO、CISO 姓名 │ │ ├── LinkedIn 资料 │ │ └── 公开演讲/采访 │ │ │ │ IT 部门 │ │ ├── IT 管理员姓名 │ │ ├── 系统管理员邮箱 │ │ └── 技术支持联系方式 │ │ │ │ 关键岗位 │ │ ├── 财务人员(钓鱼攻击目标) │ │ ├── HR 人员(简历钓鱼) │ │ └── 采购人员(供应商钓鱼) │ │ │ │ 技术栈信息 │ │ ├── 招聘信息中的技术要求 │ │ ├── 员工技术分享 │ │ └── GitHub 贡献记录 │ │ │ └─────────────────────────────────────────────────────────────┘ ``` --- ## 信息收集自动化框架 ### Recon-ng Recon-ng 是一个功能强大的侦察框架。 ```bash # 启动 Recon-ng $ recon-ng # 创建工作空间 [recon-ng][default] > workspace create target_recon # 添加目标 [recon-ng][target_recon] > db insert domains [*] Enter domain (RETURN to quit): target.com # 加载模块 [recon-ng][target_recon] > modules search subdomain [recon-ng][target_recon] > modules load recon/domains-hosts/brute_hosts # 配置模块 [recon-ng][target_recon][brute_hosts] > options set SOURCE target.com [recon-ng][target_recon][brute_hosts] > options set WORDLIST /usr/share/wordlists/subdomains.txt # 运行模块 [recon-ng][target_recon][brute_hosts] > run # 查看结果 [recon-ng][target_recon] > show hosts [recon-ng][target_recon] > show domains # 导出结果 [recon-ng][target_recon] > export hosts hosts.csv ``` ### Maltego Maltego 是图形化情报收集工具。 **使用流程**: ``` 1. 创建新图表(New Graph) 2. 添加实体(Add Entity) - Domain - IP Address - Person - Email Address - etc. 3. 运行转换(Run Transform) - DNS 查询 - WHOIS 查询 - 社交媒体搜索 - etc. 4. 分析关系图 5. 导出报告 ``` ### theHarvester ```bash # 基础使用 $ theHarvester -d target.com -b google # 多数据源 $ theHarvester -d target.com -b google,linkedin,bing # 全部数据源 $ theHarvester -d target.com -b all # 指定结果数量 $ theHarvester -d target.com -b google -l 500 # 输出文件 $ theHarvester -d target.com -b google -f target_results ``` --- ## 实战案例:目标公司全面侦察 ### 案例背景 **目标**:example-corp.com **测试类型**:灰盒渗透测试 **时间**:1 天信息收集 ### 第 1 阶段:被动收集(4 小时) **步骤 1:WHOIS 查询** ```bash $ whois example-corp.com Domain Name: EXAMPLE-CORP.COM Registrant Name: John Smith Registrant Organization: Example Corp Registrant Email: admin@example-corp.com Name Server: NS1.EXAMPLE-CORP.COM Name Server: NS2.EXAMPLE-CORP.COM ``` **发现**: - 注册人:John Smith(可能是 IT 管理员) - 联系邮箱:admin@example-corp.com - DNS 服务器:自建(可能有其他域名) **步骤 2:子域名枚举** ```bash $ subfinder -d example-corp.com [*] 发现子域名: www.example-corp.com mail.example-corp.com vpn.example-corp.com oa.example-corp.com crm.example-corp.com dev.example-corp.com test.example-corp.com git.example-corp.com jenkins.example-corp.com monitoring.example-corp.com ``` **发现**: - 开发环境暴露(dev、test) - Jenkins 暴露(常见漏洞源) - 监控系统暴露 **步骤 3:Shodan 搜索** ```bash $ shodan search "org:Example Corp" [*] 发现设备: 203.0.113.10:80 - Apache 2.4.41 (Web Server) 203.0.113.20:443 - Nginx 1.18.0 (VPN Gateway) 203.0.113.30:8080 - Jenkins 2.289.1 203.0.113.40:6379 - Redis (未授权访问!) 203.0.113.50:27017 - MongoDB (未授权访问!) ``` **关键发现**: - Redis 和 MongoDB 未授权访问(严重风险) - Jenkins 版本较旧(可能存在漏洞) **步骤 4:GitHub 搜索** ```bash $ site:github.com "example-corp.com" password [*] 发现: - 员工上传的配置文件包含数据库密码 - 测试代码包含 API 密钥 - 内部工具源码泄露 ``` ### 第 2 阶段:主动收集(4 小时) **步骤 5:Nmap 扫描** ```bash $ nmap -sS -sV -O -sC 203.0.113.0/24 203.0.113.10: 80/tcp open http Apache httpd 2.4.41 443/tcp open ssl/http Apache httpd 2.4.41 22/tcp open ssh OpenSSH 7.6p1 203.0.113.30: 8080/tcp open http Jenkins 2.289.1 22/tcp open ssh OpenSSH 7.6p1 203.0.113.40: 6379/tcp open redis Redis 5.0.7 (未授权访问) 203.0.113.50: 27017/tcp open mongodb MongoDB 4.4.6 (未授权访问) ``` **步骤 6:Web 应用扫描** ```bash # 技术栈识别 $ whatweb https://www.example-corp.com WordPress 5.8.1, PHP 7.4.3, Apache 2.4.41 # 目录扫描 $ gobuster dir -u https://www.example-corp.com -w /usr/share/wordlists/dirb/common.txt 发现: /wp-admin/ - WordPress 管理后台 /wp-content/uploads/ - 上传目录 /backup/ - 备份目录(危险!) /config.php.bak - 备份配置文件 ``` **步骤 7:漏洞验证** ```bash # 验证 Redis 未授权访问 $ redis-cli -h 203.0.113.40 203.0.113.40:6379> keys * 1) "session:user:123" 2) "cache:config:database" 3) "user:password:hash" # 验证 MongoDB 未授权访问 $ mongo 203.0.113.50:27017 > show dbs admin production_db users_db > use production_db > db.users.find() ``` ### 信息收集总结 **发现汇总**: | 类别 | 发现 | 风险等级 | |------|------|----------| | 子域名 | 10 个 | - | | 开放端口 | 15 个 | - | | 未授权访问 | Redis、MongoDB | 严重 | | 敏感文件 | config.php.bak | 高危 | | 代码泄露 | GitHub 配置文件 | 高危 | | 旧版本服务 | Jenkins 2.289.1 | 中危 | | WordPress | 5.8.1 | 中危 | **攻击路径建议**: ``` 路径 1:Redis 未授权访问 → 读取敏感数据 → 写入 SSH 密钥 → 获取服务器权限 路径 2:Jenkins 未授权 → 执行命令 → 获取服务器权限 路径 3:WordPress 漏洞 → 上传 Webshell → 获取 Web 权限 路径 4:钓鱼攻击 → 员工凭证 → VPN 访问 → 内网渗透 ``` --- ## 信息收集最佳实践 ### 工具管理 **工具清单**: ```markdown # 信息收集工具清单 ## 被动收集 - theHarvester - Subfinder - Amass - Shodan CLI - Maltego ## 主动收集 - Nmap - Masscan - Gobuster - Dirb - Nikto ## 漏洞扫描 - Nessus - OpenVAS - Nuclei ## Web 扫描 - Burp Suite - OWASP ZAP - Wappalyzer - WhatWeb ## 自动化框架 - Recon-ng - SpiderFoot - OSINT Framework ``` **工具更新**: ```bash # 每周更新 $ sudo apt update && sudo apt upgrade # Kali 工具 $ go get -u github.com/projectdiscovery/subfinder $ pip install --upgrade theHarvester # 每月检查新工具 $ git clone https://github.com/topics/osint ``` ### 信息整理 **信息分类存储**: ``` recon_target_2024/ ├── 01-passive/ │ ├── whois.txt │ ├── dns_records.txt │ ├── subdomains.txt │ ├── shodan_results.json │ └── github_findings.txt ├── 02-active/ │ ├── nmap_scan.xml │ ├── web_scans/ │ └── vulnerability_scans/ ├── 03-analysis/ │ ├── attack_surface.md │ ├── risk_assessment.md │ └── attack_paths.md └── 04-reports/ ├── executive_summary.md └── technical_report.md ``` **信息关联分析**: ```markdown # 信息关联分析模板 ## 资产清单 - 域名:X 个 - IP 地址:X 个 - 开放端口:X 个 - Web 应用:X 个 ## 高风险发现 1. [发现] - [风险等级] - [利用路径] 2. ... ## 攻击路径 1. 路径 1:A → B → C 2. 路径 2:X → Y → Z ## 优先测试目标 1. [目标] - [原因] 2. ... ``` ### 合法合规 **合规检查清单**: ``` □ 获得书面授权 □ 明确测试范围(域名、IP) □ 明确测试方法限制 □ 了解当地法律法规 □ 不测试未授权目标 □ 不进行破坏性扫描 □ 保护收集的信息 □ 测试后清理数据 ``` --- ## 总结与思考 ### 核心要点回顾 1. **信息收集是渗透测试的基础**,投入 20-30% 时间是值得的 2. **被动收集优先**,在不被发现的情况下获取尽可能多的信息 3. **工具只是辅助**,关键是要有系统性思维和关联分析能力 4. **信息整理同样重要**,杂乱的信息无法支撑有效攻击 5. **合法合规是底线**,始终在授权范围内进行测试 ### 深入思考 **问题 1:信息收集的边界在哪里?** 我的观点: - 技术边界:授权范围(域名、IP 段) - 法律边界:当地法律法规 - 道德边界:不侵犯个人隐私 - 时间边界:测试时间窗口 **问题 2:如何平衡信息收集的深度和效率?** 我建议: - 使用自动化工具进行广度收集 - 针对高价值目标进行深度分析 - 建立信息收集 SOP(标准作业程序) - 持续优化信息收集流程 **问题 3:防御方如何应对信息收集?** 防御建议: - 减少信息泄露(WHOIS 隐私、隐藏技术栈) - 监控侦察行为(IDS/IPS 告警) - 限制公开信息(员工社交媒体培训) - 定期自我侦察(发现自己的暴露面) ### 实战建议 **给新手的建议**: ``` 1. 掌握基础工具 - Nmap(端口扫描) - theHarvester(信息收集) - Gobuster(目录扫描) - Subfinder(子域名枚举) 2. 理解原理 - DNS 工作原理 - HTTP 协议 - 网络拓扑 3. 合法练习 - HackTheBox - TryHackMe - 自己搭建实验环境 4. 建立方法论 - 遵循 PTES 标准 - 创建检查清单 - 记录每次测试 ``` **给企业的建议**: ``` 1. 减少信息泄露 - WHOIS 隐私保护 - 隐藏技术栈信息 - 清理公开文档 2. 监控侦察行为 - 部署 IDS/IPS - 监控异常扫描 - 建立威胁情报 3. 定期自我评估 - 定期进行外部扫描 - 监控暗网泄露 - 进行红队演练 4. 员工培训 - 社交媒体安全意识 - 钓鱼攻击防范 - 信息保护政策 ``` --- ## 参考资料 ### 学习资源 | 资源 | 类型 | 链接 | |------|------|------| | **OSINT Framework** | 工具集合 | https://osintframework.com | | **IntelTechniques** | OSINT 指南 | https://inteltechniques.com | | **SANS SEC487** | 培训课程 | https://sans.org | | **OWASP Recon Cheat Sheet** | 速查表 | https://cheatsheetseries.owasp.org | ### 工具资源 | 工具 | 官网 | 用途 | |------|------|------| | **Recon-ng** | https://github.com/lanmaster53/recon-ng | 侦察框架 | | **Maltego** | https://maltego.com | 情报分析 | | **theHarvester** | https://github.com/laramies/theHarvester | 信息收集 | | **Subfinder** | https://github.com/projectdiscovery/subfinder | 子域名枚举 | | **Amass** | https://github.com/OWASP/Amass | 攻击面映射 | | **Shodan** | https://shodan.io | 网络空间搜索 | | **Nmap** | https://nmap.org | 端口扫描 | ### 书籍推荐 | 书名 | 作者 | 难度 | |------|------|------| | 《Open Source Intelligence Techniques》 | Michael Bazzell | 入门 | | 《The Art of Intelligence》 | Henry S. Kenyon | 进阶 | | 《Reconnaissance in Cybersecurity》 | various | 实战 | ### 实践平台 | 平台 | 类型 | 链接 | |------|------|------| | **HackTheBox** | 在线实验室 | https://hackthebox.com | | **TryHackMe** | 在线学习 | https://tryhackme.com | | **IntelTechniques OSINT Course** | 免费课程 | https://inteltechniques.com/blog | --- *365 天信息安全技术系列 | Day 212 | 信息收集技术详解 | 字数:约 20,000 字*
myh0st
2026年4月13日 23:20
分享文档
收藏文档
上一篇
下一篇
微信扫一扫
复制链接
手机扫一扫进行分享
复制链接
Markdown文件
分享
链接
类型
密码
更新密码