Skip to content

Commit

Permalink
Build 0.7.1 / 5.48.5
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidXanatos committed Feb 21, 2021
1 parent 538bbff commit 96b7d46
Show file tree
Hide file tree
Showing 54 changed files with 5,474 additions and 4,193 deletions.
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,36 @@ This project adheres to [Semantic Versioning](http://semver.org/).





## [0.7.1 / 5.48.5] - 2021-02-21

### Added
- Enchanced RpcMgmtSetComTimeout handing with "UseRpcMgmtSetComTimeout=some.dll,n"
-- this option allows to specify for each individual dll if RpcMgmtSetComTimeout should be used or not
-- this setting takes precedence over hard coded and per process presets
-- "UseRpcMgmtSetComTimeout=some.dll" and "UseRpcMgmtSetComTimeout=some.dll,y" are equivalent
- Added "FakeAdminRights=y" option that makes processes in a given box think thay have admin permissions
-- this option is recomended to be used in combination with "DropAdminRights=y" to improve securits
-- With "FakeAdminRights=y" and "DropAdminRights=y" installers should still work
- added RPC support for SSDP API (the Simple Service Discovery Protocol), Enable with "OpenUPnP=y"


### Changed
- SbieCrypto no longer triggers message 1313
- changed enum process API now more (no limit) than 511 proceses per box can be enumerated
- Reorganized box settings a bit
- Made COM tracing more verbose
- "RpcMgmtSetComTimeout=y" is now again the default behavioure, seams to cause less issues overall

### Fixed
- fixed issues with webcam access when the DevCMApi filtering is in place
- fixed issue with free download manager for 'AppXDeploymentClient.dll' RpcMgmtSetComTimeout=y is used
- fixed not all WinRM files were blocked by the driver, with "BlockWinRM=n" this file block can be disabled




## [0.7.0 / 5.48.0] - 2021-02-14

### Added
Expand All @@ -27,6 +57,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Fixed
- FIXED SECURITY ISSUE: elevated sandboxed processes could access volumes/disks for reading (thanks hg421)
-- this protection option can be disabled by using "AllowRawDiskRead=y"
- fixed crash issue around SetCurrentProcessExplicitAppUserModelID observed with GoogleUpdate.exe
- fixed issue with resource monitor sort by timestamp
- FIXED SECURITY ISSUE: a race condition in the driver allowed to obtain an elevated rights handle to a process (thanks typpos)
Expand Down
2 changes: 2 additions & 0 deletions Sandboxie/apps/com/BITS/bits.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ int __stdcall WinMain(
BOOL hook_success = TRUE;
BOOL ok;

Check_Windows_7();

SetupExceptionHandler();

HOOK_WIN32(CoImpersonateClient);
Expand Down
40 changes: 40 additions & 0 deletions Sandboxie/apps/com/Crypto/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const WCHAR *ServiceTitle = SANDBOXIE L" Crypto";


static ULONG_PTR __sys_DuplicateHandle = 0;
static ULONG_PTR __sys_CreateFileW = 0;


//---------------------------------------------------------------------------
Expand Down Expand Up @@ -126,6 +127,41 @@ ALIGNED BOOL my_DuplicateHandle(
}


//---------------------------------------------------------------------------
// my_CreateFileW
//---------------------------------------------------------------------------

ALIGNED HANDLE my_CreateFileW(
LPCWSTR lpFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,
HANDLE hTemplateFile)
{
typedef HANDLE(*P_CreateFileW)(
LPCWSTR lpFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,
HANDLE hTemplateFile);

//
// prevent SBIE1313, dont even try to access the block devcie for raw reading
//

if (_wcsnicmp(lpFileName, L"\\\\.\\PhysicalDrive", 17) == 0 && wcschr(lpFileName + 17, L'\\') == NULL) {
if (dwDesiredAccess == GENERIC_READ)
dwDesiredAccess = 0;
}

return ((P_CreateFileW)__sys_CreateFileW)(lpFileName, dwDesiredAccess, dwShareMode,
lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
}

//---------------------------------------------------------------------------
// WinMain
//---------------------------------------------------------------------------
Expand All @@ -148,10 +184,14 @@ int __stdcall WinMain(
return STATUS_LICENSE_QUOTA_EXCEEDED;
}

Check_Windows_7();

SetupExceptionHandler();

HOOK_WIN32(DuplicateHandle);

HOOK_WIN32(CreateFileW);

// hook privilege-related functions
if (! Hook_Privilege())
return EXIT_FAILURE;
Expand Down
2 changes: 2 additions & 0 deletions Sandboxie/apps/com/WUAU/wuau.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ int __stdcall WinMain(
OSVERSIONINFO osvi;
//BOOL ok;

Check_Windows_7();

SetupExceptionHandler();

HOOK_WIN32(CreateProcessW);
Expand Down
1 change: 1 addition & 0 deletions Sandboxie/common/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ typedef enum {
GAME_CONFIG_STORE_PORT,
SMART_CARD_PORT,
BT_PORT,
SSDP_PORT,
NUM_DYNAMIC_PORTS
} ENUM_DYNAMIC_PORT_TYPE;

Expand Down
6 changes: 3 additions & 3 deletions Sandboxie/common/my_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#ifndef _MY_VERSION_H
#define _MY_VERSION_H

#define MY_VERSION_BINARY 5,48,0
#define MY_VERSION_STRING "5.48.0"
#define MY_VERSION_COMPAT "5.48.0" // this refers to the driver ABI compatibility
#define MY_VERSION_BINARY 5,48,5
#define MY_VERSION_STRING "5.48.5"
#define MY_VERSION_COMPAT "5.48.5" // this refers to the driver ABI compatibility

// These #defines are used by either Resource Compiler, or by NSIC installer
#define SBIE_INSTALLER_PATH "..\\Bin\\"
Expand Down
6 changes: 6 additions & 0 deletions Sandboxie/common/win32_ntddk.h
Original file line number Diff line number Diff line change
Expand Up @@ -2189,6 +2189,12 @@ __declspec(dllimport) NTSTATUS __stdcall NtPrivilegeCheck(

typedef NTSTATUS (*P_RtlQueryElevationFlags)(ULONG *Flags);

typedef NTSTATUS (*P_RtlCheckTokenMembershipEx)(
HANDLE tokenHandle,
PSID sidToCheck,
DWORD flags,
PBOOL isMember);

__declspec(dllimport) NTSTATUS RtlQueryElevationFlags(ULONG *Flags);

__declspec(dllimport) NTSTATUS __stdcall NtContinue(
Expand Down
2 changes: 1 addition & 1 deletion Sandboxie/core/dll/SboxDll32.def
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SbieApi_CheckInternetAccess=_SbieApi_CheckInternetAccess@12
SbieApi_DisableForceProcess=_SbieApi_DisableForceProcess@8

SbieApi_EnumBoxes=_SbieApi_EnumBoxes@8
SbieApi_EnumProcessEx=_SbieApi_EnumProcessEx@16
SbieApi_EnumProcessEx=_SbieApi_EnumProcessEx@20

SbieApi_GetFileName=_SbieApi_GetFileName@12
SbieApi_GetHomePath=_SbieApi_GetHomePath@16
Expand Down
28 changes: 14 additions & 14 deletions Sandboxie/core/dll/com.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static void Com_Trace(

static void Com_Trace2(
const WCHAR* TraceType, REFCLSID rclsid, REFIID riid,
ULONG ProcNum, HRESULT hr, USHORT monflag);
ULONG ProcNum, ULONG clsctx, HRESULT hr, USHORT monflag);

static void Com_Monitor(REFCLSID rclsid, USHORT monflag);

Expand Down Expand Up @@ -599,8 +599,8 @@ _FX HRESULT Com_CoGetClassObject(
hr = __sys_CoGetClassObject(rclsid, clsctx, pServerInfo, riid, ppv);
}

Com_Trace2(TraceType, rclsid, riid, 0, clsctx, hr, monflag);
if (clsctx & CLSCTX_LOCAL_SERVER) {
Com_Trace2(TraceType, rclsid, riid, 0, hr, monflag);
if(!Com_TraceFlag) Com_Monitor(rclsid, monflag);
}

Expand Down Expand Up @@ -646,14 +646,14 @@ _FX HRESULT Com_CoGetObject(
else
monflag |= MONITOR_DENY;

Com_Trace2(TraceType, &clsid, riid, 0, hr, monflag);
if (!Com_TraceFlag) Com_Monitor(&clsid, monflag);

} else {

hr = __sys_CoGetObject(pszName, pBindOptions, riid, ppv);
}

Com_Trace2(TraceType, &clsid, riid, 0, 0, hr, monflag);
if (!Com_TraceFlag) Com_Monitor(&clsid, monflag);

return hr;
}

Expand Down Expand Up @@ -699,8 +699,8 @@ _FX HRESULT Com_CoCreateInstance(
hr = __sys_CoCreateInstance(rclsid, pUnkOuter, clsctx, riid, ppv);
}

Com_Trace2(TraceType, rclsid, riid, 0, clsctx, hr, monflag);
if (clsctx & CLSCTX_LOCAL_SERVER) {
Com_Trace2(TraceType, rclsid, riid, 0, hr, monflag);
if (!Com_TraceFlag) Com_Monitor(rclsid, monflag);
}

Expand Down Expand Up @@ -808,11 +808,11 @@ _FX HRESULT Com_CoCreateInstanceEx(
rclsid, pUnkOuter, clsctx, pServerInfo, cmq, pmqs);
}

if (clsctx & CLSCTX_LOCAL_SERVER) {

for (i = 0; i < cmq; ++i) {
MULTI_QI *mqi = &pmqs[i];
Com_Trace2(TraceType, rclsid, mqi->pIID, 0, mqi->hr, monflag);

for (i = 0; i < cmq; ++i) {
MULTI_QI *mqi = &pmqs[i];
Com_Trace2(TraceType, rclsid, mqi->pIID, 0, clsctx, mqi->hr, monflag);
if (clsctx & CLSCTX_LOCAL_SERVER) {
if (!Com_TraceFlag) Com_Monitor(rclsid, monflag);
}
}
Expand Down Expand Up @@ -3311,12 +3311,12 @@ _FX void Com_Trace(
const WCHAR* TraceType, REFCLSID rclsid, REFIID riid,
ULONG ProcNum, HRESULT hr)
{
Com_Trace2(TraceType, rclsid, riid, ProcNum, hr, MONITOR_TRACE);
Com_Trace2(TraceType, rclsid, riid, ProcNum, 0, hr, MONITOR_TRACE);
}

_FX void Com_Trace2(
const WCHAR* TraceType, REFCLSID rclsid, REFIID riid,
ULONG ProcNum, HRESULT hr, USHORT monflag)
ULONG ProcNum, ULONG clsctx, HRESULT hr, USHORT monflag)
{
WCHAR *text;
WCHAR *ptr;
Expand All @@ -3325,7 +3325,7 @@ _FX void Com_Trace2(
return;

text = Com_Alloc(1024 * sizeof(WCHAR));
ptr = text + Sbie_snwprintf(text, 1024, L"COM %s <%08X> ", TraceType, hr);
ptr = text + Sbie_snwprintf(text, 1024, L"COM <%08X> %s <%08X> ", clsctx, TraceType, hr);

if (rclsid) {
Com_Trace_Guid(ptr, rclsid, L"CLSID");
Expand Down
Loading

0 comments on commit 96b7d46

Please sign in to comment.