Trend Micro Canada David Girard Malware Analysis basic skills for the Enterprise Techniques de base pour l analyse de code malicieux en entreprise Tous droits réservés / Copyright 2012 Trend Micro Inc. 1
60 min. Workshop Agenda Atelier bilingue de 60 minutes donné au Hackfest.ca 2012 60 Workshop, 11-2012 Par David Girard Why you need basic skills in malware analysis? / Pourquoi avez-vous besoin d avoir un minimum de connaissances en analyse de code malicieux? How to build your lab? Or simply buy or rent one. / Comment monter un lab? Ou tout simplement en acheter ou louer un. Let s infect a Sandbox and analyze it. / Infectons notre Sandbox et analysons le. Q&A / Q&R David vcard 11/15/2012 2 Tous droits réservés / Copyright 2012 Trend Micro Inc. 2
Why you need basic skills? Enterprise management is asking tough questions: Damages? How much? Did we lost any Intellectual property or customers confidential information? Do you know if our critical assets were compromised? To answer these questions you need to investigate and understand what just hit you. At the same time, it help you adjust your defenses and block the next wave. For malware incidents, the answer is malware analysis in a malware lab that you build, rent or buy. 11/15/2012 3 Tous droits réservés / Copyright 2012 Trend Micro Inc. 3
Pourquoi des connaissances de base? Les exécutifs vous posent des questions difficile à répondre : Combien de dommages? Avons-nous perdu des données confidentielles ou notre propriété intellectuelle? Savez-vous si nos actifs critiques ont été compromis? Pour répondre à ces questions vous devez investiguer et comprendre ce qui vient de vous arriver. Au même moment, cela vous aide à ajuster votre défense et bloquer la prochaine vague. Pour les incidents de code malicieux, la réponse est d analyser le malware dans laboratoire que vous construisez, louez ou achetez. 11/15/2012 4 Tous droits réservés / Copyright 2012 Trend Micro Inc. 4
Rent / Location Use can use a Sandbox on the net. Many exist. Some are free and some are not. Utiliser un Sandbox sur Internet. Plusieurs existent. Quelques uns sont gratuits et d autres ne le sont pas. You can rent the expertise of an independant malware analyst if you don t have enough expertise in house. Vous pouvez aussi louer les services d un analyste en code malicieux si vous n avez pas l expertise à l interne. 11/15/2012 5 Tous droits réservés / Copyright 2012 Trend Micro Inc. 5
Buy / Acquisition If maintaining a lab cost to much, you might consider buy one. Si maintenir un lab coûte trop cher, vous pourriez considérer d en acquérir un. If you need to analize a lot of samples at «near» wire speed analysis, you might consider a solution like Trend Micro Deep Discovery that extract files from 100 protocols and send it to custom (maid for you) Sandboxes and generates the reports. Si vous avez besoin d analyser beaucoup d échantillons à la vitesse du réseau (ou presque), vous pourriez considérer une solution comme Trend Micro Deep Discovery qui extrait fichiers d une centaine de protocoles et qui les analysent dans une série de Sandbox sur mesure et génère des rapports http://www.trendmicro.com/us/enterprise/security-risk-management/deepdiscovery/index.html 11/15/2012 6 Tous droits réservés / Copyright 2012 Trend Micro Inc. 6
Build a lab for dynamic analysis / Construire un lab pour analyse dynamique Physical or Virtual? Virtual. Physique ou virtuel? Virtuel. Lab 1 Lab 2 Lab 3* Lab 4 Ubuntu 10+ OS X Windows 7 x64 VMware Virtual Box VirtualBox / VMware Fusion VMware Workstation ESXi Cuckoo Cuckoo Custom Custom XP, Win7 VM s X86, x64 XP, Win7 VM s X86, x64 11/15/2012 7 XP, Win7 VM s X86, x64 XP, Win7 VM s X86, x64 No Internet No Internet No Internet No Internet Network Emulation Network Emulation Network Emulation Network Emulation Keep it isolated from production and hypervisor. Tenir isolé de la production et de l hyperviseur *Risky, Risqué Tous droits réservés / Copyright 2012 Trend Micro Inc. 7
Dynamic Analysis Process / Processus d analyse Create baseline targets XP, 7x86, 7x64, 2008r2, OS X, Android 2.1 Start in a clean state Transfer malware Pre-execution task Execute malware Post execution task Acquire RAM Analyze Hard Drive & Network artifact Créer des cibles de base XP, 7x86, 7x64, 2008r2, OS X, Android 2.1 Démarrer dans un état propre Transférer le code malicieux Tâches avant l exécution Exécution du code Tâches post-exécution Acquérir la mémoire Analyser le disque et les traces réseaux 11/15/2012 8 Tous droits réservés / Copyright 2012 Trend Micro Inc. 8
Custom Labs Add a monitoring machine (not a Windows box please) Add honeypots (File Share, Web Server, USB ). Plus drop fake PII, Medical, Credit card, Outlook PST on those. Add an IDS and Web filtering with everything turn on. Same products that you use in production. Add a Sandbox with your current End Point security solution with the most agressive setup. 11/15/2012 9 Tous droits réservés / Copyright 2012 Trend Micro Inc. 9
Monitoring / Surveillance Disk IO with File Integrity and Disk Integrity tools. Don t forget the MBR, OSSEC, Deep Security, Capture BAT, Handle Network IO with Wireshark and others. Some in the Sandbox and some outside. HoneyPort, ARPWatch, TCPView, NetCat. Registry IO RegShot, ProcMon Process, Thread, Mutex : Process Explorer ou Hacker API Call Trace Plus, Detours, API Logger Memory analysis Memorize VM Snapshot, dd, Volatility, Mandiant TIP 1: Monitor Web Headers : Non Browsers = suspicious TIP 2: Execute twice on different dates. If DNS requests are different than previous date and you got many, you might have a Domain Generator Algorithm in use! 11/15/2012 10 Tous droits réservés / Copyright 2012 Trend Micro Inc. 10
Demo Let s infect a Sandbox and analyze it. Infectons notre Sandbox et analysons le. 11/15/2012 11 Tous droits réservés / Copyright 2012 Trend Micro Inc. 11
Books / Livres Virus Bulletin Magazine : http://www.virusbtn.com 11/15/2012 12 Confidential Copyright 2012 Trend Micro Inc. Tous droits réservés / Copyright 2012 Trend Micro Inc. 12
Références Cuckoo Sandbox http://www.cuckoosandbox.org http://wepawet.iseclab.org/index.php http://jsunpack.jeek.org/dec/go http://blog.didierstevens.com/2009/03/31/pdfid/ http://code.google.com/p/pefile/ http://code.google.com/p/yara-project/ http://code.google.com/p/droidbox/ http://glastopf.org/glastopf.php http://zeltser.com/remnux/ http://code.google.com/p/ghost-usb-honeypot/ 11/15/2012 13 Tous droits réservés / Copyright 2012 Trend Micro Inc. 13
Merci! Thank you! 11/15/2012 Confidential Copyright 2012 Trend Micro Inc. 14 Tous droits réservés / Copyright 2012 Trend Micro Inc. 14