CSE4482 07 ProtectionMechanisms ScanningAnalysisTools 2013 Posted
CSE4482 07 ProtectionMechanisms ScanningAnalysisTools 2013 Posted
Protection Mechanisms:
Scanning and
Analysis Tools
Recommended reading:
http://playfulcleverness.blogspot.ca/2013/04/google-fu.html
Public Reconnaissance Tools (cont.)
Example
Consider Company XYZ, with a
large datacenter in Atlanta.
The datacenter has been secured, www.XYZ.com
and it would be very hard for an
attacker to break into it via the
Internet.
However, the attacker has run a “link:www.XYZ.com” query
on Google and found a small Web server that links to XYZ’s
main Web server.
After further investigation, the attacker learns that the small
Web server was set up by an administrator at a remote facility.
The Web server has (via leased lines) an unrestricted internal
Access into Company ‘s corporate datacenter.
Public Reconnaissance Tools (cont.)
• Google – keywords that enable more accurate
Directives extraction of info from Google Index
formatting of Google directives:
examples of directives:
site:<domain-name> <term(s) to search>
intitle:<term(s) to search>
inurl:<term(s) to search>
filetype:<extension of the file type>
link:<URL that searched pages point to>
http://www.googleguide.com/advanced_operators_reference.html
Public Reconnaissance Tools (cont.)
Example
Assume Company XYZ’s main web
page is: www.XYZ.com.
www.XYZ.com
Which Google directive should have
the attacker used to narrow down
the search for remote web server
‘pointing’ to the main enterprise
web server.
link:www.XYZ.com –site:www.XYZ.com
Public Reconnaissance (cont.)
Example
What is the intention behind the following commands:
site:www.yorku.ca inurl:login.php
filetype:sql intext:password
http://www.cyberwarzone.com/cyberwarfare/massive-google-hacking-list-2012
• Categories of Hacking Tools
popular scanners:
Nmap (UNIX / Windows) – can rapidly sweep
large networks, can bypass firewalls, IDSs, …
SuperScan 4.0 (Windows) – GUI based
with additional tools in one interface, …
Advanced Port Scanner (Windows) – small,
fast, straightforward GUI, …
Port Scanners (cont.)
http://nmap.org/download.html
Port Scanners (cont.)
Example: Nmap/Zenmap Port Scanner
Port Scanners (cont.)
Example: Nmap/Zenmap Port Scanner (cont.)
Port Scanners (cont.)
Example: Nmap/Zenmap Port Scanner (cont.)
Port Scanners (cont.)
Example: Nmap/Zenmap Port Scanner (cont.)
Port Scanners (cont.)
Example: Nmap/Zenmap Port Scanner (cont.)
https://svn.nmap.org/nmap/zenmap/share/zenmap/config/scan_profile.usp
Port Scanners (cont.)
Example: Nmap/Zenmap Port Scanner (cont.)
Port Scanners (cont.)
Example: Nmap/Zenmap Port Scanner (cont.)
http://nmap.org/book/man-bypass-firewalls-ids.html
Port Scanners (cont.)
• Port Scanner 1) ICMP Ping Scan
Techniques not really port scanning, as ICMP is Layer 3
protocol, but useful for probing of all active
hosts in a network – host scanning
scanner sends a single ICMP request to a
destination; an ICMP response will arrive
back unless the destination is not available
or ICMP protocol is filtered
potentially faster than other footprinting
technique – only one sent packet per
machine
does not provide lots of information …
F F F
I I I
R R R
E E E
W W W
A A A
L L L
L L L
trusted host/IP
Source IP = Zombie IP
Destination Port = open
Zombie’s IP ID increased by 2!
Port Scanners (cont.)
F F F
I I I
R R R
E E E
W W W
A A A
L L L
L L L
Source IP = Zombie IP
Destination Port = closed
Zombie’s IP ID increased by 1!
Port Scanners (cont.)
• Ethic and Legality – fuzzy issue!
of Port Scanning scan itself is not an attack, but is
often prelude to an attack, like
ringing the doorbell to see if any-
body is home
line between scanning maliciously
and scanning for administrative
purposes is very vague
makes creating laws regarding
scanning difficult
http://finaldownload.com/graphicsfile/screenshotimages/lansurveyor-101102.jpg
Network Mappers (cont.)
Example: Network mapping using Nmap
Target: IP/24, Profile: Ping scan
• Categories of Hacking Tools
TCP RFC 793 requires that a system with an open port ignores
(not respond to) a FIN packet if received at the start of a connect.
Microsoft Windows (Windows 7, Windows 2000, Vista) disregard
this requirement and replies to the FIN packet with a RST packet
In Windows always response!
open port
closed port
http://www.tcpipguide.com/free/diagrams/tcp3waysynch.png
Operating System Detection Tools (cont.)
IP ID Sampling
Windows OS usually use a predictable IP ID sequence numbers,
such as increasing the number by 1 or 256 for each packet
other OS, e.g. Linux, randomize IP ID numbers
Operating System Detection Tools (cont.)
Time-to-Live (TTL): 51
TCP Window Size: 57344
Don’t Fragment Bit: 1
Type of Service (TOS): 0
Solution:
Use Traceroute to determine the actual number of hops
between itself and the host – say you have observed 13.
Hence, original TTL = 51 + 13 = 64.
Host’s OS: (likely) Linux
Operating System Detection Tools (cont.)
• OS Detection – to reduce chances of an OS being
Counter- ‘fingerprinted’, OS’s responses to
measures various network requests/packets
must be modified
IP Personality – a patch for Linux
kernel – allows changes to TCP/IP stack
IP ID field, TCP Initial Window, TCP initial
Sequence Number … values can be changed
http://ippersonality.sourceforge.net/
Possible outcomes:
a) Firewall blocks packets
intended for port P on H,
thus no response arrives
back.
b) Firewall lets packet(s),
in but the network-layer
module of H’s OS sends an
ICMP TTL Expired error TTL
message back. expired
firewall /
gateway router
one known host
on target network
• Categories of Hacking Tools
http://www.infosec.gov.hk/english/technical/files/vulnerability.pdf
Vulnerability Scanners (cont.)
Example:
Able to detect:
open ports / available services
misconfigurations (e.g. missing patches)
default passwords
presence of viruses and back-door programs, etc.
Vulnerability Scanners (cont.)
Example: Nessus (cont.)
Employs client-server architecture:
Nessus server includes a vulnerability database & a scanning engine.
Nessus client includes a user config. tool and a report-gener. tool.
Client & server can run on same or different machines (e.g. in case
of a slow link).
• Categories of Hacking Tools
Example: NetStumbler
• Categories of Hacking Tools
http://unixwiz.net/techtips/iguide-crypto-hashes.html
Password Crackers (cont.)
extremely noisy!
most systems block the victim account after several
failed login attempts
Password Crackers (cont.)
A=94
System one:
System two:
L1 L2 L3 : A (B-Z) (C-Z)
26 25 24
26*25*24 = 15,600
𝒏!
n choose k, order does not matter: 𝒏−𝒌 !
Password Crackers (cont.)
L1 L2 L3 L4 D1 D2 D4
any combination any combination
drawbacks: