ICS Protocol Fuzzing: Coverage Guided Packet Crack And .

2y ago
95 Views
2 Downloads
705.37 KB
7 Pages
Last View : 6d ago
Last Download : 3m ago
Upload by : Karl Gosselin
Transcription

ICS Protocol Fuzzing: Coverage Guided Packet Crack andGenerationZhengxiong LuoFeilong ZuoYuheng ShenKLISS, BNRist, School of SoftwareTsinghua University, Chinaluozx19@mails.tsinghua.edu.cnKLISS, BNRist, School of SoftwareTsinghua University, Chinazuofl19@mails.tsinghua.edu.cnKLISS, BNRist, School of SoftwareTsinghua University, Chinasyh1308@gmail.comXun JiaoWanli ChangYu Jiang Department of Electrical and Computer EngineeringVillanova University, USAxun.jiao@villanova.eduDepartment of Computer ScienceUniversity of York, UKwanli.chang@york.ac.ukKLISS, BNRist, School of SoftwareTsinghua University, Chinajiangyu198964@126.comAbstract—Industrial Control System (ICS) protocols play an essentialrole in building communications among system components. Recently,many severe vulnerabilities, such as Stuxnet and DragonFly, exposed inICS protocols have affected a wide distribution of devices. Therefore, it isof vital importance to ensure their correctness. However, the vulnerabilitydetection efficiency of traditional techniques such as fuzzing is challengedby the complexity and diversity of the protocols.In this paper, we propose to equip the traditional protocol fuzzing withcoverage-guided packet crack and generation. We collect the coverageinformation during testing procedure, save those valuable packets thattrigger new path coverage and crack them into pieces, based on which,we can construct higher quality new packets for further testing. Forevaluation, we build Peach* on top of Peach, which is one of the mostwidely used protocol fuzzers, and conduct experiments on several ICSprotocols such as Modbus and DNP3. Results show that, compared withthe original Peach, Peach* achieves the same code coverage and bugdetection numbers at the speed of 1.2X-25X. It also gains final increasewith 8.35%-36.84% more paths within 24 hours, and has exposed 9previously unknown vulnerabilities.Index Terms—Fuzzing, ICS Protocol, Vulnerability DetectionI. I NTRODUCTIONIndustrial Control System (ICS) refers to a system combininghardware and software with network connectivity so as to supportcritical infrastructure. In recent years, we have witnessed a wideadoption of ICS, including energy, transportation, communications,etc. To meet the demand of the developing industry, there is atrend towards higher openness of ICS, with an increasing numberof ICS components available on the Internet. However, this opennessinevitably makes ICS, primarily due to greater awareness of ICSprotocols, easy prey for attackers who aim at compromising andcontrolling those ICS devices. More concretely, ICS protocol isdesigned to acquire measurements/status of remote physical devicesand control them via packets carrying special commands. The looseprotection of these protocols presents ICS to the miscreants lowhanging fruits. Those severe security vulnerabilities revealed in ICSprotocols, such as Stuxnet [1], DragonFly [2], and their evolutions,have affected a wide distribution of devices. Hence, guaranteeing thecorrectness of those protocols is of imminent need.Many techniques have been proposed to ensure the security ofthose ICS protocols. Fuzzing, as an automated software testingtechnique, has emerged as one of the most effective techniques fordetecting security vulnerabilities in real-world software. Given thetarget program with parameters, fuzzers work as follows: generatingmalformed inputs (as for ICS protocol programs, the protocol packet Yu Jiang is the correspondence author.can be considered as the input), feeding them to the program andlooking for abnormal behaviors such as crashes or hangs. Twomain approaches are utilized to generate those malformed inputs:data mutation and data generation. Mutation-based fuzzers, such asAmerican Fuzzy Lop (or simply AFL) [3], generate new inputs byrandomly mutating existing inputs, while generation-based fuzzers,including Peach [4] and Sulley [5] for protocol, construct inputsby leveraging the knowledge of format specification provided byusers. Mutation-based fuzzers are popular due to their ease-of-useand fantastic vulnerability-detecting power. Nevertheless, lackingformat specification, mutation-based fuzzers can easily get boggeddown because the validity verification code is a significant timesink for them. Those applications that process highly-structuredinputs, such as protocol programs, make it a small probability ofsuccess for them to discover vulnerabilities deep in the programstate space. As opposed to mutation-based fuzzers, generation-basedfuzzers are capable of generating valid inputs by utilizing the inputmodel, which specifies the format of the data chunks and integrityconstraints. Those generated valid inputs manage to carry the pathexploration beyond the parser code so that it is more likely to discovervulnerabilities deep in the program’s processing logic.In practice, those generation-based fuzzers such as Peach haveexposed a great deal of vulnerabilities in ICS protocols. Even so, asfor fuzzing of complex ICS protocols, there remain two challengesheavily limiting their effectiveness: (i) despite awareness of inputstructure, due to lack of rational utilizable way, existing fuzzersdiscard those previously generated valuable inputs which achieve newcode coverage; and (ii) the random and pointless generation strategymakes it less likely to produce high-quality inputs that are capableof digging into deep paths of protocol state space.To tackle these problems, we present Peach* , an automatedfuzzing tool targeted for ICS protocol. The key innovation of Peach*is that, instead of speeding up input generation process to producemore inputs as some existing fuzzing approaches, it proposes anovel utilizable way to leverage those previously generated inputsso as to generate more high-quality inputs. Through investigationof diverse ICS protocols, we found that the construction rules ofdifferent types of protocol packets may have something in common:some chunks, that belong to different types of ICS protocol packets,may conform to similar/same construction rules. Moreover, thosedifferent types of packets usually exercise different program traces inthe protocol application. Based on this feature, Peach* is designedas follows: (i) Empowered by instrumentation, Peach* monitors the

program execution path taken by each generated input, and identifiesthose inputs that contribute to new code coverage. (ii) To learn fromthe success of those valuable inputs, Peach* constructs a corpus bycracking them into pieces based on the information of file format.These pieces can be used as donors to rule out some meaninglessrepetitions of path exploration. (iii) To this end, Peach* appliesa novel semantic aware generation strategy. Instead of starting fromscratch, it derives new inputs by selecting appropriate pieces from theconstructed corpus in preference to instantiation from input model.We implemented Peach* on top of Peach and evaluated itsperformance on several well-fuzzed and open-source implementationsof widely-used ICS protocols – Modbus [6], DNP3 [7] and so on.Experimental results demonstrate that, compared with the originalPeach, Peach* outperforms in terms of fuzzing speed (1.2X-25X, anaverage of 5.7X) as well as path covered (8.35%-36.84%, an averageof 27.35% increase) within a time limit of 24 hours. Furthermore,along with the coverage improvement, Peach* has already exposed9 previously unknown vulnerabilities in those well-known protocols,most of them are on the attack surface thus security-critical.II. G ENERATION -BASED F UZZINGFuzzers treat input file as a vector of input bytes thus themodifications on the seed (the test case generated by fuzzers arealso called “seed”) file mainly concentrate on bits/bytes such asbit flip and splice, etc. For better effectiveness of protocol fuzzing,generation-based fuzzers work on the file structure that is organized asa tree where individual nodes are called chunks and different chunksconform to its own format specification described in the configurationfile (e.g., Peach Pit [4] for Peach). Figure 1 shows a simple datamodel which contains four attributes: ID, Size, Data, and CRC.Specifically, Data consists of three individual chunks. The Sizefield is a variant that is computed by the Relation function sizeofand carries the size of Data field. The CRC field supports the errorcheck mechanism by the Fixup function DataFig. 1: Simple data model M used in Peach, illustrated as a tree.Those generation-based fuzzers construct seeds or packets byleveraging the above tree format. Algorithm 1 provides an overviewof the process. In the beginning, the fuzzer is provided with a formatspecification G, and the detailed data model set can be extractedfrom it (line 2, one format specification usually contains several datamodels, used for producing different types of valid inputs). Then thefuzzer works in a continuous loop unless timeout or aborted (lines 312). For each iteration, it works as follows: it first selects one datamodel M from set (line 4), and then analyzes the chunks required togenerate by traversing the format tree specified by M and collectsthe individual nodes as implemented in method A NALYZE (line 5). Ingeneral, those chunks adhere to specified data types such as String,Number, etc, and they are generated separately based on their datatypes in conjunction with given functions (e.g., Relation, Fixup inFigure 1) with params, and new seed is thus produced by jointingthem in the order declared in M (lines 7-9). The method G ENERATEimplements data generation based on pre-defined rules. For example,Peach implements generation by those Mutators that are designedfor different data types. As a general view, Mutator generates datain these ways: random generation, mutation on default value andmutation on existing chunks (those from user-provided initial seedsor previously generated seeds). New generated seed is further utilizedto run the target application and those seeds that crash or hang theprotocol program are recorded for further processing (lines 10-12).Algorithm 1: Generation-Based FuzzingInput: G: input model specified by format specificationInput: P: program under testOutput: C7 : seeds that crash or hang the program P1 C7 2 SM E XTRACT DATA M ODEL (G)// Data Model Set3 while true do4M C HOOSE(SM )5Chunks A NALYZE(M)6seed null7for Chunk Chunks do8component G ENERATE(M, Chunk)9seed J OINT(seed, component)101112Results RUN TARGET(P, seed)if C RASH(Results)or H ANG(Results) thenSC7 C7 {seed}III. M OTIVATIONDespite awareness of input structure, some research infers that, dueto the unique random generation strategy, generation-based fuzzerssuch as Peach and Defensics [8] may not perform very well oncomplex ICS protocols or reveal the bugs hidden in the deep paths [9].Since the generation of test cases is inherently random, we canconsider the generation-based fuzzing as the following model: giventhe format specification, equivalently, those fuzzers are provided withthe universal set SI of all legal seeds. In each iteration of inputgeneration, they can be regarded as choosing one seed from SIrandomly as the program input. Hence, in theory, if given enoughtime and resources, those fuzzers are able to enumerate all possiblesituations exhaustively and detect all potential bugs. However, thisideal case is usually unreachable as the set SI can be infiniteand the budgets are constrained forever. It is our hope to makeintelligent design decisions with optimal strategies wherever possible.Through investigation of diverse ICS protocols, we found that itis possible to augment existing generation-based fuzzers with someguided information for further improvement.ICS protocol is designed for a specific domain – industry control,thus it possesses some specific features compared with other commoninternet protocols. From the perspective of the field in packet, theseprotocols employ a special field to identify different packets, called“function code” field (or “opcode” field) that encodes the instructionto be performed by the devices, such as restart, write inner register,report self status and so on. More importantly, after diving into theinput model used in ICS protocols, we found that different types ofpackets would trigger different traces, but they would share similardata chunks which would trigger similar parsing code. Hence, we canreplace the traditional data model based random generation with thecoverage guided packet crack and generation to improve the fuzzingspeed and depth. We use Figure 2 to illustrate our insights in detail.

For a data model M, the organizing mode as a tree can betranslated into the linear model ML similar to Figure 2(a), wherethe individual nodes of tree take up in line with the order specifiedin M. As a consequence, Figure 2(a) shows the organization ofthree types of packets with different opcode values. Each rectanglerepresents the construction rule of the chunk as defined in M. Inlight of our investigation, we found that some chunks that belongto different types of packets may conform to similar or sameconstruction rules (chunks with the same color in Figure 2(a) meansthey conform to similar construction rules). For instance, as shownin Figure 2(a), the chunks generated by Rule α1 can also be parsedby Rule α2 smoothly in most cases, and vice versa. In particular,the rectangle with dashed outline refers to Fixup mechanism suchas Crc32Fixup shown in Figure 1. This feature is also reflectedin the Control Flow Graph (CFG) of the packet processing partin protocol program and Figure 2(b) shows the detail. Differenttypes of packets can cause different execution traces (indicated asdifferent colors), but those traces may contain some shared codeblocks used to decode corresponding chunks. The code blocks ofdifferent traces may not be shared, but they may act similarly becausethey are used to parse those chunks generated by similar rules.Taking the packets in Modbus [6] for example, those operations suchas calculating the mapping address, calculating the data to write,constructing a response message are all required for the packetsof write single register and write single coil. Theonly difference between them is the place to write, one for registerwhile another for coil.A. Peach* Overview.To illustrate the workflow and detailed design of Peach* better,we first introduce the following two definitions.Definition 1: Instantiation Tree. The InstantiationTree (or InsTree for short) of the data model M has the samestructure as the data model tree (e.g. Figure 1 shows a data modeltree). The only difference is that, the individual nodes of datamodel tree are construction rules of corresponding chunks, while thehomologous individual nodes of InsTree are instantiations of theseconstruction rules, namely realistic data chunks.Definition 2: Puzzle. One puzzle refers to a combination ofall the individual nodes of any sub-tree of the InsTree, and thesechunks are organized in order as described in the data model. Supposethat the individual nodes of the tree shown in Figure 1 are all replacedwith realistic data chunks, then those individual nodes ID, Sizeare both puzzles, and the combination of those atomic chunksCompressionCode, SampleRate and ExtraData in order isalso one puzzle.File CrackerRuleRuleTrace Feedback(1)(2)PitFormatSpecification(e.g., Peach Pit)(a) Structure of Different Packets with Different OpcodeaValuable SeedPuzzles(3)TestcaseGenerationFile FixupInstrumented ProgramDetectedVulnerabilitiesNew Seed1Peach*bRule2FixupcRule1Rule2(b) Control Flow Graph of Packet Parsing CodeacbFig. 3:fuzzer overview, including coverage based valuablepackets identification, packet cracking to get useful puzzles, andsemantic aware new packets generation with necessary fixup.FixupFig. 2: Peach* insights. Crack those packets that trigger new pathinto pieces, and construct higher quality new packets based onthese pieces to trigger more new paths in the control flow graph.Based on this feature, we argue that the specification in the datamodel can be further exploited for optimization. Since different typesof packet represent different commands and these different commandsrequire different parameters, the construction rules of these packetscan be regarded as different data models. Assuming that there are ntypes of packets (usually denoted by the legal values of the opcodefield) in some ICS protocol, their data models can be donated asM1 , M2 , ., Mn . If one seed Iv generated by Mi is valuable(usually labelled as valuable when a new path is triggered), then,based on the similarity of different chunks, the cracked chunks ofIv can be utilized to help optimize path exploration when generatinginputs using other data models Mj (1 j n, j 6 i). Based onthis, we can implement a more efficient packet generation strategy.IV. S YSTEM D ESIGNIn this section, we first introduce the workflow of Peach* . Then,we present the details of each component.Figure 3 describes the system overview of Peach* , which worksas follows: the fuzzing routine takes the same input as those traditional generation-based fuzzers, a target protocol program and packetformat specification, and then runs in a continuous loop. Initially, thepuzzle corpus is vacant, and Peach* generates new seed I in theTestcase Generator module by leveraging the format specificationalone with the inherent generation strategies of Peach, and the FileFixup module is needless at this stage. Once a new seed is generated,it is then used to run the target program for potential vulnerabilitydetection. Moreover, lightweight instrumentation is inserted into thetarget program to obtain coverage information, based on which,Peach* is able to identify I’s contribution to new code coverage.Peach* retains I if it is valuable, and then cracks I into puzzlesby the File Cracker module based on the format specification. Inthis case, the puzzle corpus becomes available, and the TestcaseGenerator module employs a new generation strategy (called “semantic aware generation strategy”) to take full advantage of thiscorpus. Meanwhile, the seeds generated by this new strategy maybe illegal, and the File Fixup module is used to repair it to ensurevalidity. In the design of Peach* , the puzzle corpus is availableby File Cracker only in the case that a valuable seed is detectedbased on the feedback collected from the target program. Thereafter,in the following iteration of seed generation, the proposed generationstrategy will be employed. Otherwise, the generation strategy to applyremains inherent. Peach* consists of three main components asshown in Figure 3: (1) collecting coverage information and detectingvaluable seed; (2) cracking valuable seed into puzzles; (3) applying

semantic aware generation with necessary file repairment. In thefollowing sections, we dive into details of the design of each part.B. Valuable Seeds IdentificationCode coverage information is a feedback which is wildly used intraditional software unit test generation [10] and has been confirmedeffective. Hence, as shown in the component (1) in Figure 3, we try toaugment the traditional generation-based fuzzers with feedback loop,and use the code coverage as the feedback to evaluate whether a seedis valuable. We use the edge coverage and obtain this informationby injecting instrumentation at branch points in the target protocolprogram as follows: cur location COMPILE TIME RANDOM ;shared mem[cur location ˆ prev location] ;prev location cur location 1; The variable cur location, with random value generatedduring compilation time, is used to specify the basic block. Theshared mem[] array is a shared memory region used to trackcoverage. (A 1) B, a kind of hash for simplification, can bethought of as an edge from basic block A to B, and the byte set at thisposition in shared mem[] r

with 8.35%-36.84% more paths within 24 hours, and has exposed 9 previously unknown vulnerabilities. Index Terms—Fuzzing, ICS Protocol, Vulnerability Detection I. INTRODUCTION Industrial Control System (ICS) refers to a system combining hardware and software with netwo

Related Documents:

Fuzzing for Software Security Testing and Quality Assurance Media whore. Overview The fuzzing setup Fuzzing PDF's, Preview and Adobe Acrobat Reader Fuzzing PPT's, OpenOffice and MS PowerPoint Fuzzing "truths" revealed. About this talk Most fuzzing talks take one of two forms

For specific safety information, read the Safety Message. For specific medical information, refer to the ICS 206. 5. Site Safety Plan Required? Approved Site Safety Plan(s) Located at: 6. Incident Action Plan (the items checked below are included in this Incident Action Plan): ICS 202 ICS 203 ICS 204 ICS 205 ICS 205A ICS 207 ICS 208 ICS 220 Map .

Jan 08, 2015 · Incident Organization Chart (ICS 207) Site Safety Plan (ICS 208) Incident Summary Status (ICS 209) Check-In List (ICS 211) General Message (ICS 213) Resource Request Message (ICS 213RR) Activity Log (ICS 214) Operational Planning Worksheet (ICS 215) Incident Action Plan Safety Analysis (ICS 215a)

Jan 08, 2015 · Incident Organization Chart (ICS 207) Site Safety Plan (ICS 208) Incident Summary Status (ICS 209) Check-In List (ICS 211) General Message (ICS 213) Resource Request Message (ICS 213RR) Activity Log (ICS 214) Operational Planning Worksheet (ICS 215) Incident Action Plan Safety Analysis (ICS 215a)

This unit will review the ICS features and concepts presented in ICS-100 through ICS-300. Unit 2 Fundamentals Review for Command and General Staff Page 2-2 ICS-400: Advanced ICS—Student Manual August 2006 Topic Unit Objectives Visual 2.2 Unit 2: Visual 2.2 Fundamentals Review for Command and General Staff Unit Objectives (1 of 2) Describe types of agency(ies) policies, guidelines, and .

1 MGT-347 ICS Forms February 5, 2019 Franklin County 2 ICS-300 Intermediate ICS February 5 – 7, 2019 Franklin County 3 ICS-300 Intermediate ICS February 6 – 8, 2019 Montgomery Co. 4 OH-230 Intro. to Emergency Management in Ohio February 11 - 14, 2019 Ohio EMA 5 ICS-400 Advanced ICS February 12 - 13, 2019 Wood County

Number Purpose ICS 201 (p.1)** Incident Briefing Map ICS 201 (p.2)** Summary of Current Actions ICS 201 (p.3)** Current Organization ICS 201 (p.4)** Resources Summary ICS 202 Incident Objectives ICS 203 Organization Assignment List ICS 204 Assignment List ICS205 Incident Radio Communications Plan

GENERAL MARKING ADVICE: Accounting Higher Solutions. The marking schemes are written to assist in determining the “minimal acceptable answer” rather than listing every possible correct and incorrect answer. The following notes are offered to support Markers in making judgements on candidates’ evidence, and apply to marking both end of unit assessments and course assessments. Page 3 .