From 9ce530e04c742aace7124b9e189ed86c8a7d5aac Mon Sep 17 00:00:00 2001 From: CoolElectronics <58010778+CoolElectronics@users.noreply.github.com> Date: Fri, 3 Mar 2023 16:58:11 -0500 Subject: [PATCH] update mush --- fakemurk.sh.pre | 24 +++++++++++++++++++++--- header.sh | 2 +- mush.sh | 30 ++++++++++++++++-------------- 3 files changed, 38 insertions(+), 18 deletions(-) diff --git a/fakemurk.sh.pre b/fakemurk.sh.pre index 29f4ba7..be19027 100755 --- a/fakemurk.sh.pre +++ b/fakemurk.sh.pre @@ -51,6 +51,14 @@ leave() { } config() { swallow_stdin + + echo "please enter the your managed email's domain. example: if your email is \"randomstudent@skid.edu\" then you will enter skid.edu" + echo "if you don't enter it correctly you won't be able to login, double check this" + read -r -p "> " EMAIL + echo + + swallow_stdin + echo read -r -p "Would you like to enable rootfs restore? It will add an option to quickly revert all changes and re-enroll. (Y/n)" choice case "$choice" in N | n | no | No | NO) ROOTFS_BACKUP=0 ;; @@ -159,9 +167,6 @@ drop_crossystem_sh() { chmod 777 "$ROOT/usr/bin/crossystem" } drop_pollen() { - echo "please enter the your managed email's domain. example: if your email is \"randomstudent@skid.edu\" then you will enter skid.edu" - echo "if you don't enter it correctly you won't be able to login, double check this" - read -r -p "> " EMAIL mkdir -p "$ROOT/etc/opt/chrome/policies/managed" raw_pollen | sed -e "s/__SED_REPLACEME_SCHOOL_EMAIL__/${EMAIL}/g" >$ROOT/etc/opt/chrome/policies/managed/policy.json chmod 777 "$ROOT/etc/opt/chrome/policies/managed/policy.json" @@ -285,7 +290,20 @@ EOF ROOT= fi } +get_largest_nvme_namespace() { + local largest size tmp_size dev + size=0 + dev=$(basename "$1") + for nvme in /sys/block/"${dev%n*}"*; do + tmp_size=$(cat "${nvme}"/size) + if [ "${tmp_size}" -gt "${size}" ]; then + largest="${nvme##*/}" + size="${tmp_size}" + fi + done + echo "${largest}" +} verity_enabled_for_n() { grep -q "root=/dev/dm" <"${DST}p${1}" } diff --git a/header.sh b/header.sh index 1e2fd6d..cd86954 100644 --- a/header.sh +++ b/header.sh @@ -26,7 +26,7 @@ ascii_info() { THIS IS FREE SOFTWARE! if you paid for this, you have been scammed and should demand your money back -fakemurk - a tool made by coolelectronics and r58playz to spoof verified boot while enrolled +fakemurk - a tool made by Mercury Workshop to spoof verified boot while enrolled you can find this script, its explanation, and documentation here: https://github.com/MercuryWorkshop/fakemurk EOF diff --git a/mush.sh b/mush.sh index 93c4d9f..9b20d55 100644 --- a/mush.sh +++ b/mush.sh @@ -57,8 +57,11 @@ main() { (8) Emergency Revert & Re-Enroll (9) Edit Pollen EOF + if ! test -f /mnt/stateful_partition/crouton; then + echo "(10) Install Crouton" + fi swallow_stdin - read -p "> (1-9): " choice + read -r -p "> (1-11): " choice case "$choice" in 1) runjob doas bash ;; 2) runjob bash ;; @@ -69,6 +72,8 @@ EOF 7) runjob hardenableext "*" ;; 8) runjob revert ;; 9) runjob edit /etc/opt/chrome/policies/managed/policy.json ;; + 10) runjob install_crouton ;; + 11) runjob prepare_crostini ;; *) echo "invalid option" ;; esac done @@ -117,29 +122,26 @@ revert() { sleep 1000 } harddisableext() { # calling it "hard disable" because it only reenables when you press - if [ ! -d "/home/chronos/.extstore" ]; then - mkdir /home/chronos/.extstore - fi - mv /home/chronos/user/Extensions/$1 /home/chronos/.extstore/ - chmod 000 /home/chronos/user/Extensions/$1 - - doas restart ui + read -r -p "enter extension id>" extid + chmod 000 "/home/chronos/user/Extensions/$extid" + kill -9 $(pgrep -f "\-\-extension\-process") } hardenableext() { - chmod 777 /home/chronos/user/Extensions/$1 - mv /home/chronos/.extstore/$1 /home/chronos/user/Extensions/$1 - - doas restart ui + read -r -p "enter extension id>" extid + chmod 777 "/home/chronos/user/Extensions/$extid" + kill -9 $(pgrep -f "\-\-extension\-process") } softdisableext() { echo "Extensions will stay disabled until you press Ctrl+c or close this tab" while true; do - kill -9 $(pgrep -f "\-\-extension\-process") + kill -9 $(pgrep -f "\-\-extension\-process") 2>/dev/null done } - +install_crouton() { + curl -SLk https://goo.gl/fd3zc | doas bash -t xfce && touch /mnt/stateful_partition/crouton +} if [ "$0" = "$BASH_SOURCE" ]; then stty sane main