Firewall Basics-Ron
Firewall Basics-Ron
Disclaimer:
The following presentation represents a compilation
of obscure bits of information known by the author
(me). No representation of accuracy, applicability,
usefulness or anything else you can think of is
implied.
Batteries not included, some assembly required, dont operate heavy equipment while reading this, not
all buyers will qualify, must take delivery before 1/1/1980, your mileage may vary, no user serviceable
parts inside, big brother may be watching.
Goals
(Besides killing an hour and a half)
Gain
What is a firewall?
A firewall is a device (or software feature) designed to
control the flow of traffic into and out-of a network.
In general, firewalls are installed to prevent attacks.
What is an attack?
1.
2.
3.
4.
Edge Firewall
An edge firewall is usually software running on a
server or workstation. An edge firewall protects a
single computer from attacks directed against it.
Examples of these firewalls are:
ZoneAlarm
BlackIce
IPFW on OSX
6
Firewall Appliance
An appliance firewall is a device whose sole
function is to act as a firewall. Examples of these
firewalls are:
Cisco PIX.
Netscreen series.
Network Firewall
10
Common ports
80
443
20 & 21
23
22
25
11
HTTP
HTTPS
FTP (didnt know 20 was for FTP, did you?)
Telnet
SSH
SMTP
12
Sample rules:
Can you find the problem?
(For this example, when a packet matches a rule, rule processing stops.)
13
Sample rules:
Can you find the problem?
(For this example, when a rules matches a packet, rule processing stops.)
14
If you set your rules to log too much, your logs will
not be examined. If you log too little, you wont see
things you need. If you dont log, you have no
information on how your firewall is operating.
15
16
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
11:00:06
11:00:07
11:00:08
11:00:10
11:00:15
11:50:02
11:50:02
11:50:02
11:50:05
11:50:17
11:50:20
11:50:20
11:50:24
11:50:24
11:50:27
11:50:27
11:50:30
11:50:30
11:52:48
11:52:51
11:52:54
11:52:56
11:52:57
11:53:00
12:00:24
12:00:26
12:00:28
12:00:34
12:00:46
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
11:00:06.786765
11:00:07.366515
11:00:08.526751
11:00:10.856705
11:00:15.515785
11:50:02.619311
11:50:02.629271
11:50:02.642610
11:50:05.633338
11:50:16.882433
11:50:20.401561
11:50:20.414682
11:50:24.127364
11:50:24.144581
11:50:27.761458
11:50:27.778617
11:50:30.771581
11:50:30.772833
11:52:47.511993
11:52:50.501969
11:52:53.501498
11:52:55.703527
11:52:56.500682
11:52:59.500694
12:00:24.220209
12:00:26.040009
12:00:28.794944
12:00:34.302899
12:00:45.284181
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
xl0
17
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
31
12:00:58
12:01:01
12:01:01
12:01:03
12:01:03
12:01:05
12:01:05
12:01:06
12:01:07
12:01:07
12:01:08
12:01:08
12:01:09
12:01:09
12:01:12
12:01:14
12:01:14
12:01:28
12:01:29
12:01:36
12:01:39
12:02:02
12:02:05
12:02:10
12:02:11
12:02:13
12:02:14
12:02:20
12:07:59
12:33:33
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
kd2
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
ipmon[14110]:
12:00:58.200613
12:01:00.236672
12:01:01.192960
12:01:02.868846
12:01:03.161480
12:01:05.010881
12:01:05.282234
12:01:05.796431
12:01:07.240923
12:01:07.251735
12:01:07.963357
12:01:08.229151
12:01:09.209297
12:01:09.212097
12:01:11.704343
12:01:13.969454
12:01:14.230632
12:01:28.256761
12:01:29.105610
12:01:36.257674
12:01:39.338642
12:02:02.588716
12:02:05.555511
12:02:10.610751
12:02:11.565107
12:02:13.530261
12:02:14.729242
12:02:19.529568
12:07:58.606378
12:33:32.920644
What is a state?
When your computer makes a connection with another
computer on the network, several things are exchanged
including the source and destination ports. In a standard
firewall configuration, most inbound ports are blocked. This
would normally cause a problem with return traffic since the
source port is randomly assigned (different from the
destination port).
A state is a dynamic rule created by the firewall containing
the source-destination port combination, allowing the desired
return traffic to pass the firewall.
18
19
20
21
state top
Sorted by = # bytes
ST
PR
#pkts
#bytes
ttl
4/4 tcp
551
368024 119:59:56
4/4 tcp
399
258160 119:59:59
4/4 tcp
33
6872 119:59:16
0/0 udp
2
458
0:06
0/6 tcp
5
200
1:58:03
0/0 udp
2
156
0:13
0/0 igmp
1
32
1:20
0/0 udp
62
5844
1:51
0/0 udp
35
4910
0:11
4/4 tcp
35
4208 119:59:59
0/0 udp
16
3520
1:49
0/0 udp
14
3026
2:00
0/0 udp
16
1536
1:59
0/0 udp
7
1127
1:58
0/0 igmp
10
320
1:54
0/6 tcp
5
200
1:53:26
2/0 tcp
3
128
0:47
2/0 tcp
3
128
0:48
07:50:50
22
Ruleset design
Two main approaches to designing a ruleset are:
1.
2.
23
What is IDS?
IDS is an Intrusion Detection System.
26
28
29
30
Poking holes
How to allow traffic and expose yourself.
31
Compromised Machines
Just a note about compromised machines:
When a machine is compromised, you have no
way to determine exactly what was hacked.
Cleaning what you think is the problem may not
rid yourself of everything. Most instances
require a reformat and reinstall of the operating
system for proper cleaning.
32