Skip to content
All essays
CraftFebruary 21, 202510 min

Penetration Testing: Finding Security Vulnerabilities

Learn penetration testing. Discover vulnerabilities before attackers do.

Ü
Ümit Uz
Mobile & Full Stack Developer

What is Pentesting?

Authorized security testing to find vulnerabilities in systems, applications, and networks.

⚠️ Always get written permission before testing

// Authorization letter must include:
- Scope (what to test)
- Duration
- Allowed techniques
- Contact information
- Liability protection

Reconnaissance

Passive Recon

bash
# Whois lookup
whois example.com

# DNS enumeration
nslookup example.com
dig example.com ANY

# Search engines
Google dorks: site:example.com filetype:pdf

# Shodan (IoT search)
shodan search example.com

Active Recon

bash
# Port scanning
nmap -sS -sV -O example.com

# Service detection
nmap -sV -p- example.com

# Vulnerability scan
nmap --script vuln example.com

Web Application Testing

SQL Injection

sql
-- Test for SQL injection
' OR '1'='1
' UNION SELECT NULL,NULL,NULL--
' OR 1=1--

-- Automated tools
sqlmap -u "http://example.com/page?id=1"

XSS (Cross-Site Scripting)

javascript
// Test for XSS
<script>alert('XSS')</script>
<img src=x onerror=alert('XSS')>
<svg onload=alert('XSS')>

// Automated
xsstrike -u http://example.com/search?q=test

Authentication Testing

bash
# Default credentials
admin:admin
admin:password
root:root

# Brute force (authorized only)
hydra -l admin -P wordlist.txt example.com http-post-form

# Session hijacking
# Check for weak tokens
# Test for session fixation

Network Testing

bash
# Network mapping
nmap -sC -sV -oA output 192.168.1.0/24

# Vulnerability scanning
nessus scan example.com

# Exploit testing
metasploit framework (authorized testing only)

Tools

Kali Linux Tools

bash
# Information gathering
- Maltego
- theHarvester
- Recon-ng

# Web testing
- Burp Suite
- OWASP ZAP
- sqlmap

# Network testing
- Nmap
- Wireshark
- Metasploit

OWASP Top 10

  1. 1Broken Access Control: Unauthorized access
  2. 2Cryptographic Failures: Sensitive data exposure
  3. 3Injection: SQL, NoSQL, OS command injection
  4. 4Insecure Design: Flawed architecture
  5. 5Security Misconfiguration: Default configs, open S3 buckets
  6. 6Vulnerable Components: Outdated libraries
  7. 7Authentication Failures: Weak passwords, session management
  8. 8Software & Data Integrity: CI/CD pipeline attacks
  9. 9Logging & Monitoring: Insufficient logging
  10. 10SSRF: Server-Side Request Forgery

Reporting

markdown
# Penetration Test Report

## Executive Summary
- High-level findings
- Risk ratings
- Recommendations

## Technical Details
- Vulnerability description
- Proof of concept
- Impact analysis
- Remediation steps

## Appendices
- Tools used
- Scope
- Methodology

Best Practices

  1. 1Document everything: Screenshots, logs, evidence
  2. 2Verify findings: False positives waste time
  3. 3Prioritize: Critical > High > Medium > Low
  4. 4Remediation: Provide actionable fixes
  5. 5Retest: Verify fixes work

Certification Paths

  • CEH: Certified Ethical Hacker
  • OSCP: Offensive Security Certified Professional
  • CISSP: Certified Information Systems Security Professional

Ethical hacking makes everyone safer!

Related essays

Next essay
Algorithm Design Patterns: Greedy, Dynamic Programming, and Divide & Conquer