Malware Dynamic Analysis Part 6 Veronica Kovah vkovah.ost at gmail See notes for citation1

Slides:



Advertisements
Similar presentations
Malware Dynamic Analysis Part 4 Veronica Kovah vkovah.ost at gmail See notes for citation1
Advertisements

Malware Dynamic Analysis Part 5 Veronica Kovah vkovah.ost at gmail See notes for citation1
Snort: Overview Chris Copeland What is an Intrusion Detection System (IDS)? An intrusion detection system is any system which can identify a network.
Snort & ACID. UTSA IS 6973 Computer Forensics SNORT.
Troubleshooting.
Intrusion Detection Systems and Practices
Snort - an network intrusion prevention and detection system Student: Yue Jiang Professor: Dr. Bojan Cukic CS665 class presentation.
5/1/2006Sireesha/IDS1 Intrusion Detection Systems (A preliminary study) Sireesha Dasaraju CS526 - Advanced Internet Systems UCCS.
© 2006, The Technology Firm Ethereal The Technology Firm.
Lecture 11 Intrusion Detection (cont)
CIS 193A – Lesson12 Monitoring Tools. CIS 193A – Lesson12 Focus Question What are the common ways of specifying network packets used in tcpdump, wireshark,
In-Band Detection of Virtual Machines Estefan Ortiz & Cory Hayes Computer Science and Engineering Graduate Operating Systems December 16,
Automated Malware Analysis
USENIX LISA ‘99 Conference © Copyright 1999, Martin Roesch Snort - Lightweight Intrusion Detection for Networks Martin Roesch.
PROJECT IN COMPUTER SECURITY MONITORING BOTNETS FROM WITHIN FINAL PRESENTATION – SPRING 2012 Students: Shir Degani, Yuval Degani Supervisor: Amichai Shulman.
1 Intrusion Detection Systems. 2 Intrusion Detection Intrusion is any use or attempted use of a system that exceeds authentication limits Intrusions are.
Intrusion Protection Mark Shtern. Protection systems Firewalls Intrusion detection and protection systems Honeypots System Auditing.
University of Calgary – CPSC 441.  Wireshark (originally named Ethereal)is a free and open-source packet analyzer.  It is used for network troubleshooting,
Malware Dynamic Analysis Part 1 Veronica Kovah vkovah.ost at gmail See notes for citation1
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Penetration Testing Security Analysis and Advanced Tools: Snort.
CPSC 441 Tutorial TA: Fang Wang The content of these slides are taken from CPSC 526 TUTORIAL by Nashd Safa (Extended and partially modified)
Brad Baker CS526 May 7 th, /7/ Project goals 2. Test Environment 3. The Problem 4. Some Solutions 5. ModSecurity Overview 6. ModSecurity.
Intrusion Detection: Snort. Basics: History Snort was developed in 1998 by Martin Roesch. It was intended to be an open-source technology, and remains.
IDS Intrusion Detection Systems CERT definition: A combination of hardware and software that monitors and collects system and network information and analyzes.
SNORT Tutorial Sreekanth Malladi (modifying original by N. Youngworth)
Intrusion Detection and Prevention. Objectives ● Purpose of IDS's ● Function of IDS's in a secure network design ● Install and use an IDS ● Customize.
COEN 252: Computer Forensics Network Analysis and Intrusion Detection with Snort.
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
SNORT Feed the Pig Vicki Insixiengmay Jon Krieger.
CSCI 530 Lab Intrusion Detection Systems IDS. A collection of techniques and methodologies used to monitor suspicious activities both at the network and.
Snort & Nmap Mike O’Connor Eric Tallman Matt Yasiejko.
Cs490ns - cotter1 Snort Intrusion Detection System
Saturday, May 17, 2008 Generating signatures for zero-day network attacks Pascal Gamper Daniela Brauckhoff Bernhard Tellenbach.
Christopher Kruegel University of California Engin Kirda Institute Eurecom Clemens Kolbitsch Thorsten Holz Secure Systems Lab Vienna University of Technology.
Writing Snort Rules A quick guide Brian Caswell. 2 The life of a packet through Snort’s detection engine.
Malware Dynamic Analysis Veronica Kovah vkovah.ost at gmail See notes for citation1
Snort Intrusion Detection. What is Snort Packet Analysis Tool Most widely deployed NIDS Initial release by Marty Roesch in 1998 Current version
Network Security: Lab#5 Port Scanners and Intrusion Detection System
An overview.
Intrusion Intrusion Detection Systems with Snort Hailun Yan 564-project.
COEN 252: Computer Forensics Network Analysis and Intrusion Detection with Snort.
Mastering Windows Network Forensics and Investigation Chapter 10: Introduction to Malware.
Sniffer, tcpdump, Ethereal, ntop
Snort - Lightweight Intrusion Detection for Networks YOUNG Wo Sang Program Committee, PISA
Homework tar file Download your course tarball from web page – Named using your PSU ID – Chapter labeled for each binary.
ICS-FORTH WISDOM Workpackage 3: New security algorithm design FORTH-ICS Update and plans for the next six months Heraklion, 4 th June 2007.
WebWatcher A Lightweight Tool for Analyzing Web Server Logs Hervé DEBAR IBM Zurich Research Laboratory Global Security Analysis Laboratory
Greg Steen.  What is Snort?  Snort purposes  Where can it be used?
Network Intrusion Detection System (NIDS)
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
IDS Intrusion Detection Systems CERT definition: A combination of hardware and software that monitors and collects system and network information and analyzes.
Security Log Visualization with a Correlation Engine: Chris Kubecka Security-evangelist.eu All are welcome in the House of Bytes English Language Presentation.
Some Great Open Source Intrusion Detection Systems (IDSs)
IDS Intrusion Detection Systems
Snort – IDS / IPS.
Wireshark Tutorial KUAS, Hao-Xiang Gu.
Harvesting Runtime Values in Android Applications That Feature Anti-Analysis Techniques Presented by Vikraman Mohan.
Wireshark Lab#3.
BotCatch: A Behavior and Signature Correlated Bot Detection Approach
Learning Snort Rules by Capturing Intrusions In Live Network Traffic
SNORT.
Part 1: Basic Analysis Chapter 1: Basic Static Techniques
NETWORK SECURITY LAB Lab 9. IDS and IPS.
Chapter 3. Basic Dynamic Analysis
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Network Analyzer :- Introduction to Wireshark
Network Analyzer :- Introduction to Wireshark
Basic Dynamic Analysis VMs and Sandboxes
SNORT RULES.
Presentation transcript:

Malware Dynamic Analysis Part 6 Veronica Kovah vkovah.ost at gmail See notes for citation1

All materials is licensed under a Creative Commons “Share Alike” license See notes for citation2

Where are we at? Part 5: Using an all-in-one sandbox – Cuckoo Sandbox – Malware Attribute Enumeration and Characterization (MAEC) – Different sandbox results comparison Part 6: Actionable output – Yara – Snort See notes for citation3

Yara Open source tool to identify and classify malicious files based on textual or binary patterns Light-weight way of performing signature checks Can be used for any binary data (exe, pdf, pcaps, etc) Useful in an server for tip-offs, and filtering See notes for citation4

Yara Signature (1) rule silent_banker : banker { meta: description = "This is just an example" thread_level = 3 in_the_wild = true strings: $a = {6A A 14 8D 91} $b = {8D 4D B0 2B C1 83 C A 4E 59 F7 F9} $c = "UVODFRYSIHLNWPEJXQZAKCBGMT" condition: $a or $b or $c } See notes for citation5

Yara Signature (2) Identifier – Any alphanumeric characters and underscores but cannot start with a number String definition – A string identifier starts with $ followed by alphanumeric character and underscores – Values Text strings enclosed by double quotes Hex strings enclosed by curly brackets Regular expression enclosed by slashes See notes for citation6

Yara Signature (3) Condition operators – Boolean and, or, not – Relational >=,, ==, != – Arithmetic +, -, *, / – Bitwise &, |, >, ~ Counting strings – strings: $a = “text” – condition: #a == 6 See notes for citation7

Bot classification We will make a Yara signature for a bot malware in this lab 1)Identify characteristic strings from the agobot sample – $ strings ~/MalwareClass/samples/agobot/malware.exe > /tmp/agobot.txt 2)Make an Yara signature using combination of the identified strings – Create a file (e.g. detection.yar) for the signature 3)Run Yara – $ yara detection.yar ~/MalwareClass/samples/agobot/malware.exe See notes for citation8

One possible answer rule Agobot { strings: $msg = "PhatBNC" nocase $conf1 = "ddos_maxthreads" $conf2 = "scan_maxsockets" $conf3 = "scan_maxthreads" $cmd1 = "do_stealth" $cmd2 = "do_avkill" $cmd3 = "do_speedtest" $cmd4 = "bot_topiccmd" $cmd5 = "bot_meltserver" $cmd6 = "bot_randnick" condition: (#msg > 10) and $conf1 and $conf2 and $conf3 and (any of ($cmd1, $cmd2, $cmd3, $cmd4, $cmd5, $cmd6)) } See notes for citation9

Where are we at? Part 5: Using an all-in-one sandbox – Cuckoo Sandbox – Malware Attribute Enumeration and Characterization (MAEC) – Different sandbox results comparison Part 6: Actionable output – Yara – Snort See notes for citation10

Snort (1) Open source network intrusion detection/prevention tool (NIDS/NIPS) 3 modes – Sniffer: read packets off the network and display on the screen – Packet Logger: logs the packets to a log file – NIDS: analyze network traffic and match with user-defined signatures and make actions (e.g. alert, drop, etc.) See notes for citation11

Snort (2) Preprocessors provides various pre-detection processing – Frag3: IP defragmentation – Stream5: TCP/UDP session tracking – RPC decode: RPC record defragmentation – HTTP Inspect: HTTP fields identification, normalization etc. A preprocessor may depends on the other Supports custom preprocessor See notes for citation12

Snort Signatures (1) Detection can be implemented in preprocessor, Snort (text) rules, or SO (shared object) rules. Snort rules Rule headers – Rule action tells Snort what to do (e.g. alert, log, drop) – IP addresses in Classless Inter-Domain Routing (CIDR) notation – Port numbers – Direction operator should be “->” or “<>” (bidirectional) See notes for citation13 alert tcp any any -> any 80 (msg:”No deadbeef”; content:”DEADBEEF”;) SRC IP PORT DEST IP PORT

Snort Signatures (2) Rule options – Separated by semicolon (;) – msg: message to be displayed in log – content: ascii string or binary to match – content modifiers nocase, depth, offset, distance, within, http_header, http_client_body, http_uri, file_data – pcre: match can be written in perl compatible regular expression – flags: checks TCP flag bit – sid: required field, Snort rule identifier See notes for citation14

Detect Beaconing Traffic (1) We will write a NIDS signature for this lab on the host machine – $ wireshark ~/MalwareClass/misc/darkshell.pcap & Lab is already configured – Fixed the permission violation error $ sudo usermod -aG snort student – Set HOME_NET to /24 in /etc/snort/snort.conf Let's run Snort with the existing Snort rules – $ snort -c /etc/snort/snort.conf -r ~/MalwareClass/misc/darkshell.pcap -l /tmp See notes for citation15

Detect Beaconing Traffic (2) Open a new file to write a Snort rule You can start with the following template and fill up detection rule options alert tcp any any -> any any ( ) To test your rule $ snort -c -r -l /tmp See notes for citation16

Phone Home Format // Darkshell bot-to-CnC comms struct { // Header: DWORD dwMagic; // always 0x for Darkshell // Obfuscated section: char szComputerName[64]; // Name of infected host, NULL-terminated/extended char szMemory[32]; // Amount of memory in infected host; format "%dMB"; NULL- terminated/extended char szWindowsVersion[32]; // Specifies version of Windows; one of: Windows98, Windows95, // WindowsNT, Windows2000, WindowsXP, Windows2003, or Win Vista; // NULL-terminated/extended char szBotVersion[32]; // Specifies version of bot; NULL-terminated/extended; DWORD szUnknown1[4]; // ??? - Always NULL-terminated 'n' // Binary section: char szPadding1[32]; // Filled with 0x00 bytes WORD wUnknown2; // ??? - We have seen 0x00A0, 0x00B0, and 0x00C0 WORD wUnknown3; // ??? - Always 0xFD7F char szPadding2[20]; // Filled with 0x00 bytes WORD wUnknown4; // ??? - Always 0xB0FC BYTE cUnknown5; // ??? - We have seen 0xD6, 0xD7, 0xE6, 0xE7, and 0xF1 BYTE cZero; // Always 0x00 DWORD dwSignature[8]; // Always 0x , 0xFFFFFFFF, 0x18EE907C, 0x008E917C, // 0xFFFFFFFF, 0xFA8D91&C, 0x25D6907C, 0xCFEA907C }; See notes for citation17 food-processing-equipment/

What we learned in Part 1 How an isolated malware analysis lab is setup – Ubuntu, Virtualbox, inetsim Malware terminology – Bot, RAT, etc. – Heterogeneous vendor naming RAT exploration - Poison IVY – Implant and Controller Behavioral malware analysis approaches – Diffing, monitoring, API tracing, etc. See notes for citation18

What we learned in Part 2 Background concepts – PE files, Windows Libraries, Processes, Registry, Windows Services – TrID, Process Explorer, Process Monitor, PsService, CFF Explorer Persistence techniques – Registry, File system, Windows services – Autoruns, Regshot See notes for citation19

What we learned in Part 3 Background concepts – API, Threads Maneuvering techniques (How malware strategically positions itself to access critical resources) – DLL and code injection, DLL search order hijacking, IAT, EAT, and inline hooking – Procmon, WinApiOverride, Winobj See notes for citation20

What we learned in Part 4 Background concepts – How to analyze network traffic with Wireshark Malware functionality – Key logging – Phone home – Beaconing – Self-Avoidance – Security degrading – Simple stealth techniques (non-rootkit techniques) Self-destruction Hiding files See notes for citation21

What we learned in Part 5/6 Using an all-in-one sandbox – Good for automation and the first cut – How to use Cuckoo Sandbox – How to analyze sandboxes’ results – Malware Attribute Enumeration and Characterization (MAEC) Actionable output – detection signatures – Snort: network intrusion detection/prevention system – Yara: Malware identification and classification tool See notes for citation22

All samples are from openmalware.org 101d00e77b48685bc02c1ff9672e1e94 eldorado/malware.exe b5a781edb9b683534f agobot/malware.exe 3349eab5cc4660bafa502f7565ff761d conficker/malware.exe 9f880ac607cbd7cdfffa609c5883c708 Hydraq/malware.exe a10b9b75e8c7db665cfd7947e93b999b parite/malware.exe d7578e550c0a4d4aca0cfd01ae19a331 spyeye/malware.exe df150905e2537db936ef323f48e2c1bb magania/malware.exe 4a29d41dfda9cfcbcde4d42b4bbb00aa Darkshell/malware.exe 1a36fb10f0a6474a9fea23ee4139d13e nitol/malware.exe db19c23c5f77a c790cd331c IMworm/malware.exe a9a2fb f30df22f8a3f22a10 onlinegames/2/malware.exe f1bae35d296930d2076b9d84ba0c95ea onlinegames/1/malware.exe See notes for citation23

See notes for citation24

The End See notes for citation25