Giter Site home page Giter Site logo

Comments (5)

HazEaSSaSSin avatar HazEaSSaSSin commented on July 16, 2024 1

Sorry about that delay, @gucci-on-fleek . You can mark this as closed now. I actually ended up dropping that class cuz I'm too busy lol. I wasn't able to confirm whether or not it worked because I can no longer access the course. Appreciate you checkin, though.

from lockdown-browser.

gucci-on-fleek avatar gucci-on-fleek commented on July 16, 2024

Ok, so the good news here is that the installer worked (mostly) as expected. That's good since lots of the other people with the OEM version have had bad luck getting the installer to work.

when I attempt to launch directly through that site, it detects the VM settings.

The regular Lockdown Browser uses an rldb:// URL protocol to open from a link. So either the installer isn't properly modifying the rldb protocol, or this version uses a different protocol. Try running

Set-ItemProperty -Path "HKCR:\rldb\shell\open\command" -Name "(Default)" -Value ('"' + $PSScriptRoot + '\withdll.exe" "/d:' + $PSScriptRoot + '\GetSystemMetrics-Hook.dll" ' + $lockdown_runtime + ' "%1"')

inside the Sandbox and see if that fixes anything. If not, you'll need to figure out what the correct protocol to use is. To do that, either copy the “launch in Lockdown Browser” link and see what protocol it uses, or search through the registry at HKCR (HKEY_CLASSES_ROOT) for the full path to wherever the Browser executable was installed. Then, you can modify the above line with the correct protocol.

from lockdown-browser.

HazEaSSaSSin avatar HazEaSSaSSin commented on July 16, 2024

Appreciate that! I'll give it a shot tonight and post an update here if it works successfully. Good looks

from lockdown-browser.

HazEaSSaSSin avatar HazEaSSaSSin commented on July 16, 2024

I may be slightly out of my element, but it looks to just use an https:// protocol.
ldb-link-1

I also looked through the registry, but it seems as though the LDB registered a number of different URL protocols.
reg-entry-1
reg-entry-2
reg-entry-3
reg-entry-4
reg-entry-5

All of these entries point to the same .exe and are identical. Is it possible to modify the above PS file to account for all of these?

from lockdown-browser.

gucci-on-fleek avatar gucci-on-fleek commented on July 16, 2024

@HazEaSSaSSin

I may be slightly out of my element, but it looks to just use an https:// protocol. ldb-link-1

Yeah, that URL is just https://, so it must at some point redirect to a rldb:// or ldb:// protocol.

I also looked through the registry, but it seems as though the LDB registered a number of different URL protocols. reg-entry-1 reg-entry-2 reg-entry-3 reg-entry-4 reg-entry-5

All of these entries point to the same .exe and are identical. Is it possible to modify the above PS file to account for all of these?

Sure, try replacing sandbox_run.ps1 with this (completely untested):

# Lockdown Browser in Windows Sandbox
# https://github.com/gucci-on-fleek/lockdown-browser
# SPDX-License-Identifier: MPL-2.0+
# SPDX-FileCopyrightText: 2020-2024 gucci-on-fleek

# DON'T RUN THIS ON YOUR REGULAR SYSTEM! IT WILL CAUSE **IRREVERSIBLE** DAMAGE

$ErrorActionPreference = "Stop"
Set-StrictMode -Version 3

cd $PSScriptRoot

$lockdown_extract_dir = "C:\Windows\Temp\Lockdown"
$lockdown_runtime = "C:\Program Files (x86)\Respondus\LockDown Browser\LockDownBrowser.exe"
$lockdown_installer = (ls Lockdown*)[0]

Get-ChildItem -Path "HKLM:\HARDWARE\DESCRIPTION" | Remove-ItemProperty -Name SystemBiosVersion -ErrorAction Ignore
rm HKLM:\HARDWARE\DESCRIPTION\System\BIOS -ErrorAction Ignore

# We're in a short-lived VM, so we can safely delete any necessary files
$vmcompute_path = "C:\Windows\System32\VmComputeAgent.exe"
takeown /f $vmcompute_path
icacls $vmcompute_path /grant "Everyone:(D)"
rm $vmcompute_path

& $lockdown_installer /x "`"$lockdown_extract_dir`"" # Dumb installer needs a quoted path, even with no spaces. Also, we have to extract the program before we can even run a silent install.
while (!(Test-Path $lockdown_extract_dir\id.txt)) {
    # This is the easiest way to detect if the installer is finished extracting
    sleep 0.2
}
sleep 1
kill -Name *Lockdown*

& "$lockdown_extract_dir\setup.exe" /s "/f1$PSScriptRoot\setup.iss" "/f2$PSScriptRoot\..\setup.log" # If we don't give a log file path, this doesn't work
Wait-Process -Name "setup"

# Support use of the `rldb://` URL protocol
New-PSDrive -PSProvider registry -Root HKEY_CLASSES_ROOT -Name HKCR
Set-ItemProperty -ErrorAction Ignore -Path "HKCR:\rldb\shell\open\command" -Name "(Default)" -Value ('"' + $PSScriptRoot + '\withdll.exe" "/d:' + $PSScriptRoot + '\GetSystemMetrics-Hook.dll" ' + $lockdown_runtime + ' "%1"')
Set-ItemProperty -ErrorAction Ignore -Path "HKCR:\anst\shell\open\command" -Name "(Default)" -Value ('"' + $PSScriptRoot + '\withdll.exe" "/d:' + $PSScriptRoot + '\GetSystemMetrics-Hook.dll" ' + $lockdown_runtime + ' "%1"')
Set-ItemProperty -ErrorAction Ignore -Path "HKCR:\cllb\shell\open\command" -Name "(Default)" -Value ('"' + $PSScriptRoot + '\withdll.exe" "/d:' + $PSScriptRoot + '\GetSystemMetrics-Hook.dll" ' + $lockdown_runtime + ' "%1"')
Set-ItemProperty -ErrorAction Ignore -Path "HKCR:\ielb\shell\open\command" -Name "(Default)" -Value ('"' + $PSScriptRoot + '\withdll.exe" "/d:' + $PSScriptRoot + '\GetSystemMetrics-Hook.dll" ' + $lockdown_runtime + ' "%1"')
Set-ItemProperty -ErrorAction Ignore -Path "HKCR:\ldb\shell\open\command" -Name "(Default)" -Value ('"' + $PSScriptRoot + '\withdll.exe" "/d:' + $PSScriptRoot + '\GetSystemMetrics-Hook.dll" ' + $lockdown_runtime + ' "%1"')
Set-ItemProperty -ErrorAction Ignore -Path "HKCR:\ldb1\shell\open\command" -Name "(Default)" -Value ('"' + $PSScriptRoot + '\withdll.exe" "/d:' + $PSScriptRoot + '\GetSystemMetrics-Hook.dll" ' + $lockdown_runtime + ' "%1"')

./withdll /d:GetSystemMetrics-Hook.dll $lockdown_runtime

If that works, then I'll add those lines into the main file.

from lockdown-browser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.