上一篇文章中,我们用google语法搜索了Github上的该公司的员工信息
site:github.com "megacorpone.com"找到网页 https://github.com/megacorpone
找到文件megacorpone/xampp.users 发现疑似密码字段
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC0密码破解与爆破
🔍 一、哈希结构分析
加密字符串格式为:trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC0
$apr1$:标识 Apache 特定的 MD5 算法变种(加盐迭代)**
A0vSKwao**:8字符盐值(Salt)**
GV3sgGAj...**:实际哈希值
⚙️ 二、Kali 破解方法
方法 1:John the Ripper(推荐)
步骤:
创建哈希文件
hash.txt,内容为:trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC0启动破解(自动识别
apr1格式):john --format=md5crypt-long hash.txt# 或显式指定格式john --format=apr1 hash.txt使用字典加速(如 Kali 内置
rockyou.txt):john --wordlist=/usr/share/wordlists/rockyou.txt hash.txtimage-20250530094321163 查看结果:
john --show hash.txt# 输出示例:trivera:password123
爆破得到密码trivera:Tanya4life可能是ssh登录的。
方法 2:Hashcat(GPU 加速)
提取哈希部分(移除用户名和盐标识):
echo'$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC0' > hash.txt启动破解(
-m 1600对应apr1模式):hashcat -m 1600 -a 0 hash.txt /usr/share/wordlists/rockyou.txt查看结果:
hashcat --show -m 1600 hash.txt
⚡ 三、性能优化技巧
字典选择:
优先使用
rockyou.txt(需解压):sudo gzip -d /usr/share/wordlists/rockyou.txt.gz自定义字典:结合目标信息生成(如公司名、日期等)
规则扩展: 在 Hashcat 中使用规则增强字典覆盖:
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC00暴力破解(最后手段):
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC01⚠️ 四、注意事项
合法性:仅限破解自有或授权数据!
成功率:
简单密码(如 password123)可能在几分钟内破解复杂密码(12位+特殊字符)需数天甚至不可行
算法特性:
apr1基于 MD5,但迭代 1000 次增加破解难度盐值(
A0vSKwao)防止彩虹表攻击
📚 附:相关命令速查
| 操作 | John the Ripper | Hashcat |
|---|---|---|
john hash.txt | hashcat -m 1600 hash.txt dict | |
john --wordlist=dict.txt hash.txt | hashcat -a 0 hash.txt dict | |
john --show hash.txt | hashcat --show -m 1600 hash.txt |
建议优先使用 John the Ripper 进行快速尝试,复杂场景切换 Hashcat + GPU 加速。
Gitleaks和GitRob使用方法
一、GitLeaks:敏感信息检测工具
核心功能
扫描 Git 仓库中的硬编码密码、API 密钥、令牌等敏感信息,支持本地仓库、远程仓库及 CI/CD 集成。
安装方法
Kali安装
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC02Docker 部署:
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC03Homebrew:
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC04GitHub Action 集成: 在 CI 流程中添加以下步骤:
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC05
关键命令
| 功能 | 命令 |
|---|---|
gitleaks detect --source /path/to/dir | |
gitleaks detect --report-path report.json | |
gitleaks detect --config gitleaks.toml |
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC06以下是 Gitleaks 帮助文档的完整翻译及整理结果,附带常用示例用法:
Gitleaks 文档翻译
功能:扫描代码(历史或当前)中的敏感密钥(如 API Key、密码等)命令格式:
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC07可用命令(Available Commands)
completion | |
detect | 核心功能 |
help | |
protect | |
version |
全局参数(Flags)
-b, --baseline-path <路径> | |
-c, --config <路径> | GITLEAKS_CONFIG > 3. 代码目录下的 .gitleaks.toml > 4. 默认配置) |
--exit-code <整数> | 1,常用于 CI/CD 流程) |
-h, --help | |
-l, --log-level <级别> | info) |
--max-target-megabytes <MB> | |
--no-banner | |
--redact | 安全***) |
-f, --report-format <格式> | json) |
-r, --report-path <路径> | |
-s, --source <路径> | .) |
-v, --verbose |
典型用法示例
1. 基础扫描(当前目录)
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC08扫描当前目录所有文件(包括 Git 历史记录) 检测到密钥时程序退出码为 1(可通过$?判断结果)
2. 扫描指定目录 + 生成报告
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC093. 安全扫描(隐藏密钥内容)
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC00输出日志中的密钥将被替换为 ***-v显示详细扫描过程
4. 与 CI/CD 集成(GitLab 示例)
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC01在 CI 流水线中检测到密钥立即失败( exit-code 1)
5. 使用自定义配置
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC02custom.toml:定义特定密钥规则(如公司内部密钥格式)baseline.json:忽略历史已处理的漏洞
注意事项
敏感操作:
使用 --redact避免密钥在日志中泄露。
用 --max-target-megabytes 10跳过大型文件(如二进制文件)。
protect命令可配置为pre-commit钩子(实时拦截提交中的密钥)。
灵活使用 -c参数覆盖默认规则,避免漏报。
使用 GitLeaks 扫描 GitHub 仓库的完整步骤
1. 克隆目标仓库
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC032. 执行 GitLeaks 扫描
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC04detect:扫描模式-v:详细输出(显示所有检测结果)--redact:自动屏蔽敏感信息(防止二次泄露)
3. 生成报告(可选)
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC05生成 JSON 格式报告,便于后续分析 其他格式支持: csv,sarif,html
高级用法
1. 仅扫描最新提交
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC062. 指定扫描范围
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC073. 自定义规则
创建规则文件
custom.toml:trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC08使用自定义规则扫描:
trivera:$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC09
4. Docker 方式扫描(无需克隆)
john --format=md5crypt-long hash.txt# 或显式指定格式john --format=apr1 hash.txt0结果解读示例
john --format=md5crypt-long hash.txt# 或显式指定格式john --format=apr1 hash.txt1高危项:AWS密钥、数据库凭证、API密钥 中危项:内部邮箱、服务器地址 低危项:测试凭据、占位符
注意事项
法律合规:
仅扫描授权仓库 避免公开泄露扫描结果
误报处理:
john --format=md5crypt-long hash.txt# 或显式指定格式john --format=apr1 hash.txt2使用 --baseline-path忽略已知误报
性能优化:
大仓库添加 --max-target-megabytes=50限制文件大小使用 --no-git跳过Git历史扫描(仅当前文件)
敏感信息保护:
john --format=md5crypt-long hash.txt# 或显式指定格式john --format=apr1 hash.txt3始终使用 --redact或--exit-code(CI/CD场景)
扫描完成后,立即检查并修复所有发现的敏感信息泄露!
🕵️ 二、GitRob:GitHub 仓库敏感文件扫描
核心功能
自动化扫描 GitHub 用户/组织的公开仓库,检测配置文件、密钥文件等高危文件(如 .env、id_rsa)。
安装与使用
安装(需 Go 环境):
john --format=md5crypt-long hash.txt# 或显式指定格式john --format=apr1 hash.txt4启动扫描:
john --format=md5crypt-long hash.txt# 或显式指定格式john --format=apr1 hash.txt5
输出解读
结果按文件类型分类(如
Database、SSH Keys)。显示文件路径、仓库 URL 及风险等级。
⚖️ 三、工具对比与联合使用建议
| 特性 | GitLeaks | GitRob |
|---|---|---|
| 扫描目标 | ||
| 适用场景 | ||
| 输出形式 | ||
| 联合策略 |
⚠️ 四、注意事项
法律合规:仅扫描授权目标,禁止未授权探测他人仓库。
误报处理:GitLeaks 支持自定义规则(修改
gitleaks.toml过滤误报)。性能优化 :大仓库扫描可能超时,建议通过
--max-target-megabytes限制文件大小。
💎 五、实战流程示例
john --format=md5crypt-long hash.txt# 或显式指定格式john --format=apr1 hash.txt6Shodan网络空间搜索引擎
Shodan 是一个专注于物联网设备和网络服务的搜索引擎,可用于安全研究、漏洞发现和资产监控。以下是详细的使用方法:
一、网页端使用(Shodan.io)
注册账户
访问 Shodan官网,网址:https://www.shodan.io/dashboard 注册免费账户(免费账户功能有限,付费账户支持高级搜索)。
基础搜索命令
port::指定端口(例:port:22)country::国家代码(例:country:CN)city::城市(例:city:beijing)org::组织/运营商(例:org:"China Telecom")os::操作系统(例:os:"Windows Server")vuln::CVE漏洞(例:vuln:CVE-2024-1234)
关键词搜索:直接输入设备类型(如
webcam)、服务(如ftp)或厂商(如cisco)。过滤器(组合使用更精准):
组合示例:
john --format=md5crypt-long hash.txt# 或显式指定格式john --format=apr1 hash.txt7
用如下命令搜索该网站的22端口,因为我们刚刚破解了一个疑似是ssh登录的密码trivera:Tanya4life
john --format=md5crypt-long hash.txt# 或显式指定格式john --format=apr1 hash.txt8找到4个结果,最终测试发现149.56.244.87可以登录ssh,但是密码似乎不对。
高级功能
地图视图:搜索结果以地理分布展示。 漏洞筛选:点击 "Exploits" 标签查看相关漏洞。 资产监控(付费功能):监控特定IP或网络的安全状态。
二、Kali Linux 命令行工具(shodan)
安装与配置
安装工具:
john --format=md5crypt-long hash.txt# 或显式指定格式john --format=apr1 hash.txt9或使用Python pip:
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt0初始化API密钥:
登录 Shodan 官网,在个人资料中获取 API Key。
在终端配置:
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt1
常用命令
shodan count <query> | shodan count apache | |
shodan search <query> | shodan search "nginx country:CN" | |
shodan download <文件名> <query> | shodan download results "port:21" | |
shodan parse <文件名> | shodan parse results.json.gz | |
shodan host <IP> | shodan host 8.8.8.8 | |
shodan scan list | shodan scan list |
实用示例
搜索暴露的 Redis 服务:
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt2统计中国区暴露的 SSH 服务:
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt3下载所有暴露的 MongoDB 数据并解析:
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt4
优化显示
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt5Shodan 的 --fields 参数支持丰富的字段选项,这些字段对应 Shodan 扫描结果中的 JSON 属性。以下是常用字段分类及示例:
核心字段
ip_str | |
port | |
org | |
hostnames | |
domains | |
asn | |
isp | |
transport | |
product | |
version | |
os |
地理位置字段
location.country_code | |
location.country_name | |
location.city | |
location.region_code | |
location.postal_code | |
location.latitude | |
location.longitude |
HTTP 服务字段
http.title | |
http.server | |
http.headers | |
http.robots | |
http.sitemap | |
http.security.txt |
SSL/TLS 证书字段
ssl.cert.subject | |
ssl.cert.issuer | |
ssl.cert.expired | |
ssl.cert.validity.start | |
ssl.cert.validity.end | |
ssl.cipher.version | |
ssl.jarm |
漏洞与安全字段
vulns | |
opts.vulns | |
cpe | |
shodan.ptr |
特殊字段
banner | |
data | |
timestamp | |
_shodan.id | |
_shodan.module |
使用技巧
嵌套字段访问:使用点号访问嵌套属性
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt6查看所有字段:提取一条完整记录检查可用字段
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt7组合关键字段:常用组合示例
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt8
Security Headers Scanner 安全标题扫描器
网址:https://securityheaders.com/
SSL Server SSL服务测试
网址:https://www.ssllabs.com/ssltest/analyze.html
https://www.ssllabs.com/ssltest/
Pastebin存储和共享文本的网站。
网址:https://pastebin.com/
stack overflow国外代码问答网站
网址:https://stackoverflow.com/questions
theharvester 用户信息收集
theHarvester 是一款强大的开源情报(OSINT)收集工具,用于从公开来源挖掘目标信息(如域名、邮箱、IP、子域名等)。以下是其核心用法详解:
基础语法
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt9** -d/--domain**:目标域名(必需参数) 示例:theHarvester -d example.com
核心功能选项
1. 指定数据源(关键选项)
john --show hash.txt# 输出示例:trivera:password1230常用数据源:
google:Google 搜索bing:Bing 搜索linkedin:LinkedIn 员工信息twitter:Twitter 相关账号shodan:Shodan IP/服务扫描dnsdumpster:DNS 子域名挖掘certspotter:SSL 证书信息github:GitHub 代码泄露完整列表: all(使用全部可用源)
示例:
john --show hash.txt# 输出示例:trivera:password12312. 限制结果数量
john --show hash.txt# 输出示例:trivera:password1232示例:theHarvester -d example.com -l 100
3. 主动扫描扩展
john --show hash.txt# 输出示例:trivera:password1233示例:
john --show hash.txt# 输出示例:trivera:password12344. 输出控制
john --show hash.txt# 输出示例:trivera:password1235示例:
john --show hash.txt# 输出示例:trivera:password1236高级用法
1. 代理配置(绕过封锁)
john --show hash.txt# 输出示例:trivera:password1237配置文件路径:/etc/theHarvester/proxies.yaml
2. API密钥配置
部分数据源(如Shodan、GitHub)需API密钥:
编辑配置文件:
/etc/theHarvester/api-keys.yaml添加密钥(示例):
john --show hash.txt# 输出示例:trivera:password1238
3. 组合实战示例
目标:全面收集企业信息并验证服务
john --show hash.txt# 输出示例:trivera:password1239输出结果解读
工具输出包含以下关键信息:
**Hosts (IP地址)**:发现的服务器IP Emails:关联邮箱(含来源) Subdomains:子域名列表 Virtual Hosts:共享IP的域名 Shodan Data:开放端口/服务详情(需 -c)关联人员(LinkedIn/Twitter来源)
注意事项
法律合规:仅用于授权测试,避免滥用 速率限制:搜索引擎会封禁高频请求,建议:
限制结果数( -l 100)使用代理( --proxy)避免频繁执行
练习题
使用TheHarvester枚举megacorpone.com的电子邮件地址。
echo'$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC0' > hash.txt0Social Media Tools 社交媒体信息收集工具
网址:https://www.social-searcher.com/
基于特定网站的搜索工具
Twiter https://digi.ninja/projects/twofi.php
LinkedIn https://github.com/initstring/linkedin2username
可以自行再github上搜索相关工具。
OSINT Framework 开源情报框架
网址:https://osintframework.com/
介绍了一些国外常用的收集信息的工具和网站,基于该框架搜索和收集信息
Maltego
网址:http://www.paterva.com/buy/maltego-clients.php
安装后免费注册一个账号即可使用
Maltego 是一款强大的开源情报(OSINT)和网络关系可视化工具,用于信息收集、关联分析和数据取证。以下是详细使用指南:
一、核心概念
实体(Entities)
基本数据单元(如 Domain, IP, Person, Email, Phone 等) 右键可执行操作(Transforms)
变换(Transforms)
对实体执行的操作(如查找关联域名、邮箱、IP等)
图谱(Graph)
可视化展示实体间的关系网络
二、基础工作流程
步骤1:创建新项目
启动 Maltego → New→Graph命名项目(如 megacorp_investigation)
步骤2:添加起始实体
左侧面板选择实体类型(如
Domain)拖拽到工作区 → 双击输入目标(如
megacorpone.com)echo'$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC0' > hash.txt1
步骤3:执行变换(Transforms)
右键实体 →
echo'$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC0' > hash.txt2→ 选择模块
To DNS from domain(解析DNS记录)To Website from Domain(查找网站)To Email addresses(挖掘邮箱)To IP addresses(解析IP)
常用变换:
步骤4:扩展分析
对新生成的实体重复步骤3
示例路径:
echo'$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC0' > hash.txt3
三、实战案例:调查公司资产
目标:挖掘 megacorpone.com 相关资产和人员
起始点:添加
Domain实体 →megacorpone.com执行变换:
echo'$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC0' > hash.txt4深度挖掘:
image-20250530143313981
对IP运行 To Netblock→ 发现同网段其他服务器对邮箱运行 To Person→ 关联LinkedIn资料对人员运行 To Social Networks→ 发现社交媒体账号
四、高级技巧
1. 自定义变换组合
创建
echo'$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC0' > hash.txt5(自动化工作流):
echo'$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC0' > hash.txt5 →Create new Machine拖拽实体和变换构建流程 示例:自动完成 Domain → IP → Port Scan → Services
2. 数据源集成
安装Transform Hub模块: Shodan(IP扫描) Hunter.io(邮箱挖掘) VirusTotal(威胁情报) 配置API密钥: Transforms→Transform Hub→ 激活服务
3. 可视化优化
颜色标记:右键实体 → Change Color(如红色标记高危IP)关系线调整:拖动连线调整路径 布局优化: Layout→Organic/Hierarchical
4. 数据导出
导出图谱: Export→ PNG/PDF/SVG导出数据: Export→ CSV/GraphML生成报告: Reporting→Create Report
五、常用变换模块
To DNS from domain | ||
To IP Address [DNS] | ||
To Website [Domain] | ||
To Email addresses [Domain] | ||
To Netblock [IP] | ||
To Domain [SSL Cert] | ||
To Person [Email] | ||
Shodan: Scan IP |
六、最佳实践
分层调查:
echo'$apr1$A0vSKwao$GV3sgGAj53j.c3GkS4oUC0' > hash.txt6保存检查点:
File→Save as Snapshot使用书签:标记关键实体(右键 →
Bookmark)避免噪音:设置过滤器(
View→Filter Entities)
七、学习资源
官方教程: Help→Interactive Tutorials案例库:Maltego Use Cases 认证课程:Maltego Certified Examiner (MCE)
通过 Maltego 的可视化关联分析,您能将碎片信息转化为可行动的情报,极大提升渗透测试和威胁调查效率。
🔔 想要获取更多网络安全与编程技术干货?
关注 泷羽Sec-静安 公众号,与你一起探索前沿技术,分享实用的学习资源与工具。我们专注于深入分析,拒绝浮躁,只做最实用的技术分享!💻
扫描下方二维码,马上加入我们,共同成长!🌟
👉 长按或扫描二维码关注公众号
或者直接回复文章中的关键词,获取更多技术资料与书单推荐!📚
推荐站内搜索:最好用的开发软件、免费开源系统、渗透测试工具云盘下载、最新渗透测试资料、最新黑客工具下载……




还没有评论,来说两句吧...