Master the art of exploiting injection vulnerabilities
What are Injection Attacks?
Injection flaws, such as SQL, NoSQL, OS, and LDAP injection, occur when untrusted data is sent to an interpreter as part of a command or query. The attacker's hostile data can trick the interpreter into executing unintended commands or accessing data without proper authorization.
🎯 Common Injection Types
SQL Injection: Manipulating database queries through user input
Command Injection: Executing arbitrary operating system commands
LDAP Injection: Exploiting LDAP queries for authentication bypass
XPath Injection: Manipulating XML path language queries
Scenario: You're testing a web application's login system that appears vulnerable to SQL injection. Your goals: bypass authentication and extract sensitive data from the database.
Injection Attempts: 0 | Objectives Completed: 0/3
🎯 Target Login System
💡 SQL Injection Payloads to Try:
Authentication Bypass:
admin' OR '1'='1' --
' OR 1=1 #
Data Extraction:
' UNION SELECT username,password FROM users --
' UNION SELECT table_name,column_name FROM information_schema.columns --
🔍 SQL Query Debugger
Objectives:
1. Bypass login authentication using SQL injection
2. Extract user credentials from the database
3. Discover hidden administrative accounts
Current Status: Ready to begin injection attempts
📊 Database Schema Discovery
TABLE: users
+----------+-------------+------+-----+---------+
| Field | Type | Null | Key | Default |
+----------+-------------+------+-----+---------+
| id | int(11) | NO | PRI | NULL |
| username | varchar(50) | NO | | NULL |
| password | varchar(50) | NO | | NULL |
| role | varchar(20) | NO | | user |
| email | varchar(100)| YES | | NULL |
+----------+-------------+------+-----+---------+
TABLE: admin_secrets
+----------+-------------+------+-----+---------+
| Field | Type | Null | Key | Default |
+----------+-------------+------+-----+---------+
| id | int(11) | NO | PRI | NULL |
| secret | text | NO | | NULL |
| access_level | int(1) | NO | | 1 |
+----------+-------------+------+-----+---------+
🚨 SQL Injection Vulnerability Analysis
This application is vulnerable because it:
String Concatenation: Builds SQL queries by concatenating user input
No Input Validation: Accepts any characters including SQL metacharacters
Excessive Privileges: Database user has access to all tables
Error Disclosure: Shows SQL errors that help attackers
⚡ Lab 2: OS Command Injection Challenge
Scenario: You've found a network diagnostic tool that allows users to ping hosts. The application appears to execute system commands directly. Exploit this to gain unauthorized system access.
Command Attempts: 0 | System Access Level: User
🌐 Network Diagnostic Tool
💡 Command Injection Payloads:
Command Chaining:
google.com; whoami
google.com && cat /etc/passwd
Output Redirection:
google.com | ls -la
google.com; find / -name "*.conf" 2>/dev/null
💻 Command Terminal
Welcome to SecureNet Diagnostic Tool v2.1
Enter commands above to begin network diagnostics...
====================================
Mission Objectives:
1. Execute basic system commands (whoami, pwd, ls)
2. Access sensitive system files (/etc/passwd, /etc/hosts)
3. Discover system configuration and running processes
Escalation Target: Find the flag in /var/secrets/flag.txt
🚨 Command Injection Vulnerability
This application is vulnerable because it:
System() Function: Uses shell execution without sanitization