-
Notifications
You must be signed in to change notification settings - Fork 0
Home
CorsScan is a robust and efficient Bash script designed to detect Cross-Origin Resource Sharing (CORS) vulnerabilities in web applications. CORS misconfigurations can expose sensitive data and lead to security risks like unauthorized access and exploitation. CorsScan helps developers and security researchers identify and mitigate such issues with ease.
Cross-Origin Resource Sharing (CORS) is a critical security mechanism that determines how web applications share resources across different origins. Misconfigurations can lead to:
- Exposure of sensitive information to malicious origins.
- Permitting unsafe HTTP methods (e.g., PUT, DELETE).
- Bypassing the Same-Origin Policy (SOP).
CorsScan automates the detection of such vulnerabilities, saving time and reducing human error.
- Banner Display: User-friendly banner at script startup.
- Concurrent Execution: Processes multiple URLs simultaneously for speed.
- Comprehensive Checks: Analyzes various CORS misconfigurations.
- Customizable: Easily adaptable to different testing scenarios.
- Wildcard
*
inAccess-Control-Allow-Origin
header. - Reflection of Origin header in
Access-Control-Allow-Origin
. - Unsafe methods like PUT, DELETE in
Access-Control-Allow-Methods
. - Allowing all headers in
Access-Control-Allow-Headers
. - Misuse of credentials with
Access-Control-Allow-Credentials: true
.
- Bash (pre-installed on Linux and macOS systems).
-
curl
command-line tool.
- Clone the repository:
git clone https://github.com/YogSec/CorsScanner.git cd CorsScanner
- Make the script executable:
chmod +x cors.sh
./cors.sh -h
Output:
##########################################
# CorsScan #
# CORS Vulnerability Scanner #
##########################################
Usage: ./cors.sh [OPTIONS]
Options:
-h Show help section.
-w <path> Execute the code with the specified wordlist path.
-s <file> Save the output to the specified file.
-v Show script version.
./cors.sh -w path/to/wordlist
Example:
./cors.sh -w urls.txt
./cors.sh -w path/to/wordlist -s output.txt
Example:
./cors.sh -w urls.txt -s results.txt
./cors.sh -v
https://example.com
https://test.com
https://vulnerable.com
https://vulnerable.com has CORS misconfiguration: wildcard (*) in Access-Control-Allow-Origin
https://test.com reflects the origin in Access-Control-Allow-Origin
https://example.com allows unsafe methods in Access-Control-Allow-Methods: DELETE
https://vulnerable.com allows credentials with Access-Control-Allow-Credentials: true
- Enhanced Security: Quickly detects and addresses CORS issues.
- Time-Efficient: Automates manual checks.
- Scalability: Handles large URL lists.
- Flexible: Easily modifiable for various needs.
Hi! I am Abhinav Singwal, a security researcher dedicated to helping the community secure their applications.
- Email: abhinavsingwal@gmail.com
- LinkedIn: [Abhinav Singwal](https://www.linkedin.com/in/bug-bounty-hunter/)
If you find CorsScan helpful, consider supporting my work:
[Buy Me a Coffee](https://www.buymeacoffee.com/abhinavsingwal)
Thank you for your support! Together, we can build a safer web.