White Hats - Nepal

Security research, bug bounty writeups, pentest notes

Network Penetration Testing Methodology: A Pro Pentester's Guide

A network penetration testing methodology is a structured, multi-phase framework used by security professionals to identify, exploit, and document vulnerabilities within a target's network infrastructure. By following industry-standard models like the Penetration Testing Execution Standard (PTES) or NIST SP 800-115, you ensure that every layer of the network—from external-facing assets to internal Active Directory environments—is systematically evaluated for security weaknesses. This process typically involves five core stages: reconnaissance, scanning, vulnerability assessment, exploitation, and post-exploitation reporting.

I've performed hundreds of network assessments, and the difference between a "script kiddie" approach and a professional engagement is the methodology. Without a repeatable process, you'll miss the one misconfigured Jenkins server or the forgotten staging environment that serves as the entry point for a real attacker. This guide breaks down the technical specifics of how I approach a network from the outside in, providing the commands and workflows you need to execute a high-quality test.

Phase Primary Objective Key Tools
Reconnaissance Identify the attack surface and gather OSINT. Subfinder, Amass, WHOIS, Shodan
Scanning & Enumeration Map live hosts, open ports, and running services. Nmap, Masscan, Rustscan
Vulnerability Analysis Identify misconfigurations and known CVEs. Nessus, OpenVAS, Searchsploit
Exploitation Gain initial access to the target network. Metasploit, Burp Suite, Custom PoCs
Post-Exploitation Lateral movement, privilege escalation, and persistence. Mimikatz, BloodHound, Cobalt Strike

Phase 1: Reconnaissance and Infrastructure OSINT

Reconnaissance is the most underrated part of the network penetration testing methodology. If you don't know an asset exists, you can't test it. I usually start by defining the scope through ASN (Autonomous System Number) lookups and WHOIS data. If you're testing a large organization, they likely own their own IP ranges. Tools like amass are great for this because they pull from dozens of data sources simultaneously.

During passive recon, you want to avoid touching the target's infrastructure directly. I use Shodan to see what ports were previously found open and what headers those services returned. This helps me build a profile of the technology stack before I even send a single packet. For bug bounty hunters, this is where you find those "forgotten" subdomains that haven't been patched in years.

One of my favorite workflows involves combining passive discovery with active verification. I'll use a subdomain enumeration tools deep dive approach to find every possible entry point. Once I have a list of subdomains, I resolve them to IP addresses to see which ones belong to the client’s infrastructure and which are hosted on third-party SaaS platforms, which might be out of scope.

Key Takeaway: Your exploitation is only as good as your recon. Spend 40% of your time here to ensure you haven't missed any "shadow IT" assets that could be the weakest link in the chain.

Phase 2: Active Scanning and Service Fingerprinting

Once you have your list of IPs and hostnames, it's time to get loud. Active scanning is about identifying what’s actually running. I start with a fast port scan using masscan or rustscan to find open ports across a massive range, then pipe those results into Nmap for detailed service fingerprinting.

Nmap is the industry standard for a reason. I typically run a script-based scan to identify versions and common vulnerabilities. For example:

nmap -sC -sV -p- -iL targets.txt -oA full_scan_results

This command runs default scripts (-sC), attempts version detection (-sV), scans all 65,535 ports (-p-), and saves the output in three formats (-oA). If you want to learn the nuances of these flags, check out this Nmap tutorial for pentesters for a more technical breakdown.

Service fingerprinting is where you find the "low-hanging fruit." I've seen countless internal networks where an old SMBv1 share or an unauthenticated Redis instance was just sitting there waiting to be accessed. Pay close attention to banners. If an SSH banner says SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.8, you can immediately narrow down the OS version and look for specific local privilege escalation exploits.

Vulnerability Analysis and Mapping Attack Vectors

After scanning, you'll have a mountain of data. Vulnerability analysis is the process of sorting that data to find exploitable paths. I don't just rely on automated scanners like Nessus. While they are great for finding missing patches, they often miss logic flaws or complex misconfigurations.

I manually verify the "interesting" services. If I see port 80 or 443, I'm looking for web vulnerabilities. If I see port 445, I'm checking for SMB signing requirements or known exploits like EternalBlue (MS17-010). For port 161 (SNMP), I'll try common community strings like public or private to see if I can pull system information or network maps.

Service Common Port What I Look For
SMB 445 Null sessions, SMB signing disabled, MS17-010, BlueKeep.
SNMP 161 Default community strings, sensitive info in MIBs.
RDP 3389 BlueKeep, NLA requirements, weak credentials.
Database 1433, 3306, 5432 Default passwords (sa/root), unauthenticated access.
SSH 22 Password authentication, outdated versions, weak keys.

I've found that mapping these vulnerabilities to the MITRE ATT&CK framework helps in explaining the risk to clients. It's one thing to say "SMB signing is off," but it's much more impactful to say "An attacker can use SMB Relaying to impersonate an admin and gain full control over the domain."

Exploitation Strategies: Gaining the Initial Foothold

The exploitation phase is where the "hacking" happens. In a network penetration testing methodology, this is the act of using the vulnerabilities identified in the previous step to gain unauthorized access. I always start with the least intrusive methods first. If I found a login portal, I'll try credential stuffing with leaked databases or password spraying with common seasonal passwords like Summer2023!.

If password spraying fails, I move to public exploits. Using the MITRE CVE database, I match service versions to known exploits. If I find a match, I'll search for a reliable PoC (Proof of Concept). Metasploit is my go-to for this because it handles the plumbing of the exploit, but I always keep a few manual Python or Ruby scripts ready in case the Metasploit module is outdated or detected by AV.

Exploiting Network Services and Misconfigurations

Network-level exploitation often involves attacking the protocols themselves. For example, if I'm on an internal network and LLMNR/NBT-NS is enabled, I'll use Responder to capture hashes. This is a classic "man-in-the-middle" style attack that works because Windows machines often broadcast their credentials when they can't resolve a hostname.

sudo responder -I eth0 -rdv

Once I capture a NetNTLMv2 hash, I'll try to crack it offline using Hashcat. If the password is weak, I'm in. If I can't crack it, I might try an SMB Relay attack, sending the captured authentication attempt to another machine on the network where I have administrative rights. This bypasses the need for the password entirely.

Pivoting and Lateral Movement in Internal Networks

Initial access is rarely the end goal. Most of the time, you land on a workstation or a low-privilege web server. Now you need to move. Lateral movement is the bread and butter of internal testing. I use tools like BloodHound to map out the shortest path to Domain Admin. BloodHound uses graph theory to show you exactly how a "Domain User" can become a "Domain Admin" through a chain of sessions and group memberships.

To understand the depth of these internal attacks, you should check out this guide on Active Directory attack techniques. It covers everything from Kerberoasting to AS-REP Roasting, which are essential when you’re stuck in a locked-down environment.

Pivoting involves using your compromised host as a jump box to reach parts of the network that weren't previously visible. I'm a big fan of SSH tunneling or using Chisel for SOCKS5 proxies. Once the proxy is set up, I configure proxychains to run my tools through the tunnel:

proxychains nmap -sT -Pn 10.10.10.0/24

Key Takeaway: Never stop at the first shell. Use that foothold to enumerate the local system, find stored credentials, and look for "multi-homed" hosts that connect to different VLANs.

Post-Exploitation and Maintaining Access

Post-exploitation is about two things: demonstrating the impact and maintaining access (if the rules of engagement allow). Once I have a shell, I immediately look for ways to escalate my privileges. On Windows, this might involve looking for unquoted service paths or insecure service permissions. I've compiled a Windows privilege escalation cheatsheet that I keep open during every engagement.

Maintaining access (persistence) is usually done by creating a new user, installing a beacon, or adding a scheduled task. However, in a standard pentest, you often skip persistence to avoid leaving "backdoors" in the client's environment. Instead, you focus on data exfiltration—showing the client that you *could* have stolen their sensitive data.

I look for:

This is where the value of the pentest is proven. Showing a screenshot of the CEO's "Personal" folder or the company's payroll database is much more convincing than a list of missing patches.

Reporting: Turning Technical Findings into Actionable Security

The report is the only tangible product the client receives. If your report is bad, the whole pentest is seen as bad, regardless of how "elite" your exploits were. A professional network penetration testing methodology must include a clear reporting phase. I structure my reports with an Executive Summary for management and a Technical Breakdown for the IT team.

Every finding needs three things:

  1. Evidence: Screenshots, logs, or command output proving the vulnerability exists.
  2. Impact: What can an attacker actually do? (e.g., "Full takeover of the Domain Controller").
  3. Remediation: Don't just say "Fix it." Provide specific steps, like "Enable SMB signing" or "Apply KB5000802."

I also include a "Clean-up" section. I list every account I created, every file I uploaded, and every configuration I changed. This allows the client to revert the environment to its original state. Being a "White Hat" means being responsible and professional, not just breaking things.

Frequently Asked Questions

What is the difference between a vulnerability assessment and a penetration test?

A vulnerability assessment is a passive or automated search for known security weaknesses without attempting to exploit them. A penetration test goes a step further by actively exploiting those weaknesses to demonstrate the real-world impact and find vulnerabilities that automated tools miss.

How often should a company perform a network penetration test?

Most industry standards, like PCI DSS, recommend at least one comprehensive penetration test per year. However, I suggest performing a test whenever significant changes are made to the network infrastructure or after a major security incident.

Which methodology is best for network penetration testing?

The Penetration Testing Execution Standard (PTES) is widely considered the most comprehensive framework. It covers everything from pre-engagement to post-exploitation, ensuring a consistent and high-quality result for both the tester and the client.

Can penetration testing damage a live network?

There is always a small risk when running exploits on production systems, but a professional methodology minimizes this. By using "safe" exploits and coordinating closely with the client's IT team, you can perform a thorough test without causing downtime or data loss.