Ravindra BagaleCourses & study guides

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.

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.