Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PeekabooAV Workshop and Developers Meeting 2.5....

PeekabooAV Workshop and Developers Meeting 2.5.2019

PeekabooAV
Open Source Antivirus with Behavior analysis

The slides we used to introduce and present at our second Workshop and Developers Meeting 2.5.2019 in Tübingen, Germany

Avatar for PeekabooAV

PeekabooAV

May 03, 2019

More Decks by PeekabooAV

Other Decks in Programming

Transcript

  1. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag P E E K AB O O E x t e n d E m a i l K now a word with K? At t a c h m e n t B e h a v i o r Ob s e r v a t i o n Ow l
  2. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag „PeekabooAV macht Cuckoo Sandbox zum AV.“ „Es ist die Verbindung zwischen Mail-System und Verhaltensanalyse.“ „Peekaboo verwaltet die Jobs und Samples, startet die Analyse, wertet aus und entscheidet.“ Was ist PeekabooAV?
  3. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 3,5 Aufgaben Analyse verhindern um Ressourcen zu sparen Submit zur Verhaltensanalyse an Cuckoo Auswertung des Reports Treffen der Entscheidung (Good, Unknown, Bad)
  4. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag § Email § Anhänge § Malware § Amavis § Verhaltensanalyse § Cuckoo Sandbox § PeekabooAV § Aufgaben § Links und weitere Infos Agenda
  5. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Felix Bauer – Atos HPC security, s+c Security Solutions, Tübingen ▶ Michael Weiser – Services Nord, Berlin ▶ Christoph Herrmann - Services Nord, Berlin ▶ Wir haben dieses Projekt vor 2 Jahren begonnen ▶ Kontakt: – @peekabooAV – GitHub scVENUS/PeekabooAV – YouTube Atos Tech Talks 9 Das Team
  6. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Moderne Technologien der Malwareanalyse und Erkennung nutzen und schaffen ▶ OpenSource nutzen und stärken ▶ Die Cyber-Welt sicherer machen 10 Ziele
  7. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Phishing – Email ist eines der Haupteinfallstore für Schadsoftware und Angriffe auf Firmen ▶ Links zu versuchten Webseiten ▶ Anhänge – ZIP-Dateien – JavaScript, Microsoft Office, PDF … – Ransomware – … ▶ Herausforderungen der modernen Malwareerkennung – Polymorphie, gezielte Angriffe, Zerodays – … E-Mail und Malware
  8. 13

  9. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ .exe ▶ .scr ▶ .bat ▶ .js ▶ .ps1 ▶ .vbs verbieten 14 Verbieten von ausführbaren Anhängen
  10. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ .xls ▶ .pdf ▶ .ps ▶ .svg verbieten 15 Verbieten von Anhängen mit ausführbarem Inhalt
  11. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ .* verbieten 16 Verbieten von Anhängen die Schadcode transportieren können
  12. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ .* ▶ .rt, .webm, .tiff, .docx, csv ………… ▶ Dank Metasploit kann das jeder leicht nachvollziehen Verbieten jeglicher Anhänge 17 Dateien die Verwundbarkeiten triggern können
  13. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ .* ▶ .rt, .webm, .tiff, .docx, csv ………… ▶ Dank Metasploit kann das jeder leicht nachvollziehen Ø Anhänge verbieten Ø Email verbieten 18 Dateien die Verwundbarkeiten triggern können Secure
  14. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Problem: – Emailformat ist hässlich – Verarbeitung und Interpretation sind Glückssache – Header, Encodings, Typen, Signatures, HTML Mails, Verschlüsselung …. ▶ Zum Glück gibt es Amavis ▶ Amavis (~30.000 Zeilen Perl) ▶ Industriestandard zur Anbindung von Virenscannern an Mailsysteme ▶ Kann infizierte Mails direkt bei Zustellung ablehnen Email Formate und Anhänge
  15. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Amavis zerlegt die Mails und produziert Dateien p001 … p00x ▶ Original Dateiname ist entscheidend ▶ Original Dateinameserweiterung – Entscheided darüber welche Anwendung die Datei verarbeitet ▶ Datenfelder aus Amavis: – name_declared – type_declared – size – digest – queue_id ▶ dump.info Daten werden über den Socket als JSON an Peekaboo übergeben 21 Plugin für Amavis – dump.info
  16. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Ausführung in einer kontrollierten, isolierten Umgebung (Sandbox) ▶ Beobachtung der ausgeführten Aktionen verraten Schadcode ▶ Signaturen identifizieren Aktionen als ungewollt, ungewöhnlich, exploit Versuch, Einnisten im Betriebssystem … Verhaltensanalyse
  17. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Maschinenabbild des Unternehmens in der VM – Gleiche Software, gleiche Version – Gleiche Verwundbarkeiten – Gleiche Angriffsvektoren 25 Virtuelle Maschinen als Sandbox
  18. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Korrektes Extrahieren der Anhänge ▶ Bestimmung des Dateityps ▶ Exploit Wahrscheinlichkeit ▶ Angriff auf Emailanwendung ▶ Angriffe auf Endpoint Protection ▶ Archive und Container ▶ Sandbox-Erkennung 26 Herrausforderungen
  19. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Korrektes Extrahieren der Anhänge amavis ▶ Bestimmung des Dateityps name_declared ▶ Exploit Wahrscheinlichkeit gleicher Softwarestand ▶ Angriff auf Emailanwendung noch in Arbeit ▶ Angriffe auf die Enpoint Protection noch in Arbeit ▶ Archive und Container auspacken ▶ Sandbox-Erkennung Erkennungserkennung 27 Herrausforderungen
  20. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ https://cuckoo.sh/docs/index.html ▶ OpenSource (GPLv3) ▶ Support for „all“ hypervisors ▶ Agent.py runs in VMs ▶ Snapshot of running machines ▶ Analysis ▶ Debugger, API hooks, sniffer … gather data ▶ Communication over host only network ▶ Automated report generation Cuckoo Sandbox
  21. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 31 Analysis Report crashAcroRd8.pdf
  22. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 32 Analysis Report DangerousCryptLocker.xls
  23. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 33 Analysis Report DangerousCryptLocker.xls 2
  24. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 34 Analysis Report DangerousCryptLocker.xls 3
  25. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 35 Analysis Report DangerousCryptLocker.xls 4
  26. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 36 Analysis Report autostart welcome message.csv 1
  27. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 37 Analysis Report autostart welcome message.csv 2
  28. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 38 Analysis Report autostart welcome message.csv 3
  29. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag Macro-less Code Exec in MSWord ▶ https://sensepost.com/blog/2017/macro- less-code-exec-in-msword/ ▶ Dynamic Data Exchange (DDE) 39 Analysis Report Powershell-evilserver-ninja.docx 1
  30. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 40 Analysis Report Powershell-evilserver-ninja.docx 2
  31. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 41 Analysis Report Powershell-evilserver-ninja.docx 3
  32. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 42 Dropped Files
  33. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 43 Domain Generator
  34. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Mailsystem empfängt Email (Postfix) ▶ Postfix benutzt Amavis ▶ Amavis ruft Peekaboo auf ▶ Peekaboo – Bekommt die Anhänge von Amavis – Analysiert sie – Startet, falls nötig, eine Verhaltensanalse – Wertet vollautomatisiert aus – und entscheidet ▶ Meldet zurück an Amavis ▶ Gibt die Mail zurück ans Mailsystem 45 Ablauf
  35. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 46 Ablauf II
  36. 47

  37. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ 1 email ▶ 3 attachments ▶ 3 samples ▶ Erster Anhang ist known ▶ Zweiter ist auf der whitelist ▶ Dritter startet Powershell-Prozess und wird als schädliche erkannt 48 Ablauf IV
  38. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 49 Amavis Virus-Mail
  39. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Ubuntu 18.04 ▶ Postfix ▶ Amavis ▶ Virtualbox ▶ Python ▶ Cuckoo 50 Peekaboo Setup
  40. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ https://github.com/scVENUS/peekabooav-installer ▶ Ansible ▶ Vagrant ▶ User ▶ Virtualenv /opt/[peekaboo|cuckoo]/ 52 PeekabooAV Installer
  41. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ https://vmcloak.readthedocs.io/ ▶ http://jbremer.org/vmcloak3/ ▶ Automatische Erzeugung von Virtuellen Maschinen ▶ Analyse VMs für die Cuckoo Sandbox ▶ Mit VM-Verschleierung, Handware-Profile … 53 VMCloak (Zukunftsmusik)
  42. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Geschrieben in Python ▶ Verarbeitet Parallel (Worker Model) ▶ Statische Tests ▶ Toolbox ▶ Verhaltensanalyse mit Cuckoo Sandbox ▶ Ausgewertet von konfigurierbarem Regelwerk ▶ Fast unbegrenzte Möglichkeiten ▶ Installer verfügbar auf GitHub – https://github.com/scVENUS/PeekabooAV-Installer/ Peekaboo Technologie und Funktionalität
  43. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 56 Regelwerk ▶ ruleset.conf.sample ▶ peekaboo/ruleset/rules.py
  44. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Sample Datenbank – Enthält Hashes und Ergebnis (#3) ▶ Peekaboo und Cuckoo laufen selbst in VM oder Container – Als weitere Hürde gegen Ausbrüche – Datenschutz – Skalierbarkeit 57 More Features
  45. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 59 Dashboards
  46. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag https://github.com/scVENUS/PeekabooAV/releases/tag/v1.7 ▶ give threads names for easier identification ▶ add configuration for rule cuckoo_analysis_failed to override what constitutes failure and what reliably indicates success ▶ localise client communication, i.e. have the system report findings in English by default but provide gettext-compatible translation templates for other languages ▶ add German translation (which was hard-coded in the source before) ▶ add configuration option to force language of client communication beyond $LANG and friends ▶ massively speed up shutdown ▶ make the malware_reports directory configurable ▶ add reporting of an overall analysis result (not just per sample-results) to correctly convey failures in addition to good/bad decisions to the client ▶ usage of separate python virtualenvs for peekaboo and cuckoo is now recommended because we use newer module versions than cuckoo ▶ make internal configuration defaults work so that peekaboo.conf can be mostly empty in standard setups ▶ log multiple analysis jobs per sample in analysis_jobs to get an actual job log ▶ multi-node concurrency coordinated via DB, see section [cluster] in peekaboo.conf.sample ▶ remove analysis_results table from DB schema for simplicity and performance, bump version to 6 ▶ many bug fixes, internal cleanups and improviments PeekabooAV 1.7 released 24 April 2019
  47. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ OpenSource seit 19. Mai 2017 ▶ https://github.com/scVENUS/PeekabooAV ▶ Verfügbar, nutzerbar und erweiterbar von jedem ▶ GPLv3 ▶ Installer: https://github.com/scVENUS/PeekabooAV-Installer 61 Open Source Release
  48. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 63 Beispielnetzwerktopologie
  49. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag 64 Verwendete Hardware § 6 Server mit je: § 128 GB RAM § 1TB RAID1 über SSDs § 48 CPU-Kerne § 12 Parallele Peekaboos
  50. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Inline – Email wird erst nach dem Scan zugestellt (bisher nicht im Einsatz) ▶ BCC – Kopie der Mail wird gescannt, Warnung wird nachgeliefert ▶ Forward – Nutzer leiten auffällige Mails weiter (gut für verschlüsselte Nachrichten) 65 Betriebsarten
  51. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Eigene Mail-Infrastruktur ▶ Virtualisierungs Hardware ▶ Cuckoo Cluster ▶ Erhöhte Sicherheitsanforderungen ▶ Deutsches Produkt gewünscht ▶ OpenSource präferiert ▶ Umfassende Lösung 66 Anforderungen und Einsatzgebiet
  52. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Erweiterungen ▶ Weitere Tests, Regeln, Signaturen ▶ Anbindung weiterer Systeme (MISP, TheHIVE … SOC) ▶ … 68 Was kommt als Nächstes?
  53. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Cuckoo Sandbox ▶ Cuckoo Community ▶ Amavis ▶ Python2 (RIP) ▶ Python Community ▶ OpenSource-Community 69 Dank an!
  54. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Ubuntu Desktop 18.04 (Linux Mint) – User: • ubuntu:password ▶ VM PeekabooAV – User: • peekaboo:password ▶ MISP / TheHive – User: • misp:password1234 Labor Setup
  55. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ 192.168…. – WebUI port 8000 – API port 8090 72 Cuckoo Sandbox Install
  56. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Leeres Word-Dokument ▶ docx ▶ An Peekaboo geben oder direkt an Cuckoo ▶ Per Mail verschicken 73 Aufgabe 1 – Word-Dokument analysieren
  57. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Schauen was die Sandbox sagt 74 Aufgabe 2 – CheckVM.xls
  58. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Tipp: oletools ▶ https://github.com/decalage2/oletools 75 Aufgabe 3 – CheckVM.xls manuell analysieren
  59. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ https://github.com/a0rtega/pafish ▶ https://github.com/David-Reguera-Garcia-Dreg/anticuckoo/ 76 Aufgabe 5 – crash cuckoo und pafish
  60. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Verzeichnis mit verdächtigen eml Dateien ▶ grep, yara, pyton … ▶ https://0x00sec.org/t/tutorial-creating-yara-signatures-for-malware- detection/5453 ▶ http://www.ericagamet.com/wp-content/uploads/2016/04/Erica-Gamets-GREP- Cheat-Sheet.pdf 77 Aufgabe 6 – search 2B|^2B
  61. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Exploits Microsoft Word ▶ https://cape.contextis.com/analysis/70091/ ▶ MalScore 7.9 Malicious ▶ SetUnhandledExceptionFilter detected (possible anti-debug) ▶ Dynamic (imported) function loading detected ▶ Tries to suspend Cuckoo threads to prevent logging of malicious activity ▶ Sniffs keystrokes ▶ A process attempted to delay the analysis task by a long amount of time. ▶ A possible heap spray exploit has been detected 78 Aufgabe 7 – createHugeTable2.docx
  62. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ Dokany 1.2.0.1000 - Stack-Based Buffer Overflow Privilege Escalation – https://www.exploit-db.com/exploits/46155 ▶ Nsauditor 3.0.28.0 - Local SEH Buffer Overflow – https://www.exploit-db.com/exploits/46005 ▶ VLC Media Player - MKV Use-After-Free (Metasploit) – https://www.exploit-db.com/exploits/45626 ▶ Foxit PDF Reader 9.0.1.1049 - Pointer Overwrite Use-After-Free (Metasploit) – https://www.exploit-db.com/exploits/45269 79 Aufgabe 8 – Weitere Exploits
  63. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ T302 VMware Escapology How to Houdini The Hypervisor AbdulAziz Hariri Joshua Smith – https://youtu.be/uRemWLNBSZg ▶ Windows VMs – https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ ▶ MISP – https://www.misp-project.org/ ▶ The Hive – https://thehive-project.org/ 80 Links …
  64. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag ▶ https://www.corelan.be/ ▶ … ▶ Hacking The Art of Exploitation ▶ Malware Analyst‘s Cookbook ▶ Practical Malware Analysis ▶ Security Engineering ▶ The Art of Memory Forensics ▶ Antivirus Hackers Handbook 81 Literatur und Links
  65. | 02.05.2019 | Bauer, Weiser and Herrmann | © Atos

    GBU Germany | Big Data and Security | science + computing ag