SlideShare a Scribd company logo
1 of 32
Detecting Malicious SSL
Certificates Using Bro
Andrew Beard
Ajit Thyagarajan
Motivation
• SSL traffic is increasing and so is malicious usage!
Motivation
• SSL traffic is increasing and so is malicious usage!
• Content visibility of SSL traffic is becoming increasingly harder
Motivation
• SSL traffic is increasing and so is malicious usage!
• Content visibility of SSL traffic is becoming increasingly harder
• BSides Charm talk – Using Bro IDS to Detect X509 Anomalies by Will
Glodek
Direct application of cert feeds
• Well known SSL cert blacklist, SSLBL by abuse.ch
• Identifies certificates via hash (SHA1)
• Averages about 10 new entries per week
• Relatively high efficacy
David Bianco’s Pyramid Triangle of Pain
• Reflects the pain you
cause to an adversary
• Generating new
certificates (even signed
ones) causes little pain
Using cert feeds and Bro to greater effect
• Use the feeds as a starting point to gather and label data
• Analyze metadata from known bad certificates as a training set
• Treat other certs resulting from other feeds as maybes
• Try to find patterns in the metadata we can use to match as many
known bad and maybes as possible, verify against known (or at least,
heavily biased) good traffic
Why Bro?
• Content awareness
• Ability to apply patterns to live network traffic
• Symmetry on the front and the back end
I don’t have a supercomputer
• I have a 7 year old Dell workstation
my wife’s IT department was
throwing out
• Nothing here would be remotely
considered HPC
Generating training sets
• Visit every potentially malicious site you can possibly find
• OSINT feeds are great for this
• Don’t have a lot of context (if any)
• Look for certificates that match our known bad ones
• “Everything else” creates a data set that isn’t totally trustworthy, use
for testing
Feed
Data
(All)
Fetch
Script
In
Cert
Feed?
Known
Bad
Maybe
Bad
Yes
No
Problems with generating data sets
• Expect a low response rate
• Sites get taken down, not HTTPS port 443, don’t serve anything out,
unregistered DGAs, etc
• Less than 1 in 5000 respond (with no guarantee those responses are
actually bad)
• Number that match on the SSLBL is even worse, and that’s biased
• Based entirely on what’s already labeled as bad
x509.log Fields
• ts
• id
• version
• serial
• subject
• issuer
• not_valid_before
• not_valid_after
• key_alg
• sig_alg
• key_type
• key_length
• exponent
• curve
• san.dns
• san.uri
• san.email
• san.ip
• basic_constraints.ca
• basic_constraints.path_len
Subjects and Issuers
• CN=nycards2016.com,OU=PositiveSSL,OU=Domain Control
Validated
• emailAddress=ha@163.com,CN=gjf,OU=comba,O=comba,L=guang
zhou,ST=china,C=CN
• CN=A_LifeSize_System,C=US,ST=Texas,L=Austin,emailAddres
s=hostmaster@lifesize.com,OU=IT,O=LifeSize
Communications, Inc.
• CN=Symantec Class 3 Secure Server CA - G4,OU=Symantec
Trust Network,O=Symantec Corporation,C=US
• OU=Test,O=Peersec
Networks,L=Bellevue,ST=WA,C=US,CN=MatrixSSL Sample
Server CA
Splitting the Attributes
• Subject and Issuer are the string representations of multiple Attribute
Value Assertions (AVAs)
• Hard to compare them as big strings, but a lot more commonality
once you split them up
• Not hard to parse out each attribute using something like Splunk or
Kiabana, but it makes matching on those fields harder later
• Split the fields into a new Bro log based on x509.log
(x509_extended.log)
Many attributes, but we’re just using a subset
• C Country
• CN Common Name (Site identifier)
• L Locality (City)
• O Organization
• OU Organizational Unit
• ST State (or Province)
• emailAddress
• unstructuredName
• serialNumber
x509_extended
type Info: record {
fuid: string &log;
sha1: string &log;
subject_c: string &log &optional;
subject_cn: string &log &optional;
subject_l: string &log &optional;
subject_o: string &log &optional;
subject_ou: string &log &optional;
subject_st: string &log &optional;
subject_email: string &log &optional;
subject_unstruct: string &log &optional;
subject_serial: string &log &optional;
issuer_c: string &log &optional;
…
}
Need a prototyping system
• Wanted to gather data, then test patterns on the same data sets over
and over
• Could do this with Bro directly, but you don’t really need to reprocess
the packets and sessions over and over again
• Process traffic into Bro logs, evaluate via Splunk or SQL
• May want to apply new certificate feeds to existing logs outside of Bro
Analysis
• Look at data in $VISUALIZATION
• Clustering -> Pattern Synthesis
• Check for hits in the bad table
• Check for hits in the unknown table
• Confirm against a known good set
Examples
Default Values
C ST O emailAddress
AU Some-State Internet Widgits Pty Ltd -
AU Some-State Internet Widgits Pty Ltd chmod 0600 /etc/nginx/ssl/server.key
AU Some-State Internet Widgits Pty Ltd -
openssl Command Defaults
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:
Is it actionable?
• Very strong correlation between sites that were hosting malware or
control nodes, though
• Gozi, Gootkit, Shifu, others have all been identified running from
servers with “Internet Widgits Pty Ltd” certificates
• Non-malicious sites mostly default server pages and sites under
development
• A user visiting a site outside the network could be considered
anomalous
• Default Company Ltd, Default City, also used by some OpenSSL
distributions
Copypasta
sha1 O L ST
1147947433f261bcd2cd8f508461e01898c3960b Dis Springfield Denial
f2a61975cb541e6a62ed8ca5214020108d922a14 Dis Springfield Denial
368e6beb6f8d2f6049831fe25dd397287823c5e6 Dis Springfield Denial
a9650a4522140d42e5ca4529da54805625eebe64 Dis Springfield Denial
• 4 cert feed matches in our original sample set
• SSLBL lists all four as TorrentLocker C2 servers
• 14 others were found with the same ST, L, and O fields (and other
fields not present)
• 5 of those have shown up in the SSLBL feed since
• So far ALL TorrentLocker C2 servers seem to use the same pattern
Where did it come from?
“Random” Values
C CN L O ST
CN TJMauph2wkefdglVFzqmyEvM 3KLyyRWQF0IRfH91yu5frdLX rfUvM2rqVg1P8IpFP2mJbEjD ST
CN RJHeFQ9nCz69k5RNTTLmVCIf gBEUDkp44OE7ihODZD4VbdDv oLsGPV9bx43NaNg1ZjOqIGfJ ST
CN Hcoc6tfYqmEXPnDtwJ39vBFg N9El3p9XpqOBDcqUQxKCbw5V OJ2vl3Vz2Tn0skdsUsLUMwFz ST
CN X5WBo9o5AqvtVGGAVyBiNgwO wHMhVyFMNPcbdG84Q8gKcijH 8V3jDPLZIGdNoOmKQ42ZmhlE ST
CN rQ9YqiO7S1pgULTmD3nNahn7 OBfmruLgjF88LKyg0fVHqRzU zs3L7avZO3gDESogMpf4HBxj ST
• Fixed C and ST values, and exactly 24 character in the CN, L, and O
fields
• Over 27 matches for the same pattern in the “maybe” set
• All C2 nodes from the same malware family
Applying Patterns to Bro
• Wrote collection of bro scripts that load the x509_extended module
• Hooks into an event after subject and issuer subfields have been
parsed out
• Logs to notice.log
Triangle of Pain, Revisited
Recap
• Bro makes it easy to extract certificate metadata
• Using OSINT and Bro you can easily collect large sets of data on bad
and suspect certificates
• Patterns in the certificate metadata can yield higher-value
information than the feeds alone
• Hard to definitively say something is malicious with no context, but
you can get to a high level of confidence
• Since Bro can operate a line speed, it can be used to match against
those patterns with live traffic
Future
• Better ways of applying patterns in Bro (less hardcoding into scripts)
• Certificate analysis has potential for uncovering a lot more patterns
• Better automatic clustering
• BSides DC talk focusing on clustering and analysis (Oct 22, '16)
• Continuing to enhance our collection of good/bad certs
• Looking for collaborators - let us know if you are interested...
Thanks to:
• Abuse.ch
• John Bambenek and Bambenek Consulting
• AlienVault and numerous OTX contributors
• Ravi Pandey from University of Maryland
Questions?
Andrew Beard
andrew@atomicmole.com
Ajit Thyagarajan
ajit@atomicmole.com
Atomic Mole GitHub
https://github.com/atomicmole/brocon2016

More Related Content

What's hot

Using Algorithms to Brute Force Algorithms...A Journey Through Time and Names...
Using Algorithms to Brute Force Algorithms...A Journey Through Time and Names...Using Algorithms to Brute Force Algorithms...A Journey Through Time and Names...
Using Algorithms to Brute Force Algorithms...A Journey Through Time and Names...OpenDNS
 
Black hat usa_2015-bypass_surgery-6_aug2015
Black hat usa_2015-bypass_surgery-6_aug2015Black hat usa_2015-bypass_surgery-6_aug2015
Black hat usa_2015-bypass_surgery-6_aug2015a4202655
 
Internal Pentest: from z3r0 to h3r0
Internal Pentest: from z3r0 to h3r0Internal Pentest: from z3r0 to h3r0
Internal Pentest: from z3r0 to h3r0marcioalma
 
BlueHat v17 || 28 Registrations Later: Measuring the Exploitation of Residual...
BlueHat v17 || 28 Registrations Later: Measuring the Exploitation of Residual...BlueHat v17 || 28 Registrations Later: Measuring the Exploitation of Residual...
BlueHat v17 || 28 Registrations Later: Measuring the Exploitation of Residual...BlueHat Security Conference
 
My Bro The ELK
My Bro The ELKMy Bro The ELK
My Bro The ELKTripwire
 
Jon Gorenflo - Burp Collaborator
Jon Gorenflo - Burp CollaboratorJon Gorenflo - Burp Collaborator
Jon Gorenflo - Burp Collaboratorcentralohioissa
 
An Introduction to DANE - Securing TLS using DNSSEC
An Introduction to DANE - Securing TLS using DNSSECAn Introduction to DANE - Securing TLS using DNSSEC
An Introduction to DANE - Securing TLS using DNSSECCarlos Martinez Cagnazzo
 
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2Rob Fuller
 
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...CODE BLUE
 
External service interaction
External service interactionExternal service interaction
External service interactionPawan Phogat
 
2nd ICANN APAC-TWNIC Engagement Forum: Why RPKI Matters
2nd ICANN APAC-TWNIC Engagement Forum: Why RPKI Matters2nd ICANN APAC-TWNIC Engagement Forum: Why RPKI Matters
2nd ICANN APAC-TWNIC Engagement Forum: Why RPKI MattersAPNIC
 
getdns PyCon presentation
getdns PyCon presentationgetdns PyCon presentation
getdns PyCon presentationMelinda Shore
 
Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016Daniel Bohannon
 
BlueHat v17 || TLS 1.3 - Full speed ahead... mind the warnings - the great, t...
BlueHat v17 || TLS 1.3 - Full speed ahead... mind the warnings - the great, t...BlueHat v17 || TLS 1.3 - Full speed ahead... mind the warnings - the great, t...
BlueHat v17 || TLS 1.3 - Full speed ahead... mind the warnings - the great, t...BlueHat Security Conference
 
DANE and Application Uses of DNSSEC
DANE and Application Uses of DNSSECDANE and Application Uses of DNSSEC
DANE and Application Uses of DNSSECShumon Huque
 
"Into the Fog The Return of ICEFOG APT" - Chi en (Ashley) Shen
"Into the Fog The Return of ICEFOG APT" - Chi en (Ashley) Shen"Into the Fog The Return of ICEFOG APT" - Chi en (Ashley) Shen
"Into the Fog The Return of ICEFOG APT" - Chi en (Ashley) ShenPROIDEA
 
CNIT 124: Ch 5: Information Gathering
CNIT 124: Ch 5: Information GatheringCNIT 124: Ch 5: Information Gathering
CNIT 124: Ch 5: Information GatheringSam Bowne
 
Offensive Python for Pentesting
Offensive Python for PentestingOffensive Python for Pentesting
Offensive Python for PentestingMike Felch
 
Carlos García - Pentesting Active Directory Forests [rooted2019]
Carlos García - Pentesting Active Directory Forests [rooted2019]Carlos García - Pentesting Active Directory Forests [rooted2019]
Carlos García - Pentesting Active Directory Forests [rooted2019]RootedCON
 
Pentesting Tips: Beyond Automated Testing
Pentesting Tips: Beyond Automated TestingPentesting Tips: Beyond Automated Testing
Pentesting Tips: Beyond Automated TestingAndrew McNicol
 

What's hot (20)

Using Algorithms to Brute Force Algorithms...A Journey Through Time and Names...
Using Algorithms to Brute Force Algorithms...A Journey Through Time and Names...Using Algorithms to Brute Force Algorithms...A Journey Through Time and Names...
Using Algorithms to Brute Force Algorithms...A Journey Through Time and Names...
 
Black hat usa_2015-bypass_surgery-6_aug2015
Black hat usa_2015-bypass_surgery-6_aug2015Black hat usa_2015-bypass_surgery-6_aug2015
Black hat usa_2015-bypass_surgery-6_aug2015
 
Internal Pentest: from z3r0 to h3r0
Internal Pentest: from z3r0 to h3r0Internal Pentest: from z3r0 to h3r0
Internal Pentest: from z3r0 to h3r0
 
BlueHat v17 || 28 Registrations Later: Measuring the Exploitation of Residual...
BlueHat v17 || 28 Registrations Later: Measuring the Exploitation of Residual...BlueHat v17 || 28 Registrations Later: Measuring the Exploitation of Residual...
BlueHat v17 || 28 Registrations Later: Measuring the Exploitation of Residual...
 
My Bro The ELK
My Bro The ELKMy Bro The ELK
My Bro The ELK
 
Jon Gorenflo - Burp Collaborator
Jon Gorenflo - Burp CollaboratorJon Gorenflo - Burp Collaborator
Jon Gorenflo - Burp Collaborator
 
An Introduction to DANE - Securing TLS using DNSSEC
An Introduction to DANE - Securing TLS using DNSSECAn Introduction to DANE - Securing TLS using DNSSEC
An Introduction to DANE - Securing TLS using DNSSEC
 
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
 
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
 
External service interaction
External service interactionExternal service interaction
External service interaction
 
2nd ICANN APAC-TWNIC Engagement Forum: Why RPKI Matters
2nd ICANN APAC-TWNIC Engagement Forum: Why RPKI Matters2nd ICANN APAC-TWNIC Engagement Forum: Why RPKI Matters
2nd ICANN APAC-TWNIC Engagement Forum: Why RPKI Matters
 
getdns PyCon presentation
getdns PyCon presentationgetdns PyCon presentation
getdns PyCon presentation
 
Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016
 
BlueHat v17 || TLS 1.3 - Full speed ahead... mind the warnings - the great, t...
BlueHat v17 || TLS 1.3 - Full speed ahead... mind the warnings - the great, t...BlueHat v17 || TLS 1.3 - Full speed ahead... mind the warnings - the great, t...
BlueHat v17 || TLS 1.3 - Full speed ahead... mind the warnings - the great, t...
 
DANE and Application Uses of DNSSEC
DANE and Application Uses of DNSSECDANE and Application Uses of DNSSEC
DANE and Application Uses of DNSSEC
 
"Into the Fog The Return of ICEFOG APT" - Chi en (Ashley) Shen
"Into the Fog The Return of ICEFOG APT" - Chi en (Ashley) Shen"Into the Fog The Return of ICEFOG APT" - Chi en (Ashley) Shen
"Into the Fog The Return of ICEFOG APT" - Chi en (Ashley) Shen
 
CNIT 124: Ch 5: Information Gathering
CNIT 124: Ch 5: Information GatheringCNIT 124: Ch 5: Information Gathering
CNIT 124: Ch 5: Information Gathering
 
Offensive Python for Pentesting
Offensive Python for PentestingOffensive Python for Pentesting
Offensive Python for Pentesting
 
Carlos García - Pentesting Active Directory Forests [rooted2019]
Carlos García - Pentesting Active Directory Forests [rooted2019]Carlos García - Pentesting Active Directory Forests [rooted2019]
Carlos García - Pentesting Active Directory Forests [rooted2019]
 
Pentesting Tips: Beyond Automated Testing
Pentesting Tips: Beyond Automated TestingPentesting Tips: Beyond Automated Testing
Pentesting Tips: Beyond Automated Testing
 

Viewers also liked

Detecting Malicious Websites using Machine Learning
Detecting Malicious Websites using Machine LearningDetecting Malicious Websites using Machine Learning
Detecting Malicious Websites using Machine LearningAndrew Beard
 
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015 Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015 lokeshpidawekar
 
Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3William Lee
 
Wireless Investigations using Xplico
Wireless Investigations using XplicoWireless Investigations using Xplico
Wireless Investigations using XplicoChris Harrington
 
Giga vue hb1 event rolling presentation-final-1
Giga vue hb1 event rolling presentation-final-1Giga vue hb1 event rolling presentation-final-1
Giga vue hb1 event rolling presentation-final-1Christopher Lee
 
Security Onion: peeling back the layers of your network in minutes
Security Onion: peeling back the layers of your network in minutesSecurity Onion: peeling back the layers of your network in minutes
Security Onion: peeling back the layers of your network in minutesbsidesaugusta
 
Как сдать IELTS на 8.5?
Как сдать IELTS на 8.5?Как сдать IELTS на 8.5?
Как сдать IELTS на 8.5?MBA Consult
 
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
 
Gigamon 1Q15 Investor Relations Presentation
Gigamon 1Q15 Investor Relations PresentationGigamon 1Q15 Investor Relations Presentation
Gigamon 1Q15 Investor Relations PresentationInvestorRelations
 
Optimizing your google local listing for search
Optimizing your google local listing for searchOptimizing your google local listing for search
Optimizing your google local listing for searchWebFX
 
DEF CON 23 - NSM 101 for ICS
DEF CON 23 - NSM 101 for ICSDEF CON 23 - NSM 101 for ICS
DEF CON 23 - NSM 101 for ICSChris Sistrunk
 
Visibility and Automation for Enhanced Security
Visibility and Automation for Enhanced SecurityVisibility and Automation for Enhanced Security
Visibility and Automation for Enhanced Securitypatmisasi
 
Data Mining and Intrusion Detection
Data Mining and Intrusion Detection Data Mining and Intrusion Detection
Data Mining and Intrusion Detection amiable_indian
 
Harnessing the Power of Metadata for Security
Harnessing the Power of Metadata for SecurityHarnessing the Power of Metadata for Security
Harnessing the Power of Metadata for SecurityJohn Pollack
 
5 Easy Ways to Improve Cohesion in IELTS Writing Task 2
5 Easy Ways to Improve Cohesion in IELTS Writing Task 2 5 Easy Ways to Improve Cohesion in IELTS Writing Task 2
5 Easy Ways to Improve Cohesion in IELTS Writing Task 2 Ben Worthington
 
IELTS Writing Common Grammar Mistakes
IELTS Writing Common Grammar MistakesIELTS Writing Common Grammar Mistakes
IELTS Writing Common Grammar MistakesJROOZ Review Center
 

Viewers also liked (18)

Detecting Malicious Websites using Machine Learning
Detecting Malicious Websites using Machine LearningDetecting Malicious Websites using Machine Learning
Detecting Malicious Websites using Machine Learning
 
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015 Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
 
Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3
 
Wireless Investigations using Xplico
Wireless Investigations using XplicoWireless Investigations using Xplico
Wireless Investigations using Xplico
 
Giga vue hb1 event rolling presentation-final-1
Giga vue hb1 event rolling presentation-final-1Giga vue hb1 event rolling presentation-final-1
Giga vue hb1 event rolling presentation-final-1
 
Eyeing the Onion
Eyeing the OnionEyeing the Onion
Eyeing the Onion
 
Security Onion: peeling back the layers of your network in minutes
Security Onion: peeling back the layers of your network in minutesSecurity Onion: peeling back the layers of your network in minutes
Security Onion: peeling back the layers of your network in minutes
 
Как сдать IELTS на 8.5?
Как сдать IELTS на 8.5?Как сдать IELTS на 8.5?
Как сдать IELTS на 8.5?
 
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
 
Gigamon 1Q15 Investor Relations Presentation
Gigamon 1Q15 Investor Relations PresentationGigamon 1Q15 Investor Relations Presentation
Gigamon 1Q15 Investor Relations Presentation
 
Optimizing your google local listing for search
Optimizing your google local listing for searchOptimizing your google local listing for search
Optimizing your google local listing for search
 
DEF CON 23 - NSM 101 for ICS
DEF CON 23 - NSM 101 for ICSDEF CON 23 - NSM 101 for ICS
DEF CON 23 - NSM 101 for ICS
 
Visibility and Automation for Enhanced Security
Visibility and Automation for Enhanced SecurityVisibility and Automation for Enhanced Security
Visibility and Automation for Enhanced Security
 
Snort IDS/IPS Basics
Snort IDS/IPS BasicsSnort IDS/IPS Basics
Snort IDS/IPS Basics
 
Data Mining and Intrusion Detection
Data Mining and Intrusion Detection Data Mining and Intrusion Detection
Data Mining and Intrusion Detection
 
Harnessing the Power of Metadata for Security
Harnessing the Power of Metadata for SecurityHarnessing the Power of Metadata for Security
Harnessing the Power of Metadata for Security
 
5 Easy Ways to Improve Cohesion in IELTS Writing Task 2
5 Easy Ways to Improve Cohesion in IELTS Writing Task 2 5 Easy Ways to Improve Cohesion in IELTS Writing Task 2
5 Easy Ways to Improve Cohesion in IELTS Writing Task 2
 
IELTS Writing Common Grammar Mistakes
IELTS Writing Common Grammar MistakesIELTS Writing Common Grammar Mistakes
IELTS Writing Common Grammar Mistakes
 

Similar to Detecting Malicious SSL Certificates Using Bro

NotaCon 2011 - Networking for Pentesters
NotaCon 2011 - Networking for PentestersNotaCon 2011 - Networking for Pentesters
NotaCon 2011 - Networking for PentestersRob Fuller
 
Public Key Infrastructures
Public Key InfrastructuresPublic Key Infrastructures
Public Key InfrastructuresZefren Edior
 
Geek Sync | Taking Control of Your Organization’s SQL Server Sprawl
Geek Sync | Taking Control of Your Organization’s SQL Server SprawlGeek Sync | Taking Control of Your Organization’s SQL Server Sprawl
Geek Sync | Taking Control of Your Organization’s SQL Server SprawlIDERA Software
 
RIPE 84: Revocation
RIPE 84: RevocationRIPE 84: Revocation
RIPE 84: RevocationAPNIC
 
SSL: Past, Present and Future
SSL: Past, Present and FutureSSL: Past, Present and Future
SSL: Past, Present and FutureTiago Mendo
 
SSL: Past, Present and Future
SSL: Past, Present and FutureSSL: Past, Present and Future
SSL: Past, Present and FutureLuis Grangeia
 
Heartbleed Bug Vulnerability: Discovery, Impact and Solution
Heartbleed Bug Vulnerability: Discovery, Impact and SolutionHeartbleed Bug Vulnerability: Discovery, Impact and Solution
Heartbleed Bug Vulnerability: Discovery, Impact and SolutionCASCouncil
 
OSINT for Attack and Defense
OSINT for Attack and DefenseOSINT for Attack and Defense
OSINT for Attack and DefenseAndrew McNicol
 
apidays LIVE Australia 2021 - Levelling up database security by thinking in A...
apidays LIVE Australia 2021 - Levelling up database security by thinking in A...apidays LIVE Australia 2021 - Levelling up database security by thinking in A...
apidays LIVE Australia 2021 - Levelling up database security by thinking in A...apidays
 
BSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysBSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysJoff Thyer
 
CNIT 152 11 Analysis Methodology
CNIT 152 11 Analysis MethodologyCNIT 152 11 Analysis Methodology
CNIT 152 11 Analysis MethodologySam Bowne
 
Killing Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORMKilling Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORMOrtus Solutions, Corp
 
DEF CON 23 - BRENT - white hacking web apps wp
DEF CON 23 - BRENT - white hacking web apps wpDEF CON 23 - BRENT - white hacking web apps wp
DEF CON 23 - BRENT - white hacking web apps wpFelipe Prado
 
SSL Certificate Extension for BMC Discovery
SSL Certificate Extension for BMC DiscoverySSL Certificate Extension for BMC Discovery
SSL Certificate Extension for BMC DiscoveryWes Moskal-Fitzpatrick
 
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald BelchamGetting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham.NET Conf UY
 
Cryptography
CryptographyCryptography
CryptographyPPT4U
 
Fuzzing and You: Automating Whitebox Testing
Fuzzing and You: Automating Whitebox TestingFuzzing and You: Automating Whitebox Testing
Fuzzing and You: Automating Whitebox TestingNetSPI
 
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malwareDefcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malwareDaveEdwards12
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis MethodologySam Bowne
 

Similar to Detecting Malicious SSL Certificates Using Bro (20)

NotaCon 2011 - Networking for Pentesters
NotaCon 2011 - Networking for PentestersNotaCon 2011 - Networking for Pentesters
NotaCon 2011 - Networking for Pentesters
 
Public Key Infrastructures
Public Key InfrastructuresPublic Key Infrastructures
Public Key Infrastructures
 
Geek Sync | Taking Control of Your Organization’s SQL Server Sprawl
Geek Sync | Taking Control of Your Organization’s SQL Server SprawlGeek Sync | Taking Control of Your Organization’s SQL Server Sprawl
Geek Sync | Taking Control of Your Organization’s SQL Server Sprawl
 
RIPE 84: Revocation
RIPE 84: RevocationRIPE 84: Revocation
RIPE 84: Revocation
 
SSL: Past, Present and Future
SSL: Past, Present and FutureSSL: Past, Present and Future
SSL: Past, Present and Future
 
SSL: Past, Present and Future
SSL: Past, Present and FutureSSL: Past, Present and Future
SSL: Past, Present and Future
 
Heartbleed Bug Vulnerability: Discovery, Impact and Solution
Heartbleed Bug Vulnerability: Discovery, Impact and SolutionHeartbleed Bug Vulnerability: Discovery, Impact and Solution
Heartbleed Bug Vulnerability: Discovery, Impact and Solution
 
OSINT for Attack and Defense
OSINT for Attack and DefenseOSINT for Attack and Defense
OSINT for Attack and Defense
 
apidays LIVE Australia 2021 - Levelling up database security by thinking in A...
apidays LIVE Australia 2021 - Levelling up database security by thinking in A...apidays LIVE Australia 2021 - Levelling up database security by thinking in A...
apidays LIVE Australia 2021 - Levelling up database security by thinking in A...
 
BSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysBSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad Guys
 
CNIT 152 11 Analysis Methodology
CNIT 152 11 Analysis MethodologyCNIT 152 11 Analysis Methodology
CNIT 152 11 Analysis Methodology
 
Killing Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORMKilling Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORM
 
Voldemort Nosql
Voldemort NosqlVoldemort Nosql
Voldemort Nosql
 
DEF CON 23 - BRENT - white hacking web apps wp
DEF CON 23 - BRENT - white hacking web apps wpDEF CON 23 - BRENT - white hacking web apps wp
DEF CON 23 - BRENT - white hacking web apps wp
 
SSL Certificate Extension for BMC Discovery
SSL Certificate Extension for BMC DiscoverySSL Certificate Extension for BMC Discovery
SSL Certificate Extension for BMC Discovery
 
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald BelchamGetting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
 
Cryptography
CryptographyCryptography
Cryptography
 
Fuzzing and You: Automating Whitebox Testing
Fuzzing and You: Automating Whitebox TestingFuzzing and You: Automating Whitebox Testing
Fuzzing and You: Automating Whitebox Testing
 
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malwareDefcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis Methodology
 

Recently uploaded

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Recently uploaded (20)

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

Detecting Malicious SSL Certificates Using Bro

  • 1. Detecting Malicious SSL Certificates Using Bro Andrew Beard Ajit Thyagarajan
  • 2. Motivation • SSL traffic is increasing and so is malicious usage!
  • 3. Motivation • SSL traffic is increasing and so is malicious usage! • Content visibility of SSL traffic is becoming increasingly harder
  • 4. Motivation • SSL traffic is increasing and so is malicious usage! • Content visibility of SSL traffic is becoming increasingly harder • BSides Charm talk – Using Bro IDS to Detect X509 Anomalies by Will Glodek
  • 5. Direct application of cert feeds • Well known SSL cert blacklist, SSLBL by abuse.ch • Identifies certificates via hash (SHA1) • Averages about 10 new entries per week • Relatively high efficacy
  • 6. David Bianco’s Pyramid Triangle of Pain • Reflects the pain you cause to an adversary • Generating new certificates (even signed ones) causes little pain
  • 7. Using cert feeds and Bro to greater effect • Use the feeds as a starting point to gather and label data • Analyze metadata from known bad certificates as a training set • Treat other certs resulting from other feeds as maybes • Try to find patterns in the metadata we can use to match as many known bad and maybes as possible, verify against known (or at least, heavily biased) good traffic
  • 8. Why Bro? • Content awareness • Ability to apply patterns to live network traffic • Symmetry on the front and the back end
  • 9. I don’t have a supercomputer • I have a 7 year old Dell workstation my wife’s IT department was throwing out • Nothing here would be remotely considered HPC
  • 10. Generating training sets • Visit every potentially malicious site you can possibly find • OSINT feeds are great for this • Don’t have a lot of context (if any) • Look for certificates that match our known bad ones • “Everything else” creates a data set that isn’t totally trustworthy, use for testing
  • 12. Problems with generating data sets • Expect a low response rate • Sites get taken down, not HTTPS port 443, don’t serve anything out, unregistered DGAs, etc • Less than 1 in 5000 respond (with no guarantee those responses are actually bad) • Number that match on the SSLBL is even worse, and that’s biased • Based entirely on what’s already labeled as bad
  • 13. x509.log Fields • ts • id • version • serial • subject • issuer • not_valid_before • not_valid_after • key_alg • sig_alg • key_type • key_length • exponent • curve • san.dns • san.uri • san.email • san.ip • basic_constraints.ca • basic_constraints.path_len
  • 14. Subjects and Issuers • CN=nycards2016.com,OU=PositiveSSL,OU=Domain Control Validated • emailAddress=ha@163.com,CN=gjf,OU=comba,O=comba,L=guang zhou,ST=china,C=CN • CN=A_LifeSize_System,C=US,ST=Texas,L=Austin,emailAddres s=hostmaster@lifesize.com,OU=IT,O=LifeSize Communications, Inc. • CN=Symantec Class 3 Secure Server CA - G4,OU=Symantec Trust Network,O=Symantec Corporation,C=US • OU=Test,O=Peersec Networks,L=Bellevue,ST=WA,C=US,CN=MatrixSSL Sample Server CA
  • 15. Splitting the Attributes • Subject and Issuer are the string representations of multiple Attribute Value Assertions (AVAs) • Hard to compare them as big strings, but a lot more commonality once you split them up • Not hard to parse out each attribute using something like Splunk or Kiabana, but it makes matching on those fields harder later • Split the fields into a new Bro log based on x509.log (x509_extended.log)
  • 16. Many attributes, but we’re just using a subset • C Country • CN Common Name (Site identifier) • L Locality (City) • O Organization • OU Organizational Unit • ST State (or Province) • emailAddress • unstructuredName • serialNumber
  • 17. x509_extended type Info: record { fuid: string &log; sha1: string &log; subject_c: string &log &optional; subject_cn: string &log &optional; subject_l: string &log &optional; subject_o: string &log &optional; subject_ou: string &log &optional; subject_st: string &log &optional; subject_email: string &log &optional; subject_unstruct: string &log &optional; subject_serial: string &log &optional; issuer_c: string &log &optional; … }
  • 18. Need a prototyping system • Wanted to gather data, then test patterns on the same data sets over and over • Could do this with Bro directly, but you don’t really need to reprocess the packets and sessions over and over again • Process traffic into Bro logs, evaluate via Splunk or SQL • May want to apply new certificate feeds to existing logs outside of Bro
  • 19. Analysis • Look at data in $VISUALIZATION • Clustering -> Pattern Synthesis • Check for hits in the bad table • Check for hits in the unknown table • Confirm against a known good set
  • 21. Default Values C ST O emailAddress AU Some-State Internet Widgits Pty Ltd - AU Some-State Internet Widgits Pty Ltd chmod 0600 /etc/nginx/ssl/server.key AU Some-State Internet Widgits Pty Ltd -
  • 22. openssl Command Defaults You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]: State or Province Name (full name) [Some-State]: Locality Name (eg, city) []: Organization Name (eg, company) [Internet Widgits Pty Ltd]: Organizational Unit Name (eg, section) []: Common Name (e.g. server FQDN or YOUR name) []: Email Address []:
  • 23. Is it actionable? • Very strong correlation between sites that were hosting malware or control nodes, though • Gozi, Gootkit, Shifu, others have all been identified running from servers with “Internet Widgits Pty Ltd” certificates • Non-malicious sites mostly default server pages and sites under development • A user visiting a site outside the network could be considered anomalous • Default Company Ltd, Default City, also used by some OpenSSL distributions
  • 24. Copypasta sha1 O L ST 1147947433f261bcd2cd8f508461e01898c3960b Dis Springfield Denial f2a61975cb541e6a62ed8ca5214020108d922a14 Dis Springfield Denial 368e6beb6f8d2f6049831fe25dd397287823c5e6 Dis Springfield Denial a9650a4522140d42e5ca4529da54805625eebe64 Dis Springfield Denial • 4 cert feed matches in our original sample set • SSLBL lists all four as TorrentLocker C2 servers • 14 others were found with the same ST, L, and O fields (and other fields not present) • 5 of those have shown up in the SSLBL feed since • So far ALL TorrentLocker C2 servers seem to use the same pattern
  • 25. Where did it come from?
  • 26. “Random” Values C CN L O ST CN TJMauph2wkefdglVFzqmyEvM 3KLyyRWQF0IRfH91yu5frdLX rfUvM2rqVg1P8IpFP2mJbEjD ST CN RJHeFQ9nCz69k5RNTTLmVCIf gBEUDkp44OE7ihODZD4VbdDv oLsGPV9bx43NaNg1ZjOqIGfJ ST CN Hcoc6tfYqmEXPnDtwJ39vBFg N9El3p9XpqOBDcqUQxKCbw5V OJ2vl3Vz2Tn0skdsUsLUMwFz ST CN X5WBo9o5AqvtVGGAVyBiNgwO wHMhVyFMNPcbdG84Q8gKcijH 8V3jDPLZIGdNoOmKQ42ZmhlE ST CN rQ9YqiO7S1pgULTmD3nNahn7 OBfmruLgjF88LKyg0fVHqRzU zs3L7avZO3gDESogMpf4HBxj ST • Fixed C and ST values, and exactly 24 character in the CN, L, and O fields • Over 27 matches for the same pattern in the “maybe” set • All C2 nodes from the same malware family
  • 27. Applying Patterns to Bro • Wrote collection of bro scripts that load the x509_extended module • Hooks into an event after subject and issuer subfields have been parsed out • Logs to notice.log
  • 28. Triangle of Pain, Revisited
  • 29. Recap • Bro makes it easy to extract certificate metadata • Using OSINT and Bro you can easily collect large sets of data on bad and suspect certificates • Patterns in the certificate metadata can yield higher-value information than the feeds alone • Hard to definitively say something is malicious with no context, but you can get to a high level of confidence • Since Bro can operate a line speed, it can be used to match against those patterns with live traffic
  • 30. Future • Better ways of applying patterns in Bro (less hardcoding into scripts) • Certificate analysis has potential for uncovering a lot more patterns • Better automatic clustering • BSides DC talk focusing on clustering and analysis (Oct 22, '16) • Continuing to enhance our collection of good/bad certs • Looking for collaborators - let us know if you are interested...
  • 31. Thanks to: • Abuse.ch • John Bambenek and Bambenek Consulting • AlienVault and numerous OTX contributors • Ravi Pandey from University of Maryland

Editor's Notes

  1. Hello folks, My name is Ajit Thyagarajan and this is my colleague, Andrew Beard.  We are both from Atomic Mole, a small startup developing a security solution for the mid-market. Before we dive into the guts of this presentation, I thought it would be worthwhile to tell you how we got interested in this work.
  2. The statistics are out there.  SSL traffic is on the increase (courtesy Dell).   Expected growth is 20% each year and not surprisingly only a very small percentage of this traffic is analyzed. According to Dell, there was a sharp increase in SSL/TLS encryption through 2015. In the fourth quarter of 2015 nearly 65 percent of all web connections that Dell observed were encrypted, leading to a lot more under-the-radar attacks, according to the company. Gartner has predicted that 50 percent of all network attacks will take advantage of SSL/TLS by 2017.
  3. Another interesting statistic is that it is becoming harder and harder to inspect SSL traffic content.  First you need a man-in-the-middle device and then you have to figure out how to manage certificates.  In addition, Certificate pinning and use of complex ciphers make decryption of content even more challenging. A lot of organizations also just do not decrypt SSL traffic due to legal concerns and infringement of privacy for users . [Ref: https://securityevaluators.com/knowledge/case_studies/mutual/] So, all of this points to a need for new innovative ways to analyze SSL traffic for maliciousness without decrypting the content by looking for other clues.
  4. So, Andrew and I both attended BSides Baltimore and there was a talk there about detecting anomalies in x.509 certs using bro. Since our security solution uses Bro for network traffic analysis, we figured that it would be a great feature to explore.  So, we listen and it turns out that the main hypothesis of that talk was around the certificate creation time.  The author had hypothesized that if the certificate creation time was some random value like 10am, then there was a high probability of it being malicious mainly because most of the good certs apparently had the creation time as midnight.  Well, that didn't make any sense to us and we decided to really look into this further. Turns out that the default value for creation time (its an optional field during cert creation) is 0, so thats why a lot of the values were showing up as 12:00am.  That validated our theory that the creation time probably didn't have much to do with the maliciousness of a cert. But we left with a burning question - so what attributes could potentially indicate maliciousness (if any) and we thought that there were definitely some attributes that were more likely than not which might be indicative of maliciousness.  We also had to sort of think like a hacker and try and see how and what they might do to get certs as compared to a legitimate organization. In the BSides talk, the author had used 2K good certs and a "handful" of bad certs.  Not sure if this was a good training set in the first place.  So, we decided to go all out with much higher fidelity .  We needed a setup that would pull a very large number of good and bad certs and analyze the heck out of them. One thing I did want to point out is that when our abstract was accepted, we got some great feedback from the reviewers (kudos to them - wish more conferences gave that kind of feedback).  They mentioned that since this was a Bro conference, it would be beneficial to focus more on the Bro aspect of things, so thats  what we did.
  5. Talk a little bit about certificate feeds, as these become very important to information gathering process as you’ll see in a moment Mostly commodity C2 servers, Dridex, Dyre, TorrentLocker, etc 10/week excludes Dyre High efficacy -> Ground truth
  6. Pain on adversary by denying them access to X Not just for self-signed certs anymore. Mention the rise of Let’s Encrypt and other no-cost ways of getting legit certificates. As a network defender, I want to cause pain. How do we cause pain? Identify adversary's process and tools Make them identify and change things that take time and effort
  7. We can do better, enriching feed data and processing results Not just cert feeds, but they’re my confirmed bads What do I mean by resulting from? Refer to next side
  8. Could have scripted something with curl, openssl, and a lot of parsing Combine Bro for research and monitoring after the fact Talk about feedback loop, bro -> pattern generating process -> back into bro
  9. Tours of my datacenter usually begin with someone asking “What’s making that noise?”
  10. All x509 certificates end up in files table with sha1s By isn’t totally trustworthy, I mean we don’t for use it’s malicious. Things move, takedown pages, etc
  11. Response rate on the order of most telemarketers This is a funnel, start wide, end up with few final results. Match rate is biased because our feeds include other Abuse.ch feeds, so there’s a better chance than looking at other sources
  12. Mention Bsides Charm talk concentrated on not_valid_after and not_valid_before Not scalar, categorical
  13. Ran into problems with initial analysis, not a lot of commonality. There is structure here. Separate attributes with key and value pairs
  14. Yes, we’ll make it a package
  15. ALL optional
  16. Last point, feeds change. I’ve already processed the data, tell me given what I know know about the things that happened then
  17. Look at data -> common elements. Values that recur. Every single attribute you have, sort by count Start with a bad record, spider out of other similar records Next steps -> automation. Still working on getting good results there. Known good, baseline set of traffic you trust. With a lot number of results it’s always the possibility that your “known good” traffic isn’t that good, so review to be sure.
  18. The email address part didn’t make a lot of sense until we tried generating a certificate with the openssl command
  19. Alex Kirk blog post talking about Snort signature, Talos Netresec, post on https reverse tunnel Note about the email address going off the end of the command. Probably not an automated system. Also saw results for Default Company Ltd, some versions of openssl use this by default instead
  20. These aren’t malicious, but there’s a higher proibability of something bad going on
  21. Not all patterns are in the values themselves, some are in the form Difficult to do via automated analysis Entropy calculation on text would probably show very high value
  22. What’s the best way to do these? Not really part of intel framework as I understand it.
  23. Longer shelf life. Issuing new certs part of brining up new domains, but if the patterns don’t change puts you a step ahead.
  24. Try to piece together why. Easy to create patterns that are coincidental.
  25. Special thanks to Ravi Pandey, one of our summer interns from UMD, who spent a fair bit of time with the certificates applying trying various ML algorithms on multiple versions of our dataset.