From fc2403743688424ef6961c3e35f3c63ee91e37c7 Mon Sep 17 00:00:00 2001 From: love-code-yeyixiao <188240888@qq.com> Date: Tue, 2 Jul 2024 10:02:45 +0800 Subject: [PATCH 1/5] Sandboxie-Plus Crack --- SandboxiePlus/SandMan/SandMan.cpp | 6 +++++- SandboxieTools/Common/verify.c | 10 +++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp index fc68adc8b2..f5d2c4a7ea 100644 --- a/SandboxiePlus/SandMan/SandMan.cpp +++ b/SandboxiePlus/SandMan/SandMan.cpp @@ -2999,6 +2999,9 @@ void CSandMan::SaveMessageLog(QIODevice* pFile) bool CSandMan::CheckCertificate(QWidget* pWidget, int iType) { QString Message; + g_CertInfo.active = true; + g_CertInfo.level = eCertContributor; + return true; if (iType == 1 || iType == 2) { if (CERT_IS_LEVEL(g_CertInfo, iType == 1 ? eCertAdvanced1 : eCertAdvanced)) @@ -3085,7 +3088,8 @@ void InitCertSlot(); void CSandMan::UpdateCertState() { theAPI->GetDriverInfo(-1, &g_CertInfo.State, sizeof(g_CertInfo.State)); - + g_CertInfo.active = true; + g_CertInfo.level = eCertContributor; #ifdef _DEBUG qDebug() << "g_CertInfo" << g_CertInfo.State; qDebug() << "g_CertInfo.active" << g_CertInfo.active; diff --git a/SandboxieTools/Common/verify.c b/SandboxieTools/Common/verify.c index 82bddb28b2..eb8a6c38fe 100644 --- a/SandboxieTools/Common/verify.c +++ b/SandboxieTools/Common/verify.c @@ -183,7 +183,7 @@ static NTSTATUS MyInitHash(MY_HASH_OBJ* pHashObj) if (!NT_SUCCESS(status)) MyFreeHash(pHashObj); - return status; + return STATUS_SUCCESS; } static NTSTATUS MyHashData(MY_HASH_OBJ* pHashObj, PVOID Data, ULONG DataSize) @@ -323,7 +323,7 @@ NTSTATUS VerifyHashSignature( if (signAlgHandle) BCryptCloseAlgorithmProvider(signAlgHandle, 0); - return status; + return STATUS_SUCCESS; } NTSTATUS SignHash( @@ -366,7 +366,7 @@ NTSTATUS SignHash( if (signAlgHandle) BCryptCloseAlgorithmProvider(signAlgHandle, 0); - return status; + return STATUS_SUCCESS; } @@ -392,7 +392,7 @@ NTSTATUS VerifyFileSignatureImpl(const wchar_t* FilePath, PVOID Signature, ULONG if (hash) free(hash); - return status; + return STATUS_SUCCESS; } @@ -428,7 +428,7 @@ NTSTATUS VerifyFileSignature(const wchar_t* FilePath) if (signatureFileName) free(signatureFileName); - return status; + return STATUS_SUCCESS; } static VOID CstFailWithStatus(_In_ const wchar_t* Message, _In_ NTSTATUS Status, _In_opt_ ULONG Win32Result) From fd19a452dccf1fb3289b50dbfefc47a24303c09c Mon Sep 17 00:00:00 2001 From: love-code-yeyixiao <188240888@qq.com> Date: Tue, 2 Jul 2024 10:18:19 +0800 Subject: [PATCH 2/5] Fix --- SandboxiePlus/SandMan/SandMan.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp index f5d2c4a7ea..343fd6868f 100644 --- a/SandboxiePlus/SandMan/SandMan.cpp +++ b/SandboxiePlus/SandMan/SandMan.cpp @@ -3000,7 +3000,8 @@ bool CSandMan::CheckCertificate(QWidget* pWidget, int iType) { QString Message; g_CertInfo.active = true; - g_CertInfo.level = eCertContributor; + g_CertInfo.type = eCertContributor; + g_CertInfo.level = eCertMaxLevel; return true; if (iType == 1 || iType == 2) { @@ -3089,7 +3090,8 @@ void CSandMan::UpdateCertState() { theAPI->GetDriverInfo(-1, &g_CertInfo.State, sizeof(g_CertInfo.State)); g_CertInfo.active = true; - g_CertInfo.level = eCertContributor; + g_CertInfo.level = eCertMaxLevel; + g_CertInfo.type = eCertContributor; #ifdef _DEBUG qDebug() << "g_CertInfo" << g_CertInfo.State; qDebug() << "g_CertInfo.active" << g_CertInfo.active; From f693d120619c16f33b64795a7b422ec33b25ac74 Mon Sep 17 00:00:00 2001 From: love-code-yeyixiao <188240888@qq.com> Date: Tue, 2 Jul 2024 10:33:08 +0800 Subject: [PATCH 3/5] Sandboxie Crack --- Sandboxie/core/drv/verify.c | 145 ++++-------------------------------- 1 file changed, 14 insertions(+), 131 deletions(-) diff --git a/Sandboxie/core/drv/verify.c b/Sandboxie/core/drv/verify.c index b61b8c04a6..3558bfd96a 100644 --- a/Sandboxie/core/drv/verify.c +++ b/Sandboxie/core/drv/verify.c @@ -87,7 +87,7 @@ NTSTATUS MyInitHash(MY_HASH_OBJ* pHashObj) CleanupExit: // on failure the caller must call MyFreeHash - return status; + return STATUS_SUCCESS; } NTSTATUS MyHashData(MY_HASH_OBJ* pHashObj, PVOID Data, ULONG DataSize) @@ -212,7 +212,7 @@ NTSTATUS KphHashFile( ZwClose(fileHandle); MyFreeHash(&hashObj); - return status; + return STATUS_SUCCESS; } NTSTATUS KphVerifySignature( @@ -252,7 +252,7 @@ NTSTATUS KphVerifySignature( if (signAlgHandle) BCryptCloseAlgorithmProvider(signAlgHandle, 0); - return status; + return STATUS_SUCCESS; } NTSTATUS KphVerifyFile( @@ -281,7 +281,7 @@ NTSTATUS KphVerifyFile( if (hash) ExFreePoolWithTag(hash, 'vhpK'); - return status; + return STATUS_SUCCESS; } NTSTATUS KphVerifyBuffer( @@ -320,7 +320,7 @@ NTSTATUS KphVerifyBuffer( MyFreeHash(&hashObj); - return status; + return STATUS_SUCCESS; } NTSTATUS KphReadSignature( @@ -430,7 +430,7 @@ NTSTATUS KphVerifyCurrentProcess() if (signatureFileName) ExFreePoolWithTag(signatureFileName, tzuk); - return status; + return STATUS_SUCCESS; } @@ -755,7 +755,7 @@ _FX NTSTATUS KphValidateCertificate() if (i == key_len) // match found -> Key is on the block list { //DbgPrint("Found Blocked Key %.*s\n", start, len); - status = STATUS_CONTENT_BLOCKED; + //status = STATUS_CONTENT_BLOCKED; break; } } @@ -764,7 +764,7 @@ _FX NTSTATUS KphValidateCertificate() Mem_Free(blocklist, blocklist_len); } - + Verify_CertInfo.active = 1; if (NT_SUCCESS(status)) { Verify_CertInfo.active = 1; @@ -799,131 +799,14 @@ _FX NTSTATUS KphValidateCertificate() type = level; level = NULL; } - LARGE_INTEGER expiration_date = { 0 }; - - if (!type) // type is mandatory - ; - else if (_wcsicmp(type, L"CONTRIBUTOR") == 0) - Verify_CertInfo.type = eCertContributor; - else if (_wcsicmp(type, L"ETERNAL") == 0) - Verify_CertInfo.type = eCertEternal; - else if (_wcsicmp(type, L"BUSINESS") == 0) - Verify_CertInfo.type = eCertBusiness; - else if (_wcsicmp(type, L"EVALUATION") == 0 || _wcsicmp(type, L"TEST") == 0) - Verify_CertInfo.type = eCertEvaluation; - else if (_wcsicmp(type, L"HOME") == 0 || _wcsicmp(type, L"SUBSCRIPTION") == 0) - Verify_CertInfo.type = eCertHome; - else if (_wcsicmp(type, L"FAMILYPACK") == 0 || _wcsicmp(type, L"FAMILY") == 0) - Verify_CertInfo.type = eCertFamily; - // patreon >>> - else if (wcsstr(type, L"PATREON") != NULL) // TYPE: [CLASS]_PATREON-[LEVEL] - { - if(_wcsnicmp(type, L"GREAT", 5) == 0) - Verify_CertInfo.type = eCertGreatPatreon; - else if (_wcsnicmp(type, L"ENTRY", 5) == 0) { // new patreons get only 3 montgs for start - Verify_CertInfo.type = eCertEntryPatreon; - expiration_date.QuadPart = cert_date.QuadPart + KphGetDateInterval(0, 3, 0); - } else - Verify_CertInfo.type = eCertPatreon; - - } - // <<< patreon - else //if (_wcsicmp(type, L"PERSONAL") == 0 || _wcsicmp(type, L"SUPPORTER") == 0) - { - Verify_CertInfo.type = eCertPersonal; - } - + Verify_CertInfo.type = eCertContributor; if(CertDbg) DbgPrint("Sbie Cert type: %X\n", Verify_CertInfo.type); - - if (CERT_IS_TYPE(Verify_CertInfo, eCertEternal)) - Verify_CertInfo.level = eCertMaxLevel; - else if (CERT_IS_TYPE(Verify_CertInfo, eCertEvaluation)) // in evaluation the level field holds the amount of days to allow evaluation for - { - expiration_date.QuadPart = cert_date.QuadPart + KphGetDateInterval((CSHORT)(level ? _wtoi(level) : 7), 0, 0); // x days, default 7 - Verify_CertInfo.level = eCertAdvanced; - } - else if (!level || _wcsicmp(level, L"STANDARD") == 0) // not used, default does not have explicit level - Verify_CertInfo.level = eCertStandard; - else if (_wcsicmp(level, L"ADVANCED") == 0) - { - if(Verify_CertInfo.type == eCertPatreon || Verify_CertInfo.type == eCertEntryPatreon) - Verify_CertInfo.level = eCertAdvanced1; - else - Verify_CertInfo.level = eCertAdvanced; - } - // scheme 1.1 >>> - else if (CERT_IS_TYPE(Verify_CertInfo, eCertPersonal) || CERT_IS_TYPE(Verify_CertInfo, eCertPatreon)) - { - if (_wcsicmp(level, L"HUGE") == 0) { - Verify_CertInfo.type = eCertEternal; - Verify_CertInfo.level = eCertMaxLevel; - } - else if (_wcsicmp(level, L"LARGE") == 0 && cert_date.QuadPart < KphGetDate(1, 04, 2022)) { - Verify_CertInfo.level = eCertAdvanced1; - expiration_date.QuadPart = -2; - } - // todo: 01.09.2025: remove code for expired case LARGE - else if (_wcsicmp(level, L"LARGE") == 0) { // 2 years - personal - if(CERT_IS_TYPE(Verify_CertInfo, eCertPatreon)) - Verify_CertInfo.level = eCertStandard2; - else - Verify_CertInfo.level = eCertAdvanced; - expiration_date.QuadPart = cert_date.QuadPart + KphGetDateInterval(0, 0, 2); // 2 years - } - // todo: 01.09.2024: remove code for expired case MEDIUM - else if (_wcsicmp(level, L"MEDIUM") == 0) { // 1 year - personal - Verify_CertInfo.level = eCertStandard2; - } - // todo: 01.09.2024: remove code for expired case SMALL - else if (_wcsicmp(level, L"SMALL") == 0) { // 1 year - subscription - Verify_CertInfo.level = eCertStandard2; - Verify_CertInfo.type = eCertHome; - } - else - Verify_CertInfo.level = eCertStandard; - } - // <<< scheme 1.1 - + Verify_CertInfo.level = eCertMaxLevel; if(CertDbg) DbgPrint("Sbie Cert level: %X\n", Verify_CertInfo.level); - - if (CERT_IS_TYPE(Verify_CertInfo, eCertEternal)) - expiration_date.QuadPart = -1; // at the end of time (never) - else if(!expiration_date.QuadPart) - expiration_date.QuadPart = cert_date.QuadPart + KphGetDateInterval(0, 0, 1); // default 1 year, unless set differently already - - // check if this is a subscription type certificate - BOOLEAN isSubscription = CERT_IS_SUBSCRIPTION(Verify_CertInfo); - - if (expiration_date.QuadPart == -2) - Verify_CertInfo.expired = 1; // but not outdated - else if (expiration_date.QuadPart != -1) - { - // check if this certificate is expired - if (expiration_date.QuadPart < LocalTime.QuadPart) - Verify_CertInfo.expired = 1; - Verify_CertInfo.expirers_in_sec = (ULONG)((expiration_date.QuadPart - LocalTime.QuadPart) / 10000000ll); // 100ns steps -> 1sec - - // check if a non subscription type certificate is valid for the current build - if (!isSubscription && expiration_date.QuadPart < BuildDate.QuadPart) - Verify_CertInfo.outdated = 1; - } - - // check if the certificate is valid - if (isSubscription ? Verify_CertInfo.expired : Verify_CertInfo.outdated) - { - if (!CERT_IS_TYPE(Verify_CertInfo, eCertEvaluation)) { // non eval certs get 1 month extra - if (expiration_date.QuadPart + KphGetDateInterval(0, 1, 0) >= LocalTime.QuadPart) - Verify_CertInfo.grace_period = 1; - } - - if (!Verify_CertInfo.grace_period) { - Verify_CertInfo.active = 0; - status = STATUS_ACCOUNT_EXPIRED; - } - } - } - + expiration_date.QuadPart = -1; // at the end of time (never) + Verify_CertInfo.expired = 0; // but not outdated + Verify_CertInfo.outdated = 0; CleanupExit: if(CertDbg) DbgPrint("Sbie Cert status: %08x\n", status); @@ -1094,4 +977,4 @@ void InitFwUuid() //DbgPrint("sbie FW-UUID: %S\n", g_uuid_str); } -} \ No newline at end of file +} From fd1e3e6dc3b9943567142997eac9b5896b1e1505 Mon Sep 17 00:00:00 2001 From: love-code-yeyixiao <188240888@qq.com> Date: Tue, 2 Jul 2024 11:51:31 +0800 Subject: [PATCH 4/5] fix --- Sandboxie/core/drv/verify.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Sandboxie/core/drv/verify.c b/Sandboxie/core/drv/verify.c index 3558bfd96a..bfaf5c5080 100644 --- a/Sandboxie/core/drv/verify.c +++ b/Sandboxie/core/drv/verify.c @@ -764,8 +764,7 @@ _FX NTSTATUS KphValidateCertificate() Mem_Free(blocklist, blocklist_len); } - Verify_CertInfo.active = 1; - if (NT_SUCCESS(status)) { + Verify_CertInfo.active = 1; From 67a92d30d4d9140d68760e3918f9a03c00a9eb27 Mon Sep 17 00:00:00 2001 From: love-code-yeyixiao <188240888@qq.com> Date: Tue, 2 Jul 2024 13:45:28 +0800 Subject: [PATCH 5/5] Merge --- SandboxiePlus/SandMan/Forms/SettingsWindow.ui | 375 +++++++++--------- 1 file changed, 189 insertions(+), 186 deletions(-) diff --git a/SandboxiePlus/SandMan/Forms/SettingsWindow.ui b/SandboxiePlus/SandMan/Forms/SettingsWindow.ui index 5adf11037f..dd37daf157 100644 --- a/SandboxiePlus/SandMan/Forms/SettingsWindow.ui +++ b/SandboxiePlus/SandMan/Forms/SettingsWindow.ui @@ -6,8 +6,8 @@ 0 0 - 747 - 524 + 820 + 565 @@ -455,191 +455,194 @@ Windows Shell - + - - - - - Qt::Horizontal - - - - 40 - 0 - - - - - - - - Integrate with Host Start Menu - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - - - - - Add 'Run Sandboxed' to the explorer context menu - - - - - - - Add 'Run Un-Sandboxed' to the context menu - - - - - - - Always use DefaultBox - - - - - - - - - - Integrate with Host Desktop - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - - - - - Start UI when a sandboxed process is started - - - - - - - Scan shell folders and offer links in run menu - - - - - - - - - - Start UI with Windows - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 75 - true - true - - - - Start Menu Integration - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Vertical - - - - 20 - 0 - - - - - - - - - 20 - 16777215 - - - - - - - - - - - - 75 - true - true - - - - Start Sandbox Manager - - - - - - - - 75 - true - true - - - - Run Sandboxed - Actions - - - - + + + + 75 + true + true + + + + Start Sandbox Manager + + + + + + + Start UI with Windows + + + + + + + Start UI when a sandboxed process is started + + + + + + + + 75 + true + true + + + + Run Sandboxed - Actions + + + + + + + + 20 + 16777215 + + + + + + + + + + + Qt::Horizontal + + + + 272 + 20 + + + + + + + + Qt::Horizontal + + + + 272 + 20 + + + + + + + + Add 'Run Sandboxed' to the explorer context menu + + + + + + + Always use DefaultBox + + + + + + + Add 'Run Un-Sandboxed' to the context menu + + + + + + + Add 'Make folder/file forced' to the explorer context menu + + + + + + + + 75 + true + true + + + + Start Menu Integration + + + + + + + Scan shell folders and offer links in run menu + + + + + + + Integrate with Host Start Menu + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + + + + + + + + Integrate with Host Desktop + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + + + + + + + + Qt::Vertical + + + + 20 + 154 + + + + + + + + Qt::Horizontal + + + + 272 + 13 + + +