Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions hook_network.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "config.h"
#include "misc.h"

#define NERR_Success 0

extern unsigned int dropped_count;
extern BOOL DumpRegion(PVOID Address);
extern void DebugOutput(_In_ LPCTSTR lpOutputString, ...);
Expand Down Expand Up @@ -994,9 +996,27 @@ HOOKDEF(ULONG, WINAPI, NetGetJoinInformation,
_Out_ DWORD * BufferType
) {
ULONG ret = Old_NetGetJoinInformation(lpServer, lpNameBuffer, BufferType);

LOQ_zero("network", "uuI", "Server", lpServer, "NetBIOSName", *lpNameBuffer, "JoinStatus", BufferType);

if (ret != 0 || ret == NULL)
LOQ_zero("network", "u", "Server", lpServer, "NetBIOSName");
return ret;
if (g_config.no_stealth)
{
LOQ_zero("network", "uuI", "Server", lpServer, "NetBIOSName", *lpNameBuffer, "JoinStatus", BufferType);
}
else
{
//Faking to be part of a domain in order to bypass some detections
LOQ_zero("network", "uuI", "Server", lpServer, "NetBIOSName", *lpNameBuffer, "JoinStatus", BufferType);
if (*BufferType !=3) {
*BufferType = 3;
LPWSTR fake_domain_name = L"myDomain";
DWORD net = NetApiBufferAllocate(sizeof(WCHAR) * wcslen((LPCWSTR)fake_domain_name), (LPVOID *)&fake_domain_name);
if(net == NERR_Success)
lpNameBuffer = &fake_domain_name;
else
*lpNameBuffer = *fake_domain_name;
}
Comment thread
cccs-mog marked this conversation as resolved.
}
return ret;
}

Expand Down
4 changes: 4 additions & 0 deletions hook_wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ void SpoofWmiData(const wchar_t* szClassName, const wchar_t* wszName, VARIANT* p
}
}
}
else if (pVal->vt == VT_BOOL) {
if ((!_wcsicmp(szClassName, L"Win32_ComputerSystem") && (!_wcsicmp(wszName, L"PartOfDomain"))))
pVal->boolVal = VARIANT_TRUE;
}
//
// Spoofery logic for NULL
//
Expand Down