12.07.2015 Views

The Hyperion System: CompuZng Software ... - Build Security In

The Hyperion System: CompuZng Software ... - Build Security In

The Hyperion System: CompuZng Software ... - Build Security In

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>The</strong> <strong>Hyperion</strong> <strong>System</strong>: Compu3ng So5ware Behavior with Func3on Extrac3on Technology So5ware Assurance Forum Rick Linger Cyber <strong>Security</strong> and <strong>In</strong>forma3on <strong>In</strong>telligence Research Group Oak Ridge Na3onal Laboratory 202-­‐701-­‐6257, lingerr@ornl.gov


Two Observa3ons So#ware with unknown behavior has unknown security Computer programs are mathema8cal ar8facts, subject to mathema8cal analysis


Example: A Loop Behavior Computa3on <strong>In</strong>put codeStructured codeComputed behavior expressedas a Conditional ConcurrentAssignment (CCA)


<strong>The</strong> Behavior Computa3on Process <strong>In</strong>put: malware binary code Transform instruc3ons to seman3c form Transform code to structured form <strong>In</strong>struc3on seman3cs repository Defines func3onal effect of instruc3ons Behavior expressed as Condi3onal Current Assignments (CCAs) Output: malware behavior and analysis Compute code behavior Analyze behavior func3onality Behavior abstracted to Behavior Specifica3on Units (BSUs) Behavior Specifica3on Unit (BSU) repository Defines precise behavior abstrac3ons


Computing Behavior of a Virusin Various Forms


OW28b Virus Code11


Virus Behavior – Four CasesFourth case: virus writesitself (39 bytes)into the existing file,overwriting your dataThis is a self-replicating virusthat destroys your data12


Virus Obfuscated by an <strong>In</strong>truder ToolMassive amount ofspaghetti logichas been introduced13


14Obfuscated Virus – Same BehaviorSpaghetti logic transformed tostructured form(jumps are comments)Same behavior iscalculated despitethe obfuscationFourth case: the virus opensand writes to an existing file,overwriting your data(length of virus is different)FX blocks control obfuscation asa weapon for intruders


15Computed Behavior of 10K-line ProgramTwo cases ofbehaviorWhat happens when the OW28b virusis hidden in this program?• No two lines adjacent.• Triggered by an obscure condition.


16Behavior of Program with OW28b VirusOne of the twooriginal casesFive casesof behaviorCases 1,2, 4, and 5show the ow_28bvirus behaviorFX blocks obfuscation throughhiding as a weapon for intruders


Computing Behavior of anEmbedded <strong>Software</strong> Component


Behavior Computation for Robot Arm• Matrix operations key to robot spatial maneuvering• Behavior computations carried out for assembly code thatcomputes A X B à C:1. Various matrix sizesNo errors, obfuscations, or malware inserted2. Programming errors/insider corrupted functionalityErrors/changes inserted3. <strong>In</strong>truder attacksObfuscation, interleaving, malware inserted


Behavior Specification Units (BSUs)• BSUs operate on computed behavior:Pre-defined units of specificationVery general (many implementations, one behavior)Define once, reuse forever• Serve asFunctional specifications: Malware componentsSemantic signatures: Malicious behaviorBehavior structures: Human understanding


BSUs for Matrix OperationsBSU definitions:• Vector memory shape BSUstart, number of elements, stride• Dot product BSUrow and column vectors, element products andsummations• Matrix memory shape BSUstart, number of vector rows, number of vectorcolumns• Matrix multiplication BSUmatrix of dot products


Behavior computation for A x B à C:4x4 and 4x4 matrices with no errors, obfuscations, or malicious contentC matrix is initialized before matrix calculations are performedCONDITIONTRUE àREGISTERSEAX := DOT_PRODUCT ofVECTOR(4) at (12 + (dword at (8 + ESP))) by stride 16andVECTOR(4) at (48 + (dword at (4 + ESP))) by stride 4ECX := DOT_PRODUCT ofVECTOR(3) at (12 + (dword at (8 + ESP))) by stride 16andVECTOR(3) at (48 + (dword at (4 + ESP))) by stride 4EDX := dword at (60 + (dword at (4 + ESP)))EIP := dword at ESPESP := 4 + ESPMEMORYM :=MATRIX of dwords at (dword at (12 + ESP) :=MATRIX_MULTIPLICATION ofMATRIX(4,4) of dwords at (dword at (4 + ESP))andMATRIX(4,4) of dwords at (dword at (8 + ESP)))label := "exit”FLAGSAF := falseCF := arb_bool_valOF := arb_bool_valPF := is_even_parity_lowbyte(48 + (dword at (8 + ESP)))SF := is_neg_signed_32(48 + (dword at (8 + ESP)))ZF := (4294967248 == (dword at (8 + ESP)))


Behavior computation for A x B à C:4x4 and 4x4 matrices with programming error (or corrupted function)C matrix is not initialized. Behavior computation stops at dot products of vectorsbecause matrix multiplication BSU is not satisfied. Each C matrix element is thesum of the uninitialized value plus the dot product operation for that element.CONDITIONMEMORYTRUE àREGISTERSEAX := (dword at (60 + (dword at (12 + ESP))) +DOT_PRODUCT ofVECTOR(4) at (12 + (dword at (8 + ESP))) by stride 16andVECTOR(4) at (48 + (dword at (4 + ESP))) by stride 4ECX := (dword at (60 + (dword at (12 + ESP))) +DOT_PRODUCT ofVECTOR(3) at (12 + (dword at (8 + ESP))) by stride 16andVECTOR(3) at (48 + (dword at (4 + ESP))) by stride 4EDX := dword at (60 + (dword at (4 + ESP)))EIP := dword at ESPESP := 4 + ESP(Flags not shown)M :=dword at (dword at (12 + ESP)) :=dword at (dword at (12 + ESP)) +DOT_PRODUCT ofVECTOR(4) at (dword at (4 + ESP)) by stride 4andVECTOR(4) at (dword at (8 + ESP)) by stride 16dword at (4 + (dword at (12 + ESP)) :=dword at (4 + (dword at (12 + ESP))) +DOT_PRODUCT ofVECTOR(4) at (dword at (4 + ESP)) by stride 4andVECTOR(4) at (4 + (dword at (8 + ESP))) by stride 16dword at (8 + (dword at (12 + ESP)) :=dword at (8 + (dword at (12 + ESP))) +DOT_PRODUCT ofVECTOR(4) at (dword at (4 + ESP)) by stride 4andVECTOR(4) at (8 + (dword at (8 + ESP))) by stride 16…


Behavior computation for A x B à C:4x4 and 4x4 matrices with obfuscation, interleaving, embedded malwareCONDITION 1MEMORYcreate_file_succeeded(file_name_addr = 158,file_attribute = (word at (40 + (dword at (4 + ESP)))))andwrite_file_succeeded(file_handle = get_new_file_handle(file_name_addr = 158,file_attribute = (word at (40 + (dword at (4 + ESP))))),buffer_to_write = 0,num_bytes_to_write=6738)FILE SYSTEMFILES :=create_file_and_truncate(file_name_addr = 158,file_attribute = (word at (40 + (dword at (4 + ESP)))))thenwrite_file(file_handle = get_new_file_handle(file_name_add r= 158,file_attribute = (word at (40 + (dword at (4 + ESP))))),buffer_to_write = 0,num_bytes_to_write = 6738)M :=MATRIX of dwords at 100 :=MATRIX_MULTIPLICATION of(MATRIX(3,4) of dwords at (dword at (4 + ESP)))and(MATRIX(4,4) of dwords at (dword at (8 + ESP)))MATRIX of dwords at (dword at (12 + ESP)) :=MATRIX_MULTIPLICATION of(MATRIX(4,4) of dwords at (dword at (4 + ESP)))and(MATRIX(4,4) of dwords at (dword at (8 + ESP)))OPERATING SYSTEMDOS :=mark_file_handle_as_writing(file_handle = get_new_file_handle(file_name_addr=158,file_attribute = (word at (40 + (dword at (4 + ESP))))),buffer_to_write=0,num_bytes_to_write=6738)(Flags not shown)


Behavior computation for A x B à C:4x4 and 4x4 matrices with obfuscation, interleaving, embedded malwareCONDITION 2CONDITION 4create_file_succeeded(file_name_addr = 158,file_attribute = (word at (40 + (dword at (4 + ESP)))))andwrite_file_failed(file_handle = get_new_file_handle(file_name_addr = 158,file_attribute = (word at (40 + (dword at (4 + ESP))))),buffer_to_write = 0,num_bytes_to_write=6738)CONDITION 3create_file_failed(file_name_addr = 158,file_attribute = (word at (40 + (dword at (4 + ESP)))))andwrite_file_succeeded (file_handle = get_new_file_handle(file_name_addr = 158,file_attribute = (word at (40 + (dword at (4 + ESP))))),buffer_to_write = 0,num_bytes_to_write=6738)create_file_failed(file_name_addr = 158,file_attribute = (word at (40 + (dword at (4 + ESP)))))andwrite_file_failed(file_handle = get_new_file_handle(file_name_addr = 158,file_attribute = (word at (40 + (dword at (4 + ESP))))),buffer_to_write = 0,num_bytes_to_write=6738)(<strong>In</strong> each case, a successful matrix multiplicationis carried out, with side effects on the file systemand operating system, but no malware replication.)


Project Status • Next-­‐genera8on <strong>Hyperion</strong> system under development – More powerful seman8cs language – More powerful rewriter – Parallel computa8on • Many applica8ons – Malware detec8on and analysis – Vulnerability detec8on – Rigorous so#ware development – Correctness verifica8on – Supply chain analysis – An8-­‐tamper analysis – Hardware analysis – …


Long-­‐Term Vision Computed behavior available for all common so#ware Behavior computa8on available for one-­‐off so#ware

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!