tbhm:02_discovery
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| tbhm:02_discovery [2026/05/14 09:18] – TBHM import drew | tbhm:02_discovery [2026/05/14 10:11] (current) – merge bbc ch5 recon techniques drew | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | # Discovery | + | ====== |
| - | ## Find the road less traveled | + | ===== Find the road less traveled |
| - | This means find the application (or parts of an application) less tested. In wide scoped projects the flagship application will most likely | + | This means find the application (or parts of an application) less tested. In wide scoped projects the flagship application will most liekly |
| - | - ^.acme.com scope is your friend | + | * ^.acme.com scope is your friend |
| - | - Find domains via Google (and others!) | + | |
| - | | + | |
| - | - Port scan for obscure web servers or services (on all domains) | + | |
| - | - Find acquisitions and the bounty acquisition rules | + | |
| - | | + | |
| - | - Functionality changes or re-designs | + | |
| - | - Mobile websites | + | |
| - | - New mobile app versions | + | |
| - | - Searching parent company by trademark or privacy policy | + | |
| - | ## Tool: Recon-ng script (enumall.sh) | + | ===== Tool: Recon-ng script (enumall.sh) |
| https:// | https:// | ||
| - | ## LMGTFY: Let Me GOOGLE That For You | + | ===== LMGTFY: Let Me GOOGLE That For You ===== |
| site: | site: | ||
| - | ## List of Mergers and Acquisitions: | + | ===== List of Mergers and Acquisitions: |
| https:// | https:// | ||
| - | ## Port Scanning | + | ===== Port Scanning |
| Port scanning is not just for Netpen! A full port scan of all your new found targets will usually yield #win: | Port scanning is not just for Netpen! A full port scan of all your new found targets will usually yield #win: | ||
| - | - separate webapps | + | * separate webapps |
| - | - extraneous services | + | |
| - | - Facebook had Jenkins Script console with no auth | + | |
| - | - IIS.net had rdp open vulnerable to MS12_020 | + | |
| - | ``` | + | '' |
| - | nmap -sS -A -PN -p- --script=http-title dontscanme.bro | + | |
| - | ``` | + | |
| (syn scan, OS + service fingerprint, | (syn scan, OS + service fingerprint, | ||
| + | |||
| + | |||
| + | |||
| + | ===== Zseano Recon Pipeline ===== | ||
| + | |||
| + | <code bash> | ||
| + | # Full subdomain pipeline | ||
| + | amass enum -brute -active -d target.com -o amass.txt | ||
| + | subfinder -d target.com >> amass.txt | ||
| + | cat amass.txt | sort -u | httprobe -p http:81 -p http:3000 -p https:8443 -c 50 | tee online.txt | ||
| + | cat amass.txt | dnsgen - | httprobe >> online.txt | ||
| + | cat online.txt | aquatone | ||
| + | |||
| + | # Historical URLs | ||
| + | gau target.com | sort -u > gau.txt | ||
| + | waybackurls target.com | sort -u >> gau.txt | ||
| + | </ | ||
| + | |||
| + | **Google dorks:** | ||
| + | < | ||
| + | site: | ||
| + | site: | ||
| + | </ | ||
| + | |||
| + | **GitHub/ | ||
| + | |||
| + | **Subdomain keywords to prioritize: | ||
| + | |||
| + | * [[zseano: | ||
| + | |||
| + | |||
| + | ====== BBC Ch 5: Recon -- Expanded Techniques ====== | ||
| + | |||
| + | //Merged from Bug Bounty Bootcamp Ch 5 by Vickie Li// | ||
| + | |||
| + | ===== Manually Walking the Application ===== | ||
| + | |||
| + | Before any tools, manually browse every feature: | ||
| + | * Click every link, use every function (payments, uploads, events, admin) | ||
| + | * Create accounts at every privilege level | ||
| + | * Note all data entry points -- these are your attack surface | ||
| + | |||
| + | ===== Google Dorking ===== | ||
| + | |||
| + | | Operator | Example | Use | | ||
| + | |---|---|---| | ||
| + | | `site:` | `site: | ||
| + | | `inurl:` | `inurl: | ||
| + | | `intitle:` | `intitle:" | ||
| + | | `filetype:` | `filetype: | ||
| + | | `-` | `"how to hack" -php` | Exclude term | | ||
| + | |||
| + | < | ||
| + | site: | ||
| + | site: | ||
| + | site: | ||
| + | site: | ||
| + | </ | ||
| + | |||
| + | Check the **Google Hacking Database (GHDB)** at exploit-db.com/ | ||
| + | |||
| + | ===== WHOIS, IPs, and ASNs ===== | ||
| + | |||
| + | < | ||
| + | whois facebook.com | ||
| + | nslookup facebook.com | ||
| + | whois 157.240.2.35 | ||
| + | whois -h whois.cymru.com 157.240.2.35 | ||
| + | </ | ||
| + | |||
| + | If the org has a dedicated ASN (own IP block), all IPs in the range belong to them. | ||
| + | |||
| + | **Reverse WHOIS:** search ViewDNS.info by org name/email to find all domains owned by the same entity. | ||
| + | |||
| + | ===== Certificate Parsing ===== | ||
| + | |||
| + | < | ||
| + | curl " | ||
| + | </ | ||
| + | |||
| + | Returns all hostnames in the cert's Subject Alternative Name field -- reveals subdomains across all services. | ||
| + | |||
| + | ===== Subdomain Enumeration ===== | ||
| + | |||
| + | < | ||
| + | sublist3r -d example.com | ||
| + | gobuster dns -d example.com -w / | ||
| + | amass enum -d example.com | ||
| + | sort -u wordlist1.txt wordlist2.txt > combined.txt | ||
| + | </ | ||
| + | |||
| + | Pattern-based: | ||
| + | |||
| + | ===== Service and Port Enumeration ===== | ||
| + | |||
| + | < | ||
| + | nmap example.com -sV # open ports + version detection | ||
| + | </ | ||
| + | |||
| + | Passive alternatives: | ||
| + | |||
| + | Non-standard ports (8080, 8443, 3000, 8888) often host admin panels, dev services, or debug interfaces. | ||
| + | |||
| + | ===== Directory Brute-Forcing ===== | ||
| + | |||
| + | < | ||
| + | ./ | ||
| + | gobuster dir -u https:// | ||
| + | </ | ||
| + | |||
| + | * 200: accessible -- check the content | ||
| + | * 403: exists but protected -- attempt bypass (HTTP method, path normalization, | ||
| + | * 404: doesn' | ||
| + | |||
| + | Screenshot all found pages with **EyeWitness** for fast visual triage. | ||
| + | |||
| + | ===== Spidering ===== | ||
| + | |||
| + | OWASP ZAP: Tools > Spider. Feed a starting URL; ZAP recursively visits all linked pages and builds a site map. Good for finding hidden endpoints not linked from the main nav. | ||
| + | |||
| + | ===== S3 Buckets ===== | ||
| + | |||
| + | < | ||
| + | aws s3 ls s3:// | ||
| + | aws s3 cp s3:// | ||
| + | |||
| + | # Write test (clean up after): | ||
| + | aws s3 cp testfile s3:// | ||
| + | aws s3 rm s3:// | ||
| + | </ | ||
| + | |||
| + | Tools: **lazys3**, **GrayhatWarfare** (buckets.grayhatwarfare.com), | ||
| + | |||
| + | Exposed buckets can contain credentials, | ||
| + | |||
| + | ===== GitHub Recon ===== | ||
| + | |||
| + | < | ||
| + | # Search code for secrets | ||
| + | # GitHub code search: org: | ||
| + | # or | ||
| + | trufflehog git https:// | ||
| + | gitrob analyze COMPANY_NAME | ||
| + | </ | ||
| + | |||
| + | Look at: | ||
| + | * Issues and Commits sections for unresolved bugs and security patches | ||
| + | * Config files for credentials, | ||
| + | * Outdated dependencies -- cross-reference with CVE database | ||
| + | * Blame and History for recently removed secrets | ||
| + | |||
| + | Validate credentials: | ||
| + | |||
| + | ===== OSINT ===== | ||
| + | |||
| + | * **Job listings** -- reveal tech stack; " | ||
| + | * **LinkedIn** -- employee skills = company tech; engineers' | ||
| + | * **Pastebin** -- search the org name; engineers sometimes paste source code or server logs | ||
| + | * **SlideShare** -- conference slides often reveal internal architecture | ||
| + | * **Wayback Machine** + **waybackurls** -- extract all archived URLs; find old endpoints and forgotten subdomains | ||
| + | |||
| + | ===== Tech Stack Fingerprinting ===== | ||
| + | |||
| + | < | ||
| + | curl -I https:// | ||
| + | # Server: Apache/ | ||
| + | # X-Powered-By: | ||
| + | # X-Generator: | ||
| + | # Set-Cookie: PHPSESSID=... | ||
| + | # Set-Cookie: JSESSIONID=... | ||
| + | </ | ||
| + | |||
| + | * View source: search for " | ||
| + | * File extensions in URLs: `.php`, `.asp`, `.cfm`, `.jsp` | ||
| + | * Directories: | ||
| + | * Browser extension: **Wappalyzer** | Website: **BuiltWith.com** | **StackShare.io** | ||
| + | * **Retire.js** for outdated JavaScript libraries | ||
| + | |||
| + | Once you have the version, check CVE database (cve.mitre.org) for public exploits. | ||
| + | |||
| + | ===== Recon Bash Script ===== | ||
| + | |||
| + | <code bash> | ||
| + | #!/bin/bash | ||
| + | # ./recon.sh -m [nmap-only|dirsearch-only|crt-only] domain1 domain2 | ||
| + | |||
| + | PATH_TO_DIRSEARCH="/ | ||
| + | |||
| + | nmap_scan() | ||
| + | dirsearch_scan() { $PATH_TO_DIRSEARCH/ | ||
| + | crt_scan() | ||
| + | |||
| + | while getopts " | ||
| + | case $OPTION in | ||
| + | m) MODE=$OPTARG ;; | ||
| + | esac | ||
| + | done | ||
| + | |||
| + | for i in " | ||
| + | DOMAIN=$i | ||
| + | DIRECTORY=${DOMAIN}_recon | ||
| + | mkdir -p $DIRECTORY | ||
| + | |||
| + | case $MODE in | ||
| + | nmap-only) | ||
| + | dirsearch-only) dirsearch_scan ;; | ||
| + | crt-only) | ||
| + | *) nmap_scan; dirsearch_scan; | ||
| + | esac | ||
| + | |||
| + | TODAY=$(date) | ||
| + | echo "Scan: $DOMAIN -- $TODAY" | ||
| + | [ -f $DIRECTORY/ | ||
| + | [ -f $DIRECTORY/ | ||
| + | [ -f $DIRECTORY/ | ||
| + | done | ||
| + | </ | ||
tbhm/02_discovery.1778746727.txt.gz · Last modified: by drew
