SlideShare una empresa de Scribd logo
Suricata: A Decade under the
Influence (of packet sniffing)
Jack Mott / Jason Williams
Open Information Security Foundation
WHO IS INTERRUPTING MY 10AM COFFEE
Jack
● Security Research Analyst @
Proofpoint / Emerging Threats
● Malware analysis
● Signatures for ETPRO/OPEN,
ClamAV
● Core Team of OISF
JAe
● Security Research Analyst @
Proofpoint / Emerging Threats
● Malware analysis
● Phishing Research
● Signatures for ETPRO/OPEN,
ClamAV (Phishing)
● Core Team of OISF
An (abbreviated) history of Suricata
● Brainstormed by Matt Jonkman, Will Metcalf, and Victor
Julien
● Nov 2007 - First Lines of Code Written by Victor (VIPS)
● 2009 - Name changed to Suricata based on a community
recommendation to have a meerkat as the mascot
● Latin Genus Name for Meerkat: Suricata
● Victor and all the code contributors over the years have
really grown suricata...
Suricata is Open Source - GPL v2
OISF
● Open Information Security Foundation
● 501c(3) non-profit building Suricata
● Developers like to eat and have families, people deserve
to be paid for their hard work
● Consortium Members
● Trainings (Developer, Engineer, Analyst)
Consortium Members
What makes Suricata Unique
● Multithreading
● Protocol Parsing w/ buffers (http, dns, tls, smb, etc)
● HTTP, DNS, SMB Json Logs
● File Extraction
● IP reputation
● Lua Scripting to perform complicated rule detection logic
● Backed by non-profit (can’t be sold/bought out)
● Netflow Generation
● SMTP Support
● Native IPv6
● Things coming in 4.1… :)
Suricata Today - Suricata 4.0.4
● Detection capabilities extended for HTTP, TLS and more
○ More buffers!
● Further TLS improvements, incl STARTTLS
○ More buffers!
● Experimental Rust: NFS, DNS, NTP
● Extended EVE json log fields
○ More logs!
● Rewritten TCP stream reassembly engine
● Bypass SSL/TLS after the certificate happens
● Lots of bug fix in the minor releases
● CVE-2018-6794 detection bypass fixed in 4.0.4
Suricata Today - Suricata Update
● https://github.com/OISF/suricata-update
● No need to use snort tools to manage your suricata
sensors
● Written in python
● Well Documented
○ https://suricata-update.readthedocs.io/en/latest/
● Add Rule Sources
● Keep rules up to date
● Tune your rules without losing changes when the rules
update
Suricata Upcoming 4.1 (or maybe now in beta?)
● startswith / endswith
● Bsize
● Transforms!
○ Strip_whitespace
○ Compress_whitespace
○ to_sha256
● SMB Protocol (thanks FoxIT!)
○ Reimplementation of SMB1 and DCERPC
○ Add SMB2 and SMB3
○ Detection / File Extraction / Logging
Installing Suricata
● There are pretty good docs
○ https://suricata.readthedocs.io
● Build from Source
○ Add in hyperscan support, rust, experimental features
● Ubuntu with the oisf ppa
○ sudo add-apt-repository ppa:oisf/suricata-stable
● Lots of installation walkthroughs for common systems
○ https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Suri
cata_Installation
● Even on windows!
Installing Suricata - Network Card Options
● Intel nics are best on commodity hardware for sub 1g
lines
● Recommend Napatech/Endace/Myricom specialized HW for
higher (requires compiling with support)
● Recommend a recent linux kernel w/ AFPacketv3 (native!)
● You can use PFring, but recompiling kernel kinda sucks
● Turn off all the optimization settings on your nic...
Installing Suricata - Sub 1gps
● Basically anything will work
● A Raspberry pi will handle a few hundred mbps
● Unless you throw a few hundred thousand really bad rules
at it
● That 3 year old DB server that’s out of support now will
probably make a good sensor
Installing Suricata - Sub 10 gps
● You’re going to be tuning
● At least 16 cores
● Accelerated Capture Cards
● Potentially generating 100’s of gigs of logs a day
● Utilizing bypass
Installing Suricata - Above that
● Entirely possible - we know of 100gps+ implementations
● Something we get into in the advanced user training
● Serious Tuning and Hardware Optimization
● SEPTun
○ https://github.com/pevma/SEPTun/blob/master/SEPTun.rst
○ https://github.com/pevma/SEPTun-Mark-II/blob/master/SEPTun-Mark-II.rs
t
Suricata Runmodes
NSM - Network Security Monitoring (no rules)
IDS - Intrusion Detection (no metadata)
IPS - Intrusion Prevention (get off my lawn)
NSM + IDS is the most common implementation we see
NSM / IDS usually run off a TAP/Span Port
IPS is inline (potential failure point)
Suricata - The YAML Configuration file
● Used to be /etc/suricata/suricata.yaml
● Now is /usr/local/etc/suricata/suricata.yaml
● Everything is configured here for your sensor
● Many configurations can be overwritten at runtime
● Each section has explanations of the configuration
settings
● https://suricata.readthedocs.io is your friend
Suricata Deployment Considerations
● Typically still on perimeter
● We see them moving inside more lately
● On the host occasionally
● Be sure to set your HOME_NET and EXTERNAL_NET properly
● Rules can be expensive - only use what you need
Logging - fast.log
A fast log.
Contains relevant and quick information regarding a rule
hit:
Logging - eve.json
● Amazing log containing *everything* around traffic going
through a sensor
● JSON format: easy to parse, easy to add into log
aggregation (ELK, Splunk, etc)
● Prints alert information in in the same way as fast.log
but has everything else associated with the traffic
● Makes Suricata more of NSM than just IDS/IPS
eve.json
What is an IDS rule?
Consider this traffic:
What is an IDS rule?
alert http $HOME_NET any -> $EXTERNAL_NET any
(msg:"DetoxCrypto Ransomware CnC Activity";
flow:established,to_server; content:"POST"; http_method;
content:"/generate.php"; http_uri; isdataat:!1,relative;
content:”DetoxCrypto”; fast_pattern; http_user_agent;
content:"publickey="; depth:10; http_client_body;
http_header_names; content:!”Referer”; sid:1; rev:1;)
IDS Rule Basic Format
action protocol from_ip port -> to_ip port
(msg:”something"; content:"something";
content:"something else"; sid:10000000; rev:1;)Rule Action:
● Determines action made by IDS when rule matches traffic
● 99% of the time we use “alert”
● Other common actions include:
○ pass
○ drop
○ reject
Rule Protocol:
● Determines protocol to be inspected
● Basics are tcp, udp, icmp, ip
● Suricata specific protocols:
○ http
○ dns
○ tls
○ smtp
○ ftp
○ more...
Hosts:
● Indicate originator and recipient of traffic
● Can be single IP, IP range, or Variable (configurable)
● Often use default variables:
○ $HOME_NET (what you monitor, rfc 1918)
○ $EXTERNAL_NET (!$HOME_NET)
Ports:
● Correspond with hosts
● Can be single port, port range, or Variable (configurable)
● Can also be “any”
○ Used often when in conjunction with Suricata
protocols
Rule message:
● Arbitrary text that will appear in logs when rule
fires
● Useful to be as detailed as possible
● Consistency is key!
Rule contents:
● The building blocks of a rule
● The actual bytes present in traffic that we want to
detect
● Unique, interesting, malicious, etc.
● Can be ascii, hex, or combination
Rule metadata:
● Signature ID
● Revision Number
● Classtype
● References
● Other stuff
Rule Contents
Consider this traffic:
Rule Contents
content:”POST”;
content:”/generate.php”;
content:”DetoxCrypto”;
content:”publickey=“;
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"DetoxCrypto
Ransomware CnC Activity"; flow:established,to_server; content:"POST";
content:"/generate.php"; content:”DetoxCrypto”; content:"publickey=";
content:!”Referer”; sid:1; rev:1;)
Rule Contents
HTTP Rules
● HTTP is a common protocol we write a lot of sigs for
● Like dns and tls, http protocol also exists
● http content is placed into buffers
● Buffers are much faster than raw byte matching
● LOTS of buffers available
HTTP Rules
content:”POST”; http_method;
content:”/generate.php”; http_uri;
content:”DetoxCrypto”; http_user_agent;
content:”publickey=“; http_client_body;
alert http $HOME_NET any -> $EXTERNAL_NET any
(msg:"DetoxCrypto Ransomware CnC Activity";
flow:established,to_server; content:"POST";
http_method; content:"/generate.php"; http_uri;
isdataat:!1,relative; content:”DetoxCrypto”;
fast_pattern; http_user_agent;
content:"publickey="; depth:10; http_client_body;
http_header_names; content:!”Referer”; sid:1;
rev:1;)
HTTP Rules
● New keywords in 4.0.1
● http_header_names; is a good one
● Takes header names and puts them into a string, separated
by |0d 0a|
● Useful for tracking order of headers
● Much more efficient than PCRE
Host: www.evil.com
User-Agent: Mozilla/4.0
|0d 0a|Host|0d 0a|User-Agent|0d 0a 0d 0a|
HTTP Rules
Other cool 4.0+ buffers:
http_request_line;
http_start;
http_referer;
http_accept;
http_accept_lang;
http_accept_enc;
http_content_len;
http_content_type;
http_connection;
DNS Rules
● Because Suricata can parse protocols like DNS, rules are
much easier to write
● Instead of relying on just inspecting UDP and using DNS
request flags as content, we have more flexibility
● dns protocol
○ Includes UDP and TCP
● dns_query; keyword
DNS Rules
DNS Rules
The old way…
● udp protocol
● Using destination port 53
● Using DNS query flags
● Matching on non-normalized domain name
● Higher likelihood of False Negative
DNS Rules
The new(ish) way :D
● dns protocol
● Using destination port ‘any’
● Matching on normalized domain name in request
○ Using the dns_query; keyword
● More accurate, more efficient
TLS Rules
● A blind spot for most IDS/IPS
● Cannot see into the traffic, just that it's happening
● Unless MITM, which is cool too!
● Let’s Encrypt!
● Wait!
● We can do something with SSL/TLS
TLS Rules
TLS Rules
● tls protocol
○ Like dns proto
○ Port agnostic
● tls_subject;
● tls_cert_serial;
● tls_sni;
● more...
TLS Rules
The old way...
● tls protocol
● Using destination port ‘any’
● Matching on the Cert Serial using raw hex
● Matching on Cert Organization using raw hex
TLS Rules
The new way :D
● tls protocol
● Using destination port ‘any’
● Matching on the Cert Serial using tls_cert_serial;
● Matching on Cert Organization using tls_subject;
Common Rulesets
Emerging Threats
● ET OPEN
○ https://rules.emergingthrea
ts.net/open/
● ETPRO
○ Paid
Talos (Cisco/VRT/Snort)
● Community
○ https://snort.org/downloads
/#rule-downloads
● Snort Subscriber Ruleset
○ Paid
Other orgs with Suricata specific rulesets:
Attack Detection (PT Security), CrowdStrike, SecureWorks
Awesome NSM projects using Suricata
● SELKS - Stamus Networks
○ Suricata Elasticsearch Logstash Kibana Scirius
○ Scirius - Graphical Rule Manager
○ https://www.stamus-networks.com/open-source/
● Security Onion
○ Ubuntu based (now with elasticsearch) cornucopia of NSM tools
○ https://securityonion.net/
● RockNSM
○ Response Operation Collection Kit
○ http://rocknsm.io/
Community - Connect with us packet nerds
● Mailing lists:
○ Emerging Threats
■ Discussion about ET OPEN sigdev, etc.
■ https://lists.emergingthreats.net/mailman/listinfo/emerging-sigs
○ OISF
■ General Suricata discussion
■ https://lists.openinfosecfoundation.org/mailman/listinfo/oisf-users
● Twitter
○ @oisfoundation
○ @Suricata_IDS
○ @ET_Labs
● IRC
○ #suricata on freenode
Upcoming Events
● OISF - https://suricata-ids.org/training/
○ Suricata User Training (2 Day)
■ Suricon - Nov 14-16 2018 https://suricon.net/
○ Suricata Sigdev (2 Day)
■ Suricon
○ Suricata Developer Training
■ 5 Days!
○ Private trainings available
Questions?
Thanks!
Jack Mott
@malwareforme
jmott@oisf.net
Jason Williams
@switchingtoguns
jwilliams@oisf.net

Más contenido relacionado

La actualidad más candente

No Easy Breach DerbyCon 2016
No Easy Breach DerbyCon 2016No Easy Breach DerbyCon 2016
No Easy Breach DerbyCon 2016Matthew Dunwoody
 
IDS, IPS, IDPS
IDS, IPS, IDPSIDS, IPS, IDPS
IDS, IPS, IDPSMinhaz A V
 
Bypass file upload restrictions
Bypass file upload restrictionsBypass file upload restrictions
Bypass file upload restrictionsMukesh k.r
 
Threat hunting 101 by Sandeep Singh
Threat hunting 101 by Sandeep SinghThreat hunting 101 by Sandeep Singh
Threat hunting 101 by Sandeep SinghOWASP Delhi
 
Effective Threat Hunting with Tactical Threat Intelligence
Effective Threat Hunting with Tactical Threat IntelligenceEffective Threat Hunting with Tactical Threat Intelligence
Effective Threat Hunting with Tactical Threat IntelligenceDhruv Majumdar
 
Introduction to IDS & IPS - Part 1
Introduction to IDS & IPS - Part 1Introduction to IDS & IPS - Part 1
Introduction to IDS & IPS - Part 1whitehat 'People'
 
SIEM for Beginners: Everything You Wanted to Know About Log Management but We...
SIEM for Beginners: Everything You Wanted to Know About Log Management but We...SIEM for Beginners: Everything You Wanted to Know About Log Management but We...
SIEM for Beginners: Everything You Wanted to Know About Log Management but We...AlienVault
 
Threat hunting for Beginners
Threat hunting for BeginnersThreat hunting for Beginners
Threat hunting for BeginnersSKMohamedKasim
 
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015CODE BLUE
 
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
 
Threat Hunting with Elastic at SpectorOps: Welcome to HELK
Threat Hunting with Elastic at SpectorOps: Welcome to HELKThreat Hunting with Elastic at SpectorOps: Welcome to HELK
Threat Hunting with Elastic at SpectorOps: Welcome to HELKElasticsearch
 
PHDays 2018 Threat Hunting Hands-On Lab
PHDays 2018 Threat Hunting Hands-On LabPHDays 2018 Threat Hunting Hands-On Lab
PHDays 2018 Threat Hunting Hands-On LabTeymur Kheirkhabarov
 
Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021
Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021
Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021Florian Roth
 
What is Threat Hunting? - Panda Security
What is Threat Hunting? - Panda SecurityWhat is Threat Hunting? - Panda Security
What is Threat Hunting? - Panda SecurityPanda Security
 
Security Analyst Workshop - 20200212
Security Analyst Workshop - 20200212Security Analyst Workshop - 20200212
Security Analyst Workshop - 20200212Florian Roth
 
Recon with Nmap
Recon with Nmap Recon with Nmap
Recon with Nmap OWASP Delhi
 

La actualidad más candente (20)

A Threat Hunter Himself
A Threat Hunter HimselfA Threat Hunter Himself
A Threat Hunter Himself
 
No Easy Breach DerbyCon 2016
No Easy Breach DerbyCon 2016No Easy Breach DerbyCon 2016
No Easy Breach DerbyCon 2016
 
IDS, IPS, IDPS
IDS, IPS, IDPSIDS, IPS, IDPS
IDS, IPS, IDPS
 
Bypass file upload restrictions
Bypass file upload restrictionsBypass file upload restrictions
Bypass file upload restrictions
 
Threat hunting 101 by Sandeep Singh
Threat hunting 101 by Sandeep SinghThreat hunting 101 by Sandeep Singh
Threat hunting 101 by Sandeep Singh
 
Effective Threat Hunting with Tactical Threat Intelligence
Effective Threat Hunting with Tactical Threat IntelligenceEffective Threat Hunting with Tactical Threat Intelligence
Effective Threat Hunting with Tactical Threat Intelligence
 
Database Firewall with Snort
Database Firewall with SnortDatabase Firewall with Snort
Database Firewall with Snort
 
Introduction to IDS & IPS - Part 1
Introduction to IDS & IPS - Part 1Introduction to IDS & IPS - Part 1
Introduction to IDS & IPS - Part 1
 
SIEM for Beginners: Everything You Wanted to Know About Log Management but We...
SIEM for Beginners: Everything You Wanted to Know About Log Management but We...SIEM for Beginners: Everything You Wanted to Know About Log Management but We...
SIEM for Beginners: Everything You Wanted to Know About Log Management but We...
 
Threat hunting for Beginners
Threat hunting for BeginnersThreat hunting for Beginners
Threat hunting for Beginners
 
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
 
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
 
Threat Hunting with Elastic at SpectorOps: Welcome to HELK
Threat Hunting with Elastic at SpectorOps: Welcome to HELKThreat Hunting with Elastic at SpectorOps: Welcome to HELK
Threat Hunting with Elastic at SpectorOps: Welcome to HELK
 
Snort
SnortSnort
Snort
 
PHDays 2018 Threat Hunting Hands-On Lab
PHDays 2018 Threat Hunting Hands-On LabPHDays 2018 Threat Hunting Hands-On Lab
PHDays 2018 Threat Hunting Hands-On Lab
 
Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021
Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021
Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021
 
Snort IPS
Snort IPSSnort IPS
Snort IPS
 
What is Threat Hunting? - Panda Security
What is Threat Hunting? - Panda SecurityWhat is Threat Hunting? - Panda Security
What is Threat Hunting? - Panda Security
 
Security Analyst Workshop - 20200212
Security Analyst Workshop - 20200212Security Analyst Workshop - 20200212
Security Analyst Workshop - 20200212
 
Recon with Nmap
Recon with Nmap Recon with Nmap
Recon with Nmap
 

Similar a Suricata: A Decade Under the Influence (of packet sniffing)

Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios
 
Crikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor WorkshopCrikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor WorkshopVelocidex Enterprises
 
The IPv6 Snort Plugin (at DeepSec 2014)
The IPv6 Snort Plugin (at DeepSec 2014)The IPv6 Snort Plugin (at DeepSec 2014)
The IPv6 Snort Plugin (at DeepSec 2014)Martin Schütte
 
Black hat dc-2010-egypt-uav-slides
Black hat dc-2010-egypt-uav-slidesBlack hat dc-2010-egypt-uav-slides
Black hat dc-2010-egypt-uav-slidesBakry3
 
Turbo charge your logs
Turbo charge your logsTurbo charge your logs
Turbo charge your logsJeremy Cook
 
OSMC 2008 | Monitoring Tools Shootout by Tom De Cooman
OSMC 2008 | Monitoring Tools Shootout by Tom De CoomanOSMC 2008 | Monitoring Tools Shootout by Tom De Cooman
OSMC 2008 | Monitoring Tools Shootout by Tom De CoomanNETWAYS
 
Turbo charge your logs
Turbo charge your logsTurbo charge your logs
Turbo charge your logsJeremy Cook
 
Linux security quick reference guide
Linux security quick reference guideLinux security quick reference guide
Linux security quick reference guideCraig Cannon
 
Chapter 8 security tools ii
Chapter 8   security tools iiChapter 8   security tools ii
Chapter 8 security tools iiSyaiful Ahdan
 
Splunk, SIEMs, and Big Data - The Undercroft - November 2019
Splunk, SIEMs, and Big Data - The Undercroft - November 2019Splunk, SIEMs, and Big Data - The Undercroft - November 2019
Splunk, SIEMs, and Big Data - The Undercroft - November 2019Jonathan Singer
 
The internet of $h1t
The internet of $h1tThe internet of $h1t
The internet of $h1tAmit Serper
 
Netflix Open Source: Building a Distributed and Automated Open Source Program
Netflix Open Source:  Building a Distributed and Automated Open Source ProgramNetflix Open Source:  Building a Distributed and Automated Open Source Program
Netflix Open Source: Building a Distributed and Automated Open Source Programaspyker
 
Building a Distributed & Automated Open Source Program at Netflix
Building a Distributed & Automated Open Source Program at NetflixBuilding a Distributed & Automated Open Source Program at Netflix
Building a Distributed & Automated Open Source Program at NetflixAll Things Open
 
Zephyr Introduction - Nordic Webinar - Sept. 24.pdf
Zephyr Introduction - Nordic Webinar - Sept. 24.pdfZephyr Introduction - Nordic Webinar - Sept. 24.pdf
Zephyr Introduction - Nordic Webinar - Sept. 24.pdfAswathRangaraj1
 
Splunk: Forward me the REST of those shells
Splunk: Forward me the REST of those shellsSplunk: Forward me the REST of those shells
Splunk: Forward me the REST of those shellsAnthony D Hendricks
 

Similar a Suricata: A Decade Under the Influence (of packet sniffing) (20)

Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
 
Penetration Testing Boot CAMP
Penetration Testing Boot CAMPPenetration Testing Boot CAMP
Penetration Testing Boot CAMP
 
Monkey Server
Monkey ServerMonkey Server
Monkey Server
 
Crikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor WorkshopCrikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor Workshop
 
The IPv6 Snort Plugin (at DeepSec 2014)
The IPv6 Snort Plugin (at DeepSec 2014)The IPv6 Snort Plugin (at DeepSec 2014)
The IPv6 Snort Plugin (at DeepSec 2014)
 
Black hat dc-2010-egypt-uav-slides
Black hat dc-2010-egypt-uav-slidesBlack hat dc-2010-egypt-uav-slides
Black hat dc-2010-egypt-uav-slides
 
Security Onion
Security OnionSecurity Onion
Security Onion
 
Turbo charge your logs
Turbo charge your logsTurbo charge your logs
Turbo charge your logs
 
OSMC 2008 | Monitoring Tools Shootout by Tom De Cooman
OSMC 2008 | Monitoring Tools Shootout by Tom De CoomanOSMC 2008 | Monitoring Tools Shootout by Tom De Cooman
OSMC 2008 | Monitoring Tools Shootout by Tom De Cooman
 
Deploy your own P2P network
Deploy your own P2P networkDeploy your own P2P network
Deploy your own P2P network
 
Turbo charge your logs
Turbo charge your logsTurbo charge your logs
Turbo charge your logs
 
Linux security quick reference guide
Linux security quick reference guideLinux security quick reference guide
Linux security quick reference guide
 
Chapter 8 security tools ii
Chapter 8   security tools iiChapter 8   security tools ii
Chapter 8 security tools ii
 
Splunk, SIEMs, and Big Data - The Undercroft - November 2019
Splunk, SIEMs, and Big Data - The Undercroft - November 2019Splunk, SIEMs, and Big Data - The Undercroft - November 2019
Splunk, SIEMs, and Big Data - The Undercroft - November 2019
 
Infrastructure Security
Infrastructure SecurityInfrastructure Security
Infrastructure Security
 
The internet of $h1t
The internet of $h1tThe internet of $h1t
The internet of $h1t
 
Netflix Open Source: Building a Distributed and Automated Open Source Program
Netflix Open Source:  Building a Distributed and Automated Open Source ProgramNetflix Open Source:  Building a Distributed and Automated Open Source Program
Netflix Open Source: Building a Distributed and Automated Open Source Program
 
Building a Distributed & Automated Open Source Program at Netflix
Building a Distributed & Automated Open Source Program at NetflixBuilding a Distributed & Automated Open Source Program at Netflix
Building a Distributed & Automated Open Source Program at Netflix
 
Zephyr Introduction - Nordic Webinar - Sept. 24.pdf
Zephyr Introduction - Nordic Webinar - Sept. 24.pdfZephyr Introduction - Nordic Webinar - Sept. 24.pdf
Zephyr Introduction - Nordic Webinar - Sept. 24.pdf
 
Splunk: Forward me the REST of those shells
Splunk: Forward me the REST of those shellsSplunk: Forward me the REST of those shells
Splunk: Forward me the REST of those shells
 

Último

SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...CzechDreamin
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastUXDXConf
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1DianaGray10
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationZilliz
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2DianaGray10
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty SecureFemke de Vroome
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKUXDXConf
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyUXDXConf
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 

Último (20)

SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAK
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 

Suricata: A Decade Under the Influence (of packet sniffing)

  • 1. Suricata: A Decade under the Influence (of packet sniffing) Jack Mott / Jason Williams Open Information Security Foundation
  • 2. WHO IS INTERRUPTING MY 10AM COFFEE Jack ● Security Research Analyst @ Proofpoint / Emerging Threats ● Malware analysis ● Signatures for ETPRO/OPEN, ClamAV ● Core Team of OISF JAe ● Security Research Analyst @ Proofpoint / Emerging Threats ● Malware analysis ● Phishing Research ● Signatures for ETPRO/OPEN, ClamAV (Phishing) ● Core Team of OISF
  • 3. An (abbreviated) history of Suricata ● Brainstormed by Matt Jonkman, Will Metcalf, and Victor Julien ● Nov 2007 - First Lines of Code Written by Victor (VIPS) ● 2009 - Name changed to Suricata based on a community recommendation to have a meerkat as the mascot ● Latin Genus Name for Meerkat: Suricata ● Victor and all the code contributors over the years have really grown suricata...
  • 4.
  • 5.
  • 6. Suricata is Open Source - GPL v2
  • 7. OISF ● Open Information Security Foundation ● 501c(3) non-profit building Suricata ● Developers like to eat and have families, people deserve to be paid for their hard work ● Consortium Members ● Trainings (Developer, Engineer, Analyst)
  • 9. What makes Suricata Unique ● Multithreading ● Protocol Parsing w/ buffers (http, dns, tls, smb, etc) ● HTTP, DNS, SMB Json Logs ● File Extraction ● IP reputation ● Lua Scripting to perform complicated rule detection logic ● Backed by non-profit (can’t be sold/bought out) ● Netflow Generation ● SMTP Support ● Native IPv6 ● Things coming in 4.1… :)
  • 10. Suricata Today - Suricata 4.0.4 ● Detection capabilities extended for HTTP, TLS and more ○ More buffers! ● Further TLS improvements, incl STARTTLS ○ More buffers! ● Experimental Rust: NFS, DNS, NTP ● Extended EVE json log fields ○ More logs! ● Rewritten TCP stream reassembly engine ● Bypass SSL/TLS after the certificate happens ● Lots of bug fix in the minor releases ● CVE-2018-6794 detection bypass fixed in 4.0.4
  • 11. Suricata Today - Suricata Update ● https://github.com/OISF/suricata-update ● No need to use snort tools to manage your suricata sensors ● Written in python ● Well Documented ○ https://suricata-update.readthedocs.io/en/latest/ ● Add Rule Sources ● Keep rules up to date ● Tune your rules without losing changes when the rules update
  • 12. Suricata Upcoming 4.1 (or maybe now in beta?) ● startswith / endswith ● Bsize ● Transforms! ○ Strip_whitespace ○ Compress_whitespace ○ to_sha256 ● SMB Protocol (thanks FoxIT!) ○ Reimplementation of SMB1 and DCERPC ○ Add SMB2 and SMB3 ○ Detection / File Extraction / Logging
  • 13. Installing Suricata ● There are pretty good docs ○ https://suricata.readthedocs.io ● Build from Source ○ Add in hyperscan support, rust, experimental features ● Ubuntu with the oisf ppa ○ sudo add-apt-repository ppa:oisf/suricata-stable ● Lots of installation walkthroughs for common systems ○ https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Suri cata_Installation ● Even on windows!
  • 14. Installing Suricata - Network Card Options ● Intel nics are best on commodity hardware for sub 1g lines ● Recommend Napatech/Endace/Myricom specialized HW for higher (requires compiling with support) ● Recommend a recent linux kernel w/ AFPacketv3 (native!) ● You can use PFring, but recompiling kernel kinda sucks ● Turn off all the optimization settings on your nic...
  • 15. Installing Suricata - Sub 1gps ● Basically anything will work ● A Raspberry pi will handle a few hundred mbps ● Unless you throw a few hundred thousand really bad rules at it ● That 3 year old DB server that’s out of support now will probably make a good sensor
  • 16. Installing Suricata - Sub 10 gps ● You’re going to be tuning ● At least 16 cores ● Accelerated Capture Cards ● Potentially generating 100’s of gigs of logs a day ● Utilizing bypass
  • 17. Installing Suricata - Above that ● Entirely possible - we know of 100gps+ implementations ● Something we get into in the advanced user training ● Serious Tuning and Hardware Optimization ● SEPTun ○ https://github.com/pevma/SEPTun/blob/master/SEPTun.rst ○ https://github.com/pevma/SEPTun-Mark-II/blob/master/SEPTun-Mark-II.rs t
  • 18. Suricata Runmodes NSM - Network Security Monitoring (no rules) IDS - Intrusion Detection (no metadata) IPS - Intrusion Prevention (get off my lawn) NSM + IDS is the most common implementation we see NSM / IDS usually run off a TAP/Span Port IPS is inline (potential failure point)
  • 19. Suricata - The YAML Configuration file ● Used to be /etc/suricata/suricata.yaml ● Now is /usr/local/etc/suricata/suricata.yaml ● Everything is configured here for your sensor ● Many configurations can be overwritten at runtime ● Each section has explanations of the configuration settings ● https://suricata.readthedocs.io is your friend
  • 20.
  • 21.
  • 22. Suricata Deployment Considerations ● Typically still on perimeter ● We see them moving inside more lately ● On the host occasionally ● Be sure to set your HOME_NET and EXTERNAL_NET properly ● Rules can be expensive - only use what you need
  • 23. Logging - fast.log A fast log. Contains relevant and quick information regarding a rule hit:
  • 24. Logging - eve.json ● Amazing log containing *everything* around traffic going through a sensor ● JSON format: easy to parse, easy to add into log aggregation (ELK, Splunk, etc) ● Prints alert information in in the same way as fast.log but has everything else associated with the traffic ● Makes Suricata more of NSM than just IDS/IPS
  • 26.
  • 27. What is an IDS rule? Consider this traffic:
  • 28. What is an IDS rule? alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"DetoxCrypto Ransomware CnC Activity"; flow:established,to_server; content:"POST"; http_method; content:"/generate.php"; http_uri; isdataat:!1,relative; content:”DetoxCrypto”; fast_pattern; http_user_agent; content:"publickey="; depth:10; http_client_body; http_header_names; content:!”Referer”; sid:1; rev:1;)
  • 29. IDS Rule Basic Format action protocol from_ip port -> to_ip port (msg:”something"; content:"something"; content:"something else"; sid:10000000; rev:1;)Rule Action: ● Determines action made by IDS when rule matches traffic ● 99% of the time we use “alert” ● Other common actions include: ○ pass ○ drop ○ reject Rule Protocol: ● Determines protocol to be inspected ● Basics are tcp, udp, icmp, ip ● Suricata specific protocols: ○ http ○ dns ○ tls ○ smtp ○ ftp ○ more... Hosts: ● Indicate originator and recipient of traffic ● Can be single IP, IP range, or Variable (configurable) ● Often use default variables: ○ $HOME_NET (what you monitor, rfc 1918) ○ $EXTERNAL_NET (!$HOME_NET) Ports: ● Correspond with hosts ● Can be single port, port range, or Variable (configurable) ● Can also be “any” ○ Used often when in conjunction with Suricata protocols Rule message: ● Arbitrary text that will appear in logs when rule fires ● Useful to be as detailed as possible ● Consistency is key! Rule contents: ● The building blocks of a rule ● The actual bytes present in traffic that we want to detect ● Unique, interesting, malicious, etc. ● Can be ascii, hex, or combination Rule metadata: ● Signature ID ● Revision Number ● Classtype ● References ● Other stuff
  • 32. alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"DetoxCrypto Ransomware CnC Activity"; flow:established,to_server; content:"POST"; content:"/generate.php"; content:”DetoxCrypto”; content:"publickey="; content:!”Referer”; sid:1; rev:1;) Rule Contents
  • 33. HTTP Rules ● HTTP is a common protocol we write a lot of sigs for ● Like dns and tls, http protocol also exists ● http content is placed into buffers ● Buffers are much faster than raw byte matching ● LOTS of buffers available
  • 34. HTTP Rules content:”POST”; http_method; content:”/generate.php”; http_uri; content:”DetoxCrypto”; http_user_agent; content:”publickey=“; http_client_body; alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"DetoxCrypto Ransomware CnC Activity"; flow:established,to_server; content:"POST"; http_method; content:"/generate.php"; http_uri; isdataat:!1,relative; content:”DetoxCrypto”; fast_pattern; http_user_agent; content:"publickey="; depth:10; http_client_body; http_header_names; content:!”Referer”; sid:1; rev:1;)
  • 35. HTTP Rules ● New keywords in 4.0.1 ● http_header_names; is a good one ● Takes header names and puts them into a string, separated by |0d 0a| ● Useful for tracking order of headers ● Much more efficient than PCRE Host: www.evil.com User-Agent: Mozilla/4.0 |0d 0a|Host|0d 0a|User-Agent|0d 0a 0d 0a|
  • 36. HTTP Rules Other cool 4.0+ buffers: http_request_line; http_start; http_referer; http_accept; http_accept_lang; http_accept_enc; http_content_len; http_content_type; http_connection;
  • 37. DNS Rules ● Because Suricata can parse protocols like DNS, rules are much easier to write ● Instead of relying on just inspecting UDP and using DNS request flags as content, we have more flexibility ● dns protocol ○ Includes UDP and TCP ● dns_query; keyword
  • 39. DNS Rules The old way… ● udp protocol ● Using destination port 53 ● Using DNS query flags ● Matching on non-normalized domain name ● Higher likelihood of False Negative
  • 40. DNS Rules The new(ish) way :D ● dns protocol ● Using destination port ‘any’ ● Matching on normalized domain name in request ○ Using the dns_query; keyword ● More accurate, more efficient
  • 41. TLS Rules ● A blind spot for most IDS/IPS ● Cannot see into the traffic, just that it's happening ● Unless MITM, which is cool too! ● Let’s Encrypt! ● Wait! ● We can do something with SSL/TLS
  • 43. TLS Rules ● tls protocol ○ Like dns proto ○ Port agnostic ● tls_subject; ● tls_cert_serial; ● tls_sni; ● more...
  • 44. TLS Rules The old way... ● tls protocol ● Using destination port ‘any’ ● Matching on the Cert Serial using raw hex ● Matching on Cert Organization using raw hex
  • 45. TLS Rules The new way :D ● tls protocol ● Using destination port ‘any’ ● Matching on the Cert Serial using tls_cert_serial; ● Matching on Cert Organization using tls_subject;
  • 46. Common Rulesets Emerging Threats ● ET OPEN ○ https://rules.emergingthrea ts.net/open/ ● ETPRO ○ Paid Talos (Cisco/VRT/Snort) ● Community ○ https://snort.org/downloads /#rule-downloads ● Snort Subscriber Ruleset ○ Paid Other orgs with Suricata specific rulesets: Attack Detection (PT Security), CrowdStrike, SecureWorks
  • 47. Awesome NSM projects using Suricata ● SELKS - Stamus Networks ○ Suricata Elasticsearch Logstash Kibana Scirius ○ Scirius - Graphical Rule Manager ○ https://www.stamus-networks.com/open-source/ ● Security Onion ○ Ubuntu based (now with elasticsearch) cornucopia of NSM tools ○ https://securityonion.net/ ● RockNSM ○ Response Operation Collection Kit ○ http://rocknsm.io/
  • 48. Community - Connect with us packet nerds ● Mailing lists: ○ Emerging Threats ■ Discussion about ET OPEN sigdev, etc. ■ https://lists.emergingthreats.net/mailman/listinfo/emerging-sigs ○ OISF ■ General Suricata discussion ■ https://lists.openinfosecfoundation.org/mailman/listinfo/oisf-users ● Twitter ○ @oisfoundation ○ @Suricata_IDS ○ @ET_Labs ● IRC ○ #suricata on freenode
  • 49. Upcoming Events ● OISF - https://suricata-ids.org/training/ ○ Suricata User Training (2 Day) ■ Suricon - Nov 14-16 2018 https://suricon.net/ ○ Suricata Sigdev (2 Day) ■ Suricon ○ Suricata Developer Training ■ 5 Days! ○ Private trainings available