{"id":717,"date":"2013-09-01T22:49:04","date_gmt":"2013-09-01T21:49:04","guid":{"rendered":"http:\/\/www.greyhathacker.net\/?p=717"},"modified":"2013-10-18T10:39:57","modified_gmt":"2013-10-18T09:39:57","slug":"heap-spraying-browsers-using-adobe-flashs-actionscript","status":"publish","type":"post","link":"https:\/\/www.greyhathacker.net\/?p=717","title":{"rendered":"Heap spraying browsers using Adobe Flash&#8217;s ActionScript"},"content":{"rendered":"<p>It\u2019s been a while since my last post so I thought I&#8217;d post this article on heap spraying using Adobe Flash which I have been working on to get a better understanding of the ActionScript language, hopefully it will benefit some readers to test their security layers in their own environment.<\/p>\n<p>After analysing some actual exploits which were using Flash to spray the heap I decided to use the relevant code and started customising it for my own testing purposes. I was surprised that a handful of Endpoint Protection products I tested on failed to detect any sort of heap spray. Spraying using JavaScript or DEPS does however get detected but I\u2019m not sure how it well it would stand if the code were to be obfuscated. Below is a screenshot of the ActionScript spray so you get the idea.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" alt=\"\" src=\"\/images\/sprayas.png\" width=\"503\" height=\"744\" \/><\/p>\n<p>A good portable tool to decompile flash files which I use is &#8220;AS3 Sorcerer&#8221;. There are some nice features, definitely worth the purchase.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" alt=\"\" src=\"\/images\/as3sorcerer.png\" width=\"500\" height=\"637\" \/><\/p>\n<p>&#8220;ActionScript Extractor&#8221; is another good and free portable tool but has a bug as when decompiling certain flash files triggers a crash. I didnt investigate this issue\u00a0if its exploitable so be careful using this tool. Also you&#8217;ll most likely need to make more corrections to the code if wanting to recompile again.<\/p>\n<p>I did a quick test on all the major browsers spraying 100 times with 1mb chunks. In the image below it\u2019s interesting to see its child processes of each of the browsers and different integrity levels. Bypassing browser sandboxes is something I&#8217;ll be researching in the future so if I do discover anything interesting I&#8217;ll be sure to blog about it.<\/p>\n<p><a href=\"http:\/\/www.greyhathacker.net\/images\/procspraybrowsers.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" alt=\"\" src=\"\/images\/procspraybrowsers.png\" width=\"503\" height=\"226\" \/><\/a><\/p>\n<p>Finally here is the code and examples you can download from <a href=\"http:\/\/www.greyhathacker.net\/docs\/actionscript.zip\">here<\/a>. Password is &#8220;exploit&#8221; and MD5 hash is 98afdc19007a65be636cc0a8d9fe8d9d .\u00a0 It includes the exploit for IE&#8217;s CVE-2012-4792 using JavaScript, DEPS and Flash. You can use SWFTools as3compile.exe to compile but I mainly used Adobe&#8217;s Flex SDK. Here is the direct link for version <a href=\"http:\/\/download.macromedia.com\/pub\/flex\/sdk\/flex_sdk_4.6.zip\">4.6<\/a>.<\/p>\n<p>References:<\/p>\n<p><a href=\"http:\/\/www.adobe.com\/devnet\/flex\/flex-sdk-download-all.html\" target=\"_blank\">http:\/\/www.adobe.com\/devnet\/flex\/flex-sdk-download-all.html<\/a><br \/>\n<a href=\"https:\/\/www.corelan.be\/index.php\/2013\/02\/19\/deps-precise-heap-spray-on-firefox-and-ie10\/\" target=\"_blank\">https:\/\/www.corelan.be\/index.php\/2013\/02\/19\/deps-precise-heap-spray-on-firefox-and-ie10\/<\/a><br \/>\n<a href=\"http:\/\/help.adobe.com\/en_US\/FlashPlatform\/reference\/actionscript\/3\/flash\/utils\/ByteArray.html\" target=\"_blank\">http:\/\/help.adobe.com\/en_US\/FlashPlatform\/reference\/actionscript\/3\/flash\/utils\/ByteArray.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It\u2019s been a while since my last post so I thought I&#8217;d post this article on heap spraying using Adobe Flash which I have been working on to get a better understanding of the ActionScript language, hopefully it will benefit some readers to test their security layers in their own environment. After analysing some actual [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,7,6],"tags":[42,22,32],"class_list":["post-717","post","type-post","status-publish","format-standard","hentry","category-all","category-exploits","category-vulnerabilities","tag-actionscript","tag-adobe","tag-rop"],"_links":{"self":[{"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=\/wp\/v2\/posts\/717","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=717"}],"version-history":[{"count":8,"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=\/wp\/v2\/posts\/717\/revisions"}],"predecessor-version":[{"id":734,"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=\/wp\/v2\/posts\/717\/revisions\/734"}],"wp:attachment":[{"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}