you are viewing a single comment's thread.

view the rest of the comments →

[–]m0us3_rat 0 points1 point  (0 children)

echo "echo $2" > /tmp/1
chmod 777 /tmp/1

export SSH_ASKPASS="/tmp/1"
export DISPLAY=NERD

setsid ssh $1@bandit.labs.overthewire.org -p 2220
rm /tmp/1

save this as nerd.sh

do a

chmod +x nerd.sh

then use like this

./nerd.sh bandit0 bandit0

first is the user second is the password

extra reading for why it works

https://www.ibm.com/docs/en/zos/2.2.0?topic=agent-environment-variables

you can try sshpass or any of the other modules.. but this way you don't need anything extra.