Level 5 → 6

Level Goal

The password for the next level is stored in a file somewhere under the inhere directory and has all of the following properties:

  • human-readable

  • 1033 bytes in size

  • not executable

Write-Up

  1. Find the file matching the specific criteria:

find inhere -type f -readable -size 1033c ! -executable
find inhere -type f -readable -size 1033c ! -executable
  • find inhere: Start searching in the 'inhere' directory

  • -type f: Look for regular files

  • -readable: Find human-readable files

  • -size 1033c: Look for files exactly 1033 bytes in size

  • ! -executable: Exclude executable files

This command reveals .file2 as the only file meeting all requirements.

  1. Display the content of the identified file:

cat $(find inhere -type f -readable -size 1033c ! -executable)
cat $(find inhere -type f -readable -size 1033c ! -executable)
  • cat: Command to display the content of a file

  • $(): Command substitution. It allows the output of a command to be used as an argument for another command

Or

cat inhere/maybehere07/.file2
cat inhere/maybehere07/.file2

This outputs the password: HWasnPhtq9AVKe0dmk45nxy20cvUa6EG

  1. Access the next level:

ssh [email protected] -p 2220

Enter the password when prompted.

Lessons Learned

  • The find command can search based on multiple criteria simultaneously

  • File attributes like size and permissions can be used as search parameters

  • Command substitution ($()) allows for combining commands efficiently

  • Hidden files (starting with .) can contain important information

-- Othmane

Last updated

Was this helpful?