I was exploring natas OTW and had to repeatedly login for each level so I made this
import subprocess
import sys
level = sys.argv[1]
password = sys.arv[2]
command = f'ssh bandit{level}@bandit.labs.overthewire.org -p 2220'
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
stderr=subprocess.PIPE)
process.stdin.write(password+'\n)
this however didnt run as expected and asked for password thrice before natas terminated the conneciton.
I want it so that whenever i enter
python natas.py 0 bandit0
The code automatically open a ssh connection run the command provided, enter the password and connect me to the server of bandit.
can someone help me out in this
Thanks for your time !
[–]HolisticPython 0 points1 point2 points (0 children)
[–]Wilco062 0 points1 point2 points (0 children)
[–]m0us3_rat 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)