CSS Exp 5
CSS Exp 5
5
Aim:
(i) Download and install nmap. Use it with different options to scan open ports, perform OS
fingerprinting, do a ping scan, tcp port scan, UDP port scan, xmas scan etc.
(ii) Detects ARP spoofing using nmap and/or open-source tool ARPWATCH and wireshark. Use
arping tool to generate gratuitous arps and monitor using wireshark
Theory:
What is Nmap?
Nmap (Network Mapper) is a widely used open-source tool designed to scan networks, discover
hosts and services, and audit security. Created by Gordon Lyon (Fyodor), Nmap is invaluable to
system administrators and cybersecurity professionals.
Key Features:
● Port Scanning: Identify open ports and potential services running on them.
● Scripting Engine: Automate scans and extend functionality via Nmap Scripting Engine
(NSE).
● Aggressive Scanning: Includes techniques like Xmas scan, NULL scan for stealth
testing.
Command Description
nmap -p- <target> Full TCP port scan (all 65535 ports)
nmap -sX <target> Xmas scan using FIN, URG, PSH flags
ARP spoofing (or poisoning) is a technique used to associate the attacker’s MAC address with the
IP address of another host (like a gateway), enabling interception or manipulation of traffic
(Man-in-the-Middle).
● ARPWATCH: Monitors ARP traffic and alerts when a MAC-IP mapping changes.
● Wireshark: Captures ARP packets; repeated unsolicited replies or MAC inconsistencies
indicate spoofing.
● arping: Sends ARP requests and can simulate attacks (gratuitous ARP generation).
FTP is one of the earliest protocols used to transfer files between a client and a server over a
network. It works over TCP and follows a client-server model where the client initiates
commands and the server responds. FTP operates on two channels: a command channel (for
control signals) and a data channel (for actual file transfers).
Advantages:
● Simple to implement
● Useful for bulk file transfers
Drawbacks:
● Transmits data, including credentials, in plaintext
● Susceptible to sniffing and spoofing
Secure Alternatives:
● SFTP (SSH File Transfer Protocol): Uses SSH for encryption
● FTPS (FTP Secure): Adds SSL/TLS encryption to FTP
● Use filter: ftp
● Examine commands (USER, PASS, RETR, STOR).
● Security concern: Credentials transmitted in plaintext.
● Solution: Use SFTP/FTPS for secure file transfers.
Characteristics:
● Stateless: Each request is independent
● Text-based: Human-readable requests and responses
Security Considerations:
● HTTP is unencrypted, making it vulnerable to eavesdropping
● HTTPS (HTTP Secure) adds SSL/TLS encryption for secure communication
Best Practice:
● Always prefer HTTPS to protect sensitive data
● Use filter: http
● Analyze headers, URL, and sensitive fields.
● HTTP is not encrypted — switch to HTTPS for secure communication.
2. What does it mean for a port on ves.ac.in to be “filtered?” More specifically, what is the
TCP packet type, if any, the server gives in response to a SYN packet sent to port that is
“filtered?”
Ans: A port is considered "filtered" when firewall rules or network security mechanisms block
access to it. When a SYN packet is sent to a filtered port, the server either: Does not respond at
all (silent drop), or Sends an ICMP Destination Unreachable (Type 3, Code 13: Communication
Administratively Prohibited) message.
3. What TCP parameters does nmap alter to fingerprint the host’s operating system?
Ans: Nmap modifies various TCP parameters to identify the target's operating system, including:
● Initial TTL (Time to Live) value
● Window size in SYN-ACK responses
● TCP sequence number generation patterns
● Response to unusual flag combinations (e.g., FIN, NULL, and Xmas scans)
● Behavior of IP fragmentation and TCP options (such as Maximum Segment Size (MSS),
Window Scale, and Timestamp values)
● ICMP responses, including TTL values and Type 3 (Destination Unreachable) codes.
These parameters help Nmap compare the responses to a database of known OS signatures and
determine the operating system running on the target host.
Input:-
Scanning all open ports Intense scan
Intense scan plus UDP Intense scan, all TCP ports
ARP
ARP
FTP
UDP
HTTP
Conclusion:
Nmap is a versatile network scanning tool capable of port scanning, OS detection, and service
identification. Combined with ARPWATCH, Wireshark, and arping, it enables effective
detection of ARP spoofing and traffic analysis. Understanding these tools equips network
professionals to identify vulnerabilities and improve network security.