This is a deliberately vulnerable web application for educational purposes only!
- NEVER deploy this application in production environments
- NEVER expose it to untrusted networks or the internet
- DO NOT use this as a security guide or reference
- Only use in isolated, controlled learning environments
This application contains intentional security vulnerabilities designed for educational purposes, security training, and penetration testing practice.
GDVCSharp (Goat Damn Vulnerable C#) is a deliberately vulnerable .NET 8 Web API application that showcases common web application security vulnerabilities. It serves as a practical learning tool for:
- Security professionals learning about web application vulnerabilities
- Developers understanding secure coding practices
- Penetration testers practicing vulnerability identification and exploitation
- Security trainers demonstrating real-world attack scenarios
The application demonstrates the following major vulnerability categories:
- Unvalidated URL requests allowing internal network access
- Cloud metadata service exploitation
- POST-based SSRF attacks
- Missing return statements in authorization checks
- Client-side role parameter injection
- Cookie-based authentication bypass
- HTTP method confusion
- Catastrophic backtracking patterns
- User-controlled regex patterns
- Multiple vulnerable validation endpoints
- User-supplied regex patterns
- Pattern concatenation vulnerabilities
- Log searching with regex injection
- Reflected XSS in HTML responses
- XSS in JSON responses
- DOM-based XSS opportunities
- XSS in error messages and feedback forms
- API keys and passwords in source code
- Configuration endpoints exposing secrets
- Environment variable exposure
- Backup files containing sensitive information
- Authentication credentials in URL parameters
- API keys transmitted via GET requests
- Password exposure in server logs
- Directory traversal file access
- Unrestricted file uploads
- Directory listing vulnerabilities
- Source code exposure
-
Clone the repository:
git clone https://github.com/Uraxii/gdvcsharp.git cd gdvcsharp -
Navigate to the application directory:
cd app -
Restore dependencies:
dotnet restore
-
Run the application:
dotnet run
-
Access the application:
- Application: http://localhost:5000
- Swagger UI: http://localhost:5000/swagger
- Vulnerability list: http://localhost:5000
-
Clone the repository:
git clone https://github.com/Uraxii/gdvcsharp.git cd gdvcsharp -
Build and run with Docker Compose:
docker-compose up --build
-
Access the application:
- Application: http://localhost:5000
- Target server (for SSRF): http://localhost:8080
- SSRF:
/api/ssrf/vulnerable,/api/ssrf/post-vulnerable - Auth Bypass:
/api/authbypass/admin/* - ReDoS:
/api/regex/validate,/api/regex/search - XSS:
/api/xss/search,/api/xss/profile,/api/xss/feedback - Secrets:
/api/hardcodedsecrets/config/vuln,/api/hardcodedsecrets/auth/vuln - Path Traversal:
/api/pathtraversal/vuln,/api/pathtraversal/list/vuln
For comparison, the application also includes secure implementations:
- Secure Path Traversal:
/api/pathtraversal/solution - Secure Configuration:
/api/hardcodedsecrets/config/solution - Secure Authentication:
/api/hardcodedsecrets/auth/solution
Example payloads can be found at http://localhost:5000/
Comprehensive documentation for each vulnerability type is available in the documentation/ directory:
- Authorization Bypass - Complete analysis and fixes
- Cross-Site Scripting (XSS) - XSS variants and prevention
- Hard Coded Secrets - Secret management best practices
- Path Traversal - File access vulnerabilities
- Regular Expression Denial of Service - ReDoS attacks and mitigation
- Regular Expression Injection - Pattern injection attacks
- Secrets in GET Requests - Authentication vulnerabilities
- Server-Side Request Forgery - SSRF exploitation and prevention
Each documentation file includes:
- Root cause analysis
- Attack scenarios and examples
- Impact assessment
- Complete fix implementations
- Testing procedures
Remember: This application is intentionally vulnerable. Use responsibly and only for educational purposes!