Intrusion Detection Intrusion Detection October 23, 2020 - - PDF document

intrusion detection intrusion detection
SMART_READER_LITE
LIVE PREVIEW

Intrusion Detection Intrusion Detection October 23, 2020 - - PDF document

Intrusion Detection Intrusion Detection October 23, 2020 Administrative Administrative submittal instructions submittal instructions answer the lab assignments questions in written report form, as a text, pdf, or Word document


slide-1
SLIDE 1

1

Intrusion Detection Intrusion Detection

October 23, 2020

Administrative Administrative – – submittal instructions submittal instructions

answer the lab assignment’s questions in written report

form, as a text, pdf, or Word document file (no obscure formats please)

deadline is start of your lab session the following week reports not accepted (zero for lab) if late submit via D2L

slide-2
SLIDE 2

2

Administrative Administrative – – script files reminder script files reminder

re-download the script files' zip to obtain the new vmconfigure scripts for this "sniffing" exercise

VMs VMs this lab relies on this lab relies on

it clones two base VMs (in vmconfigure-populate script) you have both, previously downloaded

– Snort-on-Centos

(was used in application security lab's stack overflow exercise)

– f19-heartbleeder

(was used in application security lab's heartbleed vulnerability exercise)

make sure each has a "base" snapshot

slide-3
SLIDE 3

3

IDS IDS – – intrustion intrustion detection systems detection systems

monitor activities and circumstances respond/react when “wrong”

IDS IDS vs vs firewall firewall

firewall – fence/gate/door/lock

– does not react, static – preventative intent – you lock your door to prevent burglary, you find joe in the living room!!1 stealing2

i.d.s. – burglar alarm / motion detector

– reacts, dynamic – curative intent – you admit joe as a party guest, you find joe in the living room2 stealing!!1

1this is what’s wrong 2this is not what’s wrong

slide-4
SLIDE 4

4

What What’ ’s available to monitor? s available to monitor?

log files

– independently pre-existing – rich information source

system state & behavior pattern

– must observe & record to define norm first

network traffic

What are monitor products called? What are monitor products called?

log files – log monitors state/behavior pattern – integrity checkers network traffic – sniffers i.d.s. combines these functions

slide-5
SLIDE 5

5

IDS IDS – – example responses example responses

write message to a log destination alert system administrator add rule to fortify firewall disable user account

Running IDS Running IDS – – where and why where and why

“sensor” = “collector” Screened subnet architecture

slide-6
SLIDE 6

6

Locus of detection Locus of detection

distributed detection (at hosts)

– host analyzes local information

local logs/state/traffic

– host concludes there’s a problem – host tells global coordinator there’s a problem

centralized detection (at global coordinator)

– hosts send local information to global coordinator – global coordinator analyzes received information

received logs/state/traffic

– global coordinator concludes there’s a problem

Focus Focus-

  • of
  • f-
  • detection categorizations

detection categorizations

host-based i.d.s. deals with

– log files – system state and behavior pattern

network based i.d.s. deals with

– network traffic

slide-7
SLIDE 7

7

Network based ids Network based ids’ ’ scope scope

may be host aware only – about the host

– examines network traffic of the single host – like snort

may be network aware – about the net

– examines network traffic of multiple hosts

collected at a single host, or collected at multiple hosts and gathered

Detection technique categorizations Detection technique categorizations

rule based

– uses pre-set rules – uses pattern matching (packets against rules)

anomaly based

– uses pre-set historical state & behavior profiles – uses statistical analysis (current state & behavior against profiles)

slide-8
SLIDE 8

8

Pre Pre-

  • operational groundwork requirements
  • perational groundwork requirements

rule based

– identify behavior patterns of known attacks (attack signatures) – write and store rules expressing the patterns – yardsticks of the abnormal

behavior like the pattern is “wrong”

anomaly based

– identify state and behavior patterns of the system – write and store profiles expressing the patterns (a “baseline”) – yardsticks of the normal

behavior unlike the pattern is “wrong”

Rule Rule vs vs anomaly based detection anomaly based detection

good no role unknown/un- foreseen attacks limited good, precise known attacks anomaly-based rule-based

slide-9
SLIDE 9

9

State/behavior criteria examples State/behavior criteria examples

locations of user’s login times of user’s login size of command history file

Corresponding anomalies Corresponding anomalies

user logs in from unusual place user logs in at unusual time command history file truncated/shrunk (?falsified?!!)

slide-10
SLIDE 10

10

Detection technique quality factors Detection technique quality factors

detection rate false alarm rate detection latency

ids problems ids problems

difficult to tune for “enough but not too much” anomaly detectors may be trainable (by adversary)

– adversary over time stretches what’s “normal” – accustom detector to attack-like behavior

small doses gradually over time

– frog-boiling

alarm behavior can itself be disruptive/taxing

– may tend to deny service – attacker could

trigger some alarm use that propitious moment for his real attack

slide-11
SLIDE 11

11

Switch Switch vs vs hub hub – – usual caveat usual caveat

caveat, for network-wide scope of awareness network traffic to an individual host

– wholesale by hub, host gets all – selective by switch, host gets some

strategies

– put i.d.s. machine on a hub – put i.d.s. machine on switch’s spanning/management port – use global coordinator to gather from multiple hosts

Hub Hub – – B gets A B gets A-

  • to

to-

  • C traffic

C traffic

see Cisco "Basic Switch Functionality" https://www.youtube.com/watch?v=eMjpNuBRjk4

slide-12
SLIDE 12

12

Switch Switch – – B denied A B denied A-

  • to

to-

  • C traffic

C traffic

B of limited value to run i.d.s. for network-wide awareness

Network performance Network performance – – ids ids vs vs firewall firewall

firewall job is lightweight

– quick binary comparison

i.d.s. job is heavyweight

– involved analytical comparison

i.d.s. subject to overwhelming; dropping packets strategies

– streamlined, non-redundant rulesets – fast platform – task distribution, global coordination

slide-13
SLIDE 13

13

Defeating the ids Defeating the ids

fragmentation

– artificial packet splitting

spoofing

– manipulating TCP sequence numbers

denial of service

– overwhelm then attack

detector “training” to desensitize

What is snort? What is snort?

“Snort is an open source network intrusion prevention system, capable of performing real-time traffic analysis and packet logging on IP networks. It can perform protocol analysis, content searching/matching and can be used to detect a variety of attacks and probes, such as buffer overflows, stealth port scans, CGI attacks, SMB probes, OS fingerprinting attempts, and much more. “Snort uses a flexible rules language to describe traffic that it should collect

  • r pass, as well as a detection engine that utilizes a modular plugin
  • architecture. Snort has a real-time alerting capability as well, incorporating

alerting mechanisms for syslog, a user specified file, a UNIX socket, or WinPopup messages to Windows clients using Samba's smbclient. “Snort has three primary uses. It can be used as a straight packet sniffer like tcpdump(1), a packet logger (useful for network traffic debugging, etc), or as a full blown network intrusion prevention system.”

http://www.snort.org/about_snort/

slide-14
SLIDE 14

14

Snort operational modes Snort operational modes

packet sniffer (-v) packet logger (-l) network intrusion detector (-c)

Snort default Snort default filesystem filesystem map map

etc var / log snort.conf snort snort alert log.snort.1193189129 log.snort.1193189505 log.snort.1193190677 etc . . . rules attack-responses.rules backdoor.rules bad-traffic.rules ddos.rules ftp.rules icmp.rules local.rules p2p.rules smtp.rules sql.rules telnet.rules web-attacks.rules etc . . .

slide-15
SLIDE 15

15

Rule Structure Rule Structure

Rule Header Rule Options alert tcp any any -> 92.168.1.0/24 111 (content:”|00 01 86 a5|”; msg:”mountd access”;)

Rule header Rule header

alert tcp any any -> 92.168.1.0/24 111

action protocol source IP source port destination IP destination port direction pass log alert activate dynamic

etc . . .

ip icmp tcp udp

etc . . .

slide-16
SLIDE 16

16

Rule options Rule options

(content:”|00 01 86 a5|”; msg:”mountd access”;)

message to insert into alert packet payload content to look for

Snort Rules Snort Rules

a bad, un-useful rule alert ip any any -> any any (msg: “ip packet detected”;) alert: the action to be performed, ip : rule applies to all ip packets any : rule applies to any source ip address any : rule applies to any source port

  • > : direction of packet

any : rule applies to any destination ip address any : rule applies to any destination port

writes a lot to /var/log/snort/alert

slide-17
SLIDE 17

17

Snort architecture Snort architecture

preprocessor sniffer detection engine log/alert system

network log destinations

rule discard match?

yes no

What is swatch? What is swatch?

Simple WATCHdog - file viewer with regexp matching, designed to monitor a file which may contain pattern(s), and to provide action(s) to perform when each pattern is found. Arbitrary file. Arbitrary action.

slide-18
SLIDE 18

18

What does swatch have to do with snort? What does swatch have to do with snort?

You want to get paged whenever there’s a port scan on your network.

snort can detect port scans, can’t page swatch can page, can’t detect port scans Use snort to watch for port scans and write to a log file when one occurs. Swatch doesn't watch for port scans, it watches for log messages. But if snort reliably issues messages when there’s a scan, then swatch is positioned to pick up scans in effect, indirectly, by picking up the messages. Swatch can be the lookout for anything that gets logged-- port scans, bad logins, whatever. It just has to get logged.

swatch operation swatch operation

watches a file (e.g., a log) notices designated content reacts to its presence uses pattern-action specification to do so

pattern detection = trigger action = resultant response

slide-19
SLIDE 19

19

main swatch action keywords main swatch action keywords

echo mail exec pipe watchfor /hello/ echo=red mail addresses=you\@isp.com,subject="hello visible"

ACTIONS: 1) print that line on the terminal in red, and 2) send it out in an email address PATTERN: hello. A line in a file matches if it contains “hello”.

ping ping – – default content and size default content and size

slide-20
SLIDE 20

20

ping ping – – controlled content controlled content “ “USC USC-

ping ping – – controlled size* controlled size*

*set tcpdump’s max receive size with –s for huge sizes

slide-21
SLIDE 21

21

Some open source IDS Some open source IDS

snort

https://snort.org/

Advanced Intrusion Detection Environment (AIDE)

https://aide.github.io/

OSSEC (Open Source HIDS SECurity)

https://www.ossec.net/