This commit is contained in:
love-code-yeyixiao 2024-06-22 19:37:41 +08:00
parent a88a83c8df
commit 9f57abf9c3
2 changed files with 261 additions and 235 deletions

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>835</width> <width>835</width>
<height>475</height> <height>575</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -45,7 +45,7 @@
<enum>QTabWidget::North</enum> <enum>QTabWidget::North</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>9</number>
</property> </property>
<widget class="QWidget" name="tabGeneral"> <widget class="QWidget" name="tabGeneral">
<attribute name="title"> <attribute name="title">
@ -1095,7 +1095,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QTabWidget" name="tabsSecurity"> <widget class="QTabWidget" name="tabsSecurity">
<property name="currentIndex"> <property name="currentIndex">
<number>3</number> <number>4</number>
</property> </property>
<widget class="QWidget" name="tabHarden"> <widget class="QWidget" name="tabHarden">
<attribute name="title"> <attribute name="title">
@ -1597,6 +1597,7 @@
<widget class="QLabel" name="lblJob"> <widget class="QLabel" name="lblJob">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight>
<bold>true</bold> <bold>true</bold>
<kerning>true</kerning> <kerning>true</kerning>
</font> </font>
@ -1700,6 +1701,7 @@
<widget class="QLabel" name="lblLimit"> <widget class="QLabel" name="lblLimit">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight>
<bold>true</bold> <bold>true</bold>
<kerning>true</kerning> <kerning>true</kerning>
</font> </font>
@ -1719,6 +1721,7 @@
<widget class="QWidget" name="tabPrivileges"> <widget class="QWidget" name="tabPrivileges">
<property name="font"> <property name="font">
<font> <font>
<weight>50</weight>
<bold>false</bold> <bold>false</bold>
<kerning>true</kerning> <kerning>true</kerning>
</font> </font>
@ -1726,63 +1729,12 @@
<attribute name="title"> <attribute name="title">
<string>Advanced Security</string> <string>Advanced Security</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_26">
<item row="0" column="1">
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="5" column="1" colspan="3">
<widget class="QCheckBox" name="chkDropPrivileges">
<property name="text">
<string>Drop critical privileges from processes running with a SYSTEM token</string>
</property>
</widget>
</item>
<item row="9" column="2">
<spacer name="horizontalSpacer_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1" colspan="3">
<widget class="QCheckBox" name="chkProtectSCM">
<property name="text">
<string>Allow only privileged processes to access the Service Control Manager</string>
</property>
</widget>
</item>
<item row="8" column="2" colspan="2">
<widget class="QLabel" name="label_74">
<property name="text">
<string>Using a custom Sandboxie Token allows to isolate individual sandboxes from each other better, and it shows in the user column of task managers the name of the box a process belongs to. Some 3rd party security solutions may however have problems with custom tokens.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="4">
<widget class="QLabel" name="label_65">
<property name="font">
<font>
<bold>true</bold>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>(Security Critical)</string>
</property>
</widget>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="lblPrivilege"> <widget class="QLabel" name="lblPrivilege">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight>
<bold>true</bold> <bold>true</bold>
<kerning>true</kerning> <kerning>true</kerning>
</font> </font>
@ -1795,51 +1747,39 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1" colspan="3"> <item row="1" column="1" colspan="2">
<widget class="QCheckBox" name="chkProtectSCM">
<property name="text">
<string>Allow only privileged processes to access the Service Control Manager</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QCheckBox" name="chkRestrictServices"> <widget class="QCheckBox" name="chkRestrictServices">
<property name="text"> <property name="text">
<string>Do not start sandboxed services using a system token (recommended)</string> <string>Do not start sandboxed services using a system token (recommended)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1" colspan="4"> <item row="3" column="1" colspan="2">
<widget class="QCheckBox" name="chkSbieLogon">
<property name="text">
<string>Use a Sandboxie login instead of an anonymous token</string>
</property>
</widget>
</item>
<item row="9" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1" colspan="3">
<widget class="QCheckBox" name="chkElevateRpcss"> <widget class="QCheckBox" name="chkElevateRpcss">
<property name="text"> <property name="text">
<string>Start the sandboxed RpcSs as a SYSTEM process (not recommended)</string> <string>Start the sandboxed RpcSs as a SYSTEM process (not recommended)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1" colspan="3"> <item row="4" column="1" colspan="2">
<widget class="QCheckBox" name="chkProtectSystem"> <widget class="QCheckBox" name="chkProtectSystem">
<property name="text"> <property name="text">
<string>Protect sandboxed SYSTEM processes from unprivileged processes</string> <string>Protect sandboxed SYSTEM processes from unprivileged processes</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="4"> <item row="4" column="3">
<widget class="QLabel" name="label_64"> <widget class="QLabel" name="label_65">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight>
<bold>true</bold> <bold>true</bold>
<kerning>true</kerning> <kerning>true</kerning>
</font> </font>
@ -1849,10 +1789,32 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0" colspan="2"> <item row="5" column="1" colspan="2">
<widget class="QCheckBox" name="chkDropPrivileges">
<property name="text">
<string>Drop critical privileges from processes running with a SYSTEM token</string>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QLabel" name="label_64">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>(Security Critical)</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="lblToken"> <widget class="QLabel" name="lblToken">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight>
<bold>true</bold> <bold>true</bold>
<kerning>true</kerning> <kerning>true</kerning>
</font> </font>
@ -1865,7 +1827,55 @@
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item row="7" column="1" colspan="2">
<widget class="QCheckBox" name="chkSbieLogon">
<property name="text">
<string>Use a Sandboxie login instead of an anonymous token</string>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QLabel" name="label_74">
<property name="text">
<string>Using a custom Sandboxie Token allows to isolate individual sandboxes from each other better, and it shows in the user column of task managers the name of the box a process belongs to. Some 3rd party security solutions may however have problems with custom tokens.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="1" colspan="2">
<widget class="QCheckBox" name="chkCreateToken">
<property name="text">
<string>Create a new sandboxed token instead of setting down default token</string>
</property>
</widget>
</item>
<item row="10" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>185</height>
</size>
</property>
</spacer>
</item>
<item row="10" column="2">
<spacer name="horizontalSpacer_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>457</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
</layout> </layout>
</widget> </widget>
@ -4042,6 +4052,7 @@ The process match level has a higher priority than the specificity and describes
<widget class="QTabWidget" name="tabsOther"> <widget class="QTabWidget" name="tabsOther">
<property name="font"> <property name="font">
<font> <font>
<weight>50</weight>
<bold>false</bold> <bold>false</bold>
<kerning>true</kerning> <kerning>true</kerning>
</font> </font>
@ -4053,16 +4064,7 @@ The process match level has a higher priority than the specificity and describes
<attribute name="title"> <attribute name="title">
<string>Compatibility</string> <string>Compatibility</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_63"> <layout class="QGridLayout" name="gridLayout_26">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_62">
<item row="3" column="1">
<widget class="QCheckBox" name="chkElevateCreateProcessFix">
<property name="text">
<string>Apply ElevateCreateProcess Workaround (legacy behaviour)</string>
</property>
</widget>
</item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QCheckBox" name="chkNoPanic"> <widget class="QCheckBox" name="chkNoPanic">
<property name="toolTip"> <property name="toolTip">
@ -4073,37 +4075,11 @@ The process match level has a higher priority than the specificity and describes
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1">
<widget class="QCheckBox" name="chkComTimeout">
<property name="text">
<string>Disable the use of RpcMgmtSetComTimeout by default (this may resolve compatibility issues)</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="chkUseSbieDeskHack">
<property name="text">
<string>Use desktop object workaround for all processes</string>
</property>
</widget>
</item>
<item row="7" column="0">
<spacer name="verticalSpacer_28">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="lblCompatibility"> <widget class="QLabel" name="lblCompatibility">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight>
<bold>true</bold> <bold>true</bold>
<kerning>true</kerning> <kerning>true</kerning>
</font> </font>
@ -4120,6 +4096,20 @@ The process match level has a higher priority than the specificity and describes
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1">
<widget class="QCheckBox" name="chkElevateCreateProcessFix">
<property name="text">
<string>Apply ElevateCreateProcess Workaround (legacy behaviour)</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="chkUseSbieDeskHack">
<property name="text">
<string>Use desktop object workaround for all processes</string>
</property>
</widget>
</item>
<item row="5" column="1"> <item row="5" column="1">
<widget class="QCheckBox" name="chkUseSbieWndStation"> <widget class="QCheckBox" name="chkUseSbieWndStation">
<property name="text"> <property name="text">
@ -4127,22 +4117,47 @@ The process match level has a higher priority than the specificity and describes
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1">
<widget class="QCheckBox" name="chkComTimeout">
<property name="text">
<string>Disable the use of RpcMgmtSetComTimeout by default (this may resolve compatibility issues)</string>
</property>
</widget>
</item>
<item row="7" column="1"> <item row="7" column="1">
<widget class="QCheckBox" name="chkForceRestart">
<property name="text">
<string>Restart force process before they begin to execute</string>
</property>
</widget>
</item>
<item row="8" column="0">
<spacer name="verticalSpacer_28">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>263</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="1">
<spacer name="horizontalSpacer_12"> <spacer name="horizontalSpacer_12">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>667</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </layout>
</item>
</layout>
</widget> </widget>
<widget class="QWidget" name="tabDlls"> <widget class="QWidget" name="tabDlls">
<attribute name="title"> <attribute name="title">
@ -5076,8 +5091,8 @@ instead of &quot;*&quot;.</string>
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>98</width> <width>75</width>
<height>28</height> <height>16</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="dbgLayout"> <layout class="QGridLayout" name="dbgLayout">

View File

@ -30,6 +30,8 @@ void COptionsWindow::CreateAdvanced()
connect(ui.chkOpenCOM, SIGNAL(clicked(bool)), this, SLOT(OnOpenCOM())); connect(ui.chkOpenCOM, SIGNAL(clicked(bool)), this, SLOT(OnOpenCOM()));
connect(ui.chkComTimeout, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); connect(ui.chkComTimeout, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
connect(ui.chkForceRestart, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
connect(ui.chkNoSecurityIsolation, SIGNAL(clicked(bool)), this, SLOT(OnIsolationChanged())); connect(ui.chkNoSecurityIsolation, SIGNAL(clicked(bool)), this, SLOT(OnIsolationChanged()));
connect(ui.chkNoSecurityFiltering, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); connect(ui.chkNoSecurityFiltering, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
@ -39,7 +41,7 @@ void COptionsWindow::CreateAdvanced()
connect(ui.chkOpenLsaEndpoint, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); connect(ui.chkOpenLsaEndpoint, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
connect(ui.chkSbieLogon, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); connect(ui.chkSbieLogon, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
connect(ui.chkCreateToken, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
m_AdvOptions.insert("UseWin32kHooks", SAdvOption{eSpec, QStringList() << "y" << "n", tr("Enable the use of win32 hooks for selected processes. Note: You need to enable win32k syscall hook support globally first.")}); m_AdvOptions.insert("UseWin32kHooks", SAdvOption{eSpec, QStringList() << "y" << "n", tr("Enable the use of win32 hooks for selected processes. Note: You need to enable win32k syscall hook support globally first.")});
m_AdvOptions.insert("EnableMiniDump", SAdvOption{eSpec, QStringList() << "y" << "n", tr("Enable crash dump creation in the sandbox folder")}); m_AdvOptions.insert("EnableMiniDump", SAdvOption{eSpec, QStringList() << "y" << "n", tr("Enable crash dump creation in the sandbox folder")});
@ -142,6 +144,8 @@ void COptionsWindow::LoadAdvanced()
ui.chkProtectSystem->setChecked(!m_pBox->GetBool("ExposeBoxedSystem", false)); ui.chkProtectSystem->setChecked(!m_pBox->GetBool("ExposeBoxedSystem", false));
ui.chkDropPrivileges->setChecked(m_pBox->GetBool("StripSystemPrivileges", true)); ui.chkDropPrivileges->setChecked(m_pBox->GetBool("StripSystemPrivileges", true));
ui.chkForceRestart->setChecked(m_pBox->GetBool("ForceRestartAll", false));
CheckOpenCOM(); CheckOpenCOM();
ui.chkComTimeout->setChecked(!m_pBox->GetBool("RpcMgmtSetComTimeout", true)); ui.chkComTimeout->setChecked(!m_pBox->GetBool("RpcMgmtSetComTimeout", true));
@ -373,6 +377,8 @@ void COptionsWindow::SaveAdvanced()
WriteAdvancedCheck(ui.chkComTimeout, "RpcMgmtSetComTimeout", "n", ""); WriteAdvancedCheck(ui.chkComTimeout, "RpcMgmtSetComTimeout", "n", "");
WriteAdvancedCheck(ui.chkForceRestart, "ForceRestartAll", "y", "");
WriteAdvancedCheck(ui.chkNoSecurityIsolation, "NoSecurityIsolation", "y", ""); WriteAdvancedCheck(ui.chkNoSecurityIsolation, "NoSecurityIsolation", "y", "");
WriteAdvancedCheck(ui.chkNoSecurityFiltering, "NoSecurityFiltering", "y", ""); WriteAdvancedCheck(ui.chkNoSecurityFiltering, "NoSecurityFiltering", "y", "");
@ -426,6 +432,9 @@ void COptionsWindow::SaveAdvanced()
bool bGlobalSbieLogon = m_pBox->GetAPI()->GetGlobalSettings()->GetBool("SandboxieLogon", false); bool bGlobalSbieLogon = m_pBox->GetAPI()->GetGlobalSettings()->GetBool("SandboxieLogon", false);
WriteAdvancedCheck(ui.chkSbieLogon, "SandboxieLogon", bGlobalSbieLogon ? "" : "y", bGlobalSbieLogon ? "n" : ""); WriteAdvancedCheck(ui.chkSbieLogon, "SandboxieLogon", bGlobalSbieLogon ? "" : "y", bGlobalSbieLogon ? "n" : "");
bool bGlobalSandboxGroup = m_pBox->GetAPI()->GetGlobalSettings()->GetBool("SandboxieAllGroup", false);
WriteAdvancedCheck(ui.chkCreateToken, "UseCreateToken", bGlobalSandboxGroup ? "" : "y", "");
SaveOptionList(); SaveOptionList();
bool bGlobalNoMon = m_pBox->GetAPI()->GetGlobalSettings()->GetBool("DisableResourceMonitor", false); bool bGlobalNoMon = m_pBox->GetAPI()->GetGlobalSettings()->GetBool("DisableResourceMonitor", false);
@ -595,14 +604,16 @@ void COptionsWindow::UpdateBoxIsolation()
ui.chkNoOpenForBox->setEnabled(!ui.chkNoSecurityIsolation->isChecked()); ui.chkNoOpenForBox->setEnabled(!ui.chkNoSecurityIsolation->isChecked());
ui.chkSbieLogon->setEnabled(!ui.chkNoSecurityIsolation->isChecked()); ui.chkSbieLogon->setEnabled(!ui.chkNoSecurityIsolation->isChecked());
ui.chkCreateToken->setEnabled(!ui.chkNoSecurityIsolation->isChecked());
if (ui.chkNoSecurityIsolation->isChecked()) { if (ui.chkNoSecurityIsolation->isChecked()) {
ui.chkCloseForBox->setChecked(false); ui.chkCloseForBox->setChecked(false);
ui.chkNoOpenForBox->setChecked(false); ui.chkNoOpenForBox->setChecked(false);
ui.chkSbieLogon->setChecked(false); ui.chkSbieLogon->setChecked(false);
ui.chkCreateToken->setChecked(false)
} }
else { else {
ReadGlobalCheck(ui.chkSbieLogon, "SandboxieLogon", false); ReadGlobalCheck(ui.chkSbieLogon, "SandboxieLogon", false);
ReadGlobalCheck(ui.chkCreateToken, "UseCreateToken", false);
} }
} }