• info@fabriziosebis.com
  • Cagliari, Sardinia, Italy
Wi-Fi
OverTheWire – Bandit Level 4 → Level 6

OverTheWire – Bandit Level 4 → Level 6

Bandit Level 4 → Level 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.

Commands you may need to solve this level

ls, cd, cat, file, du, find

bandit4@bandit:~$ ls
inhere
bandit4@bandit:~$ cd inhere/
bandit4@bandit:~/inhere$ ls
-file00  -file02  -file04  -file06  -file08
-file01  -file03  -file05  -file07  -file09
bandit4@bandit:~/inhere$ file ./-file0*
./-file00: data
./-file01: data
./-file02: data
./-file03: data
./-file04: data
./-file05: data
./-file06: data
./-file07: ASCII text
./-file08: data
./-file09: data
bandit4@bandit:~/inhere$ cat ./-file07
koReBOKuIDDepwhWk7jZC0RTdopnAYKh

 

Il comando file serve appunto a controllare e classificare uno o più file tenendo conto del tipo di dati che contengono, va a fare un controllo sul file “magico” /usr/share/magic e se non riesce a determinare il tipo di file, quest’ultimo viene classificato come “data” vedi per esempio tutti gli altri file presenti nella cartella /inhere.

Bandit Level 5 → Level 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

Commands you may need to solve this level

ls, cd, cat, file, du, find

bandit5@bandit:~$ ls
inhere
bandit5@bandit:~$ cd inhere/
bandit5@bandit:~/inhere$ ls
maybehere00  maybehere04  maybehere08  maybehere12  maybehere16
maybehere01  maybehere05  maybehere09  maybehere13  maybehere17
maybehere02  maybehere06  maybehere10  maybehere14  maybehere18
maybehere03  maybehere07  maybehere11  maybehere15  maybehere19
bandit5@bandit:~/inhere$ find -type f -size 1033c
./maybehere07/.file2
bandit5@bandit:~/inhere$ cat ./maybehere07/.file2
DXjZPULLxYr17uwoI01bNLQbtFemEgo7

Per risolvere  questo livello è stato utilizzato un nuovo comando: find; serve a cercare file o gruppi di file che rispettano determinati requisiti specificati aggiungendo opzioni al comando, in questo esempio si richiedeva un file human-readable (leggibile) , con dimensione di 1033 bytes e non eseguibile.

-type f        trova un file di tipo plain file

-size 1033c     ovviamente indica la dimensione del file, la lettera c indica il formato in bytes

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *