Skip to content

Commit 26d6bac

Browse files
committed
docs: comprehensive README update, bug fixes, test coverage improvements
1 parent bb51be7 commit 26d6bac

File tree

12 files changed

+714
-32
lines changed

12 files changed

+714
-32
lines changed

README.md

Lines changed: 156 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,45 @@ An open-source, cross-platform powerful network analysis tool for discovering we
44

55
## Features
66

7-
- ASN scanning (Autonomous System Number) with IPv4/IPv6 support
8-
- IP block scanning (CIDR format)
9-
- HTTPS/HTTP automatic fallback
10-
- **Chrome 135 TLS Fingerprint** (JA3/JA4 spoofing via uTLS)
11-
- **Real Chrome Header Order** (WAF bypass optimized)
12-
- **Referer Header Rotation** (Google, Bing, DuckDuckGo)
13-
- Firewall bypass techniques (IP shuffling, header randomization, smart jitter)
14-
- Proxy support (HTTP/HTTPS/SOCKS5)
15-
- Custom DNS servers
16-
- Rate limiting (token bucket algorithm)
17-
- Dynamic timeout calculation
18-
- Text and JSON output formats
19-
- Configurable concurrent workers (1-1000)
20-
- Real-time progress bar
21-
- Graceful Ctrl+C handling with result export
22-
- Input validation (ASN, IP/CIDR format checking)
23-
- Large CIDR block protection (max 1M IPs)
7+
### Scanning
8+
- **ASN scanning** — Queries RIPE Stat API for all announced prefixes of an ASN, with automatic fallback to RADB if RIPE is unavailable
9+
- **IP block scanning** — Direct CIDR notation input with support for multiple comma-separated blocks
10+
- **HTTPS/HTTP automatic fallback** — Tries HTTPS first, seamlessly falls back to HTTP if connection fails
11+
- **Batch reverse DNS** — Automatically resolves hostnames for all discovered IPs after scan completion
12+
- **IPv4/IPv6 support** — IPv6 scanning can be enabled with the `-ipv6` flag
13+
14+
### Anti-Detection & Firewall Bypass
15+
- **Chrome 135 TLS Fingerprint** — JA3/JA4 fingerprint spoofing via [uTLS](https://github.com/refraction-networking/utls), making requests indistinguishable from real Chrome 135 browser traffic
16+
- **Real Chrome Header Order** — Headers are sent in the exact order Chrome 135 uses (captured from DevTools), which is checked by Cloudflare and other WAFs
17+
- **User-Agent Rotation** — Pool of 17 Chrome 133-135 User-Agents across Windows, macOS, and Linux
18+
- **Referer Header Rotation** — Randomly cycles through Google, Bing, DuckDuckGo, and Yahoo referer URLs
19+
- **IP Shuffling** — Randomizes scan order to avoid sequential scanning patterns that trigger firewalls
20+
- **Smart Jitter** — Adds random delay (0-200ms) between requests for natural traffic patterns
21+
- **Rate Limiting** — Token bucket algorithm to control requests per second
22+
23+
### Performance
24+
- **Concurrent workers** — Configurable from 1 to 1000 parallel goroutines (default: 100)
25+
- **Connection pooling** — Optimized HTTP connection pool with keep-alive and buffer tuning
26+
- **Dynamic timeout** — Auto-calculated based on domain response time or worker count
27+
- **Proxy connection pre-warming** — Pre-establishes connections for lower initial latency
28+
29+
### Resilience
30+
- **Scan resume** — Interrupted scans are cached to JSON and can be resumed with `-resume`
31+
- **Graceful Ctrl+C handling** — Stops all workers, offers to export partial results before exit
32+
- **Large CIDR block protection** — Prevents memory exhaustion by limiting to 1M IPs per block
33+
34+
### Output
35+
- **Text and JSON formats** — Structured JSON output with backward-compatible field names
36+
- **Auto-export** — Results saved to file with `--export` or prompted after scan
37+
- **Custom output directory** — Export files to a specific directory with `-output-dir`
38+
- **Real-time progress bar** — Visual scan progress with ETA
39+
40+
### Configuration
41+
- **YAML config file** — Set defaults in a config file, CLI flags always override
42+
- **Auto-discovery** — Automatically finds config files in common locations
43+
- **Proxy support** — HTTP, HTTPS, and SOCKS5 proxies with authentication
44+
- **Custom DNS servers** — Use your own DNS resolvers for all lookups
45+
- **Input validation** — Validates ASN, IP/CIDR, and domain formats before scanning
2446

2547
## Installation
2648

@@ -40,6 +62,15 @@ go mod tidy
4062
go build -o ipmap .
4163
```
4264

65+
**Cross-platform Build Scripts:**
66+
```bash
67+
# Linux/macOS
68+
./build.sh
69+
70+
# Windows (PowerShell)
71+
.\build.ps1
72+
```
73+
4374
## Usage
4475

4576
### Parameters
@@ -53,15 +84,15 @@ go build -o ipmap .
5384
-format json # Output format (text or json)
5485
-workers 100 # Concurrent workers (default: 100)
5586
-v # Verbose mode
56-
-c # Continue until completion
87+
-c # Continue scanning even after domain match
5788
-proxy http://127.0.0.1:8080 # Proxy URL (HTTP/HTTPS/SOCKS5)
5889
-rate 50 # Rate limit (requests/sec, 0 = unlimited)
5990
-dns 8.8.8.8,1.1.1.1 # Custom DNS servers
6091
-ipv6 # Enable IPv6 scanning
6192
-config config.yaml # Load config from YAML file
6293
-resume cache.json # Resume interrupted scan from cache
6394
-output-dir ./exports # Directory for export files
64-
-insecure=false # Enable TLS certificate verification
95+
-insecure=false # Skip TLS certificate verification (default: true)
6596
```
6697

6798
### Examples
@@ -82,10 +113,115 @@ ipmap -asn AS13335 -workers 200 -v
82113
# With proxy and rate limiting
83114
ipmap -asn AS13335 -proxy socks5://127.0.0.1:9050 -rate 50
84115

116+
# Resume an interrupted scan
117+
ipmap -resume ipmap_AS13335_cache.json
118+
119+
# Export results to a specific directory in JSON format
120+
ipmap -asn AS13335 -format json --export -output-dir ./results
121+
85122
# Full configuration
86123
ipmap -asn AS13335 -d example.com -proxy http://127.0.0.1:8080 -rate 100 -workers 50 -dns 8.8.8.8 -v --export
87124
```
88125

126+
### Configuration File
127+
128+
ipmap supports YAML configuration files. Create a `config.yaml` in your working directory or `~/.ipmap.yaml` for global defaults:
129+
130+
```yaml
131+
# config.yaml
132+
workers: 150
133+
timeout: 3000
134+
rate_limit: 50
135+
proxy: "socks5://127.0.0.1:9050"
136+
dns_servers:
137+
- "8.8.8.8"
138+
- "1.1.1.1"
139+
ipv6: false
140+
verbose: false
141+
format: "text"
142+
```
143+
144+
**Auto-discovery order:** The tool automatically looks for config files in this order:
145+
1. `config.yaml` / `config.yml` (current directory)
146+
2. `.ipmap.yaml` / `.ipmap.yml` (current directory)
147+
3. `~/.ipmap.yaml` / `~/.ipmap.yml` (home directory)
148+
149+
> **Note:** CLI flags always override config file values. Config file values only apply if the corresponding flag is not explicitly set on the command line.
150+
151+
### Scan Resume (Cache)
152+
153+
When a scan is interrupted (Ctrl+C), ipmap automatically offers to export partial results. You can also resume from where you left off:
154+
155+
```bash
156+
# Start a scan (press Ctrl+C to interrupt)
157+
ipmap -asn AS13335
158+
159+
# Resume the interrupted scan
160+
ipmap -resume ipmap_AS13335_cache.json
161+
```
162+
163+
The cache file (JSON) stores: scanned IPs, results found so far, scan metadata, and progress. On resume, already-scanned IPs are skipped automatically.
164+
165+
### Output Examples
166+
167+
**Text format (default):**
168+
```
169+
==================== RESULT ====================
170+
Method: Search All ASN/IP
171+
Search Site: Example Site
172+
Timeout: 2000ms
173+
IP Blocks: 103.21.244.0/22,103.22.200.0/22
174+
Found Websites:
175+
200 | https://103.21.244.5 | Example Site [host.example.com.]
176+
200 | https://103.21.244.12 | Another Site
177+
403 | https://103.22.200.1 | Cloudflare
178+
================================================
179+
```
180+
181+
**JSON format (`-format json`):**
182+
```json
183+
{
184+
"method": "Search All ASN/IP",
185+
"search_site": "Example Site",
186+
"timeout_ms": 2000,
187+
"ip_blocks": ["103.21.244.0/22", "103.22.200.0/22"],
188+
"found_websites": [
189+
["200", "https://103.21.244.5", "Example Site", "host.example.com."],
190+
["200", "https://103.21.244.12", "Another Site"],
191+
["403", "https://103.22.200.1", "Cloudflare"]
192+
],
193+
"timestamp": "2026-03-11T02:00:00+03:00"
194+
}
195+
```
196+
197+
### How It Works
198+
199+
1. **ASN Lookup** — Queries [RIPE Stat API](https://stat.ripe.net/) for all announced IP prefixes of the given ASN. Falls back to [RADB](https://www.radb.net/) if RIPE is unavailable.
200+
2. **IP Expansion** — Converts CIDR blocks to individual IP addresses (excluding network and broadcast addresses).
201+
3. **IP Shuffling** — Randomizes the scan order to avoid sequential patterns that may trigger WAF/firewall rules.
202+
4. **Parallel Scanning** — Distributes IPs across a configurable worker pool. Each worker:
203+
- Waits for the rate limiter (token bucket)
204+
- Adds random jitter (0-200ms)
205+
- Probes HTTPS first, falls back to HTTP
206+
- Extracts the `<title>` tag from the response
207+
5. **Batch DNS** — After scanning, performs parallel reverse DNS lookups for all discovered IPs to resolve hostnames.
208+
6. **Results** — Displays results with progress bar, prints summary, and offers export to file.
209+
210+
### Anti-Detection Details
211+
212+
ipmap uses multiple layers to avoid detection by WAFs (Cloudflare, Akamai, etc.):
213+
214+
| Layer | Technique |
215+
|-------|-----------|
216+
| **TLS** | Chrome 135 JA3/JA4 fingerprint via [uTLS](https://github.com/refraction-networking/utls) |
217+
| **Headers** | Exact Chrome 135 header order (Host → sec-ch-ua → User-Agent → Accept → Sec-Fetch → etc.) |
218+
| **User-Agent** | 17 different Chrome 133-135 variants (Windows/macOS/Linux) |
219+
| **Referer** | Random rotation: Google, Bing, DuckDuckGo, Yahoo |
220+
| **Scan Order** | IP addresses shuffled to prevent sequential detection |
221+
| **Timing** | 0-200ms random jitter between requests |
222+
| **Rate** | Configurable token bucket rate limiter |
223+
| **Proxy** | HTTP/HTTPS/SOCKS5 proxy with authentication support |
224+
89225
## License
90226

91227
This project is open-source and available under the MIT License.
@@ -97,7 +233,7 @@ Thanks go to these wonderful people
97233
<tr>
98234
<td align="center">
99235
<a href="https://github.com/ertugrulturan">
100-
<img src="" width="100px;" alt=""/>
236+
<img src="https://avatars.githubusercontent.com/u/189706154?v=4" width="100px;" alt=""/>
101237
<br />
102238
<sub>
103239
<b>Ertuğrul TURAN</b>

0 commit comments

Comments
 (0)