Skip to content

aka76bm/pentest-ip-tracking-guide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Executive Summary & Key Enhancements

The original guide is a solid checklist. The enhancements below add:

  1. Practical, Actionable Procedures: Step-by-step commands and workflows.
  2. Advanced Techniques: Moving beyond basic scanning to modern attack paths.
  3. Operational Integration: Framing pentests and investigations within a broader security mission.
  4. Risk & Impact Focus: Connecting technical findings to business and mission risk.

Enhanced Guide: Penetration Testing & IP Tracking for Security Forces

1. Foundations of Penetration Testing (Enhanced)

New Section: Defining the "Why" - Types of Penetration Tests A test's goals dictate its methodology. The RoE should specify the type:

  • External Test: Assumes no internal access. Tests public-facing assets (websites, email servers, VPN gateways).
  • Internal Test: Simulates an attacker who has breached the network perimeter (e.g., a malicious insider or a phishing victim).
  • Web Application Test: Deep-dive on specific apps for logic flaws and complex vulnerabilities.
  • Wireless (Wi-Fi) Test: Assesses the security of wireless networks in offices or facilities.
  • Physical Social Engineering Test: Attempts to gain physical access or credentials through deception.
  • Red Team Exercise: A goal-oriented, multi-layered attack simulation designed to test overall defensive capabilities and detection/response, not just technical vulnerabilities.

Enhanced Phase 2: Intelligence Gathering (Reconnaissance)

  • Subdomain Enumeration (Practical Example):
    # Using amass for passive and active subdomain discovery
    amass enum -passive -d target.com -o subdomains_passive.txt
    amass enum -active -d target.com -o subdomains_active.txt
    
    # Using sublist3r
    sublist3r -d target.com -o subdomains_sublist3r.txt
    
    # Combine and sort unique results
    cat subdomains_*.txt | sort -u > subdomains_final.txt
  • Identifying Key Assets: Use this data to build a target map: "webmail.target.com is the OWA server, vpn.target.com is the Pulse Secure gateway, git.target.com hosts their source code."

Enhanced Phase 4: Vulnerability Analysis

  • Manual Web App Testing (OWASP Top 10 Focus):
    • SQL Injection (SQLi): ' OR 1=1-- in login fields. Use sqlmap -u "http://target.com/page?id=1" --batch to automate exploitation.
    • Cross-Site Scripting (XSS): <script>alert('XSS')</script> in search bars and form inputs.
    • File Upload Vulnerabilities: Attempt to upload a web shell (e.g., a .php file or an embedded macro in a .docx).

Enhanced Phase 5 & 6: Exploitation & Post-Exploitation (The Attacker's Mindset)

  • Common Windows Attack Path:
    1. Initial Foothold: Exploit a public web server to upload a web shell.
    2. Privilege Escalation: Use a tool like WinPEAS to find misconfigurations (e.g., unpatched software, weak service permissions).
    3. Credential Dumping: Use Mimikatz (via Meterpreter) to dump passwords from memory.
    4. Lateral Movement: Use the dumped credentials with Pass-the-Hash attacks or psexec to move to other workstations/servers.
    5. Domain Compromise: Use BloodHound to find a path to Domain Admin rights, often through misconfigured group membership or Kerberoastable accounts.
  • Living Off the Land: Use built-in OS tools (e.g., powershell.exe, bitsadmin, wmic) to avoid detection by EDR/AV.

2. Essential Toolkit (Enhanced)

New Category: Command & Control (C2) & OPSEC

  • Cobalt Strike / Sliver: Industry-standard C2 frameworks for Red Teams. Allow for realistic, persistent agent deployment and management.
  • How to Use: These tools generate payloads (e.g., .exe, .ps1) that call back to a team-controlled server, allowing remote command execution.

New Category: Cloud-Specific Tools

  • Pacu: AWS exploitation framework.
  • ScoutSuite: Multi-cloud security auditing tool.
  • Explanation: Modern environments are hybrid. Testing must include cloud asset discovery and misconfiguration checks (e.g., public S3 buckets, overly permissive IAM roles).

New Section: The Analyst's Workstation

  • VMware / VirtualBox: For isolated lab environments.
  • Visual Studio Code: With extensions for note-taking (like Markdown All in One) and code analysis.
  • CherryTree / Obsidian: For structured, linkable note-taking during engagements. This is critical for accurate reporting.

3. IP Tracking & Investigation (Enhanced)

Reframed as: The Cyber Investigation Loop This is not a linear checklist but a cycle of gathering evidence and building context.

Step 0: Triage & Context

  • What was the activity? (e.g., SSH brute-force, web vulnerability scan, data exfiltration attempt).
  • When did it happen? (Timestamps are critical).
  • What was the target? (This tells you about the attacker's intent).

Enhanced Step 2: Geolocation - The Limitations

  • Critical Insight: Geolocation for an IP is rarely the attacker's physical location. It's the location of the ISP's router. Emphasize this to avoid false leads. It's used for context (e.g., "This attack originates from a VPS provider in the Netherlands") not for pinpointing a suspect.

Enhanced Step 4: Historical & Passive Analysis - The Investigator's Goldmine

  • Shodan Deep Dive:
    • Search for the IP: ip:1.2.3.4
    • Look for banners revealing software versions (e.g., Apache/2.4.49 (Vulnerable to CVE-2021-41773)).
    • Check if the IP is part of a hosting provider known for abusive customers (e.g., "VPSie LLC").
  • ViewDNS.info Reverse IP Lookup: Shows all other domains hosted on the same web server. If one is malicious, the others might be related.

Enhanced Step 5: Threat Intelligence Correlation - Building the Case

  • VirusTotal Relations Tab: This is powerful. It shows:
    • Communicating Files: Malware samples that have contacted this IP.
    • Referrer URLs: Websites that link to this IP.
    • Related Hashes: Other files associated with this IP.
  • AbuseIPDB Check: curl -sG https://api.abuseipdb.com/api/v2/check \ --data-urlencode "ipAddress=1.2.3.4" \ -H "Key: $YOUR_API_KEY" \ -H "Accept: application/json" | jq .
    • A high abuse confidence score (%)
    • Recent reports with attack types (e.g., "Brute-Force," "Web Attack").
  • Blocklist.de & Other Feeds: Quickly check if the IP is on known blocklists.

New Step 6: Attribution & Pivoting (Advanced)

  • Pivoting to Other IOCs: An IP is one Indicator of Compromise (IOC). Use it to find others.
    • Domains: The IP may host a domain. Use Passive DNS to find it.
    • Filenames & Hashes: From VirusTotal, get hashes of malware associated with the IP.
    • TTPs (Tactics, Techniques, Procedures): How did they attack? (e.g., used a specific SQLi pattern). This is more valuable than the IP itself, as IPs change. This can be mapped to the MITRE ATT&CK Framework.

4. Legal & Operational Considerations (Enhanced)

New Section: The Rules of Engagement (RoE) Deep Dive The RoE is your legal shield and operational plan. It must explicitly state:

  • Data Handling: How will exfiltrated data be secured, transmitted, and destroyed?
  • Safety Net: What is the "stop the test" codeword or procedure if critical systems are impacted?
  • Cleanup: Who is responsible for removing persistence mechanisms, shells, and created accounts post-engagement?
  • Communication Protocol: How and when will status updates be provided?

New Section: The "Get Out of Jail Free" Card

  • Always carry a physical and digital copy of the signed RoE.
  • Ensure the client/command has informed their Security Operations Center (SOC) and Network Operations Center (NOC) about the testing to prevent your activities from being treated as a real incident and triggering a defensive response.

5. Resources & Continuous Learning (Enhanced)

New Section: Building a Lab

  • Home Lab: Use VMware/VirtualBox to build a network with:
    • A vulnerable machine (e.g., from VulnHub or TryHackMe).
    • A Kali Linux attacker machine.
    • A Windows domain controller (evaluation copy).
  • Purpose: Practice safely and learn advanced techniques like Active Directory exploitation without legal risk.

New Section: From Findings to Risk - The Reporting Bridge

  • Don't just list vulnerabilities; explain their impact.
    • Instead of: "SQL Injection found on /login page."
    • Write: "An unauthenticated attacker can extract the entire user database, including hashed passwords, via SQL Injection on the login page. This could lead to a full domain compromise through password cracking or replay attacks. Risk: Critical."
  • Prioritize remediation using a simple matrix:
    Likelihood \ Impact Low Medium High
    High Medium High Critical
    Medium Low Medium High
    Low Low Low Medium

Enhanced Communities Section:

  • Twitter/X: Follow leading security researchers (e.g., @SwiftOnSecurity, @JohnLaTwC, @Hacker0x01) for real-time news and techniques.
  • Conferences: Watch recorded talks from Black Hat, DEF CON, and BSides.

By integrating these enhancements, the guide becomes a living document that not only tells security forces what to do but how to do it, why it matters, and how to integrate it into their broader mission of defense and response.

About

Comprehensive guide to penetration testing and IP tracking for security forces

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages