Basic steps in Penetration Testing
Thilan Dissanayaka Penetration Testing February 28, 2020

Basic steps in Penetration Testing

Penetration Testing (PenTest) is a legal and authorized simulated cyberattack against a system to identify vulnerabilities before real attackers do.

A proper penetration test follows a structured methodology to ensure thorough and professional results.

Here are the main steps:

  1. Planning and Reconnaissance (Information Gathering) Goal: Understand the target environment.

Activities:

Define the scope (which systems can be tested).

Get permissions and legal agreements (rules of engagement).

Gather public information (OSINT - Open Source Intelligence).

WHOIS records

DNS information

Company websites, employees (social media)

Subdomains, email leaks, etc.

Tools: Google Dorking, Shodan, Recon-ng, Maltego

  1. Scanning and Enumeration Goal: Identify live systems, services, open ports, technologies, and possible points of entry.

Activities:

Network Scanning (ping sweeps, port scanning)

Service Enumeration (FTP, SSH, HTTP, SMTP banners)

Identify software versions (fingerprinting)

Find vulnerabilities (versions, misconfigurations)

Tools: Nmap, Masscan, Netcat, Dirb, Nikto, Gobuster

  1. Vulnerability Analysis Goal: Analyze the collected information to find known vulnerabilities.

Activities:

Identify outdated software, misconfigured servers, weak passwords.

Cross-reference found services with known CVEs (Common Vulnerabilities and Exposures).

Manual inspection of web apps (test for SQLi, XSS, LFI, etc.)

Tools: Nessus, OpenVAS, Burp Suite, SQLmap, Nikto

  1. Exploitation Goal: Actually exploit vulnerabilities to gain access.

Activities:

Exploit web vulnerabilities (SQL Injection, XSS, CSRF, IDOR).

Exploit network vulnerabilities (weak services, buffer overflows).

Bypass authentication, privilege escalation.

Tools: Metasploit Framework, SQLmap, custom scripts, manual exploitation

  1. Post-Exploitation Goal: Understand the impact and how far an attacker can go.

Activities:

Maintain access (backdoors, reverse shells).

Privilege escalation (become root/admin).

Data extraction (sensitive information, credentials).

Pivoting (move to other machines inside the network).

Tools: Meterpreter, Mimikatz, PowerShell Empire, BloodHound

  1. Reporting Goal: Document everything clearly and professionally.

Activities:

Write a detailed report:

Vulnerabilities found

Methods used

Data accessed

Risk analysis

Mitigation recommendations

Provide an executive summary for management.

Provide a technical breakdown for security teams.

ALSO READ
Blockchain 0x000 – Understanding the Fundamentals
May 21, 2020 Web3 Development

Imagine a world where strangers can exchange money, share data, or execute agreements without ever needing to trust a central authority. No banks, no intermediaries, no single point of failure yet...

Identity and Access Management (IAM)
May 11, 2020 Identity & Access Management

Who are you — and what are you allowed to do? That's the fundamental question every secure system must answer. And it's exactly what Identity and Access Management (IAM) is built to solve.

How I built a web based CPU Simulator
May 07, 2020 Pet Projects

As someone passionate about computer engineering, reverse engineering, and system internals, I've always been fascinated by what happens "under the hood" of a computer. This curiosity led me to...

Writing a Shell Code for Linux
Apr 21, 2020 Exploit Development

Shellcode is a small piece of machine code used as the payload in exploit development. In this post, we write Linux shellcode from scratch — starting with a simple exit, building up to spawning a shell, and explaining every decision along the way.

Exploiting a Stack Buffer Overflow on Windows
Apr 12, 2020 Exploit Development

In a previous tutorial we discusses how we can exploit a buffer overflow vulnerability on a Linux machine. I wen through all theories in depth and explained each step. Now today we are going to jump...

Access Control Models
Apr 08, 2020 Identity & Access Management

Access control is one of the most fundamental concepts in security. Every time you set file permissions, assign user roles, or restrict access to a resource, you're implementing some form of access control. But not all access control is created equal...

Exploiting a  Stack Buffer Overflow  on Linux
Apr 01, 2020 Exploit Development

Have you ever wondered how attackers gain control over remote servers? How do they just run some exploit and compromise a computer? If we dive into the actual context, there is no magic happening....

Basic concepts of Cryptography
Mar 01, 2020 Cryptography

Ever notice that little padlock icon in your browser's address bar? That's cryptography working silently in the background, protecting everything you do online. Whether you're sending an email,...

Common Web Application Attacks
Feb 05, 2020 Application Security

Web applications are one of the most targeted surfaces by attackers. This is primarily because they are accessible over the internet, making them exposed and potentially vulnerable. Since these...

Remote Code Execution (RCE)
Jan 02, 2020 Application Security

Remote Code Execution (RCE) is the holy grail of application security vulnerabilities. It allows an attacker to execute arbitrary code on a remote server — and the consequences are as bad as it sounds. In this post, we'll go deep into RCE across multiple languages, including PHP, Java, Python, and Node.js.