Skip to content

Commit 19382ea

Browse files
use exactly the same shell history as in tasks.yml
1 parent a3f092f commit 19382ea

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎docker/scenarios/02_vuln_password_in_shell_history.sh‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,19 @@
22
set -e
33
cat > /home/lowpriv/.bash_history <<"EOF"
44
ls
5-
cat .bash_history
5+
cat .bash_history
66
echo 'aim8Du7h' | su whoami
77
echo 'aim8Du7h' | su -S whoami
8+
echo 'aim8Du7h' | su - ls
89
echo 'aim8Du7h' | su root
10+
expect
11+
sudo apt install expect
12+
su
13+
expect -c 'spawn ssh root@127.0.0.1 ; expect "password:"; send "aim8Du7h\r"; interact'
914
history
15+
sshpass -p aim8Du7h ssh root@localhost
16+
history
17+
exit
1018
EOF
1119
chown lowpriv:lowpriv /home/lowpriv/.bash_history
1220
chmod 660 /home/lowpriv/.bash_history

0 commit comments

Comments
 (0)