{"id":130243,"date":"2009-12-02T09:43:00","date_gmt":"2009-12-02T14:43:00","guid":{"rendered":"tag:blogger.com,1999:blog-7196788127833928948.post-8655084031377360918"},"modified":"2009-12-02T09:43:00","modified_gmt":"2009-12-02T14:43:00","slug":"tutorial-alternate-data-streams-the-forgotten-art-of-information-hiding","status":"publish","type":"post","link":"https:\/\/mereja.media\/index\/130243","title":{"rendered":"Tutorial &#8211; Alternate Data Streams: The Forgotten Art of Information Hiding"},"content":{"rendered":"<p>Alternate Data Streams is a feature of the NTFS filesystem. In essence they were created to provide compatibility with HFS, or the old Macintosh Hierarchical File System. The way that the Macintosh&#8217;s file system works is that they will use both data and resource forks to store their contents. The data fork is for the contents of the document while the resource fork is to identify file type and other pertinent details.<\/p>\n<p><a onblur=\"try {parent.deselectBloggerImageGracefully();} catch(e) {}\" href=\"http:\/\/1.bp.blogspot.com\/_Hu1rpxRsqcU\/SxbR-r1mVdI\/AAAAAAAAAX0\/36nN5SYET14\/s1600-h\/dataStream.jpg\"><img decoding=\"async\" style=\"margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 255px; height: 299px;\" src=\"http:\/\/1.bp.blogspot.com\/_Hu1rpxRsqcU\/SxbR-r1mVdI\/AAAAAAAAAX0\/36nN5SYET14\/s320\/dataStream.jpg\" alt=\"\" id=\"BLOGGER_PHOTO_ID_5410742877181859282\" border=\"0\" \/><\/a><br \/>How do you create an ADS? Wonderfully easy: All you need to do is have the two files, and then send the file to be hidden to the ADS of the host file with a simple type command:<\/p>\n<blockquote style=\"color: rgb(51, 51, 51); font-family: courier new;\"><p>type file_to_be_hidden> host_file:name_of_file_to_be_hidden<\/p><\/blockquote>\n<p>The most frequent use of ADS for malicious purposes is to conceal the executable of a trojan\/rootkit as an Alternate Data Stream (ADS) to a perfectly safe file. For instance, once an attacker penetrates a Windows system, he can easily hide the malicious payload for further access into an executable which is fairly frequently used &#8211; like Calculator.<\/p>\n<p>Alternate Data Streams may also be interesting as a mechanism to hide and transport information out of an organization:<br \/>Once you include an ADS into a file, there is no visible change in filesize of the host file, only the modified date is changed. This makes it quite difficult to detect the Alternate Streamed file. Also, the ADS file does not change the MD5 hash of the original file, which may prevent systems which control file modification through hashing from detecting the hidden file. Here is an example:<\/p>\n<blockquote style=\"color: rgb(102, 102, 102);\"><p><span style=\"color: rgb(51, 51, 51);font-family:courier new;\" >C:\\Users\\user\\Desktop>md5sum test.txt<\/span><br \/><span style=\"color: rgb(51, 51, 51);font-family:courier new;\" >d41d8cd98f00b204e9800998ecf8427e *test.txt<\/span><\/p>\n<p><span style=\"color: rgb(51, 51, 51);font-family:courier new;\" >C:\\Users\\user\\Desktop>type image.jpg>test.txt:image.jpg<\/span><\/p>\n<p><span style=\"color: rgb(51, 51, 51);font-family:courier new;\" >C:\\Users\\user\\Desktop><span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_0\">md<\/span>5sum test.<span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_1\">txt<\/span><\/span><br \/><span style=\"color: rgb(51, 51, 51);font-family:courier new;\" >d41d8<span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_2\">cd<\/span>98f00b204e9800998<span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_3\">ecf<\/span>8427e *test.<span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_4\">txt<\/span><\/span><\/p><\/blockquote>\n<p>One would think that this method of information hiding is great to transfer any amount of information with an inconspicuous carrier file being sent over a network. But there is a catch: most data carriers will ignore the Alternate Data Stream, and here is the summary list:<\/p>\n<ul>\n<li>Zip, <span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_5\">RAR<\/span> or <span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_6\">ARJ<\/span> will simply compress the host file and disregard the ADS<\/li>\n<li>MIME and Base64 encoding (e-mail) will ignore the ADS entirely<\/li>\n<li>FAT32 (mostly used on <span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_7\">USB<\/span> flash drives) will loose the ADS since it&#8217;s not supported.<\/li>\n<li><span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_8\">Steganography<\/span> programs will read the bytes of the host file and stop at the <span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_9\">EOF<\/span><\/li>\n<li>FTP and HTTP transfer ignores  ADS entirely<\/li>\n<li>Recording the<\/li>\n<\/ul>\n<p>But all is not lost. There are still ways to transfer data with ADS:<\/p>\n<ul>\n<li>Transferring the host file over <span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_10\">SMB<\/span> network to an <span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_11\">NTFS<\/span> target retains the ADS hidden file<\/li>\n<li>Copying the host file to an <span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_12\">NTFS<\/span> <span class=\"blsp-spelling-corrected\" id=\"SPELLING_ERROR_13\">file system<\/span> transfers the ADS hidden file<\/li>\n<\/ul>\n<p>So the information theft scenario with ADS is mostly available to employees or trusted persons:<\/p>\n<ol>\n<li>The malicious user will create a legal host file and ADS a file with information to be stolen.<\/li>\n<li>He will convince the manager to take the legal file home to work on over the weekend.<\/li>\n<li>Upon the manager&#8217;s request, even if <span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_14\">USB<\/span> drives are restricted, IT will copy the file over <span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_15\">SMB<\/span> and onto the employee&#8217;s <span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_16\">USB<\/span> &#8211; which is sparkling clean and <span class=\"blsp-spelling-corrected\" id=\"SPELLING_ERROR_17\">conveniently<\/span> formatted with <span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_18\">NTFS<\/span>.<\/li>\n<li>All logs of the transfer will contain the transfer of the original approved file to the <span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_19\">USB<\/span><\/li>\n<\/ol>\n<p>What will you do in such a scenario? <span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_20\">Talkback<\/span> is most welcome!<\/p>\n<p>Related posts<br \/><a href=\"http:\/\/www.shortinfosec.net\/2008\/06\/be-aware-of-security-risks-of-usb-flash.html\">Be Aware of Security Risks of <span class=\"blsp-spelling-error\" id=\"SPELLING_ERROR_21\">USB<\/span> Flash Drives<\/a><br \/><a href=\"http:\/\/www.shortinfosec.net\/2009\/04\/5-biggest-mistakes-of-information.html\">5 biggest mistakes of information security<\/a><\/p>\n<div class=\"blogger-post-footer\"><img width='1' height='1' src='https:\/\/blogger.googleusercontent.com\/tracker\/7196788127833928948-8655084031377360918?l=www.shortinfosec.net' alt='' \/><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~r\/shortinfosec\/~4\/voVNRBbG0KE\" height=\"1\" width=\"1\"\/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Alternate Data Streams is a feature of the NTFS filesystem. In essence they were created to provide compatibility with HFS, or the old Macintosh Hierarchical File System. The way that the Macintosh&#8217;s file system works is that they will use both data and resource forks to store their contents. The data fork is for the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-130243","post","type-post","status-publish","format-standard","hentry","category-news"],"_links":{"self":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/posts\/130243","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/comments?post=130243"}],"version-history":[{"count":0,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/posts\/130243\/revisions"}],"wp:attachment":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/media?parent=130243"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/categories?post=130243"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/tags?post=130243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}