Phase2: Scanning

2008 Oct 18


Network
Mapping
Port
Scanning
War Dialing
Attacks
War Dialing
Defense

Network Mapping

After reconnaissance an attacker wants to acquire an inventory of the systems on your network. This includes finding out the IP addresses and network topology, discovering, critical hosts, sevrers. routers, firewalls, etc. The attcaker will start with probing those systems which can be reached: internet gateway(s), DMZ systems, web servers, mail, FTP, and DNS servers. The next step is the internal network.

If the attacker (e.g. malicious employees or vendors) are already inside then the probing starts with the internal network. They will start scanning and mapping the internal network right away. An attacker may have inside network access via a modem discoverd through war-dailing.

Sweeping: Finding Live Hosts

A usual first step is to ping all possible addresses in the network to find active hosts. Ping uses the ICMP Echo Request packet which is sent to every possible address in the network as discovered during the reconnaissance phase. If a reply comes back, that address has an active machine. No response usually means nothing is there.

Many networks block incoming ICMP messages, so an attacker could also try to send a TCP or UDP packet to a common port such as TCP port 80, looking for Web servers.

Traceroute: What are the Hops?

To understand the topology the technique known as tracerouting is used to determine the various routers and gateways that comprise the network infrastructure. Tracerouting uses the Time-To-Live (TTL) field in the IP Header. When a router receives an IP packet it first decrements the TTL field. If it becomes zero, the router sends back an ICMP Time Exceeded message to the originator and drops the packet. This prevents packets from the circling the internet forever.

An attacker (as well as legitimate users) start with a series of packets with various TTL values, giving a trace of the routers. The packets with an initial TTL value of 1 drop the packet and respond with ICMP Time Exceeded allowing the sender to get the IP address of the router. This process is repeated with TTL's of 2, then 3 and so on. Most unix varieties of a program called traceroute and called tracert on Windows (but uses ICMP packets), which do this.

Cheops: A Network Mapper and General Purpose Manegemnt Tool

Cheops, available free, is one of the most capable and easiest to use network mapping tools. It is written by Mark Spencer, and runs on Linux. auutomating the process of developing a netwrok invinetory and topology. It draws a graphic image of the information from ping and tracerouting of a network.

Defenses Against Network Mapping

Filter out the underlying messages that the network mapping tools use via fiewalls and packet filtering in routers. At the gateway to the internet block incoming ICMP messages except those you wish the public (including attackers) to be able to use. Block the DMX database server. You may need to allow pings only from your ISP. Also filter ICMP Time Exceed messages from leaving your network. This will hamper internal administration to some extent.


Port Scanning

The next step of an attack, after determining what machines exist and their network topology, is to determine which ports are open on each system. These ports are related to active services running on a system. Free port scanning tools include:

Tool Author OS Download
Nmap Fyodor Unix www.insecure.org/Nmap
(gui) Win NT www.insecure.org/Nmap
(port) Win NT www.eeye.com/html/Databases/Software/Nmapnt.html
Strobe Julian Assange Unix packetstorm.securify.com/UNIX/scanners
Ultrascan
Win NT packetstorm.securify.com/UNIX/scanners

War Dialing Attacks

Two terms are used for scanning phone lines: war dialr and demon dialer. They refer to scanning a large pool of telephone numbes looking for modem access. Some people use the first terms for teh scanning and the second for attacking the modem lines found, starting with password guessing. Sofwtare for PC remote access can be large security holes (files, network shares, screen, etc.).

Example PC Remote products
Company Software Name
Symantec pcAnyWheretm
LapLink.com LapLink
Computer Associates ControlIT
By default these PC remote products do not include password authentication. All that has to be done is to recognize the connect string from the product and connect using the corresponding control client. The attacket now has complete control of the remote machine and usually internal network access. Sometimes clueless system admins leave such software with modems on servers and routers with either no password or a very easy to guess password. Typical passwords and userIDs:
  • blank
  • root
  • sync
  • bin
  • nobody
  • operator
  • manager
  • admin
  • administrator
  • system
  • days of the week
  • COMPANY_NAME
  • COMPANY_PRODUCT
War Dialing Software Name Date By System
Delux Fone-Code Hacker 1985 The Sorceress KHAIAH
Dialing Demon, ver 1.05 1988 Tracy McKibben
PBX Scanner, ver 5.0 1989 Great White
SuperDialer, ver 1.03 1990 Evan Anderson
Doo Tools, ver 1.10 1991 Phantom Photon
Z-Hacker, ver 3.21 1991 BlackBeard
Tone Loc, ver 1.10 (excellent) 1994 Minor Threat
& Mucho Maas
A-DIAL
(Auto Dial)
1995 VeXaTiOn
X-DialerR 1996 IciKI
THC-Scan,
Ver 2.0
1998 Van Hauser Win9X, NT, 2000
TBA 2000 LOphts
hacker group
Palm PDA
Programs    Modem Info

Phone numbers to call can be found in:

Free Phone Calls

Some PBX (Private Branch eXchange) systems have a special number to call which gives a second dial tone and allows calls to go out which are charged to the company. Some may require a password. This is rarer today.

Hayes Modem Lingo

This line of product created a kind of standard.


THC-Scan

THC-Scan, Ver 2.0 download
Feature Name How Used
Carrier Mode Used to search for modems
Tone Mode Looks for repeat dial tones
Dial Mode Sequential: may trigger detection capabilities of a PBX
the telephone carrier.
Random: scans randomly in a range to defat above.
List: uses list to direct dialer.
Scanning through a
modem out-dial
Uses a network-based modem pool (in beta test).
Spread work across
multiple machines or
multiple instances of
THC-scan on one system,
each with its own modem.
Can run as many copies of THC-scan on a computer
as there are modems and phone lines.
Nudging Sending a predefined string of characters to a discovered modem.
The war dialer "nudges" the target to get it to respond with possibly
useful information including warning banners, login prompts, etc.
Random waits
betwen calls
(to lower chance
of detection)
THC-scan can be configured to wait a
random amount of time between calls.
Rudimentary
jamming
protection
If the number of busy signals reaches a threshold,
the system stops the war-dialing attack. The authors
were worried about a telephone company detecting scans
and feeding back busy siganls to thwart the attack.
Key typed
by the
attacker
Item recorded in log for
that telephone number
b busy signal tone discoved
c modem carrier discoved
g girl's voice discoved
i interesting voice discoved
t repeat dial tone discoved

War Dialing Defense

Modem Policy

A document which states that modems are not allowed without written approval from a centrl security team. All dial-up remote access must use a centralized modem pool, which is subject to audit to ensure its security. Users must be trained in the modem policy and the use of controlled remote access services.

The policy must state that the possibility of a deviation when there is a justificable business need, signed by a person responsible for the modem and subject to approval by the security team. Difficult to guess passwords must be used or an authentication token.

Dial-Out Policy

A PBX can be configured so that particular lines only support outgoing calls. No incoming calls are allowed or possible.

Find Your Modems Before the Attackers Do

Conduct your own war-dialing exercise against your own telephone numbers looking for undocumented modems. Shut them down before it is too late. Do this every 3-6 months. Use the free war dialiers or commercial ones including: PhoneSweep from Sanstorm Enterprises and TeleSweep from SecureLogix.

Also considrr scanning digital PBC lines, because a D2A line converter is available from Radio Shack for under $100. Find out if there are special or direct lines which do not go through the PBX - see the company phone bills.

Finally, conduct desk-to-desk and room-to-room checks. Have dinner for the team and make the search. Use a buddy system to make sure that everything has been checked and documented.


2005-2008