stamin4
  • whoami
  • HTB Academy
    • Introduction to Academy
    • Learning Process
    • Vulnerability Assessment
    • Web Requests
    • Introduction to Networking
    • Linux Fundamentals
    • Brief Intro to Hardware Attacks
    • Setting Up
    • Using the Metasploit Framework
    • Security Incident Reporting
    • Introduction to Web Applications
    • JavaScript Deobfuscation
    • Attacking Web Applications with Ffuf
    • Windows Fundamentals
    • File Inclusion
  • HTB Machines
    • Windows
      • 🟢Easy
      • 🟠Medium
      • 🔴Difficult
      • 🟣Insane
    • Linux
      • 🟢Easy
        • Cap
      • 🟠Medium
      • 🔴Difficult
      • 🟣Insane
  • OverTheWire
    • Bandit
      • Nivel 0
      • Nivel 1
      • Nivel 2
      • Nivel 3
      • Nivel 4
      • Nivel 5
      • Nivel 6
      • Nivel 7
      • Nivel 8
      • Nivel 9
      • Nivel 10
  • Base de datos
    • SQL
      • SELECT queries 101
      • Queries with constraints (Pt. 1)
      • Queries with constraints (Pt. 2)
      • Filtering and sorting Query results
      • Simple SELECT Queries
      • Multi-table queries with JOINs
      • OUTER JOINs
      • A short note on NULLs
      • Queries with expressions
      • Queries with aggregates (Pt. 1)
      • Queries with aggregates (Pt. 2)
      • Order of execution of a Query
      • Inserting rows
      • Updating rows
      • Deleting rows
      • Creating tables
      • Altering tables
      • Dropping tables
  • PortSwigger
    • Path Traversal
  • Dockerlabs
    • Trust
    • Firsthacking
    • Upload
Powered by GitBook
On this page
  1. OverTheWire
  2. Bandit

Nivel 5

La flag está almacenada en el directorio inhere y es un archivo legible.

Por lo tanto, lo primero que hacemos es movernos a dicho directorio.

Para ver el tipo de contenido que hay dentro de cada archivo usamos file, un comando que se encuentra dentro del $PATH, por lo que podemos ejecutarlo sin poner toda la ruta absoluta:

file ./*

./-file00: data
./-file01: data
./-file02: data
./-file03: data
./-file04: data
./-file05: data
./-file06: data
./-file07: ASCII text
./-file08: data
./-file09: data

file funciona detectando los magic numbers, que son los primeros bits del archivo, que le permiten averiguar el tipo de archivo.

También podemos hacerlo por medio de un bucle. En cada iteración, la variable i va a ir tomando como valor el nombre de cada archivo que hay en el directorio.

for i in $(ls); do file ./$i; done

Vemos que el único archivo legible es -file07, ya que es de tipo ASCII (American Standard Code for Information Interchange). Este debe contener la contraseña.

cat ./-file07

Nivel resuelto, continuamos ahora como el usuario bandit5.

ssh bandit5@bandit.labs.overthewire -p 2220
PreviousNivel 4NextNivel 6

Last updated 1 year ago