Taint Analysis ForTaint Analysis For
Vulnerability DiscoveryVulnerability Discovery
passket # gmail.com
http://passket.tistory.com
2010. 7. 3
www.CodeEngn.com
2010 4th CodeEngn ReverseEngineering Conference
Motivation
Where are vulnerabilities ?
How can you find the vulnerability ?How can you find the vulnerability ?
Is there vulnerability in my program ?
Where is my data in vulnerable program ?Unknown
vulnerability in commodity program ?
Does finding zero-day-vulnerablity make money ?
OutlineOutline
• Basic Concepts
• Tainted Propagation on x86
• Simple Test for TaintingSimple Test for Tainting
• Into The Abyss : in the wild world
• Future Work : Raison Framework
• References• References
Basic Concepts
input data : xinput data : xinput data : xinput data : x
functionfunction
ddoutput data : youtput data : y
And Now we call this “system”
modify data : we call this “tainting”
input data : xinput data : xinput data : xinput data : x
functionfunction
ddoutput data : youtput data : y
we can analysis how tainted output driven
: we can call this “taint analysis”
How does taint analysis helpHow does taint analysis help
Our works ?
• Exploit Detections :
- Find tainted EIP registerFind tainted EIP register
- Find tainted Function Pointers
- Find tainted Stack Arguments
- Find tainted Data Structure using systemFind tainted Data Structure using system
• Now we reverse upper follows
• Finding Vulnerability
fOther benefits
• Solve Reachability Problems
- How can I makes PDF files to execute code block
#937 in PDF reader ?
• Zero-day Detection
I l d h b l- Include other bug class
• Helping Fuzzer Mutationsp g
Tainted Object
• The Object from untrusted source
untrusteduntrusted sourcesource
untrusted data #1untrusted data #1
operationoperationoperationoperation
untrusted data #2untrusted data #2
Tainted Object
• The Object from untrusted operation, data
untrusteduntrusted data #1data #1
untrusteduntrusted
untrusted data #2untrusted data #2 operationoperation
untrusteduntrusted
datadata
#3#3
trusted datatrusted data
#3#3
Tainted Object
• Untrusted Sources
- Files, Inputs, Network Reads, ...
• Tainted ObjectsTainted Objects
- Memory Locations, Process Registers
Taint Propagation on x86
Taint Propagation
• Taint Propagation is analysis for tainted object
derivation activities.
• If a tainted object X derive to Y
“Y i th t i t d bj t”- we say “Y is the tainted object”
- so, we assign this : X → T(Y)
• Taint operation is transitive
- X → T(Y), and Y → T(Z) then, X → T(Z)
Taint Propagation
(Tainted Objects)
memory addressmemory address
(Tainted Objects)
yy
0x0012FF700x0012FF70
ADDADD
process registerprocess register
EBXEBX
process registerprocess register
EAXEAX
EBXEBX
EAXEAX
(untainted objects)
(Tainted Objects)
Operation on x86Operation on x86
which derived in tainited
• Assignment Operations
- operation move X to Y
• Arithmetical Operationsp
- operation perfumes arithmatic calculus from X
• Stack Push/Pop Operations
- similar with Assignment Operationssimilar with Assignment Operations
Operation on x86Operation on x86
which derived in tainited
• B l O ti• Boolean Operation
- must consider if the result of the operation depend on the
value of tainted object
- ex) AND Operationex) AND Operation
A(tainted) B A && B
0 0 0(untainted)( )
0 1 0(untainted)
1 0 0(untainted)
- special case : X xor X is always untainted
1 1 1(tainted)
Operation on x86Operation on x86
which derived in tainited
• We analysis whole program process
- Finally, if we find tainted special object, we find a new bugs
- special object : EIP register, function pointers, etc.special object : EIP register, function pointers, etc.
implementations of propagation
• Just trace using breakpointsg p
- only memory locations
• Just trace using exceptions
- only memory locationsonly memory locations
• How do we trace process registers ?
- emulation or virtualization, It is only way to propagations
implementations of propagation
• Aft fi t th t i t d bj t i t ti h t• After we figure out the tainted object, every instruction has to
execute after emulation.
- So, we can figure out new tainted object.
• Or, register handler to process register using virtualizationOr, register handler to process register using virtualization
- this requires fully implementation for cpu emulating and
memory accessmemory access
Simple Test For Tainting
I h AbInto the Abyss :
in the wild world
welcome to wild world!
• P bl 1 ltith d• Problem 1 : multithread or
message-driven
• Problem II : a lot of logs
• Problem III : still can’t find ?
for the real world tainting
• Multithreaded or Message-Driven Program makes your fuzzer
into hang overinto hang over
- Cuz, There is no automated end of program
- So, you make fully virtualization for program
• Th f l• There are tons of log
- Is it same with mutation fuzzing ?g
- no waaaay, keep in going analysis tightly
tips for the real world tainting
•• Using debugger : paimei is good for it
• Construct your own emulation for programy p g
• Sometimes just use other guy’s code
- why not ? valgrind + wine + windows app.
- concentrate your major subject : finding bugsconcentrate your major subject : finding bugs.
tips for the real world tainting
• EX> Valgrind ls -al /
Extras
Raison Framework
automated exploit framework
still under-constructing.....
references
- “LIFT: A Low-Overhead Practical Information Flow Tracking System for Detecting Security Attacks” -
Feng Qin, Cheng Wang, Zhenmin Li, Ho-seop Kim, Yuanyuan zhou, Youfeng Wu - University of Illinois
- “BitBlaze: A New Approach to Computer Security via Binary Analysis” - Dawn Song
- “Dytan: A generic dynamic taint analysis framework” – James Clause, Wanchun Li, and Alessandro Orso.y g y y , ,
Georgia Institute of Technology.
- “Understanding data lifetime via whole system emulation” – Jim Chow, Tal Garfinkel, Kevi Christopher,
Mendel Rosenblum – USENIX – Stanford UniversityMendel Rosenblum USENIX Stanford University
- “Taint analysis” - edgar barbosa, H2HC 2009
- “valgrind” http://valgrind org/- valgrind - http://valgrind.org/
- “paimei & pydbg” - http://pedram.redhive.com/PyDbg/docs/
- “PyEmu” - http://code.google.com/p/pyemu/
www.CodeEngn.com
2010 4th CodeEngn ReverseEngineering Conference

More Related Content

PDF
Taint analysis
PDF
Javascript Performance
PDF
TMPA-2017: Vellvm - Verifying the LLVM
PDF
Reducing Redundancies in Multi-Revision Code Analysis
PDF
Wait for your fortune without Blocking!
PDF
Why GC is eating all my CPU?
PDF
Reversing Engineer: Dissecting a "Client Side" Vulnerability in the APT era
PPTX
Variables and Data Types
Taint analysis
Javascript Performance
TMPA-2017: Vellvm - Verifying the LLVM
Reducing Redundancies in Multi-Revision Code Analysis
Wait for your fortune without Blocking!
Why GC is eating all my CPU?
Reversing Engineer: Dissecting a "Client Side" Vulnerability in the APT era
Variables and Data Types

Similar to [2010 CodeEngn Conference 04] passket - Taint analysis for vulnerability discovery (20)

PDF
A guided fuzzing approach for security testing of network protocol software
PPTX
Advanced malware analysis training session3 botnet analysis part2
PDF
Crash Analysis with Reverse Taint
PPT
13517398.ppt
PDF
[2011 CodeEngn Conference 05] Deok9 - DBI(Dynamic Binary Instrumentation)를 이용...
PDF
Inside the Matrix,How to Build Transparent Sandbox for Malware Analysis
PPTX
Advanced Malware Analysis Training Session 3 - Botnet Analysis Part 2
PPTX
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
PDF
The Postmodern Binary Analysis
PDF
Dynamic Taint Analysis Tools: A Review
PDF
A Smart Fuzzing Approach for Integer Overflow Detection
PDF
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
PDF
Static Analysis Techniques For Testing Application Security - Houston Tech Fest
PDF
50120130406012
PPTX
Malware 101 by saurabh chaudhary
PDF
Software Analytics: Data Analytics for Software Engineering and Security
PDF
How Automated Vulnerability Analysis Discovered Hundreds of Android 0-days
PDF
Cansec West 2009
PDF
ISSTA 2017 Impact Paper Award Presentation
PDF
PANDEMONIUM: Automated Identification of Cryptographic Algorithms using Dynam...
A guided fuzzing approach for security testing of network protocol software
Advanced malware analysis training session3 botnet analysis part2
Crash Analysis with Reverse Taint
13517398.ppt
[2011 CodeEngn Conference 05] Deok9 - DBI(Dynamic Binary Instrumentation)를 이용...
Inside the Matrix,How to Build Transparent Sandbox for Malware Analysis
Advanced Malware Analysis Training Session 3 - Botnet Analysis Part 2
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Postmodern Binary Analysis
Dynamic Taint Analysis Tools: A Review
A Smart Fuzzing Approach for Integer Overflow Detection
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
Static Analysis Techniques For Testing Application Security - Houston Tech Fest
50120130406012
Malware 101 by saurabh chaudhary
Software Analytics: Data Analytics for Software Engineering and Security
How Automated Vulnerability Analysis Discovered Hundreds of Android 0-days
Cansec West 2009
ISSTA 2017 Impact Paper Award Presentation
PANDEMONIUM: Automated Identification of Cryptographic Algorithms using Dynam...
Ad

More from Code Engn (20)

PDF
[2014 CodeEngn Conference 11] 박한범 - 가상화 기술과 보안
PDF
[2014 CodeEngn Conference 11] 이경식 - 동적 추적 프레임워크를 이용한 OS X 바이너리 분석
PDF
[2014 CodeEngn Conference 11] 남대현 - iOS MobileSafari Fuzzer 제작 및 Fuzzing
PDF
[2014 CodeEngn Conference 11] 김기홍 - 빅데이터 기반 악성코드 자동 분석 플랫폼
PDF
[2014 CodeEngn Conference 11] 최우석 - 자바스크립트 난독화 너네 뭐니?
PDF
[2014 CodeEngn Conference 11] 박세한 - IE 1DAY Case Study KO
PDF
[2014 CodeEngn Conference 11] 박세한 - IE 1DAY Case Study EN
PDF
[2014 CodeEngn Conference 11] 김호빈 - Android Bootkit Analysis KO
PDF
[2014 CodeEngn Conference 11] 김호빈 - Android Bootkit Analysis EN
PDF
[2014 CodeEngn Conference 11] 정든품바 - 웹성코드
PDF
[2014 CodeEngn Conference 10] 정광운 - 안드로이드에서도 한번 후킹을 해볼까 (Hooking on Android)
PDF
[2014 CodeEngn Conference 10] 노용환 - 디버거 개발, 삽질기
PDF
[2014 CodeEngn Conference 10] 심준보 - 급전이 필요합니다
PDF
[2013 CodeEngn Conference 09] x15kangx - MS Office 2010 문서 암호화 방식 분석 결과
PDF
[2013 CodeEngn Conference 09] proneer - Malware Tracker
PDF
[2013 CodeEngn Conference 09] BlueH4G - hooking and visualization
PDF
[2013 CodeEngn Conference 09] wh1ant - various tricks for linux remote exploits
PDF
[2013 CodeEngn Conference 09] 제갈공맹 - MS 원데이 취약점 분석 방법론
PDF
[2013 CodeEngn Conference 09] Park.Sam - 게임 해킹툴의 변칙적 공격 기법 분석
PDF
[2013 CodeEngn Conference 09] 김홍진 - 보안컨설팅 이해 및 BoB 보안컨설팅 인턴쉽
[2014 CodeEngn Conference 11] 박한범 - 가상화 기술과 보안
[2014 CodeEngn Conference 11] 이경식 - 동적 추적 프레임워크를 이용한 OS X 바이너리 분석
[2014 CodeEngn Conference 11] 남대현 - iOS MobileSafari Fuzzer 제작 및 Fuzzing
[2014 CodeEngn Conference 11] 김기홍 - 빅데이터 기반 악성코드 자동 분석 플랫폼
[2014 CodeEngn Conference 11] 최우석 - 자바스크립트 난독화 너네 뭐니?
[2014 CodeEngn Conference 11] 박세한 - IE 1DAY Case Study KO
[2014 CodeEngn Conference 11] 박세한 - IE 1DAY Case Study EN
[2014 CodeEngn Conference 11] 김호빈 - Android Bootkit Analysis KO
[2014 CodeEngn Conference 11] 김호빈 - Android Bootkit Analysis EN
[2014 CodeEngn Conference 11] 정든품바 - 웹성코드
[2014 CodeEngn Conference 10] 정광운 - 안드로이드에서도 한번 후킹을 해볼까 (Hooking on Android)
[2014 CodeEngn Conference 10] 노용환 - 디버거 개발, 삽질기
[2014 CodeEngn Conference 10] 심준보 - 급전이 필요합니다
[2013 CodeEngn Conference 09] x15kangx - MS Office 2010 문서 암호화 방식 분석 결과
[2013 CodeEngn Conference 09] proneer - Malware Tracker
[2013 CodeEngn Conference 09] BlueH4G - hooking and visualization
[2013 CodeEngn Conference 09] wh1ant - various tricks for linux remote exploits
[2013 CodeEngn Conference 09] 제갈공맹 - MS 원데이 취약점 분석 방법론
[2013 CodeEngn Conference 09] Park.Sam - 게임 해킹툴의 변칙적 공격 기법 분석
[2013 CodeEngn Conference 09] 김홍진 - 보안컨설팅 이해 및 BoB 보안컨설팅 인턴쉽
Ad

Recently uploaded (20)

PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PDF
Enhancing plagiarism detection using data pre-processing and machine learning...
PDF
Architecture types and enterprise applications.pdf
PPTX
2018-HIPAA-Renewal-Training for executives
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PPTX
Configure Apache Mutual Authentication
PDF
A proposed approach for plagiarism detection in Myanmar Unicode text
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
UiPath Agentic Automation session 1: RPA to Agents
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
Five Habits of High-Impact Board Members
PDF
CloudStack 4.21: First Look Webinar slides
PDF
A review of recent deep learning applications in wood surface defect identifi...
PPTX
The various Industrial Revolutions .pptx
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PPTX
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
PDF
sbt 2.0: go big (Scala Days 2025 edition)
PPTX
Build Your First AI Agent with UiPath.pptx
PPTX
Microsoft Excel 365/2024 Beginner's training
PPT
Geologic Time for studying geology for geologist
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Enhancing plagiarism detection using data pre-processing and machine learning...
Architecture types and enterprise applications.pdf
2018-HIPAA-Renewal-Training for executives
Final SEM Unit 1 for mit wpu at pune .pptx
Configure Apache Mutual Authentication
A proposed approach for plagiarism detection in Myanmar Unicode text
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
UiPath Agentic Automation session 1: RPA to Agents
Module 1.ppt Iot fundamentals and Architecture
Five Habits of High-Impact Board Members
CloudStack 4.21: First Look Webinar slides
A review of recent deep learning applications in wood surface defect identifi...
The various Industrial Revolutions .pptx
sustainability-14-14877-v2.pddhzftheheeeee
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
sbt 2.0: go big (Scala Days 2025 edition)
Build Your First AI Agent with UiPath.pptx
Microsoft Excel 365/2024 Beginner's training
Geologic Time for studying geology for geologist

[2010 CodeEngn Conference 04] passket - Taint analysis for vulnerability discovery

  • 1. Taint Analysis ForTaint Analysis For Vulnerability DiscoveryVulnerability Discovery passket # gmail.com http://passket.tistory.com 2010. 7. 3 www.CodeEngn.com 2010 4th CodeEngn ReverseEngineering Conference
  • 2. Motivation Where are vulnerabilities ? How can you find the vulnerability ?How can you find the vulnerability ? Is there vulnerability in my program ? Where is my data in vulnerable program ?Unknown vulnerability in commodity program ? Does finding zero-day-vulnerablity make money ?
  • 3. OutlineOutline • Basic Concepts • Tainted Propagation on x86 • Simple Test for TaintingSimple Test for Tainting • Into The Abyss : in the wild world • Future Work : Raison Framework • References• References
  • 5. input data : xinput data : xinput data : xinput data : x functionfunction ddoutput data : youtput data : y And Now we call this “system”
  • 6. modify data : we call this “tainting” input data : xinput data : xinput data : xinput data : x functionfunction ddoutput data : youtput data : y we can analysis how tainted output driven : we can call this “taint analysis”
  • 7. How does taint analysis helpHow does taint analysis help Our works ? • Exploit Detections : - Find tainted EIP registerFind tainted EIP register - Find tainted Function Pointers - Find tainted Stack Arguments - Find tainted Data Structure using systemFind tainted Data Structure using system • Now we reverse upper follows • Finding Vulnerability
  • 8. fOther benefits • Solve Reachability Problems - How can I makes PDF files to execute code block #937 in PDF reader ? • Zero-day Detection I l d h b l- Include other bug class • Helping Fuzzer Mutationsp g
  • 9. Tainted Object • The Object from untrusted source untrusteduntrusted sourcesource untrusted data #1untrusted data #1 operationoperationoperationoperation untrusted data #2untrusted data #2
  • 10. Tainted Object • The Object from untrusted operation, data untrusteduntrusted data #1data #1 untrusteduntrusted untrusted data #2untrusted data #2 operationoperation untrusteduntrusted datadata #3#3 trusted datatrusted data #3#3
  • 11. Tainted Object • Untrusted Sources - Files, Inputs, Network Reads, ... • Tainted ObjectsTainted Objects - Memory Locations, Process Registers
  • 13. Taint Propagation • Taint Propagation is analysis for tainted object derivation activities. • If a tainted object X derive to Y “Y i th t i t d bj t”- we say “Y is the tainted object” - so, we assign this : X → T(Y) • Taint operation is transitive - X → T(Y), and Y → T(Z) then, X → T(Z)
  • 14. Taint Propagation (Tainted Objects) memory addressmemory address (Tainted Objects) yy 0x0012FF700x0012FF70 ADDADD process registerprocess register EBXEBX process registerprocess register EAXEAX EBXEBX EAXEAX (untainted objects) (Tainted Objects)
  • 15. Operation on x86Operation on x86 which derived in tainited • Assignment Operations - operation move X to Y • Arithmetical Operationsp - operation perfumes arithmatic calculus from X • Stack Push/Pop Operations - similar with Assignment Operationssimilar with Assignment Operations
  • 16. Operation on x86Operation on x86 which derived in tainited • B l O ti• Boolean Operation - must consider if the result of the operation depend on the value of tainted object - ex) AND Operationex) AND Operation A(tainted) B A && B 0 0 0(untainted)( ) 0 1 0(untainted) 1 0 0(untainted) - special case : X xor X is always untainted 1 1 1(tainted)
  • 17. Operation on x86Operation on x86 which derived in tainited • We analysis whole program process - Finally, if we find tainted special object, we find a new bugs - special object : EIP register, function pointers, etc.special object : EIP register, function pointers, etc.
  • 18. implementations of propagation • Just trace using breakpointsg p - only memory locations • Just trace using exceptions - only memory locationsonly memory locations • How do we trace process registers ? - emulation or virtualization, It is only way to propagations
  • 19. implementations of propagation • Aft fi t th t i t d bj t i t ti h t• After we figure out the tainted object, every instruction has to execute after emulation. - So, we can figure out new tainted object. • Or, register handler to process register using virtualizationOr, register handler to process register using virtualization - this requires fully implementation for cpu emulating and memory accessmemory access
  • 20. Simple Test For Tainting
  • 21. I h AbInto the Abyss : in the wild world
  • 22. welcome to wild world! • P bl 1 ltith d• Problem 1 : multithread or message-driven • Problem II : a lot of logs • Problem III : still can’t find ?
  • 23. for the real world tainting • Multithreaded or Message-Driven Program makes your fuzzer into hang overinto hang over - Cuz, There is no automated end of program - So, you make fully virtualization for program • Th f l• There are tons of log - Is it same with mutation fuzzing ?g - no waaaay, keep in going analysis tightly
  • 24. tips for the real world tainting •• Using debugger : paimei is good for it • Construct your own emulation for programy p g • Sometimes just use other guy’s code - why not ? valgrind + wine + windows app. - concentrate your major subject : finding bugsconcentrate your major subject : finding bugs.
  • 25. tips for the real world tainting • EX> Valgrind ls -al /
  • 27. Raison Framework automated exploit framework still under-constructing.....
  • 28. references - “LIFT: A Low-Overhead Practical Information Flow Tracking System for Detecting Security Attacks” - Feng Qin, Cheng Wang, Zhenmin Li, Ho-seop Kim, Yuanyuan zhou, Youfeng Wu - University of Illinois - “BitBlaze: A New Approach to Computer Security via Binary Analysis” - Dawn Song - “Dytan: A generic dynamic taint analysis framework” – James Clause, Wanchun Li, and Alessandro Orso.y g y y , , Georgia Institute of Technology. - “Understanding data lifetime via whole system emulation” – Jim Chow, Tal Garfinkel, Kevi Christopher, Mendel Rosenblum – USENIX – Stanford UniversityMendel Rosenblum USENIX Stanford University - “Taint analysis” - edgar barbosa, H2HC 2009 - “valgrind” http://valgrind org/- valgrind - http://valgrind.org/ - “paimei & pydbg” - http://pedram.redhive.com/PyDbg/docs/ - “PyEmu” - http://code.google.com/p/pyemu/ www.CodeEngn.com 2010 4th CodeEngn ReverseEngineering Conference