Conference notes: How to Differentiate Yourself as a Bug Bounty Hunter (OWASP Stockholm)
Posted in Conference notes on November 7, 2018
Posted in Conference notes on October 17, 2018
Hi, these are the notes I took while watching the “Practical recon techniques for bug hunters & pen testers” talk given by Bharath Kumar on LevelUp 0x02 / 2018.
This talk is about some practical recon techniques for bug hunters & pentesters. It’s a continuation of Bharath’s talk about niche subdomain enumeration techniques.
Reconnaissance is the act of gathering preliminary data or intelligence on your target. The data is gathered in order to better plan for your attack. Reconnaissance can be performed actively or passively.
site:
for vertical correlationip:
for horizontal correlationVirusTotal runs its own passive DNS replication service, built by storing DNS resolutions performed when visiting URLs submitted by users
Can be queried using API: https://www.virustotal.com/ui/domains/example.com/subdomains?limit=40
Tool to automate it: virustotal_subdomain_enum.py
python virustotal_subdomain_enum.py example.com 20
Tip: Use shell functions to quickly perform some recon tasks (add them to ~/.bashrc
)
declare -f find-subdomains-vt
find-subdomains-vt() {
curl -s https://www.virustotal.com/ui/domains/$1/subdomains\?limit\=$2 | jq.data[].id
}
find-subdomains-vt eff.org 20
%eff.org
python crtsh_enum_psql.py eff.org
python3 ct.py example.com | ./bin/massdns -r resolvers.txt -t A -a -o -w results.txt -
find-cert() {
curl -s https://certspotter.com/api/v0/certs?domain=$1 | jq -c '.[].dns_names' | grep -o '"[^"\+"';
}
curl -L -sd "api_key=API-KEY&q=Organization:\"tesla\"&response_type=0
python censys_enumeration.py --verbose domains.txt
python csp_parser.py https://flipkart.com
python csp_parser.py https://flipkart.com -r
to resolve the domainsdig +short TXT icann.org | grep spf
python assets_fom_spf.py reddit.com
python assets_fom_spf.py reddit.com --asn | jq .
=> returns ASN info of all the assetsdig AXRF @ns1.insecuredns.com totallylegit.in
sudo apt-get install ldnsutils
ldns-walk
(part of ldnsutils
) can be used to zone walk DNSSEC signed zone that uses NSECldns-walk iana.org
ldns-walk @ns1insecuredns.com totallylegit.com
# Detect if DNSSEC NSEC or NSEC3 is used
ldns-walk icann.org
# Collect NSEC3 hashes of a domain
$ ./collect insecuredns.com > insecuredns.com.collect
# Undo the hashing, expose the subdomain information
$ ./unhash insecuredns.com.collect > insecuredns.com.unhash
# Check the number of successfully cracked subdomain hashes
$ cat insecuredns.com.unhash | grep "icann" | wc -l
# List only the subdomain part from the unhashed data
$ cat icann.org.unhash | grep "icann" | awk '{print $2;}'
site:s3.amazonaws.com file:pdf
site:s3.amazonaws.com password
./slurp-linux-amd64 keyword -t paytm
./slurp-linux-amd64 certstream
python3 spaces_finder.py -l sample_spaces.txt -g interesting_keywords.txt -D -m 500000 -t 2
Repositories
Code
Commits (Bharat’s favorite!)
Issues
Examples:
python githubcloner.py --org organization -o /tmp/output
Name | Description | Price | |
---|---|---|---|
Sonar | FDNS, RDNS, UDP, TCP, TLS, HTTP, HTTPS scan data | FREE | |
Censys.io | TCP, TLS, HTTP, HTTPS scan data | FREE (non-commercial) | |
Censys.io | TLS | FREE | |
CZDS | DNS zone files for “new” global TLDs | FREE | |
ARIN | American IP registry information (ASN, Org, Net, Poc) | FREE | |
CAIDA PFX2AS IPv4 | Daily snapshots of ASN to IPv6 mappings | FREE | |
US Gov | Daily snapshots of ASN to IPv6 mappings | FREE | |
US Gov | US government domain names | FREE | |
UK Gov | UK government domain names | FREE | |
RIR Delegations | Regional IP allocations | FREE | |
PremiumDrops | DNS zone files for com/net/info/org/biz/xxx/sk/us TLDs | $24.95/mo | |
WhoisXMLAPI.com | New domain whois data | $24.95/mo |
Source: https://github.com/hdm/inetdata
curl --silent -L https://scans.io/data/rapid7/sonar.fdns_v2/20170417-fdns.json.gz | pigz -dc | head -n 10 | jq .
cat 20170417-fdns.json.gz | pigz -dc | grep "\.example\.com"
# Extract subdomain names for a given domain from FDNS data
cat 20170417-fdns.json.gz | pigz -dc | grep "\.example\.com" | jq .name > example.com.domains.fdns
# Display first 15 subdomains from all the unique subdomains gathered
cat example.com.domains.fdns | grep "\.example\.com" | uniq | head -n 15
# Total number of unique subdomains enumerated
cat example.com.domains.fdns | grep "\.example\.com" | uniq | wc -l
Tool | Number of subdomains | What the tool finds |
---|---|---|
Sublist3r | 278 | Apps indexed by search engines |
CT logs (crt.sh) | 46 | Domains that have SSL/TLS certs on CT logs |
Zone walking NSEC3 | 182 | Depends on your computation power. Can’t find domains named very unconventionnally |
FDNS dataset | 3681 | Doesn’t have these restrictions (app being hosted or having an SSL/TLS cert…) |
See you next time!