{"id":28732008,"url":"https://github.com/cyberspacesec/chrome_auto_login","last_synced_at":"2025-06-15T19:40:44.210Z","repository":{"id":298077131,"uuid":"998768280","full_name":"cyberspacesec/chrome_auto_login","owner":"cyberspacesec","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-09T09:16:15.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-09T09:37:24.260Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyberspacesec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-09T08:09:59.000Z","updated_at":"2025-06-09T09:16:19.000Z","dependencies_parsed_at":"2025-06-09T09:47:36.935Z","dependency_job_id":null,"html_url":"https://github.com/cyberspacesec/chrome_auto_login","commit_stats":null,"previous_names":["cyberspacesec/chrome_auto_login"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cyberspacesec/chrome_auto_login","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberspacesec%2Fchrome_auto_login","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberspacesec%2Fchrome_auto_login/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberspacesec%2Fchrome_auto_login/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberspacesec%2Fchrome_auto_login/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyberspacesec","download_url":"https://codeload.github.com/cyberspacesec/chrome_auto_login/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberspacesec%2Fchrome_auto_login/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260040566,"owners_count":22949855,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-15T19:40:35.538Z","updated_at":"2025-06-15T19:40:44.187Z","avatar_url":"https://github.com/cyberspacesec.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chrome自动化登录爆破工具\n\n一个基于Chrome浏览器的智能登录页面识别和自动化爆破工具，使用Golang开发。支持批量URL处理、多种验证码检测、智能页面分析等高级功能。\n\n## ✨ 功能特性\n\n### 🎯 核心功能\n- 🔍 **智能页面检测**: 基于多维度置信度算法的登录页面识别\n- 🎯 **自动元素定位**: 智能识别用户名、密码框、验证码和登录按钮\n- 📊 **批量处理**: 支持从文件读取URL列表、用户名和密码字典\n- ⚙️ **高度可配置**: 支持自定义识别规则和选择器策略\n- 📝 **详细日志**: 完整的操作日志记录和分析报告\n- 💾 **结果自动保存**: 成功结果自动保存到文件\n\n### 🛡️ 验证码检测系统\n- 🔤 **文字验证码**: 传统图片验证码识别\n- 🖼️ **图片验证码**: 基于图像的验证码检测\n- 🎯 **滑块验证码**: 拖拽式验证码支持\n- 👆 **点击验证码**: 点击选择类验证码\n- 🤖 **reCAPTCHA**: Google验证码检测\n- 🔒 **hCaptcha**: hCaptcha验证码检测\n- 🧠 **行为验证**: 智能行为分析验证码\n- 📊 **置信度评分**: 0.0-1.0评分系统确保检测准确性\n\n### 🔧 技术特性\n- 🌐 **自动编码检测**: 支持UTF-8、GBK、Big5等多种编码\n- 📄 **页面源码输出**: analyze模式下完整页面源码展示\n- ⏱️ **智能超时控制**: 各检测阶段独立超时管理\n- 🖥️ **可视化调试**: debug模式下浏览器窗口可见\n- 🔄 **网络监听**: 获取响应头和网络状态信息\n- 📊 **实时进度显示**: 清晰的进度条和状态反馈\n\n### 🚀 OCR配置支持\n- 🔧 **多提供商**: Tesseract、百度、阿里云、腾讯云\n- 🖼️ **图像预处理**: 缩放、灰度化、降噪、对比度增强\n- 🔄 **故障转移**: 主要提供商失败时自动切换备用方案\n- ⚙️ **灵活配置**: 支持自定义OCR参数和模型路径\n\n## 📁 项目结构\n\n```\nchrome_auto_login/\n├── cmd/                    # 主程序入口\n│   └── main.go            # 命令行工具主程序\n├── pkg/                    # 核心功能包\n│   ├── browser/           # Chrome浏览器控制\n│   │   └── browser.go     # 浏览器自动化操作\n│   ├── config/            # 配置管理\n│   │   └── config.go      # 配置文件解析和管理\n│   ├── detector/          # 页面和元素检测\n│   │   ├── detector.go    # 页面分析和检测器\n│   │   └── captcha.go     # 验证码检测引擎\n│   └── bruteforce/        # 爆破引擎\n│       └── bruteforce.go  # 登录爆破逻辑\n├── util/                   # 工具函数\n│   └── logger.go          # 日志系统\n├── config/                 # 配置文件\n│   └── config.yaml        # 主配置文件\n├── test/                   # 测试文件\n│   ├── test_urls.txt      # URL测试列表\n│   ├── test_usernames.txt # 用户名测试字典\n│   ├── test_passwords.txt # 密码测试字典\n│   ├── test_captcha.html  # 验证码测试页面\n│   └── test_no_captcha.html # 无验证码测试页面\n├── logs/                   # 日志目录（自动创建）\n├── result/                 # 结果输出目录（自动创建）\n├── go.mod                  # Go模块定义\n├── go.sum                  # 依赖校验文件\n├── Makefile               # 构建脚本\n└── README.md              # 项目说明\n```\n\n## 🚀 安装和编译\n\n### 前置要求\n\n- Go 1.21 或更高版本\n- Chrome浏览器\n- 操作系统: Windows/Linux/macOS\n\n### 快速开始\n\n```bash\n# 克隆项目\ngit clone https://github.com/cyberspacesec/chrome_auto_login\ncd chrome_auto_login\n\n# 下载依赖\ngo mod tidy\n\n# 编译\ngo build -o chrome_auto_login cmd/main.go\n\n# 查看帮助\n./chrome_auto_login -help\n```\n\n### 编译所有平台版本\n\n```bash\n# 使用Makefile编译多平台版本\nmake build-all\n\n# 手动编译不同平台\n# Windows 64位\nGOOS=windows GOARCH=amd64 go build -o chrome_auto_login.exe cmd/main.go\n\n# Linux 64位\nGOOS=linux GOARCH=amd64 go build -o chrome_auto_login_linux cmd/main.go\n\n# macOS 64位\nGOOS=darwin GOARCH=amd64 go build -o chrome_auto_login_macos cmd/main.go\n```\n\n## 📖 使用方法\n\n### 命令行参数\n\n```bash\n用法:\n  ./chrome_auto_login -url \u003c目标URL\u003e [选项]\n  ./chrome_auto_login -f \u003cURL文件\u003e [选项]\n\n选项:\n  -url string        目标登录页面URL (与-f/-file二选一)\n  -f string          从文件读取URL列表，一行一个URL (与-url二选一)\n  -file string       -f的别名，从文件读取URL列表\n  -username string   从文件读取用户名列表，一行一个用户名\n  -password string   从文件读取密码列表，一行一个密码\n  -path string       Chrome浏览器可执行文件路径（可选，不指定则自动检测）\n  -config string     配置文件路径 (默认: config/config.yaml)\n  -analyze           仅分析页面，不执行爆破\n  -debug             调试模式，显示浏览器窗口和详细操作过程\n  -help              显示此帮助信息\n```\n\n### 基本使用示例\n\n```bash\n# 基本爆破\n./chrome_auto_login -url \"http://example.com/login\"\n\n# 批量URL处理\n./chrome_auto_login -f urls.txt\n\n# 使用自定义字典\n./chrome_auto_login -url \"http://example.com/login\" \\\n  -username users.txt -password passwords.txt\n\n# 页面分析（不执行爆破）\n./chrome_auto_login -url \"http://example.com/login\" -analyze\n\n# 调试模式（显示浏览器窗口）\n./chrome_auto_login -url \"http://example.com/login\" -debug\n\n# 指定Chrome路径\n./chrome_auto_login -url \"http://example.com/login\" \\\n  -path \"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\"\n\n# 使用自定义配置文件\n./chrome_auto_login -url \"http://example.com/login\" -config my_config.yaml\n```\n\n### 使用Makefile快捷命令\n\n```bash\n# 运行爆破\nmake run URL=http://example.com/login\n\n# 调试模式（显示浏览器窗口）\nmake debug URL=http://example.com/login\n\n# 页面分析\nmake analyze URL=http://example.com/login\n\n# 运行测试\nmake test-chrome                      # 测试Chrome连接\nmake test-web                         # 测试网页访问\n\n# 编译相关\nmake build                            # 编译程序\nmake build-all                        # 编译所有平台版本\n```\n\n## 📋 文件格式说明\n\n### URL文件格式 (urls.txt)\n```\n# 支持注释行\nhttp://example1.com/login\nhttps://example2.com/admin/login\nhttps://example3.com/user/signin\n\n# 空行会被自动忽略\nhttps://example4.com/auth\n```\n\n### 用户名文件格式 (usernames.txt)\n```\n# 常用用户名\nadmin\nadministrator\nroot\nuser\ntest\nguest\n# 可以添加更多用户名\nmanager\noperator\n```\n\n### 密码文件格式 (passwords.txt)\n```\n# 常用密码\nadmin\npassword\n123456\nadmin123\nroot\n# 可以添加更多密码\npassword123\nadmin@123\n```\n\n**注意事项:**\n- 支持 `#` 和 `//` 开头的注释行\n- 自动忽略空行\n- 每行一个条目\n- 文件编码建议使用UTF-8\n\n## 🔧 调试模式详解\n\n使用 `-debug` 参数可以启用可视化调试模式：\n\n```bash\n./chrome_auto_login -url \"http://example.com/login\" -debug\n```\n\n### 调试模式特性\n- 🖥️ **浏览器窗口可见**: 观察Chrome的实际操作过程\n- 🔍 **详细日志输出**: 显示每个步骤的详细信息\n- 🖊️ **表单操作可视化**: 观察用户名、密码填充过程\n- 🖱️ **点击操作可视化**: 观察按钮点击效果\n- 📊 **实时状态显示**: 显示检测过程和结果\n- 🕒 **操作延迟**: 便于观察每个操作步骤\n\n### 适用场景\n- 🔍 排查页面元素定位问题\n- 📝 调试识别规则和选择器\n- 📚 学习工具工作原理\n- 🛠️ 开发新功能和规则\n- 🎯 验证爆破流程的正确性\n\n## 🛡️ 验证码检测详解\n\n### 检测流程\n\n工具采用**两阶段智能检测机制**：\n\n#### 第一阶段：快速预检测（3秒内）\n- 🔍 快速扫描常见验证码选择器\n- 📝 检测页面关键词：验证码、captcha、verify等\n- ⚡ 无验证码页面几乎瞬间完成\n\n#### 第二阶段：详细类型分析（最多10.5秒）\n每种类型检测时间分配（各1.5秒）：\n1. 🤖 **reCAPTCHA检测** - Google验证码框架\n2. 🔒 **hCaptcha检测** - hCaptcha验证码框架  \n3. 🎯 **滑块验证码** - 拖拽滑块类验证码\n4. 🖼️ **图片验证码** - 图像选择类验证码\n5. 🔤 **文字验证码** - 传统输入框验证码\n6. 👆 **点击验证码** - 点击操作类验证码\n7. 🧠 **行为验证码** - 智能行为分析类\n\n### 检测结果示例\n\n```bash\n🎯 验证码类型分析完成: 文字验证码 (置信度: 0.80)\n📋 验证码描述: 文字验证码 - 需要输入验证码字符\n🛠️ 处理策略: 可通过OCR识别自动处理\n🎯 选择器: input[name*=\"captcha\"]\n```\n\n### 支持的验证码类型\n\n| 类型 | 检测特征 | 置信度评估 | 处理策略 |\n|------|----------|------------|----------|\n| 🔤 文字验证码 | 输入框+图片 | 基于元素匹配 | OCR识别 |\n| 🖼️ 图片验证码 | 图片选择 | 关键词+元素 | 图像识别 |\n| 🎯 滑块验证码 | 滑块元素 | 特征元素检测 | 拖拽模拟 |\n| 👆 点击验证码 | 点击指令 | 文本分析 | 坐标定位 |\n| 🤖 reCAPTCHA | iframe框架 | 框架检测 | 专门处理 |\n| 🔒 hCaptcha | 特定类名 | 类名匹配 | 专门处理 |\n| 🧠 行为验证 | 行为关键词 | 关键词权重 | 行为模拟 |\n\n## ⚙️ 配置文件详解\n\n### 主要配置项\n\n#### 浏览器配置\n```yaml\nbrowser:\n  headless: true           # 无头模式\n  timeout: 60             # 页面加载超时（秒）\n  width: 1920             # 浏览器窗口宽度\n  height: 1080            # 浏览器窗口高度\n  chrome_path: \"\"         # Chrome路径（可选）\n```\n\n#### 验证码检测配置\n```yaml\ncaptcha:\n  detection:\n    enabled: true                    # 启用验证码检测\n    timeout: 10                      # 检测超时时间\n    confidence_threshold: 0.7        # 置信度阈值\n    verbose_output: true             # 详细输出\n  \n  handling:\n    skip_on_detection: true          # 检测到验证码时跳过\n    manual_input: false              # 人工输入支持\n    ocr_enabled: false               # OCR识别启用\n```\n\n#### OCR配置\n```yaml\nocr:\n  primary_provider: \"tesseract\"      # 主要OCR提供商\n  fallback_providers:               # 备用提供商\n    - \"local\"\n    - \"tesseract\"\n  \n  preprocessing:                    # 图像预处理\n    enabled: true\n    resize_enabled: true\n    grayscale: true\n    noise_reduction: true\n    contrast_enhancement: true\n```\n\n### 自定义识别规则\n\n#### 用户名输入框选择器\n```yaml\nform_elements:\n  username_selectors:\n    - 'input[type=\"text\"][name*=\"user\"]'\n    - 'input[type=\"text\"][placeholder*=\"用户名\"]'\n    - 'input[type=\"email\"]'\n    # 可添加更多自定义选择器\n```\n\n#### 验证码元素选择器\n```yaml\ncaptcha:\n  custom_selectors:\n    image_selectors:\n      - \"img[src*='captcha']\"\n      - \"img[alt*='验证码']\"\n    input_selectors:\n      - \"input[placeholder*='验证码']\"\n      - \"input[name*='captcha']\"\n```\n\n## 📊 页面分析功能\n\n### analyze模式特性\n\n使用 `-analyze` 参数进行页面分析：\n\n```bash\n./chrome_auto_login -url \"http://example.com/login\" -analyze\n```\n\n### 分析输出内容\n\n1. **基本页面信息**\n   - 页面标题和URL\n   - 登录页面置信度（0.0-1.0）\n   - 页面编码（UTF-8、GBK等）\n   - 分析用时统计\n\n2. **检测到的页面特征**\n   - 用户名输入框\n   - 密码输入框\n   - 验证码相关元素\n   - 提交按钮\n\n3. **表单元素详情**\n   - 精确的CSS选择器\n   - 元素检测置信度\n   - 元素可见性状态\n\n4. **验证码检测结果**\n   - 验证码类型和描述\n   - 检测置信度评分\n   - 推荐处理策略\n   - 相关选择器信息\n\n5. **完整页面源码**\n   - HTML源码完整输出\n   - 便于深入分析和调试\n\n6. **网络信息**\n   - HTTP响应头\n   - 状态码信息\n   - 重定向跟踪\n\n### 分析结果示例\n\n```\n=== 页面分析结果 ===\n页面标题: 管理员登录 - 系统后台\n页面URL: http://example.com/admin/login\n是否为登录页面: true (置信度: 0.85)\n页面编码: utf-8\n分析用时: 2.5s\n\n检测到的页面特征:\n  • 用户名输入框\n  • 密码输入框\n  • 文字验证码\n  • 提交按钮\n\n检测到的表单元素:\n  用户名输入框: input[name=\"username\"]\n  密码输入框: input[type=\"password\"]\n  验证码输入框: input[name=\"captcha\"]\n  提交按钮: button[type=\"submit\"]\n\n验证码检测结果:\n  🎯 类型: 文字验证码\n  📊 置信度: 0.80\n  📋 处理策略: 可通过OCR识别自动处理\n  🎯 选择器: input[name=\"captcha\"]\n```\n\n## 📂 输出文件说明\n\n### 日志文件\n- **位置**: `logs/` 目录\n- **格式**: `YYYY-MM-DD.log`\n- **内容**: 详细的操作日志和错误信息\n- **轮转**: 自动按日期轮转和大小管理\n\n### 结果文件\n- **成功结果**: `result/YYYY-MM-DD_success.txt`\n- **格式**: `URL:用户名:密码`\n- **实时保存**: 成功即保存，避免数据丢失\n\n### 截图文件\n- **成功截图**: `success_screenshot.png`\n- **内容**: 登录成功后的页面截图\n- **用途**: 验证登录成功状态\n\n## 🔒 安全警告\n\n### ⚠️ 重要声明\n\n**此工具仅供授权的安全测试使用，严禁用于非法用途！**\n\n### 合法使用场景\n- ✅ 授权的渗透测试\n- ✅ 安全研究和学习\n- ✅ 企业内部安全评估\n- ✅ 漏洞赏金计划\n- ✅ 安全意识培训\n\n### 禁止使用场景\n- ❌ 未经授权的系统攻击\n- ❌ 恶意破坏和入侵\n- ❌ 商业机密窃取\n- ❌ 个人隐私侵犯\n- ❌ 任何违法犯罪活动\n\n### 使用责任\n- 使用者需承担所有法律责任\n- 确保获得明确的书面授权\n- 遵守当地法律法规\n- 遵循道德和职业准则\n\n## 🚀 高级功能\n\n### 批量处理能力\n- **多URL并发**: 支持批量URL处理\n- **自动跳过**: 智能跳过非登录页面\n- **进度追踪**: 实时显示处理进度\n- **错误处理**: 单个失败不影响整体进程\n\n### 智能检测算法\n- **多维度评分**: 综合页面特征评估置信度\n- **编码自适应**: 自动检测和转换页面编码\n- **超时控制**: 各阶段独立超时防止死锁\n- **容错机制**: 网络异常自动重试\n\n### 扩展性设计\n- **模块化架构**: 易于添加新功能\n- **配置驱动**: 无需修改代码即可调整行为\n- **插件友好**: 支持自定义检测规则\n- **API接口**: 便于集成到其他工具\n\n## 🛠️ 故障排除\n\n### 常见问题\n\n**Q: Chrome浏览器启动失败**\n```bash\n# 检查Chrome安装\nwhich google-chrome-stable\n# 或指定Chrome路径\n./chrome_auto_login -url \"...\" -path \"/path/to/chrome\"\n```\n\n**Q: 页面加载超时**\n```bash\n# 增加超时时间（修改config.yaml）\nbrowser:\n  timeout: 120  # 增加到120秒\n```\n\n**Q: 元素定位失败**\n```bash\n# 使用调试模式观察\n./chrome_auto_login -url \"...\" -debug\n# 使用分析模式查看页面结构\n./chrome_auto_login -url \"...\" -analyze\n```\n\n**Q: 验证码检测不准确**\n```bash\n# 调整置信度阈值（config.yaml）\ncaptcha:\n  detection:\n    confidence_threshold: 0.5  # 降低阈值\n```\n\n**Q: 编码问题导致乱码**\n```bash\n# 工具会自动检测编码，如仍有问题，检查页面meta标签：\n\u003cmeta charset=\"UTF-8\"\u003e\n```\n\n### 调试技巧\n\n1. **使用debug模式**: 观察浏览器实际操作\n2. **查看分析结果**: 了解页面检测情况\n3. **检查日志文件**: 查看详细错误信息\n4. **调整配置参数**: 修改超时和阈值设置\n5. **验证选择器**: 使用浏览器开发者工具\n\n## 🤝 贡献指南\n\n### 参与贡献\n\n欢迎提交Issue和Pull Request！\n\n1. **Fork项目** 到你的GitHub\n2. **创建特性分支** (`git checkout -b feature/AmazingFeature`)\n3. **提交更改** (`git commit -m 'Add some AmazingFeature'`)\n4. **推送分支** (`git push origin feature/AmazingFeature`)\n5. **创建Pull Request**\n\n### 开发建议\n\n- 遵循Go语言编码规范\n- 添加适当的注释和文档\n- 编写单元测试\n- 更新README文档\n\n### 功能建议\n\n- 新的验证码类型支持\n- 更多OCR提供商集成\n- 页面识别规则优化\n- 性能和稳定性改进\n\n## 📄 许可证\n\n本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情\n\n## 📞 联系信息\n\n- **作者**: zhizhuo\n- **邮箱**: zhizhuo@cyberspacesec.com\n- **组织**: CyberspaceSec\n- **项目地址**: https://github.com/cyberspacesec/chrome_auto_login\n\n---\n\n**⚡ 快速开始**\n\n```bash\ngit clone https://github.com/cyberspacesec/chrome_auto_login\ncd chrome_auto_login\ngo build -o chrome_auto_login cmd/main.go\n./chrome_auto_login -url \"http://example.com/login\" -analyze\n```\n\n**🔒 安全提醒**: 仅限授权渗透测试使用，使用者承担所有法律责任。 ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberspacesec%2Fchrome_auto_login","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyberspacesec%2Fchrome_auto_login","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberspacesec%2Fchrome_auto_login/lists"}