Skip to content
Tutorials Center
My learning

Topics

Lesson 46 of 53 ยท Projects

Project: Audit a Small Network Plan

Project: review a written network plan for a small office, find exposure, rank the risks, and propose fixes, using a Python audit script you build step by step.

In this project you act as a defensive reviewer. A small company has described its network in a plan: what devices exist, which ones face the internet, and which ports are open. You will read the plan, find exposure, rank the risks and propose fixes. Reviewing a design before it is built is one of the cheapest ways to improve security, and it uses almost every idea from this course: threat modeling, networking basics, network defenses, wireless and vulnerability triage.

Everything here is paper and code. Nothing is scanned and nothing connects to any real system. The "network" is a Python data structure with made-up devices and documentation-range addresses. The audit logic you write is a stand-in for what a human reviewer, or a policy-checking tool, does with real diagrams and configuration exports. Real firewalls, routers and scanners are not involved.

The audit in four steps

Describe Write the plan as data.
Find Spot risky exposure.
Rank Score by likelihood and impact.
Fix Propose a specific change.

A good audit ends in a short, ordered to-do list.

1 / 2

The scenario

BrightPaws is a ten-person veterinary clinic. Its plan, as the office manager described it:

TEXT
Internet
  |
[Router/firewall 192.0.2.1]  (forwards ports 22, 80, 3389 to inside)
  |
[Flat office network 10.0.0.0/24]
  |-- web-server    10.0.0.10  (website + admin login, ports 22, 80, 3389 open)
  |-- file-server   10.0.0.20  (client records, SMB 445, no MFA, Windows 2012)
  |-- printer       10.0.0.30  (default admin password, port 9100, 80)
  |-- reception-pc  10.0.0.40  (staff browse the web and read email)
  |-- cctv-recorder 10.0.0.50  (port 80 forwarded to internet for remote viewing)
  |-- guest wifi    shares 10.0.0.0/24 with the office (WPA2, shared password on a wall)
Backups: copied nightly to a USB disk plugged into file-server.

Before reading further, take a minute and list the problems you see. Then compare with what the script finds.

Step 1: model the plan as data

A reviewer's notes become a list of devices, each with properties that matter. Put the ports, exposure and notes in a structure.

Python Step 1: the plan as data

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The structure is intentionally small. In a real review you would add fields as you learn what matters: patch level, data sensitivity, who administers the device.

Step 2: write the checks

Each check is a function that looks at one device and returns zero or more findings with a short reason and a likelihood and impact from 1 to 5, as in the risk scoring lesson. The score is likelihood times impact. These numbers are judgments; the point of the exercise is to be explicit and consistent about them.

Python Step 2: checks and findings

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Try adding a new check yourself, such as flagging any device that exposes port 445 (SMB) to the internet, or flagging databases with open ports. Each check should return findings in the same shape so the rest of the program works unchanged.

Step 3: network-wide issues

Some risks are not one device's fault. They come from the design. In this plan the guest Wi-Fi shares the office network, everything lives in one flat network, backups sit next to the system they protect, and nobody mentioned logging. A design-level check can look at the whole plan.

Python Step 3: design-level findings

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Step 4: put it together and rank

Now combine device checks and design checks in one script, sort by score, bucket into severity bands, and print an ordered action list, the output a client can actually use.

Python Step 4: the complete audit

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The top of the list should read like what you wrote down before running the script: internet-exposed administration ports, the unsupported file server holding client records, no segmentation, and no MFA. If your gut feeling and the script disagree, that is useful: either a score needs adjusting or you spotted something the checks do not cover yet.

Extending the project

Pick a few of these to practice further:

  1. Add a "fixes" mode that removes findings after a proposed change, and print the new total risk, so you can show the client what each action buys.
  2. Group by owner or cost. Add effort: low|medium|high to each fix and sort by score divided by effort, which highlights quick wins.
  3. Write the executive summary in three sentences for the clinic's manager, following Writing a Penetration Test Report.
  4. Add detection. For each top risk, note what log entry would reveal an attack (Logging, Monitoring and SIEM Basics).
  5. Map to ATT&CK. Tag each finding with the attacker technique it enables.
  6. Redesign. Sketch the improved plan with VLANs, a VPN, offline backups and logging, then rerun the checks on it. A good result is a short, clean list.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why is exposing Remote Desktop (3389) directly to the internet rated so high?

    Internet-facing administration services get probed constantly. Place them behind a VPN with MFA instead.
  2. 2. What is the main problem with the flat network in the plan?

    Segmentation limits how far an attacker can move. A flat network offers no barriers between devices.
  3. 3. Why are backups on a USB disk attached to the file server risky?

    Backups should survive the failure or compromise of the system they protect. Keep an offline or immutable copy and test restores.
  4. 4. How do you decide what to fix first?

    Ranking by risk focuses limited time on what matters most. Effort helps pick quick wins among similar risks.

Summary

  • A design review finds problems before they are built, using the plan alone.
  • Model devices and design choices as data, write one check per risk, and give each finding likelihood, impact, a score and a fix.
  • Look for both device issues (exposed admin ports, unsupported systems, default passwords) and design issues (flat networks, shared guest Wi-Fi, weak backups, no logging, no MFA).
  • Sort by score and present an ordered action list.
  • Your judgment calls matter: write down why each score was chosen so others can challenge them.

Next: Project: Detect Attacks in Web Server Logs.