Hacking Methodology Lab 1
Hacking Methodology Lab 1
[email protected]
h4X0R
Know Your Enemy
The briefing is
UNCLASSIFIED
in its entirety.
Briefing Goals
The goal of this briefing is five-fold:
b. introduce the some of the methods and tools used during the network
reconnaissance process;
d. demonstrate the benefits of a personal lab and the methods used in lab
construction; and
Scanning
• Reconnaissance and Target Acquisition
Footprinting
Enumeration
Scanning
Gaining Access Enumeration
Privilege
Escalation
• Assault
Gaining access
Pilfering
Privilege escalation
Covering Tracks
Pilfering
Back Door Covering tracks
Creation
Back door creation
Denial of
Service Denial of Service (DoS)
Footprinting
• Domain name
• Network blocks
• Specific IP addresses
Types of Footprinting:
• Active – The target may be alerted to the activity
(traceroutes, social engineering, zone transfers).
• Passive - The target is unaware of the reconnaissance
activity (Whois searches, other open source information).
Footprinting Techniques & Tools
Techniques –
• DNS zone transfer/interrogation
• Online Tools
• Open source search
• Route tracing
• Social Engineering
• Whois lookup
Tools –
• nslookup
• p0f
• “Sam Spade”
• Search engines
• traceroute
• Usenet
• whois (Internic, ARIN, etc.)
• WinNSlookup
DNS Interrogation
DNS Interrogation
DNS Interrogation
DNS Resource Record Type Codes
Most DNS RR types are defined in RFCs 1034, 1183, 1876, and 2782.
C:\WINDOWS\Desktop>tracert 1.2.61.100
Tracing route to host bb2-web1.xxx.net [1.2.61.100]
1 3 ms 9 ms 9 ms Ubergeek [xxx.xxx.xxx.xxx]
2 70 ms 49 ms 69 ms gw01.phub.cable.rogers.com [xxx.xxx.82.138]
3 116 ms 99 ms 99 ms bb2.gw4.xxx.xxx.net [1.2.60.1]
4 117 ms 100 ms 100 ms bb2-gw2-60-22.xxx.net [1.2.60.2]
6 198 ms 109 ms 110 ms bb2-fw-2-dmz.xxx.net [1.2.61.1]
7 237 ms 179 ms 220 ms bb2-web1.xxx.net [1.2.61.100]
Trace complete.
C:\WINDOWS\Desktop>
XXX.net Network Topology
C:\WINDOWS\Desktop>tracert
Tracing route to host bb2.fw1.xxx.xxx.net [1.2.60.3]
• We now have an initial
1 2ms 6 ms 8 ms Ubergeek [xxx.xxx.xxx.xxx]
map of the network
2 68 ms 47ms 69 ms gw01.phub.cable.rogers.com [xxx.xxx.82.138] and an insight into the
3 111 ms 92 ms 100 ms bb2.gw4.xxx.xxx.net [1.2.60.1] its naming conventions.
4 123ms 101 ms 103 ms bb2.gw2.xxx.xxx.net [1.2.60.2]
• An educated guess and
5 138 ms 107 ms 109 ms bb2.fw1.xxx.xxx.net [1.2.60.3]
another traceroute
Trace complete.
yields another firewall.
C:\WINDOWS\Desktop>
Firewalking
Scanning
• Reconnaissance and Target Acquisition
Footprinting
Enumeration
Scanning
Gaining Access Enumeration
Privilege
Escalation
• Assault
Gaining access
Pilfering
Privilege escalation
Covering Tracks
Pilfering
Back Door Covering tracks
Creation
Back door creation
Denial of
Service Denial of Service (DoS)
Scanning Techniques & Tools
Techniques –
• Ping sweep
• TCP/UDP port scan
• Stealth scans
Tools –
• Nmap
• SuperScan
• Internet Toolkit
• Hping
• Grim’s Ping
Scanning
Scanning is the process by which the attacker performs bulk target assessment,
identifies listening services and locates possible points of ingress.
Types of scans include the following:
• Ping Sweep – Attempts to determine which hosts on a network are reachable.
• SuperScan is a scanning
tool available free from
Foundstone.
• In addition to its scanning
ability, SuperScan
incorporates an automated
banner grabbing facility
(banner grabbing will
be discussed later).
HPing
• Firewall testing
• Remote OS fingerprinting
Scanning
• Reconnaissance and Target Acquisition
Footprinting
Enumeration
Scanning
Gaining Access Enumeration
Privilege
Escalation
• Assault
Gaining access
Pilfering
Privilege escalation
Covering Tracks
Pilfering
Back Door Covering tracks
Creation
Back door creation
Denial of
Service Denial of Service (DoS)
Enumeration
Definition of Enumeration:
A mathematical set with a total ordering and no infinite descending chains.
A total ordering "<=" satisfies x <= x; x <= y <= z => x <= z; x <= y <= x
=> x=y; and for all x, y, x <= y or y <= x. In addition, if a set W is well-
ordered then all non-empty subsets A of W have a least element, i.e. there
exists x in A such that for all y in A, x <= y.
Definition of Enumeration
Enumeration refers to the process by which the attacker makes use of
more intrusive probing in order to identify resource shares, user accounts,
operating systems and applications associated with the targeted network.
Enumeration Techniques & Tools
Techniques –
• List user accounts
• List file shares
• Application/OS identification
Tools –
• Telnet
• Netcat
• SuperScan
• NAT
• NMap
• p0f
• VisualRoute
Banner Grabbing
Banner Grabbing – Telnet
• Telnet may be utilized as a rudimentary tool to grab server banners.
• This is accomplished by opening a telnet session to the service you wish to enumerate.
• VisualRoute is capable of
performing banner grab
enumeration of targeted
hosts.
• By directing traces at a
specific port useful
information may be obtained
about the target.
• P0f is a passive OS
fingerprinting tool.
• Runs in the background
and sniffs traffic on the
wire.
• The packet’s parameters
are compared against
fingerprint tables and
the program makes a
“best guess” regarding
the OS type in real time.
OS Fingerprinting
P S K
Building Your Lab
Linux LiveCD Distros
General Toolkits:
Knoppix STD (Security Tools Distribution)
http://www.knoppix-std.org/
Forensic Toolkits:
Helix
http://www.e-fense.com/helix/
Pen-Testing Toolkits:
KCPentrix
http://kcpentrix.net/
WHAX
ftp://ftp.belnet.be/packages/whoppix/whax-3.0-200705.iso
Building Your Lab
Malware Analysis Tools
• All malware analysis should take place on a standalone
host, preferably one running a virtual machine.
• Once analysis is complete, the VM image can simply be
reloaded.
• Several free analysis tools are available from various
sources on the internet.
Building Your Lab
Malware Analysis Tools
Autoruns – Displays programs configured to run during system bootup or login.
http://www.sysinternals.com/Utilities/Autoruns.html
VICE -
WinDump/TCPDump – Pcap (sniffer) tools.
http://www.winpcap.org/windump
http://www.tcpdump.org/
Building Your Lab
Compilers, Debuggers & Decompilers
Most exploits are made available as source code will have to be compiled in
order to be made executable; executable exploits can be decompiled and the
recovered code analyzed.
#include <stdio.h>
#include <winsock2.h>
Decompilers
REC Multi format binary decompiler
http://www.backerstreet.com/rec/rec.htm
http://www.metasploit.com
Building Your Lab
Metasploit Framework
• Many InfoSec related titles are available from both the public and
CIRT libraries.
• Deeply discounted computer books can be purchased at any
“Computer Books for Less” outlet in the Ottawa area.
Words of Wisdom
“Know the enemy and know yourself and you need not fear the result of a hundred battles…
Sun Tzu, Chinese General,
“The Art of War”, c. 500 B.C.E.
Questions?
Acknowledgments
My Friends
For continuing to support my delusions of grandeur – as long as the cheques continue to clear.