Chapter 4 Enumeration
Chapter 4 Enumeration
Chapter 4 Enumeration
Chapter 4: Enumeration
Technology Brief
In the earlier processes like Footprinting and Scanning, we have understood how to
collect information about any organization, target website, or a particular network. We
have also discussed several tools that can be helpful in collecting the general information
regarding the target. Now we are moving to observe the target more closely in order to
gain detailed information. This information is sensitive such as network information,
network resources, routing paths, SNMP, DNS and other protocol-related information,
user and group information, etc. This sensitive information is required to gain access to a
system. This information is gathered by using different tools and techniques actively.
Enumeration Concepts
Enumeration
In the phase of Enumeration, An attacker initiates active connections with the target
system. With this active connection, direct queries are generated to gain more
information. These information helps to identify the system attack points. Once attacker
discovers attack points, it can gain unauthorized access using this collected information
to reach assets.
Information that is enumerated in this phase are: -
Routing Information
SNMP Information
DNS Information
Machine Name
User Information
Group Information
Application and Banners
Network Sharing Information
Network Resources
In the previous phases, the finding was not too concerned with any legal issues. Using the
tools required for enumeration phase may cross legal boundaries and chances to being
traced as using active connections with the target. You must have proper permission to
perform these actions.
Performing Ping Sweep on the subnet to check live host and other basic information.
Enter the command: root@kali:~# nmap –sU -p 10.10.10.12
UDP port scanning for port 161 (SNMP Port) for the target host 10.10.10.12. The result
shows SNMP port 161 is open & filtered. Now enter the command: root@kali:~# nmap –sS
10.10.10.12 to perform a Stealthy scan on target host 10.10.10.12
The result shows a list of open ports and services running on the target host.
Enter the command: root@kali:~# nmap –sSV -O 10.10.10.12
Operating System & Version scanning on target host 10.10.10.12.
NetBIOS Enumeration
NetBIOS is Network Basic Input / Output System program that allows the
communication in between different applications running on different systems within a
local area network. NetBIOS service uses a unique 16-ASCII Character string in order to
identify the network devices over TCP/IP. The Initial 15 Characters are for identifying the
device, 16th Character is to identify the service. NetBIOS service uses TCP port 139.
NetBIOS over TCP (NetBT) uses the following TCP and UDP ports:
UDP port 137 (name services)
UDP port 138 (datagram services)
TCP port 139 (session services)
Using NetBIOS Enumeration, an attacker can discover: -
List of Machines within a domain
File Sharing
Printer Sharing
Username
Group information
Password
Policies
the nbstat command can be used along with several options, list the options available for
the nbstat command are as below: -
Option Description
With hostname, Display the NetBIOS name table, MAC address
-a
information.
With IP Address, Display the NetBIOS name table, MAC address
-A
information.
NetBIOS name cache information.
-c
Displays the names registered locally by NetBIOS applications such as
-n
the server and redirector.
Displays a count of all resolved names by broadcast or the WINS server.
-r
Lists the NetBIOS sessions table and converts destination IP addresses
-s
to computer NetBIOS names.
Lists the current NetBIOS sessions, status, along with the IP address.
-S
Table 4-03 nbstat options
After starting the Enumeration, it will gather the information about the target machine
such as MAC address information, operating system information and other information
depending upon the type of enumeration selected before initiating the process.
Displaying User information of target machine along with Full name, System comments,
Last login information, password expiry information, password change information,
number of logins and invalid password count information, etc.
The result is showing password and Account policies information, shares information,
Remote login information, etc.
After Scanning, select your target host and right click on it.
Go to Properties.
The output is showing shared resource & basic information about the host. This host has
shared folders with different users.
This host does not have any shared resource with anyone.
SNMP Enumeration
SNMP Enumeration
Simple Network Management Protocol (SNMP) Enumeration is a technique of
enumeration using most widely used network management protocol SNMP. In SNMP
Enumeration, user accounts and device information is targeted using SNMP. SNMP
requires community string to authenticate the management station.
This community string is in a different form in different versions of SNMP. Using the
default community string, by guessing the community string, attacker extracts the
information such as Host, devices, shares, network information and much more by
gaining unauthorized access.
Community Strings Description
SNMP Read-only Enables a remote device to retrieve "read-only"
community string information from a device.
SNMP Read-Write Used in requests for information from a device and to
community string modify settings on that device.
SNMP Trap community Sends SNMP Traps to InterMapper.
string
Table 4-05 SNMP Community String types
Scalar objects define a single object instance whereas tabular objects define multiple
related object instances grouped in MIB tables. MIBs are collections of definitions, which
define the properties of the managed object within the device to be managed.
This collection of information such as a description of network objects that are organized
& managed hierarchically in MIB using SNMP is addressed through Object identifiers
(OIDs). These Object identifiers (OIDs) includes MIB objects like String, Address,
Counter, Access level and other information.
MIB Example: The typical objects to monitor on a printer are the different cartridge states
and maybe the number of printed files, and on a switch, the typical objects of interest are
the incoming and outgoing traffic as well as the rate of packet loss or the number of
packets addressed to a broadcast address.
The features of available SNMP variants are:
version Features
No Support for encryption and hashing. Plain text community string is
V1
used for authentication
No support for encryption and hashing either. Some great functions like
V2c
the ability to get data in bulk from agents are implemented in version 2c
Support for both encryption (DES) and hashing (MD5 or SHA).
Implementation of version 3 has three models. NoAuthNoPriv means no
V3 encryption and hashing will be used. AuthNoPriv means only MD5 or
SHA based hashing will be used. AuthPriv means both encryption and
hashing will be used for SNMP traffic.
Table 4-07 SNMP versions
Key features
Automated network detection
Monitoring and alerts in real time
Powerful diagnostic capabilities
Improved network security
Registry configuration and administration
Monitoring of IP addresses and DHCP scopes
LDAP Enumeration
Lightweight Directory Access Protocol (LDAP)
The Lightweight Directory Access Protocol LDAP is an open standard, Internet protocol.
LDAP is for accessing and maintaining distributed directory information services in a
hierarchical and logical structure. A directory service plays an important role by allowing
the sharing of information like user, system, network, service, etc. throughout the
network. LDAP provides a central place to store usernames and passwords. Applications
and Services connect to the LDAP server to validate users. The client initiates an LDAP
session by sending an operation request to Directory System Agent (DSA) using TCP port
389. Communication between Client and Server uses Basic Encoding Rules (BER).
Directory services using LDAP includes:
Active Directory
Open Directory
Oracle iPlanet
Novell eDirectory
OpenLDAP
LDAP Enumeration Tool:
LDAP enumeration tools that can be used for the enumeration of LDAP-enabled systems
& services include:
LDAP Enumeration Tool Website
JXplorer www.jxplorer.org
LDAP Admin Tool www.ldapsoft.com
LDAP Account Manager www.ldap-account-manager.org
NTP Enumeration
Network Time Protocol (NTP)
NTP is Network Time Protocol used in a network to synchronize the clocks across the
hosts and network devices. The NTP is an important protocol, as directory services,
network devices and host rely on clock settings for login purposes and logging to keep a
record of events. NTP helps in correlating events by the time system logs are received by
Syslog servers. NTP uses UDP port number 123, and its whole communication is based on
coordinated universal time (UTC).
NTP uses a term known as stratum to describe the distance between NTP server and
device. It is just like TTL number that decreases every hop a packet passes by. Stratum
value, starting from one, increases by every hop. For example, if we see stratum number
10 on local router, it means that NTP server is nine hops away. Securing NTP is also an
important aspect as the attacker may change time at first place to mislead the forensic
teams who investigate and correlate the events to find the root cause of the attack.
NTP Authentication
NTP version 3 (NTPv3), and later versions support a cryptographic authentication
technique between NTP peers. This authentication can be used to mitigate an attack.
Three commands are used on the NTP master and the NTP client:
creators of NTP v3, it has support for authentication with NTP server before considering
its time to be authenticated one.
It is possible to gather information from NTP using different tools such as NTP
commands, Nmap and an NSE script. In the process of Enumeration through NTP,
attacker generates queries to NTP server to extract valuable information from the
responses such as: -
Host information connected to NTP server
Client IP address, Machine name, Operating System information
Network information such as Internal IPs depends upon deployment of NTP
server, i.e., if NTP server is deployed in DMZ.
NTP Enumeration Commands
ntpdc is used to query the ntpd daemon regarding current state & request changes in
state.
ntptrace is a Perl script, uses ntpq to follow the chain of NTP servers from a given host
back to the primary time source. ntptrace requires implementation of NTP Control and
Monitoring Protocol specified in RFC 1305 and enabled NTP Mode 6 packets to work
properly.
ntpq is a command line utility that is used to query the NTP server. The ntpq is used to`
monitor NTP daemon ntpd operations & determine performance. It uses the standard
NTP mode 6 control message formats.
Ntpq command can be used with following options: -
Options Description
-c The following argument is interpreted as an interactive format
command and is added to the list of commands to be executed on the
specified host(s). Multiple -c options may be given.
-d Turn on debugging mode.
-i Force ntpq to operate in interactive mode. Prompts will be written to
the standard output and commands read from the standard input.
-n Output all host addresses in the dotted-quad numeric format rather
than converting to the canonical host names.
-p Print a list of the peers known to the server as well as a summary of
their state. This is equivalent to the peer's interactive command.
-4 Force DNS resolution of following host names on the command line to
the IPv4 namespace.
-6 Force DNS resolution of following host names on the command line to
SMTP Enumeration
Simple Mail Transfer Protocol (SMTP)
SMTP Enumeration is another way to extract information about the target using Simple
Mail Transfer Protocol (SMTP). SMTP Protocol ensures the mail communication between
Email servers and recipients over Internet port 25. SMTP is one of the popular TCP/IP
protocol widely used by most of the email servers now defined in RFC 821.
SMTP Enumeration Technique
The following are some of the SMTP commands that can be used for Enumeration. SMTP
server responses for these commands such as VRFY, RCPT TO, and EXPN are different.
By inspecting and comparing the responses for valid and invalid users through interacting
the SMTP server via telnet, valid users can be determined.
Command Function
7. Linux support dig command, At a command prompt enter dig <domain.com> axfr.
Enumeration Countermeasures
Using advance security techniques, advanced security softwares, updated versions of
protocols, strong security policies, unique, and difficult password, strong encrypted
Mind Map