17. Why Learn All This Before Kali Linux?
17.2 From Networking to Nmap and Wireshark
Part 1 madhe shiklele ports, TCP/UDP, 3-way handshake aani OSI layers – he Nmap aani Wireshark che "bhasha" aahet.
| You learnt (Part 1) | You will use it for |
|---|---|
| Ports and services (22, 80, 443, 3306...) | Reading Nmap results: which service, which risk |
| TCP 3-way handshake (SYN, SYN-ACK, ACK) | Understanding SYN scan (-sS) vs connect scan (-sT), and why firewalls log half-open connections |
| TCP vs UDP | Why UDP scans (-sU) are slow and need different thinking |
| Private vs public IP, NAT, CIDR | Defining the scope of a test (192.168.56.0/24 lab only) |
| OSI layers | Placing attacks: ARP spoofing (L2), IP spoofing (L3), SYN flood (L4), SQLi/XSS (L7) |
| HTTP vs HTTPS, TLS | Why Wireshark can read HTTP passwords but not HTTPS content |
A small preview – run only against your own machine or your lab network:
nmap -sT -p 22,80,443,3306 127.0.0.1 # which of these ports are open on MY machine?
sudo tcpdump -i any -c 5 port 80 # watch 5 packets of your own HTTP traffic
Each line of the Nmap output (22/tcp open ssh) is something you already understand: a port, a protocol and a service you configured in Part 2 and Part 3.
Why this matters for security
Defenders use the same knowledge the other way: close every port that is not needed, restrict management ports (22, 3306) to specific sources in security groups, and watch for scanning patterns (many SYNs to many ports) in logs. Knowing the handshake is what lets you recognise a scan in Wireshark or a SIEM.
Ravindra Bagale's Tip
Many students don't understand the difference between filtered and closed in Nmap output. closed means the packet reached the server but nobody is listening there; filtered means a firewall/security group blocked it on the way. Remember the handshake from Part 1 – the answer is right there.
Ravindra Bagale's Tip – मराठी
Nmap output मध्ये filtered आणि closed मधला फरक बऱ्याच students ना कळत नाही. closed म्हणजे packet server पर्यंत पोहोचला पण तिथे कोणी ऐकत नाही; filtered म्हणजे मधेच firewall/security group ने अडवला. Part 1 चा handshake आठवा – उत्तर तिथेच आहे.
Ravindra Bagale's Tip – हिंदी
Nmap output में filtered और closed का फ़र्क बहुत से students को समझ नहीं आता. closed यानी packet server तक पहुँचा पर वहाँ कोई सुन नहीं रहा; filtered यानी बीच में firewall/security group ने रोक दिया. Part 1 का handshake याद करो – जवाब वहीं है.
Practice task
On your own EC2 instance, list listening ports with sudo ss -tulnp. Predict what Nmap would show from the internet given your security group, and write down which ports should be open and why.
Extended teaching notes
Why this lesson matters
Kali tools are dual-use. In this course every run ends with a defensive note: what config would have blocked or detected the activity on a system you own.
Rule
Host-only lab, written scope, no bridging onto real LANs.
Mini case study
Suppose we are on a purple-team exercise for an Indian mid-size company (sample data). Red notes a technique from this lesson against a lab clone. Blue must show the control that stops it, the log that would have fired, and the ticket that hardens production. That is the standard this course trains you for.
Defender's worksheet (do this today)
- Write the lesson title, date and the exact lab target you are allowed to use.
- List three owned systems (VMs, apps, or cloud accounts) where this lesson applies.
- Run one safe check from the lesson on a lab system only. Paste the command and output.
- Write a two-sentence fix you would give a teammate.
- Name one related public advisory (CERT-In, CISA, NVD, or a vendor bulletin) with its date.
Indian workplace (sample data)
Suppose we are a junior analyst at Infosys, TCS, Wipro or a fintech SOC in Bengaluru/Pune. Turn this lesson into one checklist item with an owner, a due date and a place to store evidence (ticket + screenshot).
Global practice
Compare your notes with OWASP, CIS Benchmarks, NIST CSF/IR guidance or a cloud Well-Architected security question. Write five lines on what overlaps.
Everyday analogy
Explain the risk and the fix to a family member without jargon. If they can repeat the warning, you understand it well enough to teach juniors.
Key terms
- Control: a safeguard (patch, config, process, detection).
- Finding: a weakness backed by evidence.
- Remediation: the fix plus how you verified it.
- Scope: systems you have written permission to touch.
- Least privilege: only the access the task needs.
- Defence in depth: several layers so one failure does not end the story.
Common mistakes
- Skipping written permission "just for a quick scan".
- Practising on hostel, office or public targets without authorisation.
- Collecting tool output without writing the fix.
- Copying attack steps onto production to "verify". Defenders verify with versions, configs and patches.
- Publishing screenshots that contain secrets, cookies or internal hostnames.
Recap
- Evidence, fix, owner, date.
- Own lab only.
- Fix > spectacle.