SlideShare a Scribd company logo
Malware Analysis Free
Toolbox
RMLL - Montpellier - July 2014 - Xavier Mertens
TrueSec
$ whoami
• Xavier Mertens (@xme)	

!
• Consultant @ day	

!
• Blogger, Hacker @ night	

!
• BruCON co-organizer
2
TrueSec
$ cat ~/.profile
• I like (your) data	

• Offensive / defensive security	

• Security visualization	

• I like to play!
3
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.”
4
TrueSec
Agenda
• Introduction	

• Build your lab	

• Automate	

• Conclusions
5
TrueSec
Why This Talk?
6
TrueSec
Don’t expect this!
7
TrueSec
Today’s Facts
8
29.122.849	

unique malicious objects: scripts, web pages, exploits,
executable files, etc.	

81.736.783 	

unique URLs were recognized as malicious by web
antivirus.	

Q1 2014
(source: Kaspersky Security Network)
TrueSec
Sources
9
• My spam folder (rootshell.be has been
registered in 2001)	

• Torrents (Keygens)	

• P0rn sites	

• You & me!
TrueSec
Motivations
10
• Plenty of material	

• To improve our security (integration with
other tools)	

• Because I’m lazy! (automation)	

• Because it’s fun!
TrueSec 11
“APT”	

VS	

“BPT”
The AttackVector
TrueSec
Analysis
12
TrueSec
Be Dynamic
13
• Execute the malware in a safe environment
and watch what it does	

• Goals	

• Understand how malwares work	

• Get IOC’s
TrueSec
We Need “IOC”!
14
TrueSec
We Need “IOC”!
15
• Hashes	

• IP addresses	

• Domain names	

• Files	

• Registry keys	

• URLs
Share!
TrueSec
Today’s Market
16
• A niche market	

• Big players

(read: $$$)	

• Integrated into an existing platform

(Many 2.0 or NG firewalls)
TrueSec
An Attack in 5 Steps
17
	

 	

 	

 	

 	

 	

 	

 	

 	

 	

 Persistence	

	

 	

 	

 	

 	

 	

 	

 	

 	

 Exploit	

	

 	

 	

 	

 	

 Plan a Backdoor	

	

 	

 	

 Initial intrusion	

Reconnaissance
Pwned!
TrueSec
The Patient “0”
18
The index case or primary case is the initial

patient in the population of an epidemiological

investigation (Source:Wikipedia)
TrueSec
Agenda
• Introduction	

• Build your lab	

• Automate	

• Conclusions
19
TrueSec
Requirements
20
• Free (because we are @ RMLL!)	

• Virtualized (easy & snapshots)	

• Open (to interconnect with other tools)	

• Automatization
TrueSec
Cuckoo
21
• Dynamic code analysis framework
developed in Python	

• “Python” means “open, modular, easy to
modify”	

• Based on the classic “sandboxing” system
TrueSec
Features
22
• Automation	

• Capture data	

• API calls	

• Network traffic	

• Screenshots	

• Filesystem / Registry operations	

• Memory dump	

• Reporting in many formats
TrueSec
Cuckoo
23
TrueSec
Architecture
24
TrueSec
Setup
25
TrueSec
Basic Installation
26
• VirtualBox (recommended)	

• Lot of Python lib dependencies	

• Recommended platform: Ubuntu	

• Ninja mode: OSX
TrueSec
We Need Intertubes
27
• Use Host-only networking withVirtualbox	

• Connect to the world
# sysctl -w net.ipv4.ip_forward=1
# iptables -A FORWARD -o eth0 -i vboxnet0 
-s 192.168.1.0/24 -m conntrack -ctstate NEW 
-j ACCEPT
# iptables -A FORWARD -m conntrack 
-ctstate ESTABLISHED,RELATED -j ACCEPT
# iptables -A POSTROUTING -t nat -j MASQUERADE
OSX Ninja?Visit http://goo.gl/aEM7gO
TrueSec
“Your” Sandbox
28
• Windows XP SP3 or Windows 7 SP1 32bits	

• Acrobat Reader, M$ Office, Browsers	

• Generate some content (cookies, browsers
history)	

• Install the Cuckoo agent	

• Disable all security features!
TrueSec
VM Hardening
29
• VM must be “vulnerable” but hardened
against anti-VM detection	

• http://github.com/markedoe/cuckoo-
sandbox	

• https://github.com/a0rtega/pafish
TrueSec
Attack of the Clones
30
TrueSec
Demo!
31
TrueSec
Agenda
• Introduction	

• Build your lab	

• Automate	

• Conclusions
32
TrueSec
Automation
33
Cuckoo is a nice tool to analyse files on
demand but some automation will be helpful to
detect more suspicious stuff!
TrueSec
Bro IDS
34
• Bro is a powerful network analysis
framework. Bro is not only a IDS	

• Bro comes with analysers for many
protocols which allow processing at layer-7	

• http://bro.org
TrueSec
Bro Scripting
35
Bro has a simple and

powerful scripting

language.All the

output generated by

Bro is based on

scripts!
TrueSec
Extract Those Files!
36
• Bro can extract files from network streams
and save them on the file system	

• There is an “extraction” analyzer to
perform this task
TrueSec
Extract Those Files!
37
global ext_map: table[string] of string = {
["application/x-dosexec"] = "exe",
} &default ="";
!
event file_new(f: fa_file) {
local ext = “data";
!
if ( f?$mime_type )
ext = ext_map[f$mime_type];
!
local fname = fmt("%s-%s.%s",

f$source, f$id, ext);
Files::add_analyzer(f, Files::ANALYZER_EXTRACT,

[$extract_filename=fname]);
}
TrueSec
Juicy Files
38
application/x-dosexec
application/vnc.ms-cab-compressed
application/pdf
application/x-shockware-flash
application/x-java-applet
application/jar
application/zip
TrueSec
And URLs?
39
• Extracting URLs from network?	

• Flood! (“HTTP is the new TCP”)	

• Analysing one-time URLs may break some
tools (think about password recovery)
TrueSec
Sniff!
40
# cd /tools/bro/logs
# vi extract.bro
# mkdir extract_files
# ../bin/bro -i eth1 extract.bro
listening on eth1, capture length 8192 bytes
TrueSec
Feed Cuckoo!
41
# cd /tools/bro/logs/extract_files
# inotifywait -m -q -e create —format %f . |
while read F
do
case “${F##*.}” in
“zip|exe|doc|dll|jar|msi”)
/tools/cuckoo/utils/submit.py $F
esac
done
TrueSec
Want Data?
42
• Cuckoo has a REST API	

• Useful to automate even more
TrueSec
Get results!
43
# curl http://localhost:8090/tasks/list
# curl http://localhost:8090/tasks/view/10
# curl http://localhost:8090/tasks/report/10
# curl http://localhost:8090/files/view/md5/xxxxxx
!
TrueSec
Extract IOC’s
44
#curl -s http://localhost:8090/tasks/report/2/json | 
python extract-domains.py
premiercrufinewine.co.uk 188.65.114.122
fidaintel.com 216.224.182.75
TrueSec
Feed OSSEC
45
• Create CDB lists (“active lists”)	

<ossec_config>

<rules>
<list>lists/baddomains.cdb</list>
<list>lists/badips.cdb</list>
</rules>
</ossec_config>
• Populate them	

• Re-generate them

/var/ossec/bin/ossec-makelists
TrueSec
Correlate
46
<rule id=“99001” level=“10”>
<decoded_as>bind9</decoded_as>
<list field=“url”>lists/baddomains</list>
<description>DNS query: malicious domain</description>
</rule>
TrueSec
Agenda
• Introduction	

• Build your lab	

• Automate	

• Conclusions
47
TrueSec
Conclusions
48
TrueSec
Conclusions
49
• We don’t have time to handle such amount
of data!	

• Know your Enemy!	

• Correlate your logs with external content
TrueSec
Thank you!	

@xme	

xavier@truesec.be	

http://blog.rootshell.be	

https://www.truesec.be
50

More Related Content

PDF
$HOME Sweet $HOME
PDF
Automatic MIME Attachments Triage
PDF
Secure Web Coding
PDF
$HOME Sweet $HOME Devoxx 2015
PDF
What are-you-investigate-today? (version 2.0)
PDF
You have a SIEM! And now?
PDF
Developers are from Mars, Security guys are from Venus
PDF
Unity Makes Strength SOURCE Dublin 2013
$HOME Sweet $HOME
Automatic MIME Attachments Triage
Secure Web Coding
$HOME Sweet $HOME Devoxx 2015
What are-you-investigate-today? (version 2.0)
You have a SIEM! And now?
Developers are from Mars, Security guys are from Venus
Unity Makes Strength SOURCE Dublin 2013

What's hot (20)

PPTX
Tracking Exploit Kits - Virus Bulletin 2016
PDF
PDF
Because we are just humans
PDF
Automatiza las detecciones de amenazas y evita falsos positivos
PPTX
BlueHat v17 || All Your Cloud Are Belong to Us; Hunting Compromise in Azure
PPTX
Intro to NSM with Security Onion - AusCERT
PDF
IoT-Shield: A Novel DDoS Detection Approach for IoT-Based Devices
PPTX
2018 - Using Honeypots for Network Security Monitoring
PPTX
Taking Hunting to the Next Level: Hunting in Memory
PDF
Hunting For Exploit Kits
PPTX
Defending Against 1,000,000 Cyber Attacks by Michael Banks
PPTX
Security Onion - Brief
PDF
iCrOSS 2013_Pentest
PPTX
Honeypots for proactively detecting security incidents
PDF
Malware cryptomining uploadv3
PDF
Incident response, Hacker Techniques and Countermeasures
PDF
HAcktive Directory - Microsoft Meetup July 2020
PDF
Cryto Party at CCU
Tracking Exploit Kits - Virus Bulletin 2016
Because we are just humans
Automatiza las detecciones de amenazas y evita falsos positivos
BlueHat v17 || All Your Cloud Are Belong to Us; Hunting Compromise in Azure
Intro to NSM with Security Onion - AusCERT
IoT-Shield: A Novel DDoS Detection Approach for IoT-Based Devices
2018 - Using Honeypots for Network Security Monitoring
Taking Hunting to the Next Level: Hunting in Memory
Hunting For Exploit Kits
Defending Against 1,000,000 Cyber Attacks by Michael Banks
Security Onion - Brief
iCrOSS 2013_Pentest
Honeypots for proactively detecting security incidents
Malware cryptomining uploadv3
Incident response, Hacker Techniques and Countermeasures
HAcktive Directory - Microsoft Meetup July 2020
Cryto Party at CCU
Ad

Similar to Malware Analysis Using Free Software (20)

PPTX
BSIDES-PR Keynote Hunting for Bad Guys
PPTX
Malware Static Analysis
PDF
What Will You Investigate Today?
PDF
Open Source Cyber Weaponry
PDF
Алексей Старов - Как проводить киберраследования?
DOCX
Project Malware AnalysisCS 6262 Project 3Agenda.docx
PDF
BSides IR in Heterogeneous Environment
PDF
SOC-BlueTEam.pdf
PDF
100 Security Operation Center Tools.pdf
PDF
Workshop: Big Data Visualization for Security
PDF
soctool.pdf
PDF
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...
PPTX
Finalppt metasploit
KEY
Unity makes strength
PDF
Full-System Emulation Achieving Successful Automated Dynamic Analysis of Evas...
PDF
unit 2 confinement techniques.pdf
PPTX
Remnux tutorial-1 Statically Analyse Portable Executable(PE) Files
PDF
CNIT 152 12 Investigating Windows Systems (Part 2)
PDF
Reversing Engineer: Dissecting a "Client Side" Vulnerability in the APT era
BSIDES-PR Keynote Hunting for Bad Guys
Malware Static Analysis
What Will You Investigate Today?
Open Source Cyber Weaponry
Алексей Старов - Как проводить киберраследования?
Project Malware AnalysisCS 6262 Project 3Agenda.docx
BSides IR in Heterogeneous Environment
SOC-BlueTEam.pdf
100 Security Operation Center Tools.pdf
Workshop: Big Data Visualization for Security
soctool.pdf
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...
Finalppt metasploit
Unity makes strength
Full-System Emulation Achieving Successful Automated Dynamic Analysis of Evas...
unit 2 confinement techniques.pdf
Remnux tutorial-1 Statically Analyse Portable Executable(PE) Files
CNIT 152 12 Investigating Windows Systems (Part 2)
Reversing Engineer: Dissecting a "Client Side" Vulnerability in the APT era
Ad

More from Xavier Mertens (17)

PDF
FPC for the Masses (SANSFire Edition)
PDF
FPC for the Masses - CoRIIN 2018
PDF
HTTP For the Good or the Bad - FSEC Edition
PDF
Unity Makes Strength
PDF
HTTP For the Good or the Bad
PDF
Building A Poor man’s Fir3Ey3 Mail Scanner
PDF
$HOME Sweet $HOME SANSFIRE Edition
PDF
The BruCO"NSA" Network
PPT
Mobile Apps Security
PDF
Mobile Security
KEY
Social Networks - The Good and the Bad
PDF
ISACA Ethical Hacking Presentation 10/2011
PDF
All Your Security Events Are Belong to ... You!
PDF
InfoSecurity.be 2011
PDF
ISSA Siem Fraud
PDF
BruCON 2010 Lightning Talk
PPT
Belnet events management
FPC for the Masses (SANSFire Edition)
FPC for the Masses - CoRIIN 2018
HTTP For the Good or the Bad - FSEC Edition
Unity Makes Strength
HTTP For the Good or the Bad
Building A Poor man’s Fir3Ey3 Mail Scanner
$HOME Sweet $HOME SANSFIRE Edition
The BruCO"NSA" Network
Mobile Apps Security
Mobile Security
Social Networks - The Good and the Bad
ISACA Ethical Hacking Presentation 10/2011
All Your Security Events Are Belong to ... You!
InfoSecurity.be 2011
ISSA Siem Fraud
BruCON 2010 Lightning Talk
Belnet events management

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Empathic Computing: Creating Shared Understanding
PPT
Teaching material agriculture food technology
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Electronic commerce courselecture one. Pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Approach and Philosophy of On baking technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
cuic standard and advanced reporting.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Empathic Computing: Creating Shared Understanding
Teaching material agriculture food technology
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
MYSQL Presentation for SQL database connectivity
Advanced methodologies resolving dimensionality complications for autism neur...
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation theory and applications.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Electronic commerce courselecture one. Pdf
Encapsulation_ Review paper, used for researhc scholars
Approach and Philosophy of On baking technology
Building Integrated photovoltaic BIPV_UPV.pdf
Spectral efficient network and resource selection model in 5G networks

Malware Analysis Using Free Software