SlideShare une entreprise Scribd logo
1  sur  53
Télécharger pour lire hors ligne
Difficulties of malware
analysis
Nguyễn Chấn Việt
Đơn vị tổ chức:

Đơn vị tài trợ:
Malware author perspective
• Manual Analysis
• Automated Malware Analysis

10/29/2013 11:13 AM

www.securitybootcamp.vn
Malware author perspective
• Manual Analysis
– How to confuse Malware Analyst ?

• Automated Malware Analysis
– How to defeat Automated Malware Analysis ?

10/29/2013 11:13 AM

www.securitybootcamp.vn
Reverse Engineering
approach
Analysis Prevention Techniques
• Anti-Disassembly
– Protect malware from static analysis

• Anti-Debugging
– Protect malware from dynamic analysis

• Anti-VM
– Malware notice from VM environment

• Anti-Sandbox
– Malware notice from sandbox environment
10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Disassembly
•
•
•
•
•

Packing
Confuse Disassembly Algorithms
Fake Jumps
Impossible disassembly
…

10/29/2013 11:13 AM

www.securitybootcamp.vn
Packing
• Packers are used to shrink the size of executable file
• Makes static analysis harder

10/29/2013 11:13 AM

www.securitybootcamp.vn
Packing

10/29/2013 11:13 AM

www.securitybootcamp.vn
Packing
• Complex packers :
–
–
–
–

Multi-layer encryption
Advanced anti-debugging techniques
Code abstraction (metamorphic, virtual machines etc.)
Examples: Armadillo, Sdprotect, ExeCrypt, VMProtect

10/29/2013 11:13 AM

www.securitybootcamp.vn
Packing
• Packer Analysis/Detection :
– PEiD : it can detect more than 400 different signatures in PE files
– RDG Packer Detector

10/29/2013 11:13 AM

www.securitybootcamp.vn
Packing
• More :
– The Art of Unpacking
– Anti-Unpacking Tricks - Peter Ferrie

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Disassembly
• Type of Disassembly :
– Linear sweep :
• Disassemble one instruction at a time
• Do not look at type of instruction
– Recursive traversal :
• Look at instruction and disassemble based on program flow
• Used by IDA Pro and other commercial products

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Disassembly
• Confuse Linear Disassembly Algorithm
– Insert Garbage byte :
• Since data is mixed with code, data can disassemble to valid instructions
jmp .destination
db 0x6a ; garbage byte
.destination:
; rest of the code
pop eax
• Result of disassembler :
eb 01 jmp 0x401003
6a 58 push 0x58

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Disassembly
• Confuse Linear Disassembly Algorithm
– Insert Garbage byte :

55

89

E5

10/29/2013 11:13 AM

31

C0

www.securitybootcamp.vn
Anti-Disassembly
• Confuse Linear Disassembly Algorithm
– Insert Garbage byte :

55

89

E5

10/29/2013 11:13 AM

31

C0

www.securitybootcamp.vn

E8

55

89

E5

31

C0
Anti-Disassembly
• Confuse Recursive traversal Disassembly Algorithm
Conditional that is, say, always true
– Jump Instructions with the Same Target
• The most common anti-disassembly technique seen in the wild is two backto-back conditional jump instructions that both point to the same target
jz short near ptr loc_4011C4+1
75 01 jnz short near ptr loc_4011C4+1

– A Jump Instruction with a Constant Condition
• XOR : XOR instruction immediately followed by JNZ or JZ instruction
xor eax, eax
jz short near ptr loc_4011C4+1
• STC : STC instruction immediately followed by JNC or JAE instruction
• CLC : CLC instruction immediately followed by JC or JB instruction
10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Disassembly
• Splicing Instructions - Called “impossible disassembly”
– A problem of representation
jmp -1
;these are hidden
inc eax
dec eax

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Disassembly
• Splicing Instructions - Called “impossible disassembly”
– A problem of representation
jmp -1
;these are hidden
inc eax
dec eax

10/29/2013 11:13 AM

EB FF C0 48
www.securitybootcamp.vn
Anti-Disassembly
• Function pointer problems
– It is easy to hide function calls made through pointers

• RET
004011C0

var_4

= byte ptr -4

004011C0

call

$+5

004011C5

add [esp+4+var_4], 5

004011C9

ret

004011C9

sp-analysis failed

004011CA

Confused IDA Pro…..

• Misusing Structured Exception Handlers
10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Disassembly
• More :
–
–

Practical Malware analysis – chapter 15
http://leetmatrix.blogspot.com/2013/02/an-anti-disassembly-trick.html

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Anti-Disassembly
• IDA supports manually re-classifying code as well as code
replacement to “fix” problem areas
• Deobfuscator : Deobfuscation plugin for IDA http://code.google.com/p/optimice/
• Good malware analysts can recognize impossible assembly and
run through the code to figure out what is going on

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Debugging
• IsDebuggerPresent() Windows API

•
•
•
•

if (IsDebuggerPresent()) {
MessageBox(NULL, L"Debugger Detected Via IsDebuggerPresent",
L"Debugger Detected", MB_OK);
}

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Debugging
• CheckRemoteDebuggerPresent() Windows API
•
•
•
•
•

CheckRemoteDebuggerPresent(GetCurrentProcess(), &pbIsPresent);
if (pbIsPresent) {
MessageBox(NULL, L"Debugger Detected Via
CheckRemoteDebuggerPresent", L"Debugger Detected", MB_OK);
}

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Debugging
• IsDebuggerPresent : check the PEB.BeingDebugged flag
•
•
•
•
•
•

status = (_NtQueryInformationProcess) (hnd, ProcessBasicInformation, &pPIB,
sizeof(PROCESS_BASIC_INFORMATION), &bytesWritten);
if (status == 0 ) {
if (pPIB.PebBaseAddress->BeingDebugged == 1) {
MessageBox(NULL, L"Debugger Detected Using PEB!IsDebugged", L"Debugger Detected", MB_OK);
} else {
MessageBox(NULL, L"No Debugger Detected", L"No Debugger Detected", MB_OK)

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Debugging
• PEB ProcessHeap Flag Debugger Detection
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•

int main(int argc, char* argv[])
{
unsigned int var;
__asm
{
MOV EAX, FS:[0x30];
MOV EAX, [EAX + 0x18];
MOV EAX, [EAX + 0x0c];
MOV var,EAX
}
if(var != 2)
{
printf("Debugger Detected");
}
return 0;
}

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Debugging

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Debugging
• PEB!NtGlobalFlag
•
•
•
•
•
•
•
•

status = (_NtQueryInformationProcess) (hnd, ProcessBasicInformation, &pPIB,
sizeof(PROCESS_BASIC_INFORMATION), &bytesWritten);
value = (pPIB.PebBaseAddress);
value = value+0x68;
if (*value == 0x70) {
MessageBox(NULL, L"Debugger Detected Using PEB!NTGlobalFlag", MessageBox(NULL, L"Debugger
Detected Using PEB!NTGlobalFlag", L"Debugger Detected", MB_OK);
} else {
MessageBox(NULL, L"No Debugger Detected", L"No Debugger Detected", MB_OK);
}

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Debugging
•

RDTSC is used to retrieve the time stamp counter (number of clocks
since boot-up) so this is a time-related trick. When you debug, the
distance between those values that are returned in EAX will be higher
than those when the program runs without being debugged. So, if there
is really a difference you're debugging

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Debugging

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Debugging
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•

int main(int argc, char* argv[])
{
unsigned int time1 = 0;
unsigned int time2 = 0;
__asm
{
RDTSC
MOV time1,EAX
RDTSC
MOV time2, EAX
}
if ((time2 - time1) > 100)
{
printf("%s", "VM Detected");
return 0;
}
printf("%s", "VM not present");
return 0;
}

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Debugging
• Find evidence of debugger on system:
– Registry entries
– FindWindow API call :
•
•
•
•
•
•
•
•

HANDLE ollyHandle = NULL;
ollyHandle = FindWindow(L"OLLYDBG", 0);
if (ollyHandle == NULL) {
MessageBox(NULL, L"OllyDbg Not Detected", L"Not Detected", MB_OK);
} else {
MessageBox(NULL, L"Ollydbg Detected Via OllyDbg FindWindow()", MessageBox(NULL,
L"Ollydbg Detected Via OllyDbg FindWindow()",
L"OllyDbg Detected", MB_OK);
}

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Debugging
• More :
– Anti-Debugging - A Developers Viewpoint
– Windows Anti-Debug Reference
– The “Ultimate”Anti-Debugging Reference

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-anti-debugging
• Olly Advanced
• StrongOD
• aadp : http://code.google.com/p/aadp/

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-VM
• VM Fingerprints
–
–
–
–
–
–
–
–

Descriptor Table addresses (IDT, LDT, etc.)
Running Processes (eg. VMWare Tools)
Registry entries that include "VMWare“
loaded modules name
Default virtual machine hardware
Common VM MAC addresses
VMWare specific I/O port
Basically, any difference between a VM and a real computer

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-VM

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-VM

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-VM
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•

int main(int argc, char **argv)
{
char lszValue[100];
HKEY hKey;
int i=0;
RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SYSTEMCurrentControlSetServicesDiskEnum", 0L,
KEY_READ , &hKey);
RegQueryValue(hKey,"0",lszValue,sizeof(lszValue));
printf("%s", lszValue);
if (strstr(lszValue, "VMware"))
{
printf("Vmware Detected");
}
RegCloseKey(hKey);
return 0;

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-VM
• Red Pill is an anti-VM technique that executes the sidt instruction
to grab the value of the IDTR register. The virtual machine
monitor must relocate the guest’s IDTR to avoid conflict with the
host’s IDTR. Since the virtual machine monitor is not notified
when the virtual machine runs the sidt instruction, the IDTR for
the virtual machine is returned. The Red Pill tests for this
discrepancy to detect the usage of VMware.

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-VM
• The sgdt and sldt instruction technique for VMware detection is
commonly known as No Pill. Unlike Red Pill, No Pill relies on the
fact that the LDT structure is assigned to a processor, not an
operating system. And because Windows does not normally use
the LDT structure, but VMware provides virtual support for it, the
table will differ predictably : The LDT location on the host
machine will be zero, and on the virtual machine, it will be
nonzero. A simple check for zero against the result of the sldt
instruction does the trick.

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-VM
• ScoopyNG - The VMware Detection Tool
– ScoopyNG combines the detection tricks of Scoopy Doo and Jerry as well as
some new techniques to determine if a current OS is running inside a
VMware Virtual Machine (VM) or on a native system.
– The first three checks look for the sidt, sgdt, and sldt (Red Pill and No Pill)
instructions.
– The fourth check looks for str.
– The fifth and sixth use the backdoor I/O port 0xa and 0x14 options,
respectively.
– The seventh check relies on a bug in older VMware versions running in
emulation mode.

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-VM

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-VM
• The same with VirtualBox
–

9 method to detect VirtualBox by waleedassar : http://pastebin.com/RU6A2UuB

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-VM
• More :
– Thwarting Virtual Machine Detection
– Detecting the Presence of Virtual Machines Using the Local Data Table

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-anti-vm
• Hardening your VM
– Don’t install the VMware tool
– Change the configuration of your virtual machine by adding the following
options to your .vmx file :
•
•
•
•
•
•
•
•
•
•
•
•
•

isolation.tools.getPtrLocation.disable = "TRUE“
isolation.tools.setPtrLocation.disable = "TRUE“
isolation.tools.setVersion.disable = "TRUE“
isolation.tools.getVersion.disable = "TRUE“
monitor_control.disable_directexec = "TRUE“
monitor_control.disable_chksimd = "TRUE“
monitor_control.disable_ntreloc = "TRUE“
monitor_control.disable_selfmod = "TRUE“
monitor_control.disable_reloc = "TRUE“
monitor_control.disable_btinout = "TRUE“
monitor_control.disable_btmemspace = "TRUE“
monitor_control.disable_btpriv = "TRUE“
monitor_control.disable_btseg = "TRUE"

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-anti-vm
• Patching the code : If you debug the malware and identify some
of the specific instructions (e.g. sidt, sgdt, sldt) you can replace
the code with NOPs to prevent it.
• More :
–
–
–

http://handlers.sans.org/tliston/ThwartingVMDetection_Liston_Skoudis.pdf
http://radlab.cs.berkeley.edu/w/upload/3/3d/Detecting_VM_Aware_Malware.pdf
http://vrt-blog.snort.org/2009/10/how-does-malware-know-difference.html

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Sandbox
• Logic bombs are particular checks in the program which require
certain events to be true in order to execute the malicious
payload
– Checking if something changes on the user desktop
– checking if the mouse pointer is not moving for a particular time

• Sandbox Overloading
– Malware flood the sandbox by generating too much worthless behavior data
(e.g the sleep call) before executing the real payload. Logging the generated
behavior data introduces additional delays and therefore the execution does
not reach the real payload
– Solution : only analysis network traffic, does not capture any system level
behavior

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Sandbox
•
•

#include <windows.h>
#include <stdio.h>
void overloadSandbox()
{
char Path[20];

}

for(int i = 0; i < 100000; ++i)
{
sprintf_s(Path, 20, "C:test");
DeleteFile(Path);
}

int main()
{
overloadSandbox();
//Real payload
CreateFile("C:payload" , GENERIC_WRITE, FILE_SHARE_WRITE, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
}

return 0;

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Sandbox
• Pafish is a demo tool that performs some
anti(debugger/VM/sandbox) tricks :
– https://github.com/a0rtega/pafish

10/29/2013 11:13 AM

www.securitybootcamp.vn
Anti-Anti-Sandbox
Logic bombs :
– By understanding the behavior of the logic bomb code in the analysis report
human analysts, we can improve your sandbox

Sandbox Overload :
– In some case, we should only analyses only network traffic and does not
capture any system level behavior
– In addition we could also write a signature to detect and blacklist the
massive worthless behavior data (e.g the sleep call)

10/29/2013 11:13 AM

www.securitybootcamp.vn
Some tools can help you
• Crowd Detox : plugin for Hex-Rays automatically removes junk
code and variables from Hex-Rays function decompilations
• CrowdRE : aims to make it easier for developers to reverse
engineer complex applications by working collaboratively with
other users
• http://www.crowdstrike.com/community-tools/index.html

10/29/2013 11:13 AM

www.securitybootcamp.vn
Conclusion
• Automated Malware Analysis is good but it can be defeat by new
anti-* techniques => we still need manual analysis for advance
malwares and update back to AMAs

10/29/2013 11:13 AM

www.securitybootcamp.vn
Thank you !

10/29/2013 11:13 AM

www.securitybootcamp.vn

Contenu connexe

Tendances

[OPD 2019] Side-Channels on the Web:
Attacks and Defenses
[OPD 2019] Side-Channels on the Web:
Attacks and Defenses[OPD 2019] Side-Channels on the Web:
Attacks and Defenses
[OPD 2019] Side-Channels on the Web:
Attacks and Defenses
OWASP
 
[1.2] Трюки при анализе защищенности веб приложений – продвинутая версия - С...
[1.2] Трюки при анализе защищенности веб приложений – продвинутая версия - С...[1.2] Трюки при анализе защищенности веб приложений – продвинутая версия - С...
[1.2] Трюки при анализе защищенности веб приложений – продвинутая версия - С...
OWASP Russia
 
"Revenge of The Script Kiddies: Current Day Uses of Automated Scripts by Top ...
"Revenge of The Script Kiddies: Current Day Uses of Automated Scripts by Top ..."Revenge of The Script Kiddies: Current Day Uses of Automated Scripts by Top ...
"Revenge of The Script Kiddies: Current Day Uses of Automated Scripts by Top ...
PROIDEA
 
Алексей Старов - Как проводить киберраследования?
Алексей Старов - Как проводить киберраследования?Алексей Старов - Как проводить киберраследования?
Алексей Старов - Как проводить киберраследования?
HackIT Ukraine
 
CSW2017 Qiang li zhibinhu_meiwang_dig into qemu security
CSW2017 Qiang li zhibinhu_meiwang_dig into qemu securityCSW2017 Qiang li zhibinhu_meiwang_dig into qemu security
CSW2017 Qiang li zhibinhu_meiwang_dig into qemu security
CanSecWest
 

Tendances (20)

Veil-Ordnance
Veil-OrdnanceVeil-Ordnance
Veil-Ordnance
 
IstSec'14 - İbrahim BALİÇ - Automated Malware Analysis
IstSec'14 - İbrahim BALİÇ -  Automated Malware AnalysisIstSec'14 - İbrahim BALİÇ -  Automated Malware Analysis
IstSec'14 - İbrahim BALİÇ - Automated Malware Analysis
 
Testing NodeJS Security
Testing NodeJS SecurityTesting NodeJS Security
Testing NodeJS Security
 
Применение виртуализации для динамического анализа
Применение виртуализации для динамического анализаПрименение виртуализации для динамического анализа
Применение виртуализации для динамического анализа
 
Js deobfuscation with JStillery - bsides-roma 2018
Js deobfuscation with JStillery - bsides-roma 2018Js deobfuscation with JStillery - bsides-roma 2018
Js deobfuscation with JStillery - bsides-roma 2018
 
[OPD 2019] Side-Channels on the Web:
Attacks and Defenses
[OPD 2019] Side-Channels on the Web:
Attacks and Defenses[OPD 2019] Side-Channels on the Web:
Attacks and Defenses
[OPD 2019] Side-Channels on the Web:
Attacks and Defenses
 
[1.2] Трюки при анализе защищенности веб приложений – продвинутая версия - С...
[1.2] Трюки при анализе защищенности веб приложений – продвинутая версия - С...[1.2] Трюки при анализе защищенности веб приложений – продвинутая версия - С...
[1.2] Трюки при анализе защищенности веб приложений – продвинутая версия - С...
 
The Supporting Role of Antivirus Evasion while Persisting
The Supporting Role of Antivirus Evasion while PersistingThe Supporting Role of Antivirus Evasion while Persisting
The Supporting Role of Antivirus Evasion while Persisting
 
"Revenge of The Script Kiddies: Current Day Uses of Automated Scripts by Top ...
"Revenge of The Script Kiddies: Current Day Uses of Automated Scripts by Top ..."Revenge of The Script Kiddies: Current Day Uses of Automated Scripts by Top ...
"Revenge of The Script Kiddies: Current Day Uses of Automated Scripts by Top ...
 
Passwords#14 - mimikatz
Passwords#14 - mimikatzPasswords#14 - mimikatz
Passwords#14 - mimikatz
 
Automate Yo'self -- SeaGL
Automate Yo'self -- SeaGL Automate Yo'self -- SeaGL
Automate Yo'self -- SeaGL
 
Алексей Старов - Как проводить киберраследования?
Алексей Старов - Как проводить киберраследования?Алексей Старов - Как проводить киберраследования?
Алексей Старов - Как проводить киберраследования?
 
Hacking NodeJS applications for fun and profit
Hacking NodeJS applications for fun and profitHacking NodeJS applications for fun and profit
Hacking NodeJS applications for fun and profit
 
CheckPlease: Payload-Agnostic Targeted Malware
CheckPlease: Payload-Agnostic Targeted MalwareCheckPlease: Payload-Agnostic Targeted Malware
CheckPlease: Payload-Agnostic Targeted Malware
 
Velocity 2011 - Our first DDoS attack
Velocity 2011 - Our first DDoS attackVelocity 2011 - Our first DDoS attack
Velocity 2011 - Our first DDoS attack
 
CSW2017 Qiang li zhibinhu_meiwang_dig into qemu security
CSW2017 Qiang li zhibinhu_meiwang_dig into qemu securityCSW2017 Qiang li zhibinhu_meiwang_dig into qemu security
CSW2017 Qiang li zhibinhu_meiwang_dig into qemu security
 
Docker Plugin For DevSecOps
Docker Plugin For DevSecOpsDocker Plugin For DevSecOps
Docker Plugin For DevSecOps
 
Waf.js: How to Protect Web Applications using JavaScript
Waf.js: How to Protect Web Applications using JavaScriptWaf.js: How to Protect Web Applications using JavaScript
Waf.js: How to Protect Web Applications using JavaScript
 
Automated Malware Analysis and Cyber Security Intelligence
Automated Malware Analysis and Cyber Security IntelligenceAutomated Malware Analysis and Cyber Security Intelligence
Automated Malware Analysis and Cyber Security Intelligence
 
Practical Exploitation - Webappy Style
Practical Exploitation - Webappy StylePractical Exploitation - Webappy Style
Practical Exploitation - Webappy Style
 

En vedette

SCB 2013 DLP, công nghệ, và phương pháp triển khai
SCB 2013  DLP, công nghệ, và phương pháp triển khaiSCB 2013  DLP, công nghệ, và phương pháp triển khai
SCB 2013 DLP, công nghệ, và phương pháp triển khai
Security Bootcamp
 
Security Bootcamp 2013 - Mô hình ứng dụng hội chẩn mã độc trực tuyến trong ...
Security Bootcamp 2013  -  Mô hình ứng dụng hội chẩn mã độc trực tuyến trong ...Security Bootcamp 2013  -  Mô hình ứng dụng hội chẩn mã độc trực tuyến trong ...
Security Bootcamp 2013 - Mô hình ứng dụng hội chẩn mã độc trực tuyến trong ...
Security Bootcamp
 
Security Bootcamp 2013 - Lap trinh web an toan
Security Bootcamp 2013 - Lap trinh web an toanSecurity Bootcamp 2013 - Lap trinh web an toan
Security Bootcamp 2013 - Lap trinh web an toan
Security Bootcamp
 
Security Bootcamp 2013 - Giải pháp phát hiện xâm nhập mạng không dây - WIDS -...
Security Bootcamp 2013 - Giải pháp phát hiện xâm nhập mạng không dây - WIDS -...Security Bootcamp 2013 - Giải pháp phát hiện xâm nhập mạng không dây - WIDS -...
Security Bootcamp 2013 - Giải pháp phát hiện xâm nhập mạng không dây - WIDS -...
Security Bootcamp
 
Security Bootcamp 2013 - Mitigate DDoS attack with effective cost - Nguyễn Ch...
Security Bootcamp 2013 - Mitigate DDoS attack with effective cost - Nguyễn Ch...Security Bootcamp 2013 - Mitigate DDoS attack with effective cost - Nguyễn Ch...
Security Bootcamp 2013 - Mitigate DDoS attack with effective cost - Nguyễn Ch...
Security Bootcamp
 
Security Bootcamp 2013 - Cach tiep can ISO27001-Lương Trung Thành
Security Bootcamp 2013 - Cach tiep can ISO27001-Lương Trung ThànhSecurity Bootcamp 2013 - Cach tiep can ISO27001-Lương Trung Thành
Security Bootcamp 2013 - Cach tiep can ISO27001-Lương Trung Thành
Security Bootcamp
 
Security Bootcamp 2013 - Thiết bị không dây không chỉ phát sóng không dây - T...
Security Bootcamp 2013 - Thiết bị không dây không chỉ phát sóng không dây - T...Security Bootcamp 2013 - Thiết bị không dây không chỉ phát sóng không dây - T...
Security Bootcamp 2013 - Thiết bị không dây không chỉ phát sóng không dây - T...
Security Bootcamp
 
Security Bootcamp 2013 lap trinh web an toan
Security Bootcamp 2013   lap trinh web an toanSecurity Bootcamp 2013   lap trinh web an toan
Security Bootcamp 2013 lap trinh web an toan
Security Bootcamp
 
Lap trinh website dotnet c#
Lap trinh website dotnet c#Lap trinh website dotnet c#
Lap trinh website dotnet c#
Le Trong Linh
 
Security Bootcamp 2013 - OWASP TOP 10- 2013
Security Bootcamp 2013 - OWASP TOP 10- 2013Security Bootcamp 2013 - OWASP TOP 10- 2013
Security Bootcamp 2013 - OWASP TOP 10- 2013
Security Bootcamp
 
Web Services
Web ServicesWeb Services
Web Services
ask bills
 
Web Application Security Testing Tools
Web Application Security Testing ToolsWeb Application Security Testing Tools
Web Application Security Testing Tools
Eric Lai
 
Lap trinh c_tu_co_ban_den_nang_cao
Lap trinh c_tu_co_ban_den_nang_caoLap trinh c_tu_co_ban_den_nang_cao
Lap trinh c_tu_co_ban_den_nang_cao
Huy Nguyễn
 

En vedette (20)

SCB 2013 DLP, công nghệ, và phương pháp triển khai
SCB 2013  DLP, công nghệ, và phương pháp triển khaiSCB 2013  DLP, công nghệ, và phương pháp triển khai
SCB 2013 DLP, công nghệ, và phương pháp triển khai
 
Security Bootcamp 2013 - Mô hình ứng dụng hội chẩn mã độc trực tuyến trong ...
Security Bootcamp 2013  -  Mô hình ứng dụng hội chẩn mã độc trực tuyến trong ...Security Bootcamp 2013  -  Mô hình ứng dụng hội chẩn mã độc trực tuyến trong ...
Security Bootcamp 2013 - Mô hình ứng dụng hội chẩn mã độc trực tuyến trong ...
 
Security Bootcamp 2013 - Lap trinh web an toan
Security Bootcamp 2013 - Lap trinh web an toanSecurity Bootcamp 2013 - Lap trinh web an toan
Security Bootcamp 2013 - Lap trinh web an toan
 
Security Bootcamp 2013 - Giải pháp phát hiện xâm nhập mạng không dây - WIDS -...
Security Bootcamp 2013 - Giải pháp phát hiện xâm nhập mạng không dây - WIDS -...Security Bootcamp 2013 - Giải pháp phát hiện xâm nhập mạng không dây - WIDS -...
Security Bootcamp 2013 - Giải pháp phát hiện xâm nhập mạng không dây - WIDS -...
 
Security Bootcamp 2013 - Mitigate DDoS attack with effective cost - Nguyễn Ch...
Security Bootcamp 2013 - Mitigate DDoS attack with effective cost - Nguyễn Ch...Security Bootcamp 2013 - Mitigate DDoS attack with effective cost - Nguyễn Ch...
Security Bootcamp 2013 - Mitigate DDoS attack with effective cost - Nguyễn Ch...
 
Security Bootcamp 2013 - Cach tiep can ISO27001-Lương Trung Thành
Security Bootcamp 2013 - Cach tiep can ISO27001-Lương Trung ThànhSecurity Bootcamp 2013 - Cach tiep can ISO27001-Lương Trung Thành
Security Bootcamp 2013 - Cach tiep can ISO27001-Lương Trung Thành
 
Security Bootcamp 2013 - Thiết bị không dây không chỉ phát sóng không dây - T...
Security Bootcamp 2013 - Thiết bị không dây không chỉ phát sóng không dây - T...Security Bootcamp 2013 - Thiết bị không dây không chỉ phát sóng không dây - T...
Security Bootcamp 2013 - Thiết bị không dây không chỉ phát sóng không dây - T...
 
Security Bootcamp 2013 lap trinh web an toan
Security Bootcamp 2013   lap trinh web an toanSecurity Bootcamp 2013   lap trinh web an toan
Security Bootcamp 2013 lap trinh web an toan
 
Lap trinh website dotnet c#
Lap trinh website dotnet c#Lap trinh website dotnet c#
Lap trinh website dotnet c#
 
Đề tài tìm hiểu WCF
Đề tài tìm hiểu WCFĐề tài tìm hiểu WCF
Đề tài tìm hiểu WCF
 
Security Bootcamp 2013 - OWASP TOP 10- 2013
Security Bootcamp 2013 - OWASP TOP 10- 2013Security Bootcamp 2013 - OWASP TOP 10- 2013
Security Bootcamp 2013 - OWASP TOP 10- 2013
 
Huong dan viet cv cho Lap Trinh Vien, Cach phong van xin viec hieu qua - TopC...
Huong dan viet cv cho Lap Trinh Vien, Cach phong van xin viec hieu qua - TopC...Huong dan viet cv cho Lap Trinh Vien, Cach phong van xin viec hieu qua - TopC...
Huong dan viet cv cho Lap Trinh Vien, Cach phong van xin viec hieu qua - TopC...
 
Profile của Võ Thái Lâm
Profile của Võ Thái LâmProfile của Võ Thái Lâm
Profile của Võ Thái Lâm
 
Web Services
Web ServicesWeb Services
Web Services
 
Lap trinh HDT Java, Object-Oriented Programming in Java
Lap trinh HDT Java, Object-Oriented Programming in JavaLap trinh HDT Java, Object-Oriented Programming in Java
Lap trinh HDT Java, Object-Oriented Programming in Java
 
(HoaND) giao trinh webservice
(HoaND) giao trinh webservice (HoaND) giao trinh webservice
(HoaND) giao trinh webservice
 
Web Application Security Testing Tools
Web Application Security Testing ToolsWeb Application Security Testing Tools
Web Application Security Testing Tools
 
Lap trinh c_tu_co_ban_den_nang_cao
Lap trinh c_tu_co_ban_den_nang_caoLap trinh c_tu_co_ban_den_nang_cao
Lap trinh c_tu_co_ban_den_nang_cao
 
Big data 5Vs 2014 - View from World to Vietnam by Dinh Le Dat
Big data 5Vs 2014 - View from World to Vietnam by Dinh Le DatBig data 5Vs 2014 - View from World to Vietnam by Dinh Le Dat
Big data 5Vs 2014 - View from World to Vietnam by Dinh Le Dat
 
Giới thiệu WCF
Giới thiệu WCFGiới thiệu WCF
Giới thiệu WCF
 

Similaire à Security Bootcamp 2013 - Difficulties of malware analysis - Nguyễn Chấn Việt

Similaire à Security Bootcamp 2013 - Difficulties of malware analysis - Nguyễn Chấn Việt (20)

Sandbox detection: leak, abuse, test - Hacktivity 2015
Sandbox detection: leak, abuse, test - Hacktivity 2015Sandbox detection: leak, abuse, test - Hacktivity 2015
Sandbox detection: leak, abuse, test - Hacktivity 2015
 
DEF CON 27 - WENXIANG QIAN and YUXIANG LI HUIYU - breaking google home exploi...
DEF CON 27 - WENXIANG QIAN and YUXIANG LI HUIYU - breaking google home exploi...DEF CON 27 - WENXIANG QIAN and YUXIANG LI HUIYU - breaking google home exploi...
DEF CON 27 - WENXIANG QIAN and YUXIANG LI HUIYU - breaking google home exploi...
 
SCADA Software or Swiss Cheese Software?  by Celil UNUVER
SCADA Software or Swiss Cheese Software?  by Celil UNUVERSCADA Software or Swiss Cheese Software?  by Celil UNUVER
SCADA Software or Swiss Cheese Software?  by Celil UNUVER
 
Concourse Workshop
Concourse WorkshopConcourse Workshop
Concourse Workshop
 
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
 
Atomic CLI scan
Atomic CLI scanAtomic CLI scan
Atomic CLI scan
 
How to hide your browser 0-days
How to hide your browser 0-daysHow to hide your browser 0-days
How to hide your browser 0-days
 
VorlonJS
VorlonJSVorlonJS
VorlonJS
 
Testing safety critical systems: Practice and Theory (14-05-2013, VU Amsterdam)
Testing safety critical systems: Practice and Theory (14-05-2013, VU Amsterdam)Testing safety critical systems: Practice and Theory (14-05-2013, VU Amsterdam)
Testing safety critical systems: Practice and Theory (14-05-2013, VU Amsterdam)
 
DevSecCon Tel Aviv 2018 - Integrated Security Testing by Morgan Roman
DevSecCon Tel Aviv 2018 - Integrated Security Testing by Morgan RomanDevSecCon Tel Aviv 2018 - Integrated Security Testing by Morgan Roman
DevSecCon Tel Aviv 2018 - Integrated Security Testing by Morgan Roman
 
Derbycon Bromium Labs: Sandboxes
Derbycon Bromium Labs: SandboxesDerbycon Bromium Labs: Sandboxes
Derbycon Bromium Labs: Sandboxes
 
owasp lithuania chapter - exploit vs anti-exploit
owasp lithuania chapter - exploit vs anti-exploitowasp lithuania chapter - exploit vs anti-exploit
owasp lithuania chapter - exploit vs anti-exploit
 
The Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote WorldThe Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote World
 
Shall we play a game?
Shall we play a game?Shall we play a game?
Shall we play a game?
 
Groovy In the Cloud
Groovy In the CloudGroovy In the Cloud
Groovy In the Cloud
 
Owasp tds
Owasp tdsOwasp tds
Owasp tds
 
The Hacker News: Hacking Wireless DSL routers via Admin Panel Password Reset ...
The Hacker News: Hacking Wireless DSL routers via Admin Panel Password Reset ...The Hacker News: Hacking Wireless DSL routers via Admin Panel Password Reset ...
The Hacker News: Hacking Wireless DSL routers via Admin Panel Password Reset ...
 
[PH-Neutral 0x7db] Exploit Next Generation®
[PH-Neutral 0x7db] Exploit Next Generation®[PH-Neutral 0x7db] Exploit Next Generation®
[PH-Neutral 0x7db] Exploit Next Generation®
 
Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014
 
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwonThe basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
 

Plus de Security Bootcamp

GOLDEN TICKET - Hiểm hoa tiềm ẩn trong hệ thống Active Directory
GOLDEN TICKET -  Hiểm hoa tiềm ẩn trong hệ thống Active DirectoryGOLDEN TICKET -  Hiểm hoa tiềm ẩn trong hệ thống Active Directory
GOLDEN TICKET - Hiểm hoa tiềm ẩn trong hệ thống Active Directory
Security Bootcamp
 
PHÂN TÍCH MỘT SỐ CUỘC TẤN CÔNG APT ĐIỂN HÌNH NHẮM VÀO VIỆT NAM 2017-2018
PHÂN TÍCH MỘT SỐ CUỘC TẤN CÔNG APT ĐIỂN HÌNH NHẮM VÀO VIỆT NAM 2017-2018PHÂN TÍCH MỘT SỐ CUỘC TẤN CÔNG APT ĐIỂN HÌNH NHẮM VÀO VIỆT NAM 2017-2018
PHÂN TÍCH MỘT SỐ CUỘC TẤN CÔNG APT ĐIỂN HÌNH NHẮM VÀO VIỆT NAM 2017-2018
Security Bootcamp
 

Plus de Security Bootcamp (20)

Ransomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdfRansomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdf
 
Hieupc-The role of psychology in enhancing cybersecurity
Hieupc-The role of psychology in enhancing cybersecurityHieupc-The role of psychology in enhancing cybersecurity
Hieupc-The role of psychology in enhancing cybersecurity
 
Nguyen Huu Trung - Building a web vulnerability scanner - From a hacker’s view
Nguyen Huu Trung - Building a web vulnerability scanner - From a hacker’s viewNguyen Huu Trung - Building a web vulnerability scanner - From a hacker’s view
Nguyen Huu Trung - Building a web vulnerability scanner - From a hacker’s view
 
Sbc 2020 bao gio vn co anm dua vao cong nghe mo
Sbc 2020 bao gio vn co anm dua vao cong nghe moSbc 2020 bao gio vn co anm dua vao cong nghe mo
Sbc 2020 bao gio vn co anm dua vao cong nghe mo
 
Deception change-the-game
Deception change-the-gameDeception change-the-game
Deception change-the-game
 
Giam sat thu dong thong tin an toan hang hai su dung sdr
Giam sat thu dong thong tin an toan hang hai su dung sdrGiam sat thu dong thong tin an toan hang hai su dung sdr
Giam sat thu dong thong tin an toan hang hai su dung sdr
 
Sbc2019 luong-cyber startup
Sbc2019 luong-cyber startupSbc2019 luong-cyber startup
Sbc2019 luong-cyber startup
 
Insider threat-what-us-do d-want
Insider threat-what-us-do d-wantInsider threat-what-us-do d-want
Insider threat-what-us-do d-want
 
Macro malware common techniques - public
Macro malware   common techniques - publicMacro malware   common techniques - public
Macro malware common techniques - public
 
Malware detection-using-machine-learning
Malware detection-using-machine-learningMalware detection-using-machine-learning
Malware detection-using-machine-learning
 
Tim dieu moi trong nhung dieu cu
Tim dieu moi trong nhung dieu cuTim dieu moi trong nhung dieu cu
Tim dieu moi trong nhung dieu cu
 
Threat detection with 0 cost
Threat detection with 0 costThreat detection with 0 cost
Threat detection with 0 cost
 
Build SOC
Build SOC Build SOC
Build SOC
 
AD red vs blue
AD red vs blueAD red vs blue
AD red vs blue
 
Securitybox
SecurityboxSecuritybox
Securitybox
 
GOLDEN TICKET - Hiểm hoa tiềm ẩn trong hệ thống Active Directory
GOLDEN TICKET -  Hiểm hoa tiềm ẩn trong hệ thống Active DirectoryGOLDEN TICKET -  Hiểm hoa tiềm ẩn trong hệ thống Active Directory
GOLDEN TICKET - Hiểm hoa tiềm ẩn trong hệ thống Active Directory
 
PHÂN TÍCH MỘT SỐ CUỘC TẤN CÔNG APT ĐIỂN HÌNH NHẮM VÀO VIỆT NAM 2017-2018
PHÂN TÍCH MỘT SỐ CUỘC TẤN CÔNG APT ĐIỂN HÌNH NHẮM VÀO VIỆT NAM 2017-2018PHÂN TÍCH MỘT SỐ CUỘC TẤN CÔNG APT ĐIỂN HÌNH NHẮM VÀO VIỆT NAM 2017-2018
PHÂN TÍCH MỘT SỐ CUỘC TẤN CÔNG APT ĐIỂN HÌNH NHẮM VÀO VIỆT NAM 2017-2018
 
Api security-present
Api security-presentApi security-present
Api security-present
 
Lannguyen-Detecting Cyber Attacks
Lannguyen-Detecting Cyber AttacksLannguyen-Detecting Cyber Attacks
Lannguyen-Detecting Cyber Attacks
 
Letrungnghia-gopyluananm2018
Letrungnghia-gopyluananm2018Letrungnghia-gopyluananm2018
Letrungnghia-gopyluananm2018
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Security Bootcamp 2013 - Difficulties of malware analysis - Nguyễn Chấn Việt

  • 2. Đơn vị tổ chức: Đơn vị tài trợ:
  • 3. Malware author perspective • Manual Analysis • Automated Malware Analysis 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 4. Malware author perspective • Manual Analysis – How to confuse Malware Analyst ? • Automated Malware Analysis – How to defeat Automated Malware Analysis ? 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 6. Analysis Prevention Techniques • Anti-Disassembly – Protect malware from static analysis • Anti-Debugging – Protect malware from dynamic analysis • Anti-VM – Malware notice from VM environment • Anti-Sandbox – Malware notice from sandbox environment 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 7. Anti-Disassembly • • • • • Packing Confuse Disassembly Algorithms Fake Jumps Impossible disassembly … 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 8. Packing • Packers are used to shrink the size of executable file • Makes static analysis harder 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 10. Packing • Complex packers : – – – – Multi-layer encryption Advanced anti-debugging techniques Code abstraction (metamorphic, virtual machines etc.) Examples: Armadillo, Sdprotect, ExeCrypt, VMProtect 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 11. Packing • Packer Analysis/Detection : – PEiD : it can detect more than 400 different signatures in PE files – RDG Packer Detector 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 12. Packing • More : – The Art of Unpacking – Anti-Unpacking Tricks - Peter Ferrie 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 13. Anti-Disassembly • Type of Disassembly : – Linear sweep : • Disassemble one instruction at a time • Do not look at type of instruction – Recursive traversal : • Look at instruction and disassemble based on program flow • Used by IDA Pro and other commercial products 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 14. Anti-Disassembly • Confuse Linear Disassembly Algorithm – Insert Garbage byte : • Since data is mixed with code, data can disassemble to valid instructions jmp .destination db 0x6a ; garbage byte .destination: ; rest of the code pop eax • Result of disassembler : eb 01 jmp 0x401003 6a 58 push 0x58 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 15. Anti-Disassembly • Confuse Linear Disassembly Algorithm – Insert Garbage byte : 55 89 E5 10/29/2013 11:13 AM 31 C0 www.securitybootcamp.vn
  • 16. Anti-Disassembly • Confuse Linear Disassembly Algorithm – Insert Garbage byte : 55 89 E5 10/29/2013 11:13 AM 31 C0 www.securitybootcamp.vn E8 55 89 E5 31 C0
  • 17. Anti-Disassembly • Confuse Recursive traversal Disassembly Algorithm Conditional that is, say, always true – Jump Instructions with the Same Target • The most common anti-disassembly technique seen in the wild is two backto-back conditional jump instructions that both point to the same target jz short near ptr loc_4011C4+1 75 01 jnz short near ptr loc_4011C4+1 – A Jump Instruction with a Constant Condition • XOR : XOR instruction immediately followed by JNZ or JZ instruction xor eax, eax jz short near ptr loc_4011C4+1 • STC : STC instruction immediately followed by JNC or JAE instruction • CLC : CLC instruction immediately followed by JC or JB instruction 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 18. Anti-Disassembly • Splicing Instructions - Called “impossible disassembly” – A problem of representation jmp -1 ;these are hidden inc eax dec eax 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 19. Anti-Disassembly • Splicing Instructions - Called “impossible disassembly” – A problem of representation jmp -1 ;these are hidden inc eax dec eax 10/29/2013 11:13 AM EB FF C0 48 www.securitybootcamp.vn
  • 20. Anti-Disassembly • Function pointer problems – It is easy to hide function calls made through pointers • RET 004011C0 var_4 = byte ptr -4 004011C0 call $+5 004011C5 add [esp+4+var_4], 5 004011C9 ret 004011C9 sp-analysis failed 004011CA Confused IDA Pro….. • Misusing Structured Exception Handlers 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 21. Anti-Disassembly • More : – – Practical Malware analysis – chapter 15 http://leetmatrix.blogspot.com/2013/02/an-anti-disassembly-trick.html 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 22. Anti-Anti-Disassembly • IDA supports manually re-classifying code as well as code replacement to “fix” problem areas • Deobfuscator : Deobfuscation plugin for IDA http://code.google.com/p/optimice/ • Good malware analysts can recognize impossible assembly and run through the code to figure out what is going on 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 23. Anti-Debugging • IsDebuggerPresent() Windows API • • • • if (IsDebuggerPresent()) { MessageBox(NULL, L"Debugger Detected Via IsDebuggerPresent", L"Debugger Detected", MB_OK); } 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 24. Anti-Debugging • CheckRemoteDebuggerPresent() Windows API • • • • • CheckRemoteDebuggerPresent(GetCurrentProcess(), &pbIsPresent); if (pbIsPresent) { MessageBox(NULL, L"Debugger Detected Via CheckRemoteDebuggerPresent", L"Debugger Detected", MB_OK); } 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 25. Anti-Debugging • IsDebuggerPresent : check the PEB.BeingDebugged flag • • • • • • status = (_NtQueryInformationProcess) (hnd, ProcessBasicInformation, &pPIB, sizeof(PROCESS_BASIC_INFORMATION), &bytesWritten); if (status == 0 ) { if (pPIB.PebBaseAddress->BeingDebugged == 1) { MessageBox(NULL, L"Debugger Detected Using PEB!IsDebugged", L"Debugger Detected", MB_OK); } else { MessageBox(NULL, L"No Debugger Detected", L"No Debugger Detected", MB_OK) 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 26. Anti-Debugging • PEB ProcessHeap Flag Debugger Detection • • • • • • • • • • • • • • • • • int main(int argc, char* argv[]) { unsigned int var; __asm { MOV EAX, FS:[0x30]; MOV EAX, [EAX + 0x18]; MOV EAX, [EAX + 0x0c]; MOV var,EAX } if(var != 2) { printf("Debugger Detected"); } return 0; } 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 28. Anti-Debugging • PEB!NtGlobalFlag • • • • • • • • status = (_NtQueryInformationProcess) (hnd, ProcessBasicInformation, &pPIB, sizeof(PROCESS_BASIC_INFORMATION), &bytesWritten); value = (pPIB.PebBaseAddress); value = value+0x68; if (*value == 0x70) { MessageBox(NULL, L"Debugger Detected Using PEB!NTGlobalFlag", MessageBox(NULL, L"Debugger Detected Using PEB!NTGlobalFlag", L"Debugger Detected", MB_OK); } else { MessageBox(NULL, L"No Debugger Detected", L"No Debugger Detected", MB_OK); } 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 29. Anti-Debugging • RDTSC is used to retrieve the time stamp counter (number of clocks since boot-up) so this is a time-related trick. When you debug, the distance between those values that are returned in EAX will be higher than those when the program runs without being debugged. So, if there is really a difference you're debugging 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 31. Anti-Debugging • • • • • • • • • • • • • • • • • • • • int main(int argc, char* argv[]) { unsigned int time1 = 0; unsigned int time2 = 0; __asm { RDTSC MOV time1,EAX RDTSC MOV time2, EAX } if ((time2 - time1) > 100) { printf("%s", "VM Detected"); return 0; } printf("%s", "VM not present"); return 0; } 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 32. Anti-Debugging • Find evidence of debugger on system: – Registry entries – FindWindow API call : • • • • • • • • HANDLE ollyHandle = NULL; ollyHandle = FindWindow(L"OLLYDBG", 0); if (ollyHandle == NULL) { MessageBox(NULL, L"OllyDbg Not Detected", L"Not Detected", MB_OK); } else { MessageBox(NULL, L"Ollydbg Detected Via OllyDbg FindWindow()", MessageBox(NULL, L"Ollydbg Detected Via OllyDbg FindWindow()", L"OllyDbg Detected", MB_OK); } 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 33. Anti-Debugging • More : – Anti-Debugging - A Developers Viewpoint – Windows Anti-Debug Reference – The “Ultimate”Anti-Debugging Reference 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 34. Anti-anti-debugging • Olly Advanced • StrongOD • aadp : http://code.google.com/p/aadp/ 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 35. Anti-VM • VM Fingerprints – – – – – – – – Descriptor Table addresses (IDT, LDT, etc.) Running Processes (eg. VMWare Tools) Registry entries that include "VMWare“ loaded modules name Default virtual machine hardware Common VM MAC addresses VMWare specific I/O port Basically, any difference between a VM and a real computer 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 38. Anti-VM • • • • • • • • • • • • • • • • • • • int main(int argc, char **argv) { char lszValue[100]; HKEY hKey; int i=0; RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SYSTEMCurrentControlSetServicesDiskEnum", 0L, KEY_READ , &hKey); RegQueryValue(hKey,"0",lszValue,sizeof(lszValue)); printf("%s", lszValue); if (strstr(lszValue, "VMware")) { printf("Vmware Detected"); } RegCloseKey(hKey); return 0; 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 39. Anti-VM • Red Pill is an anti-VM technique that executes the sidt instruction to grab the value of the IDTR register. The virtual machine monitor must relocate the guest’s IDTR to avoid conflict with the host’s IDTR. Since the virtual machine monitor is not notified when the virtual machine runs the sidt instruction, the IDTR for the virtual machine is returned. The Red Pill tests for this discrepancy to detect the usage of VMware. 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 40. Anti-VM • The sgdt and sldt instruction technique for VMware detection is commonly known as No Pill. Unlike Red Pill, No Pill relies on the fact that the LDT structure is assigned to a processor, not an operating system. And because Windows does not normally use the LDT structure, but VMware provides virtual support for it, the table will differ predictably : The LDT location on the host machine will be zero, and on the virtual machine, it will be nonzero. A simple check for zero against the result of the sldt instruction does the trick. 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 41. Anti-VM • ScoopyNG - The VMware Detection Tool – ScoopyNG combines the detection tricks of Scoopy Doo and Jerry as well as some new techniques to determine if a current OS is running inside a VMware Virtual Machine (VM) or on a native system. – The first three checks look for the sidt, sgdt, and sldt (Red Pill and No Pill) instructions. – The fourth check looks for str. – The fifth and sixth use the backdoor I/O port 0xa and 0x14 options, respectively. – The seventh check relies on a bug in older VMware versions running in emulation mode. 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 43. Anti-VM • The same with VirtualBox – 9 method to detect VirtualBox by waleedassar : http://pastebin.com/RU6A2UuB 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 44. Anti-VM • More : – Thwarting Virtual Machine Detection – Detecting the Presence of Virtual Machines Using the Local Data Table 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 45. Anti-anti-vm • Hardening your VM – Don’t install the VMware tool – Change the configuration of your virtual machine by adding the following options to your .vmx file : • • • • • • • • • • • • • isolation.tools.getPtrLocation.disable = "TRUE“ isolation.tools.setPtrLocation.disable = "TRUE“ isolation.tools.setVersion.disable = "TRUE“ isolation.tools.getVersion.disable = "TRUE“ monitor_control.disable_directexec = "TRUE“ monitor_control.disable_chksimd = "TRUE“ monitor_control.disable_ntreloc = "TRUE“ monitor_control.disable_selfmod = "TRUE“ monitor_control.disable_reloc = "TRUE“ monitor_control.disable_btinout = "TRUE“ monitor_control.disable_btmemspace = "TRUE“ monitor_control.disable_btpriv = "TRUE“ monitor_control.disable_btseg = "TRUE" 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 46. Anti-anti-vm • Patching the code : If you debug the malware and identify some of the specific instructions (e.g. sidt, sgdt, sldt) you can replace the code with NOPs to prevent it. • More : – – – http://handlers.sans.org/tliston/ThwartingVMDetection_Liston_Skoudis.pdf http://radlab.cs.berkeley.edu/w/upload/3/3d/Detecting_VM_Aware_Malware.pdf http://vrt-blog.snort.org/2009/10/how-does-malware-know-difference.html 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 47. Anti-Sandbox • Logic bombs are particular checks in the program which require certain events to be true in order to execute the malicious payload – Checking if something changes on the user desktop – checking if the mouse pointer is not moving for a particular time • Sandbox Overloading – Malware flood the sandbox by generating too much worthless behavior data (e.g the sleep call) before executing the real payload. Logging the generated behavior data introduces additional delays and therefore the execution does not reach the real payload – Solution : only analysis network traffic, does not capture any system level behavior 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 48. Anti-Sandbox • • #include <windows.h> #include <stdio.h> void overloadSandbox() { char Path[20]; } for(int i = 0; i < 100000; ++i) { sprintf_s(Path, 20, "C:test"); DeleteFile(Path); } int main() { overloadSandbox(); //Real payload CreateFile("C:payload" , GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); } return 0; 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 49. Anti-Sandbox • Pafish is a demo tool that performs some anti(debugger/VM/sandbox) tricks : – https://github.com/a0rtega/pafish 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 50. Anti-Anti-Sandbox Logic bombs : – By understanding the behavior of the logic bomb code in the analysis report human analysts, we can improve your sandbox Sandbox Overload : – In some case, we should only analyses only network traffic and does not capture any system level behavior – In addition we could also write a signature to detect and blacklist the massive worthless behavior data (e.g the sleep call) 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 51. Some tools can help you • Crowd Detox : plugin for Hex-Rays automatically removes junk code and variables from Hex-Rays function decompilations • CrowdRE : aims to make it easier for developers to reverse engineer complex applications by working collaboratively with other users • http://www.crowdstrike.com/community-tools/index.html 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 52. Conclusion • Automated Malware Analysis is good but it can be defeat by new anti-* techniques => we still need manual analysis for advance malwares and update back to AMAs 10/29/2013 11:13 AM www.securitybootcamp.vn
  • 53. Thank you ! 10/29/2013 11:13 AM www.securitybootcamp.vn