|
| 1 | +# External Reconnaissance Suite |
| 2 | + |
| 3 | +A comprehensive, modular external reconnaissance framework for penetration testing engagements. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +This suite provides a structured approach to external reconnaissance with the following features: |
| 8 | + |
| 9 | +- **Modular Task Architecture**: Easy to extend with new reconnaissance tasks |
| 10 | +- **Configurable Profiles**: Default, Quick, and Aggressive scanning profiles |
| 11 | +- **Comprehensive Tooling**: Integration with industry-standard tools |
| 12 | +- **Detailed Logging**: All outputs logged and timestamped |
| 13 | +- **Flexible Execution**: Run all tasks or specific individual tasks |
| 14 | + |
| 15 | +## Architecture |
| 16 | + |
| 17 | +``` |
| 18 | +run_external_recon_suite.sh # Main orchestrator |
| 19 | +├── tasks/ |
| 20 | +│ ├── 00-validate.sh # Input validation and CIDR expansion |
| 21 | +│ ├── 01-osint.sh # OSINT reconnaissance |
| 22 | +│ ├── 02-nmap.sh # Network mapping and port scanning |
| 23 | +│ ├── 03-http-scan.sh # HTTP/HTTPS reconnaissance |
| 24 | +│ └── 04-testssl.sh # SSL/TLS security testing |
| 25 | +├── config/ |
| 26 | +│ ├── default.conf # Default configuration |
| 27 | +│ ├── quick.conf # Fast scanning profile |
| 28 | +│ └── aggressive.conf # Comprehensive scanning profile |
| 29 | +└── README_RECON_SUITE.md # This file |
| 30 | +``` |
| 31 | + |
| 32 | +## Prerequisites |
| 33 | + |
| 34 | +### Required Tools |
| 35 | + |
| 36 | +- `bash` (4.0+) |
| 37 | +- `curl` |
| 38 | +- `jq` |
| 39 | +- `nmap` |
| 40 | + |
| 41 | +### Optional Tools (Recommended) |
| 42 | + |
| 43 | +- **OSINT**: `subfinder`, `dnsx`, `asnmap`, `cdncheck` |
| 44 | +- **HTTP**: `httpx`, `nuclei`, `gowitness`, `whatweb` |
| 45 | +- **SSL/TLS**: `testssl.sh` |
| 46 | + |
| 47 | +### Installation of Optional Tools |
| 48 | + |
| 49 | +```bash |
| 50 | +# Install Go (required for many tools) |
| 51 | +# macOS |
| 52 | +brew install go |
| 53 | + |
| 54 | +# Linux |
| 55 | +sudo apt install golang-go |
| 56 | + |
| 57 | +# Install ProjectDiscovery tools |
| 58 | +go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest |
| 59 | +go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest |
| 60 | +go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest |
| 61 | +go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest |
| 62 | +go install -v github.com/projectdiscovery/asnmap/cmd/asnmap@latest |
| 63 | +go install -v github.com/projectdiscovery/cdncheck/cmd/cdncheck@latest |
| 64 | + |
| 65 | +# Install other tools |
| 66 | +go install github.com/sensepost/gowitness@latest |
| 67 | + |
| 68 | +# Install testssl.sh |
| 69 | +git clone --depth 1 https://github.com/drwetter/testssl.sh.git ~/tools/testssl.sh |
| 70 | +sudo ln -s ~/tools/testssl.sh/testssl.sh /usr/local/bin/testssl.sh |
| 71 | + |
| 72 | +# Update nuclei templates |
| 73 | +nuclei -update-templates |
| 74 | +``` |
| 75 | + |
| 76 | +## Quick Start |
| 77 | + |
| 78 | +### 1. Prepare Your Engagement Directory |
| 79 | + |
| 80 | +```bash |
| 81 | +# Create engagement directory |
| 82 | +export ENGAGEMENT_DIR="/path/to/your/engagement" |
| 83 | +mkdir -p "${ENGAGEMENT_DIR}" |
| 84 | + |
| 85 | +# Create targets file (IPs, CIDRs, FQDNs) |
| 86 | +cat > "${ENGAGEMENT_DIR}/targets.txt" << EOF |
| 87 | +192.168.1.0/24 |
| 88 | +10.0.0.5 |
| 89 | +example.com |
| 90 | +EOF |
| 91 | + |
| 92 | +# Create domains file (for OSINT) |
| 93 | +cat > "${ENGAGEMENT_DIR}/domains.txt" << EOF |
| 94 | +example.com |
| 95 | +example.net |
| 96 | +EOF |
| 97 | +``` |
| 98 | + |
| 99 | +### 2. Set Environment Variables |
| 100 | + |
| 101 | +```bash |
| 102 | +export ENGAGEMENT_DIR="/path/to/your/engagement" |
| 103 | +export TARGETS_FILE="${ENGAGEMENT_DIR}/targets.txt" |
| 104 | +export DOMAINS_FILE="${ENGAGEMENT_DIR}/domains.txt" |
| 105 | +``` |
| 106 | + |
| 107 | +### 3. Run Reconnaissance |
| 108 | + |
| 109 | +```bash |
| 110 | +# Run with default configuration |
| 111 | +./run_external_recon_suite.sh |
| 112 | + |
| 113 | +# Run with quick scan profile |
| 114 | +./run_external_recon_suite.sh --config config/quick.conf |
| 115 | + |
| 116 | +# Run with aggressive scan profile |
| 117 | +./run_external_recon_suite.sh --config config/aggressive.conf |
| 118 | +``` |
| 119 | + |
| 120 | +## Usage Examples |
| 121 | + |
| 122 | +### Run Specific Task Only |
| 123 | + |
| 124 | +```bash |
| 125 | +# Run only OSINT |
| 126 | +./run_external_recon_suite.sh --task 01-osint |
| 127 | + |
| 128 | +# Run only Nmap scanning |
| 129 | +./run_external_recon_suite.sh --task 02-nmap |
| 130 | + |
| 131 | +# Run only HTTP scanning |
| 132 | +./run_external_recon_suite.sh --task 03-http-scan |
| 133 | +``` |
| 134 | + |
| 135 | +### Skip Specific Tasks |
| 136 | + |
| 137 | +```bash |
| 138 | +# Skip SSL/TLS testing |
| 139 | +./run_external_recon_suite.sh --skip 04-testssl |
| 140 | + |
| 141 | +# Skip multiple tasks |
| 142 | +./run_external_recon_suite.sh --skip 01-osint --skip 04-testssl |
| 143 | +``` |
| 144 | + |
| 145 | +### Dry Run Mode |
| 146 | + |
| 147 | +```bash |
| 148 | +# See what would be executed without running |
| 149 | +./run_external_recon_suite.sh --dry-run |
| 150 | +``` |
| 151 | + |
| 152 | +### List Available Tasks |
| 153 | + |
| 154 | +```bash |
| 155 | +./run_external_recon_suite.sh --list |
| 156 | +``` |
| 157 | + |
| 158 | +## Task Descriptions |
| 159 | + |
| 160 | +### 00-validate |
| 161 | + |
| 162 | +**Purpose**: Validate input files and expand CIDR ranges |
| 163 | + |
| 164 | +**What it does**: |
| 165 | +- Validates existence of required files and directories |
| 166 | +- Expands CIDR notation to individual IPs |
| 167 | +- Validates required and optional tools |
| 168 | +- Creates expanded target list for subsequent tasks |
| 169 | + |
| 170 | +**Outputs**: |
| 171 | +- `RECON/targets_expanded_*.txt` |
| 172 | + |
| 173 | +### 01-osint |
| 174 | + |
| 175 | +**Purpose**: Open-Source Intelligence gathering |
| 176 | + |
| 177 | +**What it does**: |
| 178 | +- Subdomain enumeration (subfinder) |
| 179 | +- DNS resolution and record retrieval (dnsx) |
| 180 | +- ASN mapping (asnmap) |
| 181 | +- CDN detection (cdncheck) |
| 182 | +- Microsoft 365/Azure AD reconnaissance |
| 183 | +- Certificate transparency log queries |
| 184 | + |
| 185 | +**Outputs**: |
| 186 | +- `RECON/osint_*/subfinder.json` |
| 187 | +- `RECON/osint_*/dnsx.json` |
| 188 | +- `RECON/osint_*/asnmap.json` |
| 189 | +- `RECON/osint_*/cdncheck.jsonl` |
| 190 | +- `RECON/osint_*/crtsh.json` |
| 191 | + |
| 192 | +### 02-nmap |
| 193 | + |
| 194 | +**Purpose**: Network mapping and port scanning |
| 195 | + |
| 196 | +**What it does**: |
| 197 | +- Host discovery scan |
| 198 | +- Top 1000 ports scan with service version detection |
| 199 | +- Optional: Full TCP port scan (1-65535) |
| 200 | +- Optional: UDP port scan on common ports |
| 201 | +- Optional: NSE vulnerability scanning |
| 202 | +- Service and OS detection |
| 203 | + |
| 204 | +**Outputs**: |
| 205 | +- `RECON/nmap_*/01_discovery.*` |
| 206 | +- `RECON/nmap_*/02_top_ports.*` |
| 207 | +- `RECON/nmap_*/live_hosts.txt` |
| 208 | +- `RECON/nmap_*/web_services.txt` |
| 209 | + |
| 210 | +### 03-http-scan |
| 211 | + |
| 212 | +**Purpose**: HTTP/HTTPS service reconnaissance and vulnerability scanning |
| 213 | + |
| 214 | +**What it does**: |
| 215 | +- HTTP/HTTPS service probing (httpx) |
| 216 | +- Technology detection |
| 217 | +- Vulnerability scanning with Nuclei templates: |
| 218 | + - CVEs |
| 219 | + - Known vulnerabilities |
| 220 | + - Exposures |
| 221 | + - Misconfigurations |
| 222 | + - Default credentials |
| 223 | + - Exposed panels |
| 224 | +- Screenshot capture (gowitness) |
| 225 | +- Technology fingerprinting (whatweb) |
| 226 | + |
| 227 | +**Outputs**: |
| 228 | +- `RECON/http_scan_*/httpx.json` |
| 229 | +- `RECON/http_scan_*/live_urls.txt` |
| 230 | +- `RECON/http_scan_*/nuclei_*.txt` |
| 231 | +- `RECON/http_scan_*/nuclei_all_findings.json` |
| 232 | +- `RECON/http_scan_*/screenshots/` |
| 233 | + |
| 234 | +### 04-testssl |
| 235 | + |
| 236 | +**Purpose**: SSL/TLS security testing |
| 237 | + |
| 238 | +**What it does**: |
| 239 | +- Comprehensive SSL/TLS testing |
| 240 | +- Cipher suite analysis |
| 241 | +- Protocol vulnerability detection |
| 242 | +- Certificate validation |
| 243 | +- Weak configuration identification |
| 244 | + |
| 245 | +**Outputs**: |
| 246 | +- `RECON/testssl_*/results/*.txt` |
| 247 | +- `RECON/testssl_*/results/*.json` |
| 248 | +- `RECON/testssl_*/results/*.html` |
| 249 | +- `RECON/testssl_*/aggregate_summary.txt` |
| 250 | +- `RECON/testssl_*/vulnerable_hosts.txt` |
| 251 | + |
| 252 | +## Output Structure |
| 253 | + |
| 254 | +After running the suite, your engagement directory will contain: |
| 255 | + |
| 256 | +``` |
| 257 | +/path/to/engagement/ |
| 258 | +├── targets.txt # Your input targets |
| 259 | +├── domains.txt # Your input domains |
| 260 | +├── RECON/ # All reconnaissance outputs |
| 261 | +│ ├── targets_expanded_*.txt # Expanded targets |
| 262 | +│ ├── osint_*/ # OSINT results |
| 263 | +│ ├── nmap_*/ # Nmap results |
| 264 | +│ ├── http_scan_*/ # HTTP scan results |
| 265 | +│ └── testssl_*/ # SSL/TLS test results |
| 266 | +├── OUTPUT/ |
| 267 | +│ └── TEE/ # Command output logs |
| 268 | +└── LOGS/ # Suite logs |
| 269 | +``` |
| 270 | + |
| 271 | +## Configuration |
| 272 | + |
| 273 | +### Environment Variables |
| 274 | + |
| 275 | +#### Required |
| 276 | +- `ENGAGEMENT_DIR` - Base directory for engagement outputs |
| 277 | +- `TARGETS_FILE` - Path to targets file |
| 278 | + |
| 279 | +#### Optional |
| 280 | +- `DOMAINS_FILE` - Path to domains file |
| 281 | +- `RECON_VERBOSE` - Enable verbose output (true/false) |
| 282 | +- `RECON_DRY_RUN` - Dry run mode (true/false) |
| 283 | + |
| 284 | +### Configuration Files |
| 285 | + |
| 286 | +Configuration files allow you to customize scanning behavior: |
| 287 | + |
| 288 | +```bash |
| 289 | +# Use custom configuration |
| 290 | +./run_external_recon_suite.sh --config /path/to/custom.conf |
| 291 | +``` |
| 292 | + |
| 293 | +See [config/default.conf](config/default.conf) for all available options. |
| 294 | + |
| 295 | +## Adding Custom Tasks |
| 296 | + |
| 297 | +To add a new reconnaissance task: |
| 298 | + |
| 299 | +1. Create a new task file in `tasks/` (e.g., `05-custom.sh`) |
| 300 | +2. Implement the task function: |
| 301 | + |
| 302 | +```bash |
| 303 | +#!/usr/bin/env bash |
| 304 | +set -uo pipefail |
| 305 | +IFS=$'\n\t' |
| 306 | + |
| 307 | +run_task_05_custom() { |
| 308 | + LOG info "Starting custom task" |
| 309 | + |
| 310 | + # Your task implementation here |
| 311 | + |
| 312 | + LOG pass "Custom task completed" |
| 313 | + return 0 |
| 314 | +} |
| 315 | +``` |
| 316 | + |
| 317 | +3. Update the main orchestrator to include your task: |
| 318 | + |
| 319 | +```bash |
| 320 | +# In run_external_recon_suite.sh |
| 321 | +TASK_ENABLED[05-custom]=true |
| 322 | +TASK_REQUIRED[05-custom]=false |
| 323 | +TASK_ORDER+=("05-custom") |
| 324 | +``` |
| 325 | + |
| 326 | +## Best Practices |
| 327 | + |
| 328 | +1. **Always use a dedicated engagement directory** to keep results organized |
| 329 | +2. **Start with quick.conf** to get a feel for the suite |
| 330 | +3. **Review logs** in `OUTPUT/TEE/` for detailed command outputs |
| 331 | +4. **Use --dry-run** first when testing new configurations |
| 332 | +5. **Keep tools updated** regularly (especially nuclei templates) |
| 333 | +6. **Respect rate limits** when scanning production systems |
| 334 | +7. **Always have authorization** before running reconnaissance |
| 335 | + |
| 336 | +## Troubleshooting |
| 337 | + |
| 338 | +### "Tool not found" errors |
| 339 | + |
| 340 | +Install missing tools using the prerequisites section above. |
| 341 | + |
| 342 | +### "Permission denied" errors |
| 343 | + |
| 344 | +Ensure you have write permissions to the engagement directory. |
| 345 | + |
| 346 | +### Nmap requires root |
| 347 | + |
| 348 | +Some Nmap scans (SYN scan, OS detection) require root: |
| 349 | + |
| 350 | +```bash |
| 351 | +sudo -E ./run_external_recon_suite.sh |
| 352 | +``` |
| 353 | + |
| 354 | +### Slow performance |
| 355 | + |
| 356 | +- Use `config/quick.conf` for faster scans |
| 357 | +- Disable full TCP scans: `NMAP_FULL_TCP_SCAN=false` |
| 358 | +- Reduce thread counts in configuration |
| 359 | +- Skip TestSSL for large target lists |
| 360 | + |
| 361 | +### Out of memory |
| 362 | + |
| 363 | +- Reduce `HTTPX_THREADS` and `NUCLEI_BULK_SIZE` |
| 364 | +- Process targets in smaller batches |
| 365 | +- Disable parallel mode |
| 366 | + |
| 367 | +## Integration with Existing Scripts |
| 368 | + |
| 369 | +This suite integrates with your existing reconnaissance scripts: |
| 370 | + |
| 371 | +- `m365_recon_NG.sh` - Automatically used in OSINT task |
| 372 | +- `dns_email_recon.sh` - Can be added as custom task |
| 373 | +- Common utilities from `common_utils.sh` - Automatically sourced |
| 374 | + |
| 375 | +## License |
| 376 | + |
| 377 | +This tool is for authorized security testing only. Always obtain proper authorization before scanning. |
| 378 | + |
| 379 | +## Support |
| 380 | + |
| 381 | +For issues or questions: |
| 382 | +1. Check the logs in `ENGAGEMENT_DIR/LOGS/` |
| 383 | +2. Review command outputs in `ENGAGEMENT_DIR/OUTPUT/TEE/` |
| 384 | +3. Run with `RECON_VERBOSE=true` for detailed output |
| 385 | + |
| 386 | +## Changelog |
| 387 | + |
| 388 | +### Version 1.0.0 (2026-01-03) |
| 389 | +- Initial release |
| 390 | +- Modular task architecture |
| 391 | +- Support for OSINT, Nmap, HTTP scanning, and SSL/TLS testing |
| 392 | +- Three scanning profiles (default, quick, aggressive) |
| 393 | +- Comprehensive logging and reporting |
0 commit comments