A daemon is listening on port 30002 and will give you the password for bandit25 if given the password for bandit24 and a secret numeric 4-digit pincode. There is no way to retrieve the pincode except by going through all of the 10000 combinations, called brute-forcing.
解密
bandit24@bandit:~$ :>/tmp/tmp.1YN5hffeea
bandit24@bandit:~$ for i in {0000..9999}
> do
> echo "UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ $i" >> /tmp/tmp.1YN5hffeea
> done
bandit24@bandit:~$ nc localhost 30002 < /tmp/tmp.1YN5hffeea
...
Correct!
The password of user bandit25 is uNG9O58gUE7snukf3bvZ0rxhtnjzSGzG
知识点
-
循环
i in {0000..9999}
,从0000
到9999
,在前面拼上bandit24密码输入到文件中; -
使用
nc
从文件中读入传输到本地端口30002;