Unit Iii Reconnaissance
Unit Iii Reconnaissance
DEPARTMENT OF CSBS
UNIT III
RECONNAISSANCE
Harvester – Whois – Netcraft – Host – Extracting Information from DNS – Extracting Information
from E-mail Servers – Social Engineering Reconnaissance; Scanning – Port Scanning – Network
Scanning and Vulnerability Scanning – Scanning Methodology – Ping Sweer Techniques – Nmap
Command Switches – SYN – Stealth – XMAS – NULL – IDLE – FIN Scans – Banner Grabbing and
OS Finger printing Techniques.
Harvester
Harvester is an information-gathering tool that is built by the guys at edge security and is included by
default in Kali Linux. The goal of this tool is to find and gather all email
addresses, subdomains, hosts, ports, employee names, and banners that can provide information about
the
target. This tool is intended to help Penetration testers in the early stages of the penetration test in
orde r to understand the customer footprint on the Internet. It is also useful for anyone that wants to
know what an attacker can see about their organization.
Note: But the unique part is that Harvester doesn’t use any advanced algorithms to crack passwords,
t est firewalls, or sniff data on networks. Instead, it gathers public information available on the
internet automatically.
2
Result:
Whois Lookup
In this section, we are going to have a look at is Whois Lookup. It is a protocol that is used to find
the owners of internet resources, for example, a domain, a server, an IP address. In this, we are not
actually hacking, we are just retrieving information from a database about owners of stuff on the
internet. For example, if we wanted to register a domain name like zaid.com we have to supply
information about the person who is signing in like address, and then the domain name will be stored
in our name and people will see that Zaid owns the domain name. That is all we are going to do.
Zone transfers
One particularly useful source of DNS information is a zone transfer (AXFR). Because networks
typically have two or more DNS servers for redundancy or load balancing, they need to communicate
with each other to share their host-to-IP mappings and stay in sync.
Host
If we have collected host names (for a given target) in previous reconnaissance steps, we need to
translate those into IP addresses for future steps. To do so, we can use host.
Host is built into most Linux systems (including Kali). I’m not sure what a Windows equivalent is,
besides maybe nslookup.
To use host, type host followed by the DNS server you are trying to find an IP address for. For
example:
host ns1.bluehost.com
Which returns
ns1.bluehost.com has address 162.159.24.80
NSLookup
Nslookup is a tool that queries DNS server for its host records. It’s available for Linux (including
Kali) and Windows. To use it, open up a command line and run:
nslookup
It will then show a >, and wait for you to enter in server and the IP address of the DNS server that
4
you want to learn about (if you only have the hostname, use host as shown in the previous section to
get the IP address).
server 8.8.8.8
5
Then, you’ll have to specify the type of DNS record. There are several different types:
● CNAME allows a machine to be known by the hostnames specified in the CNAME record.
● MX or Mail Exchanger is for routing email to the specified email server. There are
priority numbers given to specify which mail server should be contacted first.
● NS records map a domain name to their related DNS servers (i.e. google.com -
> ns1.google.com, ns2.google.com, etc.)
● TXT records are for text-based info. One example might be domain ownership
verification. A full list of DNS record types can be found here, on Wikipedia.
You can either ask for all DNS record types, or specify a certain type:
set type = any
or set type = a, set type = mx, and so on. The additional servers that you find from nslookup can be
added to the target list.
Email Servers
If we find an email server, this presents another opportunity to learn more about a target. Email
servers must allow outside traffic in to be useful as email servers. In The Basics of Hacking and
Penetration Testing, Engebretson says to send an email to the organization with an empty .bat or .exe
file. The goal is to get rejected, and then inspect the rejection email for anti-virus vendor and version
information, IP address of the server, software versions being used on the server, etc.
Zone
transf
ers
Dig
If you want to attempt a zone transfer (Engebretson notes that your chances of success are pretty low),
you can use dig to do so:
dig @ip_address_here example.com -t AXFR
Fierce
If the zone transfer doesn’t work out for you, fierce can be your backup option. Fierce is a Perl-script
that comes pre-installed on Kali. To use:
6
cd /usr/bin/
7
reverse lookups (brute force).
-dnsserver Use a particular DNS server for reverse lookups
(probably should be the DNS server of the target). Fierce
uses your DNS server for the initial SOA query and then
uses the target's DNS server for all additional queries by
default.
-file A file you would like to output to be logged to.
-fulloutput When combined with -connect this will output
everything the webserver sends back, not just the HTTP
headers.
A list of command line flags can be found here.
Port scanning
A port scan is a common technique hackers use to discover open doors or weak points in a network. A
port scan attack helps cyber criminals find open ports and figure out whether they are receiving or
sending data. It can also reveal whether active security devices like firewalls are being used by an
organization.
When hackers send a message to a port, the response they receive determines whether the port is
being used and if there are any potential weaknesses that could be exploited.
Businesses can also use the port scanning technique to send packets to specific ports and analyze
responses for any potential vulnerability. They can then use tools like IP scanning, network mapper
(Nmap), and Netcat to ensure their network and systems are secure.
Port scanning can provide information such as:
1. Services that are running
2. Users who own services
3. Whether anonymous logins are allowed
4. Which network services require authentication
8
What is a Port?
A port is a point on a computer where information exchange between multiple programs and the
internet to devices or other computers takes place. To ensure consistency and simplify programming
processes, ports are assigned port numbers. This, in conjunction with an IP address, forms vital
information that each internet service provider (ISP) uses to fulfill requests.
9
Port numbers range from 0 through to 65,536 and are ranked in terms of popularity. Ports numbered 0
to 1,023 are called “well-known" ports, which are typically reserved for internet usage but can also
have specialized purposes. These ports, which are assigned by the Internet Assigned Numbers
Authority (IANA), are held by leading businesses and Structured Query Language (SQL) services.
Ports are generally managed by the Transmission Control Protocol (TCP), which defines how to
establish and maintain a network conversation between applications, and User Datagram Protocol
(UDP), which is primarily used for establishing low-latency and loss-tolerating connections between
applications. Some of the most popular and most frequently used ports include:
1. Port 20 (UDP): File Transfer Protocol (FTP) used for transferring data
2. Port 22 (TCP): Secure Shell (SSH) protocol used for FTP, port forwarding, and secure logins
3. Port 23 (TCP): The Telnet protocol used for unencrypted communication
4. Port 53 (UDP): The Domain Name System (DNS), which translates internet domain
names into machine-readable IP addresses
5. Port 80 (TCP): The World Wide Web Hypertext Transfer Protocol (HTTP)
Ports numbered from 1,024 to 49,151 are considered “registered ports,” and they are registered by
software companies. The ports numbered from 49,152 to 65,536 are considered dynamic and private
ports, which can be used by almost everyone on the internet.
● Open ports: Open ports indicate that the target server or network is actively accepting
connections or datagrams and has responded with a packet that indicates it is listening. It
also indicates that the service used for the scan (typically TCP or UDP) is in use as well.
Finding open ports is typically the overall goal of port scanning and a victory for a
cybercriminal looking for an attack avenue. The challenge for IT administrators is trying to
barricade open ports by installing firewalls to protect them without limiting access for
legitimate users.
● Closed ports: Closed ports indicate that the server or network received the request, but
there is no service “listening” on that port. A closed port is still accessible and can be useful
in showing that a host is on an IP address. IT administrators should still monitor closed ports
as they could change to an open status and potentially create vulnerabilities. IT
administrators should consider blocking closed ports with a firewall, where they would then
become “filtered” ports.
● Filtered ports: Filtered ports indicate that a request packet was sent, but the host did not
respond and is not listening. This usually means that a request packet was filtered out
11
and/or blocked by a firewall. If packets do not reach their target location, attackers cannot
find out more information. Filtered ports often respond with error messages reading
“destination unreachable” or “communication prohibited.”
12
Network Scanning
Network scanning is the process of troubleshooting the active devices on your system for
vulnerabilities. It identifies and examines the connected devices by deploying one or more features in
the network protocol. These features pick up vulnerability signals and give you feedback on the
security status of your network.
Network scanning facilitates system maintenance, monitoring, and security assessments. When
implemented effectively, network scanning gives you insights into some of the best ways to protect
your network against cyberattacks.
13
Types of Network Scanners
Scanning your network properly requires using the right tools and methods. Each method is
determined by what you want to achieve with your scanning. There are two major kinds of network
scanning—port scanning and vulnerability scanning.
1. Port Scanning
Port scanning enables you to identify open ports in a network that can receive or send data. You can
use it to send packets to targeted ports on a device. This process highlights loopholes and analyzes
performance feedback.
Before implementing port scanning, you have to identify the list of active devices and maps to their IP
addresses.
The primary goal of port scanning is to use the data it acquires from active devices to diagnose
security levels.
2. Vulnerability Scanning
Vulnerability scanning helps you to detect vulnerabilities that exist on your network. Running a check
on your system exposes threats that were hidden away from you.
In most organizations, vulnerability scanning is conducted by the IT department. But if you want to
get thorough feedback, consider hiring a third-party security expert. Since they aren't familiar with
your network, they'll conduct an objective analysis from an outsider's perspective.
Vulnerability scanning can also be performed by cyberattackers intending to identify weak spots in
your network. Beat them to it by identifying and closing the weak links.
Besides identifying loopholes, vulnerability scanning also evaluates the security capacity of your
network against cyberattacks. It uses a database to analyze possible attacks. This database provides
the vulnerability scanner with packet construction anomalies, flaws, default configurations, paths to
sensitive data, and coding bugs that can enable cyber attackers to exploit your network.
14
In a complex organizational network, multiple subnets of various IP addresses are assigned to several
devices to improve their performance on the system. Scanning these devices helps to remove clogs
and creates a free flow for optimal performance.
15
Scanning your network manually is tedious and time-consuming. The scanning process could linger
for long. Your work is on hold, making you lose money in the long run.
Network scanning is an automated process. It evaluates tons of data within a short time. You get it
over with as soon as possible and keep your workflow moving.
The purpose of network scanning is as follows:
● Recognize available UDP and TCP network services running on the targeted hosts
● Recognize filtering systems between the user and the targeted hosts
● Vulnerability scanning lets you take a proactive approach to close any gaps and maintain
strong security for your systems, data, employees, and customers. Data breaches are often
the result of unpatched vulnerabilities, so identifying and eliminating these security gaps,
removes that attack vector.
● Cybersecurity compliance and regulations demand secure systems. For instance, NIST,
PCI DSS, and HIPAA all emphasize vulnerability scanning to protect sensitive data.
● Cyber criminals also have access to vulnerability scanning tools, so it is vital to carry
out scans and take restorative actions before hackers can exploit any security
vulnerabilities.
17
Let’s now explore some different types of vulnerability scans, which each have their place, depending
on your use cases.
Environmental Scans
These scans are based on the environment that your technology operates in. Specialized scans are
available for multiple different technology deployments, including cloud-based, IoT devices, mobile
devices, websites, and more.
19
A scan may need human input or further
integrations to deliver value
Although the scanning process itself is easily automated, a security expert may still need to review the
results, complete remediation, and follow-up to ensure risks are mitigated. Many organizations also
integrate vulnerability scanning with automated patch management and other solutions to help reduce
the human administrative burden. Regardless, the scan itself is only an early step in the vulnerability
management lifecycle.
Scanning methodology
1. Check for live systems. Something as simple as a ping can provide this. This gives you a list
of what’s actually alive on your network subnet.
2. Check for open ports. Once you know which IP addresses are active, find what ports
they’re listening on.
3. Scan beyond IDS. Sometimes your scanning efforts need to be altered to avoid
those pesky intrusion detection systems.
4. Perform banner grabbing. Banner grabbing and OS fingerprinting will tell you what operating
system is on the machines and which services they are running.
5. Scan for vulnerabilities. Perform a more focused look at the vulnerabilities these machines
haven’t been patched for yet.
6. Draw network diagrams. A good network diagram will display all the logical and physical
pathways to targets you might like.
20
7. Prepare proxies. This obscures your efforts to keep you
hidden. Scanning Methodology
21
● Check for Live Systems: Ping scan checks for the live system by sending ICMP echo
request packets. If a system is alive, the system responds with ICMP echo reply packet
containing details of TTL, packet size etc.
● Check for Open Ports: Port scanning helps us to find out open ports, services running
on them, their versions etc. Nmap is the powerful tool used mainly for this purpose.
We have various types of scan:
Connect scan: Identifies open ports by establishing a TCP handshake with the target.
Source:
https://www.safaribooksonline.com Nmap
command: nmap -sS -v <TargetIp>
XMAS scan: This is also called as inverse TCP scanning. This works by sending packets set with
PSH, URG, FIN flags. The targets do not respond if the ports are open and send a reset response
if ports are closed.
Source: https://www.information-security.fr
FIN scan: Fin flag is set in the TCP packets sent to the target. open ports doe does not respond while
closed ports send a reset response.
22
Source: https://securitcrs.wordpress.com
23
Nmap command: nmap -SF <targetIp>
ACK scan: Here the attacker sets the ACK flag in the TCP header and the target's port status is
gathered based on window size and TTL value of RESET packets received from the target.
Source: https://www.hackingloops.com
Nmap command: nmap -SA -v <targetip>
Null Scan: Works by sending TCP packets with no flags set to the target. Open ports do not respond
while closed ports respond with a RESET packet.
Source: https://en.wikipedia.org/wiki/Idle_scan
Nmap command : nmap -Pn -sI ZombieIp TargetIp
Banner Grabbing
Banner grabbing is a process of collecting information like operating system details, the name of the
service running with its version number etc.
Vulnerability scanning:
Mainly automated tools are used for this purpose. These automated scanners scan the target to find out
vulnerabilities or weakness in the target organization which can be exploited by the attackers.
24
Vulnerabilities include application vulnerabilities, configuration vulnerabilities, network
vulnerabilities, operating system vulnerabilities etc.
Some examples include operating system is not updated, default passwords used, plain text protocols
used, vulnerable protocols running etc.
Tools: Nessus, Acunetix
Prepare Proxies
Proxies can use to maintain the anonymity of the attacker by masking the IP address. It can capture
information passing through it since it acts as an intermediary between client and server and the
attacker can access the resources remotely using the proxies.
Eg: TOR browsers, Onion sites etc, Proxify, Psiphon etc
Countermeasures:
● Configure IDS and firewall to block probes.
25
One host like the user requests data and the receiver host accepts it, furthermore sends back packets
of information in bytes. In between these packets they get validated and a response comes back to the
sender host. For this reason, ping sweep or ping scan is also known as a two-way handshake protocol.
26
that go deep into the ocean and visibility is zero there. No light can pass, but the sound waves can. As
water is a great conductor of sound. What sonar technology does is, sends signals in all directions.
The sonar signal bounces back from obstacles on all sides, making it possible to map live data from
around the area. The system was called pinging and thus we got the name, but in computing, it is used
as an IP network utility tool and called pinging.
Network administrators have the capability to ping devices connected to a specific network. Of
course, that has to be on a network. On the other hand, as we’ve talked about ICMP, ping sweep, we
can help diagnose a network issue quickly and find what’s going on with the host. Even remote
devices on different IPs can be accessed by sweeping ping.
27
Nmap command switches
Nmap is probably the most famous reconnaissance tool among Pentesters and Hacker. It is
essentially a port scanner that helps you scan networks and identify various ports and services
available in the network, besides also providing further information on targets, including reverse
DNS names, operating system guesses, device types, and MAC addresses. It also comes in handy
during network auditing!
Nmap Switches
Nmap is strong and powerful networking scanning to tool which allows for customizing our scans
with the help of flags passed via the command line. Some of the important flags are :
● -v: Enable verbosity. You can even set the verbosity level as such :
● -vv: Level 2 verbosity. The minimum level of verbosity advised for use.
● -v3: Level 3 verbosity. You can always specify the verbosity level by specifying
a number like this.
● -oA: Same Nmap output in “normal”, XML and grepable formats. However you can
specify the format of your choice with :
● -oX: Produce output in a clean, XML format and store it in a given file
28
● -oG: Produce “grepable” output and store it to a file. Deprecated format as users
are now moving towards XML outputs.
● -A: Enables “aggressive” scanning. Presently this enables OS detection (-O), version
scanning (-sV), script scanning (-sC) and traceroute (–traceroute)
● -p: Specify the ports to scan. It can be a single port as well as a range of ports. For Example :
● nmap -p- 127.0.0.1: This scans all the ports on the localhost
29
1. TCP Connect Scans (-sT)
In this type of scan, Nmap sends a TCP packet to a port with the SYN flag set. In this scenario two
things can occur :
● The target responds with an RST packet that signifies that the port is closed.
● Target doesn’t respond at all, probably due to a firewall dropping all incoming packets
in which case the port will be considered filtered
● The target responds back with a TCP packet with the SYN/ACK flags set which would
signify that the port is open and then Nmap would respond with a TCP packet with the
ACK flag set and hence would complete the TCP 3-way handshake.
This is not a very reliable scan technique as it is easy to configure a firewall rule to respond back with
RST packets or drop all incoming packets. Also this method is extremely slow as it waits for the
entire TCP 3 way handshake.
● Often, SYN Scans are not logged by applications running on the ports as most applications
start logging a connection only after it has been fully established which is not the case
with SYN Scans
However, it is not advisable to run SYN Scans on production environments as it might break certain
unstable applications. It is also to be noted that SYN scans also require sudo privileges because it
needs to craft raw packets.
Infact, when run with sudo privileges, nmap defaults to SYN Scans, otherwise it defaults to TCP scan.
● Usually there is no response received in which case nmap marks the port as open|filtered. If
30
no response is received yet, it sends another UDP packet to double check and if yet again
no response is received, it marks the port as open|filtered and moves on
● It might get a UDP response back which is very rare. In such a scenario, the port is
marked open
31
● If the port is closed and it receives an ICMP echo request back which signifies that the port
is unreachable.
Limitations
As these scans are of a similar nature, they also have similar outputs which is very similar to that of
UDP Scans. In this case, we can only have the following three responses :
● open|filtered : When no response is received then the port is categorized as this this
because no response can mean only two things :
● filtered : When the port is protected behind a firewall which sends an ICMP ping back
It is also to be note that though RFC 793 mandates that network hosts respond to malformed
packets with a RST TCP packet for closed ports, and don’t respond at all for open ports, some
systems reject this convention. This behaviour is mostly observed in Microsoft Windows Servers
and some CISCO devices where all malformed packets are dropped by default.
32
Scanning A Network For Hosts using Nmap
One of the most important things to do on connecting to a network is to obtain a list of all active
hosts on the network before further probing. This can be done via an “Ping Sweep”, which as the
name implies, involves sending ICMP packet to all the IPs in the network and await for responses.
The hosts which reply back with an ICMP packet are considered active in this case.
You can specify your target IP ranges by using hypens or via CIDR as follows :
$ nmap -sn 192.168.0.1-254
Copy
Or,
33
$ nmap -sn 192.168.0.0/24
Copy
The -sn flag suppresses any port scans, and forces nmap to rely solely on ICMP echo packets (or ARP
requests if run with superuser privileges) to identify active hosts in the network. It also sens a TCP
SYN packet to the target’s port 443 and a TCP ACK request ( TCP SYN if run with superuser
privileges) to the target’s port 80.
● discovery:- Attempt to query running services for further information about the network
34
XMAS - XMAS scans send a packet with the FIN, URG, and PSH flags set. If the port is open, there
is no response; but if the port is closed, the target responds with a RST/ACK packet. XMAS scans
work only on target systems that follow the RFC 793 implementation of TCP/IP and don’t work
against any version of Windows.
FIN - A FIN scan is similar to an XMAS scan but sends a packet with just the FIN flag set. FIN scans
receive the same response and have the same limitations as XMAS scans. FIN A FIN scan is similar
35
to an XMAS scan but sends a packet with just the FIN flag set. FIN scans receive the same response
and have the same limitations as XMAS scans.
NULL - A NULL scan is also similar to XMAS and FIN in its limitations and response, but it just
sends a packet with no flags set.
IDLE - An IDLE scan uses a spoofed IP address to send a SYN packet to a target. Depending on
the response, the port can be determined to be open or closed. IDLE scans determine port scan
response by monitoring IP header sequence numbers.
IPEye is a TCP port scanner that can do SYN, FIN, Null, and XMAS scans. It’s a commandline tool.
IPEye probes the ports on a target system and responds with closed, reject, drop, or open. Closed
means there is a computer on the other end, but it doesn’t listen at the port. Reject means a firewall is
rejecting the connection to the port (sending a reset back). Drop means a firewall is dropping
everything to the port, or there is no computer on the other end. Open means some kind of service is
listening at the port. These responses help a hacker identify what type of system is responding.
IPSecScan is a tool that can scan either a single IP address or a range of addresses looking for systems
that are IPSec enabled.
NetScan Tools Pro, hping2, KingPingicmpenum, and SNMP Scanner are all scanning tools and
can also be used to fingerprint the operating system (discussed later).
Icmpenum uses not only ICMP Echo packets to probe networks, but also ICMP Timestamp and
ICMP Information packets. Furthermore, it supports spoofing and sniffing for reply packets.
Icmpenum is great for scanning networks when the firewall blocks ICMP Echo packets but fails to
block Timestamp or Information packets.
The hping2 tool is notable because it contains a host of other features besides OS fingerprinting such
as TCP, User Datagram Protocol (UDP), ICMP, and raw-IP ping protocols, traceroute mode, and the
ability to send files between the source and target system.
SNMP Scanner allows you to scan a range or list of hosts performing ping, DNS, and Simple
Network Management Protocol (SNMP) queries.
Banner grabbing
Banner grabbing is a method used by attackers and security teams to obtain information about
network computer systems and services running on open ports. A banner is a text displayed by a host
that provides details such as the type and version of software running on the system or server. The
screen displays the software version number on the network server and other system information,
giving cybercriminals an advantage in cyber attacks. Banner grabbing considers collecting software
banner information such as name and version. Hackers can use the OSINT tool to get the banners
manually or automatically. Banner capture is one of the essential steps in both offensive and
defensive penetration testing environments.
36
Types of Banner Grabbing:
1. Active Banner Grabbing: In this method, Hackers send packets to a remote server and
analyze the response data. The attack involves opening a TCP or similar connection
between the origin and the remote server. An Intrusion Detection System (IDS) can easily
detect an active banner.
2. Passive Banner Capture: This method allows hackers and security analysts to get the same
information while avoiding disclosing the original connection. In passive banner grabbing,
the attackers deploy software and malware as a gateway to prevent direct connection when
collecting data from the target. This technique uses third-party network tools and services to
capture and analyze packets to identify the software and version being used. run on the server.
Usage:
Hackers can perform a banner-grabbing attack against various protocols to discover insecure and
vulnerable applications and exploits. There are many services, protocols, and types of banner
information that you can collect using banner grabbing. You can develop various methods and tools
for the discovery process. In general, banner grab allows an attacker to discover network servers and
services running along with their instances on open ports, as well as the operating system. Given the
type and version of an application, a hacker, or pen tester, can quickly scan for known and
exploitable vulnerabilities in that version.
Service Ports:
● Port 80 is running on Hypertext Transfer Protocol (HTTP) service.
Important Points:
● Banner Grabbing is used in Ethical Hacking to gather information about a target
system before launching an attack.
● In order to gather this information, the Hacker must choose a website that displays
banners from affiliate sites and navigate from the banner to the site served by the affiliate
website.
● Banner Grabbing can be done through manual means or through the use of automated
tools such as web crawlers, which search websites and download everything on them,
including banners and files.
37
OS Fingerprinting
If a hacker can determine what type of operating system a targeted computer is running, he or she
can work to exploit the vulnerabilities present in that operating system. OS Fingerprinting is used by
security professionals and hackers for mapping remote networks and determining which
vulnerabilities might be present to exploit. In fact, it is a tactic used by cyber-criminals and even
ethical hackers to figure out what type of operating system is being used by a target computer on a
network. In fact, by analyzing certain protocol flags, options, and data in the packets a device sends
onto the network, hackers can make relatively accurate guesses about the OS that sent those packets.
OS Fingerprinting works only for packets that contain a full-fledged TCP connection; that is the TCP
connection should have a SYN, SYN/ACK, and ACK connection.
There are two Fingerprinting:
38
● Active
● Passive
Active OS Fingerprinting
Active OS fingerprinting involves actively determining a targeted PC’s OS by sending carefully
crafted packets to the target system and examining the TCP/IP behavior of received responses. The
main reason why an attacker may prefer a passive approach is to reduce the risk of being caught by
an IDS, IPS, or a firewall. Properly configured, implemented, and maintained IDSes, IPSes,
and firewalls can mitigate active fingerprinting. In other words, active fingerprinting is challenging
the target machine to see what happens.
Active fingerprinting works by sending packets to a target and analyzing the packets that are sent
back. Almost all active fingerprinting these days is done with Nmap.
Nmap is usually used by network administrators to monitor the security of their networks. In fact,
Nmap is an effective application for both admins and attackers. Nmap sends probes to lots of
different TCP/IP ports, and analyzes what returned. Nmap utilizes scripting that analyzes that data to
print out results that are useful for OS fingerprinting. Running an OS fingerprinting scan in Nmap is
as simple as typing:
“nmap -A
ip_address_or_domain_name_of_target”. Source:
infosecinstitute.com
Passive OS Fingerprinting
Passive OS fingerprinting is a more effective way of avoiding detection or being stopped by a
firewall and it examines of passively collected sample of packets from a host. Passive fingerprinting
uses a pcap (packet capture) API. In GNU/Linux and BSD/Unix operating systems, pcap can be
found in the libpcap library, and for Windows, there’s a port of libpcap called WinPcap. Passive
fingerprinting can make a guess of a target’s OS, because different OSes have different TCP/IP
implementations.
Passive OS fingerprinting is less accurate than active OS fingerprinting, but may be a technique
chosen by an attacker or penetration tester who wants to avoid detection. Passive fingerprinting can
be mitigated by assuring that NICs (network interface cards) don’t operate in promiscuous mode.
There are following four important elements that we will look at to determine the operating system
● TTL: What the operating system sets the Time-To-Live on the outbound packet.
● Window Size: What the operating system sets the Window Size at.
● DF: Does the operating system set the Don’t Fragment bit?
39
● TOS: Does the operating system set the type of
40
41