Level 4 → 5
Level Goal
The password for the next level is stored in the only human-readable file in the inhere directory. Tip: if your terminal is messed up, try the reset
command.
Write-Up
Navigate to the inhere directory:
ls
cd inhere

Identify the human-readable file:
for i in $(ls); do file -i "./$i"; done;

This reveals ./-file07 as the only text/plain file.
for i in $(ls)
: Loops through each file in the current directorydo
: Starts the loop bodyfile -i
: Runs thefile
command to each file, using./
to handle filenames starting with-
done
: Ends the loopOverall: Identifies the file type of every file in the directory.
Display the content of the identified file:
cat ./-file07

The retrieved password: 4oQYVPkxZOOEOO5pTW81FB8j8lxXGUQw
Access the next level:
ssh [email protected] -p 2220
Enter the password when prompted.
Lessons Learned
Scripting with loops can efficiently process multiple files
The
file
command helps identify file types regardless of extensionUsing
./
is crucial when dealing with files that start with-
-- Othmane
Last updated
Was this helpful?