SlideShare a Scribd company logo
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

More Related Content

What's hot

Intrusion prevention system(ips)
Intrusion prevention system(ips)Intrusion prevention system(ips)
Intrusion prevention system(ips)Papun Papun
 
Threat Hunting Report
Threat Hunting Report Threat Hunting Report
Threat Hunting Report Morane Decriem
 
Network Penetration Testing
Network Penetration TestingNetwork Penetration Testing
Network Penetration TestingMohammed Adam
 
Hacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning TechniquesHacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning Techniquesamiable_indian
 
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
 
Kali linux useful tools
Kali linux useful toolsKali linux useful tools
Kali linux useful toolsmilad mahdavi
 
Penetration testing
Penetration testingPenetration testing
Penetration testingAmmar WK
 
Threat Hunting
Threat HuntingThreat Hunting
Threat HuntingSplunk
 
OpeVPN on Mikrotik
OpeVPN on MikrotikOpeVPN on Mikrotik
OpeVPN on MikrotikGLC Networks
 
Threat hunting - Every day is hunting season
Threat hunting - Every day is hunting seasonThreat hunting - Every day is hunting season
Threat hunting - Every day is hunting seasonBen Boyd
 
An introduction to SSH
An introduction to SSHAn introduction to SSH
An introduction to SSHnussbauml
 
Threat Hunting with Splunk Hands-on
Threat Hunting with Splunk Hands-onThreat Hunting with Splunk Hands-on
Threat Hunting with Splunk Hands-onSplunk
 
Threat Hunting with Splunk Hands-on
Threat Hunting with Splunk Hands-onThreat Hunting with Splunk Hands-on
Threat Hunting with Splunk Hands-onSplunk
 
OSINT Tool - Reconnaissance with Recon-ng
OSINT Tool - Reconnaissance with Recon-ngOSINT Tool - Reconnaissance with Recon-ng
OSINT Tool - Reconnaissance with Recon-ngRaghav Bisht
 
ELK in Security Analytics
ELK in Security Analytics ELK in Security Analytics
ELK in Security Analytics nullowaspmumbai
 
Introduction to tcpdump
Introduction to tcpdumpIntroduction to tcpdump
Introduction to tcpdumpLev Walkin
 

What's hot (20)

Intrusion prevention system(ips)
Intrusion prevention system(ips)Intrusion prevention system(ips)
Intrusion prevention system(ips)
 
Threat Hunting Report
Threat Hunting Report Threat Hunting Report
Threat Hunting Report
 
Network Penetration Testing
Network Penetration TestingNetwork Penetration Testing
Network Penetration Testing
 
Snort
SnortSnort
Snort
 
Nmap tutorial
Nmap tutorialNmap tutorial
Nmap tutorial
 
Hacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning TechniquesHacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning Techniques
 
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
 
Kali linux useful tools
Kali linux useful toolsKali linux useful tools
Kali linux useful tools
 
Penetration testing
Penetration testingPenetration testing
Penetration testing
 
Threat Hunting
Threat HuntingThreat Hunting
Threat Hunting
 
Deep dive into ssrf
Deep dive into ssrfDeep dive into ssrf
Deep dive into ssrf
 
Introduction to Snort
Introduction to SnortIntroduction to Snort
Introduction to Snort
 
OpeVPN on Mikrotik
OpeVPN on MikrotikOpeVPN on Mikrotik
OpeVPN on Mikrotik
 
Threat hunting - Every day is hunting season
Threat hunting - Every day is hunting seasonThreat hunting - Every day is hunting season
Threat hunting - Every day is hunting season
 
An introduction to SSH
An introduction to SSHAn introduction to SSH
An introduction to SSH
 
Threat Hunting with Splunk Hands-on
Threat Hunting with Splunk Hands-onThreat Hunting with Splunk Hands-on
Threat Hunting with Splunk Hands-on
 
Threat Hunting with Splunk Hands-on
Threat Hunting with Splunk Hands-onThreat Hunting with Splunk Hands-on
Threat Hunting with Splunk Hands-on
 
OSINT Tool - Reconnaissance with Recon-ng
OSINT Tool - Reconnaissance with Recon-ngOSINT Tool - Reconnaissance with Recon-ng
OSINT Tool - Reconnaissance with Recon-ng
 
ELK in Security Analytics
ELK in Security Analytics ELK in Security Analytics
ELK in Security Analytics
 
Introduction to tcpdump
Introduction to tcpdumpIntroduction to tcpdump
Introduction to tcpdump
 

Viewers also liked

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
 
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
 
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
 

Viewers also liked (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
 
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
 
Security Onion
Security OnionSecurity Onion
Security Onion
 
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
 

Similar to 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
 

Similar to 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
 

Recently uploaded

SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar
 
Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareinfo611746
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfOrtus Solutions, Corp
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAlluxio, Inc.
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandIES VE
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)Max Lee
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabbereGrabber
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesKrzysztofKkol1
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...rajkumar669520
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems ApproachNeo4j
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Krakówbim.edu.pl
 
10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdfkalichargn70th171
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfkalichargn70th171
 
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with StrimziStrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzisteffenkarlsson2
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfVictor Lopez
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAlluxio, Inc.
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignNeo4j
 

Recently uploaded (20)

SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting software
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
 
Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabber
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Kraków
 
10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
 
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with StrimziStrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by Design
 

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