ssh bandit20@bandit.labs.overthewire.org -p 2220
#VxCazJaVykI6W36BkBU0mJTCM8rR95XT
There is a setuid binary in the homedirectory that does the following: it makes a connection to localhost on the port you specify as a commandline argument. It then reads a line of text from the connection and compares it to the password in the previous level (bandit20). If the password is correct, it will transmit the password for the next level
홈 디렉토리에는 setuid 바이너리가 있으며, 이 바이너리는 명령줄 인수로 지정한 포트의 localhost에 연결합니다. 그런 다음 연결에서 텍스트 한 줄을 읽고 이전 수준의 암호(bandit20)와 비교합니다. 암호가 올바르면 다음 단계의 암호를 전송합니다.
대충 포트로 이전 비밀번호를 보내면, 반대쪽으로 다음 비밀번호를 준다는 뜻이다
2개의 터미널로 접속해서 푼다
터미널1에서 nc -l 1234로 1234번 포트를 열어놓는다
터미널2에서 ./suconnect 1234 로 포트에 연결한다
터미널1에서 이전비밀번호를 보내면, 터미널2에서 이를 읽고 다시 1로 현재비밀번호를 보낸다
#NvEJF7oVjkddltPSrdKEFOllh9V1IBcq