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 9

La contraseña está en el archivo data.txt, en la única linea que solo se repite una vez.

Este comando nos permite ordenar las cadenas alfabéticamente con sort, luego quedarnos con las cadenas únicas con uniq y finalmente contar las repeticiones con el parámetro -c.

cat data.txt | sort | uniq -c 

Luego podemos buscar cuál es la que se repite solo una vez y listo, o eliminar las líneas que contienen un 10 porque todas contienen esa cantidad de repeticiones salvo la que nos interesa.

cat data.txt | sort | uniq -c | grep -v 10

Esta es otra forma de hacerlo, primero debemos ordenarlo porque uniq necesita que esté ordenado antes de aplicar el filtro por cadenas únicas:

cat data.txt | sort | uniq -u 

Proporcionamos la contraseña y nos convertimos en bandit9.

ssh bandit9@bandit.labs.overthewire -p 2220
PreviousNivel 8NextNivel 10

Last updated 1 year ago