Skip to content

Commit fddb570

Browse files
authored
Merge pull request #8 from lordixir/main
feat: v2.2.1 - Anti-Detection Improvements & Performance Optimizations
2 parents adc05fa + 9d31921 commit fddb570

20 files changed

+1166
-255
lines changed

CHANGELOG.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## [2.2.1] - 2025-12-11
6+
7+
### Added
8+
- **Referer Header Rotation**: Random referer from Google, Bing, DuckDuckGo for more realistic requests
9+
- **Smart Jitter Function**: `config.AddSmartJitter()` with occasional long pauses (1-3s) for natural patterns
10+
- **uTLS Transport**: Chrome 131 TLS fingerprint support (ready for integration)
11+
- New config constants: `DialTimeout`, `MaxJitterMs`
12+
- Unified RNG functions in config: `GetRandomInt`, `GetRandomString`, `ShuffleStrings`
13+
14+
### Changed
15+
- Reduced jitter from 100-800ms to 0-200ms for faster scanning
16+
- Reduced timeouts for better performance:
17+
- TLS handshake: 10s → 5s
18+
- Response header: 10s → 5s
19+
- Dial timeout: 10s → 5s
20+
- Retry backoff: 500ms → 200ms
21+
- `ValidateTimeout` now uses `config.MinTimeout` constant
22+
- Updated GitHub URL to `sercanarga/ipmap`
23+
24+
### Fixed
25+
- Domain resolution failure with uTLS HTTP/2 compatibility
26+
- Hardcoded timeout values now use config constants
27+
28+
### Removed
29+
- ~500 lines of dead code from scanner.go
30+
- Unused uTLS dependencies (temporarily, readded for future use)
31+
32+
## [2.0.0] - 2025-12-10
33+
34+
### Added
35+
- Chrome 131 TLS fingerprint (JA3/JA4 spoofing)
36+
- Real Chrome header order for WAF bypass
37+
- Proxy support (HTTP/HTTPS/SOCKS5)
38+
- Custom DNS servers
39+
- Rate limiting (token bucket algorithm)
40+
- IP shuffling for firewall bypass
41+
- Graceful Ctrl+C handling with export option
42+
- Input validation for ASN, IP/CIDR formats
43+
- Verbose logging mode
44+
- JSON output format
45+
46+
### Changed
47+
- Complete rewrite of HTTP client
48+
- Improved concurrent worker management
49+
- Better error handling and recovery
50+
51+
---
52+
53+
## Version History
54+
- **2.1.0**: Anti-detection improvements, performance optimization
55+
- **2.0.0**: Major rewrite with anti-detection features
56+
- **1.0.0**: Initial release

CONTRIBUTING.md

Lines changed: 64 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ Thank you for your interest in contributing to ipmap! We welcome contributions f
2121
3. Make your changes
2222
4. Add or update tests as needed
2323
5. Ensure all tests pass (`go test ./... -v`)
24-
6. Commit your changes (`git commit -m 'Add amazing feature'`)
25-
7. Push to the branch (`git push origin feature/amazing-feature`)
26-
8. Open a Pull Request
24+
6. Run `go vet ./...` to check for issues
25+
7. Commit your changes (`git commit -m 'Add amazing feature'`)
26+
8. Push to the branch (`git push origin feature/amazing-feature`)
27+
9. Open a Pull Request
2728

2829
## Development Setup
2930

@@ -33,33 +34,91 @@ git clone https://github.com/sercanarga/ipmap.git
3334
cd ipmap
3435

3536
# Install dependencies
36-
go mod download
37+
go mod tidy
3738

3839
# Build the project
3940
go build -o ipmap .
4041

4142
# Run tests
4243
go test ./... -v
4344

45+
# Run tests with coverage
46+
go test ./... -v -cover
47+
48+
# Run static analysis
49+
go vet ./...
50+
4451
# Run with verbose output
4552
./ipmap -asn AS13335 -v
4653
```
4754

55+
## Project Structure
56+
57+
```
58+
ipmap/
59+
├── main.go # Entry point, CLI flags
60+
├── config/
61+
│ └── config.go # Global config, RNG, jitter functions
62+
├── modules/
63+
│ ├── scanner.go # Chrome 131 headers, uTLS transport
64+
│ ├── request.go # HTTP client with retry
65+
│ ├── resolve_site.go # Worker pool, IP scanning
66+
│ ├── get_site.go # Site discovery per IP
67+
│ ├── validators.go # Input validation
68+
│ ├── rate_limiter.go # Token bucket rate limiter
69+
│ └── ...
70+
├── tools/
71+
│ ├── find_asn.go # ASN scanning
72+
│ └── find_ip.go # IP block scanning
73+
├── bin/ # Cross-platform builds
74+
└── README.md
75+
```
76+
4877
## Code Style
4978

5079
- Follow Go conventions and best practices
5180
- Use meaningful variable and function names
5281
- Add comments for exported functions and complex logic
5382
- Keep functions focused and concise
5483
- Run `go fmt` before committing
84+
- Run `go vet` to catch common issues
5585

5686
## Testing
5787

5888
- Write tests for new features
5989
- Ensure all existing tests pass
60-
- Aim for good test coverage
90+
- Aim for good test coverage (current: ~30%)
6191
- Test edge cases and error conditions
92+
- Place tests in `*_test.go` files
93+
94+
### Running Tests
95+
96+
```bash
97+
# All tests
98+
go test ./... -v
99+
100+
# Specific package
101+
go test ./modules -v
102+
103+
# With coverage report
104+
go test ./... -v -cover
105+
106+
# Run benchmarks
107+
go test ./... -bench=.
108+
```
109+
110+
## Anti-Detection Guidelines
111+
112+
When modifying the scanner module:
113+
114+
1. **TLS Fingerprint**: Use `utls.HelloChrome_Auto` for latest Chrome fingerprint
115+
2. **Header Order**: Maintain exact Chrome header order (not alphabetical)
116+
3. **Accept-Encoding**: Include `zstd` for Chrome 131+
117+
4. **Jitter**: Use `config.AddJitter()` (0-200ms) or `config.AddSmartJitter()` (with occasional long pauses)
118+
5. **User-Agent**: Use Chrome 130+ versions only
119+
6. **Referer**: Rotate between Google, Bing, DuckDuckGo URLs
62120

63121
## License
64122

65123
By contributing to ipmap, you agree that your contributions will be licensed under the MIT License.
124+

README.md

Lines changed: 28 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ An open-source, cross-platform powerful network analysis tool for discovering we
77
- ASN scanning (Autonomous System Number) with IPv4/IPv6 support
88
- IP block scanning (CIDR format)
99
- HTTPS/HTTP automatic fallback
10-
- Firewall bypass techniques (IP shuffling, header randomization, jitter)
10+
- **Chrome 131 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)
1114
- Proxy support (HTTP/HTTPS/SOCKS5)
1215
- Custom DNS servers
1316
- Rate limiting (token bucket algorithm)
@@ -16,17 +19,27 @@ An open-source, cross-platform powerful network analysis tool for discovering we
1619
- Configurable concurrent workers (1-1000)
1720
- Real-time progress bar
1821
- Graceful Ctrl+C handling with result export
22+
- Input validation (ASN, IP/CIDR format checking)
23+
- Large CIDR block protection (max 1M IPs)
1924

2025
## Installation
2126

22-
Download the latest version from [Releases](https://github.com/lordixir/ipmap/releases) and run:
23-
27+
**From Releases:**
2428
```bash
29+
# Download from releases
2530
unzip ipmap.zip
2631
chmod +x ipmap
2732
./ipmap
2833
```
2934

35+
**Build from Source:**
36+
```bash
37+
git clone https://github.com/sercanarga/ipmap.git
38+
cd ipmap
39+
go mod tidy
40+
go build -o ipmap .
41+
```
42+
3043
## Usage
3144

3245
### Parameters
@@ -35,123 +48,39 @@ chmod +x ipmap
3548
-asn AS13335 # Scan all IP blocks in the ASN
3649
-ip 103.21.244.0/22 # Scan specified IP blocks
3750
-d example.com # Search for specific domain
38-
-t 2000 # Request timeout in milliseconds (auto-calculated if not set)
51+
-t 2000 # Request timeout in ms (auto if not set)
3952
--export # Auto-export results
4053
-format json # Output format (text or json)
41-
-workers 100 # Number of concurrent workers (default: 100)
54+
-workers 100 # Concurrent workers (default: 100)
4255
-v # Verbose mode
43-
-c # Continue scanning until completion
56+
-c # Continue until completion
4457
-proxy http://127.0.0.1:8080 # Proxy URL (HTTP/HTTPS/SOCKS5)
45-
-rate 50 # Rate limit (requests/second, 0 = unlimited)
46-
-dns 8.8.8.8,1.1.1.1 # Custom DNS servers
58+
-rate 50 # Rate limit (requests/sec, 0 = unlimited)
59+
-dns 8.8.8.8,1.1.1.1 # Custom DNS servers
4760
```
4861

4962
### Examples
5063

51-
**Basic ASN scan (auto timeout):**
5264
```bash
65+
# Basic ASN scan
5366
ipmap -asn AS13335
54-
```
5567

56-
**Find domain in ASN:**
57-
```bash
68+
# Find domain in ASN
5869
ipmap -asn AS13335 -d example.com
59-
```
6070

61-
**Scan IP blocks:**
62-
```bash
71+
# Scan IP blocks
6372
ipmap -ip 103.21.244.0/22,103.22.200.0/22
64-
```
6573

66-
**High-performance scan:**
67-
```bash
74+
# High-performance scan
6875
ipmap -asn AS13335 -workers 200 -v
69-
```
70-
71-
**Export results:**
72-
```bash
73-
ipmap -asn AS13335 -d example.com --export
74-
```
75-
76-
**JSON output:**
77-
```bash
78-
ipmap -asn AS13335 -format json --export
79-
```
80-
81-
## Proxy & Rate Limiting
82-
83-
ipmap supports HTTP, HTTPS, and SOCKS5 proxies for anonymous scanning.
84-
85-
**HTTP proxy:**
86-
```bash
87-
ipmap -asn AS13335 -proxy http://127.0.0.1:8080
88-
```
89-
90-
**SOCKS5 proxy (Tor):**
91-
```bash
92-
ipmap -asn AS13335 -proxy socks5://127.0.0.1:9050
93-
```
9476

95-
**Proxy with auth:**
96-
```bash
97-
ipmap -asn AS13335 -proxy http://user:[email protected]:8080
98-
```
99-
100-
**Rate limiting:**
101-
```bash
102-
ipmap -asn AS13335 -rate 50 -workers 50
103-
```
77+
# With proxy and rate limiting
78+
ipmap -asn AS13335 -proxy socks5://127.0.0.1:9050 -rate 50
10479

105-
**Full configuration:**
106-
```bash
80+
# Full configuration
10781
ipmap -asn AS13335 -d example.com -proxy http://127.0.0.1:8080 -rate 100 -workers 50 -dns 8.8.8.8 -v --export
10882
```
10983

110-
> **Note:** When using proxies, reduce worker count and enable rate limiting to avoid overwhelming the proxy.
111-
112-
## Firewall Bypass Features
113-
114-
ipmap includes built-in firewall bypass techniques:
115-
116-
- **IP Shuffling:** Randomizes scan order to avoid sequential pattern detection
117-
- **Header Randomization:** Rotates User-Agent, Accept-Language, Chrome versions, platforms
118-
- **Request Jitter:** Adds random 0-50ms delay between requests
119-
- **Dynamic Timeout:** Auto-adjusts timeout based on worker count
120-
121-
## Interrupt Handling (Ctrl+C)
122-
123-
Press Ctrl+C during scan to:
124-
1. Immediately stop all scanning
125-
2. View found results count
126-
3. Option to export partial results
127-
128-
## Building
129-
130-
```bash
131-
git clone https://github.com/lordixir/ipmap.git
132-
cd ipmap
133-
go build -o ipmap .
134-
```
135-
136-
## Testing
137-
138-
```bash
139-
go test ./... -v
140-
```
141-
142-
## Changelog (v2.0)
143-
144-
- ✅ Added IP shuffling for firewall bypass
145-
- ✅ Added request jitter (0-50ms random delay)
146-
- ✅ Added header randomization (language, chrome version, platform)
147-
- ✅ Fixed Ctrl+C interrupt handling (immediate stop)
148-
- ✅ Added dynamic timeout calculation based on workers
149-
- ✅ Added IPv6 support for ASN scanning
150-
- ✅ Improved error logging
151-
- ✅ Fixed result collection bug with high workers
152-
- ✅ Removed gzip to fix response parsing
153-
- ✅ Added scan statistics at completion
154-
15584
## License
15685

15786
This project is open-source and available under the MIT License.

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.2.1

build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ipmap Multi-Platform Build Script
22
# Builds for macOS (ARM64 + AMD64) and Linux (AMD64)
33

4-
$VERSION = "2.0"
4+
$VERSION = "2.2.1"
55
$APP_NAME = "ipmap"
66
$BUILD_DIR = "bin"
77

0 commit comments

Comments
 (0)