To all Bug Hunters and Security Researcher, I made a Cheatsheet specifically for CORS missconfigurations. By simply copy-paste the following Bash one-liner into your terminal, you can find these Vulnerabilities in seconds.

1 Basic Origin Reflection payload — (Automatic) Send request to every crawled endpoint and subdomains of the website
gau -subs ‘https://example.com' | while read url;do target=$(curl -s -I -H “Origin: https://evil.com" -X GET $url) | if grep ‘https://evil.com'; then [Potentional CORS Found]echo $target;fi;done
1.2 Basic Origin Reflection payload — (Manualy) Send request in only one endpoint
curl -s -I -H “Origin: https://evil.com" -X GET ‘https://example.com' | if grep ‘https://evil.com'; then echo [Potentional CORS Found]; fi
2 Trusted null Origin payload — (Automatic) Send request to every crawled endpoint and subdomains of the website
gau -subs ‘https://example.com' | while read url;do target=$(curl -s -I -H “Origin: null” -X GET $url) | if grep ‘Access-Control-Allow-Origin: null’; then [Potentional CORS Found]echo $target;fi;done
2.2 Trusted null Origin payload — (Manualy) Send request in only one endpoint
curl -s -I -H “Origin: null” -X GET ‘https://example.com' | if grep ‘Access-Control-Allow-Origin: null’; then echo [Potentional CORS Found];fi
3 Whitelisted null origin value payload — (Automatic) Send request to every crawled endpoint and subdomains of the website
gau -subs ‘https://example.com' | while read url;do target=$(curl -s -I -X GET $url) | if grep ‘Access-Control-Allow-Origin: null’; then [Potentional CORS Found]echo $target;fi;done
3.2 Whitelisted null origin value payload — (Manualy) Send request in only one endpoint
curl -I -X GET ‘https://example.com' | if grep ‘Access-Control-Allow-Origin: null’;then echo [Potential CORS Found];fi
Workflow
If the one-liner bash command displays output, it means that the website is vulnerable to the respective CORS missconfiguration. If no output is displayed while executed, no vulnerability was detected.
Comments
Post a Comment