TExcelTAD
Home › Network Security: Discovery, Segmentation, Firewalls, VPN & IDS › Mini Project: A Network Security Assessment

Mini Project: A Network Security Assessment

You will carry out a complete, small network security assessment of a described lab network, from scope to report: build the inventory, plan and check the scan, read the scan results, review the firewall for shadowed rules, write an IDS rule for a weakness you can't fix at once, rate the findings, and produce a report with remediation and a retest plan. Every step uses a technique from the course and links to it. The network exists only in this lesson: its scan results and configurations are synthetic lab data in the code and transcripts, and nothing here sends a packet anywhere.

The engagement

Client: Lab Logistics, the warehouse of the lab company. Network: 10.10.0.128/25 (domain wh.lab.test), one flat VLAN behind a small firewall 10.10.0.129, with an Internet uplink on 203.0.113.20.

Scope (signed by the warehouse IT lead): 10.10.0.128/25 except 10.10.0.150 (the camera recorder, owned by the security contractor); 203.0.113.20. Window 2026-03-09 to 2026-03-11, 19:00–23:00 UTC. Sources: 10.10.0.250 (internal laptop), 198.51.100.20 (external). Max 50 probes per second. Allowed: discovery, TCP connect/SYN scans, top-200 UDP, version detection, safe NSE scripts, configuration review of exports. Not allowed: password guessing, exploitation, changes. Contacts and stop word agreed.

Documented assets: firewall fw (.129), warehouse management server wms (.140, web app on 443), its database wmsdb (.141, PostgreSQL), file server files (.180, SMB), admin PC (.170), handheld scanners (DHCP pool .200–.239).

Step 1: check the target list

Before any probe, turn the scope into the exact target list and verify it. A list scan (-sL) prints the targets Nmap would scan without sending a single packet (-n also skips DNS); it is the cheapest way to prove the exclusion works. (Scope and Authorization)

bash · try it yourself
nmap -sL -n 10.10.0.128/25 --exclude 10.10.0.150 | grep -c 'scan report for'
nmap -sL -n 10.10.0.128/25 --exclude 10.10.0.150 | grep -E '10\.10\.0\.(149|150|151)
  

127
Nmap scan report for 10.10.0.149
Nmap scan report for 10.10.0.151

127 targets (128 minus the exclusion), and .150 is missing between .149 and .151. Save this list with the report.

Step 2: inventory, scan results and a first review

Passive data and the internal scan (synthetic exports from the engagement; the scan as Nmap XML, shortened to the fields used). The program merges them and applies the checks of the "Common network weaknesses" section. (Asset Inventory, Nmap Inventories, Exposed Services, Unencrypted Protocols, Remote Administration)

python · try it yourself
import xml.etree.ElementTree as ET

official = {"10.10.0.129": "fw", "10.10.0.140": "wms", "10.10.0.141": "wmsdb", "10.10.0.170": "admin-pc", "10.10.0.180": "files"}
dhcp = {"10.10.0.201": "hh-01", "10.10.0.202": "hh-02", "10.10.0.233": "DESKTOP-7Q2M"}
SCAN = """<nmaprun args="nmap -sS -sV --top-ports 1000 --max-rate 50 --exclude 10.10.0.150 -oA wh-int 10.10.0.128/25">
<host><address addr="10.10.0.129"/><ports>
 <port protocol="tcp" portid="22"><state state="open"/><service name="ssh" product="OpenSSH" version="9.6p1"/></port>
 <port protocol="tcp" portid="443"><state state="open"/><service name="https" product="firewall admin UI"/></port></ports></host>
<host><address addr="10.10.0.140"/><ports>
 <port protocol="tcp" portid="80"><state state="open"/><service name="http" product="nginx" version="1.24.0"/></port>
 <port protocol="tcp" portid="443"><state state="open"/><service name="https" product="nginx" version="1.24.0"/></port>
 <port protocol="tcp" portid="22"><state state="open"/><service name="ssh" product="OpenSSH" version="9.6p1"/></port></ports></host>
<host><address addr="10.10.0.141"/><ports>
 <port protocol="tcp" portid="5432"><state state="open"/><service name="postgresql" product="PostgreSQL" version="16"/></port></ports></host>
<host><address addr="10.10.0.180"/><ports>
 <port protocol="tcp" portid="445"><state state="open"/><service name="microsoft-ds" product="Samba smbd" version="4.19"/></port>
 <port protocol="tcp" portid="21"><state state="open"/><service name="ftp" product="vsftpd" version="3.0.5"/></port></ports></host>
<host><address addr="10.10.0.233"/><ports>
 <port protocol="tcp" portid="3389"><state state="open"/><service name="ms-wbt-server"/></port>
 <port protocol="tcp" portid="5900"><state state="open"/><service name="vnc"/></port></ports></host>
</nmaprun>"""

root = ET.fromstring(SCAN)
print("scan:", root.get("args"))
open_ports = {h.find("address").get("addr"): {int(p.get("portid")): p.find("service").get("name")
              for p in h.iter("port") if p.find("state").get("state") == "open"} for h in root.iter("host")}
APPROVED = {"10.10.0.129": {22}, "10.10.0.140": {443, 22}, "10.10.0.141": {5432}, "10.10.0.180": {445}}
CLEAR = {21: "FTP", 23: "Telnet", 80: "HTTP", 5900: "VNC"}
ADMIN = {22, 3389, 5900}

findings = []
for ip, ports in sorted(open_ports.items(), key=lambda kv: int(kv[0].split(".")[-1])):
    name = official.get(ip) or dhcp.get(ip)
    if ip not in official:
        findings.append((ip, f"not in the asset list (DHCP name {name!r}), offers {sorted(ports)}"))
    for p in sorted(ports):
        if p not in APPROVED.get(ip, set()):
            findings.append((ip, f"{p}/tcp {ports[p]} not approved" + (f"; cleartext {CLEAR[p]}" if p in CLEAR else "")
                                 + ("; remote admin from the staff network" if p in ADMIN else "")))
    if ip == "10.10.0.129" and 443 in ports:
        findings.append((ip, "firewall admin UI reachable from the internal network"))
for ip, text in findings:
    print(f"{ip:12} {text}")
scan: nmap -sS -sV --top-ports 1000 --max-rate 50 --exclude 10.10.0.150 -oA wh-int 10.10.0.128/25
10.10.0.129  443/tcp https not approved
10.10.0.129  firewall admin UI reachable from the internal network
10.10.0.140  80/tcp http not approved; cleartext HTTP
10.10.0.180  21/tcp ftp not approved; cleartext FTP
10.10.0.233  not in the asset list (DHCP name 'DESKTOP-7Q2M'), offers [3389, 5900]
10.10.0.233  3389/tcp ms-wbt-server not approved; remote admin from the staff network
10.10.0.233  5900/tcp vnc not approved; cleartext VNC; remote admin from the staff network

Write down what each line means before moving on. Two are worth a closer look: port 80 on the WMS server (is it only a redirect to HTTPS? one request answers that), and DESKTOP-7Q2M, a Windows PC in the handheld scanners' DHCP pool with RDP and VNC open: someone's unmanaged machine with remote access, on the same network as the warehouse database.

Step 3: firewall review

The firewall's forward chain (export), between the warehouse network and the Internet:

text
1  ct state established,related accept
2  iifname "lan" accept                                         # "staff need the Internet"
3  iifname "wan" ip daddr 10.10.0.140 tcp dport 443 accept      # WMS for the drivers' app
4  iifname "wan" tcp dport 3389 drop                            # "never RDP from outside"
5  iifname "wan" tcp dport 3000-3999 accept                     # vendor support tool, temporary (2025)
6  iifname "lan" tcp dport { 25, 445 } drop                     # "no SMB or SMTP to the Internet"
policy accept

Check it with the method of Rule Order, Shadowing and Redundancy, and think about what isn't there (Misconfigured Firewalls, Egress Filtering).

python · try it yourself
rules = [  # (n, iface, dst, (lo, hi) ports, action)
    (2, "lan", None, (0, 65535), "accept"),
    (3, "wan", "10.10.0.140", (443, 443), "accept"),
    (4, "wan", None, (3389, 3389), "drop"),
    (5, "wan", None, (3000, 3999), "accept"),
    (6, "lan", None, (25, 25), "drop"),
    (6, "lan", None, (445, 445), "drop"),
]
def covers(a, b):
    return a[1] == b[1] and (a[2] is None or a[2] == b[2]) and a[3][0] <= b[3][0] and b[3][1] <= a[3][1]
for j, rj in enumerate(rules):
    for ri in rules[:j]:
        if covers(ri, rj):
            print(f"rule {rj[0]} ({rj[4]} {rj[1]} port {rj[3][0]}) is shadowed by rule {ri[0]} ({ri[4]}): never matches")
            break
overlap = [(a[0], b[0]) for i, a in enumerate(rules) for b in rules[i + 1:]
           if a[1] == b[1] and a[4] != b[4] and not (a[3][1] < b[3][0] or b[3][1] < a[3][0]) and not covers(a, b)]
print("partial overlaps with different verdicts:", overlap or "none")
print("default policy: accept -> anything from wan not dropped above is forwarded")
rule 6 (drop lan port 25) is shadowed by rule 2 (accept): never matches
rule 6 (drop lan port 445) is shadowed by rule 2 (accept): never matches
partial overlaps with different verdicts: [(4, 5)]
default policy: accept -> anything from wan not dropped above is forwarded

The egress drops (rule 6) are shadowed by the "staff need the Internet" accept, so SMB and SMTP leave freely. The overlap the program reports between rules 4 and 5 is the intended kind: 3389 lies inside 3000–3999, and the specific drop comes before the broad accept, so RDP stays blocked; but the moment someone reorders the rules or deletes rule 4 "because 3389 isn't used", the vendor range opens it. With policy accept, the forward chain also admits from the Internet everything that isn't explicitly dropped, and rule 5's "temporary" vendor range is a year old.

Step 4: an IDS rule for what can't be fixed today

The handheld scanners talk to the WMS over HTTP on port 80 with HTTP Basic authentication, and the vendor's next firmware with HTTPS is three months away. Until then, the compensating controls are: give the handhelds DHCP reservations in 10.10.0.200/29 (the open pool is how the unmanaged desktop got .233), restrict port 80 on the WMS to that block, and alert on Basic-auth requests from anywhere else. Write the rule in Suricata syntax and test the logic on sample requests (Suricata and Snort Rules).

python · try it yourself
import ipaddress
RULE = ('alert http !$HANDHELDS any -> 10.10.0.140 80 (msg:"WH Basic auth to WMS from outside the handheld pool"; '
        'flow:established,to_server; http.header; content:"Authorization|3a| Basic "; nocase; sid:1000100; rev:1;)')
HANDHELDS = ipaddress.ip_network("10.10.0.200/29")       # the handhelds' DHCP reservations .200-.207

def fires(src, dst, port, headers):
    return (ipaddress.ip_address(src) not in HANDHELDS and dst == "10.10.0.140" and port == 80
            and "authorization: basic " in headers.lower())

samples = [("10.10.0.201", "Authorization: Basic aGgtMDE6bGFiLW9ubHk="),   # hh-01, test credentials
           ("10.10.0.233", "Authorization: Basic YWRtaW46bGFiLW9ubHk="),   # the unmanaged desktop
           ("10.10.0.170", "Cookie: session=lab-test"),                      # admin PC, no Basic auth
           ("10.10.0.233", "authorization: basic dGVzdDpsYWI=")]             # lower-case header
print(RULE, "\n")
for src, h in samples:
    print(f"{src:12} {h[:34]:36} {'ALERT 1000100' if fires(src, '10.10.0.140', 80, h) else '-'}")
alert http !$HANDHELDS any -> 10.10.0.140 80 (msg:"WH Basic auth to WMS from outside the handheld pool"; flow:established,to_server; http.header; content:"Authorization|3a| Basic "; nocase; sid:1000100; rev:1;)

10.10.0.201  Authorization: Basic aGgtMDE6bGFiL   -
10.10.0.233  Authorization: Basic YWRtaW46bGFiL   ALERT 1000100
10.10.0.170  Cookie: session=lab-test             -
10.10.0.233  authorization: basic dGVzdDpsYWI=    ALERT 1000100

The handheld's request is quiet, both of the desktop's requests alert (the second despite its lower-case header, because of nocase), and the admin PC sends no Basic auth at all. Note the variable $HANDHELDS must be defined in the sensor's configuration (address-groups), and the sensor must see the traffic: on a flat network that means a SPAN of the WMS server's switch port (IDS and IPS). The Base64 values in the samples are lab test credentials, as they would be in your test captures.

Step 5: rate the findings and write the report

Collect your findings with evidence, rate them (likelihood × impact, as in A Network Assessment from Scope to Retest), and generate the summary table of the report.

python · try it yourself
L = {"low": 1, "medium": 2, "high": 3}
F = [
    ("W1", "Firewall forward policy accept; egress drops shadowed; stale vendor range 3000-3999 open from the Internet", "high", "high", "export review, step 3"),
    ("W2", "Unmanaged Windows PC (DESKTOP-7Q2M) with RDP and VNC in the handheld network", "high", "high", "DHCP + scan, step 2"),
    ("W3", "Flat network: handhelds, PCs and the WMS database share one VLAN", "medium", "high", "design, scan"),
    ("W4", "Handhelds use HTTP Basic auth to the WMS (cleartext credentials)", "medium", "medium", "vendor docs, test capture"),
    ("W5", "FTP on the file server", "medium", "medium", "scan, banner"),
    ("W6", "Firewall admin UI reachable from the whole LAN", "medium", "medium", "scan"),
    ("W7", "PostgreSQL reachable from every LAN host", "low", "high", "scan; pg_hba.conf not reviewed"),
]
rows = []
for fid, text, li, im, ev in F:
    s = L[li] * L[im]
    rating = "Critical" if s >= 9 else "High" if s >= 6 else "Medium" if s >= 3 else "Low"
    rows.append((s, fid, rating, text, ev))
rows.sort(key=lambda r: (-r[0], r[1]))
print("| ID | Rating | Finding | Evidence |")
print("|---|---|---|---|")
for s, fid, rating, text, ev in rows:
    print(f"| {fid} | {rating} ({s}) | {text} | {ev} |")
| ID | Rating | Finding | Evidence |
|---|---|---|---|
| W1 | Critical (9) | Firewall forward policy accept; egress drops shadowed; stale vendor range 3000-3999 open from the Internet | export review, step 3 |
| W2 | Critical (9) | Unmanaged Windows PC (DESKTOP-7Q2M) with RDP and VNC in the handheld network | DHCP + scan, step 2 |
| W3 | High (6) | Flat network: handhelds, PCs and the WMS database share one VLAN | design, scan |
| W4 | Medium (4) | Handhelds use HTTP Basic auth to the WMS (cleartext credentials) | vendor docs, test capture |
| W5 | Medium (4) | FTP on the file server | scan, banner |
| W6 | Medium (4) | Firewall admin UI reachable from the whole LAN | scan |
| W7 | Medium (3) | PostgreSQL reachable from every LAN host | scan; pg_hba.conf not reviewed |

The printed table is Markdown: paste it into the report.

Report template

Copy this structure and fill it in from your work above.

text
NETWORK SECURITY ASSESSMENT - Lab Logistics warehouse (10.10.0.128/25)
Version 1.0, <date>. Classification: confidential, client and assessor only.

1. Executive summary (half a page, for managers)
   - What was assessed, when, by whom, under which authorization.
   - Overall picture in three sentences. The 3 most important risks and the 3 most important actions.

2. Scope and method
   - In scope / out of scope (the exclusion of 10.10.0.150 and why), window, source addresses, rate limit.
   - Activities performed and not performed (no password guessing, no exploitation).
   - Tools and versions; evidence kept (scan XML, exports), where and for how long.
   - Limitations: what could not be validated and why.

3. Asset inventory
   - Official vs observed assets; unknown devices; stale records.

4. Findings (one block per finding, ordered by rating)
   ID / title / rating (likelihood x impact) / affected assets
   Description: what is wrong, in plain words.
   Evidence: scan line, config excerpt, capture reference (secrets redacted).
   Validation: how it was confirmed, or "observed, not validated" and why.
   Impact: what an attacker could do here.
   Recommendation: the fix; quick mitigation if the fix takes time; owner; deadline.
   References: course lesson, vendor advisory, standard.

5. Remediation plan
   Quick wins (days) / short projects (weeks) / programme (months), with owners.

6. Detection notes
   What the SOC saw during the test (were the scans detected?), new rules proposed (rule 1000100).

7. Retest plan
   For each finding: the exact check that will show it fixed, same options and vantage point.

Appendix: target list (step 1), scan commands and XML, firewall export, rules.

Extensions

  1. Retest. Write the retest checks for W1, W2 and W5 as concrete commands or code (which scan, from where, what output means "fixed").
  2. Segmentation design. Propose zones for the warehouse (handhelds, office PCs, servers, management, cameras) and a zone matrix; generate the nftables forward chain from it as in Zones, DMZs and Trust Boundaries, and check it with nft -c in a sandbox session.
  3. Detection check. Using Zeek Logs with pandas, write the queries that would have spotted the unmanaged desktop's RDP sessions and any SMB leaving the network.
  4. Prioritise the patching of the WMS stack with the method of CVE, CVSS and Patch Prioritisation, using an authenticated vulnerability scan's (synthetic) results you write yourself.

Test yourself

Why run nmap -sL -n before the real scan?

  1. It finds open ports
  2. It lists the exact targets without sending any packets, proving the exclusions work
  3. It is faster than -sT
  4. It detects versions

In the warehouse firewall, why do SMB and SMTP leave the network despite rule 6?

  1. Rule 6 has a syntax error
  2. Rule 2 accepts all traffic from the LAN first, so rule 6 is shadowed
  3. The policy is drop
  4. They use UDP

What is the role of the IDS rule 1000100 in this assessment?

  1. To replace HTTPS
  2. A compensating control: detect Basic-auth requests to the WMS from outside the handheld pool until the firmware supports HTTPS
  3. To block all handhelds
  4. To test the firewall