Exploiting CVE-2011-2140 another flash player vulnerability

hello all .

before going future we are sorry to not update blog regularly, but it’s due to we are busy with stack of projects and also working on our expert training courses.

so as we didn’t post any blog post here we go with another flash player exploit we wrote long time ago.

 

1) Advisory information

 

  Title                   :  Adobe flash player memory overwrite exploit   Version             :  <= 10.3.186.3  Discovery         :  http://www.zerodayinitiative.com/advisories/ZDI-11-276/  Vendor             :  http://adobe.com

  Impact              :  Critical

  Contact            :   info  [at] abysssec.com

  Twitter             :   @abysssec

 

2) Vulnerability Information

 

Class        1- Stack OverwriteImpactSuccessfully exploiting this issue allows remote attackers to gain code execution on vulnerable system

Remotely Exploitable

Yes

Locally Exploitable

Yes

 

 

3) Vulnerabilities detail

 

1- Stack overwrite vulnerability

 

Before we go deep into the vulnerability for understanding this vulnerability you should take a look at MP4 format and H.264/AVC data structures.The actual vulnerability occurs during processing data units in Sequence Parameter Set in MP4. Sub_1005B396 function, is responsible for processing   Sequence Parameter Set. In this function pic_order_cnt_type from SPS will be check, if it’s equal with 1, other fields like data_pic_order_always_zero_flag , offset_for_non_ref_pic , offset_for_top_to_bottom_field  will be initialize :

.text:1005B396 sub_1005B396    proc near               ; CODE XREF: sub_1005B8DB+4Bp.text:1005B397                 push    ebp.text:1005B398                 push    esi.text:1005B399                 push    edi

.text:1005B39A                 mov     edi, ecx

.text:1005B39C                 call    sub_1005A95B

.text:1005B3A1                 mov     esi, [esp+10h+arg_0]

.text:1005B3A5                 mov     ecx, edi

.text:1005B3A7                 mov     [esi], al

 

 

.text:1005B47D                 mov     ecx, edi

.text:1005B47F                 mov     [esi+20h], eax

.text:1005B482                 call    sub_1005AA64

.text:1005B487                 mov     [esi+40h], eax

.text:1005B48A                 cmp     eax, ebp             à     if( pic_order_cnt_type )

.text:1005B48C                 jnz     short loc_1005B49D

 

 

.text:1005B49D loc_1005B49D:                           ; CODE XREF: sub_1005B396+F6j

.text:1005B49D                 xor     ebx, ebx

.text:1005B49F                 inc     ebx

.text:1005B4A0                 cmp     eax, ebx            à       if( pic_order_cnt_type == 1 )

.text:1005B4A2                 jnz     short loc_1005B4EF

.text:1005B4A4                 mov     ecx, edi

.text:1005B4A6                 call    sub_1005A99A    à       offset_for_top_to_bottom_field

.text:1005B4AB                 mov     ecx, edi

.text:1005B4AD                 mov     [esi+48h], al

.text:1005B4B0                 call    sub_1005AA93    à        offset_for_non_ref_pic

.text:1005B4B5                 mov     ecx, edi

.text:1005B4B7                 mov     [esi+54h], eax

.text:1005B4BA                 call    sub_1005AA93    à         offset_for_top_to_bottom_field

 

Then the num_ref_frames_in_pic_order_cnt_cycle will be set and if it’s bigger than 0 the values in offset_for_ref_frame will be copied into buffer.

text:1005B4BF                 mov     ecx, edi.text:1005B4C1                 mov     [esi+50h], eax.text:1005B4C4                call    sub_1005AA64      à    num_ref_frames_in_pic_order_cnt_cycle.text:1005B4C9                 mov     [esi+4Ch], eax

.text:1005B4CC                 test    eax, eax

.text:1005B4CE                 jbe     short loc_1005B4EF

.text:1005B4D0                 lea     eax, [esi+58h]

.text:1005B4D3                 mov     [esp+10h+arg_0], eax

.text:1005B4D7

.text:1005B4D7 loc_1005B4D7:                                             à         do{

.text:1005B4D7                 mov     ecx, edi

.text:1005B4D9                 call    sub_1005AA93                    à         offset_for_ref_frame[i]

.text:1005B4DE                 mov     ecx, [esp+10h+arg_0]

.text:1005B4E2                 add     [esp+10h+arg_0], 4            à          buf = &buf + 4

.text:1005B4E7                 inc     ebp                                      à          i++

.text:1005B4E8                 mov     [ecx], eax                           à          buf = offset_for_ref_frame[i]

.text:1005B4EA                 cmp     ebp, [esi+4Ch]

.text:1005B4ED                 jb      short loc_1005B4D7             à          } while(i < num_ref_frames_…)   

You should got the vulnerability at this point. There is no boundary check for num_ref_frames_in_pic_order_cnt_cycle, so our data related to  offset_for_ref_frame will be copy into the stack , that’s all .

 

 

2- Exploitation

Thanks to windows memory manager, browser and class of bug it’s not that hard to archive RCE. The only thing that should care about is return address. Because values which copied from MP4 file into stack, come with the changes. In other words, these values ​​after reading from file will be decode and then are copied into stack. Values ​​are copied into the buffer are generated from values in file into Signed Exp-Golomb code.After taking controll of EIP it’s easy to finish the job we used basic heap spray.

here is reliable exploit : CVE-2011-2140

happy hunting !

 

 

Microsoft Excel 2007 SP2 Buffer Overwrite Vulnerability BA / Exploit (MS11-021)

hello all

as we didn’t publish any exploit for a bit we just going to release.

1) Advisory information

Title : Microsoft Excel 2007 SP2 Buffer Overwrite Vulnerability

Vendor : http://www.microsoft.com
Impact : Critical
Contact : info [at] abysssec.com
Twitter : @abysssec

Microsoft :
A remote code execution vulnerability exists in the way that Microsoft Excel handles specially crafted Excel files.An attacker who successfully exploited this vulnerability could take complete control of an affected system. An attacker could then install programs; view, change, or delete data; or create new accounts with full user rights.

2) Vulnerability detail

each excel file can contain multiple BOF (2057) records . This record specifies the first substream associated with workbook.One of the fields in these records, specify substream recordd to come with. This field can be extracted from sub_3018F0C2 function.

.text:301A0C87 push [ebp+arg_2C]
.text:301A0C8A mov ecx, [ebp+var_14]
.text:301A0C8D push 1
.text:301A0C8F call sub_3018F0C2
.text:301A0C94 mov ecx, eax
.text:301A0C96 mov eax, [ebp+arg_24]
.text:301A0C99 cmp eax, ebx
.text:301A0C9B mov [ebp+var_10], ecx
.text:301A0C9E jz short loc_301A0CA2
.text:301A0CA0 mov [eax], ecx

If the field value is equal with 400, sub_3019DFBA function is called to check file type. if file type is xls EXCEL.exe will display a message If approved it will continue to run the code.if you change file extension to xlb there will be any message. After this step sub_3053F626 function will be executed. This function will parse the next BOF records.


.text:304D4E9D cmp [ebp+arg_20], ebx
.text:304D4EA0 jnz short loc_304D4EC6
.text:304D4EA2 test dword ptr word_30EDCF9C, 2000000h
.text:304D4EAC jnz short loc_304D4EC6
.text:304D4EAE mov edx, [ebp+arg_C]
.text:304D4EB1 mov ecx, [ebp+arg_8]
.text:304D4EB4 push 3Fh
.text:304D4EB6 call sub_3019DFBA
.text:304D4EBB cmp eax, ebx
.text:304D4EBD mov [ebp+var_8], eax
.text:304D4EC0 jz loc_304D4FD3
.text:304D4EC6
.text:304D4EC6 loc_304D4EC6: ; CODE XREF: sub_301A0BC7+3342D9j
.text:304D4EC6 ; sub_301A0BC7+3342E5j
.text:304D4EC6 push ebx
.text:304D4EC7 push dword_30EB89A4
.text:304D4ECD push [ebp+var_C]
.text:304D4ED0 call sub_3053F626
.text:304D4ED5 cmp dword_30F5E64C, ebx
.text:304D4EDB mov [ebp+var_8], eax
.text:304D4EDE jz short loc_304D4EE7
.text:304D4EE0 cmp eax, ebx
.text:304D4EE2 jz short loc_304D4EE7

one of records may come after BOF,is undocumented record which have record type equal to 0xA7 (167). for truly parsing this record should come with another record with 0x3C (60) record type. if it meet this requirement the length of records will be read and copied to the stack the function which operation of copying data records in the stack is sub_30199E55. This function takes three arguments .The first argument specifies the number of bytes to copy, which will read from file. The second argument specifies the destination of the copy and the third argument specifies the maximum amount of data can be copied. values of the second and third arguments based on the amount of computing reading from file and into this cumpoting,computational error which may occur here …


.text:3053F830 call sub_301A0A01
.text:3053F835 cmp eax, 3Ch
.text:3053F838 mov [ebp+var_ED4], eax
.text:3053F83E jnz loc_30540488
.text:3053F844 call sub_301A0A01
.text:3053F849 mov ecx, [ebp+var_EDC]
.text:3053F84F imul ecx, [ebp+var_F00]
.text:3053F856 mov edi, eax
.text:3053F858 mov eax, [ebp+var_EE0]
.text:3053F85E lea ebx, [ecx+eax+3]
.text:3053F862 call sub_301A0ABE
.text:3053F867 push 0FFFFFFFDh
.text:3053F869 pop edx
.text:3053F86A sub edx, ecx
.text:3053F86C add eax, edx
.text:3053F86E push eax ; Dst
.text:3053F86F push ebx ; int
.text:3053F870 mov eax, edi
.text:3053F872 call sub_30199E55

the vulnerability that exists here is that we can change the value of parameter 3 whith our own values. program will not correcly controll third argument of sub_30199E55 this and can result in the desired amount and location of desired data can overwrite in the stack.


.text:30199E60 cmp edi, [esp+4+Dst]
.text:30199E64 ja loc_303EE1B7
.text:30199E6A mov ecx, [esp+4+arg_0]
.text:30199E6E push ebx
.text:30199E6F mov ebx, dword_30F726C0
.text:30199E75 push ebp
.text:30199E76 mov ebp, nNumberOfBytesToRead
.text:30199E7C push esi
.text:30199E7D mov [esp+10h+Dst], ecx
....
.text:30199E93 mov eax, [esp+10h+Dst]
.text:30199E97 push esi ; Size
.text:30199E98 lea edx, dword_30F6E6B8[ebx]
.text:30199E9E push edx ; Src
.text:30199E9F push eax ; Dst
.text:30199EA0 sub edi, esi
.text:30199EA2 call memcpy
.text:30199EA7 add [esp+1Ch+Dst], esi
.text:30199EAB add ebx, esi
.text:30199EAD add esp, 0Ch
.text:30199EB0 test edi, edi
.text:30199EB2 mov dword_30F726C0, ebx
.text:30199EB8 jnz loc_301E0DB3

3) Exploitation :

Stack overflows are not hard to exploit at all ! but as we have both /GS , SAFESEH here. because given that we are destined to memcpy we can change it so that it begins to overwrite the stack after GS. and from there when the return comes , our values contained in the ESP and we can call it with simple call esp and game is over !!!

 

download full exploit source  : MS11-021

Happy Hacking .

 

 

 

 

 

 

 

bypassing all anti-virus in the world (Good Bye Detection , Hello Infection)

hello to all readers

Introduction

as  you may read in @abysssec in twitter  actually in past a few months we did a cool research on bypassing anti-viruses and got really great result .

Bypassing anti-viruses is not a new topic and it’s still about encrypting / decrypting  of a program to being hide from AV eyes. In past it was really, really easy task to do but AV’s getting smarter and bypassing all anti-viruses with some really unique methods that each of them use is not funny and neither easy to do.

before i go feature i like to have a simple glossary for unfamiliar readers.

Glossary

Crypter : the program (mostly GUI) will crypt the malware / bot to make it hide from anti-viruses

Stub : the Decryptor of crypted program

FUD : Fully Un Detectable (FUD = no AV detect)

RUNPE : run the PE without headers in memory

USG : unique stub generator. (make unique stubs)

Binder: will join two file will drop in hdd or mem

Pumper: will increase size of tool

EOF  : end of file(in crypter it need to preserve)

Cloner : will clone the file (Decryptor like in HDD)

Icon Changer: will change the final exe icon

well there are two also different kind of crypters scan time and run time. The good crypter is run time one because as it name says the scan time crypter is just FUD at scan time and when you run it and after real malware decrypted  it will be detect  so not that useful. And the real crypter is the runtime one.

How it works ?

if we remove all complex technical info for bypassing all 35 anti-virus around the world it works really sample.

 

it simply encrypt  program, decrypt, and  then run it in memory. encryption algorithm is not important and sample ideas are enough to make a crypter fud

but some of mostly used alghortims are :

I. RC4
II. AES
III.DES
IV. TEA
V. XOR
VI. CryptoAPI
VII. blowfish
note that there is important part in your job and that is run the malware safely in memory after decrypting it , and this is done by RunPE . the idea of RunPE comes from great PoC by Tan Chew Keong called dynamic forking of win32 exe : http://www.security.org.sg/code/loadexe.html

steps and idea are really sample :

CreateProcess

Find Base address

Virtualalloc

Align sections

Fix thread context

Resume thread

but this is not easy to hide this kind of API chaining from anti-viruses .

so we finished our research by writing a new fud crypter and our crypter is unique and different with public ones .

our crypter is unique and can bypass all 35 exist av right now .

here is list of AV we fully tested our crypters on them .

 - Ad-Aware
 - AhnLab V3 Internet Security
 - ArcaVir
 - Avast
 - Avast 5
 - AVG Free
 - AntiVir (Avira)
 - BitDefender
 - BullGuard
 - VirusBuster Internet Security
 - Clam Antivirus
 - COMODO Internet Security
 - Dr.Web
 - eTrust-Vet
 - F-PROT Antivirus
 - F-Secure Internet Security
 - G Data
 - IKARUS Security
 - Kaspersky Antivirus
 - McAfee
 - MS Security Essentials
 - ESET NOD32
 - Norman
 - Norton Antivirus
 - Panda Security
 - A-Squared
 - Quick Heal Antivirus
 - Rising Antivirus
 - Solo Antivirus
 - Sophos
 - Trend Micro Internet Security
 - VBA32 Antivirus
 - Vexira Antivirus
 - Webroot Internet Security
 - Zoner AntiVirus

we even tested 10 year ago malware and our crypter can hide them from any anti-virus system .

our crypter comes with some unique features here is some of them

 

 - FUD 0 / 35 detection
 - EOF support
 - Coded in C/ASM Stub and GUI In C#
 - Compatible with Win 2k/XP/7 x32 and x64
 - Ability of bypassing heuristic and emulators (Kaspersky pro-acvtive defense , Nod32 advanced heuristic , Norton Sonar, Avira heuristic)
 - Command line support
 - Unicode support (chines , russian and so on)
 - Right-to-Left Exploit after crypting you can have .mp3 , doc , pdf , avi or anything as output !!!
 - inbuilt scanner and scanning with 35 anti-virus after cryptring
 - advanced file binder with drop in disk and memory
 - Anti-debug
 - Anti-sandbox
 - advanced encryption : Double XOR , RC4, AES256
 - Advanced resource storage : unique method

here is some screen shot of GUI :

 

 

 

 

 

 

and finally you can see the actual work in a demo here :

http://abysssec.com/files/VampCrypt.rar

as we don’t want harm anyone if you are :

- penetration testing company

- anti virus / IDS company

- any legit company who needs it

” please note that WE DON”T give tool / technology to PERSON . ONLY VERIFIED COMPANY ”  

contact : info [at] abysssec.com

and as always you can follow @abysssec in twitter

happy fudding .

Exploit for CVE-2011-0222 Safari SVG Vulnerability

Hello all again

we are here with a patched vuln again and this time apple safari one .

 

 

actually it’s not that really odd to see your 0day got patched in vendor big patches and this time this happened to US too.

our safari vulnerability got patched and we decide to public our windows exploit + stand alone trigger without any pop up and finally a simple ROP to DEP bypass .

no more explanation this time check out exploit code.

http://www.abysssec.com/files/CVE-2011-0222_WinXP_Exploit.zip

http://www.exploit-db.com/sploits/CVE-2011-0222_WinXP_Exploit.zip

as always feel free to contact us : info [at] abysssec.com

follow @twitter for updates

 

cheers

 

Analysis of CVE-2011-0041 vulnerability in GDI+

Abysssec Research

we tried for other case in exploit bounty this time for a 500$ one .

no luck for successful exploitation and to be honest we didn’t tried so hard . at least we got a PoC and here is our analysis for this cool bug.

1) Advisory information

 

  Title                   :  GDI+ CreateDashedPath Integer overflow in gdiplus.dll  

  Discovery         :  Nicolas july from vupen

  Analysis            :  Abysssec.com

  Vendor             :  http://www.microsoft.com

  Impact              :  High

  Contact            :  info  [at] abysssec.com

  Twitter             : @abysssec

  CVE                   : CVE-2011-0041

2) Vulnerable version

Gdiplus.dll 5.2.6001.22319

 

3) Vulnerability information

 

Class

        1-Integer overflow

Impact

Successfully exploiting this issue allows remote attackers to execute arbitrary code in the context of vulnerable application or cause denial-of-service conditions.

Remotely Exploitable

Yes

Locally Exploitable

Yes

4) Vulnerabilities detail

 

The vulnerability exists in gdiplus!GpPath::CreateDashedPath function of gdiplus.dll that is responsible for bitmap drawing and other 2d graphic rendering. EMF+ file is one of the image file format that is rendered by the library. And the vulnerability is based on some floating point calculation of an EMF+ path object.

We made the following proof of concept to trigger the issues and it will be explained more:

 

A little taste of file format we simply put a EMF_COMMENT record (id = 0×00000046) and embed and emf+ geraphic object ( id = 0×00004008 ) . For simplicity we ripped out a valid graphic object from another file and started to play with it. The record have two important area that we highlighted them in the above picture.

 

Here is the faulty code:

.text:4ECFCBAD loc_4ECFCBAD:                     

.text:4ECFCBAD                 mov     eax, esi

.text:4ECFCBAF                 shl     eax, 3

.text:4ECFCBB2                 cmp     [ebp+lpMem], 0

.text:4ECFCBB6                 push    eax             ; dwBytes

.text:4ECFCBB7                 jz      short loc_4ECFCBCE

.text:4ECFCBB9                 push    [ebp+lpMem]     ; lpMem

.text:4ECFCBBC                 call    GpRealloc(x,x)

.text:4ECFCBC1                 test    eax, eax

.text:4ECFCBC3                 jz      loc_4ECFCCDB

.text:4ECFCBC9                 mov     [ebp+lpMem], eax

.text:4ECFCBCC                 jmp     short loc_4ECFCBDE

.text:4ECFCBCE ; —————————————————————————

.text:4ECFCBCE

.text:4ECFCBCE loc_4ECFCBCE:                      

.text:4ECFCBCE                 call    GpMalloc(x)

.text:4ECFCBD3                 test    eax, eax

.text:4ECFCBD5                 mov     [ebp+lpMem], eax

.text:4ECFCBD8                 jz      loc_4ECFCCDB

 

The above code uses the eax register as arguments to the GpMalloc function. GpMalloc is simply a gdi version of heapAlloc function. The value of eax register is based on various floating point calculation that is not simple to examine at first look.

But I traced the value of eax register and it seems the calculations are based on our values mentioned earlear in the file.  And it doesn’t bound checked well, by changing the path value tricky it is possible when the “shl    eax, 3” instruction multiply the value by 8 we get an integer overflow and in turn a faulty heap allocation.

 

I dynamically traced the values with my proof of concept file. Eax register is equall to eax + [ebp-38] * 10 and as there are a lot of values and calculations before that, for better consideration I made the following diagram:

 

 

 

 

It took a lot of time explanation of all of the variables above but, the important one is the GpPath object that is in the code a clone of the object is made to later be manipulated for drawings.

.text:4ECFC9D9 loc_4ECFC9D9:                           ; CODE XREF: GpPath::CreateDashedPath(DpPen const *,GpMatrix const *,float,float,float,int)+1AAj

.text:4ECFC9D9                 fld     dword ptr [esi+eax*4]

.text:4ECFC9DC                 fmul    [ebp+arg_0]

.text:4ECFC9DF                 fstp    dword ptr [esi+eax*4]

.text:4ECFC9E2                 inc     eax

.text:4ECFC9E3                 cmp     eax, [ebp+arg_4]

.text:4ECFC9E6                 jl      short loc_4ECFC9D9

.text:4ECFC9E8

.text:4ECFC9E8 loc_4ECFC9E8:                      

.text:4ECFC9E8                 mov     ecx, [ebp+var_18] ; Src

.text:4ECFC9EB                 call    GpPath::Clone(void)

.text:4ECFC9F0                 mov     edi, eax

.text:4ECFC9F2                 test    edi, edi

.text:4ECFC9F4                 jz      loc_4ECFCDBA

.text:4ECFC9FA                 mov     eax, [edi]

.text:4ECFC9FC                 mov     ecx, edi

.text:4ECFC9FE                 call    dword ptr [eax+4]

 

After calling the clone, it checks whether it is a valid clone or not at address 4ECFC9FE.

The offset +34h of the object contains a pointer to our 4byte path object values.

0:000> dd ecx

0e03ca50  4ec67e58 68745031 00000000 00000000

0e03ca60  0e03ca74 0e03ca74 00000010 00000010

0e03ca70  00000002 00000100 00000000 00000000

0e03ca80  00000000 0e03ca98 0e03ca98 00000010

0e03ca90  00000010 00000002 449a8eab 458ac500

0e03caa0  449a8eab 4e0000fe 00000000 00000000

0e03cab0  00000000 00000000 00000000 00000000

0e03cac0  00000000 00000000 00000000 00000000

 

Our floating point values in the file format:

0e03ca98  449a8eab 458ac500 449a8eab 4e0000fe

0e03caa8  00000000 00000000 00000000 00000000

 

But there are some modifications on our values before we get the faulty code. First after the clone is performed GpPath::Flatten function made some changes to our values based on a transform matrix in the file. So this is cause of the highlighted 6 DWORDs in the file.­­­

.text:4ECFC9FE                 call    dword ptr [eax+4]

.text:4ECFCA01                 test    eax, eax

.text:4ECFCA03                 jz      loc_4ECFCDBA

.text:4ECFCA09                 fld     ds:flt_4ECB80FC

.text:4ECFCA0F                 push    ecx             ; float

.text:4ECFCA10                 lea     eax, [ebp+var_F8]

.text:4ECFCA16                 fstp    [esp+108h+var_108]

.text:4ECFCA19                 push    eax             ; int

.text:4ECFCA1A                 mov     ecx, edi

.text:4ECFCA1C                 call    GpPath::Flatten(GpMatrix const *,float)

.text:4ECFCA21                 cmp     [ebp+var_2C], 0

 

Flattened GpPath object values:

0:000> dd poi(edi+34)

0e03cd18  449a7eab 458ac100 449a7eab 4e0000fd

0e03cd28  00000000 00000000 00000000 00000000

 

And after that our changed GpPath object is sent to calculateGradiantArray and some array of floating point values are made based on its calculation.

There are many other default floating point values has effects on the value of the overflowing size for GpMalloc that are not so interesting and I’ve just shown them on the diagram.

After the calculation integer wrapped, the heap allocated by the gpMalloc function is not big enough to hold our data. So in next uses of the wrapped allocated heap the corruption occurs. But it seems there is not a straight way of exploiting such heap corruptions using a standalone file. .

PoC link   : http://abysssec.com/files/GDI_PoC.zip

			

DEP/ASLR bypass using 3rd party + Clarification

hello again to all of our great readers .

is this post we are going to do some clarification also share and drop some random 0day DEP/ASLR bypass using 3rd parties .

due to there is lots of things to say we wrote all the notes as an article called “The Arashi”.

 

Table of content :

===============================================================

Introduction and warning

The Story of Sayonara

First Method: ASLR Bitter

Second Method: Process Explorer

Narly Windbg Extension

Mona / PVEFindAddr

Ropping this fun DLL

First 0day tatsumaki

Second (half) 0day Ikazuchi

Third 0day Sugokunai

Final Note

===============================================================

and finally  here you can download it from  : here

note that the offer in paper will be expire in 10 day so if you are verified and need one of modules let us know .

as always feel free to contact us : info [at] abysssec.com

and also follow @abysssec in twitter

 

Exploiting Adobe Flash Player on Windows 7

Hello again . as a lot of readers like windows 7 exploits here is other one .

1) Advisory information

Title                   : Adobe Flash player Action script type confusion  

Version             :  flash10h.dll

Discovery         :  Malware writers

Exploit              :  www.abysssec.com

Vendor             :  http://www.adobe.com

Impact              :  Critical

Contact            :   info  [at] abysssec.com

Twitter            : @abysssec

CVE                    : CVE-2010-3654

2) Vulnerable version

Adobe Flash Player 10.1.53 .64 prior versions

3) Vulnerability information

 

Class 

1- Type Confusion

Impact

Successfully exploiting this issue allows remote attackers to execute code under the context of targeted browser.

Remotely Exploitable

Yes

Locally Exploitable

Yes

4) Vulnerability detail

Here we have type confusion vulnerability in ActionScript bytecode language. The cause of these vulnerabilities is because of implementation of verification process in AS3 jit engine that because of some miscalculation in verifying datatype atoms, some data replaces another type of data and the confusion results in faulty machine code.

Action script has the following structure. First our scripts are compiled using an action script compiler like flex to AS3 ByteCodes and embed it to DoABC, DoAction or DoInitAction tags in swf file format. When flash player opens the swf file, bytecodes are compiled to a jitted machine code through verification and generation process. Verification process is responsible for checking bytecodes to be valid instructions and it pass the valid bytecodes to generation process, thus generation process produces the machine code in memory.

According to Dion Blazakis’s JIT Spray paper:

 

To handle this runtime typing requirement, the ActionScript interpreter represents internal objects using tagged pointers – internal, this object is called an “atom”. Tagged pointers are a common implementation technique to differentiate between those objects stored by value and those stored by reference using the same word sized memory cell. A tagged pointer stores type information in the least significant bits and stores a type specific values in the most significant bits. As shown in Illustration 1, the ActionScript atom is 32 bits wide; it allocates 3 bits to store the type information and uses 29 bits for the value.

So if it would be possible to confuse verifier too act an atom as another atom by some bytecode changes it would be possible to generate faulty code that most of the times lead to disclosing a vtable pointer call to the attacker.

The bug is perfectly presented in Haifei li recent slides. We have OriginalClass and RefClass with the same functions. Func1 – OriginalClass return a class objects, but Func1 – RefClass returns another type. By changing a byte in the bytecode we have confused AS3 to execute RefClass functions in the main class. After that verifier confuses the return type of the function with an OriginalClass object and generate faulty code with the vtable under the control of the return value.

 

Exploitation:

For exploitation purpose on recent protections on windows 7 without any 3rd party, it is possible to use the same bug many times to leak the imageBase address and payload address. In our exploit we used three confusion to read String Objects address and accordingly imagebase address.

Step1: read shellcode string object pointer by confusing it with uint and use it to leak ImageBase.

Step2: leak address of the shellcode with the same pointer and NewNumber trick.

Step3: send imageBase & shellcode address as parameters to the RopPayload function, develop Rop payload string and again confuse the return value with uint to read address of RopPayload string.

Step4: send address of the rop payload as parameters to the last confused function that confuses string type with class object. And thus address of our rop payload will be used as vtable in the fake class object.

Note: In using strings as a buffer for shellcode in action script, it is important to use alphanumeric characters because the toString method converts our ascii character set to uincode thus make our shellcode unusable.

5) Conclusion

Finally we got the point that memory leakages are extremely useful in modern exploitation to bypass DEP, ASLR protections. It would be possible to find same atom confusion situation and other object leakage in adobe flash player. Kudos to haifei li for his great research, although it was not that simple to implement a reliable exploit with just slides without attending in talk.

6) Refrences

http://www.cansecwest.com/csw11/Flash_ActionScript.ppt

http://www.semantiscope.com/research/BHDC2010/BHDC-2010-Paper.pdf

7) Exploit-Code

Here you can get our reliable exploit against windows 7 :

calc.exe payload

Download : CVE-2010-3654_Win7

if you need other payloads for sure you know how to change it ;)

as always feedbacks are welcomed and you can follow @abysssec in twitter to getting updates .

Happy Hunting !

Hacking / Exploiting / Cheating in Online Games

Hello to all readers.

we know that there are thousands and millions of online game players around and we guess lots of them may like to cheat this is our totally offensive research that we did to present in immunity infiltrate and as we missed that so here we go .

 

This research is about hacking /exploiting / cheating in online games and is sponsored by immunity.

 

This is a six part talk and contains:

 

Part I   : introduction

Part II: Hacking Online Game Servers

Part III: Exploiting Online Games

Part IV: Cheating in Online games

Part V   : Creating your own cheats

Part VI: Bypassing anti-cheat engines

 

Real world cheating is mainly focused on in this talk as it’s fun and legal.
During this talk we will have a tour into all the ways to manipulate an online game
and we will end up with bypassing the latest anti-cheating technologies and
manipulating the game to our heart’s desire.

 

Our case studies are:

 

1 -counter strike (half-life) as game:

 

2- SXE-Injected and Valve-anti cheat (VAC) as anti-cheat engines

Our codes will be release soon as soon we can but if you are hurry to use some cheats you can find almost all necessary codes in slides also there is two demos for proofing our research. We really enjoyed this research and it’s done from our side hope you enjoy too.

 

You can download slides here:

ppt : Exploiting-Online-Games

Font : in case if you have problem with embedded one

PDF : Exploiting-Online-Games

PS 1 : video demos are ready but due to those are huge we need to find a better way to compress them after that we will post them here.

PS 2 : Tools will be release after a while .

For getting updates about tools / videos please follow @abysssec in twitter.

 

For any question please contact:

 

Shahin [at] abysssec.com

 

For any other requirement please contact:

 

Info [at] abysssec.com

 

Kind Regards

 

Exploiting Internet Explorer 8 on Windows 7

hello all.

Our Demo is clear enough. maybe we release some more detail’s later.

embedded by Embedded Video

good luck

Adobe Shockwave player rcsL chunk memory corruption 0day

1) Advisory information

Title                   :  Adobe Shockwave player rcsL chunk memory corruption

Version             : Shockwave player 11.5.8.612

Discovery         :  http://www.abysssec.com

Vendor             :  http://www.adobe.com

Impact              :  Critical

Contact            :  shahin [at] abysssec.com , info  [at] abysssec.com

Twitter             : @abysssec

CVE                   :  ZeroDay Not Patched

2) Vulnerable version

Shockwave Player 11.5.8.612 last version

3) Vulnerability information

Class

1- Memory corruption allow command execute

Impact

Successfully exploiting this issue allows remote attackers to execute arbitrary code or cause denial-of-service conditions.

Remotely Exploitable

Yes

Locally Exploitable

Yes

4) Vulnerabilities detail

Introduction

Shockwave player is a plug in for loading Adobe Director video files in to the browser. Director movies have DIR or compressed format of DCR.  DIR file format is based on RIFF based formats. RIFF formats start with a 4byte RIFX identifier and length of the file. And subsequently chunks come together with format of 4byte chunk identifier + size of chunk + data. Some of the chunk identifiers are tSAC, pami, rcsL.

By help of our simple fuzzer we have manipulated a director movie file and found a vulnerability in part of an existing rcsL chunk.

Vulnerability explanation

There is a 4bytes value in the undocumented rcsL chunk in our sample director movie and it may be possible to find similar rcsL chunks in other director samples. The 4bytes so called value can be manipulated to reach the vulnerable part of function 68122990. Here is the function:

.text:68122990 sub_68122990    proc near               ; CODE XREF: sub_68112120+1A57p

.text:68122990                                         ; DATA XREF: sub_68122F30+4AAo

.text:68122990

.text:68122990 var_8           = dword ptr -8

.text:68122990 var_4           = dword ptr -4

.text:68122990 arg_0           = dword ptr  4

.text:68122990 arg_4           = dword ptr  8

.text:68122990

.text:68122990                 sub     esp, 8

.text:68122993                 mov     eax, [esp+8+arg_4]

.text:68122997                 push    ebx

.text:68122998                 push    ebp

.text:68122999                 push    esi

.text:6812299A                 mov     esi, [esp+14h+arg_0]

.text:6812299E                 push    edi

.text:6812299F                 push    eax

.text:681229A0                 push    esi

.text:681229A1                 call    sub_680FC6D0

.text:681229A6                 mov     ecx, [esi+18h]

.text:681229A9                 mov     edx, [esi+10h]

.text:681229AC                 mov     ebp, [esi+1Ch]

.text:681229AF                 mov     ebx, [esi+20h]

.text:681229B2                 add     ecx, 0FFFFFFF8h

.text:681229B5                 cmp     ebp, 3

.text:681229B8                 mov     [esp+18h+arg_0], eax

.text:681229BC                 mov     [esi+18h], ecx

.text:681229BF                 mov     eax, [edx]

.text:681229C1                 mov     edx, [eax+ecx]

.text:681229C4                 lea     edi, [esi+1Ch]

.text:681229C7                 mov     [edi], edx

.text:681229C9                 mov     eax, [eax+ecx+4]

.text:681229CD                 mov     [edi+4], eax

.text:681229D0                 mov     [esp+18h+var_8], 4

.text:681229D8                 mov     [esp+18h+var_4], 0

.text:681229E0                 jz      short loc_681229F6

.text:681229E2                 push    ebx

.text:681229E3                 push    ebp

.text:681229E4                 push    0Ch

.text:681229E6                 push    esi

.text:681229E7                 call    sub_680FCFB0

.text:681229EC                 pop     edi

.text:681229ED                 pop     esi

.text:681229EE                 pop     ebp

.text:681229EF                 pop     ebx

.text:681229F0                 add     esp, 8

.text:681229F3                 retn    8

.text:681229F6 ; —————————————————————————

.text:681229F6

.text:681229F6 loc_681229F6:                           ; CODE XREF: sub_68122990+50j

.text:681229F6                 mov     ecx, [ebx]

.text:681229F8                 mov     edx, [ecx]

.text:681229FA                 mov     ecx, [esp+18h+arg_0]

.text:681229FE                 lea     eax, [esp+18h+var_8]

.text:68122A02                 push    eax

.text:68122A03                 push    ecx

.text:68122A04                 push    ebx

.text:68122A05                 push    esi

.text:68122A06                 call    dword ptr [edx+2Ch]

.text:68122A09                 mov     ecx, [esi+7Ch]

.text:68122A0C                 test    ecx, ecx

.text:68122A0E                 jz      short loc_68122A22

.text:68122A10                 push    ebx

.text:68122A11                 push    ebp

.text:68122A12                 push    esi

.text:68122A13                 call    sub_680FC730

.text:68122A18                 pop     edi

.text:68122A19                 pop     esi

.text:68122A1A                 pop     ebp

.text:68122A1B                 pop     ebx

.text:68122A1C                 add     esp, 8

.text:68122A1F                 retn    8

.text:68122A22 ; —————————————————————————

.text:68122A22

.text:68122A22 loc_68122A22:                           ; CODE XREF: sub_68122990+7Ej

.text:68122A22                 test    eax, eax

.text:68122A24                 jnz     loc_68122AAC

.text:68122A2A                 push    esi

.text:68122A2B                 call    sub_680FD9D0

.text:68122A30                 push    edi

.text:68122A31                 push    esi

.text:68122A32                 mov     [edi], ebp

.text:68122A34                 mov     [edi+4], ebx

.text:68122A37                 call    sub_680FC7C0

.text:68122A3C                 push    esi

.text:68122A3D                 call    sub_680FD9D0

.text:68122A42                 mov     eax, [esp+18h+arg_4]

.text:68122A46                 mov     edx, [esi+28h]

.text:68122A49                 mov     [esi+0A4h], eax

.text:68122A4F                 mov     dword ptr [esi+20h], 80000001h

.text:68122A56                 mov     ecx, [edx]

.text:68122A58                 lea     eax, [eax+eax*2]

.text:68122A5B                 push    esi

.text:68122A5C                 call    dword ptr [ecx+eax*8+20h]

.text:68122A60                 mov     eax, [esi+7Ch]

.text:68122A63                 test    eax, eax

.text:68122A65                 jz      short loc_68122A85

.text:68122A67                 cmp     eax, 4

.text:68122A6A                 jnz     short loc_68122ACE

.text:68122A6C                 mov     edx, [esp+18h+arg_0]

.text:68122A70                 push    edx

.text:68122A71                 push    8

.text:68122A73                 push    37h

.text:68122A75                 push    esi

.text:68122A76                 call    sub_680FD040

.text:68122A7B                 pop     edi

.text:68122A7C                 pop     esi

.text:68122A7D                 pop     ebp

.text:68122A7E                 pop     ebx

.text:68122A7F                 add     esp, 8

.text:68122A82                 retn    8

.text:68122A85 ; —————————————————————————

.text:68122A85

.text:68122A85 loc_68122A85:                           ; CODE XREF: sub_68122990+D5j

.text:68122A85                 mov     eax, [edi]

.text:68122A87                 mov     ecx, [edi+4]

.text:68122A8A                 mov     edx, [esi+10h]

.text:68122A8D                 mov     [esp+18h+var_8], eax

.text:68122A91                 mov     eax, [esi+18h]

.text:68122A94                 add     eax, 0FFFFFFF8h

.text:68122A97                 mov     [esp+18h+var_4], ecx

.text:68122A9B                 mov     [esi+18h], eax

.text:68122A9E                 mov     ecx, [edx]

.text:68122AA0                 mov     edx, [ecx+eax]

.text:68122AA3                 mov     [edi], edx

.text:68122AA5                 mov     eax, [ecx+eax+4]

.text:68122AA9                 mov     [edi+4], eax

.text:68122AAC

.text:68122AAC loc_68122AAC:                           ; CODE XREF: sub_68122990+94j

.text:68122AAC                 push    ebx

.text:68122AAD                 push    ebp

.text:68122AAE                 push    esi

.text:68122AAF                 call    sub_680FC730

.text:68122AB4                 mov     eax, [esi+7Ch]

.text:68122AB7                 test    eax, eax

.text:68122AB9                 jnz     short loc_68122ACE

.text:68122ABB                 push    esi

.text:68122ABC                 call    sub_680FD9D0

.text:68122AC1                 mov     ecx, [esp+18h+var_8]

.text:68122AC5                 mov     edx, [esp+18h+var_4]

.text:68122AC9                 mov     [edi], ecx

.text:68122ACB                 mov     [edi+4], edx

.text:68122ACE

.text:68122ACE loc_68122ACE:                           ; CODE XREF: sub_68122990+DAj

.text:68122ACE                                         ; sub_68122990+129j

.text:68122ACE                 pop     edi

.text:68122ACF                 pop     esi

.text:68122AD0                 pop     ebp

.text:68122AD1                 pop     ebx

.text:68122AD2                 add     esp, 8

.text:68122AD5                 retn    8

.text:68122AD5 sub_68122990    endp

In the above function we have direct control on the second argument of the function. By manipulating the argument in rcsL chunk we reach to an indirect call that is based on our arguments:

.text:68122A42                 mov     eax, [esp+18h+arg_4]

.text:68122A46                 mov     edx, [esi+28h]

.text:68122A49                 mov     [esi+0A4h], eax

.text:68122A4F                 mov     dword ptr [esi+20h], 80000001h

.text:68122A56                 mov     ecx, [edx]

.text:68122A58                 lea     eax, [eax+eax*2]

.text:68122A5B                 push    esi

.text:68122A5C                 call    dword ptr [ecx+eax*8+20h]

The above code is our vulnerable part. EAX register is set with second argument that we have control on it and ESI is first argument of the function and is a pointer to a dynamic allocated structure in heap. Value of offset 28h of the structure that is unknown is set in ECX register and finally an indirect call to the ‘ECX+EAX*24+20h’ is done. Because result of EAX*24 is a large value and we have complete control on EAX register we can almost control first byte of our indirect call pointer without the need of ECX register.

Exploitation :

For exploitation purpose because we don’t have a fixed address in our call we cannot control the execution flow to an exact value but we can jump to a specific range because we have control on first bytes of the pointer of indirect call. So here by abusing javascript we can use old-school heap spray technic to fill memory with nops+shellcode and call to this range.

To control the 4 bytes EAX register in our exploit we manipulated 4bytes at offset 4C4B of the file to value FFF00267.

An important hint here is that because we call the indirect pointer the EIP is set to nops itself. As you know an EIP of 90909090 is invalid. But we can use other opcodes as nopslides that doesn’t have any effect. In our test sample we used 0a0a0a0a as both base range of heap spray and nopslides because 0a0a opcode is an OR instruction on some unimportant registers.

The sample + exploit are tested on patched windows XP service pack 3.

here is exploit + binary analysis link:

http://abysssec.com/files/Adobe_Shockwave_Director_rcsL_Chunk_Memory_Corruption.zip

Proof Video : Here

PS 1 : this vulnerability is not patched bug released by ZDI http://www.zerodayinitiative.com/advisories/ZDI-10-162/

PS 2 : it’s possible to exploit this vulnerability on modern windows like Vista/7 too and it’s up to readers …

related links:

http://www.vupen.com/english/advisories/2010/2752

http://secunia.com/advisories/41932

CVE-2010-3653

http://www.adobe.com/products/player_census/shockwaveplayer/

http://www.adobe.com/support/security/advisories/apsa10-04.html

Happy Hacking !

Get Adobe Flash playerPlugin by wpburn.com wordpress themes