<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Josephx on Medium]]></title>
        <description><![CDATA[Stories by Josephx on Medium]]></description>
        <link>https://medium.com/@musazadayusif?source=rss-504a83eca958------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*VDfAYUcaJmU2kJ5I</url>
            <title>Stories by Josephx on Medium</title>
            <link>https://medium.com/@musazadayusif?source=rss-504a83eca958------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 16:33:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@musazadayusif/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How Nmap Works: A Deep Dive into Network Scanning and Security Auditing]]></title>
            <link>https://medium.com/@musazadayusif/how-nmap-works-a-deep-dive-into-network-scanning-and-security-auditing-db8e57025765?source=rss-504a83eca958------2</link>
            <guid isPermaLink="false">https://medium.com/p/db8e57025765</guid>
            <dc:creator><![CDATA[Josephx]]></dc:creator>
            <pubDate>Wed, 01 Jan 2025 23:10:45 GMT</pubDate>
            <atom:updated>2025-01-01T23:10:45.395Z</atom:updated>
            <content:encoded><![CDATA[<h4>İntroduction</h4><p>Nmap (“Network Mapper”) is an open source tool for network intelligence and security auditing. Although it works well against single hosts, it is designed to quickly scan large networks. Nmap uses raw IP packets in new ways to determine what hosts are present on the network, what services (application name and version) those hosts offer, what operating systems (and OS versions) they are running, and what packet filters/firewalls they have. . has and dozens of other features are used. Although Nmap is typically used for security audits, many systems and network administrators find it useful for everyday tasks such as network inventories, managing service upgrade schedules, and monitoring host or service uptime.</p><p>The output of Nmap is a list of scanned targets with additional information about each depending on the options used. At the head of this information is the “table of interesting ports”. The table shows the port number and protocol, service name and status. A state is either open, filtered, closed, or unfiltered. Open means that the application on the target machine is listening for connections/packets on that port. Filtered means that a firewall, filter, or other network barrier is blocking the port, so Nmap can’t tell if it’s open or closed. Closed ports do not have software listening on them, but they can be opened at any time. Ports are classified as unfiltered when they respond to Nmap’s probes, but Nmap cannot determine whether they are open or closed. When Nmap cannot determine which of the two states describes a port, it reports the state combinations open|filtered and closed|filtered. When version detection is required, the port table may also include details of the software version. When IP protocol scanning is requested (-sO), Nmap reports the supported IP protocols, not the listening ports.</p><p>In addition to the table of ports of interest, Nmap can provide additional information about targets, including reverse DNS names, operating system guesses, device types, and MAC addresses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5tei4fGMQO-jYH4GIq8KMg.png" /><figcaption>This way we can see which ports are open in the scanme.nmap.org DNS</figcaption></figure><h3>How NMAP works</h3><p>Nmap sends various types of packets (e.g., TCP, UDP, ICMP) to the target using options like -sS (SYN scan) for stealthy scanning, -sT (TCP connect scan) for a full handshake scan, or -sU (UDP scan) for identifying open UDP ports. It then analyzes the responses, such as SYN-ACK for open TCP ports or ICMP replies for alive hosts, to gather information. Additionally, the -O option allows Nmap to perform OS detection, while -sV is used to detect service versions running on open ports. Advanced features like the Nmap Scripting Engine (NSE), triggered with — script, enable further in-depth analysis, such as vulnerability scanning. The results provide valuable insights into the network’s security posture, including open ports, running services, OS type, and possible security flaws.</p><h3>How the port scan process works</h3><h4>Choosing target and sending packets</h4><p>TCP Connect Scan (-sT): Nmap tries to establish a full TCP connection for each port. A triple handshake (TCP handshake) occurs for each port: “SYN” is sent, “SYN-ACK” is received, and “ACK” is sent.</p><p>SYN Scan (-sS): Nmap determines that a port is open if it only sends a “SYN” packet and receives a “SYN-ACK” response. This method is faster and is called a “stealth” scan because the connection is not completely completed.</p><p>UDP Scan (-sU): Nmap sends only UDP packets and determines whether ports are open based on responses or not, since no UDP connection is established.</p><p>Ping Scan (-sn): Used to check if target hosts are reachable only. Nmap checks whether hosts are alive by sending ICMP Echo Request (ping) or TCP SYN packets.</p><h4>Analysis of response</h4><p>Open: If the port is open, an appropriate response is received from the target system (for example, a SYN-ACK response in TCP).</p><p>Closed: If the port is closed, a “RST” (reset) response is received from the system.</p><p>Filtered: For firewalls and other security devices, no response may be received, in which case Nmap reports that the port is “filtered”.</p><p>Open|Filtered: Indicates whether a port is open or filtered if Nmap does not distinguish between open and filtered ports.</p><h4>Defining Services and Versions</h4><p>If the ports are open, Nmap tries to determine the services running on those ports and their versions with the -sV option. Nmap sends specific requests to specified ports and uses the responses to determine the name and version of the service. For example, on a port where an HTTP server is running, Nmap sends a “GET / HTTP/1.1” request and parses the server’s response.</p><h4>OS detection</h4><p>Nmap attempts to determine the target system’s operating system with the -O option. For this, TCP/IP stack fingerprinting is used, that is, Nmap tries to determine the operating system by analyzing specific parameters in network packets (TTL value, TCP window size, IP bytes, etc.).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*sYGwHtUVkDHqWJY-aB-AxA.jpeg" /><figcaption>For example: target’s operating system is Windows</figcaption></figure><p>Operating systems by TTL values</p><ul><li>Linux/Unix: Typically 64</li><li>Windows: Typically 128</li><li>MacOS: Typically 64</li></ul><h3>How Host Scan works</h3><h4>Ping Scan (-sn):</h4><p>The most commonly used method for host scan in Nmap is ping scan. This involves sending ICMP Echo Request (ping) packets to check if the host is alive and waiting for responses. If an ICMP Echo Reply is received from the host, then the host is reachable (alive).<br>This method can also be implemented with TCP SYN or TCP ACK packets, so that Nmap can scan the target even if ICMP packets are blocked by firewalls and other security systems.</p><h4>How is the process going?</h4><p>Nmap identifies the target IP address or network range entered by the user. Once a target is selected, Nmap sends packets to check if the hosts on the network are alive. Commonly used packets types are:</p><p>ICMP Echo Request (Ping): This is the simplest and most widely used method. A ping (ICMP Echo Request) packet is sent to the target device and an ICMP Echo Reply is received if the device is alive.</p><p>TCP SYN Packets: Sometimes, firewalls can block ICMP packets. In this case, Nmap sends TCP SYN packets. If the target port is open, a SYN-ACK will be received in response and the host will be determined to be alive.</p><p>UDP Packets: UDP pings can also be used. UDP is a connectionless protocol and is used to test whether a host is up or not.</p><h4>Getting response and analyzing</h4><p>Alive Host: If the target host responds with an ICMP Echo Reply or a TCP SYN-ACK, the host is alive.</p><p>No response: If no response is received, the host may be offline (dead) or blocked by a firewall.</p><h4>Firewalls and Filters</h4><p>Static Packet Filters: These filters make decisions based on packet headers. For example, data such as IP address, port number and protocol type are taken into account.</p><p>Dynamic (Stateful) Packet Filters: In addition to packet headers, these filters monitor the connection state. Such filters monitor the state of TCP connections and accept packets only for certain connections.</p><p>Proxy Firewalls: Proxy firewalls act as an intermediary between the client and the server. They monitor network traffic and block traffic that does not meet security rules.</p><p>Web Application Firewalls (WAF): WAFs protect web applications. They detect and prevent attacks such as SQL injection, cross-site scripting (XSS) by monitoring HTTP/HTTPS traffic.</p><h4>To find out firewalls and filters with Nmap</h4><pre>#FIN XMAS NULL SCAN<br><br>#These scans use special flags to check the status of firewalls and filters.<br>#Some firewalls do not block these types of packets.<br>nmap -sF 192.168.1.1   # FIN Scan<br>nmap -sX 192.168.1.1   # Xmas Scan<br>nmap -sN 192.168.1.1   # Null Scan</pre><pre>#IDLE SCAN<br><br>#This is a hidden type of scan and is used to avoid detection by firewalls.<br>nmap -sI zombie_host 192.168.1.1</pre><pre>#FRAGMENTATION<br><br>#Sending packets in smaller chunks makes it harder for firewalls to detect them.<br>nmap -f 192.168.1.1</pre><h3>Conclusion</h3><p>Nmap is an essential tool for network security and management. Its various scanning methods and parameters provide network administrators with a wide range of opportunities to detect and protect weak points in their networks. In this article, how the process of host scanning and port scanning via Nmap is briefly explained.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db8e57025765" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>