Lecture (part 1)-Intrusion Detection
Lecture (part 1)-Intrusion Detection
1
Links
• https://www.coursera.org/lecture/detecting-cyber-attacks/intrusion-detection-systems-UeDqJ
• https://www.coursera.org/learn/detecting-cyber-attacks/exam/pzXev/week-2-intrusion-detection-and-
prevention
• https://www.cse.wustl.edu/~jain/cse571-07/ftp/l_23ids/l_23ids.html
• https://www.coursera.org/learn/detecting-cyber-attacks/lecture/du5Bv/detection-methods
• http://people.duke.edu/~tkb13/courses/ece590-sec-2018fa/
• https://www.youtube.com/watch?v=izA04yceVaQ
• http://sharif.edu/~kharrazi/courses/40817-941/reading/Debar00a.pdf
q http://www.cse.psu.edu/~trj1/cse497b-s07/slides/cse497b-lecture-23-ids.pdf\S. Kumar, "Survey of Current Network Intrusion
Detection Techniques," http://www.cse.wustl.edu/~jain/cse571-07/p_nid.html
q NIST, Guide to Intrusion Detection and Prevention Systems (IDPS), Special Publication SP 800-94, Sep 2006,
http://csrc.nist.gove/publications/PubsSPs.html
q Open Directory Projects IDS Page, http://www.dmos.org/Computers/Security/Intrusion_Detection_Syste ms/ Has a list of 25
open source and 96 commercial tools, 79 security scanners, 25 security scanner services
q Architectural Issues of Intrusion Detection Infrastructure in Large Enterprises,
http://www.softpanorama.org/Security/intrusion_detection.shtml
q Gert DeLaet, Gert X. Schauwers, "Network Security Fundamentals," Cisco Press, Sep 2004, 400 pp., ISBN:
1587051672.
q Richard Bejtlich, "The Tao Of Network Security Monitoring : Beyond Intrusion Detection," Addison-Wesley, Jul 2004, 798 pp.,
ISBN:321246772.
q SANS Institute, "Intrusion Detection FAQ," http://www.sans.org/resources/idfaq/index.php?portal=46489b3fa83
24804cb8de1e1ff4ae9e7
q https://engineering.purdue.edu/kak/compsec/ß
q https://www.khanacademy.org/economics-finance-domain/core-finance/money-and-banking/bitcoin/v/bitcoin-digital-signatures
q https://www.markmonitor.com/download/webinar/2015/MarkMonitor-Webinar-150715-DeepWebDarknetBitcoin.pdf
2
Intrusion Detection and Prevention
• Intrusion
– Actions aimed at compromising the security of a target network
(confidentiality, integrity, availability of resources)
• Intrusion detection
– The identification of possible intrusion through intrusion
signatures and network activity analysis
– IDS: Intrusion Detection Systems
• Intrusion prevention
– The process of both detecting intrusion activities and managing
automatic responsive actions throughout the network
– IPS: Intrusion Prevention Systems
– IDPS: Intrusion Detection and Prevention Systems
3
Intrusion Detection Systems:
4
l Host-based IDS (HIDS)
l Monitors the characteristics of a single host for
suspicious activity
l monitor changes to host’s OS files and traffic
sent to the host
Comprises three logical components:
l Network-based IDS (NIDS)
• detect intrusions on one or more
network segments • Sensors - input to a sensor
l Monitors network traffic and analyzes network, includes network packets, log
transport, and application protocols to identify
suspicious activity
files, and system call traces.
• Analyzers - Analyzers receive
l Distributed or hybrid IDS input from one or more sensors
l Combines information from a number of sensors, or from other analyzers.
often both host and network based, in a central determine if intrusion has occurred
analyzer that is able to better identify and respond
to intrusion activity • User interface - view output or
control system behavior
5
Network IDS Deployment
External Router /
Firewall
Internet
Internal
Router /
Firewall DB Production
Work
Server Server
DMZ Network Station
Internal Networks
DNS Web Email NIDS
Server Server Server
NIDS
6
Host-Based IDSs
• Using OS auditing mechanisms
• E.G., BSM on Solaris: logs all direct or indirect
events generated by a user
• trace for system calls made by a program
• Monitoring user activities
• e.g., Analyze shell commands
• Monitoring execution of system programs
• e.g., Analyze system calls made by sendmail
7
Basic Audit Modules (Hosts)
• eventLog - Uses the windows Event Logging system to track entries into all
three of the windows event logs: System, Security, Application
• netstat - Uses the information from the program netstat to provide information
about network usage on the machine
• health - Runs the program health to give current information about the system
(CPU usage, mem usage, swap usage)
8
HIPS
• Many industry observers see the enterprise endpoint, including desktop and laptop
systems, as now the main target for hackers and criminals
10
Table 8.2 Linux System Calls and Windows DLLs Monitored
accept, access, acct, adjtime, aiocancel, aioread, aiowait, aiowrite, alarm, async_daemon,
auditsys, bind, chdir, chmod, chown, chroot, close, connect, creat, dup, dup2, execv, execve,
exit, exportfs, fchdir, fchmod, fchown, fchroot, fcntl, flock, fork, fpathconf, fstat, fstat,
fstatfs, fsync, ftime, ftruncate, getdents, getdirentries, getdomainname, getdopt, getdtablesize,
Linux
getfh, getgid, getgroups, gethostid, gethostname, getitimer, getmsg, getpagesize,
getpeername, getpgrp, getpid, getpriority, getrlimit, getrusage, getsockname, getsockopt,
gettimeofday, getuid, gtty, ioctl, kill, killpg, link, listen, lseek, lstat, madvise, mctl, mincore,
mkdir, mknod, mmap, mount, mount, mprotect, mpxchan, msgsys, msync, munmap,
nfs_mount, nfssvc, nice, open, pathconf, pause, pcfs_mount, phys, pipe, poll, profil, ptrace,
System
putmsg, quota, quotactl, read, readlink, readv, reboot, recv, recvfrom, recvmsg, rename,
resuba, rfssys, rmdir, sbreak, sbrk, select, semsys, send, sendmsg, sendto, setdomainname,
Calls and
setdopt, setgid, setgroups, sethostid, sethostname, setitimer, setpgid, setpgrp, setpgrp,
setpriority, setquota, setregid, setreuid, setrlimit, setsid, setsockopt, settimeofday, setuid, Windows
shmsys, shutdown, sigblock, sigpause, sigpending, sigsetmask, sigstack, sigsys, sigvec,
socket, socketaddr, socketpair, sstk, stat, stat, statfs, stime, stty, swapon, symlink, sync, DLLs
Monitored
sysconf, time, times, truncate, umask, umount, uname, unlink, unmount, ustat, utime, utimes,
vadvise, vfork, vhangup, vlimit, vpixsys, vread, vtimes, vtrace, vwrite, wait, wait3, wait4,
write, writev
comctl32
kernel32
msvcpp
msvcrt
mswsock
ntdll
ntoskrnl
(Table can be found on page
user32
280 in the textbook)
ws2_32
11
Ongoing activity to be provided as input to Analysis
Registry access:
– An access to the registry, given the amount of information and access to it used
by programs on these systems. However this source is very Windows specific,
and has recorded limited success.
12
Signature or Heuristic HIDS
• The alternative of signature or heuristic based HIDS is widely used,
particularly as seen in anti-virus (A/V), more correctly viewed as anti-
malware, products.
• These are very commonly used on Windows systems, and also
incorporated into mail and web application proxies on firewalls and in
network based IDSs.
• They use either a database of file signatures, which are patterns of data
found in known malicious software, or heuristic rules that characterize
known malicious behavior.
• These products are quite efficient at detecting known malware, however
they are not capable of detecting zero-day attacks that do not correspond to
the known signatures or heuristic rules.
• They are widely used, particularly on Windows systems, which continue to
be targeted by intruders
13
Network-based IDS (NIDS)
• A network-based IDS (NIDS) monitors traffic at selected points on a network or
interconnected set of networks.
• The NIDS examines the traffic packet by packet in real time, or close to real time, to
attempt to detect intrusion patterns. The NIDS may examine network-, transport-,
and/or application-level protocol activity.
• NIDS examines packet traffic directed toward potentially vulnerable computer systems
on a network. A host-based system examines user and software activity on a host.
• NIDS are typically included in the perimeter security infrastructure of an organization,
either incorporated in, or associated with, the firewall. They typically focus on
monitoring for external intrusion attempts, by analyzing both traffic pat- terns and
traffic content for malicious activity.
14
Classes of Intruders –Cyber Criminals
16
Web is not private by default
• The web is not private by default. Websites can use
cookies to track user actions on their site and even
across other sites. Browsers can track the browsing history
of a user, their search queries, and even their form
• Use cases for cookies
o There are many ways a website can use cookies to personalize an experience.
A search engine can use them to remember how many results a user prefers
seeing per page.
o A news site can use them to recommend headlines that are similar to the
articles you've already read.
o All sorts of websites can use cookies to track analytics, like how long you spent
on a page and which buttons you clicked.
o Any website with a log-in uses a cookie to keep you logged in on every page
of the site. When you log out of that site, it clears the cookie and doesn't set it
again until you login again.
17
Web is not private by default
• A 2016 study found that the average website loaded in about
20 third-party cookies, and the average news site loaded
double that amount.
• What are they doing with all those cookies? Most third-party
cookies are used for advertising. Imagine a user that visits a
food blog with a recipe for gluten-free cookies. That blog
includes a Facebook ad with a cookie. The user then visits
facebook.com and notices a sudden uptick in ads about
gluten-free products. That's not a coincidence, that's cookies!
• Make an IP-based guess. Websites can't see a user's GPS or
WiFi network information. However, websites do see the IP
addresses of the HTTP request coming to their server. There are
databases that attempt to identify the approximate location
of IP addresses, and websites can lookup an IP address in
those databases.
18
Web is not private by default
• Request access. The website can request the geolocation from the
browser, and the browser will ask the user for permission to share it.
The browser can typically make a good approximation of a user's
location using GPS (when available), WiFi/mobile network positioning
(most commonly), or as a last resort
• Ultimately, our ISP can see every HTTP request that goes over their
network. We can hide the contents of those requests by using HTTPS-
secured websites, but we can't hide the destination of the requests.
ISPs can use that information to find customers that are engaged in
illegal activities, like downloading movies illegally.
• Privacy-savvy users can obscure their activity by using a Virtual
Private Network (VPN), but most do not, since VPNs cost money and
slow down the online experience.based location.
19
Understanding the Internet
Landscape
Surface Web
Searchable with standard
search engines
Deep Web
Un-indexed websites
The Deep Web is hundreds of times larger than the ‘Surface Web'
20
What's in the Deep Web?
§ 96% of the content exists in the deep web
• 7500+ TB of content
Social
Websites
Media
Email
Mobile
Apps
Paid
Search
23
So What Is the Darknet?
§ Within the Darknet both web surfers and website publishers are
entirely anonymous
24
What is Tor?
26
The Tor Browser
27
How Does Tor Work?
torproject.org
28
How Does Tor Work?
torproject.org
29
How Does Tor Work?
torproject.org
30
May 2015 Tor 14
M
√
M OR2
M C2 C3
M
OR1 OR3
C1 C2 C3 Port
32 9
May 2015 Tor 16
33 9
May 2015 Tor 17
34 9
May 2015 Tor 18
35 9
May 2015 Tor 19
36 9
May 2015 Tor 20
How{{{m}Onion
}}
Routing Works
1 2
3 4 1
u d
5 3
4
1. u creates l-hop circuit through routers
2. u opens a stream in the circuit to d
3. Data are exchanged
37 9
May 2015 Tor 21
38 9
May 2015 Tor 22
39 9
May 2015 Tor 23
40 9
May 2015 Tor 24
41 9
May 2015 Tor 25
42 9
May 2015 Tor 26
43 9
May 2015 Tor 27
44 9
May 2015 Tor 28
47
What’s Sold on a Typical Tor Marketplace?
Drugs
Information
eBooks
Erotica
Counterfeits
Services
Data
Electronics
Misc
Software
Hacking
Fraud
Security
49
Typical Tor Marketplace
50
Typical Tor Marketplace - Pirated Software
51
Typical Tor Marketplace - Luxury
Goods
52
Typical Tor Marketplace - Pharmaceuticals
53
Typical Tor Marketplace -
Counterfeits
54
Typical Tor Marketplace – Account
Info
55
So What Role Does Bitcoin Play?
56
How Does Bitcoin Work?
57
Classes of Intruders –Activists
58
Classes of Intruders –
State-Sponsored Organizations
59
Classes of Intruders –Others
60
Efficiency of intrusion-detection
systems
• Accuracy.
o Accuracy deals with the proper detection of attacks and the absence of
false alarms.
• Performance.
o The performance of an intrusion-detection system is the rate at which
audit events are processed.
o If the performance of the intrusion-detection system is poor, then real-
time detection is not possible.
• Completeness.
o Completeness is the property of an intrusion-detection system to detect all
attacks.
o Incompleteness occurs when the intrusion-detection system fails to detect
an attack. This measure is much more difficult to evaluate than the others
because it is impossible to have a global knowledge about attacks or
abuses of privileges.
61
Efficiency of intrusion-detection
systems
• Fault tolerance
o An intrusion-detection system should itself be resistant to attacks,
especially denial-of- service-type attacks, and should be designed with
this goal in mind.
• Timeliness
o An intrusion-detection system has to perform and propagate its analysis
as quickly as possible to enable the security officer to react before much
damage has been done, and also to prevent the attacker from
subverting the audit source or the intrusion-detection system itself.
62
IDS: Time aspect
• Real-time IDS
• Analyzes the data while the sessions are in progress
• Raises an alarm immediately when the attack is detected
• Off-line IDS
• Analyzes the data after the information has been already collected
• Useful for understanding the attackers’ behavior
63
Intrusion Detection Systems
• IDS’s really refer to two kinds of
detection technologies
‣ Behavior-based Detection
‣ Misuse Detection
6
4
Intrusion Detection Techniques
• Misuse detection
– Use attack “signatures” (need a model of the attack)
• Sequences of system calls, patterns of network traffic, etc.
– Must know in advance what attacker will do (how?)
– Can only detect known attacks
– Relatively few false positives
• Anomaly detection
– Using a model of normal system behavior, try to detect
deviations and abnormalities
• E.g., raise an alarm when a statistically rare event(s) occurs
– Can potentially detect unknown attacks
– Many false positives
slide 38
Intrusion Detection Systems
Misuse Detection
• The system is equipped with a number of attack
descriptions (“signature”). Then matched against the audit
data to detect attacks.
• Pro: less false positives (But there still some!)
• Con: cannot detect novel attacks, need to update the
signatures often.
• Approaches: pattern matching, security rule specification.
66
Intrusion Detection Systems
Behavior-based IDS
• Good completeness, bad accuracy
• Involves the collection of data relating to the behavior of legitimate users over
a period of time
• Current observed behavior is analyzed to determine whether this behavior is
that of a legitimate user or that of an intruder
• Detect intrusion by observing a deviation from the normal or expected
behavior of the system or the users
• Can detect attempts to exploit new and unforeseen vulnerabilities
• Behavior-based IDS
• Statistics
• Expert systems
• Neural networks
67
• User intention identification
Behavior-based IDS
• In essence, anomaly approaches aim to define normal, or expected,
behavior, in order to identify malicious or unauthorized behavior.
68
Anomaly Detection
A variety of classification approaches are
used: