P
potatoCTF LabCTF Lab1 days ago

[Bandit] lv.1 -> lv.2

Level Goal The password for the next level is stored in a file called - located in the home directory Connected to lv.Connected to lv.1 using the password obtained from lv.0 → lv.1. 1. Tried the same approach - used ls to check the filename and cat to read the file contents. However, only a cursor appeared instead of the file contents, so I used ls -l to inspect the file in detail. 2. The -l option stands for "long" and displays files in a long listing format, showing detailed information about each file. From the ls -l output, the user with uid bandit2 has read (r) and write (w) permissions, the user with gid bandit1 has read (r) permission only, and others have no permissions. Since I'm currently logged in as bandit1, I do have read access. I then Googled "dashed filename" from the Helpful Reading Material section. According to the search results, filenames starting with a dash (-) are valid in Linux, but since Unix command options also start with a dash (-), the shell interprets the filename as a command option - which is why only a cursor appears (waiting for standard input). 3. Therefore, when working with a dashed filename, you must specify the full path to the file explicitly. This leads to the solution.

4
0

Comments (0)

Log in to post a comment.

No comments yet

Start the conversation by leaving the first comment.