|
| 1 | +# SubProbe |
| 2 | +> JS-powered crawler for hidden endpoints & internal subdomains |
| 3 | +
|
| 4 | +<p align="center"> |
| 5 | + <img src="https://i.imgur.com/aJPgEZ9.png" width="250" alt="SubProbe logo"/> |
| 6 | +</p> |
| 7 | + |
| 8 | +<p align="center"> |
| 9 | + <img src="https://img.shields.io/github/license/devploit/SubProbe?style=flat-square" alt="License"> |
| 10 | + <img src="https://img.shields.io/github/stars/devploit/SubProbe?style=flat-square" alt="Stars"> |
| 11 | +</p> |
| 12 | + |
| 13 | +<p align="center"> |
| 14 | + <b>Extract hidden endpoints and internal subdomains from JavaScript files through semantic analysis</b> |
| 15 | +</p> |
| 16 | + |
| 17 | +SubProbe is a powerful JavaScript-aware web crawler designed for security researchers and penetration testers. It discovers hidden endpoints, APIs, and subdomains by analyzing JavaScript files within web applications — revealing potential attack surfaces that traditional crawlers and subdomain enumeration tools miss. |
| 18 | + |
| 19 | +## 🚀 Features |
| 20 | + |
| 21 | +- **Deep JavaScript Analysis**: Parses and extracts endpoints from **JavaScript files** (semantic analysis) |
| 22 | +- **Recursive Crawling**: Supports multi-level crawling to discover deeper JS resources |
| 23 | +- **External Sources**: Collects additional endpoints from: |
| 24 | + - robots.txt |
| 25 | + - sitemap.xml |
| 26 | + - Wayback Machine |
| 27 | +- **Endpoint Verification**: Tests endpoints to verify they're accessible |
| 28 | +- **Status Filtering**: Filter results by HTTP status codes |
| 29 | +- **Export Options**: Save results as JSON, CSV, or plain text files |
| 30 | + |
| 31 | +## 📋 Installation |
| 32 | + |
| 33 | +```bash |
| 34 | +# Clone the repository |
| 35 | +git clone https://github.com/devploit/SubProbe.git |
| 36 | +cd SubProbe |
| 37 | +npm install |
| 38 | + |
| 39 | +# Make it executable |
| 40 | +npm link |
| 41 | +``` |
| 42 | + |
| 43 | +After running the above commands, you can use `subprobe` directly from your terminal. |
| 44 | + |
| 45 | +## 📊 Command Options |
| 46 | + |
| 47 | +| Option | Description | |
| 48 | +|--------|-------------| |
| 49 | +| `--depth <number>` | Recursive scan depth for internal links (default 0) | |
| 50 | +| `--filter-status <codes>` | Filter by status codes. Supports exact (200), ranges (400-410), and groups (4xx) | |
| 51 | +| `-o, --out <file>` | Export results to JSON, CSV, or plain text (determined by file extension) | |
| 52 | +| `--probe` | Check if endpoints respond (via HTTP status codes) | |
| 53 | +| `--wayback` | Include Wayback Machine results | |
| 54 | +| `--silent` | Only show discovered endpoints without progress information | |
| 55 | +| `--no-color` | Disable colored output | |
| 56 | + |
| 57 | +## 📝 Example Output |
| 58 | + |
| 59 | +Running `subprobe https://example.com --probe --wayback` might produce output like this: |
| 60 | + |
| 61 | +``` |
| 62 | +🚀 Starting SubProbe on https://example.com |
| 63 | +
|
| 64 | +[12:34:56] 🕷️ Starting crawl (depth: 0) |
| 65 | +[12:34:57] 🎯 Crawling depth 0 (1 URLs) |
| 66 | +[12:35:01] 📂 Collecting from robots.txt & sitemap.xml |
| 67 | +[12:35:05] 🕚 Collecting from Wayback... |
| 68 | +[12:35:12] 🔌 Probing 42 endpoints... |
| 69 | +
|
| 70 | +✅ Analysis complete - Summary: |
| 71 | + - URLs analyzed: 1 |
| 72 | + - JS files analyzed: 3/3 |
| 73 | + - Endpoints found: 42 |
| 74 | +
|
| 75 | +[12:35:30] 🔍 Found 42 endpoints: |
| 76 | +
|
| 77 | +🟩 https://example.com/api/v1/users ✅ [200] |
| 78 | +🟩 https://example.com/api/v1/products ✅ [200] |
| 79 | +🟩 https://example.com/api/v1/cart ✅ [200] |
| 80 | +🟩 https://example.com/api/v1/checkout 🔒 [401] |
| 81 | +🟦 https://api.example.com/v2/products ✅ [200] |
| 82 | +🟥 https://cdn.example.net/assets/main.js ✅ [200] |
| 83 | +🟥 https://analytics.example-tracker.com/collect ❌ [404] |
| 84 | +🕓 https://example.com/legacy/api/users ❌ [404] |
| 85 | +🕓 https://example.com/beta/graphql ✅ [200] |
| 86 | +🗺️ https://example.com/sitemap/products.xml ✅ [200] |
| 87 | +🤖 https://example.com/admin/login.php ❌ [404] |
| 88 | +``` |
| 89 | + |
| 90 | +The output shows different types of endpoints with their status: |
| 91 | +- 🟩 Relative paths from the same domain |
| 92 | +- 🟦 Internal subdomains |
| 93 | +- 🟥 External domains referenced in code |
| 94 | +- 🕓 Historical endpoints from Wayback Machine |
| 95 | +- 🗺️ Endpoints found in sitemap.xml |
| 96 | +- 🤖 Endpoints found in robots.txt |
| 97 | + |
| 98 | +Status codes are shown when using `--probe`: |
| 99 | +- ✅ 2xx: Success |
| 100 | +- 🔁 3xx: Redirection |
| 101 | +- 🔒 401/403: Authentication required |
| 102 | +- ❌ 4xx: Client error |
| 103 | +- 💥 5xx: Server error |
| 104 | + |
| 105 | +## 🔍 How It Works |
| 106 | + |
| 107 | +SubProbe uses a multi-stage approach to discover hidden endpoints: |
| 108 | + |
| 109 | +1. **Crawling**: SubProbe behaves like a lightweight crawler, starting from the target URL and recursively following links up to the specified depth to discover more JavaScript files and internal pages. |
| 110 | +2. **JS Collection**: Extracts and downloads JavaScript files from HTML source |
| 111 | +3. **Semantic Analysis**: Parses JS files using AST (Abstract Syntax Tree) analysis to find: |
| 112 | + - Fetch API calls |
| 113 | + - Axios requests |
| 114 | + - XMLHttpRequest URLs |
| 115 | + - Hardcoded API endpoints |
| 116 | +4. **External Data**: Gathers additional endpoints from robots.txt, sitemap.xml, and optionally Wayback Machine |
| 117 | +5. **Endpoint Verification**: If enabled, probes discovered endpoints to check their HTTP status |
| 118 | +6. **Results Display**: Presents organized results with color-coded endpoint types and status codes |
| 119 | + |
| 120 | +## 🌐 Use Cases |
| 121 | + |
| 122 | +- Finding hidden API endpoints during penetration tests |
| 123 | +- Discovering forgotten or legacy endpoints that might be vulnerable |
| 124 | +- Identifying internal subdomains referenced in JavaScript |
| 125 | +- Mapping the full attack surface of a web application |
| 126 | +- Reconnaissance phase of bug bounty hunting |
| 127 | + |
| 128 | +## 👨💻 Contributing |
| 129 | + |
| 130 | +Contributions are welcome! Please feel free to submit a Pull Request. |
| 131 | + |
| 132 | +1. Fork the repository |
| 133 | +2. Create your feature branch (`git checkout -b feature/amazing-feature`) |
| 134 | +3. Commit your changes (`git commit -m 'Add some amazing feature'`) |
| 135 | +4. Push to the branch (`git push origin feature/amazing-feature`) |
| 136 | +5. Open a Pull Request |
| 137 | + |
| 138 | +## 📄 License |
| 139 | + |
| 140 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
| 141 | + |
| 142 | +--- |
| 143 | + |
| 144 | +<p align="center"> |
| 145 | + Made with ❤️ by <a href="https://github.com/devploit">devploit</a> |
| 146 | +</p> |
0 commit comments