@@ -600,6 +697,38 @@ function GetHtmlContent {
Uninstall ThreatLocker
+
+
+
+ Uninstall CyberQP
+
+
+
+ Uninstall DattoEDR
+
+
+
+ Uninstall DattoRMM
+
+
+
+ Uninstall DattoDEB
+
+
+
+ Uninstall RocketCyber
+
+
+
+ Uninstall splashtop
+
+
+
+ Uninstall SVSHelpdesk
+
+
+
+ Uninstall SVSWatchtower
Offboard
@@ -653,15 +782,7 @@ function GetHtmlContent {
const optionsContainer = document.getElementById('dattoRMMOptionsContainer');
const n8nPasswordContainer = document.getElementById('n8nPasswordContainer');
const dattoRMMContainer = document.getElementById('DattoRMMContainer');
-
-
-
- checkboxes.forEach(checkbox => {
- if (checkbox !== selectedCheckbox) {
- checkbox.checked = selectedCheckbox.checked;
- }
- });
-
+
if (dattoRMMCheckbox.checked) {
optionsContainer.style.display = 'block';
n8nPasswordContainer.style.display = 'block';
@@ -673,6 +794,31 @@ function GetHtmlContent {
}
}
+ function toggleLeftColumnCheckboxes(selectAllCheckbox) {
+ const leftCheckboxes = document.querySelectorAll('#leftColumn input[type="checkbox"]:not(#selectAllLeftCheckbox)');
+ const dattoRMMCheckbox = document.getElementById('installDattoRMMCheckbox');
+ const optionsContainer = document.getElementById('dattoRMMOptionsContainer');
+ const n8nPasswordContainer = document.getElementById('n8nPasswordContainer');
+ const dattoRMMContainer = document.getElementById('DattoRMMContainer');
+
+ // Toggle all checkboxes
+ leftCheckboxes.forEach(checkbox => {
+ checkbox.checked = selectAllCheckbox.checked;
+ });
+
+ // Check if "Install DattoRMM" is selected
+ if (dattoRMMCheckbox.checked) {
+ optionsContainer.style.display = 'block';
+ n8nPasswordContainer.style.display = 'block';
+ dattoRMMContainer.style.display = 'block';
+ } else {
+ optionsContainer.style.display = 'none';
+ n8nPasswordContainer.style.display = 'none';
+ dattoRMMContainer.style.display = 'none';
+ }
+ }
+
+
function updateSelectAllonboard() {
const selectAllCheckbox = document.getElementById('selectAllOnboardCheckbox');
const checkboxes = document
@@ -683,43 +829,69 @@ function GetHtmlContent {
selectAllCheckbox.checked = Array.from(checkboxes).every(checkbox => checkbox.checked);
}
+ function gatherSelectedTasks() {
+ const selectedLeftTasks = Array.from(document.querySelectorAll('.left-checkbox:checked')).map(checkbox => checkbox.name);
+ const selectedRightTasks = Array.from(document.querySelectorAll('.right-checkbox:checked')).map(checkbox => checkbox.name);
+ return [...selectedLeftTasks, ...selectedRightTasks];
+ }
+
+
// Attach the updateSelectAllonboard function to all individual checkboxes
document.querySelectorAll('#onboardTab input[type="checkbox"]:not(#selectAllOnboardCheckbox)').forEach(checkbox => {
checkbox.addEventListener('change', updateSelectAllonboard);
});
function toggleOffboardCheckboxes(selectAllCheckbox) {
- // Get all checkboxes inside the offboardTab container
- const checkboxes = document
- .getElementById('offboardTab')
- .querySelectorAll('input[type="checkbox"]:not(#selectAllOffboardCheckbox)');
-
- // Set the checked state of all checkboxes to match the "Select All" checkbox
+ const checkboxes = document.querySelectorAll('#offboardTab input[type="checkbox"]:not(#selectAllOffboardCheckbox)');
checkboxes.forEach(checkbox => {
checkbox.checked = selectAllCheckbox.checked;
});
}
-
function updateSelectAllOffboard() {
const selectAllCheckbox = document.getElementById('selectAllOffboardCheckbox');
- const checkboxes = document
- .getElementById('offboardTab')
- .querySelectorAll('input[type="checkbox"]:not(#selectAllOffboardCheckbox)');
-
- // If any checkbox is unchecked, uncheck "Select All"
+ const checkboxes = document.querySelectorAll('#offboardTab input[type="checkbox"]:not(#selectAllOffboardCheckbox)');
selectAllCheckbox.checked = Array.from(checkboxes).every(checkbox => checkbox.checked);
}
- // Attach the updateSelectAllOffboard function to all individual checkboxes
document.querySelectorAll('#offboardTab input[type="checkbox"]:not(#selectAllOffboardCheckbox)').forEach(checkbox => {
checkbox.addEventListener('change', updateSelectAllOffboard);
});
+
function triggerOffboard() {
- appendLog("testeteteteteteet")
+ const checkboxes = document.querySelectorAll('#offboardTab input[type="checkbox"]:not(#selectAllOffboardCheckbox)');
+ const selectedTasks = Array.from(checkboxes)
+ .filter(checkbox => checkbox.checked)
+ .map(checkbox => checkbox.name);
+
+ if (selectedTasks.length === 0) {
+ appendLog("Please select at least one offboarding task.", "red");
+ return;
+ }
+
+ appendLog("Starting offboarding tasks...", "yellow");
+
+ fetch('/offboard', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ SelectedTasks: selectedTasks })
+ })
+ .then(response => {
+ if (!response.ok) {
+ throw new Error('Failed to execute offboarding tasks.');
+ }
+ return response.text();
+ })
+ .then(message => {
+ appendLog(message, "green");
+ })
+ .catch(error => {
+ appendLog("Error: " + error.message, "red");
+ });
}
+
function toggleTweaksCheckboxes(selectAllCheckbox) {
// Get all checkboxes inside the tweaksTab container
const checkboxes = document
@@ -838,7 +1010,6 @@ function GetHtmlContent {
}
}
-
function triggerInstall() {
const dropdown = document.getElementById('dattoRmmDropdown');
const UID = dropdown && dropdown.options[dropdown.selectedIndex]
@@ -851,15 +1022,14 @@ function GetHtmlContent {
(async () => {
// Priority 1: Install SVSMSP Module
if (document.querySelector('input[name="installSVSMSPModule"]').checked) {
- appendLog("Installing SVSMSP Module (Priority 1)...", "cyan");
- try {
- await fetch('/installSVSMSPModule', { method: 'GET' });
- appendLog("SVSMSP Module installation completed.", "green");
- } catch (error) {
- appendLog("Error installing SVSMS", "red");
- }
- }
-
+ appendLog("Installing SVSMSP Module (Priority 1)...", "cyan");
+ try {
+ await fetch('/installSVSMSPModule', { method: 'GET' });
+ appendLog("SVSMSP Module installation completed.", "green");
+ } catch (error) {
+ appendLog("Error installing SVSMSP Module: " + error.message, "red");
+ }
+ }
// Priority 2: Install DattoRMM
if (document.querySelector('input[name="installDattoRMM"]').checked) {
@@ -881,85 +1051,99 @@ function GetHtmlContent {
});
appendLog("DattoRMM installation completed.", "green");
} catch (error) {
- appendLog("Error installing DattoRMM: ${error.message}", "red");
+ appendLog("Error installing DattoRMM: " + error.message, "red");
}
}
-
// Priority 3: Other tasks
if (document.querySelector('input[name="setSVSPowerplan"]').checked) {
- appendLog("Setting SVS Powerplan (Priority 3)...", "cyan");
- try {
- await fetch('/SetSVSPowerplan', { method: 'GET' });
- appendLog("SVS Powerplan set successfully.", "green");
- } catch (error) {
- appendLog("Error setting SVS Powerplan: ${error.message}", "red");
- }
- }
+ appendLog("Setting SVS Powerplan (Priority 3)...", "cyan");
+ try {
+ await fetch('/SetSVSPowerplan', { method: 'GET' });
+ appendLog("SVS Powerplan set successfully.", "green");
+ } catch (error) {
+ appendLog("Error setting SVS Powerplan: " + error.message, "red");
+ }
+ }
- if (document.querySelector('input[name="installCyberQP"]').checked) {
- appendLog("Installing CyberQP (Priority 3)...", "cyan");
- try {
- await fetch('/installCyberQP', { method: 'GET' });
- appendLog("CyberQP installation completed.", "green");
- } catch (error) {
- appendLog("Error installing CyberQP: ${error.message}", "red");
- }
- }
+ if (document.querySelector('input[name="installCyberQP"]').checked) {
+ appendLog("Installing CyberQP (Priority 3)...", "cyan");
+ try {
+ await fetch('/installCyberQP', { method: 'GET' });
+ appendLog("CyberQP installation completed.", "green");
+ } catch (error) {
+ appendLog("Error installing CyberQP: " + error.message, "red");
+ }
+ }
- if (document.querySelector('input[name="installSplashtop"]').checked) {
- appendLog("Installing Splashtop (Priority 3)...", "cyan");
- try {
- await fetch('/installSplashtop', { method: 'GET' });
- appendLog("Splashtop installation completed.", "green");
- } catch (error) {
- appendLog("Error installing Splashtop: ${error.message}", "red");
- }
- }
+ if (document.querySelector('input[name="installSplashtop"]').checked) {
+ appendLog("Installing Splashtop (Priority 3)...", "cyan");
+ try {
+ await fetch('/installSplashtop', { method: 'GET' });
+ appendLog("Splashtop installation completed.", "green");
+ } catch (error) {
+ appendLog("Error installing Splashtop: " + error.message, "red");
+ }
+ }
- if (document.querySelector('input[name="installSVSHelpDesk"]').checked) {
- appendLog("Installing SVS HelpDesk (Priority 3)...", "cyan");
- try {
- await fetch('/installSVSHelpDesk', { method: 'GET' });
- appendLog("SVS HelpDesk installation completed.", "green");
- } catch (error) {
- appendLog("Error installing SVS HelpDesk: ${error.message}", "red");
- }
- }
+ if (document.querySelector('input[name="installSVSHelpDesk"]').checked) {
+ appendLog("Installing SVS HelpDesk (Priority 3)...", "cyan");
+ try {
+ await fetch('/installSVSHelpDesk', { method: 'GET' });
+ appendLog("SVS HelpDesk installation completed.", "green");
+ } catch (error) {
+ appendLog("Error installing SVS HelpDesk: " + error.message, "red");
+ }
+ }
- if (document.querySelector('input[name="installSVSWatchtower"]').checked) {
- appendLog("Installing SVS Watchtower (Priority 3)...", "cyan");
- try {
- await fetch('/installSVSWatchtower', { method: 'GET' });
- appendLog("SVS Watchtower installation completed.", "green");
- } catch (error) {
- appendLog("Error installing SVS Watchtower: ${error.message}", "red");
- }
- }
+
- if (document.querySelector('input[name="installThreatLocker"]').checked) {
- appendLog("Installing ThreatLocker (Priority 3)...", "cyan");
- try {
- await fetch('/installThreatLocker', { method: 'GET' });
- appendLog("ThreatLocker installation completed.", "green");
- } catch (error) {
- appendLog("Error installing ThreatLocker: ${error.message}", "red");
- }
- }
+ if (document.querySelector('input[name="installThreatLocker"]').checked) {
+ appendLog("Installing ThreatLocker (Priority 3)...", "cyan");
+ try {
+ await fetch('/installThreatLocker', { method: 'GET' });
+ appendLog("ThreatLocker installation completed.", "green");
+ } catch (error) {
+ appendLog("Error installing ThreatLocker: " + error.message, "red");
+ }
+ }
- if (document.querySelector('input[name="installRocketCyber"]').checked) {
- appendLog("Installing RocketCyber (Priority 3)...", "cyan");
- try {
- await fetch('/installRocketCyber', { method: 'GET' });
- appendLog("RocketCyber installation completed.", "green");
- } catch (error) {
- appendLog("Error installing RocketCyber: ${error.message}", "red");
- }
- }
+ if (document.querySelector('input[name="installRocketCyber"]').checked) {
+ appendLog("Installing RocketCyber (Priority 3)...", "cyan");
+ try {
+ await fetch('/installRocketCyber', { method: 'GET' });
+ appendLog("RocketCyber installation completed.", "green");
+ } catch (error) {
+ appendLog("Error installing RocketCyber: " + error.message, "red");
+ }
+ }
+
+ // NEW: Set Edge Default Search Engine
+ if (document.querySelector('input[name="setedgedefaultsearch"]').checked) {
+ appendLog("Setting Edge Default Search Engine (Priority 3)...", "cyan");
+ try {
+ await fetch('/setedgedefaultsearch', { method: 'GET' });
+ appendLog("Edge Default Search Engine set successfully.", "green");
+ } catch (error) {
+ appendLog("Error setting Edge Default Search Engine: " + error.message, "red");
+ }
+ }
+
+ if (document.querySelector('input[name="EnableBitLocker"]').checked) {
+ appendLog("Enabling BitLocker (Priority 3)...", "cyan");
+ try {
+ await fetch('/EnableBitLocker', { method: 'GET' });
+ appendLog("BitLocker enabled successfully.", "green");
+ } catch (error) {
+ appendLog("Error enabling BitLocker: " + error.message, "red");
+ }
+ }
})();
}
+
+
function endSession() {
@@ -1231,7 +1415,7 @@ try {
$responseString = "Method not allowed. Use GET."
$response.StatusCode = 405
}
- $buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
+ $buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
$response.ContentType = "text/plain"
$response.ContentLength64 = $buffer.Length
$response.OutputStream.Write($buffer, 0, $buffer.Length)
@@ -1282,7 +1466,6 @@ try {
"/setedgedefaultsearch"{
if ($request.HttpMethod -eq "GET") {
- write-host "it attempted it!"
try {
set-EdgeDefaultSearchProvider
$responseString = "setedgedefaultsearch triggered successfully."
@@ -1324,15 +1507,19 @@ try {
$response.OutputStream.Close()
}
- "/installSVSWatchtower" {
+
+
+ "/EdgeDefaultSearchEngine" {
if ($request.HttpMethod -eq "GET") {
- Install-SVSWatchtower
try {
- Install-SVSWatchtower
- $responseString = "Install SVSWatchtower triggered successfully."
+ Write-LogHybrid -Message "Setting Edge Default Search Engine started." -Level "Info"
+ Set-EdgeDefaultSearchEngine
+ Write-LogHybrid -Message "Edge Default Search Engine set successfully." -Level "Success"
+ $responseString = " Set Edge Default Search Engine triggered successfully."
$response.StatusCode = 200
} catch {
- $responseString = "Error triggering Install SVSWatchtower: $_"
+ Write-LogHybrid -Message "Error setting Edge Default Search Engine: $($_.Exception.Message)" -Level "Error"
+ $responseString = "Error attempting to Set Edge Default Search Engine: $_"
$response.StatusCode = 500
}
} else {
@@ -1346,6 +1533,92 @@ try {
$response.OutputStream.Close()
}
+ "/EnableBitLocker" {
+ if ($request.HttpMethod -eq "GET") {
+ try {
+ Set-SVSBitLocker -Mode Enable -DriveLetter C -SaveToRegistry $true
+ $responseString = " BitLocker enabled on C successfully."
+ $response.StatusCode = 200
+ } catch {
+ $responseString = "Error Attempting to set BitLocker: $_"
+ $response.StatusCode = 500
+ }
+ } else {
+ $responseString = "Method not allowed. Use GET."
+ $response.StatusCode = 405
+ }
+ $buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
+ $response.ContentType = "text/plain"
+ $response.ContentLength64 = $buffer.Length
+ $response.OutputStream.Write($buffer, 0, $buffer.Length)
+ $response.OutputStream.Close()
+ }
+
+
+ "/offboard" {
+ if ($request.HttpMethod -eq "POST") {
+ try {
+ # Read the Request Body
+ $bodyStream = New-Object IO.StreamReader $request.InputStream
+ $body = $bodyStream.ReadToEnd()
+ $requestData = ConvertFrom-Json $body
+
+ $selectedTasks = $requestData.SelectedTasks
+
+ Write-LogHybrid -Message "Offboarding request received with tasks: $($selectedTasks -join ', ')" -Level "Info"
+
+
+ if (-not $selectedTasks -or $selectedTasks.Count -eq 0) {
+ $response.StatusCode = 400
+ $responseString = "Error: No offboarding tasks selected."
+ $buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
+ $response.OutputStream.Write($buffer, 0, $buffer.Length)
+ $response.OutputStream.Close()
+ return
+ }
+
+ # Process each selected task
+ foreach ($task in $selectedTasks) {
+ switch ($task) {
+ "uninstallSVSMSPModule" { Write-LogHybrid -Message "Uninstalling SVSMSP Module..." -Level "Info"; } #Uninstall-SVSMSP }
+ "uninstallThreatLocker" { Write-LogHybrid -Message "Uninstalling Threatlocker" -Level "Info"; Uninstall-ThreatLocker }
+ "uninstallCyberQP" { Write-LogHybrid -Message "Uninstalling CyberQP" -Level "Info";Uninstall-CyberQP }
+ "uninstallDattoEDR" { Uninstall-DattoEDR }
+ "uninstallDattoRMM" { Uninstall-DattoRMM }
+ "uninstallRocketCyber" { Uninstall-RocketCyber }
+ "uninstallSplashtop" { Uninstall-Splashtop }
+ "uninstallSVSHelpdesk" { Uninstall-SVSHelpdesk }
+ "uninstallSVSWatchtower" { Uninstall-SVSWatchtower }
+ default {
+ Write-LogHybrid -Message "Unknown task: $task" -Level "Warning"
+ }
+ }
+ }
+
+ # Return Success Response
+ $responseString = "Offboarding tasks executed successfully."
+ $response.StatusCode = 200
+ } catch {
+ $responseString = "Error processing offboarding tasks: $($_.Exception.Message)"
+ $response.StatusCode = 500
+ }
+
+ # Send the Response
+ $buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
+ $response.ContentType = "text/plain"
+ $response.ContentLength64 = $buffer.Length
+ $response.OutputStream.Write($buffer, 0, $buffer.Length)
+ $response.OutputStream.Close()
+ } else {
+ $responseString = "Method not allowed. Use POST."
+ $response.StatusCode = 405
+ $buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
+ $response.OutputStream.Write($buffer, 0, $buffer.Length)
+ $response.OutputStream.Close()
+ }
+ }
+
+
"/runTweaks" {
if ($request.HttpMethod -eq "POST") {
try {