Top Banner
What Will You Investigate Today? InfoSecurity.nl 11/2013 - Xavier Mertens
43

What are-you-investigate-today? (version 2.0)

May 26, 2015

Download

Technology

Xavier Mertens

Here is an updated version of the presentation I made at the RMLL in July 2013. This talk have been giving at InfoSecurity.nl in October 2013.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: What are-you-investigate-today? (version 2.0)

What Will You Investigate Today?

InfoSecurity.nl 11/2013 - Xavier Mertens

Page 2: What are-you-investigate-today? (version 2.0)

TrueSec

$ whoami

• Xavier Mertens (@xme)

!

• Consultant @ day

!

• Blogger @ night

!

• BruCON co-organizer���2

Page 3: What are-you-investigate-today? (version 2.0)

TrueSec

$ cat disclaimer.txt

“The opinions expressed in this presentation are those of the speaker and do not necessarily reflect those of past, present employers, partners or customers.”

���3

Page 4: What are-you-investigate-today? (version 2.0)

TrueSec

Agenda

• Introduction

• Interesting protocols

• Public resources

• Toolbox

���4

Page 5: What are-you-investigate-today? (version 2.0)

TrueSec

Feeling This?

���5

Page 6: What are-you-investigate-today? (version 2.0)

TrueSec

Or This?

���6

Page 7: What are-you-investigate-today? (version 2.0)

TrueSec

Me? Breached?

���7

• In 66% of investigated incidents, detection was a matter of months or even more

• 69% of data breaches are discovered by third parties

(Source: Verizon DBIR 2012)

Page 8: What are-you-investigate-today? (version 2.0)

TrueSec

“Grepping” for Gold

���8

• Tracking users

• Suspicious traffic

• Out-of-business

• Compliance

• Exfiltration

• “Below the radar”

Page 9: What are-you-investigate-today? (version 2.0)

TrueSec

Sources

���9

• OS / Applications Events

• Network protection(FW, ID(P)S, Proxies, etc)

• Users Credentials

• IP, Domains, URLs

• Filenames, Database rows

• Hashes (MD5, SHA1)

• Metadata

Page 10: What are-you-investigate-today? (version 2.0)

TrueSec

IOC

���10

“In computer forensics, an Indicator of Compromise is an artefact observed on a network or in operating system that with high confidence indicates a computer intrusion.”

(Source: wikipedia.org)

Page 11: What are-you-investigate-today? (version 2.0)

TrueSec

Multiple Sources

• Automatic (logfiles, events)

• Online repositories

• Internal resources

• Developers!

���11

Page 12: What are-you-investigate-today? (version 2.0)

TrueSec

Classification

���12

• Tag your events with “classification” info

• Help you to build better detection schemes

attack, reconnaissance, scan, auth_success, auth_fail, firewall_allow, firewall_drop, etc

info, warning, error, critical, emergency

Page 13: What are-you-investigate-today? (version 2.0)

TrueSec

“Active” Lists

���13

• Temporary or suspicious information to track and dynamically updated

• Examples: Contractors, Admins, Terminated Accounts, Countries (GeoIP)

• If grep(/$USER/, @ADMINS) { ... }

Page 14: What are-you-investigate-today? (version 2.0)

TrueSec

Correlation

���14

YourRecipes

Evidences

Page 15: What are-you-investigate-today? (version 2.0)

TrueSec

Visibility!

���15

Page 16: What are-you-investigate-today? (version 2.0)

TrueSec

Agenda

• Introduction

• Interesting protocols

• Public resources

• Toolbox

���16

Page 17: What are-you-investigate-today? (version 2.0)

TrueSec

Golden Rule

���17

“Anything unknown must be considered as suspicious”

Page 18: What are-you-investigate-today? (version 2.0)

TrueSec

DNS• No DNS, no Internet!

• Can help to detect data exfiltration, communications with C&C (malwares)

• Alert on any traffic to untrusted DNS

• Allow only local DNS as resolvers

• Investigate for suspicious domains

• Track suspicious requests (TXT)

���18

Page 19: What are-you-investigate-today? (version 2.0)

TrueSec

HTTP• HTTP is the new TCP

• Investigate for suspicious domains

• Inspect HTTPS (Check with your legal dept before playing MitM!)

• Search for interesting hashes

���19

Page 20: What are-you-investigate-today? (version 2.0)

TrueSec

SMTP

• Because it remains the 1st infection path!

• Track outgoing emails

• Investigate for suspicious domains

���20

Page 21: What are-you-investigate-today? (version 2.0)

TrueSec

Netflow

• Analyze network flows

• Src Port

• Src IP

• Dst Port

• Dst IP

• Timestamp

���21

Page 22: What are-you-investigate-today? (version 2.0)

TrueSec

Agenda

• Introduction

• Interesting protocols

• Public resources

• Toolbox

���22

Page 23: What are-you-investigate-today? (version 2.0)

TrueSec

IP Addresses

• http://www.malwaredomainlist.com/hostslist/ip.txt

• Correlate your firewall logs

• GeoIP

���23

Page 24: What are-you-investigate-today? (version 2.0)

TrueSec

IP Addresses

• http://dshield.org

• http://zeustracker.abuse.ch/blocklist.php

• http://www.nothing.org/honeypots.php

���24

Page 25: What are-you-investigate-today? (version 2.0)

TrueSec

Domains

• DNS-BH (malwaredomains.com) http://mirror1.malwaredomains.com/files/domains.txthttp://mirror1.malwaredomains.com/files/spywaredomains.zoneshttp://www.malwaredomainlist.com/hostslist/hosts.txt

• spam404bl.com/blacklist.txt

• Correlate your resolver logs

���25

Page 26: What are-you-investigate-today? (version 2.0)

TrueSec

URLs• http://malwareurls.joxeankoret.com/

normal.txt

• http://hosts-file.net/

• http://www.malware.com.br/

• http://malc0de.com/bl/

• http://scumware.com

���26

Page 27: What are-you-investigate-today? (version 2.0)

TrueSec

Hashes

• http://malware.lu

• http://virustotal.com

• http://www.malwr.com

���27

Page 28: What are-you-investigate-today? (version 2.0)

TrueSec

$ cat disclaimer2.txt

���28

“Data are provided for ‘free’ but the right to us can be restricted to specific conditions (ex: cannot be re-used for commercial applications). Always read carefull the terms of use. Some services require prior registration and use of APIs”

Page 29: What are-you-investigate-today? (version 2.0)

TrueSec

OSINT“Set of techniques to conduct regular reviews and/or continuous monitoring over multiple sources, including search engines, social networks, blogs, comments, underground forums, blacklists/whitelistsand so on. “

���29

Page 30: What are-you-investigate-today? (version 2.0)

TrueSec

OSINT

���30

• Think “out of the box”!

• What identify you on the Internet?

• Domain names

• IP addresses

• Brand

• Monitor them!

Page 31: What are-you-investigate-today? (version 2.0)

TrueSec

Agenda

• Introduction

• Interesting protocols

• Public resources

• Toolbox

���31

Page 32: What are-you-investigate-today? (version 2.0)

TrueSec

OpenIOC• Open framework

• Sharing threatintelligence

• XML based

���32

Page 33: What are-you-investigate-today? (version 2.0)

TrueSec

URLs

• Google SafeBrowsing

use Net::Google::SafeBrowsing2; use Net::Google::SafeBrowsing2:::Sqlite; my gsb = Net::Google::SafeBrowsing2->new( key => “xxx”, storage => Net::Google::SafeBrowsing2::Sqlite->new(file => “google.db”) ); $gsb->update(); my $match = $gsb->lookup(url => “http://evil.com”); if ($match eq MALWARE) { ... }

���33

Page 34: What are-you-investigate-today? (version 2.0)

TrueSec

Hashes• http://blog.didierstevens.com/2013/05/03/

virustotal-searching-and-submitting/

• Example from Python:

>> import virustotal >> api = virustotal.VirusTotalAPI("MYAPIKEY") >> print api.get_file_report(resource="99017f6eebbac24f351415dd410d522d") {"report": ["2010-04-13 23:28:27", {"nProtect": "", "CAT-QuickHeal": "", "McAfee": "Generic.dx!rkx", "TheHacker": "Trojan/VB.gen", "VirusBuster": "", "NOD32": "a variant of Win32/Qhost.NTY", "F-Prot": "", "Symantec": "", "Norman": "", "a-squared": "Trojan.Win32.VB!IK", ...}], "permalink": "http://www.virustotal.com/file-scan/report.html?id=a8...", "result": 1}

���34

Page 35: What are-you-investigate-today? (version 2.0)

TrueSec

IP Reputation

• http://isc.sans.edu/api/ip/50.46.90.187

• Example received in XML:<ip> <number>50.46.90.187</number> <count>186</count> <attacks>27</attacks> <maxdate>2013-10-26</maxdate> <mindate>2013-08-30</mindate> <updated>2013-10-27 04:34:04</updated> <country></country> <as>5650</as> <asname> FRONTIER-FRTR - Frontier Communications of America, Inc. </asname> <network>50.32.0.0/12</network> <comment/> </ip>

���35

Page 36: What are-you-investigate-today? (version 2.0)

TrueSec

pastebin.com• A gold mine for exfiltrated data!

• Interesting search:

• Logins

• Email addresses

• IPs, domains

• Tool: pastemon.pl

• https://github.com/xme/pastemon

���36

Page 37: What are-you-investigate-today? (version 2.0)

TrueSec

Data Parsers

• d3.js Javascript library

• Example of implementation: malcom (Malware Communications Analyzer)

• https://github.com/tomchop/malcom

���37

Page 38: What are-you-investigate-today? (version 2.0)

TrueSec

Data Parser

���38

Page 39: What are-you-investigate-today? (version 2.0)

TrueSec

Offline Honeypots

• Fake .conf file on the desktop

• Fake row in a SQL DB

• Track activity using yourIDS or SIEM

���39

Page 40: What are-you-investigate-today? (version 2.0)

TrueSec

The Conductor

• OSSEC

• Log Management

• Active-Response

• Powerful alerts engine

���40

Page 41: What are-you-investigate-today? (version 2.0)

TrueSec

Online Tools

• http://urlquery.net

• http://bgpranking.circl.lu/

• http://www.informatica64.com/foca.aspx

• http://virustotal.com

���41

Page 42: What are-you-investigate-today? (version 2.0)

TrueSec

Conclusions

• Know your environment

• You have plenty of useful (big)data

• Free software can help you (but the project is not free)

• To do good defensive security, know your enemy!(learn how bad guys work)

���42

Page 43: What are-you-investigate-today? (version 2.0)

TrueSec

Questions?

@xme

[email protected]

http://blog.rootshell.be

https://www.truesec.be

���43