Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- CHROOT_FOLDER="$(realpath ./AttackPup2Headed.sfs.extracted/kali)"
- function umountall(){
- set -x
- umount -l "$CHROOT_FOLDER"/dev/shm
- umount -l "$CHROOT_FOLDER"/dev/pts
- umount -l "$CHROOT_FOLDER"/dev
- umount -l "$CHROOT_FOLDER"/proc
- umount -l "$CHROOT_FOLDER"/sys
- killall Xephyr
- }
- trap 'umountall' 1
- mkdir -p "$CHROOT_FOLDER"/sys
- mount --bind /dev "$CHROOT_FOLDER"/dev
- mount --bind /proc "$CHROOT_FOLDER"/proc
- mount --bind /sys "$CHROOT_FOLDER"/sys
- mkdir -p "$CHROOT_FOLDER"/dev/shm
- mount --bind "$CHROOT_FOLDER"/dev/shm
- mount -t devpts devpts "$CHROOT_FOLDER"/dev/pts
- XP="-fullscreen -title container -name Xephyr2 -dpi 144 -nolisten tcp"
- #if [ $T -ne 2 ];then
- Xephyr :2 ${XP} &
- #else
- # exit # Xephyr2 already running
- #fi
- cat << "EOF" >"$CHROOT_FOLDER"/strip_jwm.sh
- #!bin/sh
- cat /root/.jwmrc | sed -nr '$! {H};$ {H;x;s#(<StartupCommand>)(.*)(</StartupCommand>)##g;p}' > /root/.jwmrc-new
- mv /root/.jwmrc-new /root/.jwmrc
- cat /root/.jwmrc-tray | sed -nr '/.*xload*./! {p}' > /root/.jwmrc-tray-new
- mv /root/.jwmrc-tray-new /root/.jwmrc-tray
- EOF
- chmod +x "$CHROOT_FOLDER"/strip_jwm.sh
- echo '
- #!/bin/sh
- source /etc/profile
- ldconfig
- #gdk-pixbuf-query-loaders --update-cache
- /usr/bin/gtk-update-icon-cache -f /usr/share/icons/hicolor/
- DEFAULT_DESK_ICONS="JQ8flat"
- #[ $NEWPVERSION -ge 500 ] && DEFAULT_DESK_ICONS="JQ8flat"
- [ ! -d /usr/local/lib/X11/themes/JQ8flat ] && DEFAULT_DESK_ICONS="Stardust"
- [ -f /etc/desktop_icon_theme ] && DEFAULT_DESK_ICONS="`cat /etc/desktop_icon_theme`" #w477
- /usr/sbin/icon_switcher_cli $DEFAULT_DESK_ICONS
- fixmenus #probably not necessary
- DISPLAY=:2 rox -n &
- /strip_jwm.sh
- DISPLAY=:2 jwm &
- PID=$!
- #/opt/Ungoogled_Chromium-portable/chromium/chromium-pup-nosb" &
- wait "$PID"
- #DISPLAY=:2 jwm &
- #DISPLAY=:2 roxfiler -n &
- #DISPLAY=:2 xterm
- ' >"$CHROOT_FOLDER"/init_basic
- chmod +x "$CHROOT_FOLDER"/init_basic
- if [ ! -f "$CHROOT_FOLDER/opt/Ungoogled_Chromium-portable/chromium/chromium-pup-nosb" ] && \
- [ -f "$CHROOT_FOLDER/opt/Ungoogled_Chromium-portable/chromium/chromium-pup" ] ; then
- (cd "$CHROOT_FOLDER/opt/Ungoogled_Chromium-portable/chromium/"; cp -a chromium-pup chromium-pup-nosb;
- cat chromium-pup | sed -rn \
- '/run-as-spot "$HERE\/chrome"/ {s#^(.*)$#"$HERE/chrome" --no-sandbox --user-data-dir=$HERE/PROFILE --disable-infobars "$@"#g;p}
- /run-as-spot "$HERE\/chrome"/! {p}' > chromium-pup-nosb )
- fi
- cp -f /etc/resolv.conf "$CHROOT_FOLDER"/etc/resolv.conf
- mount -t devpts devpts "$CHROOT_FOLDER"/dev/pts
- cp /var/lib/dbus/machine-id "$CHROOT_FOLDER"/var/lib/dbus/machine-id
- echo "LD_LIBRARY_PATH=/lib/x86_64-linux-gnu:/usr/local/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH" > "$CHROOT_FOLDER"/etc/profile
- set +x
- #read -p "ready to chroot. Press enter to continue"
- LD_LIBRARY_PATH=/lib/x86_64-linux-gnu:/usr/local/lib/x86_64-linux-gnu:usr/lib/x86_64-linux-gnu:/lib64:/usr/lib64:/usr/local/lib64:/usr/lib64/seamonkey:/lib:/usr/lib:/lib32:/usr/lib32:/usr/local/lib:/usr/local/lib32:/opt/qt5/lib64:/usr/local/firstrib/bin \
- #DISPLAY=:2 chroot "$CHROOT_FOLDER" bash -c "/init_basic &"
- DISPLAY=:2 chroot "$CHROOT_FOLDER" /init_basic
- umountall
Add Comment
Please, Sign In to add comment