Week 3 Active Reconnaissance & Nmap

Updated 4 Oct 2026

CSS484 — Week 3 Cheat Sheet: Active Reconnaissance & Nmap

"Crossing the line: probing systems directly to map what is exposed."


0. Learning Objectives (Roadmap)

#Objective
01Discover targets & services — how attackers actively reach out and discover systems/services that respond
02Perform & interpret Nmap scans — run multiple scan techniques AND understand what results actually mean
03Identify exposed services & flaws — open services, exact versions, and misconfigurations that create real risk
04Turn fingerprints into exploits — how banners & OS fingerprints lead directly to known vulnerabilities
05Operate responsibly — reconnaissance tools only within the isolated lab, always within authorization

1. Networking Foundations for Recon

Core idea: Reconnaissance is a networking skill first, a tooling skill second. Nmap sends packets and tabulates responses — knowing why a port is silent, why UDP is ambiguous, or why the inside looks nothing like the outside is entirely on you.

Analogy: A scanner is like a stethoscope — it just reports the sound it hears. Whether that sound means "healthy" or "problem" depends entirely on the doctor's (your) knowledge of anatomy (networking).

Key principleMeaning
Tools interact with live servicesScanners send crafted packets and watch exactly what comes back — nothing more
Attackers focus on what respondsYou need to read a response and know what it means, not memorize OSI layers
Open ports define the attack surfaceEvery listening service is a door — discovering them is the whole point of a scan
Your position shapes what you seeThe same target looks completely different from inside the LAN vs. out on the internet

LAN vs. WAN — two very different vantage points

PropertyLAN: internalWAN: the internet
ScopePrivate, internal networksLarge-scale public networks
AddressingPrivate (RFC 1918): 10.x / 172.16.x / 192.168.xPublic, globally routable IPs
Trust & filteringHigh trust, low filtering insideHardened perimeter, heavy filtering
What a scan seesEverything — full internal surfaceOnly deliberately exposed services
Scan speedFast, relatively unrestrictedSlower, restricted by the firewall
Attacker's goalImpact — reach the real objectivesEntry — find one weak door in

The strategic move: WAN recon finds the door; LAN recon, after you pivot inside, finds the impact. Attacks flow from the outside in.

Why the inside is the real prize

ZoneReality
Outside — a hardened wallOnly a few public services visible; firewall hides everything internal; each exposed service is likely well-defended
Inside — a soft, sprawling surfaceHundreds of internal services reachable once inside; hosts trust each other, filtering is minimal, services once invisible are suddenly reachable and often unpatched
The bridge — pivoting1 door is all it takes: compromise one public-facing host, get inside the NAT boundary, and the whole internal surface opens up

Analogy: A building's exterior has one locked front door and reinforced windows. Once you're inside, every office door is unlocked and every filing cabinet is reachable.

IP addressing — public vs. private

Private (hidden inside LANs) — NOT routablePublic (exposed to the world) — globally routable
10.0.0.0/8 — one huge blockAssigned by ISPs for an org's external systems
172.16.0.0–172.31.255.255 — 16 contiguous blocksCarries public services: web, mail, VPN
192.168.0.0/16 — the home-router classicEvery one grows the surface — visible to the entire internet
Invisible from outside; reachable only from inside (or via NAT)Enumerate these first for external recon

NAT / PAT — why outside is not inside

Many private hosts share one public IP. The router rewrites addresses on the way out and tracks each connection by port, so an external scan sees only the router, never the hosts behind it.

Private LAN                          NAT/PAT Router          Internet sees:
Host A 192.168.1.10  ┐
Host B 192.168.1.11  ├──────────────▶ 203.0.113.5  ────────▶  ONE public IP
Host C 192.168.1.12  ┘
  • Many hosts, one public IP — PAT distinguishes connections by port number
  • External scans stop at the boundary — you can't even tell how many hosts exist
  • To reach them, get inside first — compromise something public, then scan from within

Analogy: NAT/PAT is like an office receptionist with one phone number — every employee's outgoing calls show the same caller ID, and outsiders can't dial an employee directly without the receptionist forwarding the call.

Ports as the attack surface

Anatomy of a socket address: 10.10.2.244:443

  • 10.10.2.244 → which host (IP address)
  • 443 → which service (port)
PrincipleMeaning
Ports are entry pointsWhere a service listens for connections
More open ports = bigger target1 door is trivial; 20 is a sprawling surface
Unneeded services = free riskA door open for no reason — pure exposure
$ netstat -tuln
Proto  Local Address     State
tcp    0.0.0.0:22        LISTEN   # SSH, needed?
tcp    0.0.0.0:445       LISTEN   # SMB, high risk
tcp    0.0.0.0:3389      LISTEN   # RDP, exposed!
tcp    0.0.0.0:8080      LISTEN   # old web app?

High-value targets to know:

PortService
22SSH
23Telnet
80/443HTTP/S
445SMB
3389RDP

When you scan, you're asking one question: which doors are open, and what's behind each one?

Port forwarding — how outside gets in

Incoming traffic from the WAN addressed to 203.0.113.5:443 is forwarded to 192.168.1.10.

  • The rule exists before the packet — no dynamic entry can match unsolicited traffic; someone configured this by hand
  • The port number is a label, not a promise — external 2222 can land on internal 22; this is why you run -sVinstead of assuming

Analogy: A forwarding rule is like telling the office receptionist "if anyone calls extension 443, put them through to Bob's desk." Without that instruction, unsolicited calls just get dropped.

TCP vs. UDP — from the attacker's view

PropertyTCP: connection-orientedUDP: connectionless
Connection3-way handshake firstFire and forget, no setup
ReliabilityGuaranteed, orderedBest-effort, may be lost
ScannabilityPredictable, clear statesAmbiguous — silence is not closed
Scan speedFastSlow (retries + timeouts)
Key servicesWeb, SSH, databasesDNS, SNMP, NTP
Attacker noteMost of your attentionOverlooked, so misconfigured

Why UDP matters: because everyone finds it annoying and skips it, UDP services are frequently misconfigured. A thorough attacker doesn't skip it.

How scanners read the network

Scanner sends probe →
  SYN-ACK → OPEN      (service is there, offering to connect)
  RST     → CLOSED    (host reachable, nothing listening here)
  no reply/ICMP → FILTERED  (a firewall is silently dropping the probe)

The core logic: poke each port, watch the reply, infer the state. Open and closed give a definite answer; filtered gives silence, and that gap is where the subtlety lives.

🧠 Concept Checks (very likely exam material — these are the instructor's own reasoning drills)

Q: TCP SYN scan, no response at all — what does it mean?

Not "closed" (closed usually replies RST). Could be filtered (firewall silently drops) OR open but not responding — from one probe you cannot tell them apart. No response = uncertain, not closed. Worse with UDP, where silent drops are the norm, not the exception. Key takeaway: In scanning, no response is not a result — it is an ambiguity.

Q: You just compromised one public-facing web server — what's next?

Pivot. The internal network is a far larger attack surface with higher trust and more targets — the web server was just the door. (External recon can still matter for multi-tenant hosting/shared infra/supply chain.) Key takeaway: WAN recon finds doors; LAN recon finds impact.

Q: What most limits what a scanner can actually see?

Not "a better tool" — it's firewall/filtering/NAT/policy/routing — i.e., network architecture, not scanner capability. Key takeaway: Recon is constrained far more by where you are standing than by what you are holding.

Q: UDP scan on port 53 (DNS), no response — most correct conclusion?

Open UDP often gives no response at all. Closed UDP sometimes returns ICMP unreachable but that's often rate-limited/blocked. Filtered also gives no response. All three can look identical. Nmap's honest label: open|filtered = unknown. Key takeaway: UDP scanning is inherently ambiguous — "unknown" is a legitimate, professional answer.

Networking commands — your orientation kit

WindowsLinux/KaliWhat it does
ipconfigifconfigInterface IP configuration
netstatnetstatListening ports + their programs
routerouteView/modify routing table
pingpingICMP: is the target reachable?
tracerttracerouteTrace the path, hop by hop
arparpMAC-to-IP cache on the segment
nslookupdigDNS queries
telnet/ftptelnet/ftpRaw interaction: plaintext, insecure

2. Active Scanning — The Defining Trade-off of the Week

Active scanning = reaching out and probing targets directly. Confirmed, current intelligence — at the cost of every probe being a packet that arrives, gets logged, and can be seen.

GAINCOST
Confirmed, current data — not inferenceEvery probe is a packet that arrives at the target
Exact services & versions — raw material for real vulnsLogs & alerts fire — firewalls/IDS/IPS are tuned to spot scans
A live attack-surface mapYou announce your presence — active recon is detectable by design

Active vs. Passive — one more time

PropertyPASSIVE (Week 2)ACTIVE (this week)
ContactNo contact with targetDirect probing of systems
SourcesPublic records, OSINT, DNSLive hosts, ports, services
DetectabilityEssentially invisibleNoisy, logged & alertable
InformationLimited to what's publicDetailed, current, confirmed
WhenFirst — build the pictureSecond — confirm & deepen

The professional switch: start passive to find where to look, go active to confirm what's there.

The attacker's shopping list (active recon delivers, top to bottom)

  1. Live hosts — which machines are up/reachable — no wasted effort
  2. Port states — open/closed/filtered — where the viable doors are
  3. Services & versions — outdated software = exactly where exploitable flaws live
  4. Attack-surface map — the whole environment, reveals lateral movement paths
  5. Misconfigurations — services exposed that shouldn't be, defaults left in place

Precision vs. coverage — a spectrum, not a right answer

BROAD SCANS ←————————————————→ TARGETED SCANS
Broad scansTargeted scans
Maximum visibility — map the whole rangeStealthy — minimal footprint
High noise — trips IDS/IPS quicklyPrecise — only what you need
⏱ Slow across large targets (can take hours)Fast, but you must know where to look
🔔 Aggressive scans can be actively blocked mid-scan

On the other side of your scan (the defender's chain)

Your scan (probes arrive) → Logs (every probe recorded) → IDS/IPS (pattern recognized)
→ Correlation (intent revealed) → ALERT (defender responds)

A single odd packet means nothing. A correlated pattern is unmistakable. In many real breaches, the reconnaissance scan is the defender's very first indication something is wrong — before any exploitation. This is exactly why evasion exists.

Analogy: One person jiggling a doorknob means nothing. Someone systematically jiggling every doorknob on the street, in order, is what makes neighbors call the police.

⚖️ Legal/ethical discussion (Q&A — Starbucks WiFi scenario, likely a direct exam scenario)

QuestionCorrect reasoning
Scanning the local WiFi range at a coffee shop — a crime?Port scanning is not, by itself, specifically illegal in most jurisdictions — but that's a different question from whether it's authorized.
What does the network record about your device?At minimum your device's MAC address and assigned IP, usually with timestamps — often the domains/traffic you generated too.
Does a VPN make local scanning anonymous?No — it encrypts traffic contents/destination from the local network, but the AP still sees your real MAC; a scan of the local subnet doesn't go through the tunnel the way you'd expect.
Scanning a public website with VPN on — what changes?The target logs the VPN's exit IP instead of yours — but the scan is still recorded, the VPN provider can tie that IP back to you, and scanning a site you don't own can still be unauthorized regardless.

Analogy: A VPN is like wearing a ski mask while walking down the street — passersby can't identify your face (traffic contents), but the doorman at the building you entered (local AP) still saw your height, build, and gait (MAC address) on the way in.


3. Nmap — The Attacker's Tool of Choice

Nmap is configured, not just run. Beginners type nmap target and accept whatever happens. Professionals choose scan type, timing, and depth for the goal.

Why Nmap dominates
Automates active recon — packet-crafting and interpretation at speed
Flexible & configurable — you shape every scan
Works LAN and WAN — same tool, internal or external
Attacker & defender — learn it once, use it on both sides

SYN scan — the default weapon

Full Connect Scan (-sT) — completes the full 3-way handshake:

Scanner → SYN → Target
Target → SYN-ACK → Scanner
Scanner → ACK → Target
Result: connection OPEN (logged by target)

SYN Scan (-sS) — half-open, Nmap's default for a privileged (sudo) user:

Scanner → SYN → Target
Target → SYN-ACK (port open) → Scanner
Scanner → RST (tear down) → Target
Result: never completes (stealthier, faster)
nmap -sS 192.168.1.0/24

Fast & stealthy, but crafts raw packets — needs root, and can be blocked by firewalls watching for the SYN-without-completion pattern.

Analogy: A full connect scan is like walking into a store, browsing, and checking out at the register (fully logged). A SYN scan is like opening the door, peeking in, and walking away before the bell even finishes ringing.

Three ways to probe a port

FlagTypeHowTrade-off
-sSSYN scan (half-open)SYN → read reply → RST, never completesFast & stealthy; needs root; default when privileged
-sTConnect scan (full)Completes SYN/SYN-ACK/ACKEasily logged; works unprivileged (fallback without root)
-sUUDP scan (connectionless)Fires UDP, infers from silenceSlow & ambiguous; finds overlooked services (DNS/SNMP/NTP)

Version detection — where recon becomes an exploit

A plain scan says "something's on port 80." Version detection says "Apache 2.4.49" — and a specific version is a specific, searchable list of known vulnerabilities.

$ nmap -sV -p 21,22,80 10.10.2.244
 
PORT    STATE  SERVICE  VERSION
21/tcp  open   ftp      vsftpd 3.0.3
22/tcp  open   ssh      OpenSSH 7.2p2
80/tcp  open   http     Apache 2.4.49

That one line, weaponised (the chain to know cold):

  1. Apache 2.4.49 — the version string from the scan
  2. Search CVE / Exploit-DB → "Apache 2.4.49 vulnerability"
  3. → CVE-2021-41773 — path traversal, RCE when CGI enabled
  4. → A working, targeted exploit

Trade-off: -sV has a fuller conversation with each service, so it's noisier — but accurate versioning turns a vague hope into a targeted attack. Worth the visibility.

OS fingerprinting — a strong hint, not gospel

$ nmap -O 10.10.2.244
Running: Microsoft Windows 10|11
OS CPE: cpe:/o:microsoft:windows_10
Aggressive OS guesses:
  Windows 10 (92%), Win11 (87%)

How it works: reads TCP/IP stack quirks → times responses & inspects defaults/edge cases → matches a signature DB → narrows exploit choices.

Note the percentages — Nmap infers, doesn't confirm. Use it to focus effort; never bet everything on a fingerprint being exactly right.

Analogy: OS fingerprinting is like identifying a car's make from a blurry tire-tread photo — a confident guess (92% Toyota), not a VIN check.

NSE — the Nmap Scripting Engine

What turns Nmap from a port scanner into a reconnaissance framework: hundreds of scripts encoding known attack logic.

nmap --script vuln target            # run vulnerability scripts
ls /usr/share/nmap/scripts/          # 600+ .nse scripts live here
ls /usr/share/nmap/scripts/*vuln*    # narrow to vuln scripts
ls /usr/share/nmap/scripts | grep smb # search by service name
What NSE does
Encodes known attack logic — checks a researcher would run, packaged
Automates enumeration — hours of manual checks in one command
Reduces manual effort — hundreds of researchers' knowledge, reused
Scales your capability — sophisticated checks, invoked instantly

NSE done right — Discover, THEN target (guaranteed exam concept)

You almost never run --script vuln blindly against everything — it's slow, deafeningly noisy, and mostly wasted. The professional approach is two deliberate steps:

1. Identify services first:

nmap -sT -sV 10.10.2.244

2. Target only what you found:

nmap -p445 --script smb-vuln*        # found SMB on 445?
nmap -p80,443 --script http-vuln*    # found HTTP on 80/443?

Discover then target: blind scanning is loud and lazy; targeted scanning is surgical. Always work in these two steps.

Evasion — shaping the signal, not vanishing

Evasion alters timing and structure to blend in, because it's patterns that trigger detection, not individual packets.

FlagWhat it does
-T2 (polite timing)Deliberately slows the scan — rapid bursts are exactly what IDS is tuned to catch; spreading probes over time reduces the pattern's visibility
-Pn (skip host discovery)Skips the initial ping — useful when a host blocks pings, or to reduce footprint by assuming the host is up
nmap -T2 -Pn target

A single probe is unremarkable. A thousand in quick succession is a screaming signature. Nmap produces information, not answers — the interpretation is always yours, and not every open port matters.


4. From Discovery to Exploitation

Where scanning fits — MITRE ATT&CK

The industry-standard catalogue of adversary tactics, read left→right as an intrusion's life story. Key point: scanning appears TWICE.

ReconInitial AccessExecutionPersistencePriv. Esc.Cred. AccessDiscovery + LateralCollectionExfil
OSINTphishingrun codeautostartexploitMimikatzscanningstage datacovert channel
scanningpublic appscriptsaccountstokenshashespivot
fingerprintSMB

Defence Evasion runs throughout — hiding from defenders at every stage. **Scanning appears twice:**external recon at the start, and internal Discovery & Lateral Movement after a foothold. Recon isn't a one-time step — it threads through the whole attack.

The discovery workflow (a cycle, not a one-time step)

Live hosts (who's reachable?) → Exposed services (what ports/apps?) 
→ Weaknesses (versions, anomalies) → Prioritise paths (where to attack)
      ↳ repeat as access expands: discovery continues after every new foothold

Attacker mindset: attackers aren't impressed by what's expected — they hunt for what stands OUT. An unexpected service, outdated software, or a management interface in the wrong context signals a misconfiguration or forgotten system.

Discovery → exploitation chain

  1. Extract banners & versions (from -sV/banner grabbing)
  2. Map to known vulnerabilities (e.g. "Apache 2.4.49" → what's it known to be vulnerable to?)
  3. Search CVE & Exploit-DB
  4. Prefer reliable, low-effort paths — favour exploits likely to work without crashing the target

Exploitation follows prioritisation. You don't attack everything or in random order — prioritise by impact, reliability, and effort, then strike best-target-first.

Internal discovery — the real payoff (perimeter defense alone is never enough)

From outside the perimeterOnce you're inside
A small, hard surface — only exposed, hardened public servicesFar more exposed services — everything behind NAT is now reachable
Heavy filtering — firewall drops most of what you tryFewer controls — the soft interior is often lightly monitored
Low trust — nothing internal trusts your connectionTrust breaks down — internal systems trust each other, and you inherit it
Lateral movement opens up — move host to host toward the real objective

This is exactly why "assume breach" is the modern defensive mindset.

Interpreting banners, versions & fingerprints

A banner is what a service announces when you connect — often before authentication, and never intended as a security feature. Each one is a direct lead to an exploit.

$ nmap -sV -p 21,22,80 10.10.2.244
PORT    STATE  SERVICE  VERSION
21/tcp  open   ftp      vsftpd 3.0.3          -> search: vsftpd 3.0.3 CVE
22/tcp  open   ssh      OpenSSH 7.2p2 Ubuntu  -> dated build, check advisories
80/tcp  open   http     Apache 2.4.49         -> CVE-2021-41773 path traversal!

For defenders: reducing banner leakage is a real, concrete hardening step.

OpenVAS / GVM — automated scanning

Where Nmap is a precision instrument you drive by hand, OpenVAS (now GVM) is a comprehensive automated scanner, checking a target against a huge vulnerability database and producing a full report.

  • "OpenVAS is now GVM" — the framework is GVM; "OpenVAS" is the scanner engine inside it. Package: gvm
  • Record the admin password — gvm-setup prints an auto-generated one that flies past quickly
  • Web UI on port 9392 — https://localhost:9392 (username admin)
  • Be patient — setup downloads a massive vulnerability feed

Web workflow, end to end:

  1. Create a target — Configuration > Targets > New Target (point at your lab machine)
  2. Create a scan task — Scans > Tasks > New Task, name it, choose "Full and Fast" config, set target
  3. Run it — Scans > Tasks, click play. Probes the target against the entire vuln database
  4. Open the report — vulnerabilities listed, each rated by severity; click any for details/remediation

The payoff: the automated tool does, at scale, the same discover-then-assess workflow you learned by hand with Nmap.

Scanning services on the internet (legitimate authorized targets)

  • http://scanme.nmap.org/ — Fyodor's officially authorized public Nmap test target
  • Bug bounties — check the conditions carefully
  • VulnHub — download vulnerable VMs to scan locally
  • Hack The Box, TryHackMe — VPN in; you're on the same LAN as the target, so scanning is in-scope

5. 🖥️ LAB SECTION — Week 3 Workshop: Active Reconnaissance with Nmap

Goal: Take a target from unknown → mapped → assessed — the core loop of active reconnaissance, using one tool (Nmap) from three angles: host discovery, service/version identification, and NSE-based deeper investigation.

The most important skill is not memorising flags — it's learning to ask the tool what it can do. Use nmap -h for a quick option summary, man nmap for the full manual, and / inside man to search (then n/N to step forward/backward through matches).

⚠️ Scope & authorization: Only scan machines in the isolated lab environment. Active scanning sends real traffic that arrives at the target, is logged, and is detectable. Scanning anything you don't own or lack explicit permission for — including the university network, cloud servers, or any public-internet address — is a serious matter: it can be illegal, disrupt the target, and breach the course's conduct expectations. If unsure whether something is in scope, it is not — ask first. Prefer the least aggressive scan that answers your question, even inside the lab.

Exercise 1 — Discover which hosts are alive

Goal: Produce a list of live hosts in the lab subnet — host discovery only, no port scanning yet.

What to find via help: the option for host-discovery-only (a "ping scan" / disables port scan) — under the HOST DISCOVERY section of nmap -h; how to express a CIDR range as target; optional verbosity flag to watch progress.

nmap -sn 10.10.96.0/20

-sn disables port scanning after host discovery — you get a list of "up" hosts without probing any ports.

Worked example (from an actual run):

  • Swept all 4095 addresses in an authorised /20 lab block using an ARP ping scan
  • Several hosts responded as up; many others returned [host down], confirming most of the block is unused address space
  • Why host discovery first? It focuses effort — no point running a detailed port/service scan against addresses that aren't even in use. A quick sweep narrows a whole subnet down to a short, concrete list of worthwhile targets.

Report checklist:

  • Screenshot of command + output showing hosts discovered as up
  • 2–3 sentences: how many live hosts found, which option kept it to host-discovery-only, and why finding live hosts before port scanning is sensible

Exercise 2 — Identify open ports and their services

Goal: Choose one live host; find open ports; identify service and version as precisely as possible. End with a small table: port | service | version.

What to find via help: the service/version-detection option (SERVICE/VERSION DETECTION section); the different TCP scan types (which needs root, which doesn't); optional port-restriction flag for quick re-scans.

# Plain scan: ports only, no detail
sudo nmap 10.10.96.19
 
# Service + version detection
sudo nmap -sV 10.10.96.19

Run a plain scan first, then a -sV scan, and compare — seeing the difference between the two outputs is the point of the exercise.

Worked example — actual results table:

PortServiceVersionNotes
135/tcpmsrpc—Microsoft RPC endpoint mapper
139/tcpnetbios-ssn—NetBIOS Session Service
445/tcpmicrosoft-ds—SMB over TCP
5800/tcpvnc-httpTightVNCBanner leaked username master-3202
5900/tcpvncVNC (protocol 3.8)

Nmap also reported the target's MAC address, identifying it as an ASUSTek device — confirming the scan reaches a real NIC, not just a router/filter.

⚠️ Worked interpretation (exactly the kind of reasoning the instructor tests):

A plain scan on port 5800 only says "something's listening." The -sV scan reveals it's specifically TightVNCand — critically — leaks a username (master-3202) directly in the connection banner. An attacker now has an immediate starting point: search known TightVNC vulnerabilities for that build, or attempt to brute-force/guess a password for the disclosed account — rather than blindly guessing what remote-access software is running. The open port says a door exists; the version and banner tell you what kind of lock is on it, and in this case, who might hold the key.

Report checklist:

  • Screenshot: open ports + service/version info
  • Port/service/version summary table
  • A few sentences: pick one service+version, explain what an attacker would do next and why the _exact version_matters more than just "port is open"

Exercise 3 — Investigate a service with the Nmap Scripting Engine (NSE)

Goal: Use NSE to learn more about ONE service from Exercise 2. Explore the script library first, then run a small, relevant set — not everything.

What to find via help: the option that invokes scripts (accepts a script name or a whole category); explore /usr/share/nmap/scripts/ on disk and filter by service name; understand script categories (default, safe, vuln); combine with -p to target the single relevant port.

# Explore: filter the script library for your service
ls /usr/share/nmap/scripts/ | grep smb
 
# Run a small, targeted set of scripts against just the relevant port
sudo nmap -p445 --script smb-os-discovery,smb-protocols,smb-security-mode 10.10.96.19

Worked example — why these specific scripts:

  • SMB (port 445) chosen — most information-dense service found, and a classic high-value target for lateral movement in Windows environments
  • smb-os-discovery — reveals OS build & computer name
  • smb-protocols — lists supported SMB dialects
  • smb-security-mode — reveals whether SMB signing is required
  • All three are safe + default category — they passively gather extra detail without testing for or exploiting any weakness, appropriate for an authorised lab target

⚠️ Worked troubleshooting example — a genuinely instructive failure:

On a re-run, Nmap's default ping probe reported the host as seemingly down ("blocking our ping probes") — resolved with -Pn to skip host discovery and treat the host as up. But then port 445 came back **filtered**instead of open (as it was in Exercise 2). No scripts returned output against a filtered port. Most likely explanation: the target's state changed between exercises (firewall toggled, host reconfigured) — plausible since this was a shared lab host outside the author's control.

This directly illustrates the lecture's core point: a filtered port produces no response, and no response is not evidence of "closed" — it's fundamentally ambiguous (could be firewall dropping the probe, or inconsistent service behavior; from one probe you can't tell). It's also a concrete demonstration that active recon results are a snapshot in time, not a permanent fact — host defences can change between one scan and the next. The professional response is to note the ambiguity honestly, not assume a definite state.

Report checklist:

  • Screenshot of how you explored/listed available scripts for your service
  • Screenshot of the script run + its output
  • A few sentences: which script/category chosen and why relevant; what the output told you that a plain port+version scan didn't; one sentence on why a small, targeted script set beats running everything

What good work looks like (grading criteria — worth internalizing)

  • Each exercise shows: the command run, the output, and a short explanation in your own words
  • State which option you found/used for each task — show you worked it out from the tool's help, not memorized it
  • Thoughtful interpretation — marks reward understanding and method, not sheer volume of results. A small, well-explained set of findings beats a huge, unexplained dump.

What to submit

  • One PDF to Google Classroom, containing screenshots + short supporting text for all 3 exercises, in order
  • Name + student ID at the top
  • Nothing else — no exported scan files, no separate logs

Additional lab reference — SYN scan before/after defences (in-class demo)

  1. Lower target's defences (lab only) — turn OFF Windows Firewall (both locations) and disable real-time/virus protection
  2. Start a service to find: python -m http.server 443
  3. Scan from Kali: nmap -sS <target-ip> — port should show open
  4. Re-enable firewall, re-scan: nmap -sS <target-ip> — watch ports shift to filtered. (Are some still open? Why?)

GVM/OpenVAS setup reference

sudo gvm-start
# opens browser at 127.0.0.1:9392/login — username: admin, password: newpass
sudo greenbone-feed-sync   # update vulnerability feed

Troubleshooting (if admin setting is lost — "Feed Import Owner" error):

sudo runuser -u postgres -- psql gvmd -c \
  "SELECT value FROM settings WHERE uuid = '78eceaec-3385-11ea-b237-28d24461215b';"
# if it returns 0:
sudo runuser -u _gvm -- gvmd --get-users --verbose
# returns e.g.: admin b544a23b-7a32-42f0-a190-6d26cc46a0a3
sudo runuser -u _gvm -- gvmd --modify-setting 78eceaec-3385-11ea-b237-28d24461215b \
  --value b544a23b-7a32-42f0-a190-6d26cc46a0a3

6. Rapid-Fire Recall Table (Last-Minute Review)

ConceptOne-liner
LAN vs WAN goalWAN recon finds the door (entry); LAN recon (after pivot) finds the impact
Private IP ranges10.0.0.0/8, 172.16.0.0–172.31.255.255, 192.168.0.0/16
NAT/PATMany hosts, one public IP — distinguished by port; external scans see only the router
Socket addressIP:port = which host : which service
TCP vs UDP scanningTCP = predictable, clear states; UDP = ambiguous, silence ≠ closed
Scan result logicSYN-ACK=open, RST=closed, no reply/ICMP=filtered (ambiguous)
No response meansUncertain, not closed — could be filtered OR open-but-quiet
UDP silent portNmap's honest label: open|filtered = unknown
Active vs PassiveActive = direct contact, detectable, confirmed data; Passive = no contact, invisible, inference only
-sSSYN/half-open scan — fast, stealthy, needs root, default when privileged
-sTFull connect scan — logged, works unprivileged
-sUUDP scan — slow, ambiguous, finds overlooked services
-sVService/version detection — turns "port open" into "exact exploitable software"
-OOS fingerprinting — probabilistic, a lead not a certainty
-snHost discovery only, no port scan
-PnSkip host discovery (evasion / bypass ping-blocking)
-T2Polite/slow timing (evasion)
--scriptInvoke NSE scripts — by name or category
NSE best practiceDiscover first (-sV), then target specific scripts to the specific port/service found
Script categoriesdefault, safe, vuln — know the difference; vuln scripts actively test/exploit
MITRE ATT&CK + scanningScanning appears twice: initial Recon, and again in Discovery/Lateral Movement after a foothold
Port scanning legalityNot inherently illegal — but authorization is the separate, deciding question
VPN + local scanningEncrypts content/destination, but local AP still sees your real MAC
GVM/OpenVASAutomated vuln scanner; web UI on port 9392; "OpenVAS" = engine inside the GVM framework