SlideShare a Scribd company logo
1 of 48
Download to read offline
ShellCon 2017 | What Can RE Do For You?
1
WHAT CAN
REVERSE
ENGINEERING
DO FOR YOU?
MALWARE UNICORN
ShellCon 2017 | What Can RE Do For You?
2
ABOUT ME
WHAT I DO
securedorg.github.io
Teach Malware RE
Look at malware
DEFCON
OPCDE
CFP Reviewer
Amanda Rousseau
Host Meetups
Follow Fashion Trends
meetup.com/Dead-Drop-SF
vanitysec.com
RSA, DEFCON
44Con, CanSecWest
Bsides SF, WiCys
DC3Con, MirCon
Speak at ConsSr.
Malware
Researcher
Endgame
Inc.
Occasionally Shitpost
@malwareunicorn
ShellCon 2017 | What Can RE Do For You?
3
Why
Reverse Engineering?
It is the foundation for both the blue and red teams
Vuln Research
Malware Analysis
Exploit Dev
Detection Sigs
Forensics
Pentesting Kits
Reverse Engineering
AV Engine Dev
ShellCon 2017 | What Can RE Do For You?
4
Watch out for
Rabbit Holes
It’s easy to get lost debugging
some random binary.
This talk will help you identify
specific patterns in assembly
routines commonly found in
malware.
ShellCon 2017 | What Can RE Do For You?
5
“YOU ONLY NEED A DISASSEMBLER,
DEBUGGER, AND A HEX EDITOR TO DO RE”
– ANONYMOUS DUDE
ShellCon 2017 | What Can RE Do For You?
6
The “RE” starter pack
ShellCon 2017 | What Can RE Do For You?
7
ALL TOOLS
SUPPORT
HxD Hex Editor
Python - used for automating tasks
INFORMATION GATHERING
CFF Explorer - PE header parser
PE Explorer - PE inspection
BinText - Extract strings
Sysinternals Suite
DISASSEMBLERS
Ida
Free
Pro (Most Popular)
Radare
Capstone
DEBUGGERS
x64dbg (My Favorite)
Immunity
OllyDbg (Most Popular)
WinDbg
GDB
ShellCon 2017 | What Can RE Do For You?
8
Approach
• Recognizing patterns comes with experience
• Break down algorithms into basic steps
• Information gathering is key, it helps define
how the binary and assembly is used for that
specific language
• Use Backward-Forward navigation and take
notes!
ShellCon 2017 | What Can RE Do For You?
9
BACKWARD-FORWARD
Start somewhere in the middle
and navigate backwards to the
entry point function.
Then go forwards to get back to
the middle while taking notes.
main()
Sub_1()
Sub_2()
Sub_4()Start
Sub_3()Next
Next
End
Sub_4()
Sub_2()
main()
Sub_1()
ShellCon 2017 | What Can RE Do For You?
10
BACKWARD-FORWARD
My Notes
ShellCon 2017 | What Can RE Do For You?
11
Common Assembly Patterns
Common techniques found in malware
PACKING EVASION CRYPTO SHELLCODE
ShellCon 2017 | What Can RE Do For You?
12
PACKING
1. Allocate a huge memory chunk
2. Load referenced section, resource, or
.data
3. Some routine that loops
4. Recreate the import table
5. Convert to R-W-X
6. Jump to start of newly copied bytes
Things to look for
ShellCon 2017 | What Can RE Do For You?
13
PACKING
HEADER
MAIN CODE
PACKED CODE
NEW MEMORY
RWX
RECREATE IMPORT TABLE
LOOP
1
2
5
4
3
6
JUMP
ShellCon 2017 | What Can RE Do For You?
14
PACKING
UPX
ShellCon 2017 | What Can RE Do For You?
15
PACKING
memory chuck == UPX0 section
ShellCon 2017 | What Can RE Do For You?
16
PACKING
Recreate the import table
ShellCon 2017 | What Can RE Do For You?
17
PACKING
Recreate the import table
ShellCon 2017 | What Can RE Do For You?
18
PACKING
Import table in the debugger
ShellCon 2017 | What Can RE Do For You?
19
PACKING
Convert to R-W-X with VirtualProtect
Some routine that loops
Jump to start of newly copied bytes
ShellCon 2017 | What Can RE Do For You?
20
PACKING
• Look for references to sections, resources, or .data
• Look for the jump call
Debugging
• Save the address to the new memory section. Set
an execution breakpoint on that memory location.
Static Analysis
How to get around it
ShellCon 2017 | What Can RE Do For You?
21
EVASION
• Lots of jumps where one jump
terminates the program
• Environment checking
• Useless routines
Things to look for
ShellCon 2017 | What Can RE Do For You?
22
EVASION
Sub_0()
Sub_1()
Sub_4()
Sub_3()
Exit()
Some Check
JZ Exit()
JZ Exit()
JZ Exit()
Some Check
Some Check
ShellCon 2017 | What Can RE Do For You?
23
EVASION
ShellCon 2017 | What Can RE Do For You?
24
EVASION
• VM Evasion – Checking the environment for VM artifacts
• Anti-analysis – useless jumps & functions
• Anti-AV Detection – Heavy obfuscation, environment checks
• Anti Automation – requires UI activity
Types of Evasion
ShellCon 2017 | What Can RE Do For You?
25
EVASION
VM Evasion
• Accessing registry keys for hardware & Bios
• Checking driver names for VM drivers
• Any check in Paranoid Fish
(https://github.com/a0rtega/pafish)
Things to look for
ShellCon 2017 | What Can RE Do For You?
26
EVASION
VM Evasion
• Accessing registry keys
for hardware, Bios,
and/or Physical Drive
ShellCon 2017 | What Can RE Do For You?
27
EVASION
VM Evasion
• Accessing registry keys
for hardware, Bios,
and/or Physical Drive
ShellCon 2017 | What Can RE Do For You?
28
EVASION
• useless jumps & functions
• Debugger checks
• Time bombs
• Tick timer checks
Things to look for
Anti-Analysis
ShellCon 2017 | What Can RE Do For You?
29
EVASION
• useless jumps & functions
• Debugger checks
• Time bombs
• Tick timer checks
Things to look for
Anti-Analysis
ShellCon 2017 | What Can RE Do For You?
30
EVASION
Anti-AV Detection
• Accessing registry keys for AV names
• Checking program files, DLLs, Driver names
• Stack based strings and IOCs
Things to look for
ShellCon 2017 | What Can RE Do For You?
31
EVASION
Anti-AV Detection
Stack based strings and IOCs
ShellCon 2017 | What Can RE Do For You?
32
EVASION
Anti Automation
• Checking for User Interaction
• Mouse movement
• Foreground window state change
• Long sleep/wait calls
• Internet connection tests
Things to look for
ShellCon 2017 | What Can RE Do For You?
33
• Checking for User Interaction
• Foreground window state
change
EVASION
Anti Automation
ShellCon 2017 | What Can RE Do For You?
34
EVASION
• Patch the CMP and JNZ jump calls so that it
always passes the check
Debugging
• Modify the Zero flag to bypass the check
Static Analysis
How to get around it
ShellCon 2017 | What Can RE Do For You?
35
EVASION
• Patch the CMP and JNZ jump calls so that it
always passes the check
Debugging
• Modify the Zero flag to bypass the check
Static Analysis
How to get around it
ShellCon 2017 | What Can RE Do For You?
36
CRYPTO
Call a function right after
STEP 2
Loop a lot
STEP 3
Load a reference in .DATA
STEP 1
XOR something
STEP 4
ShellCon 2017 | What Can RE Do For You?
37
CRYPTO
Call a function right after
STEP 2
Load a reference in .DATA
STEP 1
ShellCon 2017 | What Can RE Do For You?
38
CRYPTO
Loop a lot
STEP 3
ShellCon 2017 | What Can RE Do For You?
39
CRYPTO
xor A, B
xor A, A
xor [esi], al
xor eax, eax
XOR the lower byte of register eax
with the value at esi
Clear the register eax
XOR something
STEP 4
ShellCon 2017 | What Can RE Do For You?
40
CRYPTO
• Look for frequent usages of the function after data
loads
• Identify the crypto algorithm and create a simple
decryption script
Debugging
• Place a breakpoint before the return or after the
function to see the decrypted string
• Place a write hardware breakpoint in the newly
allocated memory region
Static Analysis
How to get around it
ShellCon 2017 | What Can RE Do For You?
41
SHELLCODE
• Heap or VirtualAlloc with R-W-X
permissions
• Copy a large chunk of bytes to
newly created memory
• Jump to an offset in that new
memory
• Or spawn a new thread
Things to look for
ShellCon 2017 | What Can RE Do For You?
42
SHELLCODE
• Similar to unpacking
• Shellcode is process independent code
• May or may not need an import table creation
Things to note
ShellCon 2017 | What Can RE Do For You?
43
SHELLCODE
HEADER
MAIN CODE
SHELLCODE
NEW MEMORY
RWX
LOOP
1
2
4
3
5
JUMP
ShellCon 2017 | What Can RE Do For You?
44
SHELLCODE
• value Offset+0x42B7 is being
saved in register esi and then
pushed onto the stack before
the function returns.
• Typically functions will pop the
ebp on the stack to restore
the previous stack frame of
the calling function.
Things to note
ShellCon 2017 | What Can RE Do For You?
45
SHELLCODE
• Look for references to sections, resources, or .data
• Look for the jump or push & ret call
Debugging
• Save the address to the new memory section. Set
an execution breakpoint on that memory location.
• Extract the shellcode from memory and convert it
into an exe
Static Analysis
How to get around it
ShellCon 2017 | What Can RE Do For You?
46
SHELLCODE
Converting Shellcode to an EXE
1. Download Yasm yasm-1.3.0-win32.exe
2. Extract yasm-1.3.0-win32.exe and rename it to yasm.exe
3. Download GoLink linker Golink.zip
4. Extract golink.exe
5. Create a shellcode.asm file with the following instructions
6. From a command line run the following command to assemble the code:
• yasm.exe -f win32 -o shellcode.obj shellcode.asm
7. Now run the linker
• golink /ni /entry Start shellcode.obj
8. Change the AddressOfEntryPoint. Add the current value to 0x42B7 which was the offset of where the
malware was going to return to in function sub_45B794. AddressOfEntryPoint should be 000052B7.
This will ensure that IDA knows where to start the disassembly.
Global Start
SECTION 'AyyLmao' write, execute,read
Start: incbin "shellcode.bin"
ShellCon 2017 | What Can RE Do For You?
47
Things to REmember
• Take notes
• PATCH, PATCH, PATCH - every evasion can be bypassed
• Memory & Hardware breakpoints are your friends
• Loops are annoying but good for identification
• Repeated functions are fishy indicators
ShellCon 2017 | What Can RE Do For You?
48
Thanks for coming!
Questions?
Twitter: @malwareunicorn

More Related Content

What's hot

Trusted Third Parties are NOT Trust Worthy!
Trusted Third Parties are NOT Trust Worthy!Trusted Third Parties are NOT Trust Worthy!
Trusted Third Parties are NOT Trust Worthy!nettitude_labs
 
DARPA CGC and DEFCON CTF: Automatic Attack and Defense Technique
DARPA CGC and DEFCON CTF: Automatic Attack and Defense TechniqueDARPA CGC and DEFCON CTF: Automatic Attack and Defense Technique
DARPA CGC and DEFCON CTF: Automatic Attack and Defense TechniqueChong-Kuan Chen
 
Статический анализ кода в контексте SSDL
Статический анализ кода в контексте SSDLСтатический анализ кода в контексте SSDL
Статический анализ кода в контексте SSDLPositive Hack Days
 
Tracing Software Build Processes to Uncover License Compliance Inconsistencie...
Tracing Software Build Processes to Uncover License Compliance Inconsistencie...Tracing Software Build Processes to Uncover License Compliance Inconsistencie...
Tracing Software Build Processes to Uncover License Compliance Inconsistencie...Shane McIntosh
 
The Impact of Code Review Coverage and Participation on Software Quality
The Impact of Code Review Coverage and Participation on Software QualityThe Impact of Code Review Coverage and Participation on Software Quality
The Impact of Code Review Coverage and Participation on Software QualityShane McIntosh
 
Open Canary - novahackers
Open Canary - novahackersOpen Canary - novahackers
Open Canary - novahackersChris Gates
 
Isolating GPU Access in its Own Process
Isolating GPU Access in its Own ProcessIsolating GPU Access in its Own Process
Isolating GPU Access in its Own ProcessPatricia Aas
 
Formbook - In-depth malware analysis (Botconf 2018)
Formbook - In-depth malware analysis (Botconf 2018)Formbook - In-depth malware analysis (Botconf 2018)
Formbook - In-depth malware analysis (Botconf 2018)Rémi Jullian
 
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
Null Mumbai Meet_Android Reverse Engineering by Samrat DasNull Mumbai Meet_Android Reverse Engineering by Samrat Das
Null Mumbai Meet_Android Reverse Engineering by Samrat Dasnullowaspmumbai
 
Possibility of arbitrary code execution by Step-Oriented Programming
Possibility of arbitrary code execution by Step-Oriented ProgrammingPossibility of arbitrary code execution by Step-Oriented Programming
Possibility of arbitrary code execution by Step-Oriented Programmingkozossakai
 
FRIDA 101 Android
FRIDA 101 AndroidFRIDA 101 Android
FRIDA 101 AndroidTony Thomas
 
Ida python intro
Ida python introIda python intro
Ida python intro小静 安
 
Justin collins - Practical Static Analysis for continuous application delivery
Justin collins - Practical Static Analysis for continuous application deliveryJustin collins - Practical Static Analysis for continuous application delivery
Justin collins - Practical Static Analysis for continuous application deliveryDevSecCon
 
Mining Co-Change Information to Understand when Build Changes are Necessary
Mining Co-Change Information to Understand when Build Changes are NecessaryMining Co-Change Information to Understand when Build Changes are Necessary
Mining Co-Change Information to Understand when Build Changes are NecessaryShane McIntosh
 
For the Greater Good: Leveraging VMware's RPC Interface for fun and profit by...
For the Greater Good: Leveraging VMware's RPC Interface for fun and profit by...For the Greater Good: Leveraging VMware's RPC Interface for fun and profit by...
For the Greater Good: Leveraging VMware's RPC Interface for fun and profit by...CODE BLUE
 
Pentesting Android Apps using Frida (Beginners)
Pentesting Android Apps using Frida (Beginners)Pentesting Android Apps using Frida (Beginners)
Pentesting Android Apps using Frida (Beginners)Chandrapal Badshah
 
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...DevSecCon
 
DBI-Assisted Android Application Reverse Engineering
DBI-Assisted Android Application Reverse EngineeringDBI-Assisted Android Application Reverse Engineering
DBI-Assisted Android Application Reverse EngineeringSahil Dhar
 
[2014 CodeEngn Conference 10] 정광운 - 안드로이드에서도 한번 후킹을 해볼까 (Hooking on Android)
[2014 CodeEngn Conference 10] 정광운 -  안드로이드에서도 한번 후킹을 해볼까 (Hooking on Android)[2014 CodeEngn Conference 10] 정광운 -  안드로이드에서도 한번 후킹을 해볼까 (Hooking on Android)
[2014 CodeEngn Conference 10] 정광운 - 안드로이드에서도 한번 후킹을 해볼까 (Hooking on Android)GangSeok Lee
 

What's hot (20)

Trusted Third Parties are NOT Trust Worthy!
Trusted Third Parties are NOT Trust Worthy!Trusted Third Parties are NOT Trust Worthy!
Trusted Third Parties are NOT Trust Worthy!
 
DARPA CGC and DEFCON CTF: Automatic Attack and Defense Technique
DARPA CGC and DEFCON CTF: Automatic Attack and Defense TechniqueDARPA CGC and DEFCON CTF: Automatic Attack and Defense Technique
DARPA CGC and DEFCON CTF: Automatic Attack and Defense Technique
 
Статический анализ кода в контексте SSDL
Статический анализ кода в контексте SSDLСтатический анализ кода в контексте SSDL
Статический анализ кода в контексте SSDL
 
Tracing Software Build Processes to Uncover License Compliance Inconsistencie...
Tracing Software Build Processes to Uncover License Compliance Inconsistencie...Tracing Software Build Processes to Uncover License Compliance Inconsistencie...
Tracing Software Build Processes to Uncover License Compliance Inconsistencie...
 
The Impact of Code Review Coverage and Participation on Software Quality
The Impact of Code Review Coverage and Participation on Software QualityThe Impact of Code Review Coverage and Participation on Software Quality
The Impact of Code Review Coverage and Participation on Software Quality
 
Open Canary - novahackers
Open Canary - novahackersOpen Canary - novahackers
Open Canary - novahackers
 
Isolating GPU Access in its Own Process
Isolating GPU Access in its Own ProcessIsolating GPU Access in its Own Process
Isolating GPU Access in its Own Process
 
Formbook - In-depth malware analysis (Botconf 2018)
Formbook - In-depth malware analysis (Botconf 2018)Formbook - In-depth malware analysis (Botconf 2018)
Formbook - In-depth malware analysis (Botconf 2018)
 
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
Null Mumbai Meet_Android Reverse Engineering by Samrat DasNull Mumbai Meet_Android Reverse Engineering by Samrat Das
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
 
Possibility of arbitrary code execution by Step-Oriented Programming
Possibility of arbitrary code execution by Step-Oriented ProgrammingPossibility of arbitrary code execution by Step-Oriented Programming
Possibility of arbitrary code execution by Step-Oriented Programming
 
FRIDA 101 Android
FRIDA 101 AndroidFRIDA 101 Android
FRIDA 101 Android
 
Ida python intro
Ida python introIda python intro
Ida python intro
 
Justin collins - Practical Static Analysis for continuous application delivery
Justin collins - Practical Static Analysis for continuous application deliveryJustin collins - Practical Static Analysis for continuous application delivery
Justin collins - Practical Static Analysis for continuous application delivery
 
Introduction to Frida
Introduction to FridaIntroduction to Frida
Introduction to Frida
 
Mining Co-Change Information to Understand when Build Changes are Necessary
Mining Co-Change Information to Understand when Build Changes are NecessaryMining Co-Change Information to Understand when Build Changes are Necessary
Mining Co-Change Information to Understand when Build Changes are Necessary
 
For the Greater Good: Leveraging VMware's RPC Interface for fun and profit by...
For the Greater Good: Leveraging VMware's RPC Interface for fun and profit by...For the Greater Good: Leveraging VMware's RPC Interface for fun and profit by...
For the Greater Good: Leveraging VMware's RPC Interface for fun and profit by...
 
Pentesting Android Apps using Frida (Beginners)
Pentesting Android Apps using Frida (Beginners)Pentesting Android Apps using Frida (Beginners)
Pentesting Android Apps using Frida (Beginners)
 
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
 
DBI-Assisted Android Application Reverse Engineering
DBI-Assisted Android Application Reverse EngineeringDBI-Assisted Android Application Reverse Engineering
DBI-Assisted Android Application Reverse Engineering
 
[2014 CodeEngn Conference 10] 정광운 - 안드로이드에서도 한번 후킹을 해볼까 (Hooking on Android)
[2014 CodeEngn Conference 10] 정광운 -  안드로이드에서도 한번 후킹을 해볼까 (Hooking on Android)[2014 CodeEngn Conference 10] 정광운 -  안드로이드에서도 한번 후킹을 해볼까 (Hooking on Android)
[2014 CodeEngn Conference 10] 정광운 - 안드로이드에서도 한번 후킹을 해볼까 (Hooking on Android)
 

Similar to What Can Reverse Engineering Do For You?

Adding Security to Your Workflow With InSpec - SCaLE17x
Adding Security to Your Workflow With InSpec - SCaLE17xAdding Security to Your Workflow With InSpec - SCaLE17x
Adding Security to Your Workflow With InSpec - SCaLE17xMandi Walls
 
InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017Mandi Walls
 
Winning the Erlang Edit•Build•Test Cycle
Winning the Erlang Edit•Build•Test CycleWinning the Erlang Edit•Build•Test Cycle
Winning the Erlang Edit•Build•Test CycleRusty Klophaus
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?AFUP_Limoges
 
DevOpsDaysRiga 2017: Mandi Walls - Building security into your workflow with ...
DevOpsDaysRiga 2017: Mandi Walls - Building security into your workflow with ...DevOpsDaysRiga 2017: Mandi Walls - Building security into your workflow with ...
DevOpsDaysRiga 2017: Mandi Walls - Building security into your workflow with ...DevOpsDays Riga
 
One bite and all your dreams will come true: Analyzing and Attacking Apple Ke...
One bite and all your dreams will come true: Analyzing and Attacking Apple Ke...One bite and all your dreams will come true: Analyzing and Attacking Apple Ke...
One bite and all your dreams will come true: Analyzing and Attacking Apple Ke...Priyanka Aash
 
Ephemeral DevOps: Adventures in Managing Short-Lived Systems
Ephemeral DevOps: Adventures in Managing Short-Lived SystemsEphemeral DevOps: Adventures in Managing Short-Lived Systems
Ephemeral DevOps: Adventures in Managing Short-Lived SystemsPriyanka Aash
 
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbers
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbersDefcon 22 - Stitching numbers - generating rop payloads from in memory numbers
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbersAlexandre Moneger
 
You're Off the Hook: Blinding Security Software
You're Off the Hook: Blinding Security SoftwareYou're Off the Hook: Blinding Security Software
You're Off the Hook: Blinding Security SoftwareCylance
 
InSpec Workflow for DevOpsDays Riga 2017
InSpec Workflow for DevOpsDays Riga 2017InSpec Workflow for DevOpsDays Riga 2017
InSpec Workflow for DevOpsDays Riga 2017Mandi Walls
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Pantheon
 
There and Back Again (My DevOps journey) - DevOps Days Copenhagen 2018
There and Back Again (My DevOps journey) - DevOps Days Copenhagen 2018There and Back Again (My DevOps journey) - DevOps Days Copenhagen 2018
There and Back Again (My DevOps journey) - DevOps Days Copenhagen 2018Giulio Vian
 
Lions, Tigers and Deers: What building zoos can teach us about securing micro...
Lions, Tigers and Deers: What building zoos can teach us about securing micro...Lions, Tigers and Deers: What building zoos can teach us about securing micro...
Lions, Tigers and Deers: What building zoos can teach us about securing micro...Sysdig
 
Make static instrumentation great again, High performance fuzzing for Windows...
Make static instrumentation great again, High performance fuzzing for Windows...Make static instrumentation great again, High performance fuzzing for Windows...
Make static instrumentation great again, High performance fuzzing for Windows...Lucas Leong
 
08 - Return Oriented Programming, the chosen one
08 - Return Oriented Programming, the chosen one08 - Return Oriented Programming, the chosen one
08 - Return Oriented Programming, the chosen oneAlexandre Moneger
 
Building a REST API Microservice for the DevNet API Scavenger Hunt
Building a REST API Microservice for the DevNet API Scavenger HuntBuilding a REST API Microservice for the DevNet API Scavenger Hunt
Building a REST API Microservice for the DevNet API Scavenger HuntAshley Roach
 
Reuse, Reduce, Recycle in Serverless World
Reuse, Reduce, Recycle in Serverless WorldReuse, Reduce, Recycle in Serverless World
Reuse, Reduce, Recycle in Serverless WorldDmitri Zimine
 
Python testing like a pro by Keith Yang
Python testing like a pro by Keith YangPython testing like a pro by Keith Yang
Python testing like a pro by Keith YangPYCON MY PLT
 

Similar to What Can Reverse Engineering Do For You? (20)

Adding Security to Your Workflow With InSpec - SCaLE17x
Adding Security to Your Workflow With InSpec - SCaLE17xAdding Security to Your Workflow With InSpec - SCaLE17x
Adding Security to Your Workflow With InSpec - SCaLE17x
 
InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017
 
Winning the Erlang Edit•Build•Test Cycle
Winning the Erlang Edit•Build•Test CycleWinning the Erlang Edit•Build•Test Cycle
Winning the Erlang Edit•Build•Test Cycle
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?
 
DevOpsDaysRiga 2017: Mandi Walls - Building security into your workflow with ...
DevOpsDaysRiga 2017: Mandi Walls - Building security into your workflow with ...DevOpsDaysRiga 2017: Mandi Walls - Building security into your workflow with ...
DevOpsDaysRiga 2017: Mandi Walls - Building security into your workflow with ...
 
One bite and all your dreams will come true: Analyzing and Attacking Apple Ke...
One bite and all your dreams will come true: Analyzing and Attacking Apple Ke...One bite and all your dreams will come true: Analyzing and Attacking Apple Ke...
One bite and all your dreams will come true: Analyzing and Attacking Apple Ke...
 
Ephemeral DevOps: Adventures in Managing Short-Lived Systems
Ephemeral DevOps: Adventures in Managing Short-Lived SystemsEphemeral DevOps: Adventures in Managing Short-Lived Systems
Ephemeral DevOps: Adventures in Managing Short-Lived Systems
 
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbers
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbersDefcon 22 - Stitching numbers - generating rop payloads from in memory numbers
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbers
 
You're Off the Hook: Blinding Security Software
You're Off the Hook: Blinding Security SoftwareYou're Off the Hook: Blinding Security Software
You're Off the Hook: Blinding Security Software
 
InSpec Workflow for DevOpsDays Riga 2017
InSpec Workflow for DevOpsDays Riga 2017InSpec Workflow for DevOpsDays Riga 2017
InSpec Workflow for DevOpsDays Riga 2017
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
 
Ruby Under The Hood
Ruby Under The HoodRuby Under The Hood
Ruby Under The Hood
 
There and Back Again (My DevOps journey) - DevOps Days Copenhagen 2018
There and Back Again (My DevOps journey) - DevOps Days Copenhagen 2018There and Back Again (My DevOps journey) - DevOps Days Copenhagen 2018
There and Back Again (My DevOps journey) - DevOps Days Copenhagen 2018
 
Lions, Tigers and Deers: What building zoos can teach us about securing micro...
Lions, Tigers and Deers: What building zoos can teach us about securing micro...Lions, Tigers and Deers: What building zoos can teach us about securing micro...
Lions, Tigers and Deers: What building zoos can teach us about securing micro...
 
Make static instrumentation great again, High performance fuzzing for Windows...
Make static instrumentation great again, High performance fuzzing for Windows...Make static instrumentation great again, High performance fuzzing for Windows...
Make static instrumentation great again, High performance fuzzing for Windows...
 
08 - Return Oriented Programming, the chosen one
08 - Return Oriented Programming, the chosen one08 - Return Oriented Programming, the chosen one
08 - Return Oriented Programming, the chosen one
 
Building a REST API Microservice for the DevNet API Scavenger Hunt
Building a REST API Microservice for the DevNet API Scavenger HuntBuilding a REST API Microservice for the DevNet API Scavenger Hunt
Building a REST API Microservice for the DevNet API Scavenger Hunt
 
Reuse, Reduce, Recycle in Serverless World
Reuse, Reduce, Recycle in Serverless WorldReuse, Reduce, Recycle in Serverless World
Reuse, Reduce, Recycle in Serverless World
 
Python testing like a pro by Keith Yang
Python testing like a pro by Keith YangPython testing like a pro by Keith Yang
Python testing like a pro by Keith Yang
 

Recently uploaded

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 

Recently uploaded (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 

What Can Reverse Engineering Do For You?

  • 1. ShellCon 2017 | What Can RE Do For You? 1 WHAT CAN REVERSE ENGINEERING DO FOR YOU? MALWARE UNICORN
  • 2. ShellCon 2017 | What Can RE Do For You? 2 ABOUT ME WHAT I DO securedorg.github.io Teach Malware RE Look at malware DEFCON OPCDE CFP Reviewer Amanda Rousseau Host Meetups Follow Fashion Trends meetup.com/Dead-Drop-SF vanitysec.com RSA, DEFCON 44Con, CanSecWest Bsides SF, WiCys DC3Con, MirCon Speak at ConsSr. Malware Researcher Endgame Inc. Occasionally Shitpost @malwareunicorn
  • 3. ShellCon 2017 | What Can RE Do For You? 3 Why Reverse Engineering? It is the foundation for both the blue and red teams Vuln Research Malware Analysis Exploit Dev Detection Sigs Forensics Pentesting Kits Reverse Engineering AV Engine Dev
  • 4. ShellCon 2017 | What Can RE Do For You? 4 Watch out for Rabbit Holes It’s easy to get lost debugging some random binary. This talk will help you identify specific patterns in assembly routines commonly found in malware.
  • 5. ShellCon 2017 | What Can RE Do For You? 5 “YOU ONLY NEED A DISASSEMBLER, DEBUGGER, AND A HEX EDITOR TO DO RE” – ANONYMOUS DUDE
  • 6. ShellCon 2017 | What Can RE Do For You? 6 The “RE” starter pack
  • 7. ShellCon 2017 | What Can RE Do For You? 7 ALL TOOLS SUPPORT HxD Hex Editor Python - used for automating tasks INFORMATION GATHERING CFF Explorer - PE header parser PE Explorer - PE inspection BinText - Extract strings Sysinternals Suite DISASSEMBLERS Ida Free Pro (Most Popular) Radare Capstone DEBUGGERS x64dbg (My Favorite) Immunity OllyDbg (Most Popular) WinDbg GDB
  • 8. ShellCon 2017 | What Can RE Do For You? 8 Approach • Recognizing patterns comes with experience • Break down algorithms into basic steps • Information gathering is key, it helps define how the binary and assembly is used for that specific language • Use Backward-Forward navigation and take notes!
  • 9. ShellCon 2017 | What Can RE Do For You? 9 BACKWARD-FORWARD Start somewhere in the middle and navigate backwards to the entry point function. Then go forwards to get back to the middle while taking notes. main() Sub_1() Sub_2() Sub_4()Start Sub_3()Next Next End Sub_4() Sub_2() main() Sub_1()
  • 10. ShellCon 2017 | What Can RE Do For You? 10 BACKWARD-FORWARD My Notes
  • 11. ShellCon 2017 | What Can RE Do For You? 11 Common Assembly Patterns Common techniques found in malware PACKING EVASION CRYPTO SHELLCODE
  • 12. ShellCon 2017 | What Can RE Do For You? 12 PACKING 1. Allocate a huge memory chunk 2. Load referenced section, resource, or .data 3. Some routine that loops 4. Recreate the import table 5. Convert to R-W-X 6. Jump to start of newly copied bytes Things to look for
  • 13. ShellCon 2017 | What Can RE Do For You? 13 PACKING HEADER MAIN CODE PACKED CODE NEW MEMORY RWX RECREATE IMPORT TABLE LOOP 1 2 5 4 3 6 JUMP
  • 14. ShellCon 2017 | What Can RE Do For You? 14 PACKING UPX
  • 15. ShellCon 2017 | What Can RE Do For You? 15 PACKING memory chuck == UPX0 section
  • 16. ShellCon 2017 | What Can RE Do For You? 16 PACKING Recreate the import table
  • 17. ShellCon 2017 | What Can RE Do For You? 17 PACKING Recreate the import table
  • 18. ShellCon 2017 | What Can RE Do For You? 18 PACKING Import table in the debugger
  • 19. ShellCon 2017 | What Can RE Do For You? 19 PACKING Convert to R-W-X with VirtualProtect Some routine that loops Jump to start of newly copied bytes
  • 20. ShellCon 2017 | What Can RE Do For You? 20 PACKING • Look for references to sections, resources, or .data • Look for the jump call Debugging • Save the address to the new memory section. Set an execution breakpoint on that memory location. Static Analysis How to get around it
  • 21. ShellCon 2017 | What Can RE Do For You? 21 EVASION • Lots of jumps where one jump terminates the program • Environment checking • Useless routines Things to look for
  • 22. ShellCon 2017 | What Can RE Do For You? 22 EVASION Sub_0() Sub_1() Sub_4() Sub_3() Exit() Some Check JZ Exit() JZ Exit() JZ Exit() Some Check Some Check
  • 23. ShellCon 2017 | What Can RE Do For You? 23 EVASION
  • 24. ShellCon 2017 | What Can RE Do For You? 24 EVASION • VM Evasion – Checking the environment for VM artifacts • Anti-analysis – useless jumps & functions • Anti-AV Detection – Heavy obfuscation, environment checks • Anti Automation – requires UI activity Types of Evasion
  • 25. ShellCon 2017 | What Can RE Do For You? 25 EVASION VM Evasion • Accessing registry keys for hardware & Bios • Checking driver names for VM drivers • Any check in Paranoid Fish (https://github.com/a0rtega/pafish) Things to look for
  • 26. ShellCon 2017 | What Can RE Do For You? 26 EVASION VM Evasion • Accessing registry keys for hardware, Bios, and/or Physical Drive
  • 27. ShellCon 2017 | What Can RE Do For You? 27 EVASION VM Evasion • Accessing registry keys for hardware, Bios, and/or Physical Drive
  • 28. ShellCon 2017 | What Can RE Do For You? 28 EVASION • useless jumps & functions • Debugger checks • Time bombs • Tick timer checks Things to look for Anti-Analysis
  • 29. ShellCon 2017 | What Can RE Do For You? 29 EVASION • useless jumps & functions • Debugger checks • Time bombs • Tick timer checks Things to look for Anti-Analysis
  • 30. ShellCon 2017 | What Can RE Do For You? 30 EVASION Anti-AV Detection • Accessing registry keys for AV names • Checking program files, DLLs, Driver names • Stack based strings and IOCs Things to look for
  • 31. ShellCon 2017 | What Can RE Do For You? 31 EVASION Anti-AV Detection Stack based strings and IOCs
  • 32. ShellCon 2017 | What Can RE Do For You? 32 EVASION Anti Automation • Checking for User Interaction • Mouse movement • Foreground window state change • Long sleep/wait calls • Internet connection tests Things to look for
  • 33. ShellCon 2017 | What Can RE Do For You? 33 • Checking for User Interaction • Foreground window state change EVASION Anti Automation
  • 34. ShellCon 2017 | What Can RE Do For You? 34 EVASION • Patch the CMP and JNZ jump calls so that it always passes the check Debugging • Modify the Zero flag to bypass the check Static Analysis How to get around it
  • 35. ShellCon 2017 | What Can RE Do For You? 35 EVASION • Patch the CMP and JNZ jump calls so that it always passes the check Debugging • Modify the Zero flag to bypass the check Static Analysis How to get around it
  • 36. ShellCon 2017 | What Can RE Do For You? 36 CRYPTO Call a function right after STEP 2 Loop a lot STEP 3 Load a reference in .DATA STEP 1 XOR something STEP 4
  • 37. ShellCon 2017 | What Can RE Do For You? 37 CRYPTO Call a function right after STEP 2 Load a reference in .DATA STEP 1
  • 38. ShellCon 2017 | What Can RE Do For You? 38 CRYPTO Loop a lot STEP 3
  • 39. ShellCon 2017 | What Can RE Do For You? 39 CRYPTO xor A, B xor A, A xor [esi], al xor eax, eax XOR the lower byte of register eax with the value at esi Clear the register eax XOR something STEP 4
  • 40. ShellCon 2017 | What Can RE Do For You? 40 CRYPTO • Look for frequent usages of the function after data loads • Identify the crypto algorithm and create a simple decryption script Debugging • Place a breakpoint before the return or after the function to see the decrypted string • Place a write hardware breakpoint in the newly allocated memory region Static Analysis How to get around it
  • 41. ShellCon 2017 | What Can RE Do For You? 41 SHELLCODE • Heap or VirtualAlloc with R-W-X permissions • Copy a large chunk of bytes to newly created memory • Jump to an offset in that new memory • Or spawn a new thread Things to look for
  • 42. ShellCon 2017 | What Can RE Do For You? 42 SHELLCODE • Similar to unpacking • Shellcode is process independent code • May or may not need an import table creation Things to note
  • 43. ShellCon 2017 | What Can RE Do For You? 43 SHELLCODE HEADER MAIN CODE SHELLCODE NEW MEMORY RWX LOOP 1 2 4 3 5 JUMP
  • 44. ShellCon 2017 | What Can RE Do For You? 44 SHELLCODE • value Offset+0x42B7 is being saved in register esi and then pushed onto the stack before the function returns. • Typically functions will pop the ebp on the stack to restore the previous stack frame of the calling function. Things to note
  • 45. ShellCon 2017 | What Can RE Do For You? 45 SHELLCODE • Look for references to sections, resources, or .data • Look for the jump or push & ret call Debugging • Save the address to the new memory section. Set an execution breakpoint on that memory location. • Extract the shellcode from memory and convert it into an exe Static Analysis How to get around it
  • 46. ShellCon 2017 | What Can RE Do For You? 46 SHELLCODE Converting Shellcode to an EXE 1. Download Yasm yasm-1.3.0-win32.exe 2. Extract yasm-1.3.0-win32.exe and rename it to yasm.exe 3. Download GoLink linker Golink.zip 4. Extract golink.exe 5. Create a shellcode.asm file with the following instructions 6. From a command line run the following command to assemble the code: • yasm.exe -f win32 -o shellcode.obj shellcode.asm 7. Now run the linker • golink /ni /entry Start shellcode.obj 8. Change the AddressOfEntryPoint. Add the current value to 0x42B7 which was the offset of where the malware was going to return to in function sub_45B794. AddressOfEntryPoint should be 000052B7. This will ensure that IDA knows where to start the disassembly. Global Start SECTION 'AyyLmao' write, execute,read Start: incbin "shellcode.bin"
  • 47. ShellCon 2017 | What Can RE Do For You? 47 Things to REmember • Take notes • PATCH, PATCH, PATCH - every evasion can be bypassed • Memory & Hardware breakpoints are your friends • Loops are annoying but good for identification • Repeated functions are fishy indicators
  • 48. ShellCon 2017 | What Can RE Do For You? 48 Thanks for coming! Questions? Twitter: @malwareunicorn