SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Downloaden Sie, um offline zu lesen
An Introduction to Suricata
By
Tex Morgan
What is Suricata?
Open Source IDS / IPS / NSM engine
IDS – Intrusion Detection System
IPS – Intrusion Prevention System
NSM – Network Security Monitoring
But Wait, There's More
● Off line analysis of PCAP files
● Traffic recording using PCAP logger
● Unix socket mode for automated processing
● Automatic Protocol Detection
● JSON event and alert outputs
– Logstache, etc.
http://suricata-ids.org/features/all-features/
Command Line (Weeee!)
● suricata
• -c <yaml configuration file location>
• -i <interface to sniff>
• -s <signatures file> (runs in addition to -c)
• -r <pcap recording file location>
• -l <default log directory location>
• -D }:-)
suricata -c suricata.yaml -s signatures.rules -i eth0
Default Files (/etc/suricata)
● suricata.yaml
● Signatures (aka Rules)
– decoder-events.rules
– dns-events.rules
– files.rules
– http-events.rules
– smtp-events.rules
– stream-events.rules
– tls-events.rules
Staying on Top
● Edit /etc/oinkmaster.conf
– Add url =
http://rules.emergingthreats.net/open/suricata/emerging.rules.tar
.gz
– save
● $ sudo oinkmaster -C /etc/oinkmaster.conf -o
/etc/suricata/rules
– Cronjob this for up-to-date rules
● Update the Classification and Reference file
– /etc/suricata/rules/classification.conf
– /etc/suricata/rules/reference.conf
Configuring for Rules
● Not all rules are loaded from /etc/suricata/rules
● You can add rules easily to suricata.yaml
• - <rule name>.rules
• # to comment out the rule temporarily
● To change a specific rule, edit oinkmaster.conf
– disablesid 2010495
– modifysid 2010495 “alert” | “drop”
EVE Logging
- eve-log:
enabled: yes
type: file #file|syslog|unix_dgram|unix_stream
filename: eve.json
types:
- alert
- http:
extended: yes # enable this for extended logging information
custom: [Accept-Encoding, Accept-Language, Authorization]
- dns
- tls:
extended: yes # enable this for extended logging information
- files:
force-magic: no # force logging magic on all logged files
force-md5: no # force logging of md5 checksums
- ssh
Multiple EVE Logs
- eve-log:
enabled: yes
type: file
filename: eve-ips.json
types:
- alert
- drop
- eve-log:
enabled: yes
type: file
filename: eve-nsm.json
types:
- http
- dns
- tls
Custom HTTP Logging
custom: yes
customformat:
%h - Host HTTP Header (remote host name). ie: google.com
%H - Request Protocol. ie: HTTP/1.1
%m - Request Method. ie: GET
%u - URL including query string. ie: /search?q=suricata
%{header_name}i - contents of the defined HTTP Request Header name. ie:
%{User-agent}i: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:11.0) Gecko/20100101 Firefox/11.0
%{X-Forwarded-For}i: outputs the IP address contained in the X-Forwarded-For HTTP header (inserted by a reverse proxy)
%s - return status code. In the case of 301 and 302 it will print the url in brackets. ie: 200
%B - response size in bytes. ie: 15789
%{header_name}o - contents of the defined HTTP Response Header name
%{strftime_format]t - timestamp of the HTTP transaction in the selected strftime format. ie: 08/28/12-22:14:30
%z - precision time in useconds. ie: 693856
%a - client IP address
%p - client port number
%A - server IP address
%P - server port number
Saving to MySQL
mysql>create database filejsondb;
mysql> create user 'filejson'@'localhost' IDENTIFIED BY 'PASSWORD123';
mysql> grant all privileges on filejsondb.* to 'filejson'@'localhost' with grant
option;
mysql> flush privileges;
mysql> use filejsondb;
mysql> CREATE TABLE filejson( time_received VARCHAR(64), ipver
VARCHAR(4), srcip VARCHAR(40), dstip VARCHAR(40), protocol SMALLINT
UNSIGNED, sp SMALLINT UNSIGNED, dp SMALLINT UNSIGNED, http_uri
TEXT, http_host TEXT, http_referer TEXT, filename TEXT, magic TEXT, state
VARCHAR(32), md5 VARCHAR(32), stored VARCHAR(32), size BIGINT
UNSIGNED);
mysql> show columns from filejson;
Follow JSON
https://redmine.openinfosecfoundation.org/project
s/suricata/wiki/Script_FollowJSON
Common MySQL Queries
https://redmine.openinfosecfoundation.org/project
s/suricata/wiki/Useful_queries_-
_for_MySQL_and_PostgreSQL
Rule Format
● Action: drop, alert, pass, reject
● Header: protocol address port direction address
port
– Protocol : ip(all/any), tcp, udp, icmp
– Address: IPv4, IPv6, $HOME_NET,
$EXTERNAL_NET
– Direction : →(from to) or <> (bidirectional)
● Rule Options
Address
● Suricata.yaml config
– $HOME_NET: [127.0.0.1, 192.168.1.128]
– $EXTERNAL_NET: !$HOME_NET #very good idea
● ![127.0.0.1, 192.168.1.128]
● 1.1.1.1/24
Ports
● !88
● [80:85]
● [80:85, !84]
Rule Options
● Meta-settings #no effect on inspection
● Payload Keywords
● HTTP Keywords
● DNS Keywords
● Flow Keywords
● File Keywords
● IP Reputation Keywords
Meta-Settings
● Msg: “hello”
● Sid: (signature id number)
● Rev: (revision of signature)
● Gid: (group type id)
● Classtype: trojan-activity
– Use classification.config values
● Reference : <type>, <value>
● Priority: 1-255 (normally 1-4, smaller = higher)
● Metadata: “faniofarnogirai”
Payload Keywords
● content : “abc”
● nocase
● distance: 3 #only with multiple content
● within: 3
● dsize
● replace: “def”
HTTP Keywords
● http_method
● http_uri / http_raw_uri
● uricontent / urilen
● http_header / http_header_raw
● http_cookie
● http_user_agent
● http_client_body / http_server_body
● file_data
● http_stat_msg / http_stat_code
DNS Keywords
● dns_query
– Inspects DNS response
– all contents following it are affected by it!!
● Example:
alert dns any any -> any any (msg:"Test
dns_query option"; dns_query;
content:"google"; nocase; sid:1;)
Flow Keywords
● Flowbits
● Flow: [<direction>] [<state>] [<stream>]
– Direction: to/from_client, to/from_server
– State: established or stateless
– Stream: only_stream, no_stream (packet only)
● Flowint
● stream_size
File Keywords
● filename
● Fileext
● Filemagic
● Filestore: <direction>, <scope>
● Filemd5
● Filesize: <value>
IP Reputation Keywords
● iprep: <side>,<cat>,<operator>,<value>
– side to check: <any|src|dst|both>
– cat: the category short name
– operator: <, >, =
– Value: 1-127
● Disabled by default
Simple Example Rule
alert ip $EXTERNAL_NET any → $HOME_NET
any (msg: “Probably not a good idea to accept
these packets”; geoip: any, CN, RU, FR, A1,
A2, O1, BR, IQ, IR, KP; sid: 999999999; rev:1)
Detect SYN Flood
alert tcp $EXTERNAL_NET any -> $HOME_NET any
(msg:"LOCAL DOS Unusually fast SYN packets
inbound, Potential DOS"; flags: S,12; threshold: type
both, track by_dst, count 5000, seconds 5;
classtype:misc-activity; sid:5;)
alert tcp $HOME_NET any -> $EXTERNAL_NET any
(msg:"LOCAL DOS Unusually fast SYN packets
outbound, Potential DOS"; flags: S,12; threshold:
type both, track by_dst, count 5000, seconds 5;
classtype:misc-activity; sid:6;)
Pass and Suppress
● Pass for safe traffic
– pass ip 1.2.3.4 any <> any any (msg:"pass all traffic
from/to 1.2.3.4"; sid:1;)
● Suppress is a bad idea
– Stops alerts
– Only considered post matching
– suppress gen_id 0, sig_id 0, track by_src, ip 1.2.3.4
Snort.conf → Suricata.yaml
https://redmine.openinfosecfoundation.org/project
s/suricata/wiki/Snortconf_to_Suricatayaml
Kibana/Logstash
JSON Output:
https://redmine.openinfosecfoundation.org/proj
ects/suricata/wiki/_Logstash_Kibana_and_Surica
ta_JSON_output
Template:
https://github.com/pevma/Suricata-Logstash-Tem
plates

Weitere ähnliche Inhalte

Was ist angesagt?

Understanding the Event Log
Understanding the Event LogUnderstanding the Event Log
Understanding the Event Logchuckbt
 
CNIT 124 Ch 13: Post Exploitation (Part 1)
CNIT 124 Ch 13: Post Exploitation (Part 1)CNIT 124 Ch 13: Post Exploitation (Part 1)
CNIT 124 Ch 13: Post Exploitation (Part 1)Sam Bowne
 
Hacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning TechniquesHacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning Techniquesamiable_indian
 
Intro to NSM with Security Onion - AusCERT
Intro to NSM with Security Onion - AusCERTIntro to NSM with Security Onion - AusCERT
Intro to NSM with Security Onion - AusCERTAshley Deuble
 
DDoS Saldırı Analizi - DDoS Forensics
DDoS Saldırı Analizi - DDoS ForensicsDDoS Saldırı Analizi - DDoS Forensics
DDoS Saldırı Analizi - DDoS ForensicsBGA Cyber Security
 
Nmap basics
Nmap basicsNmap basics
Nmap basicsitmind4u
 
Snort IPS(Intrusion Prevention System) Eğitimi
Snort IPS(Intrusion Prevention System) EğitimiSnort IPS(Intrusion Prevention System) Eğitimi
Snort IPS(Intrusion Prevention System) EğitimiBGA Cyber Security
 
Recon with Nmap
Recon with Nmap Recon with Nmap
Recon with Nmap OWASP Delhi
 
3 palo alto ngfw architecture overview
3 palo alto ngfw architecture overview3 palo alto ngfw architecture overview
3 palo alto ngfw architecture overviewMostafa El Lathy
 
Type of DDoS attacks with hping3 example
Type of DDoS attacks with hping3 exampleType of DDoS attacks with hping3 example
Type of DDoS attacks with hping3 exampleHimani Singh
 

Was ist angesagt? (20)

Understanding the Event Log
Understanding the Event LogUnderstanding the Event Log
Understanding the Event Log
 
Ceh v5 module 03 scanning
Ceh v5 module 03 scanningCeh v5 module 03 scanning
Ceh v5 module 03 scanning
 
LLMNR ve NetBIOS Poisoning
LLMNR ve NetBIOS PoisoningLLMNR ve NetBIOS Poisoning
LLMNR ve NetBIOS Poisoning
 
Ceh v5 module 04 enumeration
Ceh v5 module 04 enumerationCeh v5 module 04 enumeration
Ceh v5 module 04 enumeration
 
Building active directory lab for red teaming
Building active directory lab for red teamingBuilding active directory lab for red teaming
Building active directory lab for red teaming
 
Snort IPS
Snort IPSSnort IPS
Snort IPS
 
CNIT 124 Ch 13: Post Exploitation (Part 1)
CNIT 124 Ch 13: Post Exploitation (Part 1)CNIT 124 Ch 13: Post Exploitation (Part 1)
CNIT 124 Ch 13: Post Exploitation (Part 1)
 
Hacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning TechniquesHacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning Techniques
 
Security Onion
Security OnionSecurity Onion
Security Onion
 
Understanding NMAP
Understanding NMAPUnderstanding NMAP
Understanding NMAP
 
Intro to NSM with Security Onion - AusCERT
Intro to NSM with Security Onion - AusCERTIntro to NSM with Security Onion - AusCERT
Intro to NSM with Security Onion - AusCERT
 
DDoS Saldırı Analizi - DDoS Forensics
DDoS Saldırı Analizi - DDoS ForensicsDDoS Saldırı Analizi - DDoS Forensics
DDoS Saldırı Analizi - DDoS Forensics
 
Snort
SnortSnort
Snort
 
Nmap basics
Nmap basicsNmap basics
Nmap basics
 
Snort IPS(Intrusion Prevention System) Eğitimi
Snort IPS(Intrusion Prevention System) EğitimiSnort IPS(Intrusion Prevention System) Eğitimi
Snort IPS(Intrusion Prevention System) Eğitimi
 
Security Onion - Introduction
Security Onion - IntroductionSecurity Onion - Introduction
Security Onion - Introduction
 
Linux security
Linux securityLinux security
Linux security
 
Recon with Nmap
Recon with Nmap Recon with Nmap
Recon with Nmap
 
3 palo alto ngfw architecture overview
3 palo alto ngfw architecture overview3 palo alto ngfw architecture overview
3 palo alto ngfw architecture overview
 
Type of DDoS attacks with hping3 example
Type of DDoS attacks with hping3 exampleType of DDoS attacks with hping3 example
Type of DDoS attacks with hping3 example
 

Andere mochten auch

The Next Generation Open IDS Engine Suricata and Emerging Threats
The Next Generation Open IDS Engine Suricata and Emerging ThreatsThe Next Generation Open IDS Engine Suricata and Emerging Threats
The Next Generation Open IDS Engine Suricata and Emerging ThreatsJoshua L. Davis
 
Open Source IDS Tools: A Beginner's Guide
Open Source IDS Tools: A Beginner's GuideOpen Source IDS Tools: A Beginner's Guide
Open Source IDS Tools: A Beginner's GuideAlienVault
 
HL WORLDWIDE LOGISTICS -- SERVICES PRESENTATION MARCH 2016
HL WORLDWIDE LOGISTICS -- SERVICES PRESENTATION  MARCH 2016HL WORLDWIDE LOGISTICS -- SERVICES PRESENTATION  MARCH 2016
HL WORLDWIDE LOGISTICS -- SERVICES PRESENTATION MARCH 2016Gloria Aleman de Jaco
 
El suricato. gladis fenández
El suricato. gladis fenándezEl suricato. gladis fenández
El suricato. gladis fenándezGladis1137
 
Suricato, suricata ou suricate
Suricato, suricata ou suricateSuricato, suricata ou suricate
Suricato, suricata ou suricateRui Macário
 
Windows Firewall & Its Configuration
Windows Firewall & Its ConfigurationWindows Firewall & Its Configuration
Windows Firewall & Its ConfigurationSoban Ahmad
 
Security Onion: Watching for Leeks
Security Onion: Watching for LeeksSecurity Onion: Watching for Leeks
Security Onion: Watching for LeeksKory Kyzar
 
Como fazer trabalhos escolares - Ensino Básico
Como fazer trabalhos escolares - Ensino BásicoComo fazer trabalhos escolares - Ensino Básico
Como fazer trabalhos escolares - Ensino BásicoCarlos Pinheiro
 
Security Onion Conference - 2015
Security Onion Conference - 2015Security Onion Conference - 2015
Security Onion Conference - 2015DefensiveDepth
 
부동산 텔레그램봇 사내공유 @Tech
부동산 텔레그램봇 사내공유 @Tech부동산 텔레그램봇 사내공유 @Tech
부동산 텔레그램봇 사내공유 @TechHoChul Shin
 
Arahan keselamatan
Arahan keselamatanArahan keselamatan
Arahan keselamatanIszwan Shah
 
Factores abióticos
Factores abióticosFactores abióticos
Factores abióticosTânia Reis
 
Windows 7 firewall & its configuration
Windows 7 firewall & its configurationWindows 7 firewall & its configuration
Windows 7 firewall & its configurationSoban Ahmad
 

Andere mochten auch (20)

Security Onion
Security OnionSecurity Onion
Security Onion
 
The Next Generation Open IDS Engine Suricata and Emerging Threats
The Next Generation Open IDS Engine Suricata and Emerging ThreatsThe Next Generation Open IDS Engine Suricata and Emerging Threats
The Next Generation Open IDS Engine Suricata and Emerging Threats
 
Suricata
SuricataSuricata
Suricata
 
Suricata
SuricataSuricata
Suricata
 
Open Source IDS Tools: A Beginner's Guide
Open Source IDS Tools: A Beginner's GuideOpen Source IDS Tools: A Beginner's Guide
Open Source IDS Tools: A Beginner's Guide
 
Suricata
SuricataSuricata
Suricata
 
HL WORLDWIDE LOGISTICS -- SERVICES PRESENTATION MARCH 2016
HL WORLDWIDE LOGISTICS -- SERVICES PRESENTATION  MARCH 2016HL WORLDWIDE LOGISTICS -- SERVICES PRESENTATION  MARCH 2016
HL WORLDWIDE LOGISTICS -- SERVICES PRESENTATION MARCH 2016
 
El suricato. gladis fenández
El suricato. gladis fenándezEl suricato. gladis fenández
El suricato. gladis fenández
 
Suricato, suricata ou suricate
Suricato, suricata ou suricateSuricato, suricata ou suricate
Suricato, suricata ou suricate
 
Windows Firewall & Its Configuration
Windows Firewall & Its ConfigurationWindows Firewall & Its Configuration
Windows Firewall & Its Configuration
 
Security Onion: Watching for Leeks
Security Onion: Watching for LeeksSecurity Onion: Watching for Leeks
Security Onion: Watching for Leeks
 
Como fazer trabalhos escolares - Ensino Básico
Como fazer trabalhos escolares - Ensino BásicoComo fazer trabalhos escolares - Ensino Básico
Como fazer trabalhos escolares - Ensino Básico
 
Security Onion Conference - 2015
Security Onion Conference - 2015Security Onion Conference - 2015
Security Onion Conference - 2015
 
부동산 텔레그램봇 사내공유 @Tech
부동산 텔레그램봇 사내공유 @Tech부동산 텔레그램봇 사내공유 @Tech
부동산 텔레그램봇 사내공유 @Tech
 
Arahan keselamatan
Arahan keselamatanArahan keselamatan
Arahan keselamatan
 
Osi Model
Osi ModelOsi Model
Osi Model
 
Arahan mkn 20
Arahan mkn 20Arahan mkn 20
Arahan mkn 20
 
Factores abióticos
Factores abióticosFactores abióticos
Factores abióticos
 
Firewall configuration
Firewall configurationFirewall configuration
Firewall configuration
 
Windows 7 firewall & its configuration
Windows 7 firewall & its configurationWindows 7 firewall & its configuration
Windows 7 firewall & its configuration
 

Ähnlich wie Suricata

Fluentd and Embulk Game Server 4
Fluentd and Embulk Game Server 4Fluentd and Embulk Game Server 4
Fluentd and Embulk Game Server 4N Masahiro
 
SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28
SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28
SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28Jxck Jxck
 
Linux HTTPS/TCP/IP Stack for the Fast and Secure Web
Linux HTTPS/TCP/IP Stack for the Fast and Secure WebLinux HTTPS/TCP/IP Stack for the Fast and Secure Web
Linux HTTPS/TCP/IP Stack for the Fast and Secure WebAll Things Open
 
InSecure Remote Operations - NullCon 2023 by Yossi Sassi
InSecure Remote Operations - NullCon 2023 by Yossi SassiInSecure Remote Operations - NullCon 2023 by Yossi Sassi
InSecure Remote Operations - NullCon 2023 by Yossi SassiYossi Sassi
 
Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...
Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...
Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...Amazon Web Services
 
Dynamic Tracing of your AMP web site
Dynamic Tracing of your AMP web siteDynamic Tracing of your AMP web site
Dynamic Tracing of your AMP web siteSriram Natarajan
 
Collect distributed application logging using fluentd (EFK stack)
Collect distributed application logging using fluentd (EFK stack)Collect distributed application logging using fluentd (EFK stack)
Collect distributed application logging using fluentd (EFK stack)Marco Pas
 
Logstash for SEO: come monitorare i Log del Web Server in realtime
Logstash for SEO: come monitorare i Log del Web Server in realtimeLogstash for SEO: come monitorare i Log del Web Server in realtime
Logstash for SEO: come monitorare i Log del Web Server in realtimeAndrea Cardinale
 
Ngrep commands
Ngrep commandsNgrep commands
Ngrep commandsRishu Seth
 
How to admin
How to adminHow to admin
How to adminyalegko
 
IT Operations for Web Developers
IT Operations for Web DevelopersIT Operations for Web Developers
IT Operations for Web DevelopersMahmoud Said
 
Tempesta FW - Framework и Firewall для WAF и DDoS mitigation, Александр Крижа...
Tempesta FW - Framework и Firewall для WAF и DDoS mitigation, Александр Крижа...Tempesta FW - Framework и Firewall для WAF и DDoS mitigation, Александр Крижа...
Tempesta FW - Framework и Firewall для WAF и DDoS mitigation, Александр Крижа...Ontico
 
Odoo command line interface
Odoo command line interfaceOdoo command line interface
Odoo command line interfaceJalal Zahid
 
1032 cs208 g operation system ip camera case share.v0.2
1032 cs208 g operation system ip camera case share.v0.21032 cs208 g operation system ip camera case share.v0.2
1032 cs208 g operation system ip camera case share.v0.2Stanley Ho
 

Ähnlich wie Suricata (20)

Fluentd and Embulk Game Server 4
Fluentd and Embulk Game Server 4Fluentd and Embulk Game Server 4
Fluentd and Embulk Game Server 4
 
Penetration Testing Boot CAMP
Penetration Testing Boot CAMPPenetration Testing Boot CAMP
Penetration Testing Boot CAMP
 
The basics of fluentd
The basics of fluentdThe basics of fluentd
The basics of fluentd
 
SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28
SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28
SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28
 
Linux HTTPS/TCP/IP Stack for the Fast and Secure Web
Linux HTTPS/TCP/IP Stack for the Fast and Secure WebLinux HTTPS/TCP/IP Stack for the Fast and Secure Web
Linux HTTPS/TCP/IP Stack for the Fast and Secure Web
 
InSecure Remote Operations - NullCon 2023 by Yossi Sassi
InSecure Remote Operations - NullCon 2023 by Yossi SassiInSecure Remote Operations - NullCon 2023 by Yossi Sassi
InSecure Remote Operations - NullCon 2023 by Yossi Sassi
 
Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...
Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...
Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...
 
Dynamic Tracing of your AMP web site
Dynamic Tracing of your AMP web siteDynamic Tracing of your AMP web site
Dynamic Tracing of your AMP web site
 
Collect distributed application logging using fluentd (EFK stack)
Collect distributed application logging using fluentd (EFK stack)Collect distributed application logging using fluentd (EFK stack)
Collect distributed application logging using fluentd (EFK stack)
 
Logstash for SEO: come monitorare i Log del Web Server in realtime
Logstash for SEO: come monitorare i Log del Web Server in realtimeLogstash for SEO: come monitorare i Log del Web Server in realtime
Logstash for SEO: come monitorare i Log del Web Server in realtime
 
Ngrep commands
Ngrep commandsNgrep commands
Ngrep commands
 
How to admin
How to adminHow to admin
How to admin
 
Running php on nginx
Running php on nginxRunning php on nginx
Running php on nginx
 
Logstash
LogstashLogstash
Logstash
 
IT Operations for Web Developers
IT Operations for Web DevelopersIT Operations for Web Developers
IT Operations for Web Developers
 
Tempesta FW - Framework и Firewall для WAF и DDoS mitigation, Александр Крижа...
Tempesta FW - Framework и Firewall для WAF и DDoS mitigation, Александр Крижа...Tempesta FW - Framework и Firewall для WAF и DDoS mitigation, Александр Крижа...
Tempesta FW - Framework и Firewall для WAF и DDoS mitigation, Александр Крижа...
 
Odoo command line interface
Odoo command line interfaceOdoo command line interface
Odoo command line interface
 
Performance_Up.ppt
Performance_Up.pptPerformance_Up.ppt
Performance_Up.ppt
 
Nmap scripting engine
Nmap scripting engineNmap scripting engine
Nmap scripting engine
 
1032 cs208 g operation system ip camera case share.v0.2
1032 cs208 g operation system ip camera case share.v0.21032 cs208 g operation system ip camera case share.v0.2
1032 cs208 g operation system ip camera case share.v0.2
 

Kürzlich hochgeladen

WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 

Kürzlich hochgeladen (20)

WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 

Suricata

  • 1. An Introduction to Suricata By Tex Morgan
  • 2. What is Suricata? Open Source IDS / IPS / NSM engine IDS – Intrusion Detection System IPS – Intrusion Prevention System NSM – Network Security Monitoring
  • 3. But Wait, There's More ● Off line analysis of PCAP files ● Traffic recording using PCAP logger ● Unix socket mode for automated processing ● Automatic Protocol Detection ● JSON event and alert outputs – Logstache, etc. http://suricata-ids.org/features/all-features/
  • 4. Command Line (Weeee!) ● suricata • -c <yaml configuration file location> • -i <interface to sniff> • -s <signatures file> (runs in addition to -c) • -r <pcap recording file location> • -l <default log directory location> • -D }:-) suricata -c suricata.yaml -s signatures.rules -i eth0
  • 5. Default Files (/etc/suricata) ● suricata.yaml ● Signatures (aka Rules) – decoder-events.rules – dns-events.rules – files.rules – http-events.rules – smtp-events.rules – stream-events.rules – tls-events.rules
  • 6. Staying on Top ● Edit /etc/oinkmaster.conf – Add url = http://rules.emergingthreats.net/open/suricata/emerging.rules.tar .gz – save ● $ sudo oinkmaster -C /etc/oinkmaster.conf -o /etc/suricata/rules – Cronjob this for up-to-date rules ● Update the Classification and Reference file – /etc/suricata/rules/classification.conf – /etc/suricata/rules/reference.conf
  • 7. Configuring for Rules ● Not all rules are loaded from /etc/suricata/rules ● You can add rules easily to suricata.yaml • - <rule name>.rules • # to comment out the rule temporarily ● To change a specific rule, edit oinkmaster.conf – disablesid 2010495 – modifysid 2010495 “alert” | “drop”
  • 8. EVE Logging - eve-log: enabled: yes type: file #file|syslog|unix_dgram|unix_stream filename: eve.json types: - alert - http: extended: yes # enable this for extended logging information custom: [Accept-Encoding, Accept-Language, Authorization] - dns - tls: extended: yes # enable this for extended logging information - files: force-magic: no # force logging magic on all logged files force-md5: no # force logging of md5 checksums - ssh
  • 9. Multiple EVE Logs - eve-log: enabled: yes type: file filename: eve-ips.json types: - alert - drop - eve-log: enabled: yes type: file filename: eve-nsm.json types: - http - dns - tls
  • 10. Custom HTTP Logging custom: yes customformat: %h - Host HTTP Header (remote host name). ie: google.com %H - Request Protocol. ie: HTTP/1.1 %m - Request Method. ie: GET %u - URL including query string. ie: /search?q=suricata %{header_name}i - contents of the defined HTTP Request Header name. ie: %{User-agent}i: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:11.0) Gecko/20100101 Firefox/11.0 %{X-Forwarded-For}i: outputs the IP address contained in the X-Forwarded-For HTTP header (inserted by a reverse proxy) %s - return status code. In the case of 301 and 302 it will print the url in brackets. ie: 200 %B - response size in bytes. ie: 15789 %{header_name}o - contents of the defined HTTP Response Header name %{strftime_format]t - timestamp of the HTTP transaction in the selected strftime format. ie: 08/28/12-22:14:30 %z - precision time in useconds. ie: 693856 %a - client IP address %p - client port number %A - server IP address %P - server port number
  • 11. Saving to MySQL mysql>create database filejsondb; mysql> create user 'filejson'@'localhost' IDENTIFIED BY 'PASSWORD123'; mysql> grant all privileges on filejsondb.* to 'filejson'@'localhost' with grant option; mysql> flush privileges; mysql> use filejsondb; mysql> CREATE TABLE filejson( time_received VARCHAR(64), ipver VARCHAR(4), srcip VARCHAR(40), dstip VARCHAR(40), protocol SMALLINT UNSIGNED, sp SMALLINT UNSIGNED, dp SMALLINT UNSIGNED, http_uri TEXT, http_host TEXT, http_referer TEXT, filename TEXT, magic TEXT, state VARCHAR(32), md5 VARCHAR(32), stored VARCHAR(32), size BIGINT UNSIGNED); mysql> show columns from filejson;
  • 14. Rule Format ● Action: drop, alert, pass, reject ● Header: protocol address port direction address port – Protocol : ip(all/any), tcp, udp, icmp – Address: IPv4, IPv6, $HOME_NET, $EXTERNAL_NET – Direction : →(from to) or <> (bidirectional) ● Rule Options
  • 15. Address ● Suricata.yaml config – $HOME_NET: [127.0.0.1, 192.168.1.128] – $EXTERNAL_NET: !$HOME_NET #very good idea ● ![127.0.0.1, 192.168.1.128] ● 1.1.1.1/24
  • 17. Rule Options ● Meta-settings #no effect on inspection ● Payload Keywords ● HTTP Keywords ● DNS Keywords ● Flow Keywords ● File Keywords ● IP Reputation Keywords
  • 18. Meta-Settings ● Msg: “hello” ● Sid: (signature id number) ● Rev: (revision of signature) ● Gid: (group type id) ● Classtype: trojan-activity – Use classification.config values ● Reference : <type>, <value> ● Priority: 1-255 (normally 1-4, smaller = higher) ● Metadata: “faniofarnogirai”
  • 19. Payload Keywords ● content : “abc” ● nocase ● distance: 3 #only with multiple content ● within: 3 ● dsize ● replace: “def”
  • 20. HTTP Keywords ● http_method ● http_uri / http_raw_uri ● uricontent / urilen ● http_header / http_header_raw ● http_cookie ● http_user_agent ● http_client_body / http_server_body ● file_data ● http_stat_msg / http_stat_code
  • 21. DNS Keywords ● dns_query – Inspects DNS response – all contents following it are affected by it!! ● Example: alert dns any any -> any any (msg:"Test dns_query option"; dns_query; content:"google"; nocase; sid:1;)
  • 22. Flow Keywords ● Flowbits ● Flow: [<direction>] [<state>] [<stream>] – Direction: to/from_client, to/from_server – State: established or stateless – Stream: only_stream, no_stream (packet only) ● Flowint ● stream_size
  • 23. File Keywords ● filename ● Fileext ● Filemagic ● Filestore: <direction>, <scope> ● Filemd5 ● Filesize: <value>
  • 24. IP Reputation Keywords ● iprep: <side>,<cat>,<operator>,<value> – side to check: <any|src|dst|both> – cat: the category short name – operator: <, >, = – Value: 1-127 ● Disabled by default
  • 25. Simple Example Rule alert ip $EXTERNAL_NET any → $HOME_NET any (msg: “Probably not a good idea to accept these packets”; geoip: any, CN, RU, FR, A1, A2, O1, BR, IQ, IR, KP; sid: 999999999; rev:1)
  • 26. Detect SYN Flood alert tcp $EXTERNAL_NET any -> $HOME_NET any (msg:"LOCAL DOS Unusually fast SYN packets inbound, Potential DOS"; flags: S,12; threshold: type both, track by_dst, count 5000, seconds 5; classtype:misc-activity; sid:5;) alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"LOCAL DOS Unusually fast SYN packets outbound, Potential DOS"; flags: S,12; threshold: type both, track by_dst, count 5000, seconds 5; classtype:misc-activity; sid:6;)
  • 27. Pass and Suppress ● Pass for safe traffic – pass ip 1.2.3.4 any <> any any (msg:"pass all traffic from/to 1.2.3.4"; sid:1;) ● Suppress is a bad idea – Stops alerts – Only considered post matching – suppress gen_id 0, sig_id 0, track by_src, ip 1.2.3.4