20. Vulnerability Scanning and Assessment
20.8 Red vs Blue, Project and Real Incidents
Chala mitrano, vulnerability scanning shiklo – aata Purple Team loop lavuya. Red scanners ne old versions aani Critical CVEs shodhto; Blue patch priority thevto, false positives kadhto, clear report lihito. Tumhi Sahyadri / Raja-Rani style OWN Metasploitable lab madhe build → hack → fix karun prove kara ki Critical/High count drop hote. Scanner "hack" nahi – to map aahe; map nantar fix = real kaam. Samjla ka?
Red Team vs Blue Team – vulnerability scanning and assessment
| Red team (attacker) does | Blue team (defender) detects / stops |
|---|---|
Runs sudo nmap -sV --script vuln / Greenbone "Full and fast" against many hosts to list Critical CVEs |
Patch management + asset inventory; CISA KEV-style priority; re-scan after fix and archive -oA evidence |
Uses searchsploit / NVD on banner versions (e.g. vsftpd 2.3.4) to pick easy targets |
Remove or replace ancient packages; stop unused daemons; hide version banners (ServerTokens Prod) |
| Leaves scanner UI / weak lab VMs on bridged LAN so findings become a public attack surface | Host-only only; scanners bind to lab; never expose Greenbone/OpenVAS or Metasploitable on real Wi-Fi |
| Dumps 300-page raw scanner PDF to the client with no triage | Confirm true positives; remove false positives; top-5 priority table; 1-page executive summary |
| Scans outside written scope (classmate / public sites) "to practise CVEs" | Written scope + host-only proof (ip a); refuse out-of-scope; IT Act awareness |
| Treats every "VULNERABLE" line as gospel without version check | Verify installed package (rpm -q / dpkg -l); reproduce safely; mark false positives clearly |
Defender chi simple checklist: inventory → scan → triage → patch Critical/High first → re-scan → short Purple report. Tool Kali var; remediation Blue var. Dhyan rakho – company madhe "I can run OpenVAS" peksha "I can prove Critical count dropped and write a clear report" jast valuable aahe.
# OWN host-only only – Kali 192.168.56.10 → Metasploitable 192.168.56.20
mkdir -p ~/labs/sahyadri-vuln
# Pre-fix snapshot of findings (lab only)
sudo nmap -sV --script vuln -T2 192.168.56.20 -oA ~/labs/sahyadri-vuln/pre
searchsploit vsftpd 2.3.4
searchsploit samba 3.0.20
# Optional if Greenbone/GVM is installed on Kali:
# sudo gvm-start # then Full-and-fast task against 192.168.56.20; export PDF
# On a Linux helper YOU own (optional .50) – defender moves after triage:
# sudo service vsftpd stop
# sudo yum remove vsftpd # Amazon Linux / CentOS style helper
# sudo service iptables status # or firewalld – allow only from 192.168.56.10
# Re-scan same commands → Critical/High should drop
Ravindra Bagale's Tip
Students scanner cha PDF seedha client la pathavtat – 200 findings, zero priority. Mag manager "aadhi kay fix karu?" vicharto ani tumhi ghabarta. Rule: confirm → false positive kadha → top 5 → 1-page exec summary. Aani bridged LAN var Greenbone thevne = tumcha scanner swatah target hoto. Host-only. CEH exam modules madhe vulnerability assessment yetat – report quality nehmi joda. He lakshat theva, mitrano.
Lab
Metasploitable (192.168.56.20) var sudo nmap -sV --script vuln -T2 -oA ~/labs/20-pre chalu kara. searchsploit ne vsftpd 2.3.4 aani kamit kami 3 itar services sathi CVE note kara. Mag Greenbone asel tar ek Full-and-fast task (lab only) – Critical/High count liha. False positive sathi ek finding package version ne confirm kara. Output save – pudhcha Project madhe before/after compare karaycha aahe.
Project: Build it, hack it, fix it
Build: For fictional Sahyadri Traders (Pune) / Raja-Rani Traders warehouse IT, treat Metasploitable 192.168.56.20 as the deliberately weak assessment target (host-only). Document the weak surface before you start:
- Old services left listening (vsftpd 2.3.4 on 21, other ancient banners from Chapter 19)
- No triage habit – raw scanner noise accepted as "truth"
- Optional: leave an unused helper service on
.50that you installed withsudo yumon purpose
Snapshot pre-vuln-assessment. Ethics card from Chapter 18 apply kara – no bridged weak VMs.
Hack (lab assessment only – not a weapon recipe): From Kali 192.168.56.10:
sudo nmap -sV --script vuln -T2 192.168.56.20 -oA ~/labs/sahyadri-vuln/presearchsploit vsftpd 2.3.4(and other banners); note CVE IDs from NVD / Exploit-DB- Optional: Greenbone Full-and-fast against
.20only; export severity counts - Nikto against
http://192.168.56.20for web-facing noise (headers, indexing)
Prove a wide Critical/High list. Never scan institute Wi-Fi, classmates, or public IPs. Do not run exploit payloads – finding + documenting is enough here.
Fix:
- Stop/remove unused daemons (
sudo service vsftpd stop; on Amazon Linux helperssudo yum removeunused servers) - Firewall allow-list: needed ports only from Kali
192.168.56.10 - Prefer SFTP/SSH over ancient FTP where the lab OS allows; patch what you can on helpers with
sudo yum update - Banner hardening on any web helper you own (
ServerTokens Prod/server_tokens off;) - Snapshot
post-vuln-fix
Re-verify: Same Nmap vuln scripts / Greenbone / Nikto – Critical/High drop; vsftpd finding gone or port closed/filtered. Write a 1-page Purple report for owner Raja: executive summary + top 5 findings (ID, severity, evidence, fix, re-scan proof). Study buddy Shraddha / Zoya peer-review false-positive calls. No real org, no internet targets.
Real incident: Equifax breach (2017)
In 2017, attackers exploited an unpatched Apache Struts vulnerability (publicly tracked as CVE-2017-5638) on an Equifax internet-facing dispute portal. Public US government reporting (including GAO) describes failures around identifying the vulnerable system, circulating the US-CERT patch alert on an outdated recipient list, and a scan that did not flag the portal – so the Critical web-app CVE stayed open while attackers later moved deeper and accessed large volumes of personal data (Equifax and GAO reported impact on the order of over 140 million individuals). Weakness: missing patch + incomplete asset inventory + weak detection on a public web application. What would have reduced it: timely Critical patching, accurate inventory of internet-facing apps, verified vulnerability scans that catch the real host, segmentation, and monitoring. Lab lesson: scanners and CVE lookups only help if Blue triages and patches – and never leaves a weak assessment target on a bridged LAN. Source: U.S. GAO report GAO-18-559; Equifax public statements; NVD entry for CVE-2017-5638 (verify current docs).
Real incident: WannaCry ransomware wave (2017)
In May 2017, WannaCry spread widely as ransomware that also wormed across networks by abusing unpatched Windows SMB (EternalBlue-class issues addressed in Microsoft’s MS17-010 bulletin). Reported disruption included many organisations worldwide and major impact on parts of the UK NHS where systems were unpatched or poorly segmented. Weakness: wormable OS/network vulnerability left unpatched + flat networks. What would have stopped / reduced it: apply available OS patches, disable unnecessary SMBv1, block SMB at the edge, segment critical networks, and keep offline backups. Lab lesson (different from Equifax’s web-app CVE): inventory must cover servers and OS services; re-scan after patching to prove High/Critical findings close. Source: Microsoft security blog on WannaCrypt; UK NAO investigation of WannaCry and the NHS; CISA alerts (verify current advisories).
Interview model (clean English): "I run vulnerability scans only against my host-only lab. I triage false positives, prioritise Critical/High that are reachable, remediate with service removal and allow-lists, re-scan to prove the drop, and deliver a short executive summary plus top findings – not a raw scanner dump."
Thodkyaat: scan shika, pan patch ani clear report shika. Aata pudhe web testing tools – ethics card sobat. Chala pudhe, mitrano!
Thodkyaat sangaycha tar
- A vulnerability is a weakness; CVE names one specific bug, CWE names the type of mistake, CVSS scores severity from 0 to 10.
- Start manually: versions from Nmap, then searchsploit and NVD.
- Nmap
vulnscripts give a quick first check, not a full picture. - OpenVAS/Greenbone does full network scans with fixes; Nikto checks web servers.
- Confirm findings, remove false positives, and prioritise by reachability, known exploitation and business impact – not only CVSS.
- The report is the product: executive summary for managers, exact evidence and fixes for engineers.
Samjla ka? Aata aaplyala kamjorya mahit aahet. Pudhchya chapter madhe aapan web applications kade valu – Burp Suite aani web testing tools. Chala pudhe, mitrano!