Title: COUNTER HACK
1COUNTER HACK
Information Networking Security and Assurance LAB
Department of Communication Engineering
National Chung Cheng University Chia-Yi, Taiwan
, ROC
Mike
2Network Mapping
- Focus on IP-based computer systems.
- Map out your network infrastructure.
- Mapping and scanning your Internet gateway,
including DMZ systems, such as Web, mail, FTP,
and DNS sever. - Mapping and scanning your internal network.
Server
Server
Server
INTERNET
INTERNALNETWORK?
BORDERROUTER?
Firewall?
Firewall?
BORDERROUTER?
Server
3Network Mapping Techniques
- Finding live hosts
- Tracing your network topology
4Finding Live Hosts
- ICMP ping
- Ping all possible addresses to determine which
ones have active hosts - Ping, using an ICMP Echo Request packet
ICMP packet
ICMP Echo Request packet
Attacker
Victim
5Traceroute
- Tracerouting relies on the Time-To-Live(TTL)
- If the TTL is zero,the router sends back an ICMP
Time Exceeded message to the originator.
6Traceroute
7Cheops
- Developing a network inventory and topology using
ping and traceroute - Runs on Linux
8Defenses against Network Mapping
- Filter
- Firewalls and packet-filtering capabilities of
your routers - Stop ICMP Time Exceeded messages leaving your
network
9Using port scanners
- Analyzing which ports are open
- To know the addresses of live system
- Have the basic understanding of your network
- TCP/IP stack has 65,535 TCP/UDP ports
- RFC 1700, Assigned Numbers
10Using port scanners
- Ports like doors on each of machines
- Port scan knock on each door to see if anyone is
listening behind it - Someone behind the door, get a response
- No one behind the door, no answer back
11Free port-scanning tools
- Nmap ( www.insecure.org/Nmap)
- Strobe (packetstorm.securify.com/UNIX/scanners/)
- Ultrascan, a Windows NT port scanner,
(packetstorm.securify.com/UNIX/scanners)
12Nmap
- What type of packets does the scanning system
send - TCP Connect, TCP SYN, TCP FIN,
- Some types could cause the target system to
become flooded or even crash
13Types of Nmap Scans
- Legitimate TCP connections established using a
three-way handshake
SYN with ISNA
ACK ISNA and SYN with ISNB
ACK ISNB
Connection
Attacker
Victim
14TCP ACK Scans
15TCP ACK Scans
PacketFilterDevice
ACK dest port 1024
ACK dest port 1025
ACK dest port 1026
RESET
Aha! I know port 1026 isopen through the firewall
INTERNALNETWORK
EXTERNALNETWORK
16FTP Bounce Scans
FTP Serversupporting FTPforwarding
FTP Control Connection
open data connectionto send file to victimon
port 1.port 2etc.,etc.
Victimto be scanned
17How to avoid FTP Bounce Scans
- Make sure that your FTP sever does not support
this bounce capability - Checking your FTP sever (www.cert.org/advisories/C
A-1997-27.html)
18Standard FTP Control and Data Connections
Internal FTP Client
External FTP Server
Standard FTP Control and Data Connections
19FTP Bounce Scans
- Makes standard FTP harder for router and
firewalls to handle.
Duh Ill let in thatincoming FTP
dataconnection.
FIREWALL
Src port 20Dst port 1024
Src port 20Dst port 1025
Src port 20Dst port 1026
Client
Server
Data Connections
20Defenses against Port Scanning
- Harden your system
- Close all unused ports.
- Minimizes all services and tools installed.
- Find the openings before the attackers do
- Stateful inspection
- Remembers all outgoing SYNs in a connection table
- Check incoming packets against ACK scans.
21How Firewalk Works
Firewalk discovery phase counts the number of
hops to the firewall
22Determining Firewall Filter Rules with Firewalk
External IP 10.1.1.1
PacketFilterFirewall
ROUTER
ATTACKER
ROUTER
TCP port 1, TTL 4
TCP port 2, TTL 4
TCP port 3, TTL 4
Aha! TCP port 3 is unfiltered!
Time exceeded
Firewalk scanning phase determines open ports
through the firewall
23Firewalk Defenses
- Configured with a minimum set of ports allowed
through it.
24Firewalk Defenses
- To replace packet-filtering devices with
proxy-based firewalls(proxies do not transmit TTL
information) - Drawback Lower performance
- By filtering out ICMP Time Exceed message leaving
your network - Drawback normal user and network administrators
will not be able to traceroute
25Vulnerability Scanning
- Whats vulnerability scanner
- Types of vulnerabilities
- Common configuration errors.
- Default configuration weaknesses.
- Well-known system vulnerabilities.
26Vulnerability Scanner
A generic vulnerability scanner
27The Nessus Architecture
- Client-server architecture
- Client user configuration tool and a results
repository/report generation tool. - Server vulnerabilities database, a knowledge
base of the current active scan, and a scanning
engine.
28The Nessus Architecture
- Supports strong authentication, based on public
key encryption. - Supports strong encryption based on the twofish
and ripemd algorithms. - The most common use running on a single machine.
29Vulnerability Scanning Defense
- Close unused ports
- Keep systems patched
- Run the tools against your networks
- Be careful with DoS(Denial-to-Server) and
Password Guessing tests! - Be aware of limitations of vulnerability scanning
tools.
30Intrusion Detection System(IDS)
- All the scanning tools are noisy
- Tools can be detected by a network-based
intrusion detection system (IDS) - IDS listen for attacks and warn administrators of
the attackers activities
31How Intrusion Detection Systems Work
- Captures all data on the LAN.
- Sortthrough this data to determine if an actual
attack is underway. - Have a database of attack signatures.
- Match attack signatures in their database.
- When attacks discovered, the IDS will warn the
administrator.
32A Network-Based Intrusion Detection System
33IDS Evasion at the Network Level
- Fragment packets
- IDS must reassemble packets. However, different
target systems have various inconsistencies in
the way they handle fragments - Just use fragments
- Send a flood of fragments
- Fragment the packets in unexpected ways
34The tiny fragment attack
Looks goodto me
NETWORKIDSPROBE
Fragment 1Part of TCP Header
NETWORK
Fragment 2Rest of TCP Headerwith port number
ATTACKER
PROTECTEDSERVER
35A fragment overlap attack
Looks goodto me
NETWORKIDSPROBE
Fragment 1Part of TCP packetfor port 80
NETWORK
Fragment 2My offset is xyz. Datacontains part
of TCPHeader with port 23
ATTACKER
PROTECTEDSERVER
36Using FragRouter to evade IDS detection
Looks goodto me
NETWORKIDSPROBE
Attackpackets
Attackfragments
ATTACKSYSTEM
VICTIM
FRAGROUTER
37Some of the Many Fragmentation Options Offered by
FragRouter
Name Flag How the packets are mangled
frag-1 -F1 Send data in ordered 8-byte IP fragments
frag-2 -F2 Send data in ordered 24-byte IP fragments
frag-3 -F3 Send data in ordered 8-byte IP fragments, with one fragment sent out of order
tcp-1 -T1 Complete TCP handshake, send fake FIN and RST (with bad checksums) before sending data in ordered 1-byte segments
tcp-5 -T5 Complete TCP handshake, send data in ordered 2-byte segments, preceding each segment with a 1-byte null data segment that overlaps the latter half of it. This amounts to the forward-overlapping 2-byte segment rewriting the null data back to the real attack.
tcp-7 -T7 Complete TCP handshake, send data in ordered 1-byte segments interleaved with 1-byte null segments for the same connection but with drastically different sequence numbers.
38IDS Evasion Defenses
- Keep the IDS system up to Date
- Utilize Both Host-Based and Network-Based IDS
39Referense
- Firewalkhttp//www.packetfactory.net/Firewalk/fir
ewalk-final.html - Nessuswww.nessus.org
40Vulnerability Assessment tool
41Description
- Nessus is a free, open source vulnerability
scanner that provide a view of your networks as
seen by outsiders.
42Description
- Nessus also provide many kinds of detailed report
that identifies the vulnerabilities and the
critical issues that need to be corrected. - Nessus Features
- Plugin-based
- Exportable report
43Structure
44Step (I) install nessus
- Some way to install
- lynx -source http//install.nessus.org sh
- dangerous
- sh nessus-installer.sh
- Easy and less dangerous
45Step (II) create nessusd account
add the client users account
The authentication method by password check
Edit users right
46Step (III) create nessusd account
The authentication method by key change
The key information of user
47Step (V) Nessus client configuration
The nessusd servers address
The open port number of nessusd
Login user name
User password
Click on Log in
48The scan range
Avoid the detection by IDS
Choice the scan tools
49Input the targets address
50Nessus information
Start the scan
51the scan process
Scanning
52The export of the data(I)
The targets open port
The resource of this security include know-how
and the solution
53The export of the data(II)
Report in html with graphs
Warning information
54Summary
- Nessus is a powerful vulnerability assessment and
port scanner
55Reference
- Nessus
- http//www.nessus.org