Information Gathering#
Information Gathering: Why It Matters#
Information gathering is the first and most important phase of web application security testing. In this stage, a tester collects as much information as possible about the target website or application.
-
Understanding the Target
Helps identify the website structure, technologies used, servers, domains, and frameworks.
-
Identifying Attack Surface
Reveals entry points such as subdomains, directories, APIs, login pages, and parameters that could be tested for vulnerabilities.
-
Finding Potential Weaknesses
Information like software versions, plugins, and configurations can expose known vulnerabilities.
-
Planning the Security Testing
The gathered data helps security testers decide which tools, techniques, and attacks to use.
-
Reducing Time and Effort
Proper reconnaissance helps focus on the most vulnerable areas instead of testing blindly.
Types#
- Active Recon
It is a process to gather information by directly interacting with the target.
- Passive Recon
It is a process to gather information without interacting with the target.
Types of Information#
- Subdomains
- Data Breaches
- Endpoints
- Usernames
- Server side technology
Passive Recon#
Tech Profiling#
These are browser extensions that helps to map the tech profile of the web application.
-
Wappalyzer -
WhatRuns -
BuiltWith -
nucleiThis tool helps to find out the technology stack, CVEs, Missing HTTP headers etc and uses nuclei templates.
nuclei -u http://target.com -f --headless-fused for following redirects--headlesshelps to run the tool in browser environment
Meta Files#
robots.txtsitemap.xmlhumans.txtsecurity.txt
Search Engines#
- Shodan
- DuckDuckGo
- Baidu
- ZoomEye
- Censys
- AlienVault (https://otx.alienvault.com/
)
Dorking#
-
GoogleFilter Description Example intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"inurl Searches for a URL matching one of the keywords. inurl:"keyword"allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"allintitle Searches for occurrences of keywords all at a time. allintitle:"keyword"site Specifically searches that particular site and lists all the results for that site. site:"www.google.com"filetype Searches for a particular filetype mentioned in the query. filetype:"pdf"cache Shows the version of the web page that Google has in its cache. cache:www.google.comsite: target.com filetype: envsite:target.com intext:password intext:username intext:secretsite: target.com inurl: credentials inurl: password -
Githubhttps://github.com/RobinRana/githubRecon/blob/main/Gdorklinks.sh
This is an automated script that helps to create some of the dorks to search through the public github repositories.
bash Gdorklink.sh example.com
Acquisitions#
An acquisition is a business transaction where one company purchases another, gaining control through the purchase of its shares or assets
- One can gather acquisitions from
crunchbase
https://www.crunchbase.com/discover/acquisitionsASN (Autonomous System Numbers)#
It is a unique identifier assigned to an Autonomous System (AS), which is a collection of IP networks under a single administrative entity, such as an ISP or a large organization.
- From online at bgp.he.net
https://bgp.he.net/BGP View API
curl -s https://api.bgpview.io/search?query_term=<company_name> | jq -r | grep -i '"asn"' | cut -d : -f2 | tr -d ','Nmap
nmap --script=asn-query.nse -T2 -Pn target.comAmass Intel#
https://github.com/owasp-amass/amass
- Amass intel scan can be used to extract subdomains, apex domains, IPs from ASN
amass intel -asn 1234- Automated bash script
#!/bin/bash
# Save the file with name ASN containing the ASN numbers (eg: ASN1234)
for i in $(cat ASN)
do
x=$(echo "$i" | tr -d 'ASN')
output=$(amass intel -asn "$x")
echo "$output"
doneShosubgo#
https://github.com/incogbyte/shosubgo
- It is shodan based tool to extract subdomains
shosubgo -d example.com -s shodan_api_key_here-dis used to specify the domain name-sis used to specify the shodan API key which one can get from their shodan account
Karma v2#
https://github.com/Dheerajmadhukar/karma_v2
- A shodan based tool collect the subdomains through Osint
bash karmav2 -d example.com -l -1 -deep-dis used to specify the target domain-lis used to specify the number of results to download-deepflag allow to support all modules- Collecting the subdomains and apex domains from the output directory
awk -F '::' '{for (i=1; i<=NF; i++) if ($i ~ /^[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/) print $i}' <file_name_here>- Collecting the IPv4 addresses
awk -F '::' '{for (i=1; i<=NF; i++) if ($i ~ /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/) print $i}' <file_name_here>Cloud#
- One can gather cloud dumped information from **
https://kaeferjaeger.gay/**
- An automated script
echo "[*] Extracting domains, ips from cloud"
platforms=(amazon google microsoft digitalocean oracle)
mkdir cloud
for i in $platforms; do mkdir cloud/$i; cd cloud/$i; wget https://kaeferjaeger.gay/sni-ip-ranges/$i/ipv4_merged_sni.txt; cd ../../ ;done
cat cloud/*txt | grep -Po "(.+\.$1)" | cut -d '-' -f1 | tr -d ':[],' | sed 's/443/\ /g' > ../assets/ip/cloud.ips
cat cloud/*txt | cut -d '-' -f3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 | sed 's/\ /\n/g' | grep -Po "(.+\.$1)" | tr -d ',[]' | sort -u > ../assets/domain/cloud.sub-domains
echo "[-]Done"whoxy.com#
https://api.whoxy.com/?key=<your_api_key_here>&reverse=whois&keyword=<company_name_here>&mode=domainsAd / Analytic Tracker Code#
When websites use third-party services like Google Analytics, New Relic, or similar analytics tools, they embed unique tracking codes (usually in the form of JavaScript snippets) into their pages. These codes help track visitor behavior, monitor performance, or manage ads across different domains.
- Same Tracking Codes Across Domains: Often, an organization uses the same analytics tracking codes across multiple domains or subdomains. For example, if a company owns multiple websites or web applications, they might use the same Google Analytics ID on all of them to aggregate data.
- Collect the builtwith cookie from ⇒
https://pro.builtwith.com/ getrelationship.py
https://github.com/m4ll0k/BBTz/blob/master/getrelationship.py
python3 getrelationship.py example.com <the-builwith-cookie>Github-Subdomains#
https://github.com/gwen001/github-subdomains
- This Go tool performs searches on GitHub and parses the results to find subdomains of a given domain.
- Get your github api key from ⇒
https://github.com/settings/tokens
github-subdomains -d example.com -t github_api_key_here -o outputfile.txtSubreconGPT#
https://github.com/jhaddix/SubreconGPT
chaos -d example.com --key your_chaos_key_here | python subrecongpt.py --apikey YOUR_OPENAI_API_KEYCrt.sh#
- crt.sh
can be used to get the Certificate Transparency Logs. Certificate transparency is the process to verify the assigned SSL certificates.
- Check certificate transparency from ⇒
https://crt.sh
curl -s https://crt.sh/\?q=<company_domain_name>\&output=json | jq . | grep 'common_name' | tr -d ',":' | awk '{print $2}' | sort -uAmass enum#
amass enum -brute -d example.com -w wordlists.txt -r resolvers.txt enums the operational module that carries out the actual asset discovery and network mapping process for a given domain-bruteto brute-force-rfor resolvers that one can download from here ⇒ https://github.com/blechschmidt/massdns/blob/master/lists/resolvers.txt
Subfinder#
subfinder is a subdomain discovery tool that returns valid subdomains for websites, using passive online sources. It has a simple, modular architecture and is optimized for speed.
subfinder -d example.com -o output.txtBBOT#
This tool is used to scan the target domain and look for CVEs, CNAMEs, s3 buckets etc
https://github.com/blacklanternsecurity/bbot
bbot -m otx -t example.comPuredns#
puredns is a fast domain resolver and subdomain bruteforcing tool that can accurately filter out wildcard subdomains and DNS poisoned entries.
https://github.com/d3mondev/puredns
puredns bruteforce wordlists.txt example.com -r resolvers.txt -w output.txtDnsgen#
Used for permuted scanning and find the new subdomains
cat sub-domain-file.txt | dnsgen - | puredns resolve -r resolvers.txt httprobe#
This tool is used to look for live URLs
cat all_subdomains.txt | httprobe > live_domains.txtWebanalyze#
This tool helps to look for the technology stack
https://github.com/rverton/webanalyzeWaymore#
The idea behind waymore is to find even more links from the Wayback Machine (plus other sources) than other existing tools.
https://github.com/xnl-h4ck3r/waymore
waymore -i target.com -mode BxnLinkFinder#
It extracts different URLs and endpoints from the JS and HTML files of the target domain.
https://github.com/xnl-h4ck3r/xnLinkFinder
python3 xnLinkFinder.py -i ~/directory/to/xml/files -sp https://www.target.com -sf target.com -o output.txtJavascript Analysis#
-
JS Finderhttps://github.com/kacakb/jsfinder?tab=readme-ov-file
- Reading URLs from the JS files
echo http://target.com | jsfinder -read -s -o out.txtjsfinder -l list.txt -read -s -o out.txt -
Secret FinderSecretFinder is a python script based on LinkFinder
, written to discover sensitive data like apikeys, accesstoken, authorizations, jwt,..etc in JavaScript files. It does so by using jsbeautifier for python in combination with a fairly large regular expression. The regular expressions consists of four small regular expressions. These are responsible for finding and search anything on js files.
https://github.com/m4ll0k/SecretFinder
python3 SecretFinder.py -i http://target.com -e -H "Cookie: cookie-here" -o cli-oto specify the output method- cli
- results.html
SSL / TLS Scanner#
This tool helps to scan the SSL and TLS flaws from command line
https://github.com/testssl/testssl.sh
./testssl.sh HOST_OR_IPBurpExtension - SSL Scanner
theHarvester#
- This helps to find subdomains, URLs, email addresses
theHarvester -d target.com -b all-doption is used to specify the target domain-bstands for data source (search engine or service).allmeans the tool will search all available data sources such as:- Bing
- Yahoo
- DuckDuckGo
- Shodan
- other OSINT sources
Automated Recon Frame-works#
-
Recon-ng -
Recon For the Winhttps://github.com/six2dez/reconftw
./reconftw.sh -d target.com <flags> <options> -
SpiderFoot
Breach Databases#
Breach databases are online services used in Cybersecurity and Open Source Intelligence (OSINT) to check whether emails, usernames, passwords, or other personal data have been exposed in past data breaches.
-
HaveIBeenPwned- Allows users to check if their email or phone number was involved in a data breach.
- Searches through billions of leaked accounts from breaches such as websites, apps, or online services.
- Shows:
- Which website was breached
- What type of data was leaked (email, password, name, etc.)
-
Breached- A more advanced breach database search engine used by security researchers and penetration testers.
- Allows searching by:
- Username
- Domain
- IP address
- Name
It can reveal:
- Emails
- Password hashes
- Usernames
- Phone numbers
- IP addresses
Rocket Reach#
- Purpose
- Employee contact details
- Role discovery
- Executive targeting
- Search
- Company name
- Person name
Hunter.io#
- Purpose
- Discover verified corporate emails
- Email pattern recognition
curl "https://api.hunter.io/v2/domain-search?domain=target.com&api_key=YOUR_API_KEY"URL Scan#
- Purpose
- Technology Stack
- Endpoints
- Analyze JS
domain: "linkedin.com"Virus Total#
- Purpose
- Subdomain discovery
- Historical IP mapping
- Infrastructure correlation
curl --request GET --url https://www.virustotal.com/api/v3/domains/target.com --header 'x-apikey: YOUR_API_KEY'Employee Enumeration Techniques#
-
Github Enumeration
https://github.com/gwen001/github-search/blob/master/github-employees.py
python3 github-employees.py -m github -f facebook-dev-cookie -t "company-name-here"
Active Recon#
Domain Registration Information#
-
whois- Helps to extract the registrar information and nameservers
whois target.com
DNS Enumeration#
These tools helps to find different records like
-
A
-
AAAA
-
TXT
-
MX
-
CNAME
-
NS
-
dnsrecondnsrecon -d target.com -
fiercefierce --domain target.com -
dnsenumdnsenum target.com -
digdig axfr @<name-server-here> example.com- Here we are using the
axfrprotocol to zone transfer the DNS records of the target domain
- Here we are using the
-
host- It helps to look for the A and AAAA records of the domain.
host target.com
Firewall Detection#
-
wafw00f- It extract the firewall information of the target
wafw00f -a target.com
Web Crawlers#
These helps to find different URLs and endpoints by active crawling and extracting the JS files
-
gospiderhttps://github.com/jaeles-project/gospider
gospider -q -s https://example.com -w -d 0 -H "Cookie: cookie-here"- -q is used to extract extra information like subdomains, URLs, status code etc
- -w is used to include the subdomains while crawling
- -d is used to control the depth level
- -H is used to add any custom header with a value
-
hakrawlerhttps://github.com/hakluke/hakrawler
echo https://example.com | hakrawler -subs -d 3- -subs is used to include the subdomains during crawls
- -d is used to control the depth of crawl
-
katanahttps://github.com/projectdiscovery/katana
katana -u https://example.com
Endpoints Finding#
-
LinkFinder- This tool extract all the URLs and endpoints from JS files
https://github.com/GerbenJavado/LinkFinder
python3 linkfinder.py -i https:/example.com -d- -i flag takes input a domain, URL, JS file
- -d is used to enable the domain filtering mode, so it will extract only the internal endpoints
-
Subdomanizer- SubDomainizer is a tool designed to find hidden subdomains and secrets present is either webpage, Github, and external javascripts present in the given URL. This tool also finds S3 buckets
https://github.com/nsonaniya2010/SubDomainizer
python3 SubDomainizer.py -u https://example.com
Web Cloning#
-
httrack- This tool is used to clone the target application and create a directory path along with files in the local system
httrack
Directory Brute-forcing#
-
ffufffuf -w /path/to/wordlists:FUZZ -u http://target.com -e .php -H "Host: FUZZ.target.com" -mc all -fc 400 -fs 162- -w to specify the wordlists
- -u is used to specify the target URL
- -e used for adding extension
- -H is sued for adding custom HTTP header
- -mc is the match code and with all value it will show every result
- -fc is used for filtering the results on the basis of status code
- -fs is used to filter out the results on the basis of size of the http response.
-
gobustergobuster dir -w /usr/share... -u http://evil.com -x .php,.txt -H "User-Agent: ..." -s 200-500 -hl 162diris a module to start a directory brute-forcing- -x used for extension
- Simple Host Header Injection
- Via Middleware
- Using Dangling Markup Injection
- -s is used to include all the status code results
- -hl used to filter out the size of the response
-
dirsearchdirsearch -u http://target.com -i 200-500 -x 404 -e php,txt -r -H "Cookie: cookie-here" --exclude-sizes=162- -u is used to specify the URL
- -i for including the responses in the results
- -x for excluding the responses in the results
- -e is used for including the extensions
- -r is used for recursive directory bruteforcing
- -H is used to include the custom HTTP headers
--exclude-sizesis used to filter out the HTTP response sizes
-
feroxbusterferoxbuster -u http://target.com -w <wordlist> -x pdf,php,txt -r -d 2 -H "Cookie: cookie-here"- -x is used to specify the extensions
- -H is used to add the custom headers
- -r is used for recursive mode
- -d is used to specify the recursion depth for brute-forcing the directories
Subdomain Brute-forcing#
-
ffufffuf -u http://target.com -w /usr/share/...:FUZZ -H "Host: FUZZ.target.com" -mc all -fc 404 -fs 162-mc allis used to list all status code results- -fc is used to filter out the stratus codes
- -fs is used to filter out the results on the basis of response size.
-
dnsenumdnsenum --enum example.com -f /usr/sahre/wordlists/.. -renumenables full DNS enumeration on the target- -f is used to specify the wordlists
- -r is sued to enables the recursive enumeration of the target domain
-
gobustergobuster dns -d example.com -w wordlist.txt- dns is used to enable the subdomain enumeration mode
- -d is used to specify the target domain name
- -w is used to specify the wordlists
Parameters Discovery#
-
ArjunArjun can find query parameters for URL endpoints. If you don’t get what that means, it’s okay, read along.
https://github.com/s0md3v/Arjun
arjun -u http://example.com/user/profile --headers "Cookie: cookie-here" -t 100 -d 1000-uto specify the URL endpoint--headersto add custom headers-tfor threads-dfor delay between two requests-ito scan all the endpoints from a list of targets
-
x8The tool aids in identifying hidden parameters that could potentially be vulnerable or reveal interesting functionality that may be missed by other testers. Its high accuracy is achieved through line-by-line comparison of pages, comparison of response codes, and reflections.
x8 -u http://url1.com http://url2.com -w <wordlist> -X GET -H "Cookie: cookie-here" -d 1000-dis used for delay between two requests
Port Scanning#
-
nmaphttps://nmap.org/- This tool helps to scan for open ports and the services running one those.
nmap -sV -A -sC -Pn -T3 -p- -oA nmap/results 10.10.10.10- -sV is used to specify the version enumeration
- -A is sued to enable the agresive scanning
- -sC is used to enable the nmap by default scripts
- -Pn is used to specify the nmap tool for not sending any ICMP packets
- -T is used to epcify the scanning speed and it has different values like 2,3.4,5 and by default is set to 3
- -p is used to specify the port number and -p- is used to specify the all ports
- -oA is used for saving the output in all formats
-
rustscan- The Modern Port Scanner. Find ports quickly (3 seconds at its fastest). Run scripts through our scripting engine (Python, Lua, Shell supported).
https://github.com/bee-san/RustScan
rustscan --addresses 10.10.10.10/24 -t 500 -b 1500 -- -A- -t is used for specifying the number of threads
- -b is used for specifying the batch size, like here in one batch it scan 1500 ports. Rustscan does not scan all the ports at once
- -A option is used for passing the data to nmap inputs
Scanning Network Range#
-
Scanning an entire subnet
nmap 172.162.1.0/24
References:#
https://medium.com/dvlpr/penetration-testing-methodology-part-1-6-recon-9296c4d07c8a
https://blog.fikara.io/information-gathering-in-bug-bounty
https://www.intigriti.com/researchers/blog/hacking-tools/hunting-for-secrets-in-bug-bounty-targets
https://www.yeswehack.com/learn-bug-bounty/recon-series-recap-reconnaissance-footprinting
https://www.recordedfuture.com/threat-intelligence-101/tools-and-technologies/osint-tools