Fix in order, retest and report
Unit 5 of 5 in Testing networks and hosts.
You will be able to rank findings, fix one thing at a time, prove each fix with a re-scan and a diff, and describe what your test looked like to a defender.
Lesson
Rate findings in context, then order the fixes
NIST says assessors should determine the appropriate risk level for each vulnerability and not simply accept scanner levels. FIRST's CVSS 3.1 specification gives one shared way to do it: the Base score reflects intrinsic characteristics and assumes the reasonable worst case across environments, and Environmental metrics adjust the severity to a specific computing environment. A cleartext login service in a sealed lab and the same service on a server reachable from the internet share a base vector and deserve different urgency.
The practical question for fix order is exposure, impact and effort. What can reach the weakness, what would it expose, and how cheap is the fix? The lab ranks the findings on those three and shows that the cheap, high-exposure fixes usually go first.
Recommendations go with root causes
NIST says a security test is much more valuable if it also results in a mitigation strategy being developed and implemented, and that recommendations, including the outcome of root cause analysis, should be developed for each finding. They can be technical, such as applying a patch, or about process, such as updating patch management. It lists common root causes: insufficient patch management, insufficient threat management (including firewall rulesets that do not enforce policy), lack of security baselines and poor integration of security into the development life cycle.
A report that says close port 23 is correct but short. A report that also says why the service was there, which process let it stay, and what check would catch it next time is the one that keeps the same finding from coming back.
One change, one re-scan, one diff
Nmap's Ndiff utility compares two scans. It reports differences in host states, port states, service versions, operating system matches and script output, and its exit code tells a script the result: 0 means the scans are the same in all the aspects Ndiff knows about, 1 means they differ and 2 means a runtime error. That exit code is what makes a retest repeatable.
Used with discipline, that gives the remediation lab its shape: take a baseline scan, make one change, re-scan, diff, and keep the pair. Read the diff for what you expected to change and also for what you did not. A fix that closes the wrong thing, or breaks an allowed service, shows up as a second line in the diff. NIST's remediation section adds the order of work: test the recommendation on a test system that replicates the real environment, coordinate it through change management, then implement and verify it.
Verify with a mirror copy of the test, and do not skip change control
NIST says verification can be an audit of the system or a retest, and that the test team will be able to verify implementation only if a mirror copy of the original test is performed. That is why the lab keeps the exact scan command next to the finding and runs the same command again. A different scan proves nothing about the first one.
NIST also notes that after weaknesses are found, administrators may want to fix them at once and expect assessors to re-assess quickly; assessors should stress the importance of following the organization's change management policies. A tester who keeps quiet about a quick fix on a client's production system is not being helpful.
What your test looked like to a defender
NIST notes that enterprise firewalls and intrusion detection systems can identify many instances of scans. A port scan has a shape in a log: many ports on one host, or one port on many hosts. A good detector flags that shape rather than raw connection counts, and the tuning lab shows how a backup server that talks to many hosts gets flagged unless the threshold and the allow list are tuned.
That is the other half of the activity log from the first unit: because you recorded the times, your tools and the source address, a defender can match their alert to your test, and a real scan that does not match your log stands out. The detection task in the capstone puts you in the defender's seat for the same behaviour.
Key points
- Rate in context; scanner ratings and base scores are inputs, not the answer.
- Every recommendation should include the root cause and a check that would catch it next time.
- One change, one re-scan, one diff; the same command before and after is what makes a retest valid.
- Follow change management, and keep the log that lets a defender tell your scan from a real one.
Sources
- NIST SP 800-115: Technical Guide to Information Security Testing and Assessment (full text)
- Nmap Ndiff Reference Guide
- FIRST: CVSS v3.1 Specification Document
Lecture
Vulnerability management as a loop: Find, rank, fix, prove and start again: the loop your findings land in on the client's side.
Practice in the labs
Fix the practice network's findings in order and prove each; then turn the same diff into a monitor and a log detection.
- Fix practice-network findings in risk order and prove each fix with ndiff: You rank findings by exposure, impact and effort, fix one at a time, read the diff for side effects and test that each fix survives a reboot.
- Catch new open ports: a Python Nmap-diff surface monitor: You turn the scan diff into a small monitor that returns a non-zero exit code when a new port opens, the defender's use of the same idea.
- Detect a port scan from firewall logs and tune the threshold: You write a detector for horizontal and vertical scans on a generated log and tune it until the backup server stops being flagged.
Knowledge check
- What does an Ndiff exit code of 1 mean? Answer: The two scans differ. The Ndiff guide says 0 means the scans are the same in all aspects it knows about, 1 means they differ and 2 means a runtime error.
- Why must a retest repeat the original test rather than use a different scan? Answer: NIST says the team can verify implementation only if a mirror copy of the original test is performed. Only the same test can show that what was found before is no longer there.
- A client wants to fix a weakness at once, in production, right after you found it. What should you do? Answer: Encourage following the organization's change management, then re-assess. NIST says assessors should communicate the importance of change management even when quick mitigation is the wish.
- Why might a good port-scan detector use fan-out (many hosts or ports per source) instead of total connection count? Answer: A busy, legitimate backup server makes many connections but not to many different hosts or ports. The tuning lab shows that raw counts flag busy normal systems; the shape of a scan is breadth, not volume.
Back to the syllabus or see all classes.