Top Banner
SMT Solvers in IT Security - Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg [email protected] barbieauglend
26

SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R [email protected] 7 barbieauglend.

Aug 15, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

SMT Solvers in IT Security -Deobfuscating binary code

with logic

barbieauglend @ BlackHoodie17 - LuxembourgR [email protected] • 7 barbieauglend

Page 2: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

DISCLAIMER

This research was accomplished by me in my personalcapacity. The opinions and views expressed in this talk andarticle are my own and do not necessarily reflect the official

policy or view of my employer.

Page 3: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

WHO AM I?

Page 4: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

Overview:

• Introduction to Constraint Logic Programming• Applications of CLP in IT Security• Binary Obfuscation• Malware deobfuscation using CLP

Page 5: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

CONSTRAINTS

Page 6: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

”Constraint programming represents one of the closestapproaches computer science has yet made to the Holy Grail ofprogramming: the user states the problem, the computer solves

it.”

Eugene C. Freuder, Constraints, April 1997

Page 7: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.
Page 8: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

Automated Theorem Proving

• Hardware and Software→ Large-scale verification

• Languages specification and Computing proof obligations

Page 9: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

SYMBOLIC EXECUTION

Page 10: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

APPLICATIONS

Page 11: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

Bug Hunting

• Fuzzing

• Verification

• Analysis

Page 12: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

Exploit Generation

• Automatic Exploit Generation

• Proof of Concept

• Automatic Payload Generation

Page 13: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

Malware Analysis

• Obfuscation

• Garbage-code elimination

• Compilation

• Packing

• Anti-debugging

• Crypto analysis

Page 14: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

BINARY OBFUSCATION

Page 15: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

Malware Obfuscation

SW Property Protection

Page 16: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

HOW DOES IT WORK?

Page 17: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

• Compiled

• Packed

• Obfuscated

• Anti-debugging

Page 18: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

Garbage Code

• Unnecessary instructions• Jumps that are never taken

Page 19: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

The exclusive or operation

Page 20: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

Packers

• UPX, NSIS• self implemented

Page 21: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

Malware Analysis• Practical:

Techniques tothwart analysis

• Theoretical:Rice’s Theorem

Page 22: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.
Page 23: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

• Symbols as arguments⇒ any feasible path

• Program states• Symbolic values for memory

locations• Path conditions

Page 24: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.
Page 25: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

CONCLUSION

Page 26: SMT Solvers in IT Security - Deobfuscating binary code ...€¦ · Deobfuscating binary code with logic barbieauglend @ BlackHoodie17 - Luxembourg R barbieauglend@chaosdorf.de 7 barbieauglend.

THANK YOU!