31st IEEE Symposium on Security & Privacy

TaintScope: A Checksum-Aware Directed Fuzzing Tool for Automatic Software Vulnerability Detection 1

1

2

Tielei Wang , Tao Wei , Guofei Gu , Wei Zou 1 Peking University, China 2 Texas A&M University, US

1

Outline 

Introduction  



Background Motivation

TaintScope   

Intuition System Design Evaluation

...... 

Conclusion 2

Fuzzing/Fuzz Testing 

Feed target applications with malformed inputs e.g., invalid, unexpected, or random test cases  

Proven to be remarkably successful E.g., randomly mutate well-formed inputs and runs the target application with the “mutations”

Fuzzer

Introduction

Malformed Input

crash

Application

TaintScope

Conclusion

3

Fuzzing is great In the best case, malformed inputs will explore different program paths, and trigger security vulnerabilities

However… Introduction

TaintScope

Conclusion

4

A quick example

re-compute a new checksum

1 void decode_image(FILE* fd){ 2 ... 3 int length = get_length(fd); read the attached 4 int recomputed_chksum = checksum(fd, length); checksum 5 int chksum_in_file = get_checksum(fd); //line 6 is used to check the integrity of inputs 6 if(chksum_in_file != recomputed_chksum) 7 error(); 8 int Width = get_width(fd); compare two values 9 int Height = get_height(fd); 10 int size = Width*Height*sizeof(int);//integer overflow 11 int* p = malloc(size); 12 ... 

Malformed images will be dropped when the decoder function detects checksums mismatch Introduction

TaintScope

Conclusion

5

Checksum: the bottleneck Checksum is a common way to test the integrity of input data Most mutations are blocked at the checksum test point

if(checksum(Data)!= Chksum)

Introduction

TaintScope

Conclusion

6

Our motivation 

Penetrate checksum checks!

Our Goal

Introduction

TaintScope

Conclusion

7

Intuition 

Disable checksum checks by control flow alteration if(checksum(Data)!= Chksum) goto L1; exit(); L1: continue(); Modified Original program

 

Fuzz the modified program Repair the checksum fields in malformed inputs that can crash the modified program Introduction

TaintScope

Conclusion

8

Key Questions 





Q1: How to locate the checksum test instructions in a binary program? Q2: How to effectively and efficiently fuzz for security vulnerability detection? Q3: How to generate the correct checksum value for the invalid inputs that can crash the modified program? Introduction

TaintScope

Conclusion

9

TaintScope Overview Q1

Q2

Checksum Locator

Modified Program

Q3

Directed Fuzzer

Instruction Profile

Execution Monitor

Crashed Samples

Checksum Repairer

Hot Bytes Info

Reports

10

A1: Locate the checksum test instruction Key Observation 1 Checksum is usually used to protect a large number of input bytes

Data if(checksum(Data) != 



Chksum Chksum)

Based on fine-grained taint analysis, we first find the conditional jump instructions (e.g., jz, je) that depend on more than a certain number of input bytes Take these conditional jump instructions as candidates Introduction

TaintScope

Conclusion

11

A1: Locate the checksum test instruction Key Observation 2 Well-formed inputs can pass the checksum test, but most malformed inputs cannot 

We log the behaviors of candidate conditional jump instructions

Introduction

TaintScope

Conclusion

12

A1: Locate the checksum test instruction Key Observation 2 Well-formed inputs can pass the checksum test, but most malformed inputs cannot 



We log the behaviors of candidate conditional jump instructions Run well-formed inputs, identify the always-taken and always-not-taken insts

Introduction

TaintScope

Conclusion

13

A1: Locate the checksum test instruction Key Observation 2 Well-formed inputs can pass the checksum test, but most malformed inputs cannot 





We log the behaviors of candidate conditional jump instructions Run well-formed inputs, identify the always-taken and always-not-taken insts Run malformed inputs, also identify the always-taken and always-not-taken insts

Introduction

TaintScope

Conclusion

14

A1: Locate the checksum test instruction Key Observation 2 Well-formed inputs can pass the checksum test, but most malformed inputs cannot 







We log the behaviors of candidate conditional jump instructions Run well-formed inputs, identify the always-taken and always-not-taken insts Run malformed inputs, also identify the always-taken and always-not-taken insts Identify the conditional jump inst that behaves completely different when processing well-formed and malformed inputs Introduction

TaintScope

Conclusion

15

A2: Effective and efficient fuzzing 

Blindly mutating will create huge amount of redundant test cases --- ineffective and inefficient Directly modifying “width” or “height" 1 void decode_image(FILE* fd){ 2 ... fields will trigger the bug easily ... 6 if(chksum_in_file != recomputed_chksu goto 8; 7 error(); 8 int Width = get_width(fd); 9 int Height = get_height(fd); 10 int size = Width*Height*sizeof(int);//integer overflow 11 int* p = malloc(size); 12 …



Directed fuzzing: focus on modifying the “hot bytes” that refer to the input bytes flow into critical system/library calls 

Memory allocation, string operation… Introduction

TaintScope

Conclusion

16

A3: Generate the correct checksum The classical solution is symbolic execution and constraint solving Solving checksum(Data)== Chksum is hard or impossible, if both Data and Chksum are symbolic values 



We use combined concrete/symbolic execution  



Only leave the bytes in the checksum field as symbolic values Collect and solve the trace constraints on Chksum when reaching the checksum test inst. Note that:  

checksum(Data) is a runtime determinable constant value. Chksum originates from the checksum field, but may be transformed, such as from hex/oct to dec number, from little-endian to big-endian.

Introduction

TaintScope

Conclusion

17

Design Summary 

Directed Fuzzing 

Identify and modify “hot bytes” in valid inputs to generate malformed inputs 



On top of PIN binary instrumentation platform

Checksum-aware Fuzzing   

Locate checksum check points and checksum fields. Modify the program to accept all kinds input data Generate correct checksum fields for malformed inputs that can crash the modified program 

Offline symbolically execute the trace, using STP solver

Introduction

TaintScope

Conclusion

18

Evaluation 

Component evaluation 

 



E1: Whether TaintScope can locate checksum points and checksum fields? E2: How many hot byte in a valid input? E3: Whether TaintScope can generate a correct checksum field?

Overall evaluation 

E4: Whether TaintScope can detect previous unknown vulnerabilities in real-world applications?

Introduction

TaintScope

Conclusion

19

Evaluation 1: locate checksum points 

We test several common checksum algorithms, including CRC32, MD5, Adler32. TaintScope accurately located the check statements.

Introduction

TaintScope

Conclusion

20

Evaluation 2: identify hot bytes 

We measured the number of bytes could affect the size arguments in memory allocation functions

Introduction

TaintScope

Conclusion

21

Evaluation 3: generate correct checksum fields 



We test malformed inputs in four kinds of file formats. TaintScope is able to generate correct checksum fields.

Introduction

TaintScope

Conclusion

22

Evaluation 4 : 27 previous unknown vulns

MS Paint

Google Picasa

irfanview

gstreamer

Amaya

dillo

Introduction

TaintScope

Adobe Acrobat

ImageMagick

Winamp

XEmacs

wxWidgets

PDFlib

Conclusion

23

Evaluation 4 : 27 previous unknown vulns

24

Evaluation 4: 27 previous unknown vulns

Introduction

TaintScope

Conclusion

25

Conclusion  

Checksum is a big challenge for fuzzing tools TaintScope can perform: 

Directed fuzzing  



Checksum-aware fuzzing  



Identify which bytes flow into system/library calls. dramatically reduce the mutation space. Disable checksum checks by control flow alternation. Generate correct checksum fields in invalid inputs.

TaintScope detected dozens of serious previous unknown vulnerabilities. Introduction

TaintScope

Conclusion

26

Thanks for your attention!

TaintScope: A Checksum-Aware Directed Fuzzing Tool ...

Introduction. TaintScope. Conclusion. MS Paint. Google Picasa. Adobe Acrobat. ImageMagick irfanview gstreamer. Winamp. XEmacs. Amaya dillo. wxWidgets.

760KB Sizes 2 Downloads 96 Views

Recommend Documents

browser fuzzing in 2014 - SyScan360
HITB (x2) – Deepsec – nuit du hack – phDays – swiss cyber storm. • https://sites.google.com/site/tentacoloviola/ ..... xhr/WS. Nodejs app js. Eval. (JS). • This evaluation of the js fragment is influenced by: ▫ synch DOM mutations that

A Tool for Text Comparison
The data to be processed was a comparative corpus, the. METER ..... where xk denotes the mean value of the kth variables of all the entries within a cluster.

A new tool for teachers
Items 11 - 20 - Note: The authors wish to express their sincere thanks to Jim Davis .... of the American population) to allow confident generalizations. Children were ..... available to them and (b) whether they currently had a library card. Those to

Middlemen: A Directed Search Equilibrium Approach
Sep 14, 2010 - Page 1 ... Any remaining errors are my own. ..... An increase in the capacity of middlemen km creates a demand effect that induces more.

A Directed Search Model of Ranking by Unemployment ...
May 17, 2011 - tribution may be quite sensitive to business cycle fluctuations. Shocks on ... Ranking of job applicants by unemployment duration has first been introduced by Blanchard ...... Third, farming-, army- and public-administration-.

MEASURABLE CHROMATIC NUMBERS §1. Introduction. A directed ...
In particular, this holds for “the” minimum analytic graph G0 with uncountable Borel (and Baire measurable) chromatic number. In contrast, we show that for all κ ...

A Directed Search Model of Ranking by Unemployment ...
University Carlos III of Madrid & Norwegian School of Management. May 17, 2011 ... Ministry of Science and Technology under Grant Nos. SEJ2007-63098 and 2011/0031/001, ..... the firm to offer a positive net wage to all types of workers.

kirafatyangra - a tool to recommend insecticides - GitHub
Department of Computer Science and Information Technology. DWIT College. In partial fulfillment of the requirements for the Bachelor's Degree in ... Page 2 ...

A Tool for All Seasons
variation. Moreover, museum curators are often reluctant to allow researchers to drill deep grooves into rare hominin teeth. In contrast to conventional methods, ...

A Visual Shell Scripting Tool
and/or file redirections and can be used in a batch ... write a shell script, he or she has to use help system .... command window has a single field where the.

A Collaborative Tool for Synchronous Distance Education
application in a simulated distance education setting. The application combines video-conference with a networked virtual environment in which the instructor and the students can experiment ..... Virtual Campus: Trends for Higher Education and. Train

A Multifunctional RFID/NFC Tool - GitHub
send unexpected data → buffer overflow, … ▫ Power-switch: effective privacy protection/ ... Record and analyze all communication. ▫ Distinguish normal behavior ...

Middlemen: A Directed Search Equilibrium Approach
Sep 14, 2010 - service to buyers and the bid price includes a wholesale premium charged to .... inventory ordering on the markups is consistent with data in a ...

A Model of Directed Consumer Search
Apr 6, 2017 - the VI Conference on the Economics of Advertising and Marketing (Recanati School of ... E-mail: [email protected]. ... 1Or go through the hassle of ordering them online and returning them in case they don't fit.

When Play Is Learning - A School Designed for Self-Directed ...
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. When Play Is Learning - A School Designed for Self-Directed Education.pdf. When Play Is Learning - A School

A Self-Directed Guide to Designing Courses for ...
For Integrated Course Design (Model 1), start by building strong primary components (INITIAL DESIGN ... What kind of thinking or application abilities do you want them to develop? How do you want them to ... student performance, it is much easier to

MEASURABLE CHROMATIC NUMBERS §1. Introduction. A directed ...
towards a contradiction, that there exists n ≥ 3 such that dm(um|m, vm|m) is odd, for all m ≥ n. A simple induction ...... BOX 951555. LOS ANGELES, CA 90095- ...

Efficiency in a Directed Search Model with Information Frictions and ...
Mar 31, 2014 - We show that the directed search equilibrium is not constrained efficient in a dy- namic setting .... complement them with the publicly available information. Thus, the ...... correspondence T1,τ on the domain Iτ as. T1,τ (x)=(qτ .