Sec day cuckoo_workshop

Analyse de malware automatisée
avec Cuckoo SandBox
ESGI - Workshop Security Day 2015
Thomas ROCCIA | thomas.roccia@gmail.com | @R1tch1e_
Workshop Cuckoo Sandbox 2
Sommaire
0x01 Présentation
0x02 Objectifs
0x03 Analyse de malware
0x04 Analyse automatisée
0x05 Cuckoo Sandbox
0x06 Documentation
0x07 Conclusion
Workshop Cuckoo Sandbox 3
0x01 Présentation
● Thomas ROCCIA | @R1tch1e_
● Analyste en Sécurité des Systèmes d'Information
– Investigation numérique (forensic)
– Analyse de malware
– Test d'intrusion
Workshop Cuckoo Sandbox 4
0x02 Objectifs
0x01 Présentation
0x02 Objectifs
0x03 Analyse de malware
0x04 Analyse automatisée
0x05 Cuckoo Sandbox
0x06 Documentation
0x07 Conclusion
Workshop Cuckoo Sandbox 5
0x02 Objectifs
● Monter un environnement d'analyse de
malware automatisée avec Cuckoo Sandbox
● Analyser les résultats provenant de Cuckoo
● Créer des rapports standards
● Aller plus loin dans l'analyse de malware
Workshop Cuckoo Sandbox 6
0x03 Analyse de malware
0x01 Présentation
0x02 Objectifs
0x03 Analyse de malware
0x04 Analyse automatisée
0x05 Cuckoo Sandbox
0x06 Documentation
0x07 Conclusion
Workshop Cuckoo Sandbox 7
0x03 Analyse de malware
● Objectif de l'analyse de malware ?
– Comprendre son fonctionnement
– Générer une signature de détection
– Bloquer les actions malveillantes
● Limite de l'analyse de malware manuelle
– Nécessite une bonne connaissance de l'assembleur
– Analyse souvent longue et fastidieuse
Workshop Cuckoo Sandbox 8
0x04 Analyse automatisée
0x01 Présentation
0x02 Objectifs
0x03 Analyse de malware
0x04 Analyse automatisée
0x05 Cuckoo Sandbox
0x06 Documentation
0x07 Conclusion
Workshop Cuckoo Sandbox 9
0x04 Analyse automatisée
● Objectif de l'analyse automatisée ?
– Comprendre rapidement le fonctionnement du malware
– Identifier ses connexions vers l'extérieur
– Identifier les fichiers créés
– Générer une signature de détection
– Comparer sa signature sur des bases connues (virustotal)
– Établir une première estimation de ses capacités
– Générer des rapports automatisés
● Limite de l'analyse automatisée
– Nécessite une analyse approfondie complémentaire (Reverse Engineering ...)
– Certains malwares détectent qu'ils sont dans un environnement d'analyse
Workshop Cuckoo Sandbox 10
0x05 Cuckoo Sandbox
0x01 Présentation
0x02 Objectifs
0x03 Analyse de malware
0x04 Analyse automatisée
0x05 Cuckoo Sandbox
0x06 Documentation
0x07 Conclusion
Workshop Cuckoo Sandbox 11
0x05 Cuckoo Sandbox
● Rappel et définition d'une sandbox
● Selon Wikipédia :
« Une  sandbox  (anglicisme  signifiant  «  bac  à  sable  »)  est  un 
mécanisme  qui  permet  l'exécution  de  logiciel(s)  avec  moins  de 
risques pour le système d'exploitation. Ces derniers sont souvent 
utilisés  pour  exécuter  du  code  non  testé  ou  de  provenance 
douteuse. » 
● Pour faire simple :
Une sandbox est un environnement contrôlé qui permet d'étudier 
des  logiciels  malveillants  (malware)  afin  d'en  comprendre  leur 
fonctionnement.
Workshop Cuckoo Sandbox 12
0x05 Cuckoo Sandbox
● Présentation
– Développé par Claudio Guarnieri
– Créé en 2010
– Soutenu par le projet www.honeynet.org
– Open Source et sous licence GNU
– Développé en python
– www.cuckoosandbox.org
– irc.freenode.net #cuckoosandbox
Workshop Cuckoo Sandbox 13
0x05 Cuckoo Sandbox
● Principe de
fonctionnement
– Environnement
« bac-à-sable »
automatisé
– Connecté à des
machines
virtuelles
– Gestion de divers
fichiers (exe,
PDF, OLE, PHP)
Workshop Cuckoo Sandbox 14
0x05 Cuckoo Sandbox
● Pré-requis
– Une VM Ubuntu desktop 14 (25 Go / 3 Go de
RAM) + les VMtools
– Installation de Virtualbox dans la VM
– Un système Windows « clean » de base dans la
VM (9Go / 1Go de RAM)
● Network : Host only vboxnet et NAT
● Ajouter un mot de passe sur le compte Windows
Workshop Cuckoo Sandbox 15
0x05 Cuckoo Sandbox
● Configuration de l'hôte Cuckoo
– Installation par défaut Ubuntu Desktop 14 LTS (25Go et 3Go de RAM)
– Installation des paquets python et dépendances :
$ apt­get install python 2.7 
$ apt­get install python­magic 
$ apt­get install python­dpkt 
$ apt­get install python­mako
$ apt­get install python­sqlalchemy  
$ apt­get install python­jinja2
$ apt­get install python­bottle
$ apt­get install python­pefile
$ apt­get install python­libvirt
$ apt­get install python2.7­dev
$ apt­get update && apt­get dist­upgrade
Workshop Cuckoo Sandbox 16
0x05 Cuckoo Sandbox
● Configuration du serveur Cuckoo
– Installation ssdeep pour le calcul de hash :
– Installation de MongoDB :
$ apt­get install ssdeep  
$ apt­get install python­pyrex 
$ apt­get install subversion  
$ apt­get install libfuzzy­dev   
$ svn checkout http://pyssdeep.googlecode.com/svn/trunk/ pyssdeep  
$ cd pyssdeep  
$ python setup.py build  
$ python setup.py install
$ apt­get install ssdeep build­essential git libpcre3 libpcre3­dev   
$ apt­get install python­pyrex libcre++­dev libssdeep
$ apt­get install subversion  
$ apt­get install libfuzzy­dev 
$ cd /opt  
$ git clone https://github.com/kbandla/pydeep.git  
$ cd /opt/pydeep/ 
$ python setup.py build  
$ python setup.py install
$ apt­get install python­pymongo 
$ apt­get install mongodb 
Workshop Cuckoo Sandbox 17
0x05 Cuckoo Sandbox
● Configuration de l'hôte Cuckoo
– Installation de Yara :
 $ apt­get install g++
 $ apt­get install automake ­y
 $ wget http://yara­project.googlecode.com/files/yara­1.6.tar.gz  
 $ tar ­xvzf yara­1.6.tar.gz  
 $ cd yara­1.6  
 $ ./configure  
 $ make  
 $ make check  
 $ make install
 $ wget http://yara­project.googlecode.com/files/yara­python­1.6.tar.gz  
 $ tar ­xvzf yara­python­1.6.tar.gz  
 $ cd yara­python­1.6  
 $ python setup.py build  
 $ python setup.py install
Workshop Cuckoo Sandbox 18
0x05 Cuckoo Sandbox
● Configuration de l'hôte Cuckoo 
– Installation de TCPdump :
– Téléchargement de Cuckoo Sandbox :
– Création du user cuckoo et installation virtualbox :
$ apt­get install tcpdump libcap2­bin  
$ setcap cap_net_raw,cap_net_admin=eip /usr/sbin/tcpdump  
$ getcap /usr/sbin/tcpdump
$ git clone git://github.com/cuckoobox/cuckoo.git   
$ sudo apt­get install virtualbox
$ sudo adduser cuckoo  
$ usermod ­a ­G vboxusers cuckoo 
$ sudo usermod ­G libvirtd cuckoo
$ id cuckoo
Workshop Cuckoo Sandbox 19
0x05 Cuckoo Sandbox
● Configuration de l'hôte Cuckoo 
– Paquets supplémentaires :
$ wget https://bootstrap.pypa.io/get­pip.py
$ sudo python get­pip.py
$ sudo pip install cybox==2.0.1.4
$ sudo pip install maec==4.0.1.0
$ sudo apt­get install wireshark
Workshop Cuckoo Sandbox 20
0x05 Cuckoo Sandbox
● Configuration de la machine de test
– Windows XP (9Go et 1Go RAM)
– Configuration en 2 cartes réseaux (host-only vboxnet0 + NAT)
– Créer un compte avec mot de passe
– Installation des Virtualbox-tool
– Configuration d'un dossier partagé (Shared Folders)
● Choisir un répertoire (par exemple /home/share)
● Cocher les options (RO, Auto-mount, Permanent)
– Monter ensuite le répertoire dans Windows
● Clic droit my computer => map network drive
● Ajouter vboxsrvshare
Workshop Cuckoo Sandbox 21
0x05 Cuckoo Sandbox
● Configuration de la machine de test
– Désactivation des éléments de sécurité (Firewall, Windows Update...)
– Installation Python 2.7
https://www.python.org/downloads/release/python-279/
– Installation Python PIL 1.1.7 : http://www.pythonware.com/products/pil/
– Installation des logiciels susceptibles d'être des vecteurs d'infection
(Adobe Reader 9.5, Flash player 3, Office 2007 + désactiver sécu macro,
Firefox 3.6, Java 6...) et désactivation de leurs MAJ automatiques +
descendre leurs niveaux de sécurité. Http://www.oldapps.com
Workshop Cuckoo Sandbox 22
0x05 Cuckoo Sandbox
● Configuration de la machine de test
– Copier le script /opt/cuckoo/agent/agent.py dans le dossier share
– Dans Windows copier le fichier agent.py dans C:python27 et dans le
startup c:Document_and_settingsall_userStart_MenuProgramsstartup
– Exécuter le fichier agent.py et vérifier qu'une socket est ouverte sur le port
0.0.0.0:8000 avec la commande netstat ­aon
– Remarque : lorsque l'on clique sur le fichier agent.py une console s'ouvre, 
pour ne pas la voir, il suffit de renommer le fichier agent.py en agent.pyw
Workshop Cuckoo Sandbox 23
0x05 Cuckoo Sandbox
● Configuration de Cuckoo Sandbox
– Fichier de configuration /opt/cuckoo/conf/ :
● Cuckoo.conf : c'est le fichier de configuration principal. Il
permet de définir le comportement de la sandbox et les
objectifs.
● Virtualbox.conf : il contient les informations sur
l'environnement virtuel (un fichier pour les différents
environnements)
● Processing.conf : ce fichier permet d'activer et de
configurer les différents modules de traitement (virustotal...)
● Reporting.conf : ce fichier contient les stratégies d'analyse
(réseau, comportementale...)
Workshop Cuckoo Sandbox 24
0x05 Cuckoo Sandbox
● Configuration de Cuckoo Sandbox
– Configuration du fichier cuckoo.conf
● Mettre l'IP de l'interface virtuel (vboxnet0)
● Machine manager : virtualbox
● D'autres fonctionnalités
– Configuration du fichier virtualbox.conf :
● Changer le nom de la machine (cuckoo1) / mettre le nom de la vm dans le
champ machine et dans le label.
● Ajouter l'OS de la VM (Windows)
● Ajouter l'IP de la VM
● Ajouter le nom du snapshot
● Dé-commenter et modifier si besoin l'interface
Workshop Cuckoo Sandbox 25
0x05 Cuckoo Sandbox
● Configuration de Cuckoo Sandbox
– Configuration du fichier processing.conf :
● Modifier l'API Virus Total
● Laisser le reste du fichier par défaut
– Configuration du fichier reporting.conf :
● Modifier le fichier si besoin
– Configuration du fichier physical.conf :
● Ajouter les credentiales de la machine virtuelle
– Snapshot de la machine windows (attention à respecter le nom du 
snapshot (Snapshot1) et pas en root !) :
$ vboxmanage snapshot "CuckooXP" take "Snapshot1" ­­pause
Workshop Cuckoo Sandbox 26
0x05 Cuckoo Sandbox
Cuckoo est à présent opérationnel !
● Lancement de Cuckoo Sandbox. Attention au droit !
● Envoi d'un fichier à cuckoo en ligne de commande
● Lancement de l'interface web
$ ./cuckoo.py
$ cd /opt/cuckoo/util/
$ ./submit.py <sample> 
$ cd /opt/cuckoo/util/
$ ./web.py
Workshop Cuckoo Sandbox 27
0x05 Cuckoo Sandbox
Workshop Cuckoo Sandbox 28
0x05 Cuckoo Sandbox
● Base de données de malware :
– http://malwaredb.malekal.com/
– http://virusshare.com/
– http://oc.gtisc.gatech.edu:8080/
– http://contagiodump.blogspot.fr/
– https://www.google.com/cse/home?cx=001439139068102
559330:uruncpbgqm8
– https://avcaesar.malware.lu/
– http://syrianmalware.com/
– URLs malveillantes : http://www.scumware.org/
Workshop Cuckoo Sandbox 29
0x05 Cuckoo Sandbox
● Analyse d'un fichier malveillant
– Envoi du fichier laroux.xls :
Workshop Cuckoo Sandbox 30
0x05 Cuckoo Sandbox
● Analyse d'URL malveillante :
– Configuration de l'interface réseau (NAT)
– Envoi de l'URL malveillante :
$ ./submit.py ­­url <url>  
Workshop Cuckoo Sandbox 31
0x05 Cuckoo Sandbox
● Fichiers de reporting :
– /opt/cuckoo/storage
● Analyses : contient tout les éléments de l'analyse
● Binaries : contient les binaires analysés
– /opt/cuckoo/storage/analyses/
Workshop Cuckoo Sandbox 32
0x05 Cuckoo Sandbox
● Contenu du fichier report.html
– Info : cette section donne des informations sur le déroulé de l'analyse (type de fichier,
timestamp, nom de la VM de test, durée de l'analyse, version de Cuckoo...)
– File : cette section contient des informations sur le fichier analysé (nom, taille, type de
fichier, empreinte, détection PeiD, détection YARA et VirusTotal)
– Signatures : Il s'agit des signatures de détection (utils/./community.py ­a)
– Screenshot : il s'agit des copies d'écran de la vm lors de l'analyse (fichier du
repertoire shots)
– Static Analysis : il s'agit d'informations sur le fichier (strings, DLL, Sections, imports...)
– Dropped Files : il s'agit des fichiers créés par le malware
– Network : cette section contient les connexions réseaux du fichier
– Behavior : cette section contient des informations sur le comportement du malware
(registre, processus, fichiers, mutexes...)
Workshop Cuckoo Sandbox 33
0x05 Cuckoo Sandbox
● Créer des rapports MAEC (Malware Attribute Enumeration
and Characterization)
– Modifier le fichier reporting.conf : maec40 = on
$ sudo apt­get install treeline
$ Treeline report.maec.xml (choisir generic xml)
http://maec.mitre.org/
Workshop Cuckoo Sandbox 34
0x05 Cuckoo Sandbox
● Créer des rapports PDF
– Installation :
– Supprimer /cuckoo/modules/reporting/reporthtml.pyc
– Créer un fichier pdf.py :
– Dans le fichier reporthtml.py ajouter la ligne :
$ sudo apt­get install wkhtmltopdf
$ git clone https://github.com/JazzCore/python­pdfkit.git
$ sudo python setup.py build
$ sudo python setup.py install
import pdfkit
def create_pdf(xhtml, dest):
    pdfkit.from_file(xhtml, dest)
 from pdf import create_pdf 
Workshop Cuckoo Sandbox 35
0x05 Cuckoo Sandbox
● Créer des rapports PDF
– Ajouter à la fin du fichier reporthtml.py :
try:
   xhtml = open(self.reports_path+"/report.html")
   create_pdf(xhtml, self.reports_path+"/report.pdf")
   xhtml.close()
except (Exception, TypeErro, IOError) as e:
   raise CuckooReportError("Failed to generate PDF report: %s" % e)
Workshop Cuckoo Sandbox 36
0x05 Cuckoo Sandbox
Aller plus loin dans l'analyse de malware...
● Interface Web Cuckoo 1.2
● Cuckoo et Volatility
● Cuckoo et Yara
● Aller encore plus loin
Workshop Cuckoo Sandbox 37
0x05 Cuckoo Sandbox
● Interface web Cuckoo 1.2
– Configuration
● Activer la base de donnée MongoDB dans le
fichier cuckoo/conf/reporting.conf
● Lancer l'interface web :
●
$ cd cuckoo/web/
$ python manage.py runserver
Workshop Cuckoo Sandbox 38
0x05 Cuckoo Sandbox
● Interface web Cuckoo 1.2
Workshop Cuckoo Sandbox 39
0x05 Cuckoo Sandbox
● Cuckoo Sandbox et Volatility
– Configuration
● Installation de volatility (apt-get install volatility)
● Cuckoo.conf : modifier memory_dump = on
● Remarque : les dumps mémoires prennent beaucoup 
de place, il faudra donc prévoir en conséquence la 
taille du disque dans une utilisation courante.
● Le fichier créé se retrouve donc dans le répertoire de
l'analyse.
Workshop Cuckoo Sandbox 40
0x05 Cuckoo Sandbox
● Cuckoo Sandbox et Volatility
– Analyse de base
Identification de la machine :
$ volatility ­f memory.dmp imageinfo
Analyse des processus :
$ volatility ­f memory.dmp ­­profile=WinXPSP3x86 pslist
$ volatility ­f memory.dmp ­­profile=WinXPSP3x86 pstree
Analyse des connexions :
$ volatility ­f memory.dmp ­­profile=WinXPSP3x86 connections
Dump d'un processus :
$ volatility ­f memory.dmp ­­profile=WinXPSP3x86 procexedump ­p 564 ­D opt/
$ volatility ­f memory.dmp ­­profile=WinXPSP3x86 procexedump ­p 564 ­D opt/
Afficher l'aide :
$ volatility ­h
Workshop Cuckoo Sandbox 41
0x05 Cuckoo Sandbox
● Cuckoo Sandbox et Yara
– Configuration
● Créer une nouvelle
règle /opt/cuckoo/data/yara/binaries/hello.yar:
rule HelloWorld
{
meta:
        author = "r1tch1e"
strings:
$a = "hello world"
condition:
$a
}
Workshop Cuckoo Sandbox 42
0x05 Cuckoo Sandbox
● Cuckoo Sandbox et Yara
– Configuration
● Modifier le fichier
/opt/cuckoo/data/yara/index_binaries.yar
● Tester la règle :
include "/home/r1tch1e/opt/cuckoo/data/yara/binaries/embedded.yar"
include "/home/r1tch1e/opt/cuckoo/data/yara/binaries/shellcodes.yar"
include "/home/r1tch1e/opt/cuckoo/data/yara/binaries/vmdetect.yar"
include "/home/r1tch1e/opt/cuckoo/data/yara/binaries/hello.yar"
$ yara hello.yar /home/r1tch1e/share/
HelloWorld /home/r1tch1e/share//hello.exe
Workshop Cuckoo Sandbox 43
0x05 Cuckoo Sandbox
● Volatitlity et Yara :
volatility ­f memory.dmp yarascan ­y cuckoo/data/yara/binaries/hello.yar 
Workshop Cuckoo Sandbox 44
0x05 Cuckoo Sandbox
● Pour aller encore plus loin
– CuckooMX (https://github.com/xme/cuckoomx)
– Pafish Hardening VM (https://github.com/a0rtega/pafish)
– Interface graphique avec maltego
(https://github.com/bostonlink/cuckooforcanari)
Workshop Cuckoo Sandbox 45
0x06 Documentation
0x01 Présentation
0x02 Objectifs
0x03 Analyse de malware
0x04 Analyse automatisée
0x05 Cuckoo Sandbox
0x06 Documentation
0x07 Conclusion
Workshop Cuckoo Sandbox 46
0x06 Documentation
● http://www.cuckoosandbox.org/
● https://malwr.com/
● https://github.com/bostonlink/cuckooforcanari
● http://maec.mitre.org/
● https://cuckoo.readthedocs.org/en/latest/
● https://blog.malwarebytes.org/intelligence/2014/04/automati
ng-malware-analysis-with-cuckoo-sandbox/
● http://www.honeynet.org/
● http://www.google.fr (joke inside)
Workshop Cuckoo Sandbox 47
0x07 Conclusion
0x01 Présentation
0x02 Objectifs
0x03 Analyse de malware
0x04 Analyse automatisée
0x05 Cuckoo Sandbox
0x06 Documentation
0x07 Conclusion
Workshop Cuckoo Sandbox 48
0x07 Conclusion
● Gain de temps
● Identification rapide de la charge malicieuse
● Amélioration du processus de résolution
● Analyse de fichiers et d'URLs
● Multiples fonctionnalités avec les plugins
● Gestion d'une base de connaissance
● Création automatique de rapports
Workshop Cuckoo Sandbox 49
Thomas ROCCIA | @R1tch1e_
1 de 49

Recomendados

Introduction to malware analysis with Cuckoo Sandbox por
Introduction to malware analysis with Cuckoo SandboxIntroduction to malware analysis with Cuckoo Sandbox
Introduction to malware analysis with Cuckoo Sandboxsysinsider
3.5K vistas54 diapositivas
Prévention et traitement du hack de serveurs por
Prévention et traitement du hack de serveursPrévention et traitement du hack de serveurs
Prévention et traitement du hack de serveursAmen.fr
990 vistas7 diapositivas
Hackfest2010 Tm Dg Fr por
Hackfest2010 Tm Dg FrHackfest2010 Tm Dg Fr
Hackfest2010 Tm Dg FrDavid Girard
454 vistas24 diapositivas
ASFWS 2013 - Prévention et analyse de cyber attaques : Import-Module Incident... por
ASFWS 2013 - Prévention et analyse de cyber attaques : Import-Module Incident...ASFWS 2013 - Prévention et analyse de cyber attaques : Import-Module Incident...
ASFWS 2013 - Prévention et analyse de cyber attaques : Import-Module Incident...Cyber Security Alliance
1.2K vistas47 diapositivas
Agilly vulnérabilité log4j-sucuri por
Agilly vulnérabilité log4j-sucuriAgilly vulnérabilité log4j-sucuri
Agilly vulnérabilité log4j-sucuriAGILLY
85 vistas4 diapositivas
Colloque cyber 2010 les botnets por
Colloque cyber 2010   les botnetsColloque cyber 2010   les botnets
Colloque cyber 2010 les botnetsmichelcusin
1.1K vistas57 diapositivas

Más contenido relacionado

La actualidad más candente

[SINS] Présentation de Nagios por
[SINS] Présentation de Nagios[SINS] Présentation de Nagios
[SINS] Présentation de Nagiosjeyg
11.1K vistas59 diapositivas
mise en pratique de l'outil Skipfish por
mise en pratique de l'outil Skipfishmise en pratique de l'outil Skipfish
mise en pratique de l'outil SkipfishMounia EL
1.6K vistas10 diapositivas
Ubuntu est il un système sécuritairement sain PDF por
Ubuntu est il un système sécuritairement sain PDFUbuntu est il un système sécuritairement sain PDF
Ubuntu est il un système sécuritairement sain PDFMohamed Ben Bouzid
2.9K vistas36 diapositivas
Research Paper on Digital Forensic por
Research Paper on Digital ForensicResearch Paper on Digital Forensic
Research Paper on Digital ForensicThomas Roccia
1.6K vistas126 diapositivas
Prés kais por
Prés kaisPrés kais
Prés kaisKais Madi
1K vistas28 diapositivas
Audit et sécurité informatique por
Audit et sécurité informatiqueAudit et sécurité informatique
Audit et sécurité informatiqueMohamed Habib Jomaa
841 vistas54 diapositivas

La actualidad más candente(12)

[SINS] Présentation de Nagios por jeyg
[SINS] Présentation de Nagios[SINS] Présentation de Nagios
[SINS] Présentation de Nagios
jeyg11.1K vistas
mise en pratique de l'outil Skipfish por Mounia EL
mise en pratique de l'outil Skipfishmise en pratique de l'outil Skipfish
mise en pratique de l'outil Skipfish
Mounia EL 1.6K vistas
Ubuntu est il un système sécuritairement sain PDF por Mohamed Ben Bouzid
Ubuntu est il un système sécuritairement sain PDFUbuntu est il un système sécuritairement sain PDF
Ubuntu est il un système sécuritairement sain PDF
Mohamed Ben Bouzid2.9K vistas
Research Paper on Digital Forensic por Thomas Roccia
Research Paper on Digital ForensicResearch Paper on Digital Forensic
Research Paper on Digital Forensic
Thomas Roccia1.6K vistas
Prés kais por Kais Madi
Prés kaisPrés kais
Prés kais
Kais Madi1K vistas
Sécurité informatique : le Retour sur Investissement que vous n'attendiez pas por Maxime ALAY-EDDINE
Sécurité informatique : le Retour sur Investissement que vous n'attendiez pasSécurité informatique : le Retour sur Investissement que vous n'attendiez pas
Sécurité informatique : le Retour sur Investissement que vous n'attendiez pas
Maxime ALAY-EDDINE1.7K vistas
CD d’auto-installation de Nagios, Centreon et NaReTo por guest3be047
CD d’auto-installation de Nagios, Centreon et NaReToCD d’auto-installation de Nagios, Centreon et NaReTo
CD d’auto-installation de Nagios, Centreon et NaReTo
guest3be0471.4K vistas
FAN, Fully Automated Nagios, Rencontres Mondiales du Logiciel Libre 2008 por FAN Fully Automated Nagios
FAN, Fully Automated Nagios, Rencontres Mondiales du Logiciel Libre 2008FAN, Fully Automated Nagios, Rencontres Mondiales du Logiciel Libre 2008
FAN, Fully Automated Nagios, Rencontres Mondiales du Logiciel Libre 2008
Sécurité informatique - Etat des menaces por Maxime ALAY-EDDINE
Sécurité informatique - Etat des menacesSécurité informatique - Etat des menaces
Sécurité informatique - Etat des menaces
Maxime ALAY-EDDINE3.7K vistas

Destacado

Malware Analysis 101 - N00b to Ninja in 60 Minutes at CactusCon on April 4, 2014 por
Malware Analysis 101 - N00b to Ninja in 60 Minutes at CactusCon on April 4, 2014Malware Analysis 101 - N00b to Ninja in 60 Minutes at CactusCon on April 4, 2014
Malware Analysis 101 - N00b to Ninja in 60 Minutes at CactusCon on April 4, 2014grecsl
4K vistas68 diapositivas
Zynga adder por
Zynga adderZynga adder
Zynga adderKomfom Menang Terus
364 vistas6 diapositivas
Reverse-Engineering Pour le Fun et le Profit por
Reverse-Engineering Pour le Fun et le ProfitReverse-Engineering Pour le Fun et le Profit
Reverse-Engineering Pour le Fun et le ProfitSoufiane Tahiri
1.4K vistas41 diapositivas
Fighting advanced malware using machine learning (English) por
Fighting advanced malware using machine learning (English)Fighting advanced malware using machine learning (English)
Fighting advanced malware using machine learning (English)FFRI, Inc.
1.9K vistas37 diapositivas
Ransomware Teslacrypt Uncovered - Malware Analysis por
Ransomware Teslacrypt Uncovered - Malware AnalysisRansomware Teslacrypt Uncovered - Malware Analysis
Ransomware Teslacrypt Uncovered - Malware AnalysisThomas Roccia
859 vistas16 diapositivas
Cuckoo Sandbox: Automated malware analysis por
Cuckoo Sandbox: Automated malware analysisCuckoo Sandbox: Automated malware analysis
Cuckoo Sandbox: Automated malware analysisjekil
2.1K vistas55 diapositivas

Destacado(19)

Malware Analysis 101 - N00b to Ninja in 60 Minutes at CactusCon on April 4, 2014 por grecsl
Malware Analysis 101 - N00b to Ninja in 60 Minutes at CactusCon on April 4, 2014Malware Analysis 101 - N00b to Ninja in 60 Minutes at CactusCon on April 4, 2014
Malware Analysis 101 - N00b to Ninja in 60 Minutes at CactusCon on April 4, 2014
grecsl4K vistas
Reverse-Engineering Pour le Fun et le Profit por Soufiane Tahiri
Reverse-Engineering Pour le Fun et le ProfitReverse-Engineering Pour le Fun et le Profit
Reverse-Engineering Pour le Fun et le Profit
Soufiane Tahiri1.4K vistas
Fighting advanced malware using machine learning (English) por FFRI, Inc.
Fighting advanced malware using machine learning (English)Fighting advanced malware using machine learning (English)
Fighting advanced malware using machine learning (English)
FFRI, Inc.1.9K vistas
Ransomware Teslacrypt Uncovered - Malware Analysis por Thomas Roccia
Ransomware Teslacrypt Uncovered - Malware AnalysisRansomware Teslacrypt Uncovered - Malware Analysis
Ransomware Teslacrypt Uncovered - Malware Analysis
Thomas Roccia859 vistas
Cuckoo Sandbox: Automated malware analysis por jekil
Cuckoo Sandbox: Automated malware analysisCuckoo Sandbox: Automated malware analysis
Cuckoo Sandbox: Automated malware analysis
jekil2.1K vistas
Reversing & malware analysis training part 9 advanced malware analysis por Abdulrahman Bassam
Reversing & malware analysis training part 9   advanced malware analysisReversing & malware analysis training part 9   advanced malware analysis
Reversing & malware analysis training part 9 advanced malware analysis
Abdulrahman Bassam1K vistas
Reversing & malware analysis training part 12 rootkit analysis por Abdulrahman Bassam
Reversing & malware analysis training part 12   rootkit analysisReversing & malware analysis training part 12   rootkit analysis
Reversing & malware analysis training part 12 rootkit analysis
Abdulrahman Bassam1.4K vistas
Advanced Malware Analysis Training Session 5 - Reversing Automation por securityxploded
Advanced Malware Analysis Training Session 5 - Reversing AutomationAdvanced Malware Analysis Training Session 5 - Reversing Automation
Advanced Malware Analysis Training Session 5 - Reversing Automation
securityxploded14K vistas
Reversing & Malware Analysis Training Part 13 - Future Roadmap por securityxploded
Reversing & Malware Analysis Training Part 13 - Future RoadmapReversing & Malware Analysis Training Part 13 - Future Roadmap
Reversing & Malware Analysis Training Part 13 - Future Roadmap
securityxploded12.8K vistas
Reversing & Malware Analysis Training Part 11 - Exploit Development [Advanced] por securityxploded
Reversing & Malware Analysis Training Part 11 - Exploit Development [Advanced]Reversing & Malware Analysis Training Part 11 - Exploit Development [Advanced]
Reversing & Malware Analysis Training Part 11 - Exploit Development [Advanced]
securityxploded14.3K vistas
Windows Kernel Debugging por Thomas Roccia
Windows Kernel DebuggingWindows Kernel Debugging
Windows Kernel Debugging
Thomas Roccia953 vistas
Malware analysis as a hobby (Owasp Göteborg) por Michael Boman
Malware analysis as a hobby (Owasp Göteborg)Malware analysis as a hobby (Owasp Göteborg)
Malware analysis as a hobby (Owasp Göteborg)
Michael Boman776 vistas
Sandbox vs manual malware analysis v1.1 por Michael Gough
Sandbox vs manual malware analysis v1.1Sandbox vs manual malware analysis v1.1
Sandbox vs manual malware analysis v1.1
Michael Gough2.4K vistas
Advanced Malware Analysis Training Session 3 - Botnet Analysis Part 2 por securityxploded
Advanced Malware Analysis Training Session 3 - Botnet Analysis Part 2Advanced Malware Analysis Training Session 3 - Botnet Analysis Part 2
Advanced Malware Analysis Training Session 3 - Botnet Analysis Part 2
securityxploded13.2K vistas
Malware Detection with OSSEC HIDS - OSSECCON 2014 por Santiago Bassett
Malware Detection with OSSEC HIDS - OSSECCON 2014Malware Detection with OSSEC HIDS - OSSECCON 2014
Malware Detection with OSSEC HIDS - OSSECCON 2014
Santiago Bassett19.4K vistas
Threat Intelligence with Open Source Tools - Cornerstones of Trust 2014 por Santiago Bassett
Threat Intelligence with Open Source Tools - Cornerstones of Trust 2014Threat Intelligence with Open Source Tools - Cornerstones of Trust 2014
Threat Intelligence with Open Source Tools - Cornerstones of Trust 2014
Santiago Bassett18.2K vistas
Visiting the Bear Den por ESET
Visiting the Bear DenVisiting the Bear Den
Visiting the Bear Den
ESET17.5K vistas
ACDM approche detection malware por youssra chaib
ACDM approche detection malware ACDM approche detection malware
ACDM approche detection malware
youssra chaib1.5K vistas

Similar a Sec day cuckoo_workshop

Installation open erp por
Installation open erpInstallation open erp
Installation open erpAddi Ait-Mlouk
3.5K vistas39 diapositivas
Installation Et Configuration De Monkey Spider por
Installation Et Configuration De Monkey SpiderInstallation Et Configuration De Monkey Spider
Installation Et Configuration De Monkey SpiderMohamed Ben Bouzid
1.8K vistas7 diapositivas
Installer et configurer NAGIOS sous linux por
Installer et configurer NAGIOS sous linuxInstaller et configurer NAGIOS sous linux
Installer et configurer NAGIOS sous linuxZakariyaa AIT ELMOUDEN
6.6K vistas8 diapositivas
WordCamp Lyon 2015 - WordPress, Git et l'intégration continue por
 WordCamp Lyon 2015 - WordPress, Git et l'intégration continue WordCamp Lyon 2015 - WordPress, Git et l'intégration continue
WordCamp Lyon 2015 - WordPress, Git et l'intégration continueStéphane HULARD
4.1K vistas35 diapositivas
Mise en place d’un laboratoire de sécurité « Scénarios d’Attaques et Détectio... por
Mise en place d’un laboratoire de sécurité « Scénarios d’Attaques et Détectio...Mise en place d’un laboratoire de sécurité « Scénarios d’Attaques et Détectio...
Mise en place d’un laboratoire de sécurité « Scénarios d’Attaques et Détectio...Trésor-Dux LEBANDA
136 vistas65 diapositivas
memoire utilisation de Puppet et Nagios por
memoire utilisation de Puppet et Nagiosmemoire utilisation de Puppet et Nagios
memoire utilisation de Puppet et Nagiosabouaalexis
1.9K vistas16 diapositivas

Similar a Sec day cuckoo_workshop(20)

Installation Et Configuration De Monkey Spider por Mohamed Ben Bouzid
Installation Et Configuration De Monkey SpiderInstallation Et Configuration De Monkey Spider
Installation Et Configuration De Monkey Spider
Mohamed Ben Bouzid1.8K vistas
WordCamp Lyon 2015 - WordPress, Git et l'intégration continue por Stéphane HULARD
 WordCamp Lyon 2015 - WordPress, Git et l'intégration continue WordCamp Lyon 2015 - WordPress, Git et l'intégration continue
WordCamp Lyon 2015 - WordPress, Git et l'intégration continue
Stéphane HULARD4.1K vistas
Mise en place d’un laboratoire de sécurité « Scénarios d’Attaques et Détectio... por Trésor-Dux LEBANDA
Mise en place d’un laboratoire de sécurité « Scénarios d’Attaques et Détectio...Mise en place d’un laboratoire de sécurité « Scénarios d’Attaques et Détectio...
Mise en place d’un laboratoire de sécurité « Scénarios d’Attaques et Détectio...
Trésor-Dux LEBANDA136 vistas
memoire utilisation de Puppet et Nagios por abouaalexis
memoire utilisation de Puppet et Nagiosmemoire utilisation de Puppet et Nagios
memoire utilisation de Puppet et Nagios
abouaalexis1.9K vistas
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter... por XavierPestel
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
XavierPestel805 vistas
Rapport openembedded por Ayoub Rouzi
Rapport openembeddedRapport openembedded
Rapport openembedded
Ayoub Rouzi149 vistas
Intégration continue des projets PHP avec Jenkins por Hugo Hamon
Intégration continue des projets PHP avec JenkinsIntégration continue des projets PHP avec Jenkins
Intégration continue des projets PHP avec Jenkins
Hugo Hamon20.1K vistas
De la chaîne de production au SI géré par des logiciels por Johan Moreau
De la chaîne de production au SI géré par des logicielsDe la chaîne de production au SI géré par des logiciels
De la chaîne de production au SI géré par des logiciels
Johan Moreau662 vistas
Gérer ses environnements de développement avec vagrant - PHP Tour Nantes 2012 por Jean-Marc Fontaine
Gérer ses environnements de développement avec vagrant - PHP Tour Nantes 2012Gérer ses environnements de développement avec vagrant - PHP Tour Nantes 2012
Gérer ses environnements de développement avec vagrant - PHP Tour Nantes 2012
Jean-Marc Fontaine3.5K vistas
Sécurité internet sandboxie por GillRoy
Sécurité internet  sandboxieSécurité internet  sandboxie
Sécurité internet sandboxie
GillRoy422 vistas
Devenez l’Élu et maitrisez la Matrice AWS 🦸 por Membré Guillaume
Devenez l’Élu et maitrisez la Matrice AWS 🦸Devenez l’Élu et maitrisez la Matrice AWS 🦸
Devenez l’Élu et maitrisez la Matrice AWS 🦸
Membré Guillaume41 vistas
Creation de cluster (Master et deux slave ) nfs, htcondor, mpi por Khalid EDAIG
Creation de cluster (Master et deux slave ) nfs, htcondor, mpiCreation de cluster (Master et deux slave ) nfs, htcondor, mpi
Creation de cluster (Master et deux slave ) nfs, htcondor, mpi
Khalid EDAIG795 vistas
Infra as Code, choisissez vous la pilule rouge ou la pilule bleue - Devoxx 2016 por Fabien Arcellier
Infra as Code, choisissez vous la pilule rouge ou la pilule bleue - Devoxx 2016Infra as Code, choisissez vous la pilule rouge ou la pilule bleue - Devoxx 2016
Infra as Code, choisissez vous la pilule rouge ou la pilule bleue - Devoxx 2016
Fabien Arcellier1.4K vistas
Reverse Engineering d'un ransomware por NinaSAMMUT
Reverse Engineering d'un ransomwareReverse Engineering d'un ransomware
Reverse Engineering d'un ransomware
NinaSAMMUT66 vistas
Retour d'expérience technique Go, gRPC, Kubernetes por Vincent Composieux
Retour d'expérience technique Go, gRPC, KubernetesRetour d'expérience technique Go, gRPC, Kubernetes
Retour d'expérience technique Go, gRPC, Kubernetes
Vincent Composieux1.1K vistas
Oxalide Workshop #4 - Docker, des tours dans le petit bassin por Ludovic Piot
Oxalide Workshop #4 - Docker, des tours dans le petit bassinOxalide Workshop #4 - Docker, des tours dans le petit bassin
Oxalide Workshop #4 - Docker, des tours dans le petit bassin
Ludovic Piot883 vistas
Oxalide Workshop #4 - Docker, des tours dans le petit bassin por Oxalide
Oxalide Workshop #4 - Docker, des tours dans le petit bassinOxalide Workshop #4 - Docker, des tours dans le petit bassin
Oxalide Workshop #4 - Docker, des tours dans le petit bassin
Oxalide2.6K vistas
Ops@viadeo : Puppet & Co... 6 mois après par Xavier Krantz por Olivier DASINI
Ops@viadeo : Puppet & Co... 6 mois après par Xavier KrantzOps@viadeo : Puppet & Co... 6 mois après par Xavier Krantz
Ops@viadeo : Puppet & Co... 6 mois après par Xavier Krantz
Olivier DASINI2.3K vistas

Más de Thomas Roccia

TRITON: The Next Generation of ICS Malware por
TRITON: The Next Generation of ICS MalwareTRITON: The Next Generation of ICS Malware
TRITON: The Next Generation of ICS MalwareThomas Roccia
1.6K vistas31 diapositivas
CoinMiners are Evasive - BsidesTLV por
CoinMiners are Evasive - BsidesTLVCoinMiners are Evasive - BsidesTLV
CoinMiners are Evasive - BsidesTLVThomas Roccia
1.8K vistas34 diapositivas
42 - Malware - Understand the Threat and How to Respond por
42 - Malware - Understand the Threat and How to Respond42 - Malware - Understand the Threat and How to Respond
42 - Malware - Understand the Threat and How to RespondThomas Roccia
1.9K vistas65 diapositivas
Wannacry | Technical Insight and Lessons Learned por
Wannacry | Technical Insight and Lessons LearnedWannacry | Technical Insight and Lessons Learned
Wannacry | Technical Insight and Lessons LearnedThomas Roccia
437 vistas39 diapositivas
Sandbox Evasion Cheat Sheet por
Sandbox Evasion Cheat SheetSandbox Evasion Cheat Sheet
Sandbox Evasion Cheat SheetThomas Roccia
1.3K vistas2 diapositivas
Malware Evasion Techniques por
Malware Evasion TechniquesMalware Evasion Techniques
Malware Evasion TechniquesThomas Roccia
4.2K vistas34 diapositivas

Más de Thomas Roccia(6)

TRITON: The Next Generation of ICS Malware por Thomas Roccia
TRITON: The Next Generation of ICS MalwareTRITON: The Next Generation of ICS Malware
TRITON: The Next Generation of ICS Malware
Thomas Roccia1.6K vistas
CoinMiners are Evasive - BsidesTLV por Thomas Roccia
CoinMiners are Evasive - BsidesTLVCoinMiners are Evasive - BsidesTLV
CoinMiners are Evasive - BsidesTLV
Thomas Roccia1.8K vistas
42 - Malware - Understand the Threat and How to Respond por Thomas Roccia
42 - Malware - Understand the Threat and How to Respond42 - Malware - Understand the Threat and How to Respond
42 - Malware - Understand the Threat and How to Respond
Thomas Roccia1.9K vistas
Wannacry | Technical Insight and Lessons Learned por Thomas Roccia
Wannacry | Technical Insight and Lessons LearnedWannacry | Technical Insight and Lessons Learned
Wannacry | Technical Insight and Lessons Learned
Thomas Roccia437 vistas
Sandbox Evasion Cheat Sheet por Thomas Roccia
Sandbox Evasion Cheat SheetSandbox Evasion Cheat Sheet
Sandbox Evasion Cheat Sheet
Thomas Roccia1.3K vistas
Malware Evasion Techniques por Thomas Roccia
Malware Evasion TechniquesMalware Evasion Techniques
Malware Evasion Techniques
Thomas Roccia4.2K vistas

Sec day cuckoo_workshop

  • 1. Analyse de malware automatisée avec Cuckoo SandBox ESGI - Workshop Security Day 2015 Thomas ROCCIA | thomas.roccia@gmail.com | @R1tch1e_
  • 2. Workshop Cuckoo Sandbox 2 Sommaire 0x01 Présentation 0x02 Objectifs 0x03 Analyse de malware 0x04 Analyse automatisée 0x05 Cuckoo Sandbox 0x06 Documentation 0x07 Conclusion
  • 3. Workshop Cuckoo Sandbox 3 0x01 Présentation ● Thomas ROCCIA | @R1tch1e_ ● Analyste en Sécurité des Systèmes d'Information – Investigation numérique (forensic) – Analyse de malware – Test d'intrusion
  • 4. Workshop Cuckoo Sandbox 4 0x02 Objectifs 0x01 Présentation 0x02 Objectifs 0x03 Analyse de malware 0x04 Analyse automatisée 0x05 Cuckoo Sandbox 0x06 Documentation 0x07 Conclusion
  • 5. Workshop Cuckoo Sandbox 5 0x02 Objectifs ● Monter un environnement d'analyse de malware automatisée avec Cuckoo Sandbox ● Analyser les résultats provenant de Cuckoo ● Créer des rapports standards ● Aller plus loin dans l'analyse de malware
  • 6. Workshop Cuckoo Sandbox 6 0x03 Analyse de malware 0x01 Présentation 0x02 Objectifs 0x03 Analyse de malware 0x04 Analyse automatisée 0x05 Cuckoo Sandbox 0x06 Documentation 0x07 Conclusion
  • 7. Workshop Cuckoo Sandbox 7 0x03 Analyse de malware ● Objectif de l'analyse de malware ? – Comprendre son fonctionnement – Générer une signature de détection – Bloquer les actions malveillantes ● Limite de l'analyse de malware manuelle – Nécessite une bonne connaissance de l'assembleur – Analyse souvent longue et fastidieuse
  • 8. Workshop Cuckoo Sandbox 8 0x04 Analyse automatisée 0x01 Présentation 0x02 Objectifs 0x03 Analyse de malware 0x04 Analyse automatisée 0x05 Cuckoo Sandbox 0x06 Documentation 0x07 Conclusion
  • 9. Workshop Cuckoo Sandbox 9 0x04 Analyse automatisée ● Objectif de l'analyse automatisée ? – Comprendre rapidement le fonctionnement du malware – Identifier ses connexions vers l'extérieur – Identifier les fichiers créés – Générer une signature de détection – Comparer sa signature sur des bases connues (virustotal) – Établir une première estimation de ses capacités – Générer des rapports automatisés ● Limite de l'analyse automatisée – Nécessite une analyse approfondie complémentaire (Reverse Engineering ...) – Certains malwares détectent qu'ils sont dans un environnement d'analyse
  • 10. Workshop Cuckoo Sandbox 10 0x05 Cuckoo Sandbox 0x01 Présentation 0x02 Objectifs 0x03 Analyse de malware 0x04 Analyse automatisée 0x05 Cuckoo Sandbox 0x06 Documentation 0x07 Conclusion
  • 11. Workshop Cuckoo Sandbox 11 0x05 Cuckoo Sandbox ● Rappel et définition d'une sandbox ● Selon Wikipédia : « Une  sandbox  (anglicisme  signifiant  «  bac  à  sable  »)  est  un  mécanisme  qui  permet  l'exécution  de  logiciel(s)  avec  moins  de  risques pour le système d'exploitation. Ces derniers sont souvent  utilisés  pour  exécuter  du  code  non  testé  ou  de  provenance  douteuse. »  ● Pour faire simple : Une sandbox est un environnement contrôlé qui permet d'étudier  des  logiciels  malveillants  (malware)  afin  d'en  comprendre  leur  fonctionnement.
  • 12. Workshop Cuckoo Sandbox 12 0x05 Cuckoo Sandbox ● Présentation – Développé par Claudio Guarnieri – Créé en 2010 – Soutenu par le projet www.honeynet.org – Open Source et sous licence GNU – Développé en python – www.cuckoosandbox.org – irc.freenode.net #cuckoosandbox
  • 13. Workshop Cuckoo Sandbox 13 0x05 Cuckoo Sandbox ● Principe de fonctionnement – Environnement « bac-à-sable » automatisé – Connecté à des machines virtuelles – Gestion de divers fichiers (exe, PDF, OLE, PHP)
  • 14. Workshop Cuckoo Sandbox 14 0x05 Cuckoo Sandbox ● Pré-requis – Une VM Ubuntu desktop 14 (25 Go / 3 Go de RAM) + les VMtools – Installation de Virtualbox dans la VM – Un système Windows « clean » de base dans la VM (9Go / 1Go de RAM) ● Network : Host only vboxnet et NAT ● Ajouter un mot de passe sur le compte Windows
  • 15. Workshop Cuckoo Sandbox 15 0x05 Cuckoo Sandbox ● Configuration de l'hôte Cuckoo – Installation par défaut Ubuntu Desktop 14 LTS (25Go et 3Go de RAM) – Installation des paquets python et dépendances : $ apt­get install python 2.7  $ apt­get install python­magic  $ apt­get install python­dpkt  $ apt­get install python­mako $ apt­get install python­sqlalchemy   $ apt­get install python­jinja2 $ apt­get install python­bottle $ apt­get install python­pefile $ apt­get install python­libvirt $ apt­get install python2.7­dev $ apt­get update && apt­get dist­upgrade
  • 16. Workshop Cuckoo Sandbox 16 0x05 Cuckoo Sandbox ● Configuration du serveur Cuckoo – Installation ssdeep pour le calcul de hash : – Installation de MongoDB : $ apt­get install ssdeep   $ apt­get install python­pyrex  $ apt­get install subversion   $ apt­get install libfuzzy­dev    $ svn checkout http://pyssdeep.googlecode.com/svn/trunk/ pyssdeep   $ cd pyssdeep   $ python setup.py build   $ python setup.py install $ apt­get install ssdeep build­essential git libpcre3 libpcre3­dev    $ apt­get install python­pyrex libcre++­dev libssdeep $ apt­get install subversion   $ apt­get install libfuzzy­dev  $ cd /opt   $ git clone https://github.com/kbandla/pydeep.git   $ cd /opt/pydeep/  $ python setup.py build   $ python setup.py install $ apt­get install python­pymongo  $ apt­get install mongodb 
  • 17. Workshop Cuckoo Sandbox 17 0x05 Cuckoo Sandbox ● Configuration de l'hôte Cuckoo – Installation de Yara :  $ apt­get install g++  $ apt­get install automake ­y  $ wget http://yara­project.googlecode.com/files/yara­1.6.tar.gz    $ tar ­xvzf yara­1.6.tar.gz    $ cd yara­1.6    $ ./configure    $ make    $ make check    $ make install  $ wget http://yara­project.googlecode.com/files/yara­python­1.6.tar.gz    $ tar ­xvzf yara­python­1.6.tar.gz    $ cd yara­python­1.6    $ python setup.py build    $ python setup.py install
  • 18. Workshop Cuckoo Sandbox 18 0x05 Cuckoo Sandbox ● Configuration de l'hôte Cuckoo  – Installation de TCPdump : – Téléchargement de Cuckoo Sandbox : – Création du user cuckoo et installation virtualbox : $ apt­get install tcpdump libcap2­bin   $ setcap cap_net_raw,cap_net_admin=eip /usr/sbin/tcpdump   $ getcap /usr/sbin/tcpdump $ git clone git://github.com/cuckoobox/cuckoo.git    $ sudo apt­get install virtualbox $ sudo adduser cuckoo   $ usermod ­a ­G vboxusers cuckoo  $ sudo usermod ­G libvirtd cuckoo $ id cuckoo
  • 19. Workshop Cuckoo Sandbox 19 0x05 Cuckoo Sandbox ● Configuration de l'hôte Cuckoo  – Paquets supplémentaires : $ wget https://bootstrap.pypa.io/get­pip.py $ sudo python get­pip.py $ sudo pip install cybox==2.0.1.4 $ sudo pip install maec==4.0.1.0 $ sudo apt­get install wireshark
  • 20. Workshop Cuckoo Sandbox 20 0x05 Cuckoo Sandbox ● Configuration de la machine de test – Windows XP (9Go et 1Go RAM) – Configuration en 2 cartes réseaux (host-only vboxnet0 + NAT) – Créer un compte avec mot de passe – Installation des Virtualbox-tool – Configuration d'un dossier partagé (Shared Folders) ● Choisir un répertoire (par exemple /home/share) ● Cocher les options (RO, Auto-mount, Permanent) – Monter ensuite le répertoire dans Windows ● Clic droit my computer => map network drive ● Ajouter vboxsrvshare
  • 21. Workshop Cuckoo Sandbox 21 0x05 Cuckoo Sandbox ● Configuration de la machine de test – Désactivation des éléments de sécurité (Firewall, Windows Update...) – Installation Python 2.7 https://www.python.org/downloads/release/python-279/ – Installation Python PIL 1.1.7 : http://www.pythonware.com/products/pil/ – Installation des logiciels susceptibles d'être des vecteurs d'infection (Adobe Reader 9.5, Flash player 3, Office 2007 + désactiver sécu macro, Firefox 3.6, Java 6...) et désactivation de leurs MAJ automatiques + descendre leurs niveaux de sécurité. Http://www.oldapps.com
  • 22. Workshop Cuckoo Sandbox 22 0x05 Cuckoo Sandbox ● Configuration de la machine de test – Copier le script /opt/cuckoo/agent/agent.py dans le dossier share – Dans Windows copier le fichier agent.py dans C:python27 et dans le startup c:Document_and_settingsall_userStart_MenuProgramsstartup – Exécuter le fichier agent.py et vérifier qu'une socket est ouverte sur le port 0.0.0.0:8000 avec la commande netstat ­aon – Remarque : lorsque l'on clique sur le fichier agent.py une console s'ouvre,  pour ne pas la voir, il suffit de renommer le fichier agent.py en agent.pyw
  • 23. Workshop Cuckoo Sandbox 23 0x05 Cuckoo Sandbox ● Configuration de Cuckoo Sandbox – Fichier de configuration /opt/cuckoo/conf/ : ● Cuckoo.conf : c'est le fichier de configuration principal. Il permet de définir le comportement de la sandbox et les objectifs. ● Virtualbox.conf : il contient les informations sur l'environnement virtuel (un fichier pour les différents environnements) ● Processing.conf : ce fichier permet d'activer et de configurer les différents modules de traitement (virustotal...) ● Reporting.conf : ce fichier contient les stratégies d'analyse (réseau, comportementale...)
  • 24. Workshop Cuckoo Sandbox 24 0x05 Cuckoo Sandbox ● Configuration de Cuckoo Sandbox – Configuration du fichier cuckoo.conf ● Mettre l'IP de l'interface virtuel (vboxnet0) ● Machine manager : virtualbox ● D'autres fonctionnalités – Configuration du fichier virtualbox.conf : ● Changer le nom de la machine (cuckoo1) / mettre le nom de la vm dans le champ machine et dans le label. ● Ajouter l'OS de la VM (Windows) ● Ajouter l'IP de la VM ● Ajouter le nom du snapshot ● Dé-commenter et modifier si besoin l'interface
  • 25. Workshop Cuckoo Sandbox 25 0x05 Cuckoo Sandbox ● Configuration de Cuckoo Sandbox – Configuration du fichier processing.conf : ● Modifier l'API Virus Total ● Laisser le reste du fichier par défaut – Configuration du fichier reporting.conf : ● Modifier le fichier si besoin – Configuration du fichier physical.conf : ● Ajouter les credentiales de la machine virtuelle – Snapshot de la machine windows (attention à respecter le nom du  snapshot (Snapshot1) et pas en root !) : $ vboxmanage snapshot "CuckooXP" take "Snapshot1" ­­pause
  • 26. Workshop Cuckoo Sandbox 26 0x05 Cuckoo Sandbox Cuckoo est à présent opérationnel ! ● Lancement de Cuckoo Sandbox. Attention au droit ! ● Envoi d'un fichier à cuckoo en ligne de commande ● Lancement de l'interface web $ ./cuckoo.py $ cd /opt/cuckoo/util/ $ ./submit.py <sample>  $ cd /opt/cuckoo/util/ $ ./web.py
  • 27. Workshop Cuckoo Sandbox 27 0x05 Cuckoo Sandbox
  • 28. Workshop Cuckoo Sandbox 28 0x05 Cuckoo Sandbox ● Base de données de malware : – http://malwaredb.malekal.com/ – http://virusshare.com/ – http://oc.gtisc.gatech.edu:8080/ – http://contagiodump.blogspot.fr/ – https://www.google.com/cse/home?cx=001439139068102 559330:uruncpbgqm8 – https://avcaesar.malware.lu/ – http://syrianmalware.com/ – URLs malveillantes : http://www.scumware.org/
  • 29. Workshop Cuckoo Sandbox 29 0x05 Cuckoo Sandbox ● Analyse d'un fichier malveillant – Envoi du fichier laroux.xls :
  • 30. Workshop Cuckoo Sandbox 30 0x05 Cuckoo Sandbox ● Analyse d'URL malveillante : – Configuration de l'interface réseau (NAT) – Envoi de l'URL malveillante : $ ./submit.py ­­url <url>  
  • 31. Workshop Cuckoo Sandbox 31 0x05 Cuckoo Sandbox ● Fichiers de reporting : – /opt/cuckoo/storage ● Analyses : contient tout les éléments de l'analyse ● Binaries : contient les binaires analysés – /opt/cuckoo/storage/analyses/
  • 32. Workshop Cuckoo Sandbox 32 0x05 Cuckoo Sandbox ● Contenu du fichier report.html – Info : cette section donne des informations sur le déroulé de l'analyse (type de fichier, timestamp, nom de la VM de test, durée de l'analyse, version de Cuckoo...) – File : cette section contient des informations sur le fichier analysé (nom, taille, type de fichier, empreinte, détection PeiD, détection YARA et VirusTotal) – Signatures : Il s'agit des signatures de détection (utils/./community.py ­a) – Screenshot : il s'agit des copies d'écran de la vm lors de l'analyse (fichier du repertoire shots) – Static Analysis : il s'agit d'informations sur le fichier (strings, DLL, Sections, imports...) – Dropped Files : il s'agit des fichiers créés par le malware – Network : cette section contient les connexions réseaux du fichier – Behavior : cette section contient des informations sur le comportement du malware (registre, processus, fichiers, mutexes...)
  • 33. Workshop Cuckoo Sandbox 33 0x05 Cuckoo Sandbox ● Créer des rapports MAEC (Malware Attribute Enumeration and Characterization) – Modifier le fichier reporting.conf : maec40 = on $ sudo apt­get install treeline $ Treeline report.maec.xml (choisir generic xml) http://maec.mitre.org/
  • 34. Workshop Cuckoo Sandbox 34 0x05 Cuckoo Sandbox ● Créer des rapports PDF – Installation : – Supprimer /cuckoo/modules/reporting/reporthtml.pyc – Créer un fichier pdf.py : – Dans le fichier reporthtml.py ajouter la ligne : $ sudo apt­get install wkhtmltopdf $ git clone https://github.com/JazzCore/python­pdfkit.git $ sudo python setup.py build $ sudo python setup.py install import pdfkit def create_pdf(xhtml, dest):     pdfkit.from_file(xhtml, dest)  from pdf import create_pdf 
  • 35. Workshop Cuckoo Sandbox 35 0x05 Cuckoo Sandbox ● Créer des rapports PDF – Ajouter à la fin du fichier reporthtml.py : try:    xhtml = open(self.reports_path+"/report.html")    create_pdf(xhtml, self.reports_path+"/report.pdf")    xhtml.close() except (Exception, TypeErro, IOError) as e:    raise CuckooReportError("Failed to generate PDF report: %s" % e)
  • 36. Workshop Cuckoo Sandbox 36 0x05 Cuckoo Sandbox Aller plus loin dans l'analyse de malware... ● Interface Web Cuckoo 1.2 ● Cuckoo et Volatility ● Cuckoo et Yara ● Aller encore plus loin
  • 37. Workshop Cuckoo Sandbox 37 0x05 Cuckoo Sandbox ● Interface web Cuckoo 1.2 – Configuration ● Activer la base de donnée MongoDB dans le fichier cuckoo/conf/reporting.conf ● Lancer l'interface web : ● $ cd cuckoo/web/ $ python manage.py runserver
  • 38. Workshop Cuckoo Sandbox 38 0x05 Cuckoo Sandbox ● Interface web Cuckoo 1.2
  • 39. Workshop Cuckoo Sandbox 39 0x05 Cuckoo Sandbox ● Cuckoo Sandbox et Volatility – Configuration ● Installation de volatility (apt-get install volatility) ● Cuckoo.conf : modifier memory_dump = on ● Remarque : les dumps mémoires prennent beaucoup  de place, il faudra donc prévoir en conséquence la  taille du disque dans une utilisation courante. ● Le fichier créé se retrouve donc dans le répertoire de l'analyse.
  • 40. Workshop Cuckoo Sandbox 40 0x05 Cuckoo Sandbox ● Cuckoo Sandbox et Volatility – Analyse de base Identification de la machine : $ volatility ­f memory.dmp imageinfo Analyse des processus : $ volatility ­f memory.dmp ­­profile=WinXPSP3x86 pslist $ volatility ­f memory.dmp ­­profile=WinXPSP3x86 pstree Analyse des connexions : $ volatility ­f memory.dmp ­­profile=WinXPSP3x86 connections Dump d'un processus : $ volatility ­f memory.dmp ­­profile=WinXPSP3x86 procexedump ­p 564 ­D opt/ $ volatility ­f memory.dmp ­­profile=WinXPSP3x86 procexedump ­p 564 ­D opt/ Afficher l'aide : $ volatility ­h
  • 41. Workshop Cuckoo Sandbox 41 0x05 Cuckoo Sandbox ● Cuckoo Sandbox et Yara – Configuration ● Créer une nouvelle règle /opt/cuckoo/data/yara/binaries/hello.yar: rule HelloWorld { meta:         author = "r1tch1e" strings: $a = "hello world" condition: $a }
  • 42. Workshop Cuckoo Sandbox 42 0x05 Cuckoo Sandbox ● Cuckoo Sandbox et Yara – Configuration ● Modifier le fichier /opt/cuckoo/data/yara/index_binaries.yar ● Tester la règle : include "/home/r1tch1e/opt/cuckoo/data/yara/binaries/embedded.yar" include "/home/r1tch1e/opt/cuckoo/data/yara/binaries/shellcodes.yar" include "/home/r1tch1e/opt/cuckoo/data/yara/binaries/vmdetect.yar" include "/home/r1tch1e/opt/cuckoo/data/yara/binaries/hello.yar" $ yara hello.yar /home/r1tch1e/share/ HelloWorld /home/r1tch1e/share//hello.exe
  • 43. Workshop Cuckoo Sandbox 43 0x05 Cuckoo Sandbox ● Volatitlity et Yara : volatility ­f memory.dmp yarascan ­y cuckoo/data/yara/binaries/hello.yar 
  • 44. Workshop Cuckoo Sandbox 44 0x05 Cuckoo Sandbox ● Pour aller encore plus loin – CuckooMX (https://github.com/xme/cuckoomx) – Pafish Hardening VM (https://github.com/a0rtega/pafish) – Interface graphique avec maltego (https://github.com/bostonlink/cuckooforcanari)
  • 45. Workshop Cuckoo Sandbox 45 0x06 Documentation 0x01 Présentation 0x02 Objectifs 0x03 Analyse de malware 0x04 Analyse automatisée 0x05 Cuckoo Sandbox 0x06 Documentation 0x07 Conclusion
  • 46. Workshop Cuckoo Sandbox 46 0x06 Documentation ● http://www.cuckoosandbox.org/ ● https://malwr.com/ ● https://github.com/bostonlink/cuckooforcanari ● http://maec.mitre.org/ ● https://cuckoo.readthedocs.org/en/latest/ ● https://blog.malwarebytes.org/intelligence/2014/04/automati ng-malware-analysis-with-cuckoo-sandbox/ ● http://www.honeynet.org/ ● http://www.google.fr (joke inside)
  • 47. Workshop Cuckoo Sandbox 47 0x07 Conclusion 0x01 Présentation 0x02 Objectifs 0x03 Analyse de malware 0x04 Analyse automatisée 0x05 Cuckoo Sandbox 0x06 Documentation 0x07 Conclusion
  • 48. Workshop Cuckoo Sandbox 48 0x07 Conclusion ● Gain de temps ● Identification rapide de la charge malicieuse ● Amélioration du processus de résolution ● Analyse de fichiers et d'URLs ● Multiples fonctionnalités avec les plugins ● Gestion d'une base de connaissance ● Création automatique de rapports
  • 49. Workshop Cuckoo Sandbox 49 Thomas ROCCIA | @R1tch1e_