Set up an isolated lab
Use VirtualBox, a Kali Linux VM with a desktop, and a fresh Debian VM with console access and a user who can run sudo. Take VM snapshots before the exercise. Use an ordinary, patched Debian installation and disposable demo content.
Install tools before isolation
Prepare the VMs with temporary NAT access for official package downloads. Keep port forwarding off. Save any Debian security advisories you need before going offline, or read them later on your everyday computer.
Kali terminal
sudo apt update
sudo apt install nmap curl
sudo runs the command with administrator privileges. apt update refreshes the repository package lists. apt install nmap curl installs the scanner and the HTTP client.
Debian console
sudo apt update
sudo apt install apache2 python3
sudo systemctl enable --now apache2
On Debian, apt install installs the Apache web server and Python 3. systemctl enable --now apache2 starts Apache immediately and enables it on future boots. The default Apache site provides the service to keep on TCP port 80.
If you plan to run Greenbone, complete the Greenbone installation and feed preparation while Kali still has NAT. The Nmap exercise can run without Greenbone.
Disconnect NAT and join the internal switch
- Shut down both guests. In each VM’s VirtualBox settings, set Adapter 1 to Internal Network and name it
darkpc-lab. Use the same spelling on both guests. Keep the virtual cable connected. - Disable every other virtual network adapter. This exercise uses no bridged, NAT, or host-only adapter during assessment. Keep other VMs off the
darkpc-labswitch. - Start both guests. Assign the static addresses below without an IPv4 gateway or DNS server. The internal switch connects the two VMs on the same host.
Read addresses, subnets and interfaces
An interface is a system’s point of connection to a network. In a VM, enp0s3 or eth0 usually identifies a virtual Ethernet adapter. lo is the loopback interface. Its IPv4 address 127.0.0.1 reaches the current VM only.
- Lab subnet
192.168.56.0/28- Kali scanner
192.168.56.10/28- Debian target
192.168.56.11/28
An IPv4 address contains 32 bits. The /28 prefix fixes the first 28 bits as the network part and leaves 4 bits for addresses. This block runs from 192.168.56.0 to 192.168.56.15. .0 is the network address, .15 is broadcast, and .1 through .14 are usable host addresses. A private IP address can still be part of a shared network. The VirtualBox switch and adapter settings provide the isolation here.
Run on both VMs
ip -br link
ip inspects and configures Linux networking. -br selects a brief view, and link lists interfaces and their link state. Identify the single Ethernet adapter, such as enp0s3, alongside lo. Substitute its actual name in the next commands.
Kali terminal
sudo ip link set dev enp0s3 up
sudo ip address add 192.168.56.10/28 dev enp0s3
Debian console
sudo ip link set dev enp0s3 up
sudo ip address add 192.168.56.11/28 dev enp0s3
link set changes the named device’s state to up. address add assigns the stated address and prefix to that dev (device). These commands configure the running system. Repeat them after a reboot if the addresses are gone. If the adapter still has an old NAT address or a default route, resolve that in the guest’s network settings before scanning.
Check both VMs
ip -br -4 address
ip -4 route
-4 selects IPv4. address displays assigned addresses, and route shows how traffic leaves the system.
lo UNKNOWN 127.0.0.1/8
enp0s3 UP 192.168.56.10/28
192.168.56.0/28 dev enp0s3 proto kernel scope link src 192.168.56.10
UNKNOWN is normal for loopback in this view, and UP shows the lab link is up. proto kernel shows Linux added the route automatically. scope link means the subnet is directly connected. src is the preferred source address. Debian should show the same subnet with source 192.168.56.11. Verify that both guests have only the lab IPv4 address on the Ethernet adapter, no default route, and no other attached adapters in VirtualBox.
Confirm Kali’s path to Debian
ip -4 route get 192.168.56.11
route get asks Linux which path it would use for this single IP. Look for dev enp0s3 src 192.168.56.10 using your actual adapter name. If a different source, interface, or gateway appears, return to the adapter settings.
Discover hosts and identify services with Nmap
Start a small, disposable HTTP listener on Debian. Use a dedicated empty directory so the server exposes only a new lab directory. Keep this console open.
Debian console
lab_dir=$(mktemp -d)
python3 -m http.server 8000 \
--bind 192.168.56.11 --directory "$lab_dir"
mktemp -d makes a fresh directory, and $(…) captures its path in lab_dir. The shell quotes keep the path together. python3 -m http.server runs Python’s built-in HTTP server on TCP 8000. --bind limits the listener to the Debian lab address, and --directory chooses what it serves. The trailing backslash continues the command on the next line.
Serving HTTP on 192.168.56.11 port 8000 (http://192.168.56.11:8000/) ...
This line confirms the IP, port and protocol. If you see an address or binding error, check the assigned Debian IP and whether another process already uses the port.
Kali terminal
sudo nmap -sn -n 192.168.56.0/28 -oN lab-discovery.txt
-sn performs host discovery only. On this directly connected Ethernet segment, privileged Nmap normally uses ARP to learn which IPv4 addresses answer. -n skips reverse DNS lookups. The subnet limits the scan to the approved range. -oN lab-discovery.txt saves a human-readable report in the current directory.
Nmap scan report for 192.168.56.10
Host is up.
Nmap scan report for 192.168.56.11
Host is up (0.00040s latency).
Nmap done: 16 IP addresses (2 hosts up) scanned in 1.48 seconds
The two report headings identify Kali and Debian. Host is up indicates a response or the scanner’s local address. The optional latency is the measured response time. The final line counts addresses assessed and hosts seen. A device that is powered down or fails to respond can be absent from discovery. If Debian is missing, check its console, virtual cable and subnet before continuing.
Kali terminal
nmap -n -sT -sV --version-light -p 80,443,8000 \
192.168.56.11 -oN lab-before.txt
-sT makes normal TCP connection attempts and works without administrator privileges. -sV probes services to estimate the application and version. --version-light uses fewer identification probes, so some services may remain unidentified. -p 80,443,8000 selects three TCP ports on the one Debian IP. The command saves the baseline to lab-before.txt.
PORT STATE SERVICE VERSION
80/tcp open http Apache httpd 2.4.65 ((Debian))
443/tcp closed https
8000/tcp open http SimpleHTTPServer 0.6 (Python 3.13.5)
PORT shows the number and transport protocol. STATE shows reachability from Kali. open means the connection was accepted, closed means the host responded but no service accepted it, and filtered means a filter or other network obstacle prevented a determination. SERVICE is a protocol label. The https label on closed port 443 reflects its conventional use. VERSION is the result of service identification and can be blank or inaccurate.
Verify potentially outdated software
Use Nmap’s version estimates as leads. On the Debian console, identify the release and full installed package revision.
cat /etc/os-release
dpkg-query -W -f='${Status} ${Package} ${Version}\n' apache2 python3
cat prints the release identification file. dpkg-query -W queries the named packages. -f sets a format with package status, name, version and a newline (\n). Single quotes let dpkg-query interpret the fields itself.
VERSION_CODENAME=trixie
install ok installed apache2 2.4.65-2
install ok installed python3 3.13.5-1
trixie is the release codename. install ok installed is the package status. The strings after the package names include Debian’s packaging revisions. The Python interpreter may be provided by a versioned package such as python3.13. If an advisory names that package, substitute it in the same query.
- Find the advisory or CVE entry for the affected package in the Debian Security Tracker.
- Check the row for the actual Debian release, the fixed package revision, and any affected configuration. Debian can backport security fixes while retaining the upstream version shown in a remote banner.
- Record the advisory URL and observed package version. Mark a finding confirmed only when the vendor information and the local package or configuration support it. An unresolved match stays needs verification; a vendor-confirmed backport can make a banner-only result a false positive.
If a package needs updating, fetch it from the distribution’s supported repositories during a separate maintenance window. Restore internal-only networking and repeat the route checks before rescanning. If a service is unnecessary, remove or disable it. If it must stay, keep it patched and restrict access to the clients that need it.
Assess the target with Greenbone/OpenVAS
OpenVAS runs vulnerability tests. Greenbone Vulnerability Management (GVM) manages scan targets and tasks, and its web interface displays reports. The feed supplies security tests and related data. This lesson uses an unauthenticated network assessment of the Debian VM, followed by local package verification from its console.
Prepare Greenbone on Kali before isolation
While Kali still has temporary NAT for package and feed downloads, run the following commands one at a time. The first feed sync and import can take a while. Keep the Kali console private if setup prints an initial administrator password.
sudo apt install gvm
sudo gvm-setup
sudo gvm-check-setup
sudo gvm-start
apt install gvminstalls Kali’s GVM package and dependencies. Run it after the earlier package-list refresh.gvm-setupprepares the services and database, fetches the feed, and may generate an administrator password. Keep it private.gvm-check-setupreports whether the Kali installation passes its setup checks. If it reports an error, use the Kali or Greenbone documentation to resolve it before scanning.gvm-startstarts the services and prints the web UI address. Use it again after moving Kali onto the internal switch if the services did not start after reboot.
Web UI (Greenbone Security Assistant): https://127.0.0.1:9392
127.0.0.1 means the UI is on Kali itself. 9392 is its HTTPS port in this example. Open the address reported by your installation in Kali’s own browser. Confirm the address is local. Wait until the UI has imported the feed and shows scan configurations before disconnecting NAT.
Run one scoped assessment after isolation
- Recheck the lab adapters and IPv4 route on both VMs. In Greenbone, open Configuration → Port Lists and create a list called DarkPC Lab 004 TCP. Enter
80,443,8000in Port Ranges. Entries without a protocol prefix use TCP. - Under Configuration → Targets, create a target with
192.168.56.11as its only host and select the new port list. Leave credentials empty. Keep the default alive check. If the target is skipped, check that it is up and reachable. - In Scans → Tasks, create a task and select that target and the default OpenVAS scanner. Use Full and fast, the standard scan profile with safe checks, when it is available. Keep the task unscheduled and start it manually. If the profile is missing, check that feed import finished and use the Nmap exercise while troubleshooting.
- When the task completes, open its report. Record the target, date, feed version or feed status and date, port list, scan configuration, and any skipped hosts or tests. A report with no detections can be a valid outcome on this patched target. Check its coverage before drawing a conclusion.
Interpret and report findings
In the Greenbone report, open each result and read its detection method, affected host and port, impact, and suggested fix. CVSS is a standard severity score. Quality of Detection (QoD) describes the reliability of Greenbone’s detection method. Decide priority using the actual exposure, how the service is used, and the evidence you can verify.
Suppose a report labels Apache on 80/tcp outdated based on its HTTP banner. Check the relevant Debian advisory and query the installed package. If the advisory confirms that revision contains the fix, record a false positive with the advisory and local evidence. If the facts remain unclear, keep the finding open for verification. A clean report can miss a problem if the relevant port was omitted, the feed was stale, or local package information was unavailable. Keep a coverage note with the report.
Record one finding
Include the asset and port, date and scope, evidence, status, impact, proposed fix, owner, and the retest result. Add an advisory or CVE only when it applies. Store the raw reports with the finding and keep credentials out of the record.
- Finding
- Unneeded HTTP listener on
192.168.56.11:8000/tcp - Evidence and status
- Confirmed exposure in this lab.
lab-before.txtshowsopenand the Debian console shows the demo HTTP process running. - Impact
- Any VM on the segment can connect to the listener. The demo directory is empty. If an operator later serves real files, clients could read them over HTTP.
- Fix and owner
- The Debian lab operator stops the demo server and keeps Apache on port 80.
- Retest criterion
- Port 8000 is closed from Kali, port 80 remains open, and Apache still responds to HTTP requests.
Exercise and rescan after remediation
- Record the subnet, the two IPs, the date, and your approval to test. Run discovery and the baseline port scan. Explain what ports 80, 443 and 8000 show.
- Compare the installed Apache package revision with the Debian Security Tracker for your release. Write down the evidence you’d need to resolve a banner-only alert. If Greenbone is installed, run the baseline assessment and record its actual coverage, even if it reports zero findings.
- On the Debian console running Python, press Ctrl+C. This sends an interrupt to the foreground process and stops the demo listener. Leave Apache running.
- Run the following from the same Kali VM. Keep the source IP, target, port selection, and options the same so the saved reports are comparable.
nmap -n -sT -sV --version-light -p 80,443,8000 \
192.168.56.11 -oN lab-after.txt
curl --head --max-time 5 http://192.168.56.11/
The Nmap flags and target are identical to the baseline. -oN now writes to lab-after.txt. curl --head sends an HTTP HEAD request for headers only. --max-time 5 caps the request at five seconds. The URL uses Debian’s lab IP and HTTP’s default TCP port 80.
PORT STATE SERVICE VERSION
80/tcp open http Apache httpd 2.4.65 ((Debian))
443/tcp closed https
8000/tcp closed http-alt
HTTP/1.1 200 OK
Compare the STATE column with lab-before.txt. Port 8000 moved from open to closed, and http-alt is just a service name guess for the closed port. Ports 80 and 443 retain their earlier states. 200 OK confirms Apache served a successful response. If 8000 is still open, check the Debian console for a remaining listener. If it is filtered, record that and verify locally before calling the fix complete.
If you ran Greenbone, rerun the same task after the change and compare both reports. Keep the target, port list, profile, and feed the same where possible. For each reported change, check whether the relevant host and port were assessed both times. Update your finding with the evidence, date and status, then shut down the VMs when finished.