Information Gathering
Itβs a passive or active way of collecting information about your target, without directly interacting with the host/services. You scope out your attack surface.
Eg β Find domain, subdomains, IP-ranges, SSL/TLS certificates, public web pages, API endpoints, past breaches, public github repositories.
Tools
Subdomains - Subfinder, OWASP Amass, Sublist3r, nmmapper.com(website)
SSL/TLS cert - Qualys SSL Labs, crt.sh(website)
Past data breaches involving API endpoints - https://escape.tech/resources/api-threat-landscape
Webpages β robots.txt, sitemap.xml, Google dorking, Gobuster, Wayback Machine
Google Dorking Commands
Basics
site:example.com
Shows results for the domain example.com only
site:*.example.com
All subdomains of example.com (e.g. mysite.example.com)
For Login Pages
π
site:example.com inurl:admin
π
site:*.example.com inurl:admin/login
β (βadmin loginβ) use quotes for multiword phrases
π
site:*.example.com intitle:login/admin
β (βloginβ / βadminβ / βlogin pageβ) use quotes for exact words
Directory Listing
π
site:*.example.com intitle:"Index of /"
β very useful and powerful
π
site:*.example.com intitle:"index of" "parent directory"
β finds pages with<title>Index of</title>containing βparent directoryβ
π
site:*.example.com inurl:ftp
β old but sometimes used for files/backups
π
site:*.example.com inurl:wp-content
β for WordPress sites
Finding Files
π
site:example.com ext:xls OR ext:csv OR ext:doc
π
site:example.com (ext:pdf OR filetype:pdf)
β ext:pdf is more precise than filetype:pdf (other: txt, robots.txt, sitemap, docx, xlsx, log, xml)
π
site:example.com filetype:env
β try env, ini, sql, bak for sensitive info
Subdomain Enumeration
Websites
- π crt.sh
- π pentest-tools.com/information-gathering/find-subdomains-of-domain
Tools
- π οΈ sublist3r - CLI tool for getting all the subdomains of a domain.
step 1 βgit clone https://github.com/aboul3la/Sublist3r.git
step 2 βcd ~/Sublist3r
step 3 βpython3 -m venv venv
step 4 βsource venv/bin/activate
step 5 βpip install -r requirements.txt
step 6 βpython sublist3r.py -d example.com
step 7 βpython sublist3r.py -d example.com > subdomains.txt
step 8 βdeactivate
for step 6 - run inside the Sublist3r directoryβwhere the sublist3r.py file is located.
for step 7 - run if you want to save the result in a file.
for step 8 - after using you can type to exit out of venv -> virtual environment
- shodan / spiderfoot - browsers for advance search
Directory and File Enumeration - (Gobuster)
- Gobuster supports both protocols, and you can specify the target URL using either http:// or https://. When using HTTPS, you may encounter certificate validation errors, especially with self-signed certificates, which can be bypassed using the -k or βno-tls-validation flag to skip SSL certificate verification.