02.03.2018 Views

Sybex CEH Certified Ethical Hacker Version 8 Study Guide

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

134 Chapter 6 ■ Enumeration of Services<br />

One step in gaining a foothold in a Windows system is exploiting the NetBIOS API.<br />

This service was originally intended to assist in the access to resources on a local area<br />

network (LAN) only. The service was designed to use 16 character names, with the first<br />

15 characters identifying the machine and the last character representing a service or item<br />

on the machine itself. NetBIOS has proven to be a blessing to some and a curse to others.<br />

Let’s look at why.<br />

NetBIOS was originally developed by Syntek and IBM many years ago for<br />

the LANs that were available at the time. Due to the design of the protocol<br />

and the evolution of networks, the service is no longer preferred.<br />

An attacker who is using certain tools and techniques (more on this in a moment) can<br />

extract quite a bit of information from NetBIOS. Using scanning techniques, an attacker<br />

can sweep a system, find port 139 open, and know that this port is commonly associated<br />

with NetBIOS. Once the port has been identified, they can attempt to view or access information<br />

such as file shares, printer sharing, usernames, group information, or other goodies<br />

that may prove helpful.<br />

One of the many tools that can be used to work with NetBIOS is a command-line utility<br />

nbtstat. This utility can display information, including name tables and protocol statistics,<br />

for local or remote systems. Included with every version of the Windows operating system,<br />

nbtstat can assist in network troubleshooting and maintenance. It is specifically designed to<br />

troubleshoot name resolution issues that are a result of the NetBIOS service. During normal<br />

operation, a service in Windows known as NetBIOS over TCP/IP will resolve NetBIOS<br />

names to IP addresses. nbtstat is designed to locate problems with this service.<br />

In addition, the utility has the ability to return names (if any) registered with the Windows<br />

Internet Naming Service (WINS).<br />

Tasks You Can Do with nbtstat<br />

Run the nbtstat command as follows to return the name table on a remote system:<br />

nbtstat.exe –a < "netbios name of remote system"<br />

The -a switch can be used to return a list of addresses and NetBIOS names the system<br />

has resolved. The command line that uses this option would look like the following if the<br />

targeted system had an IP address of 192.168.1.10:<br />

nbtstat -A 192.168.1.10<br />

The nbtstat command can do much more than these two functions. The following is a<br />

partial listing of the options available with the nbtstat command:<br />

■ -a Returns the NetBIOS name table and mandatory access control (MAC) address of<br />

the address card for the computer name specified<br />

■ -A Lists the same information as -a when given the target’s IP address<br />

■ -c Lists the contents of the NetBIOS name cache

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!