Wargame: Bandit
Level: 1
Category: Linux Fundamentals
Description
The password is in a file named - in the home directory. Reading it with cat - does not work because - is interpreted as stdin.
Overview
- When a filename starts with
-, most utilities interpret it as a flag argument. - Using a redirect
< -or providing the path as./-forces the shell to treat it as a filename.
Solution
- Use input redirection to pass the file named
-tocat.
channel = connect.system("cat < -")
result = channel.recv().decode().strip()
Password
rRGizSaX8Mk1RTb1CNQoXTcYZWU6lgzi