SecurityTesting Complete Guide
SecurityTesting Complete Guide
COMPLETE GUIDE
CIA Triad • VAPT • OWASP Top 10 • HTTP Security
This guide covers all topics from the Security Testing Training Curriculum
SECURITY TESTING GUIDE — Complete Reference Cybersecurity | VAPT | OWASP | SSL | Dorking
CHAPTER 1
■ Confidentiality Ensures that information is accessible only Encryption (AES-256), Access Control Lists,
to authorized individuals. Data must be kept Multi-Factor Authentication, Data masking,
private and protected from unauthorized Role-Based Access Control (RBAC)
disclosure.
■ Availability Ensures that authorized users can access Redundancy, Load balancing, Backups &
information and systems when needed. DR plans, DDoS mitigation, Fault-tolerant
Systems must remain operational and architecture, SLA monitoring
accessible.
Phase Description
Phase 1: Planning Define scope, objectives, and rules of engagement. Identify systems to test, testing
methodology (black/grey/white box), legal permissions, timelines, and team
responsibilities. Deliverable: Test Plan document.
Phase 2: Scanning Actively probe systems for weaknesses. Use automated scanners (Nessus, OpenVAS,
Burp Suite) and manual techniques to enumerate services, identify open ports, detect
outdated software, and map attack surface.
Phase 3: Exploitation Attempt to exploit found vulnerabilities to determine real-world impact. Use tools like
Metasploit, SQLMap, or manual exploit code. Document what was accessed, how far
lateral movement was possible.
Phase 4: Reporting Document all findings with clear severity ratings, evidence, and remediation steps.
Executive summary for management + technical details for developers. Include CVSS
scores, PoC screenshots, and fix recommendations.
VAPT (Vulnerability Assessment & Combines automated scanning and manual exploitation to find and validate security
Penetration Testing) weaknesses
SAST (Static Application Security Analyzes source code without executing — finds bugs early in development (e.g.,
Testing) Checkmarx, SonarQube)
DAST (Dynamic Application Security Tests running applications by sending malicious inputs — simulates real attacks (e.g.,
Testing) Burp Suite, OWASP ZAP)
IAST (Interactive Application Combines SAST & DAST — uses agents inside running apps to monitor behavior during
Security Testing) testing
Red Team Testing Simulates a full adversarial attack — stealth, persistence, lateral movement, data
exfiltration
Blue Team / SOC Testing Tests defensive capabilities — detection time, incident response procedures, log analysis
Administrative Controls
• Security Awareness Training: Educate employees on phishing, social engineering, and secure password
practices
• Incident Response Plan: Documented procedures for detecting, containing, and recovering from security
breaches
• Access Control Policy: Principle of least privilege — users get only the minimum access needed for their role
RISK FORMULA
Example:
CRITICAL Exploit publicly available; CVSS 9.0+; immediate patch required within 24–48 hours
HIGH Significant data or system compromise possible; CVSS 7.0–8.9; patch within 7 days
MEDIUM Limited impact; requires specific conditions; CVSS 4.0–6.9; patch within 30 days
LOW Minimal impact; difficult to exploit; CVSS 0.1–3.9; patch in next release cycle
CHAPTER 2
GET Retrieve a resource. Should be idempotent and read-only. Parameters are in the URL
(visible in logs, browser history, Referer headers).
POST Submit data to create a resource. Parameters in request body. Not cached. Used for
forms, file uploads, API calls that modify state.
PUT Replace/update an entire resource. Idempotent — calling it multiple times has the same
result. Requires full resource representation.
DELETE Remove a resource. Idempotent. Must be properly authorized — missing auth checks
allow mass deletion attacks.
PATCH Partially update a resource. Sends only the changed fields. Non-idempotent by default.
Often has weaker validation than PUT.
OPTIONS Returns allowed HTTP methods for a URL. Can leak info about server capabilities if not
properly restricted.
HEAD Like GET but returns only headers, no body. Used to check resource existence without
downloading content.
Content-Type: application/json
2. HTTP Headers
Headers carry metadata about the request/response. Misconfigured headers create significant vulnerabilities.
Authorization Bearer tokens/API keys — must use HTTPS; token theft via MITM if HTTP
Cookie Session tokens — must have HttpOnly, Secure, SameSite flags set
Host Host injection — modify to bypass virtual host routing or cache poisoning
Referer Leaks sensitive URLs to external sites — avoid putting tokens in URLs
Content-Type MIME confusion — wrong type can cause XSS or deserialization attacks
CORS headers Access-Control-Allow-Origin: * allows any origin to read your API responses
3. Cookies
Cookies store session tokens, preferences, and tracking data. Insecure cookie configuration is one of the most
common web vulnerabilities.
Set-Cookie: session=abc123
4. Request Body
The request body carries data for POST/PUT/PATCH requests. Vulnerabilities arise from insufficient validation and
sanitization.
• Deserialization attacks: Malicious serialized objects in JSON/XML body execute code on server
• Large payloads: Sending gigabyte-sized bodies causes Denial of Service (buffer overflow)
Host: [Link]
X-Forwarded-For: [Link]
Content-Type: application/json
IDOR via userId Changing userId=105 to userId=1 could expose any user's profile — no ownership
verification
JWT in URL Token in query string gets logged in server logs, browser history, Referer headers —
token theft risk
debug=true Parameter Debug mode exposes stack traces, internal paths, DB queries — information disclosure
Cookie: admin=false Client-side authorization flag — attacker can forge Cookie: admin=true to escalate
privileges
X-Forwarded-For spoofing If server trusts this header for rate limiting, attacker can bypass by setting [Link]
Weak JWT Algorithm HS256 with weak secret is brute-forceable — should use RS256 with public/private key
pair
CHAPTER 3
Component Description
Vulnerability Assessment (VA) Goal: Identify and catalogue vulnerabilities without exploiting them.
How: Automated scanners (Nessus, OpenVAS, Qualys) scan
systems for known CVEs, misconfigurations, outdated software.
Output: Prioritized list of vulnerabilities with severity ratings (CVSS
scores). Analogy: Like a doctor running tests to find all possible
ailments.
Penetration Testing (PT) Goal: Actively exploit vulnerabilities to determine real-world impact.
How: Manual + automated exploitation using tools like Metasploit,
Burp Suite, SQLMap. Output: Evidence of successful exploits,
data accessed, systems compromised. Analogy: Like actually
breaking a lock to prove it can be broken.
Scenario Details
Example 1: IDOR GET /api/orders/1234 — User can change order ID to view others' orders. No
authorization check verifies the order belongs to the requesting user.
Example 2: Privilege Escalation Normal user adds &role;=admin to account update request. Server trusts
client-supplied role without server-side validation.
Prevention Server-side authorization checks on every request. Deny by default. Log and alert on
access control failures. Use indirect object references (random UUIDs instead of
sequential IDs).
Scenario Details
Example 1: Cleartext Storage Database stores passwords as MD5 hashes. MD5 is cryptographically broken — rainbow
tables crack billions of common passwords in seconds. A data breach exposes all user
credentials.
Example 2: HTTP Transmission Login form submits credentials over HTTP (not HTTPS). Attacker on the same Wi-Fi uses
Wireshark to capture cleartext username and password.
Prevention Use bcrypt/Argon2 for password hashing. Force HTTPS with HSTS. Encrypt PII with
AES-256. Never store unnecessary sensitive data. Use TLS 1.2+ for all communications.
A03: Injection
Untrusted data is sent to an interpreter as part of a command or query, tricking it into executing unintended commands.
# Vulnerable query:
Type Impact
SQL Injection Modifies database queries. Can read all data, bypass auth, delete tables (DROP TABLE),
or execute OS commands
Command Injection ping $(cat /etc/passwd) — OS commands injected via unsanitized system() calls
LDAP Injection Manipulates LDAP queries to bypass authentication or extract directory data
NoSQL Injection MongoDB: {"username": {"$gt": ""}} matches all users — bypasses login
• Brute Force: No account lockout allows unlimited password guesses — automated tools can try millions
• Credential Stuffing: Using breach databases to try known username/password combinations on your app
• Weak Session Tokens: Predictable session IDs (sequential numbers) allow session hijacking
• Session Fixation: Attacker forces a known session ID before login — after victim logs in, attacker owns the
session
• Missing MFA: Single factor authentication has no defense against phished or leaked passwords
[Link]="[Link]
[/script tag]
# When any user views the page, their session cookie is sent to [Link]
# Prevention: encode output — never insert untrusted data into HTML directly
A04: Insecure Design Security not considered during architecture phase. Threat modeling and secure design
patterns must be applied from day one.
A05: Security Misconfiguration Default credentials, open cloud storage, verbose error messages, unnecessary features
enabled, missing security headers.
A06: Vulnerable Components Using libraries with known CVEs. Example: Log4Shell (CVE-2021-44228) affected
millions of Java apps worldwide.
A08: Software/Data Integrity Unsigned updates, insecure deserialization, CI/CD pipeline compromise. SolarWinds
attack vector.
A09: Security Logging Failures No logs for login failures, no alerts on suspicious activity, logs not protected from
tampering.
A10: SSRF Server-Side Request Forgery — server makes HTTP requests to attacker-controlled
URLs, exposing internal services.
CHAPTER 4
Wappalyzer Browser extension + API Detects 1500+ web technologies: CMS, frameworks, server
software, analytics, CDN, payment processors
[Link] Browser extension + CLI Specifically scans for JavaScript libraries with known CVEs
— jQuery, Angular, Bootstrap, etc.
BuiltWith Web portal + API Comprehensive tech stack profiling with historical data —
shows what technologies were used over time
Shodan Web search engine + API Indexes internet-connected devices — finds exposed
servers, IoT devices, cameras, industrial systems
Outdated CMS (WordPress 4.x) Check WPScan database for known vulnerabilities. Old WordPress versions have
thousands of CVEs including RCE, SQL injection, XSS
Apache 2.2.x detected Apache 2.2 is EOL (End of Life) — no security patches. Check for CVE-2017-7679,
CVE-2017-9798 (Optionsbleed)
PHP 5.x detected PHP 5.x is EOL. Vulnerable to numerous CVEs. Object injection, heap overflow, type
juggling attacks
jQuery 1.x detected [Link] flags these — multiple XSS vulnerabilities in jQuery < 3.5.0 via .html(),
.parseHTML()
Cloudflare/WAF detected Helps plan bypass techniques — test for WAF evasion. Confirms DDoS protection is in
place
# Output example:
port:3389 country:IN
# Find webcams
server: "webcam"
[Link]:*.[Link]
Only use Shodan to research systems you own or have explicit permission to test.
1. [Link] Cloudflare CDN, React, [Link], nginx, [Link]: Check React version for CVEs.
Let's Encrypt SSL Cloudflare provides DDoS protection but
doesn't patch app vulnerabilities.
2. [Link] Shopify platform, jQuery 1.x, Bootstrap, [Link]: jQuery 1.x has known XSS CVEs.
Google Analytics Shopify handles PCI-DSS but client-side
libraries need updating.
3. [Link] Akamai CDN, Java/Spring backend, Tracking pixels collect behavioral data —
React, Google Tag Manager, multiple privacy compliance risk (GDPR). WAF
tracking pixels present.
4. [Link] PHP backend, Apache, Cloudflare, older PHP version not disclosed in headers
Bootstrap version (good). Shodan: Check for exposed admin
panels on subdomains.
5. [Link] nginx, Java, various old JS libraries [Link] flags multiple outdated libraries. No
detected, no WAF detected WAF means direct access to application
layer.
CHAPTER 5
TC-LOGIN-01 Valid credentials login Enter correct email + password → Redirect to Pass
dashboard. Token/session created.
TC-LOGIN-02 Invalid password Enter wrong password → Generic error "Invalid Pass
credentials". No info about which field is wrong.
TC-LOGIN-03 Non-existent user Enter unregistered email → Same generic error Critical
as wrong password (no user enumeration)
TC-LOGIN-04 Empty fields Submit with blank fields → Client-side and Pass
server-side validation errors shown
TC-LOGIN-05 SQL injection in email Enter admin'-- → Request rejected, error Pass
logged, no DB error shown
TC-LOGIN-06 XSS in username field Enter alert(1) → Input sanitized, script not Pass
executed
Content-Type: application/json
Server-Side Session Invalidation After logout, the server must destroy the session token. Test: Copy session cookie before
logout → logout → use copied cookie → should receive 401 Unauthorized. Common
failure: server returns 200 OK with session still valid.
Token Blacklisting (JWT) JWTs are stateless — server must maintain a blacklist of invalidated tokens. Without this,
a stolen JWT remains valid until its expiry time even after logout.
Clear Client-Side Storage Logout must clear cookies, localStorage, sessionStorage, and IndexedDB. Verify via
browser DevTools after logout — no tokens should remain.
Re-authentication Protection After logout, pressing browser Back button should not restore the logged-in state. Test
with Cache-Control: no-store headers.
Concurrent Sessions Logging out of one device should optionally invalidate all active sessions. Offer "Logout all
devices" functionality for security-sensitive apps.
Password Reset Token Entropy Token must be cryptographically random with at least 128 bits of entropy. Predictable
tokens (sequential IDs, timestamps, MD5 of email) can be brute-forced.
Token Expiration Reset tokens must expire within 15–60 minutes. Tokens that never expire can be used
days/months later after a link is forwarded or intercepted.
Single Use Tokens Token must be invalidated after use. Test: Use a reset link twice — second use should
return "Token already used or expired."
No Token in URL (ideal) Tokens in URLs appear in server logs and Referer headers. Better: POST token in body
or use cookie-based flow.
Rate Limiting on Reset No rate limiting allows attackers to flood victims with password reset emails (email
bombing / account enumeration).
Account Enumeration Response should always say "If your email is registered, you will receive a reset link" —
never confirm/deny account existence.
CHAPTER 6
TLS 1.3 (2018) RECOMMENDED — Strongest. Removed weak ciphers, 0-RTT resumption. Use this.
TLS 1.2 (2008) ACCEPTABLE — Widely supported. Must disable weak cipher suites (RC4, 3DES,
export).
TLS 1.1 (2006) DEPRECATED — Officially deprecated in RFC 8996. Disable immediately.
TLS 1.0 (1999) DEPRECATED — Vulnerable to BEAST, POODLE. PCI-DSS non-compliant since 2018.
SSL 3.0 (1996) CRITICAL — DISABLE — Vulnerable to POODLE attack. Should not exist on any server.
SSL 2.0 (1995) CRITICAL — DISABLE — Completely broken. Multiple critical vulnerabilities.
BEAST (2011) Browser Exploit Against SSL/TLS. Exploits CBC mode in TLS 1.0. Allows MITM to decrypt
HTTPS cookies. Fix: Disable TLS 1.0, use RC4 (temporary) or AEAD ciphers.
POODLE (2014) Padding Oracle On Downgraded Legacy Encryption. Exploits SSL 3.0 padding. Can
decrypt ~1 byte per 256 requests. Fix: Disable SSL 3.0 entirely.
HEARTBLEED (2014) OpenSSL buffer over-read. Leaks up to 64KB of server memory per request — can
expose private keys, passwords, session tokens. CVE-2014-0160.
FREAK (2015) Factoring RSA Export Keys. Downgrades to weak "export-grade" 512-bit RSA. Crackable
in hours with cloud computing. Fix: Disable export cipher suites.
DROWN (2016) Decrypting RSA with Obsolete and Weakened eNcryption. SSLv2 allows decryption of
TLS sessions. Fix: Disable SSLv2 on ALL servers sharing the private key.
SWEET32 (2016) 64-bit block cipher birthday attack affecting 3DES and Blowfish in TLS. After collecting
785GB of ciphertext, can recover plaintext. Fix: Disable 3DES ciphers.
Expired Certificate Browser shows security warning, users leave, automated systems fail. Use Let's Encrypt
with auto-renewal or set calendar reminders 30 days before expiry.
Missing HSTS Without HTTP Strict Transport Security, users can be downgraded to HTTP via SSL
stripping attacks. Add: Strict-Transport-Security: max-age=31536000;
includeSubDomains; preload
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256
:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384
:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
ssl_stapling on;
ssl_stapling_verify on;
PCI-DSS Payment Card Industry Data Security Standard For: Any business that processes credit/debit
cards Key SSL/TLS requirements: Disable TLS 1.0/1.1; use TLS 1.2+; quarterly vulnerability scans;
annual penetration testing Penalty for non-compliance: $5,000–$100,000/month fines; card
processing privileges revoked
HIPAA Health Insurance Portability and Accountability Act For: Healthcare providers, insurers, business
associates handling PHI (Protected Health Information) Key requirements: Encryption of PHI at rest
and in transit; access controls; audit logs; incident response plan Penalty: $100–$50,000 per
violation; up to $1.9M/year per category
GDPR General Data Protection Regulation For: Any organization processing personal data of EU
residents (regardless of where the org is based) Key requirements: Data minimization, right to
erasure, breach notification within 72 hours, Privacy by Design Penalty: Up to 4% of global annual
revenue or €20M, whichever is higher
ISO 27001 International Standard for Information Security Management For: Any organization wanting
internationally recognized security certification Key requirements: Risk assessment, security controls
across 14 domains, regular audits, ISMS (Information Security Management System) Benefit:
Demonstrates security maturity to clients, enables business with regulated industries
SOC 2 Service Organization Controls 2 For: Technology companies and SaaS providers handling
customer data Key requirements: Security, Availability, Processing Integrity, Confidentiality, Privacy
trust service criteria Benefit: Required by enterprise clients; demonstrates controls to auditors and
customers
OWASP ASVS Application Security Verification Standard For: Web application development teams and security
testers Key requirements: Three levels (L1=basic, L2=standard, L3=advanced) of security controls
covering authentication, session, access control, crypto, etc. Benefit: Provides concrete checklist for
secure application development
CHAPTER 7
Google Dorking techniques must only be used on systems you own or have explicit written authorization to test.
Unauthorized access to computer systems — even via publicly indexed information — is illegal in most countries.
The Computer Fraud and Abuse Act (CFAA) in the US, and similar laws globally, apply to unauthorized access.
site: Restrict search to a specific domain. site:[Link] admin — finds admin pages
on [Link]
intitle: Search in page title. intitle:"index of" — finds open directory listings
filetype: Search for specific file type. filetype:sql — finds exposed database dumps
cache: View Google's cached version of a page — useful even if page is now removed
"string" Exact phrase match. "DB_PASSWORD" — finds pages with exact string
filetype:env "DB_PASSWORD"
inurl:.env "APP_KEY="
filetype:bak inurl:backup
# Configuration files
inurl:wp-admin site:[Link]
inurl:cpanel inurl:login
inurl:phpmyadmin intitle:"phpMyAdmin"
# Exposed dashboards
Vulnerability Discovery
intext:"mysql_fetch_array()" "Warning:"
[Link] List directories to block from indexing: Disallow: /admin, Disallow: /config, Disallow: /.env
Google Search Console Use "Remove URLs" tool to de-index accidentally exposed sensitive pages already
indexed
Web Application Firewall Detect and block directory traversal and path disclosure patterns in requests
File Permissions Ensure sensitive files (config, backups, logs) are not in web-accessible directories
Regular Dorking Audits Run dork queries against your own domain monthly. Set up Google Alerts for company
name + "password" etc.
CHAPTER 8
The following questions cover all topics from this guide and represent common interview questions for Security
Testing, VAPT, and Cybersecurity roles at junior to mid-level positions.
Q5. Explain SQL Injection with an example and how to prevent it.
Answer: SQL Injection occurs when user input is directly concatenated into a SQL query without sanitization.
Example: query = "SELECT * FROM users WHERE user='" + input + "'". If input = admin'-- the query becomes
SELECT * FROM users WHERE user='admin'-- which bypasses the password check. Prevention: Use
parameterized queries/prepared statements, input validation, least-privilege DB accounts, WAF rules.
Q6. What is XSS? Distinguish between Reflected, Stored, and DOM-based XSS.
Answer: XSS (Cross-Site Scripting) injects malicious scripts into pages viewed by other users. Reflected XSS:
Malicious script in URL parameter — server reflects it in response (non-persistent). Stored XSS: Script saved in
DB (e.g., comment) — executes for every visitor (most dangerous). DOM-based XSS: Client-side JavaScript
writes attacker data to DOM without sanitization — server not involved. All enable session hijacking, credential
theft, keylogging.
Q12. What tools do you use for web application security testing?
Answer: Proxy/Scanner: Burp Suite Professional (intercepting proxy, scanner, intruder, repeater). OWASP ZAP
(free alternative). Recon: Nmap (network scanning), Shodan (internet-facing assets), Wappalyzer/BuiltWith (tech
fingerprinting), [Link] (vulnerable JS). Exploitation: SQLMap (SQL injection automation), Metasploit (exploit
framework). SSL: SSL Labs, [Link]. Fuzzing: FFUF, Dirb, Gobuster (directory enumeration).
Q15. What are the key differences between SSL and TLS?
Answer: SSL (Secure Sockets Layer) is the predecessor to TLS (Transport Layer Security). SSL 2.0 and 3.0 are
completely broken and should be disabled. TLS 1.0 and 1.1 are deprecated (RFC 8996, 2021). TLS 1.2 is
currently acceptable with proper cipher configuration. TLS 1.3 (2018) is the recommended standard — faster
handshake, removed legacy ciphers, mandatory forward secrecy. The term "SSL certificate" is a misnomer —
they are actually TLS certificates.
Q16. What are weak cipher suites and why are they dangerous?
Answer: Weak cipher suites use cryptographic algorithms that are vulnerable to attacks: RC4 (statistical biases
— stream cipher broken); 3DES (SWEET32 birthday attack — 64-bit blocks); Export-grade ciphers (FREAK
attack — 40/56-bit keys breakable in hours); NULL ciphers (no encryption at all). Weak suites allow attackers to
decrypt HTTPS traffic via MITM. Always configure: ECDHE key exchange, AESGCM or ChaCha20-Poly1305
ciphers, SHA-256+ for MAC.
to HTTP on first connection, intercepting credentials. With HSTS: Browser refuses HTTP connections and shows
error instead. Best practice: max-age=31536000; includeSubDomains; preload — submit to browser preload lists
for protection on very first visit.
Q18. You discover a login page with no rate limiting. What is your testing approach?
Answer: 1. Verify with manual test — try 20+ wrong passwords, confirm no lockout. 2. Use Burp Intruder:
intercept login POST, set payload position on password field, load wordlist ([Link]). 3. Document: HTTP 200
on correct password vs HTTP 401 on wrong (different response length/time = oracle). 4. Escalate: Try with
known breached passwords for target users (OSINT from LinkedIn). 5. Report as HIGH severity: No rate limiting,
no account lockout, no CAPTCHA — trivially brute-forceable. Recommend: Implement progressive delays,
account lockout after 5 attempts, CAPTCHA, MFA.
Q19. How would you test for sensitive data exposure in a web application?
Answer: 1. Check all API responses for unnecessary data (full card number, SSN, passwords). 2. Test HTTPS
enforcement — try HTTP, check for redirect vs. content on HTTP. 3. Check cookies for Secure flag — test in
HTTP context. 4. Search for data in local storage (DevTools → Application → Local Storage). 5. Check error
messages — do they expose stack traces, DB connection strings, file paths? 6. Google dork the site for exposed
files: site:[Link] filetype:log. 7. Check API responses for over-fetching (returning full user object when only
name needed). 8. Test caching headers — sensitive pages should have Cache-Control: no-store.
Q20. What is the OWASP Testing Guide and how do you use it?
Answer: The OWASP Testing Guide (OTG) is a comprehensive reference for web application security testing
with specific test cases for each category of vulnerability. Structure: 12 categories including Information
Gathering, Configuration Testing, Identity Management, Authentication Testing, Authorization Testing, Session
Management, Input Validation, Error Handling, Cryptography, Business Logic, Client-Side Testing. Each test
case has: Objective, test technique, specific payloads, expected results, and remediation. It serves as a checklist
to ensure complete coverage during an assessment.
Chapter 1: Define cybersecurity; explain CIA Triad; give 2 examples of security measures.
Chapter 2: Analyze an API request for vulnerabilities; explain HTTP method risks.
Chapter 3: How does VAPT strengthen security posture? Give 2 OWASP vulnerability examples.
Chapter 5: Generate security test cases for login, logout, and forgot password.
Chapter 6: Test a live site SSL configuration using SSL Labs; list compliance types.
Chapter 7: Apply Google Dorking to find exposed data; discuss ethical considerations.