C

CTF Lab

/hubs/ctf-lab

A space for everyone - from beginners to seasoned hackers. Share write-ups, discuss challenges, and level up together.

Korea1 member3 posts
P
potatoKorea20 hours ago

[Bandit] Lv.2 -> Lv.3

[Bandit] Lv.2 -> Lv.3

Level Goal The password for the next level is stored in a file called --spaces in this filename-- located in the home directory 1. Used ls to confirm the filename spaces in this filename. Applying what was learned in Lv.1 → Lv.2, I tried cat ./spaces in this filename, but the shell recognized ./spaces, in, this, and filename as separate files. 2. This appeared to be caused by the spaces in the filename. I looked up Google Search for "spaces in filename" from the Helpful Reading Material section, which explained that filenames containing spaces are treated as separate files by the shell, resulting in the error shown in the first image. The solution is to either wrap the filename in quotes or use an escape character (\) before each space.

2
0
P
potatoKorea1 days ago

[Bandit] lv.1 -> lv.2

[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.

3
0
P
potatoKorea1 days ago

[Bandit] lv.0 -> lv.1

[Bandit] lv.0 -> lv.1

Level Goal The password for the next level is stored in a file called readme located in the home directory. Use this password to log into bandit1 using SSH. Whenever you find a password for a level, use SSH (on port 2220) to log into that level and continue the game. 1. In Linux, the ls command stands for "list" and is used to display the contents of the current directory or a specified path. Usage: ls [options] [file or directory] 2. The cat command is a basic Linux command used to display the contents of a text file on the screen. Usage: cat [options] [file]

3
0
You've reached the end.