{"id":6324,"date":"2017-01-23T15:50:22","date_gmt":"2017-01-23T23:50:22","guid":{"rendered":"http:\/\/www.palada.net\/index.php\/2017\/01\/23\/news-162\/"},"modified":"2017-01-23T15:50:22","modified_gmt":"2017-01-23T23:50:22","slug":"news-162","status":"publish","type":"post","link":"http:\/\/www.palada.net\/index.php\/2017\/01\/23\/news-162\/","title":{"rendered":"Reverse-engineering DUBNIUM\u2019s Flash-targeting exploit"},"content":{"rendered":"<p>The DUBNIUM campaign in December involved one exploit in-the-wild that affected Adobe Flash Player. In this blog, we\u2019re going to examine the technical details of the exploit that targeted vulnerability <a href=\"http:\/\/www.cvedetails.com\/cve\/CVE-2015-8651\/\">CVE-2015-8651<\/a>. For more details on this vulnerability, see <a href=\"https:\/\/helpx.adobe.com\/security\/products\/flash-player\/apsb16-01.html\">Adobe Security Bulletin APSB16-01<\/a>.<\/p>\n<p>Note that Microsoft Edge on Windows 10 was protected from this attack due to the mitigations introduced into the browser.<\/p>\n<p>&nbsp;<\/p>\n<h2>Vulnerability exploitation<\/h2>\n<h3>Adobe Flash Player version checks<\/h3>\n<p>The nature of the vulnerability is an integer overflow, and the exploit code has quite extensive subroutines in it. It tries to cover versions of the player from 11.x to the most recent version at the time of the campaign, 20.0.0.235.<\/p>\n<p>The earliest version of Adobe Flash Player 11.x was released in October 2011 (11.0.1.152) and the last version of Adobe Flash Player 10.x was released in June 2013 (10.3.183.90). This doesn\u2019t necessarily mean the exploit existed from 2011 or 2013, but it again demonstrates the broad target the exploit tries to cover.<\/p>\n<p><div id=\"attachment_7815\" style=\"width: 721px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7815\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-1.png\" alt=\"Figure 1 Version check for oldest Flash Player the exploit targets\" width=\"711\" height=\"214\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 1 Version check for oldest Flash Player the exploit targets<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Mainly we focused our analysis upon the function named <em>qeiofdsa<\/em>, as the routine covers any Adobe Flash player version since 19.0.0.185 (released on September 21, 2015).<\/p>\n<p><div id=\"attachment_7825\" style=\"width: 638px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7825\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-2.png\" alt=\"Figure 2 Version check for latest Flash Player the exploit supports\" width=\"628\" height=\"247\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 2 Version check for latest Flash Player the exploit supports<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Why is this version of Flash Player so important? Because that is the release which had the latest <em>Vector<\/em> length corruption hardening applied at the time of the incident. The original <em>Vector<\/em> length hardening came with 18.0.0.209 and it is well explained in the Security @ Adobe blog <a href=\"https:\/\/blogs.adobe.com\/security\/2015\/12\/community-collaboration-enhances-flash.html\">https:\/\/blogs.adobe.com\/security\/2015\/12\/community-collaboration-enhances-flash.html<\/a>.<\/p>\n<p>The <em>Vector<\/em> object from Adobe Flash Player can be used as a corruption target to acquire read or write (RW) primitives.<\/p>\n<p>This object has a very simple object structure and predictable allocation patterns without any sanity checks on the objects. This made this object a very popular target for exploitation for recent years. There were a few more bypasses found after that hardening, and 19.0.0.185 had another bypass hardening. The exploit uses a new exploitation method (<em>ByteArray<\/em> length corruption) since this new version of Adobe Flash Player.<\/p>\n<p>Note, however, that with new mitigation from Adobe released after this incident, the <em>ByteArray<\/em> length corruption method no longer works.<\/p>\n<p>To better understand the impact of the mitigations on attacker patterns, we compared exploit code line counts for the <em>pdfsajoe<\/em> routine, which exploits Adobe Flash Player versions earlier than 19.0.0.185, to the <em>qeiofdsa<\/em> routine, which exploits versions after 19.0.0.185. We learned that <em>pdfsajoe<\/em> has 139 lines of code versus <em>qeiofdsa<\/em> with 5,021.<\/p>\n<p>While there is really no absolute way to measure the impact and line code alone is not a standard measurement, we know that in order to target the newer versions of Adobe Flash Player, the attacker would have to write 36 more times the lines of code.<\/p>\n<table style=\"width: 80%;border: 0.5px\">\n<tbody>\n<tr style=\"border: 0.5px solid #70AD47;background: #70AD47\">\n<td style=\"color: #ffffff;font-weight: 600;font-size: 1.1em;border-bottom: 0.5px solid white;text-align: left;padding: 10px\"><strong>Subroutine name<\/strong><\/td>\n<td style=\"color: #ffffff;font-weight: 600;font-size: 1.1em;border-bottom: 0.5px solid white;text-align: left;padding: 10px\"><strong><em>pdfsajoe<\/em><\/strong><\/td>\n<td style=\"color: #ffffff;font-weight: 600;font-size: 1.1em;border-bottom: 0.5px solid white;text-align: left;padding: 10px\"><strong><em>qeiofdsa<\/em><\/strong><\/td>\n<\/tr>\n<tr style=\"border: 0.5px solid #70AD47;background: #E2EFDA\">\n<td style=\"padding: 10px\"><strong>Vulnerable Flash Player version<\/strong><\/td>\n<td style=\"padding: 10px\">Below 19.0.0.185<\/td>\n<td style=\"padding: 10px\">19.0.0.185 and up<\/td>\n<\/tr>\n<tr style=\"border: 0.5px solid #70AD47;background: #E2EFDA;padding: 10px\">\n<td style=\"padding: 10px\"><strong>Mitigations<\/strong><\/td>\n<td style=\"padding: 10px\">No latest Vector mitigations<\/td>\n<td style=\"padding: 10px\">Latest Vector mitigations applied<\/td>\n<\/tr>\n<tr style=\"border: 0.5px solid #70AD47;background: #E2EFDA;padding: 10px\">\n<td style=\"padding: 10px\"><strong>Lines of attack code<\/strong><\/td>\n<td style=\"padding: 10px\">139 lines<\/td>\n<td style=\"padding: 10px\">5,021 lines<\/td>\n<\/tr>\n<tr style=\"border: 0.5px solid #70AD47;background: #E2EFDA;padding: 10px\">\n<td style=\"padding: 10px\"><strong>Ratio<\/strong><\/td>\n<td style=\"padding: 10px\">1<\/td>\n<td style=\"padding: 10px\">36<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><em>Table 1 Before and after Vector mitigation<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>This tells us a lot about the importance of mitigation and the increasing cost of exploit code development. Mitigation in itself doesn\u2019t fix existing vulnerabilities, but it is definitely raising the bar for exploits.<\/p>\n<p>&nbsp;<\/p>\n<h3>Heap spraying and vulnerability triggering<\/h3>\n<p>The exploit heavily relies on heap spraying. Among heap spraying of various objects, the code from Figure 3 shows the code where the <em>ByteArray<\/em> objects are sprayed. This <em>ByteArray<\/em> has length of 0x10. These sprayed objects are corruption targets.<\/p>\n<p><div id=\"attachment_7835\" style=\"width: 352px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7835\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-3.png\" alt=\"Figure 3 Heap-spraying code\" width=\"342\" height=\"123\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 3 Heap-spraying code<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>The vulnerability lies in the implementation of fast memory opcodes. More detailed information on the usage of fast memory opcodes are available in the <a href=\"http:\/\/www.adobe.com\/devnet\/air\/articles\/faster-byte-array-operations.html\"><em>Faster byte array operations with ASC2<\/em> article at the Adobe Developer Center<\/a>.<\/p>\n<p>After setting up application domain memory, the code can use <em>avm2.intrinsics.memory<\/em>. The package provides various methods including <em>li32<\/em> and <em>si32<\/em> instructions. The <em>li32<\/em> can be used to load 32bit integer values from fast memory and <em>si32<\/em> can be used to store 32bit integer values to fast memory. These functions are used as methods, but in the AVM2 bytecode level, they are opcode themselves.<\/p>\n<p><div id=\"attachment_7845\" style=\"width: 409px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7845\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-4.png\" alt=\"Figure 4 Setting up application domain memory\" width=\"399\" height=\"108\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 4 Setting up application domain memory<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Due to the way these instructions are implemented, the out-of-bounds access vulnerability happens (Figure 5). The key to this vulnerability is the second <em>li32<\/em> statement just after first <em>li32<\/em> one in each IF statement. For example, from the <em>li32((_local_4+0x7FEDFFD8)) <\/em>statement, the <em>_local_4+0x7FEDFFD8 <\/em>value ends up as 4 after integer overflow. From the just-in-time (JIT) level, the range check is only generated for this <em>li32<\/em> statement, skipping the range check JIT code for the first <em>li32<\/em> statement.<\/p>\n<p><div id=\"attachment_7855\" style=\"width: 617px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7855\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-5.png\" alt=\"Figure 5 Out-of-bounds access code using li32 instructions\" width=\"607\" height=\"291\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 5 Out-of-bounds access code using li32 instructions<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>We compared the bytecode level AVM2 instructions with the low-level x86 JIT instructions. Figure 6 shows the comparisons and our findings. Basically two <em>li32<\/em> accesses are made and the JIT compiler optimizes length check for both <em>li32<\/em> instructions and generates only one length check. The problem is that integer overflow happens and the length check code becomes faulty and allows bypasses of <em>ByteArray<\/em> length restrictions. This directly ends with out-of-bounds RW access of the process memory. Historically, fast memory implementation suffered range check vulnerabilities (CVE-2013-5330, CVE-2014-0497). The Virus Bulletin 2014 paper by Chun Feng and Elia Florio, <em>Ubiquitous Flash, ubiquitous exploits, ubiquitous mitigation (<\/em><a href=\"https:\/\/www.virusbulletin.com\/uploads\/pdf\/conference\/vb2014\/VB2014-FengFlorio.pdf\"><em>PDF download<\/em><\/a><em>)<\/em>, provides more details on other old but similar vulnerabilities.<\/p>\n<p><div id=\"attachment_7865\" style=\"width: 634px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7865\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-6.png\" alt=\"Figure 6 Length check confusion\" width=\"624\" height=\"483\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 6 Length check confusion<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Using this out-of-bounds vulnerability, the exploit tries to locate heap-sprayed objects.<\/p>\n<p>These are the last part of memory sweeping code. We counted 95 IF\/ELSE statements that sweep through memory range from <em>ba<\/em>+0x121028 to <em>ba<\/em>+0x17F028 (where <em>ba<\/em> is the base address of fast memory), which is 0x5E000 (385,024) byte size. Therefore, these memory ranges are very critical for this exploit\u2019s successful run.<\/p>\n<p><div id=\"attachment_7875\" style=\"width: 696px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7875\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-7.png\" alt=\"Figure 7 End of memory sweeping code\" width=\"686\" height=\"275\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 7 End of memory sweeping code<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Figure 8 shows a crash point where the heap spraying fails. The exploit heavily relies on a specific heap layout for successful exploitation, and the need for heap spraying is one element that makes this exploit unreliable.<\/p>\n<p><div id=\"attachment_7885\" style=\"width: 635px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7885\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-8.png\" alt=\"Figure 8 Out-of-bounds memory access\" width=\"625\" height=\"56\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 8 Out-of-bounds memory access<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>This exploit uses a corrupt <em>ByteArray.length<\/em> field and uses it as RW primitives (Figure 9).<\/p>\n<p><div id=\"attachment_7895\" style=\"width: 630px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-9.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7895\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-9.png\" alt=\"Figure 9 Instruction si32 is used to corrupt ByteArray.length field\" width=\"620\" height=\"132\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 9 Instruction si32 is used to corrupt ByteArray.length field<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>After <em>ByteArray.length<\/em> corruption, it needs to determine which <em>ByteArray<\/em> is corrupt out of the sprayed <em>ByteArrays<\/em> (Figure 10).<\/p>\n<p>&nbsp;<\/p>\n<p><div id=\"attachment_7905\" style=\"width: 390px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7905\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-10.png\" alt=\"Figure 10 Determining corrupt ByteArray\" width=\"380\" height=\"259\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 10 Determining corrupt ByteArray<\/p>\n<\/div>\n<h3><\/h3>\n<h3>RW primitives<\/h3>\n<p>The following shows various RW primitives that this exploit code provides. Basically these extensive lists of methods provide functions to support different application and operating system flavors.<\/p>\n<p><div id=\"attachment_7906\" style=\"width: 550px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7906\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-11.png\" alt=\"Figure 11 RW primitives\" width=\"540\" height=\"344\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 11 RW primitives<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>For example, the <em>read32x86 <\/em>method can be used to read an arbitrary process\u2019s memory address on x86 platform. The <em>cbIndex<\/em> variable is the index into the bc array which is an array of the <em>ByteArray <\/em>type. The <em>bc[cbIndex]<\/em> is the specific <em>ByteArray<\/em> that is corrupted through the fast memory vulnerability. After setting virtual address as position member, it uses the <em>readUnsignedInt<\/em> method to read the memory value.<\/p>\n<p><div id=\"attachment_7916\" style=\"width: 483px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-12.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7916\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-12.png\" alt=\"Figure 12 Read primitive\" width=\"473\" height=\"146\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 12 Read primitive<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>The same principle applies to the <em>write32x86<\/em> method. It uses the <em>writeUnsignedInt<\/em> method to write to arbitrary memory location.<\/p>\n<p><div id=\"attachment_7925\" style=\"width: 753px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-13.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7925\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-13.png\" alt=\"Figure 13 Write primitive\" width=\"743\" height=\"122\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 13 Write primitive<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Above these, the exploit can perform a slightly complex operation like reading multiple bytes using the <em>readBytes<\/em> method.<\/p>\n<p><div id=\"attachment_7935\" style=\"width: 741px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-14.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7935\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-14.png\" alt=\"Figure 14 Byte reading primitive\" width=\"731\" height=\"245\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 14 Byte reading primitive<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<h2><em>Function<\/em> object virtual function table corruption<\/h2>\n<p>Just after acquiring the process\u2019s memory RW ability, the exploit tries to get access to code execution. This exploit uses a very specific method of corrupting a <em>Function<\/em> object and using the <em>apply<\/em> and <em>call<\/em> methods of the object to achieve shellcode execution. This method is similar to the exploit method that was disclosed during the Hacking Team leak. Figure 15 shows how the <em>Function<\/em> object\u2019s virtual function table pointer (vptr) is acquired through a leaked object address, and low-level object offset calculations are performed. The offsets used here are relevant to the Adobe Flash Player\u2019s internal data structure and how they are linked together in the memory.<\/p>\n<p><div id=\"attachment_7945\" style=\"width: 626px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-15.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7945\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-15.png\" alt=\"Figure 15 Resolving Function object vptr address\" width=\"616\" height=\"336\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 15 Resolving Function object vptr address<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>This leaked virtual function table pointer is later overwritten with a fake virtual function table\u2019s address. The fake virtual function table itself is cloned from the original one and the only pointer to <em>apply<\/em> method is replaced with the <em>VirtualProtect<\/em> API. Later, when the <em>apply<\/em> method is called upon the dummy function object, it will actually call the <em>VirtualProtect<\/em> API with supplied arguments \u2013 not the original empty call body. The supplied arguments are pointing to the memory area that is used for temporary shellcode storage. The area is made read\/write\/executable (RWX) through this method.<\/p>\n<p><div id=\"attachment_7946\" style=\"width: 618px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-16.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7946\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-16.png\" alt=\"Figure 16 Call VirtualProtect through apply method\" width=\"608\" height=\"400\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 16 Call VirtualProtect through apply method<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Once the RWX memory area is reserved, the exploit uses the <em>call<\/em> method of the <em>Function<\/em> object to perform further code execution. It doesn\u2019t use the <em>apply<\/em> method because it no longer needs to pass any arguments. Calling the <em>call<\/em> method is also simpler (Figure 17).<\/p>\n<p><div id=\"attachment_7955\" style=\"width: 641px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-17.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7955\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-17.png\" alt=\"Figure 17 Shellcode execution through call method\" width=\"631\" height=\"199\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 17 Shellcode execution through call method<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>This shellcode-running routine is highly modularized and you can actually use API names and arguments to be passed to the shellcode-running utility function. This makes shellcode building and running very extensible. Again, this method has close similarity with the code found with the Adobe Flash exploit leaked during the Hacking Team information leak in July 2015.<\/p>\n<p><div id=\"attachment_7965\" style=\"width: 918px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-18.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7965\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-18.png\" alt=\"Figure 18 Part of shellcode call routines\" width=\"908\" height=\"181\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 18 Part of shellcode call routines<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Note that the exploit\u2019s method of using the corrupted <em>Function<\/em> object virtual table doesn\u2019t work on Microsoft Edge anymore as it has additional mitigation against these kinds of attacks.<\/p>\n<h2>ROP-less shellcode<\/h2>\n<p>With this exploit, shellcode is not just contiguous memory area, but various shellcodes are called through separate <em>call<\/em> methods. As you can see from this exploit, we are observing more exploits operate without return-oriented programming (ROP) chains. We can track these calls by putting a breakpoint on the native code that performs the ActionScript <em>call<\/em> method. For example, the disassembly in Figure 19 shows the code that calls the <em>InternetOpenUrlA<\/em> API call.<\/p>\n<p>&nbsp;<\/p>\n<p><div id=\"attachment_7975\" style=\"width: 635px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-19.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7975\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-19.png\" alt=\"Figure 19 InternetOpenUrlA 1st download\" width=\"625\" height=\"354\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 19 InternetOpenUrlA 1st download<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>This call only retrieves some portion of a portable executable (PE) file\u2019s header, but not the whole file. It will do another run of the <em>InternetOpenUrlA<\/em> API call to retrieve the remaining body of the payload. This is most likely a trick to confuse analysts who will look for a single download session for payloads.<\/p>\n<p><div id=\"attachment_7985\" style=\"width: 635px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-20.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7985\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/06\/d2-20.png\" alt=\"Figure 20 InternetOpenUrlA 2nd download\" width=\"625\" height=\"262\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Figure 20 InternetOpenUrlA 2nd download<\/p>\n<\/div>\n<h2><\/h2>\n<h2>Conclusion<\/h2>\n<p>With the analysis of the Adobe Flash Player-targeting exploit used by DUBNIUM last December, we learned they are using highly organized exploit code with extensive support of operating system flavors. However, some functionalities for some operating system are not yet implemented. For example, some 64-bit support routines had an empty function inside them.<\/p>\n<p>The way the shellcode is authored makes the exploit code very extensible and flexible as changing shellcode behavior is extremely simple \u2013 as much as just changing AS3 code lines.<\/p>\n<p>The actual first stage payload download is not just performed by a single download but are split into two.<\/p>\n<p>They also use the <em>ByteArray.length<\/em> corruption technique to achieve process memory RW access. There was a hardening upon this object just after this incident and <em>ByteArray<\/em> now has better sanity checks. Therefore, the same technique would not work as straightforwardly as in this exploit for the versions after the hardening.<\/p>\n<p>The exploit relies heavily on heap-spraying techniques, and this is one major element that makes this exploit unreliable.<\/p>\n<p>This is a good example of how mitigation undermines an exploit\u2019s stability, and how it increases exploit development cost.<\/p>\n<p>Due to the exploitation method it relies on for the <em>Function<\/em> object corruption, with Microsoft Edge you have additional protection over this new exploit method.<\/p>\n<p><em>\u00a0<\/em><\/p>\n<p><em>Jeong Wook Oh<br \/> MMPC<\/em><\/p>\n<p><a href=\"https:\/\/blogs.technet.microsoft.com\/mmpc\/2016\/06\/20\/reverse-engineering-dubniums-flash-targeting-exploit\/\" target=\"bwo\" >https:\/\/blogs.technet.microsoft.com\/mmpc\/feed\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The DUBNIUM campaign in December involved one exploit in-the-wild that affected Adobe Flash Player. In this blog, we\u2019re going to examine the technical details of the exploit that targeted vulnerability CVE-2015-8651. For more details on this vulnerability, see Adobe Security Bulletin APSB16-01. Note that Microsoft Edge on Windows 10 was protected from this attack due&#8230;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[10759,10378],"tags":[666],"class_list":["post-6324","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-security","tag-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/6324","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/comments?post=6324"}],"version-history":[{"count":0,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/6324\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/media?parent=6324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/categories?post=6324"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/tags?post=6324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}