Hacking For System Administrators I: Markus A Campo
Hacking For System Administrators I: Markus A Campo
Markus a Campo
SySS GmbH
Preamble
2 / 89
3 / 89
3 / 89
Disclaimer
4 / 89
Disclaimer
4 / 89
Disclaimer
5 / 89
Worm authors
Sven Jaschan (Sasser Author)
The suspect confessed that the worms mydoom and bagle
motivated him to create an Antivirus - encouraged by talks
with his classmates he developed netsky further, to sasser
source:
http://www.heise.de/security/news/meldung/47212
6 / 89
Defacements
Definition
any kind of malicious modification of websites
archived at http://www.zone-h.org
target audience
Whom do the defacers want to reach anyway?
7 / 89
8 / 89
9 / 89
Results...
General problem:
My security depends on your security - Theo de Raadt
10 / 89
11 / 89
12 / 89
Definition
whois -T dn -h whois.denic.de 193.99.145.37
Exkursus:
ping or host can be used to find out the matching IP address for a
hostname
-T dn Type set to domain
13 / 89
AXFR & MX
14 / 89
15 / 89
Exercise:
Please find out the mail- and DNS-servers (and their version)
responsible for fsb.ru and the IP-ranges they are in Please try to do a
zone-transfer.
16 / 89
17 / 89
Netcraft
Exercise:
Check http://www.geneva.ch
Has the webserver been changed? If yes, when?
... how often did the provider change?
... is the version of the webserver up-to-date?
18 / 89
Informations:
Mail/Newsclient used
Headers allowing to trace back the path of an email (e.g.
the received-stamps in the SMTP-Header)
Information in signatures
http://groups.google.com
19 / 89
Google-Hacking
(Source: http://www.heise.de/newsticker/meldung/58087)
Now we know those systems are vulnerable. But how do we find
them?
20 / 89
Google-Hacking
21 / 89
Legal considerations
Please use google to find the default password of those VPN systems.
22 / 89
Google-Hacking
23 / 89
24 / 89
Google-Hacking
25 / 89
Google-Hacking
26 / 89
Google-Hacking
27 / 89
What we did:
Neither did we circumvent a protection mechanism, nor did we change
anything
28 / 89
Google-Hacking
29 / 89
Google-Hacking
30 / 89
Excursus: SMTP-Howto
Subject:Mail-Bouncing Test
31 / 89
Mail-Bouncing-Test
Our goal:
Send a mail to a address we know is not correct, in order to provoke a
response, which in turn well check for interesting information
Exercise
Please perform a mail-bounce against a domain of your choice!
32 / 89
Overview:
whois
dig, host
http://www.netcraft.com
http://www.google.com
Mail-Bouncing-Test
33 / 89
Sniffing
34 / 89
Why sniffing?
or
analysing network services (e.g. telnet)
spying
35 / 89
Why sniffing?
or
analysing network services (e.g. telnet)
spying
35 / 89
36 / 89
common sniffer
running on Windows and UNIX
http://www.wireshark.org
supports a lot of protocols
37 / 89
Filters in wireshark
Filters can be defined (Menu Capture - Start oder STRG+K)
before starting to capture
Important filters:
host
port
38 / 89
39 / 89
40 / 89
41 / 89
Example:
tcpdump dst host banking.postbank.de and dst port 443
42 / 89
Passwort-Sniffer
dsniff
Reads traffic and displays any transmitted password
Understands quite a few protocols (HTTP, SMTP, POP3 ...)
43 / 89
Protection
44 / 89
Wireshark exercise
45 / 89
46 / 89
Passive OS fingerprinting
Analysis of:
TTL - Time to live of pakets
Windows Size
DF - Dont fragment bit set?
etc.
Exercise
Please try to find out the operating system used by the webservers by
checking the TTL
47 / 89
Default TTL-values
OS
BSD-based UNIX(Linux, Free/Net/OpenBSD, Mac OS X)
AIX, IRIX
Windows-Family (since NT 4.0, 2000, XP)
Solaris, Cisco
48 / 89
Overview
Wireshark
dsniff/Cain
Only cryptography protects from sniffing
49 / 89
Basic portscanning
50 / 89
51 / 89
The 3-way-handshake
Client
Server
52 / 89
The 3-way-handshake
SYN
Client
Server
52 / 89
The 3-way-handshake
SYN
SYN/ACK
Client
Server
52 / 89
The 3-way-handshake
SYN
SYN/ACK
ACK
Client
Server
52 / 89
The 3-way-handshake
SYN
SYN/ACK
ACK
Client
Server
52 / 89
What is a portscan?
Protocol
HTTP
FTP
SMTP
POP3
Port
80
21
25
110
Definition
Open ports are always seen from the perspective of an IP address.
53 / 89
Exercise
54 / 89
Nmap
Powerful portscanner
available for windows and UNIX
http://www.insecure.org/nmap/
55 / 89
Nmap: Exercises
56 / 89
Sniffing: NMAP
57 / 89
Status
Open
Closed
Filtered
Filtered/ICMP
description
connection can be established (3-way-handshake)
connection attemp is denies with
RST/ACK-paket
No reaction to the SYN-paket within a certaintimeframce
No reaction by TCP, but
ICMP (destination unreachable)
58 / 89
UDP scanning
NMAP syntax
nmap -sU <target-IP>
Exercise:
Please scan a host in this network with an UDP-scan. Again use a
sniffer to check what the portscanner does.
59 / 89
UDP scanning
NMAP syntax
nmap -sU <target-IP>
Exercise:
Please scan a host in this network with an UDP-scan. Again use a
sniffer to check what the portscanner does.
59 / 89
Results of an UDP-Scans
Nmap uses
open|filtered
to describe one of several states
a) The port is open.
b) The request was lost or filtered away and never reached the target.
c) The response of the target was lost or filtered away.
d) ICMP Message Throtteling (RFC 1812) prevents an answer. The
number of ICMP-responses the systems sends is limited.
60 / 89
Overview
nmap
The state of an UDP-port cannot easily be established with a
portscanner
Scans of all ports might take a long time
61 / 89
, Mac OSX
, Windows(Cygwin)
62 / 89
63 / 89
Usage of hydra
64 / 89
65 / 89
Hashes
Common rule
Password (Brute-Forcing) guessing may be used against any
mechanism which relies on hashes, if those hashes are accessible by
third parties.
66 / 89
67 / 89
68 / 89
Intelligent bruteforcing:
69 / 89
Specialities:
Computing and pre-sorting tables will take a long time
Only bottlenecks are available memory and disk perfmance
70 / 89
Finished already?
Please use john -show to see your results again.
71 / 89
Linux: /etc/shadow
Windows: SAM-database
can be read locally with pwdump2, over the network with
pwdump3
72 / 89
73 / 89
Cain
74 / 89
Overview
75 / 89
Simple D.o.S-attacks
76 / 89
NDN-Attack
General problem:
Legal mail-bouncing can become an illegal D.o.S-Attack if were not
careful when choosing the address of the sender
77 / 89
NDN-Attack
General problem:
Legal mail-bouncing can become an illegal D.o.S-Attack if were not
careful when choosing the address of the sender
77 / 89
Exercise: SMBdie
78 / 89
A local buffer-overflow
79 / 89
RPC-DCOM-Exploit
Opening a shell
Use kaht.exe in order to access a remote windows-system.
80 / 89
Metasploit Framework
, Unix
, MacOS X
81 / 89
Metasploit Framework
Exercise
Please use the framework to gain shell access to a remote system.
Create a share on the target afterwards.
82 / 89
83 / 89
The Upload&Execute-payload
84 / 89
Trojan horses
85 / 89
86 / 89
Exercise
87 / 89
Solution
88 / 89
Please consider
89 / 89