SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

Network Penetration Testing
Network Penetration TestingNetwork Penetration Testing
Network Penetration TestingMohammed Adam
 
CentOS Linux Server Hardening
CentOS Linux Server HardeningCentOS Linux Server Hardening
CentOS Linux Server HardeningMyOwn Telco
 
01- intro to firewall concepts
01- intro to firewall concepts01- intro to firewall concepts
01- intro to firewall conceptsMostafa El Lathy
 
MITRE AttACK framework it is time you took notice_v1.0
MITRE AttACK framework it is time you took notice_v1.0MITRE AttACK framework it is time you took notice_v1.0
MITRE AttACK framework it is time you took notice_v1.0Michael Gough
 
Chapter 7 Presentation
Chapter 7 PresentationChapter 7 Presentation
Chapter 7 PresentationAmy McMullin
 
Nessus-Vulnerability Tester
Nessus-Vulnerability TesterNessus-Vulnerability Tester
Nessus-Vulnerability TesterAditya Jain
 
Nessus Software
Nessus SoftwareNessus Software
Nessus SoftwareMegha Sahu
 
Nmap 9 truth "Nothing to say any more"
Nmap 9 truth "Nothing to say  any more"Nmap 9 truth "Nothing to say  any more"
Nmap 9 truth "Nothing to say any more"abend_cve_9999_0001
 
Industrial Training - Network Intrusion Detection System Using Snort
Industrial Training - Network Intrusion Detection System Using SnortIndustrial Training - Network Intrusion Detection System Using Snort
Industrial Training - Network Intrusion Detection System Using SnortDisha Bedi
 
Threat Modeling to Reduce Software Security Risk
Threat Modeling to Reduce Software Security RiskThreat Modeling to Reduce Software Security Risk
Threat Modeling to Reduce Software Security RiskSecurity Innovation
 
Intrusion prevention system(ips)
Intrusion prevention system(ips)Intrusion prevention system(ips)
Intrusion prevention system(ips)Papun Papun
 
Ch 5: Port Scanning
Ch 5: Port ScanningCh 5: Port Scanning
Ch 5: Port ScanningSam Bowne
 
Intrusion detection and prevention system
Intrusion detection and prevention systemIntrusion detection and prevention system
Intrusion detection and prevention systemNikhil Raj
 

La actualidad más candente (20)

Network Penetration Testing
Network Penetration TestingNetwork Penetration Testing
Network Penetration Testing
 
Snort
SnortSnort
Snort
 
Understanding NMAP
Understanding NMAPUnderstanding NMAP
Understanding NMAP
 
Ceh v5 module 04 enumeration
Ceh v5 module 04 enumerationCeh v5 module 04 enumeration
Ceh v5 module 04 enumeration
 
CentOS Linux Server Hardening
CentOS Linux Server HardeningCentOS Linux Server Hardening
CentOS Linux Server Hardening
 
NMAP - The Network Scanner
NMAP - The Network ScannerNMAP - The Network Scanner
NMAP - The Network Scanner
 
01- intro to firewall concepts
01- intro to firewall concepts01- intro to firewall concepts
01- intro to firewall concepts
 
Snort
SnortSnort
Snort
 
MITRE AttACK framework it is time you took notice_v1.0
MITRE AttACK framework it is time you took notice_v1.0MITRE AttACK framework it is time you took notice_v1.0
MITRE AttACK framework it is time you took notice_v1.0
 
Chapter 7 Presentation
Chapter 7 PresentationChapter 7 Presentation
Chapter 7 Presentation
 
Network scanning
Network scanningNetwork scanning
Network scanning
 
Nessus-Vulnerability Tester
Nessus-Vulnerability TesterNessus-Vulnerability Tester
Nessus-Vulnerability Tester
 
Nessus Software
Nessus SoftwareNessus Software
Nessus Software
 
Nmap 9 truth "Nothing to say any more"
Nmap 9 truth "Nothing to say  any more"Nmap 9 truth "Nothing to say  any more"
Nmap 9 truth "Nothing to say any more"
 
Industrial Training - Network Intrusion Detection System Using Snort
Industrial Training - Network Intrusion Detection System Using SnortIndustrial Training - Network Intrusion Detection System Using Snort
Industrial Training - Network Intrusion Detection System Using Snort
 
Threat Modeling to Reduce Software Security Risk
Threat Modeling to Reduce Software Security RiskThreat Modeling to Reduce Software Security Risk
Threat Modeling to Reduce Software Security Risk
 
Intrusion prevention system(ips)
Intrusion prevention system(ips)Intrusion prevention system(ips)
Intrusion prevention system(ips)
 
Ch 5: Port Scanning
Ch 5: Port ScanningCh 5: Port Scanning
Ch 5: Port Scanning
 
NMap
NMapNMap
NMap
 
Intrusion detection and prevention system
Intrusion detection and prevention systemIntrusion detection and prevention system
Intrusion detection and prevention system
 

Destacado

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
 

Destacado (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 a 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 a 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
 

Último

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durbanmasabamasaba
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
%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
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
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
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburgmasabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
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
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 

Último (20)

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%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
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
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
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
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...
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 

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