Global Information Assurance Certification Paper Copyright SANS Institute Author Retains Full Rights This paper is taken from the GIAC directory of certified professionals. Reposting is not permited without express written permission. Interested in learning more? Check out the list of upcoming events offering "Hacker Tools, Techniques, and Incident Handling (Security 504)" at http://www.giac.org/registration/gcih . hts DETECTING HYDAN rig STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN l ful BASED STEGONOGRAPHY IN EXECUTABLE FILES ins eta GIAC Certified Incident Handler (GCIH) Gold rr tho , Au Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 Author: Craig S. Wright, CraigSWright@acm.org 20 Adviser: Carlos Frederico Cid te titu Accepted: 22 June 2008 Ins NS SA © - 1- © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES . hts Index i. Abstract ...................................................................................................... 3 rig Executive Summary........................................................................................... 4 What is Steganography?............................................................................... 5 HYDAN ....................................................................................................................... 6 l ful How HYDAN Functions .................................................................................. 6 The Embedding Function....................................................................... 8 The Decode Function ............................................................................ 11 ins Encrypting and Decrypting the Message................................. 11 Instructions for using HYDAN ...................................................... 12 eta Attacking HYDAN ......................................................................................... 13 Overwriting ............................................................................................... 13 Detection.................................................................................................... 14 rr Decryption ................................................................................................. 15 What is HYDAN and how is it used? .............................................. 17 tho Installing HYDAN ................................................................................... 17 Running HYDAN .......................................................................................... 17 HYDAN Detection ............................................................................................. 22 Au Method 1 - Checksums ............................................................................. 22 Method 2 – Statistics ........................................................................... 22 .............................. 23 , R (a2F94 Key fingerprint = AF19 FA27 Statistical 998D FDB5 DE3D Programming F8B5 06E4 A169 Language) 4E46 08 Reading in the data ................................................................................ 24 Disassembling the binary ................................................................ 26 20 Detecting HYDAN ......................................................................................... 27 The Distribution ................................................................................... 29 Finding Where the Data Encoding Starts .............................. 32 te What this means for HYDAN (or Future Lessons) ................. 34 Plausible Deniability ....................................................................... 36 titu Conclusion and Future Research ......................................................... 37 Bibliography..................................................................................................... 38 Ins Websites .......................................................................................................... 40 Statistical References......................................................................... 40 NS SA © Craig Wright - 2 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES i. Abstract . It is known that HYDAN changes the statistical distribution hts of Sub and Add calls in the assembly code to embed the "hidden rig data". Before this paper, there were no publicly released tools or methods available to detect HYDAN. The methods l previously used to detect HYDAN have been inefficient and ful involved extensive manual processes that could not be easily automated. This paper presents a method to take the assembly ins code (using a disassembler) and to feed this into R, a eta statistical language, in order to detect if the file has been altered steganographically. rr The method uses a set of statistical tests to determine tho both the use of HYDAN and the extent of use in a file. , Au Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 20 te titu Ins NS SA © Craig Wright - 3 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES Executive Summary . Steganography is the art and science of hiding text hts messages in other data (Provos, 2003). This is commonly rig graphics files, audio files and video files. HYDAN is a steganographic tool that is designed to hide data inside of a l binary executable file. ful Steganography when used with multimedia based files can ins impair the quality of the output or display. This is usually managed such that the degradation remains unnoticed to the eta casual viewer/listener. Computers can display many more colors than the human visual system can process and hence a reduced rr color map in an image may be unnoticeable to simple visual or tho audit analysis. Changing data within an executable code segment is more problematic. The alteration of a single byte Au of binary code can result in an irreparable corruption of the code destroying the functionality of the code segment. , Key fingerprint = AF19 HYDANFA27is 2F94 a 998D FDB5of method DE3D F8B5 06E4 A169 4E46 encapsulating data 08 steganographically within an executable code segment without 20 either altering the function of the code or varying the file size of the executable. te This paper presents a method that can be used to detect titu HYDAN based steganography. This is simply an initial means and should be improved if it is to be used in any serious Ins endeavor. To do this, the code could be compiled into a single program1 that incorporates the disassembly and comparison in a NS SA 1 A means of compiling R code into a standalone executable is presented in “Compiling R: A Preliminary Report” by Luke Tierney (2001). The paper is available from: © http://www.ci.tuwien.ac.at/Conferences/DSC-2001/Proceedings/Tierney.pdf An R compiler called RCC that takes the R interpreted code and compiles it in C++/R format is available from: http://hipersoft.cs.rice.edu/rcc/index.html Craig Wright - 4 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES single binary. This would then return a value for those . segments that have embedded data. hts What is Steganography? rig Provos and Honeyman (2003) define steganography (aka stego) as “the art and science of hiding communication; a l ful steganographic system thus embeds hidden content in unremarkable cover media so as not to arouse an eavesdropper’s ins suspicion”. The majority of modern steganographic systems begin with eta discovering the redundant bits within the host media or data. The goal is to be able to modify the host data in a manner rr that does not obliterate the integrity of the source data. tho Another objective of steganography is to not be detected in the host file. It is in effect, a means of hiding data within Au other data. Although contemporary steganography through the use of , Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 computers is a relatively recent field, both Richmond (1998) as well as Johnson & Jajodia (1998) make mention of an ancient 20 example. In their paper they note the example of an early steganographic system. Richmond notes the practices of the te ancient Athenians where the head of a messenger was shaved and titu subsequently tattooed with a message that would be covered with hair rendering it unseen if the messenger was captured. Ins Johnson & Jajodia mention how this same system was adopted by a Roman general who shaved a slave’s head and tattooed a NS message on it sending the messenger on the errant after the hair grew back. SA The majority of steganographic methods (Provos, 2001) that have been developed in modern times have been centered on © hiding a message within images and audio files (such as BMP, GIF, JPEG, WAV and MP3 file formats). A number of other methods include hiding messages within Word documents or even within embedded macros and Metadata (Provos & Honeyman, 2003). Craig Wright - 5 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES The secret to effective steganography is that it needs to . be difficult to detect (McGill, 2005). hts HYDAN rig Rakan El-Khalil designed a novel steganographic technique called HYDAN. The name selected, HYDAN [hI-dn] is erudite and l ful holds a message in itself. The word actually means to hide or conceal. First developed in 2003, HYDAN hides data or messages ins in Binary Executables. The main website for HYDAN eta (http://www.crazyboy.com/HYDAN/) offers a number of uses for HYDAN: rr • Covert Communication: embedding data into binaries tho creates a covert channel that can be used to exchange secret messages. Au • Signing: a program's cryptographic signature can be , embedded Key fingerprint = AF19 FA27 2F94 998Dinto itself. FDB5 DE3D TheA169 F8B5 06E4 recipient 4E46 of the binary 08 can then verify that it has not been tampered with 20 (virus or trojan), and is really from who it claims to be from. This check can be built into the OS for te user transparency. titu • Watermarking: a watermark can be embedded to uniquely identify binaries for copyright purposes, Ins or as part of a DRM scheme. Note: this usage is not recommended as HYDAN implements fragile watermarks. NS How HYDAN Functions HYDAN steganographically secretes a message into SA an executable. It is a method of encapsulating data steganographically within an executable code segment without © either altering the function of the code or varying the file size of the executable. HYDAN is designed to make use of a number of redundancies that exist within X86 binary instruction code or assembly language. The X86 assembly Craig Wright - 6 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES language set has instances where two instructions are . fundamentally the same. In addition, certain combinations of hts this code are rarely if ever used. HYDAN uses this anomaly to replace a standard format used commonly in code with an rig unusual code combination (i.e. replacing an “ADD 1” function with a “SUB -1”). l ful ins eta rr tho , Au Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 20 te titu Ins These code anomalies are not extremely common. As such, NS HYDAN is limited to being able to embed only one byte of a hidden message for approximately each 110 bytes of executable SA code. This is far less efficient than other steganographic applications. Many of these can hide as much as one byte within 17 bytes of a .jpeg file. This gives HYDAN a far lower © rate of embedding than other methods, but this does not remove its functionality. Craig Wright - 7 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES HYDAN is open source and includes the capability to . encrypt the messages with the blowfish algorithm. To do this a hts passphrase needs to be included. This makes it difficult to determine what the message stored within the executable is, rig but a method to attempt to brute force it could be developed from the detection method presented in this paper. l ful Steganography, and in particular HYDAN can also be used ins to embed an executable file with a watermark or a digital signature. This allows the file to be marked and possibly eta tracked. The Embedding Function rr HYDAN processes the byte code of an executable tho application sequentially. In this process it is searching for instructions with functional equivalents (as noted above). Au Each time that such an instruction is found, it is replaced (substituted) with the alternate (and equivalent) instruction , that= AF19 Key fingerprint corresponds to FDB5 FA27 2F94 998D the DE3D dataF8B5 being 06E4 embedded A169 4E46 by HYDAN. This 08 process is repeated bit by bit for the data. 20 For instance, the table below documents the changes made to embed the binary 1001101: te titu Original code HYDAN Embedded Message 1 ADD %eax, 10 SUB %eax, -10 Ins 0 ADD %eax, 25 ADD %eax, 25 NS 0 ADD %eax, 09 ADD %eax, 09 1 ADD %eax, 20 SUB %eax, -20 SA 1 ADD %eax, 50 SUB %eax, -50 © 0 ADD %eax, 50 ADD %eax, 50 1 ADD %eax, 35 SUB %eax, -35 Craig Wright - 8 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES The substitution set is: {"ADD %reg, $imm", "SUB %reg, . $imm"}. hts Each time an instruction is passed by HYDAN that has the rig form "ADD %register, $imm" a single bit of hidden message can be encoded. Where the bit value in the message equals “0”; the l ful code is unchanged. Where the bit value in the message equals “1”, HYDAN substitutes the assembly “ADD” function with a ins “SUB” function of the form: "SUB % register, -$imm". To do this, it simply subtracts the negative of the value that eta originally was to be added. For a detailed explanation of Assembly coding, see Hyde rr (2004); Irvine (2007); Duntemann (2000). For a specific focus tho on reversing see Eilam (2005). Other equivalent instructions do exist. HYDAN does not Au make use of these; however, a variant on the theme could be created using these additional functions. El-Khalil and , Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 Keromytis (2003) provide a detailed list of equivalent functions in the appendix to their paper for Open BSD(see 20 figure below). te titu Ins NS SA © Craig Wright - 9 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES The inclusion of a greater number of equivalent functions . would make a greater subset of data to test. This would make hts detection more difficult due to a great cost in computer cycles. HYDAN does not use these other functions. rig Prior to embedding the encrypted message and header HYDAN l ful follows a random walk that skips a random number of useable byte code instructions. This is designed to amplify the amount ins of exertion required by a detection procedure in the hope that it will make it infeasible. The random walk is seeded using eta the user-supplied passphrase. The random walk is seeded by the user-supplied passphrase rr to increase the detection workload. Supposedly the method tho proposed by Neils Provos (Provos, 2001) is utilized. This technique requires that the embedded data is distributed Au homogeneously throughout the original file (the cover-text). In HYDAN (El-Khalil & Keromytis, 2003), the number of bits , skipped Key fingerprint = AF19 is FA27stated toFDB5 2F94 998D lieDE3D in F8B5 a distribution 06E4 A169 4E46 of range [0, 08 ]. This is defined with the value being the number of 20 bits remaining in the original file, and being defined as te the remaining length of the message to be encoded. It is titu stated that the aforementioned interval is recalculated for every 8 bits of message that are embedded by HYDAN. Ins In the version of HYDAN tested (0.11) the initial embedding of the data jumped a number of instructions on the NS Windows XP host and did not follow the prior stated distribution. This is displayed in the section of the paper SA “Finding Where the Data Encoding Starts”. Version 0.13 of HYDAN was compiled on Linux and the © random jump was not tested for this version as it is not essential for the detection the HYDAN to do this test. Even if the random walk function did correctly, it would not change Craig Wright - 10 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES the results of the test as these are based on an analysis of . the entire code set and not an extraction. hts The Decode Function rig To reverse the function and extract a hidden message with HYDAN, the embedded data in the byte code is read. When either l ful an “ADD” function or “SUB” function is read, the message is reconstructed bit by bit as follows: ins ADD % register, $imm Is read as a binary digit 0. SUB % register, -$imm Is read as a binary digit 1. eta When the message entire byte code has been read, the rr message length has been extracted. If the message was tho encrypted first, it may now pass to be decrypted using the passphrase that was originally used to encrypt the message. To Au extract the hidden message, HYDAN employs the user-supplied passphrase to again seed the random-walk algorithm. With this, it first extracts the length of the embedded data. , Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 When the message has been extracted to the required 20 length, the remaining binary stream is decrypted. Encrypting and Decrypting the Message te HYDAN requests that a passphrase is entered to both titu encrypt and decrypt the message it is to embed or decode within an executable. Ins The process to create an encrypted message with HYDAN occurs using the following process: NS 1. HYDAN calculates the length of the message to be encoded. SA 2. HYDAN appends the message length as a header at the © start of the message to be encoded. 3. The message and length header are encrypted using the CBC mode of the Blowfish algorithm. The message Craig Wright - 11 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES length is encrypted with the data. The passphrase . supplied from the user is used to secure the hts encrypted message and acts as a key. rig 4. The data is embedded into the application using the embedding method listed previously. l ful The process to decrypt the message works in the following manner: ins 1. The decode function (as defined above) is run to extract all of the bits that could be a part of a eta message from the data. rr 2. As the message length is unknown prior to the data tho being extracted, the entire stream needs to be processed. Au 3. The message is decrypted using the key that was supplied to encrypt the message. As the Blowfish , algorithm Key fingerprint = AF19 FA27 is run 2F94 998D FDB5 DE3Din CBC F8B5 06E4mode (a stream cipher mode), A169 4E46 08 it does not need to know the total length of the 20 message and header before starting to decrypt it. 4. When the header is decrypted, HYDAN can then use te this information to truncate the message size and titu only return the original message. The process used by HYDAN is not really efficient. It Ins does make the guessing of the message body more difficult. Instructions for using HYDAN NS The file, “hdn_insns.c” that was distributed in earlier versions of HYDAN has a complete list of instructions. The SA operation will be covered in detail later in the paper, but the main functions are embedding or decoding a hidden message. © The commands to do this are: Embedding the hidden message Craig Wright - 12 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES To hide the message, with the file “/bin/ls” . where the output file is “ls.steg.HYDAN” in the local drive, hts the following command is issued: rig ./HYDAN /bin/ls ls.steg.HYDAN Decoding the hidden message l ful To reveal the message that was hidden within the file “ls.steg.HYDAN” which will display to STD_OUT (usually the ins screen), the following command is issued: ./HYDAN-decode ls.steg.HYDAN eta Attacking HYDAN rr The process used by HYDAN can be attacked and broken. The tho ease to which the steganographic function can be subverted limits HYDAN’s effectiveness as a watermarking tool. There are Au a number of primary attack vectors that render HYDAN ineffective that range from overwriting the data (such as using HYDAN again with an alternate message) to detecting its , Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 use. It is not necessary to detect that HYDAN has been used on a file to render it ineffective using the overwrite method. 20 The detection of HYDAN is discussed below. Once the use te of HYDAN has been detected, the message could be extracted. A titu brute force attack could be run against the data that has been extracted, but this is unlikely to prove effective. For HYDAN Ins to be truly effective as a steganographic tool, an analyst should not be able to detect if a message has been incorporated into an executable (let alone be able to decrypt NS it). The method discussed later in the paper limits the effectiveness of HYDAN for steganographic purposes. SA Overwriting HYDAN has no defense against overwriting other than © volume. Until now there has been no simple method to detect if HYDAN has been used and overwriting all executables on a system is problematic to say the least. Craig Wright - 13 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES By simply running HYDAN over an executable with another . message, the original message will be irretrievably lost. The hts intended recipient would than not be able to retrieve the message (assuming that this was the only version of the rig executable and message). l ful It has been noted (Slashdot, 2004) that the addition of an error correcting code to the encoding of the message ins coupled with an addition of an algorithm that distributes the message in a seemingly random manner throughout the binary eta based on the specific passphrase could correct this flaw. More effectively would be to also reduce the amount of the message rr and insert it multiple times. tho Parts of the original message could be overwritten while still enabling the original message to be reconstructed. This Au of course also has flaws. By ensuring that the length of a new message is greater than the encoding fraction will allow, the , message Key fingerprint = AF19 can FA27 be 2F94still be DE3D 998D FDB5 overwritten rendering F8B5 06E4 A169 4E46 this new method 08 ineffective as well. 20 As noted above, the sheer volume of binary files that exist makes this problematic. To be effective, this method te also needs to be used when a steganographic message is titu detected and not on all files. Again, detection becomes the critical component. Ins Detection The main focus of this paper is on detecting the presence NS of HYDAN. The goal of HYDAN (like all steganographic tools) was to not exhibit any obvious patterns that could be easily SA detected. Additionally, the header (length) information is encrypted and embedded in a manner that does not produce an © easily recognizable marker or token. Encrypting the data helps to make the distribution of the data more random. Craig Wright - 14 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES HYDAN fails at the assembly code level. HYDAN is . vulnerable to the simple statistical analysis techniques hts presented later in this paper, as it does not imitate the distribution of instructions normally found in a binary rig executable. The instructions that HYDAN replaces are functionally equivalent, but they form a pattern that seldom l ful occurs naturally in assembly code. ins Both global statistical distributions from the patterns of assembly code across programs as a whole as well as local eta statistical distributions as they occur in hosts or even individual software packages need to have a level of rr conformity after the application of HYDAN if it is to be successful. tho When modifying byte code instructions it is necessary to Au create a method that embeds data consistently across procedures. HYDAN has not achieved this. Hence the statistical , methods Key fingerprint = AF19 presented below FA27 2F94 998D manage FDB5 DE3D F8B5 to 06E4detect even the smallest A169 4E46 08 HYDAN derived steganography. 20 Decryption HYDAN embeds the data using a method that is not te efficient, but that makes the retrieval of the data difficult. titu HYDAN accomplishes this through the use of the Blowfish algorithm in CBC mode. The data (which consists of the message Ins length plus the message) is encrypted using a user-specified passphrase that acts as the key. HYDAN encrypts the entirety NS of the information including the message length. This could make decryption far more difficult, except SA that it is possible to guess the message length. HYDAN inserts the message sequentially into the executable beginning from a © random position at an arbitrary function within the executable and works to the end of the message. Craig Wright - 15 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES HYDAN uses the Blowfish algorithm in a stream-cipher mode . to encrypt and decrypt data using the passphrase supplied by hts the user as the key. If no passphrase is supplied, a null key is used to encrypt and hence decrypt the data. rig HYDAN uses the Blowfish block cipher in cipher-block- l ful chaining (CBC) mode. In CBC mode (Goldreich, 2004, Pp 404-408) the existing plaintext block is combined with the preceding ins cipher-text block using the XOR function previous to running the encryption function. eta This allows the use of a block cipher (which is designed to operate on small fixed-size blocks of plaintext or rr ciphertext that are generally in the order of 64 or 128 bits tho in length) to encrypt longer messages (Goldreich, Pp 408-416, 2004). Au The functions used by HYDAN to encrypt and decrypt data are included in the following table: , Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 Encryption Decryption 20 Ci = EK(Pi Ci-1) Pi = DK(Ci) Ci-1 te Here, the elements of the equation are (Goldreich, Pp titu 404-418, 2004): Ins • Ci Ci is the ciphertext block at position “i” (from C1,..., Cn) that is obtained after applying the block- cipher to each block of the plaintext. NS • Ci-1 Ci-1 is the ciphertext block at position “i-1”. SA • EK EK is the function that takes block B of size b as an input and returns the encrypted block (which will also © happen to be of size b). • Pi The plaintext is partitioned into n blocks P1,..., Pn of size b. Pi is the ith block. Craig Wright - 16 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES • DK is the function that describes the decryption . operation. It is in effect the reverse of EK. hts Mathematically, a block-cipher can be seen as pair of two rig functions EK and DK that depend on a key K (). A detailed process to capture the encrypted header length l ful and use this as both a means to Brute force the data and also to simply determine the message length will be expounded in a ins follow-up paper to this one. What is HYDAN and how is it used? eta The following section acts as a tutorial on how HYDAN is rr installed and used. Installing HYDAN tho The source code for HYDAN may be downloaded from: Au http://www.crazyboy.com/HYDAN. To install HYDAN on Linux/Unix, simply extract the source , Key fingerprint code= AF19 and FA27 then2F94 998D FDB5 compile DE3D it. F8B5 The 06E4 A169 4E46 following example demonstrates 08 this process: 20 $ cd /usr/local/bin te $ tar -xvfz HYDAN-0.13.tar.gz titu $ cd /usr/local/bin/HYDAN $ make Ins The system will compile and install the HYDAN binary. The process is more complex on Windows and will require a NS different methodology based on the compiler used. SA I have used Turbo C++ Explorer to compile HYDAN in Windows. This can be downloaded free from: http://cc.codegear.com/free/turbo. © Running HYDAN Once HYDAN is installed, running it is simple. The command is: Craig Wright - 17 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES /usr/local/bin/HYDAN/HYDAN /path/binary /path/message_to_add . > /path/updated_binary hts In this instance, HYDAN has been installed in the rig directory, /usr/local/bin/HYDAN. The file, /path/binary is the binary to be encoded. The message is contained in l ful message_to_add. The output binary with the encoded message is now /path/updated_binary. The program will prompt the user for ins a password and then proceed to encode the message. The newly created binary will not have the same eta permissions and the new binary with the encoded message needs to have the execute permission set. rr chmod u+x /path/updated_binary tho The timestamp of the file will have changed. With Au sufficient privileges, a skilled UNIX or Windows used can change the timestamp to match that of the former file. , Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 20 te titu Ins Comparing the newly created binary NS The new binary will perform precisely as the previous command without the encoding. It will fail to meet an SA integrity check if a hashing program (such as AIDES or Tripwire) has been used. For some selected binaries on © platforms such as Redhat Linux, the hash is saved for use with the pkgadd command. This will also detect the change. Craig Wright - 18 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES . hts rig l ful ins The file has not changed in size. eta rr tho , Au Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 20 Overwriting the old binary with the new In many cases it will be necessary to have root te privileges to be able to overwrite the old binary. In the titu case above, the shell was already running as root, but this may not be the situation for an attacker or user in general. Ins In the example given in the previous section, the following commands also need to be used to move the binary NS into its original directory and to set the permissions to match that of the original. SA mv ./umount.steg /bin/umount chown root:root /bin/umount © chmod 755 /bin/umount Craig Wright - 19 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES The timestamp of the resultant binary will not be the . same as the original. In UNIX/Linux, the touch command can be hts used to change the timestamp of the newly created binary so that it matches that of the former binary without encoding. rig The command: ls –al /path/binary can be used l ful to obtain the timestamp of the original binary before encoding. ins eta rr tho , Au Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 20 te titu The command, touch, can then be used to update the Ins timestamp so that it matches the original binary as closely as possible. NS Decoding the message As long as you know which file the message is in and have SA the password, decoding it is simple. The command below and the image demonstrate this process. © /usr/local/bin/HYDAN/HYDAN-decode /path/binary_with_message Craig Wright - 20 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES HYDAN will prompt for the password that was used to . encode the message. hts rig l ful ins eta rr tho Au The hidden message may also be extracted to a file rather than being sent to STD-OUT (as stated – usually the screen). , Key fingerprint This= AF19 FA27 2F94 998D FDB5 in DE3D the F8B5 06E4below: A169 4E46 08 is demonstrated image 20 te titu Ins NS SA © The hidden message when recovered is identical to the original. Craig Wright - 21 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES HYDAN Detection . There are a few means to discovering HYDAN. The simplest hts involves having either the original file or a checksum of the rig file. The issue comes in discovering steganographic information in files that have not been imaged or otherwise l where the investigator has no recourse to checking the ful original file. ins Method 1 - Checksums The checksum of the original binary does not match with eta the resultant HYDAN produced binary. This allows the investigator to determine that the file has been altered, but rr not that it was altered using HYDAN. As such this provides no tho evidence that HYDAN has been used on the file. An attempt can be made to attempt to extract text from Au these altered files using HYDAN and a guessed pass phrase. It is unlikely that this method would result in the detection of , Key fingerprint HYDAN.= AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 Method 2 – Statistics 20 The primary focus of this research was to create a method to detect steganographically encoded messages that have been te created using HYDAN. This was achieved using existing titu disassembly tools and the powerful “R” statistical language. R has the functionality to call external programs. Using Ins this capability, R can call an external disassembler, capture the byte code instructions (the de-compiled assembly language NS of the executable) that the disassembler outputs and feed these values into an array. SA This information is then sorted to select a subset that contains only the instructions of interest. In the case of © HYDAN, these are limited to: ADD % register, $imm and Craig Wright - 22 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES SUB % register, -$imm . hts Each ADD command is recorded into a separate variable as a value “0” and the SUB command where the value being rig subtracted is negative is encoded in the variable as a “1”. Any SUB commands that have a positive value that is to be l ful subtracted are discarded. A baseline of the local and global distributions was ins estimated. To do this, a random selection of 500 binary executable files was selected using the rnorm() random normal eta function from R and a list of files from the systems tested was saved into an array. rr The following systems where tested: tho • Windows XP SP2 Au • Linux. The details of the resulting distributions are included , Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 in the following sections. A random selection of 10 files was encoded on both 20 systems under test. These files were encoded using HYDAN to embed a message into each of the binary files. The processes te listed above where used to embed the message and to extract titu it. Each message was successfully extracted from the steganographically encoded file. Ins The distribution of byte code instructions in the HYDAN encoded files was compared to both the local (the system it NS was created on) and global (the concatenation of both systems) distributions. The results of this experiment are included SA below with the R function that was used and a number of statistical visualizations. © R (a Statistical Programming Language) The analysis of the data was conducted using the R statistical language. The functions have been left in an Craig Wright - 23 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES interpretive mode for this paper, but there are compilers that . support the R language. In addition, RServe is a precompiled hts engine that can be used to run the interpreted language as a batch script. It is available from rig http://www.rforge.net/Rserve/faq.html. l ful What is R and where do I get it? As is noted on the primary website (http://www.r- ins project.org/), “R is a free software environment for statistical computing and graphics. It compiles and runs on a eta wide variety of UNIX platforms, Windows and MacOS”. R is available from of the many mirrors listed at rr http://cran.r-project.org/mirrors.html. It may be downloaded tho and installed freely. A number of graphical front-ends (such as Rattle from http://rattle.togaware.com/) exist to simplify Au the process of using and deploying R. Reading in the data , Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 R has the capability to make remote system calls. This can be used to call other programs from within R. An example 20 would be using R system calls to open a URL with Mozilla: system(paste('"c:/Program Files/Mozilla Firefox/firefox.exe"', te '-url www.sans.org/rr), wait = FALSE) titu In this case, the command to be run should be loaded as a batch file in Windows or a Shell script in Unix. The windows Ins script below is designed for a single file. "c:\data\dis.exe c:\windows\system32\cacls.exe > NS c:\data\calcs.asm” SA Using variable input this can be increased to test multiple files or to take the output of a file listing as the © input feed. The command lists the disassembled program code. The output format seems difficult to understand and interpret, but the secret lies in understanding that only a limited set of data from this output is needed for the statistical tests. Craig Wright - 24 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES All that is needed is a small component of the code. . hts ADD % register, $imm becomes ADD,$imm SUB % register, -$imm becomes SUB, -$imm rig In fact, all that is finally needed is the “-“ sign. l Actually, a simple command such as the one below can be used ful to read the data into R. This results in a lower detection rate as non-tested commands are also loaded: ins Test.HYDAN <- read.csv("c:/data/calcs.asm", header=FALSE) eta The loss of information is minimal as the function is actually simple to detect (as will be demonstrated below). The rr better option would be to use a call to Perl to run a REGEX tho call (regular expressions). , Au Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 20 te titu Ins NS SA © Example of the disassembled output from cacls.exe Craig Wright - 25 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES This reduces the output in the data file to be tested and . adds a table such as the one below: hts > Test.HYDAN <- read.csv("c:/data/example.csv", header=FALSE) rig > Test.HYDAN l V1 V2 ful 1 sub 10 2 add eax ins 3 add eax eta 4 sub 10 5 add eax rr 6 add 8 7 sub 14 tho 8 add esi … Au Disassembling the binary , The FA27 Key fingerprint = AF19 Windows XP FDB5 2F94 998D version of the DE3D F8B5 06E4 code is displayed. For this A169 4E46 08 exercise the following disassemblers were tested: 20 • Windows XP: Win32 Program disassembler http://www.geocities.com/~sangcho/disasm.html te • Linux: Perl x86 Disassembler description titu http://linux.softpedia.com/get/Programming/Disassemb lers/Perl-x86-Disassembler-1155.shtml Ins The Linux option is the simplest to port as it runs in Perl. It is simple to change the R code below to run this NS function. The R code to call an application is included below. Alternatively, the Win32 Disassembler is portable to Linux and SA the source file has details on this process. This disassembler had periodic problems with Windows XP running with SP2 +. © Craig Wright - 26 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES . hts rig l ful ins eta rr Detecting HYDAN HYDAN is surprisingly simple to detect when the extra tho data is removed. All that is sought in the data is the negative sign. In all cases where the assembly language Au equivalent function; “SUB, -value” or “Add, -value”; is found in the code, the encoded binary is likely to be an indicator , Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 of the use of HYDAN. The proof of this assertion is included below. As such, any significant increase in the equivalent 20 function is an indicator of the use of HYDAN. te By simply examining the table (Test.HYDAN), any negative value that is found in column V2 demonstrates significant titu evidence at the alpha=0.1 level that HYDAN has been used. The ordinary distribution of negative values, or for that matter, Ins equivalent assembly language functions is so low as to produce statistically significant results for even the smallest NS message. SA (alpha=0.1% is far in excess of normal scientific or even legal requirements of proof that generally look at alpha = 5%. For further details on statistical significance, see © http://www.statsoft.com/textbook/stathome.html. A number of other statistical references have been included at the end of the paper). Craig Wright - 27 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES A simple plot of the data that demonstrates any . significant level of difference is all that is required to hts determine the use of HYDAN visually and a simple t-test can be coded to automatically determine the use of HYDAN. rig Before HYDAN After HYDAN l ful ins eta rr tho , Au Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 These plots are made as simply as with the commands: > plot(Test.HYDAN2) 20 > plot(Test.HYDAN) In this instance, the dataset, “Test.HYDAN” is the set of te data from the file where HYDAN has not been used. The dataset, titu “Test.HYDAN2” is the output from the file where HYDAN was used to hide a small (1kb) message. Ins Even at the low encoding rate of (or 1 in every 110 NS bits) stated by El-Khalil and Keromytis (2003), HYDAN is easily detected. Further testing did demonstrate that HYDAN SA was extremely difficult to conclusively detect at the alpha =5 level for an encoding rate of around . The problem with © this is that this makes the use of HYDAN ineffective as a means of encoding steganographic data as a file of about 15Mb is needed to encode a 1Kb hidden message. Craig Wright - 28 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES The Distribution . To create a distribution, 500 files on both Windows and hts Linux where tested. These where combined to form a global dataset. rig The summary results of the Global datasets l ful > summary(Global) # The files that have not had HYDAN used on them ins Min. 1st Qu. Median Mean 3rd Qu. Max. 0.0001041 0.0038660 0.0050950 0.0050350 0.0061710 0.0123800 eta > summary(Global.test)# HYDAN used on these files Min. 1st Qu. Median Mean 3rd Qu. Max. rr 0.08021 0.13560 0.15580 0.15140 0.17120 0.20910 tho > A simple z or t-test will statistically determine even Au the simplest datasets. To run a simple t-test in R we use the following command: , Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 > t.test(Global.test-Global) 08 One Sample t-test 20 data: Global.test - Global te t = 140.8821, df = 999, p-value < 2.2e-16 titu alternative hypothesis: true mean is not equal to 0 95 percent confidence interval: Ins 0.1443012 0.1483779 sample estimates: NS mean of x 0.1463395 SA > In the above example, we have tested the Global set against the test data. “Global.test” is the set of files where © HYDAN was used. “Global” is the set of files that occurred naturally on the system. The bloxplot below demonstrates the Craig Wright - 29 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES distribution of data with HYDAN encoding and naturally . occurring binary distributions. hts rig l ful ins eta rr tho , Au Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 20 te titu Finding the starting point of HYDAN (with a measure) for error is simple. By converting all negatives (those register Ins values that have been switched by HYDAN) to be represented by a “1” and letting the other values be a “0” we can plot the dataset (“plot(HYDAN.data)”) . From this on a single program NS we can visually see the presence of HYDAN in the code as well as having a good starting point to determine where the random SA walk function started adding the data. Once the data is loaded, a simple test is required to see © if the mean value of the distribution is zero. The testing process is simple. We take the extracted dataset and test whether this equals the natural distribution. Alternatively, Craig Wright - 30 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES we could test against a means of “0”, but for the exercise we . shall test the natural distribution. hts > t.test(linux.test.1, mu=mean(linux1), conf.level=0.001) rig One Sample t-test l ful data: linux.test.1 ins t = 25.0016, df = 9, p-value = 1.258e-09 alternative hypothesis: true mean is not equal to 0.0052126 eta 0.1 percent confidence interval: 0.1741266 0.1741441 rr sample estimates: tho mean of x 0.1741354 Au > t.test(XP.test.1, mu=mean(XP1), conf.level=0.001) , Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 One Sample t-test 20 data: XP.test.1 te t = 14.1112, df = 9, p-value = 1.915e-07 titu alternative hypothesis: true mean is not equal to 0.004856961 0.1 percent confidence interval: Ins 0.1286020 0.1286246 sample estimates: mean of x NS 0.1286133 SA > As can be seen in either case (p=1.258e-09 and p=1.915e- © 07 respectively for Linux and XP) the chances of finding HYDAN encoding are overwhelming. Craig Wright - 31 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES All tests demonstrate that the distributions of values . that represent “negatives” or those values that have been hts reversed by HYDAN are significantly different than those that occur naturally. rig Even if the testing was to be set with a mean larger than l ful that of the expected range, the embedding of even small amounts of data is detectable. ins > t.test(linux.test.1, mu=mean(0.01), conf.level=0.001) eta One Sample t-test rr data: linux.test.1 tho t = 24.2931, df = 9, p-value = 1.624e-09 alternative hypothesis: true mean is not equal to 0.01 Au 0.1 percent confidence interval: 0.1741266 0.1741441 , Key fingerprint sample= AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 estimates: 08 mean of x 20 0.1741354 te > titu Finding Where the Data Encoding Starts Even finding the start of the data is simple. From the Ins plots below, we can see the probable position of where the data has started to be encoded. NS SA © Craig Wright - 32 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES . hts rig l ful ins eta rr tho , Au Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 20 te As can be seen from the plot, we can visually deduce that titu HYDAN has started adding data between command 15 and 17 with a reasonable level of confidence. Ins NS SA © Craig Wright - 33 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES A close-up demonstrates this better. The sample of 10 . files was again plotted as before. Again the start of the hts HYDAN encoding is visually available. rig l ful ins eta rr tho The start location of the HYDAN data does vary, but it is Au simple to determine the likely start location visually. The random walk algorithm described by El-Khalil and Keromytis (2003) does not describe the distribution actually found. It , Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 is uncertain if this would be a consequence of the platform used for this section of testing (Windows XP) or if there was 20 some other flaw. te What this means for HYDAN (or Future Lessons) titu El-Khalil & Keromytis (2003) state that the methodology used in HYDAN is based on the work of Provos (2001) stating Ins that the method proposed by Provos is used to increase the entropy of the embedding process. NS HYDAN creates a noticeable distortion in the natural distribution of instructions. If HYDAN or another tool was to SA change the instruction sets used or to even use multiple equivalent instruction sets simultaneously, this would do little to significantly reduce the ease to which HYDAN can be © discovered. Provos (2001) however stated that: Craig Wright - 34 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES “Detectability is also used as a bias in the selection . process. The selector does not try to reduce only the number hts of changed bits but also the overall detectability. rig Whenever a bit has to be modified, its detectability will be added to a global bias. A higher accumulated bias reduces l ful the likelihood that this specific embedding will be used”. Zollner et al. (1998) advocate that there are two ins essential stipulations that are required to produce a secure steganographic function: eta • The secret key used to embed the hidden message is rr unknown to the adversary. • tho The adversary does not know the cover medium. The issue with HYDAN is the latter of these requirements. Au The distributions of alternative assembly instructions are low enough in the wild to ensure that any use of HYDAN will be , easily Key fingerprint detected. = AF19 This FA27 2F94 998D makes FDB5 the 06E4 DE3D F8B5 useA169 of 4E46 HYDAN for any 08 operational purpose infeasible. 20 Even the proposed enhancements to HYDAN (El-Khalil & Keromytis, 2003, Pp. 7-8) fail to offer any improvement. The te set of possible alternative and equivalent instructions is too titu unevenly distributed. The methods presented in this paper can be simply changed to incorporate the testing of all equivalent Ins instructions with little if any overhead. In creating a steganographic process, the developer needs NS to find a model where the distribution of the original medium is unknown to the adversary. HYDAN has not achieved this. SA Unlike image based steganography, any preprocessing step designed to introduce randomness into a cover medium based on © binary code significantly alters the natural distribution of the instruction sets. Craig Wright - 35 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES This makes the process of deducing the existence of an . embedded message trivial as it is not possible to embed a hts message of any significant size while preserving the natural distribution of the cover medium. rig Plausible Deniability l ful The methods of “Plausible Deniability” proposed by Provos (2001, p. 7) could be incorporated into HYDAN to make the ins detection of a “true” message more difficult. The addition of capability to embed additional messages would allow the person eta who created a message to hand over the pass-phrase of an innocuous message and claim that only a single message was rr embedded into the covertext. tho However, even this is problematic. If the passphrase for the innocuous message is handed over, the process of comparing Au the sample with a single message and the captured message is simple. To do this, the analyst could simply recreate the , message Key fingerprint = AF19 as FA27follows: 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 1. Using an original copy of the binary, the passphrase 20 that has been handed over and the message that has been recovered, re-run the embedding process with te the captured message. titu 2. Compare the binary that was originally captured with the newly created one. Ins 3. If there is any difference, the existence of a second (or further) message would be determined. NS Being that HYDAN uses the user supplied pass-phrase as SA the seed for its random walk, the repeated use of HYDAN with the same message, passphrase and binary will always result in an identical output. That is, there is no randomness between © use of the program. As Zöllner et al. (1998) state, “An advanced solution to this problem is to have an indeterministic embedding Craig Wright - 36 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES operation. An indeterministic operation or process gives . different results (within a certain range) every time it is hts computed. In other words, it contains randomness”. rig This could be incorporated to create a detectable program that still allowed for plausible denial. l ful Conclusion and Future Research HYDAN is not particularly difficult to detect ins statistically. This paper presented a preliminary method that could be further refined into a production level tool if the eta need to detect HYDAN or a future variant was required. The R detection function could be compiled using an R code compiler rr rather than leaving it running in an interpreted mode as was tho done in this paper. Statistical tools such as R provide an excellent tool for Au the analysis of data from computer systems and networks. These statistical tests could be expanded to uncover other forms of , Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 steganography. The methods in this paper have demonstrated that it is not necessary to analyze the entire binary 20 executable as was supposed by the author of HYDAN. The distribution of functionally equivalent but uncommon byte code te instructions becomes statistically significant well before the titu entirety of these functions have been analyzed. Future research efforts have started to detail the Ins process required to capture the encrypted header length and use this as both a means to Brute force the data and determine NS the message length. SA © Craig Wright - 37 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES Bibliography . Duntemann, Jeff (2000) “Assembly Language Step-by-Step” Wiley hts Press USA rig Eilam, Eldad (2005) “Reversing, the Secrets of Reverse Engineering” Wiley Press USA l ful El-Khalil, Rakan & Keromytis, Angelos D. (2003) “HYDAN: Hiding ins Information in Program Binaries” Department of Computer Science, Columbia University in the City of New York, eta http://www1.cs.columbia.edu/~angelos/Papers/HYDAN.pdf Hyde, Randall (2004) “Write Great Code. Volume 1: rr Understanding the Machine”, No Starch Press. tho Goldreich, Oded (2001) “Foundations of Cryptography I”, Au Cambridge University Press, UK Goldreich, Oded (2004) “Foundations of Cryptography II”, , Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 Cambridge University Press, UK 20 Irvine, Kip R. (2007) “Assembly Language for Intel-Based Computers” 5th Ed. Pearson, Prentice Hall USA te Johnson, N.F. & Jajodia, S. (1998) “Exploring Steganography: titu Seeing the Unseen” Computer, vol. 31, no. 2, 1998, pp. 26–34. Ins Kuhnert, Petra & Venables, Bill (2005) “An Introduction to R: Software for Statistical Modelling & Computing”. Cleveland, Australia. http://www.csiro.au/resources/Rcoursenotes.html NS Maindonald, J. H. (2004) “Using R for Data Analysis and SA Graphics: Introduction, Code and Commentary”. Centre for Bioinformation Science, Australian National University. © http://wwwmaths.anu.edu.au/~johnm/ & http://www.maths.anu.edu.au/~johnm/r/usingR.pdf Craig Wright - 38 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES McGill, L. (2005) “Steganography: The Right Way” SANS Reading . Room, hts https://www2.sans.org/reading_room/whitepapers/stenganography/ 1584.php rig Paradis, Emmanuel, (2004) “R for Beginners”, http://cran.r- l ful project.org/doc/contrib/Paradis-rdebuts_en.pdf. Provos, Neils, & Honeyman, Peter. (2003), “Hide and Seek: An ins Introduction to Steganography” IEEE Security and Privacy, eta May/June 2003; IEEE Computer Society. Provos, Neils (2001) “Defending Against Statistical rr Steganalysis”. In: Proceedings of the 10th USENIX Security tho Symposium. Richmond, J. A. (1998) “Spies in Ancient Greece” Greece & Au Rome, Second Series, Vol. 45, No. 1 (Apr., 1998), pp. 1-18, Cambridge University Press on behalf of The Classical , Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 Association. 20 SANS (2007) “SEC 504” SANS USA Courseware te Slashdot, (2004) “HYDAN: Steganography in Executables” Thu. Aug 12, 2004 titu http://slashdot.org/article.pl?sid=04/08/12/2051219 Ins Wand, Matt., (2004) “Fundamentals of R. A “Hands-On” Tutorial”, Department of Statistics, University of New South NS Wales http://web.maths.unsw.edu.au/~wand/web232/r-tut.txt & http://web.maths.unsw.edu.au/~wand/binf3001.html SA Zollner, J., Federrath, H., Klimant, H., Ptzmann, A., Piotraschke, R., Westfeld, A., Wicke, G. & Wolf. G. (1998) © “Modelling the Security of Steganographic Systems”. In Proceedings of Information Hiding - Second International Workshop. Springer-Verlag, April 1998. Craig Wright - 39 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES Websites . HYDAN - http://www.crazyboy.com/HYDAN/ hts Matt Wand’s Bioinformatics course web page - rig http://web.maths.unsw.edu.au/~wand/binf3001.html Null Hypothesis (Wikipedia) l ful http://en.wikipedia.org/wiki/Null_hypothesis R Windows release download - http://cran.r- ins project.org/bin/windows/base/release.htm eta R graph library - http://addictedtor.free.fr/graphiques/allgraph.php rr The R Project- http://www.r-project.org/tho Significance Tests and The Null and the Alternative Hypothesis Au http://www.bized.co.uk/timeweb/crunching/crunch_experiment_exp l.htm , Key fingerprint = AF19 FA27 hypothesis Statistical 2F94 998D FDB5testing DE3D F8B5 (Wikipedia) 06E4 A169 4E46 08 http://en.wikipedia.org/wiki/Statistical_hypothesis_testing 20 Wikipedia, article on box plot - te http://en.wikipedia.org/wiki/Box_plot titu Statistical References Carlin, B.P. & Louis T.A. (2000) “Bayes and Empirical Bayes Ins Methods for Data Analysis”, Chapman and Hall. Casella, George & Berger, Roger L (2002) “Statistical NS Inference” Duxbury Advanced Series Congdon, P (2001). “Bayesian Statistical Modelling”, Wiley SA Dobson, Annette J. (2002) “An Introduction to Generalized Linear Models” 2nd Ed. CHAPMAN & HALL/CRC © Gelman, Andrew et al., (2003) “Bayesian Data Analysis”, 2nd Edition; Chapman & Hall/CRC, London Craig Wright - 40 - © SANS Institute 2008, Author retains full rights. DETECTING HYDAN: STATISTICAL METHODS FOR CLASSIFYING THE USE OF HYDAN BASED STEGONOGRAPHY IN EXECUTABLE FILES Gilks, W.G., Richardson, S. & Spiegelhalter, D.J. (1995) . “Markov Chain Monte Carlo in Practice”, CRC Press. hts Givens, Geof H. & Hoeting, Jennifer A. (2005) “Computational rig Statistics” Wiley Madigan, David (2006) {Course notes to - BAYESIAN DATA l ful ANALYSIS} http://www.stat.rutgers.edu/~madigan/bayes06/ Maindonald, John & Braun, John (2004) “Data Analysis and ins Graphics Using R, An example based approach” Cambridge University Press eta Rice, John A. (1999) “Mathematical Statistics and Data rr Analysis” Duxbury Press tho , Au Key fingerprint = AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46 08 20 te titu Ins NS SA © Craig Wright - 41 - © SANS Institute 2008, Author retains full rights.