Top Banner
Malware Analysis – Identifying Inherent Security Threats Dr. Charles Lim, Msc., Bsc., CTIA, CHFI, EDRP, ECSA, ECSP, ECIH, CEH, CEI Charles.lim [at] sgu.ac.id
46

Malware Analysis Identifying Inherent Security Threats

Feb 15, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Malware Analysis Identifying Inherent Security Threats

Malware Analysis –Identifying Inherent Security Threats

Dr. Charles Lim, Msc., Bsc., CTIA, CHFI, EDRP, ECSA, ECSP, ECIH, CEH, CEI

Charles.lim [at] sgu.ac.id

Page 2: Malware Analysis Identifying Inherent Security Threats

Agenda:

1. Malware & Malware Analysis

2. Static Analysis

a) Fingerprinting Malware

b) Strings extraction

c) File obfuscation determination

d) Pattern Matching using YARA

e) Fuzzy Hashing Portable Executable

Page 3: Malware Analysis Identifying Inherent Security Threats

Objectives:

1. To understand malware and its history

2. To understand malware analysis process

3. To understand and know how to perform static malware analysis

Page 4: Malware Analysis Identifying Inherent Security Threats

To the trained eye there is as much difference between the black ash of a Trichinopoly and

the white fluff of bird’s eye as there is between a cabbage and a potato.

Sherlock Holmes, in The Sign of the FourArthur Conan Doyle, 1859–1930

Page 5: Malware Analysis Identifying Inherent Security Threats

MALWARE

Malware (Malicious Software): program or code that is malicious, such as stealing personal

information

Page 6: Malware Analysis Identifying Inherent Security Threats

Type of Malware

6

Adware: software designed to advertise on the computer and us.ually also used to collect private information from user computer

Ransomware: The type of malware that limits the use of the computer by encrypting all user’s files in the computer and asks certain ransom for a

decrypting key.

Trojan: malware that disguises itself as a legitimate software.

Virus: malware that sticks to an existing legitimate software and replicates to another program when executed.

Worm: a self-replicating malware that has capability to spread to another computer very fast

Page 7: Malware Analysis Identifying Inherent Security Threats

The Evolution of Malware

7

https://blog.51sec.org/2015/06/2015-check-points-annual-security-report.html

Page 8: Malware Analysis Identifying Inherent Security Threats

What can malware do?

▶ Disturb the operation of computer

▶ Steal sensitive information

▶ To gain access to computer system

▶ To spy on computer users’ information

▶ To extort

Page 9: Malware Analysis Identifying Inherent Security Threats

Malware categories

▶ MASS MALWARE, designed to infect as many computers as possible and also the most common means of infection

▶ TARGETED MALWARE, designed to target specific system and usually more difficult to be detected and need a higher skills to analyze this capability

Page 10: Malware Analysis Identifying Inherent Security Threats

Advanced Persistent Threats

Page 11: Malware Analysis Identifying Inherent Security Threats

Cyber Kill Chain

Page 12: Malware Analysis Identifying Inherent Security Threats

Case Study – Target Data Breach (1/2)

Use HVAC credentials to get into Target

Network, then reconnaissance

performed to install malware

Sent the credit card stealing malware on

Cashier machine

Malware collected all the credit cards onto 3 staging serves before

sent to Moscow

Credit card numbers flowing out starting 2 Dec

and security system detected the breach but

failed to act.

Federal investigator warned Target on 12 Dec on data breach

15 Dec Target confirmed the breach afer 40 million credit card numbers stolen

Page 13: Malware Analysis Identifying Inherent Security Threats

Case Study – Target Data Breach (2/2)

Recon Weaponize Deliver Exploit Install C&C Action

Target missed warnings from anti-intrusion

software ➔malware installed

Target missed info from anti-intrusion software ➔millions credit card #

stolen

Attacker took advantage of Target vendor weakness

to penetrate into Target’s network

Attacker took advantage of weak control of Target network ➔

Attacker move into other part of the network

Page 14: Malware Analysis Identifying Inherent Security Threats

Malware Techniques (1/3)

▶ Compression or packing – Previously designed to make smaller binary size, but now used to evade malware detection

▶ Obfuscation – makes it harder for malware analyst to analyze

▶ Persistency – maintain its existence in the infected computers permanent

▶ Privilege Escalation – to escalate current privilege to admin (by exploiting the vulnerability of operating system)

▶ Défense Evasion – to evade malware detection

Page 15: Malware Analysis Identifying Inherent Security Threats

Malware Techniques (2/3)

▶ Stealing credentials – steal user credentials, i.e. user id and passwords, of a system

▶ Reconnaissance – obtain internal system and network information of the targeted system

▶ Lateral Movement – move from system to system to the targeted system

▶ Execution – executing code that has been prepared for the targeted machine

Page 16: Malware Analysis Identifying Inherent Security Threats

Malware Techniques (3/3)

▶ Collection, to collect sensitive information before performing exfiltration

▶ Exfiltration, to remove information

▶ Command and Control, capability to communicate to the control system

Page 17: Malware Analysis Identifying Inherent Security Threats

Persistence

Page 18: Malware Analysis Identifying Inherent Security Threats

Malware Statistics

Page 19: Malware Analysis Identifying Inherent Security Threats

Malware Statistics

Page 20: Malware Analysis Identifying Inherent Security Threats

Mobile Malware

Page 21: Malware Analysis Identifying Inherent Security Threats

Mobile Malware

Page 22: Malware Analysis Identifying Inherent Security Threats

Why Malware Analysis?

▶ How malware behaves

▶ To determine the basic malware capabilities and its goal

▶ To identify network indicator of compromise

▶ To Identify host indicator of compromise

▶ To determine its persistence mechanism

Page 23: Malware Analysis Identifying Inherent Security Threats

Different Methods of Malware Analysis

A method of examining computer program/code without executing the program

A method of examining computer program/code while executing the program in a real or virtual processor

A method of examining computer program/code afterexecuting the program in a real or virtual processor

Dynamic

AnalysisMemory

Analysis

Static

Analysis

Page 24: Malware Analysis Identifying Inherent Security Threats

Static Analysis

A method to investigate the binary code base on the structure of the code without executing it.

Page 25: Malware Analysis Identifying Inherent Security Threats

Steps in Static Analysis

▶ Determine file type

▶ Cryptographic hash (fingerprinting the malware)

▶ Strings extraction

▶ Upload to multi AV scanning engine

▶ Detect file obfuscations (packers, cryptors)

▶ Pattern matching using YARA

▶ Fuzzy Hashing and comparison

▶ Investigate PE Imports

▶ Investigate PE Header

Page 26: Malware Analysis Identifying Inherent Security Threats

File Type

Goal: determining the architecture the malware is targeting

▶ Tools

▶ Note: File extension is not the indicator of file type

• Unix ➔ File Utility• Windows ➔ PEStudio

Page 27: Malware Analysis Identifying Inherent Security Threats

File Type Examples

Page 28: Malware Analysis Identifying Inherent Security Threats

Fingerprinting Malware (Cryptographic Hash)

▶ Provides a unique identifier of malware analyzed

▶ Makes sharing easier with other researchers in identifying malware

▶ Helps to determine if the malware is already identified

▶ Tools: md5sum, sha256sum, sha1sum (Linux) or pestudio (Windows)

Page 29: Malware Analysis Identifying Inherent Security Threats

Strings

▶ Plain text ASCII and UNICODE characters embedded within a file

▶ Provide clues on the functionality and commands associated with a malicious file

▶ Often contain interesting strings like domain name, file name, URL etc.

▶ Tools: strings utility (Linux) or BinText, pestudio (Windows)

Page 30: Malware Analysis Identifying Inherent Security Threats

Example Strings

Page 31: Malware Analysis Identifying Inherent Security Threats

Multi AV Scanning Submission

Page 32: Malware Analysis Identifying Inherent Security Threats

File Obfuscation

▶ Make files being analyzed more difficult to detect & analyze

▶ Often Packers & Cryptors are used to evade detection

▶ Obfuscation results in less number of strings & functions

▶ If the malware is obfuscated more likely the sample is malicious

Page 33: Malware Analysis Identifying Inherent Security Threats

File Obfuscation Example

Page 34: Malware Analysis Identifying Inherent Security Threats

Pattern Matching using YARA

▶ Useful to classify and identify malware samples

▶ Based on rules using textual or binary patterns

▶ Rules: a set of strings and a Boolean expression which determine its logic

Page 35: Malware Analysis Identifying Inherent Security Threats

Example of Yara’s Usage

Page 36: Malware Analysis Identifying Inherent Security Threats

Fuzzy Hashing

▶ To percentage similarity of different malware samples or malware samples and their variants

▶ Tool: ssdeep

Page 37: Malware Analysis Identifying Inherent Security Threats

Windows Architecture

Page 38: Malware Analysis Identifying Inherent Security Threats

Portable Executable (PE)

Page 39: Malware Analysis Identifying Inherent Security Threats

Portable Executable (PE)

Source: https://code.google.com/p/corkami/wiki/PE101

Page 40: Malware Analysis Identifying Inherent Security Threats

PE Header (Hex Dump)

▶ PE File starts with string “MZ” (4D 5A)

▶ On the DOS Stub section string “This program cannot be run in DOS mode” can be found

▶ On the COFF Header section string “PE” is located

Page 41: Malware Analysis Identifying Inherent Security Threats

Mapping PE ke Memory▶ Stack – Memory area for temporary storage using

LIFO methods

▶ Heap – Memory area for dynamic allocation needs

▶ Program Image – Location where the PE executable code located

▶ DLLs - DLL used by PE

▶ TEB - Thread Environment Block to store information on running threads

▶ PEB - Process Environment Block to store information on module and process.

Page 42: Malware Analysis Identifying Inherent Security Threats

Memory Stack

▶ Instruction to store information ➔ push

▶ Instruction to obtain the information back ➔ pop

Page 43: Malware Analysis Identifying Inherent Security Threats

PE Header

The PE header possesses useful information for malware analysis, such as:

▶ Imports: functions from the other library malware use

▶ Exports: functions in the malware that will be called by other program

▶ Time Stamp: the compiled program time

▶ Resources: Strings, icons, dan other information found in the file

Page 44: Malware Analysis Identifying Inherent Security Threats

PE Import

▶ Executable loads several shared libraries and calls API functions to perform some actions such as domain names resolution, create HTTP connections, etc.

▶ From shared library types and list of API calls imported by executable to provide information about malware functions

▶ Tool: pestudio

Page 45: Malware Analysis Identifying Inherent Security Threats

PE Import Example (using PEstudio)

Page 46: Malware Analysis Identifying Inherent Security Threats

Questions & Anwers

46