SSH Information Host: bandit.labs.overthewire.org Port: 2220
bandit0@bandit:~$ cat readme
NH2SXQwcBdpmTEzi3bvBHMM9H66vVXjL
- Dashed filename
bandit1@bandit:~$ cat ./-
rRGizSaX8Mk1RTb1CNQoXTcYZWU6lgzi
- Spaces in filename
bandit2@bandit:~$ cat spaces\ in\ this\ filename
aBZ0W5EmUfAf7kHTQeOwd8bauFJ2lAiG
bandit3@bandit:~$ cat inhere/.hidden
2EW7BBsr6aMMoJ2HjW067dm8EgX26xNe
bandit4@bandit:~$ file inhere/*
inhere/-file00: data
inhere/-file01: data
inhere/-file02: data
inhere/-file03: data
inhere/-file04: data
inhere/-file05: data
inhere/-file06: data
inhere/-file07: ASCII text
inhere/-file08: data
inhere/-file09: Non-ISO extended-ASCII text, with no line terminators
bandit4@bandit:~$ cat inhere/-file07
lrIWWI6bB37kxfiCQZqUdOIYfr6eEeqR
- No tamanho especificado como "1033c", o "c" é uma unidade de medida utilizada pelo find para representar bytes exatos. Nesse contexto, "c" significa "bytes".
bandit5@bandit:~$ find inhere/ -type f -size 1033c
inhere/maybehere07/.file2
bandit5@bandit:~$ cat inhere/maybehere07/.file2
P4L4vucdmLnm8I7Vl7jG1ApGSfjYKqJU
bandit6@bandit:~$ find / -user bandit7 -group bandit6 -size 33c -type f 2>/dev/null
/var/lib/dpkg/info/bandit7.password
bandit6@bandit:~$ cat /var/lib/dpkg/info/bandit7.password
z7WtoNQU2XfjmMtWA8u5rN4vzqu4v99S
bandit7@bandit:~$ cat data.txt | grep millionth
millionth TESKZC0XvTetK0S9xNwm25STk5iWrBvP
bandit8@bandit:~$ cat data.txt | sort | uniq -u
EN632PlfYiZbn3PhVK3XOGSlNInNE00t
- O comando strings no Linux é usado para extrair sequências de caracteres legíveis de arquivos, geralmente em busca de texto em arquivos binários. Ele varre um arquivo e identifica qualquer sequência de caracteres que pareça ser texto legível.
bandit9@bandit:~$ strings data.txt | grep "====="
4========== the#
========== password
========== is
========== G7w8LIi6J3kTb8A7j9LgrywtEUlyyp6s
bandit10@bandit:~$ base64 --decode data.txt
The password is 6zPeziLdR2RKNdNYFNb6nVCKzphlXHBM
- ROT13
- O comando tr é um utilitário no Linux que traduz ou exclui caracteres de entrada, substituindo-os por outros caracteres com base em duas sequências de caracteres fornecidas.
bandit11@bandit:~$ tr 'A-Za-z' 'N-ZA-Mn-za-m' < data.txt
The password is JVNBBFSmZwKKOP0XbFXOoW8chDz5yVRv
- HexDump
#!/bin/bash
# descompactar.sh
# Define o arquivo que você está trabalhando
arquivo=$1
# Função para descompactar arquivos com base no tipo
descompactar() {
local arquivo=$1
# Determina o tipo do arquivo
tipo=$(file -b --mime-type "$arquivo")
# Toma a ação apropriada com base no tipo do arquivo
case $tipo in
application/gzip)
mv "$arquivo" "${arquivo}.gz"
gzip -d "${arquivo}.gz"
descompactar "${arquivo}"
;;
application/x-bzip2)
mv "$arquivo" "${arquivo}.bz2"
bzip2 -d "${arquivo}.bz2"
descompactar "$arquivo"
;;
application/x-tar)
mv "$arquivo" "${arquivo}.tar"
tar -xf "${arquivo}.tar"
for arquivo_extraido in $(tar -tf "${arquivo}.tar"); do
descompactar "$arquivo_extraido"
done
;;
text/plain)
cat "$arquivo"
;;
*)
echo "Tipo de arquivo desconhecido: $tipo"
;;
esac
}
descompactar $arquivo
bandit12@bandit:/tmp/data$ xxd -r ~/data.txt > data.bin.gz
bandit12@bandit:/tmp/data$ ./descompactar.sh data.bin.gz
The password is wbWdlBxEir4CaE8LaPhauuOo6pwRmrDw
bandit13@bandit:~$ cat sshkey.private
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAxkkOE83W2cOT7IWhFc9aPaaQmQDdgzuXCv+ppZHa++buSkN+
gg0tcr7Fw8NLGa5+Uzec2rEg0WmeevB13AIoYp0MZyETq46t+jk9puNwZwIt9XgB
ZufGtZEwWbFWw/vVLNwOXBe4UWStGRWzgPpEeSv5Tb1VjLZIBdGphTIK22Amz6Zb
ThMsiMnyJafEwJ/T8PQO3myS91vU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