![]() |
||||||||||
|
|
||||||||||
Dont
Let Hackers Gather Your Information Introduction: Research is the starting point for almost every new project. By doing research you will gain valuable information about the subject in question. The same holds true in the world of hacking. A hacker will first attempt to gain information about a system before trying to break in. There are several avenues to take when it comes to gathering information. Social engineering:
Dumpster diving:
Network tools:
This paper will focus on using network tools as a way of collecting information. It will also discuss basic ways in which to prevent this information from being obtained. Port Scanning: There are many applications that use the TCP/IP protocol. Most computers will use more than one of the applications in daily use. For example, a machine that is used for network management (SNMP) would more than likely be listening for SNMP traps, using Telnet and possibly even have a TFTP server running. There had to be a way for each datagram to get to the correct application. This is where the idea for ports comes into play. According to the Internet Assigned Numbers Authority (IANA), the ports are divided into three categories (http://www.isi.edu/in-notes/iana/assignments/port-numbers): a) The Well-Known Ports are those from 0 through 1023. b) The Registered Ports are those from 1024 through 49151 c) The Dynamic and/or Private Ports are those from 49152 through 65535 Well-Known ports are assigned for specific use (such as FTP, Telnet, SMTP, etc.) and can not be used for other purposes. Registered and Dynamic ports can be used for any purpose (although Registered ports that are in use are assigned for one purpose). Its in this region that trojan horses such as Back Orifice and SubSeven live. If one device wanted to talk to another using SNMP, the SNMP port has to be in an active or open state so that it can receive the datagram. Since this is the case, it is possible for other machines on a network to determine which ports are in an open state for a particular system. Port scanners are used for just this purpose. Because of the information that can be obtained from a simple port scan, it will probably be the first thing that a hacker will use on system. The following is an NMAP session that was run on a test system. NMAP is a very popular port scanner with many features. It is currently a free tool available at www.insecure.org. Please note that the scans have been truncated to keep the list of open ports short.
Some of the interesting ports that are listed in the scan are SMTP(25), TFTP(69), and SNMP(161). It is possible to gain further information about a system or a network from just these ports. There are certainly other ports that can be used. However, these will be left for the reader to research on their own. The following are some simple steps that can help reduce the amount of information that can be gathered by a port scan.
SMTP TCP Port 25: It is possible to telnet to other ports. When you telnet to other ports there is the chance that you can get information about the application using it. The following example is a telnet session to port 25 (Simple Mail Transfer Protocol) of the same system that NMAP was run against. The first thing that you see when you telnet into the system is the actual mail software in use:
Here it is seen that the software is Sendmail and that version 8.11.0 is being used. This information can be used to find security holes within the software. Typing help at this point will provide the following list of commands:
Using "HELP <topic>" on every command shows that two of them can be used to see if there is a user(s) configured for this system.
Running the VRFY command on the test system produced the following results:
Verifying user names can be relatively easy. By doing a little research on a company you should be able to collect names of people that work there. More than likely a potential hacker will already have names from the companys press releases and web site. Once they have this information they can start to guess the user names. Theres a pretty good chance that the user names will be in the form of first name, last initial or some variation of this scheme. It is easy to stop these commands from confirming that a user exists. This version of Sendmail uses the sendmail.cf file for configuration. In this file you will need to look for the section titled privacy flags. You will then need to add novrfy and noexpn to the PrivacyOptions line.
Once this is done, you will get the following output when trying to use VRFY and EXPN:
Section 2.11 of RFC 2505, Anti-Spam Recommendations for SMTP MTAs, also suggests that these two commands be disabled to prevent spammers from verifying addresses. (http://www.ietf.org/rfc/rfc2505.txt?number=2505). TFTP UDP Port 69 Trivial File Transfer Protocol (TFTP) can be thought of as the little brother of FTP. Both are used to transfer files from one system to another. TFTP is used mostly to boot diskless workstations or to send new software images to network devices (such as routers). Some other differences are that TFTP uses less commands and has no user authentication. Since there is no user name or password required for TFTP, it may be possible to get any file off a system (as long as you have read permissions on that file). On the test station, that was incorrectly configured, it was possible to TFTP the /etc/passwd file to another station. This is the file that contains user names and passwords. Once this file is obtained, it is an easy task to crack the passwords with program likes Crack and John the Ripper (the only factor is time). As a side note, it took about 18 seconds on a 450Mhz PentiumII to crack the weak password startrek. It took over 20 minutes to crack a stronger password of b08j8y5r (the process was actually stopped before the password was cracked). When creating passwords, you should use a mix of alphanumeric characters along with special characters. As one can imagine, TFTP can be a big security hole for a system. Luckily there are a few things that can be done to help reduce the risk.
#tftp dgram udp6 wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot The # sign is a comment (which is a good thing since by default TFTP is disabled). If you are going to enable TFTP make sure that the s option is on the line. This specifies that the /tftpboot directory, in this case, is the home directory for TFTP access. SNMP UDP port 161 Simple Network Management Protocol (SNMP) was designed to monitor and manage networks. A network administrator can use a network management application to get or set the information for a managed device through its SNMP agent. These bits of information are called Object Identifiers (OID) and are stored in a management information base (MIB). The OIDs can be used to enable/disable ports, gather user information such as IP and MAC addresses, gather historical information from RMON and much more. The OIDs that were queried below are common on most, if not all devices with an SNMP agent. With these four OIDs it is possible to determine the software version, possible contact names, what type of interface is used and if those interfaces are up/down. Note that ifAdminStatus not only lets you know if an interface is up or down, but you can also set this OID (ie. You can disable the interface). Agent Name: test IP Address: 172.26.1.1
Object Instance Type Value
--------------------------------------------------------------------------
sysDescr 0 OCTET STRING Hardware: x86 Family 6 Model 5
Stepping 2 AT/AT COMPATIBLE -
Software: Windows NT Version 4.0
(BuildNumber 1381 Uniprocessor Free)
sysContact 0 OCTET STRING John Smith
ifDescr 1 OCTET STRING MS TCP Loopback interface
ifDescr 2 OCTET STRING 3Com 3C90x Ethernet Adapter
ifAdminStatus 1 INTEGER up ( 1 )
ifAdminStatus 2 INTEGER up ( 1 )
SNMPv1 does have a simple authentication mechanism. The security comes in the form of community names. Community names act as form of passwords when contacting an SNMP agent. There is usually a read-only and a read-write community name. Read-only community names will only allow the network management application to retrieve data. Most vendors will use public as the read-only community name. Read-write allows for both retrieval and setting. The default community name that is setup for read-write by most vendors is private. The major problem is that these community names are transmitted over the network in clear text. This can easily be seen in a capture of a SNMPv1 packet:
As one can see, the community name is public. The networking community came to realize this was a security risk. Work was begun on SNMPv2 (there were actually three versions of SNMPv2) to address the security issues and provide other enhancements. The current version is SNMPv3. It expanded upon the best aspects of the three versions of SNMPv2. The following suggestions may help reduce the risk of SNMP being used against you.
This should help limit the amount of SNMP traffic on the network and provide less chances for a community name to be obtained. If you have to use SNMP, use the read-only community name. will support SNMPv3. Update if possible. As a note, SNMPV2 is not used by many vendors. Most vendor are skipping directly to version 3. Conclusion: This paper only touches the tip of the iceberg when it comes to information gathering. It should show anyone how easy it is for a hacker to use a few simple tools to gain the data that is needed to potentially break into a system. We have to limit the amount of information that a hacker will obtain. Use the same tools that a hacker would. If you see the same holes in your system you can work to patch them. Upgrade to the latest version of software that is used for a device. Dont give them the chance to break in by using well documented problems in old software. If you need assistance, by all means, hire a professional. In the long run it will probably save you money. References: Naugle, Matthew. "Network Protocols Signature Edition." Printed in USA: McGraw-Hill Companies, The, April 1998: 522-562 -- ISBN 0-07-046603-3. Chappell, Laura. "Youre Being Watched Cyber-crime Scans." Novell Connection, March 2001 (2001): 20-31. Shipley, Greg. "Tools From the Underground."
Network Computing. 29 May 2000. Harari, Eddie. "Post-Installation Security
Procedures." Linux Journal issue #68. December 1999. Lindberg, G., "Anti-Spam Recommendations for SMTP
MTAs." Network Working Group Request for Comments: 2505. February 1999. Perkins, David T. "SNMP Versions." The Simple
Times -- The Quarterly Newsletter of SNMP Technology, Comment, and Events. Volume 5,
Number 1, December 1997. Gibson, Steve. "Internet Connection Security for
Windows Users." 2001 |
||||||||||
|
to top of page | to Threats & Vulnerabilities | to Reading Room Home
|
||||||||||
![]() |
||||||||||