Urgent.News

What's breaking now, across thousands of outlets.

Tech

OverTheWire Bandit Level 2 Writeup — Read a Filename With Spaces

The password file is named spaces in this filename . The shell splits unquoted arguments on whitespace, so the filename has to be quoted or escaped to be treated as one argument. Platform: OverTheWire Bandit Category: Linux Fundamentals Level: 2 → 3 Difficulty: Beginner Technique: Shell quoting and escaping Challenge description Level 2's home directory has one file, but its name contains spaces.…

The OverTheWire Bandit level 2 writeup focuses on accessing a file named "spaces in this filename" located in the home directory. This file's name contains spaces, which poses a challenge for the shell when it comes to interpreting the filename properly.

Upon logging in as bandit2, the recommended first step is to list the files in the home directory using the `ls` command. However, when attempting to directly access "spaces in this filename" without addressing the space issue, the command will split the filename into separate arguments due to the shell's behavior of treating unquoted spaces as argument separators.

To resolve this, two techniques are suggested: quoting the filename using double quotes (`"`) or escaping each space with a backslash (`\`). Both methods ensure the shell treats the entire filename as a single argument. For example, typing `cat "spaces in this filename"` or `cat spaces\ in\ this\ filename` will successfully read the file's contents, thereby revealing the password for the next level (bandit3).

The writeup emphasizes the importance of using proper quoting or escaping techniques when dealing with filenames that may contain special characters, such as spaces. It also highlights the convenience of relying on tab-completion, which automatically escapes special characters for the user, eliminating the need for manual intervention. By following these recommended practices, users can effectively navigate through the OverTheWire Bandit challenges and progress to higher levels.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Adding Concurrency with `cancel-in-progress` to GitHub Actions CI to Cut Build Minutes

Adding Concurrency with cancel-in-progress to GitHub Actions CI to Cut Build Minutes TL;DR: I added a concurrency block with cancel-in-progress: true to the ci-e2e.yml workflow, preventing overlapping…

  • GitHub Actions workflows updated with concurrency block
  • cancel-in-progress: true ensures canceled previous runs
  • Build minutes cut by ~30% on active pull requests

From 10,000 frames to 30 moments: Building a visual story compressor

Two hours at 2fps is around 14,000 frames. Most of them are noise: the cursor blinks, the system clock ticks, nothing in the code moved. The first step isn't clever. It's just getting rid of those.

  • ProgressCut compresses coding sessions into 30-second visual stories
  • First stage removes identical frames using dHash, discarding 89% of frames
  • Third stage segments frames into regions, averaging SSIM scores for changes

More from Friday 2 October →