Vous êtes sur la page 1sur 15

http://overthewire.

org/wargames/

https://github.com/USCGA/writeups/tree/master/overthewire/bandit

https://www.youtube.com/user/RootOfTheNull/playlists

bandit level0

pass bandit0

ssh -l bandit0 bandit.labs.overthewire.org -p 2220


Readme:

boJ9jbbUNNfktd78OOpsqOltutMc3MY1

bandit level1

ssh -l bandit1 bandit.labs.overthewire.org -p 2220

cat /home/bandit1/-

pass CV1DtqXWVFXTvM2F0k09SHz0YwRINYA9

bandit level2

cat spaces\ in\ this\ filename

UmHadQclWmgdLOKQ3YNgjWxGoRMb5luK

bandit level3

cd inhere

ls –las

cat .hidden

pIwrPrtPN36QITSp3EQaw936yaFoFgAB

bandit level4

cat /home/bandit4/inhere/-file07

koReBOKuIDDepwhWk7jZC0RTdopnAYKh

bandit level5

Como especifica que el archivo tiene un tamaño de 1033 bytes in size

Hacemos una búsqueda

find -size 1033c

lo cual nos devuelve un resultado de

./maybehere07/.file2

Dentro de este archivo esta la flag

DXjZPULLxYr17uwoI01bNLQbtFemEgo7
bandit level6

Buscando con las pistas que nos da tenemos muchos archivos que nos da permiso denegado

find / -size 33c -user bandit7 -group bandit6

La solución redirigir a /dev/null lo que no sea valido

find / -size 33c -user bandit7 -group bandit6 2>/dev/null

de esta forma vemos que la flag esta en /var/lib/dpkg/info/bandit7.password

HKBPTKQnIay4Fw76bEy8PVxKEDQRKTzs

bandit level7

Tenemos un archivo data.txt el cual al hacer un cat tenemos mucho texto.

Telemos que usar grep para filtrarlo con la pista que nos da

cat data.txt | grep millionth

cvX2JJa4CFALtqS87jk27qwqGhBM9plV

bandit level8

La pista que nos da es que es la única línea que no se repite

Tenemos que hacer uso de las redirecciones para filtrar el archivo

El comando sort ordena las cadenas agrupándolas

El comando unique –u nos mostrara la única línea que no se repite

cat data.txt | sort | uniq –u

lo cual nos devuelve

UsvVyFSfZZWbi6wgC7dAFyFuR6jQQUhR

bandit level9

cat data.txt | strings | grep "="

truKLdjsbJ5g7yyJ2X2R0o3a5HQJFuLk

bandit level10

El pass esta en base64

cat data.txt | base64 –decore

IFukwKGsFW8MOq3IRFqrxE1hxTNEbUPR

bandit level11

https://cryptii.com/rot13

The password is 5Te8Y4drgCRfCx8ugdwuEX8KFC6k2EUu

bandit level12
El password esta en un hexdump, utilizamos el programa xxd para hacer un volcado de los
datos.

Creamos un directorio en /tmp/user/ donde podremos realizar todos los pasos

Mkdir /tmp/usuario/
Xxd –x data.txt > /tmp/usuario/original
Ahora nos vamos a la carpeta y vemos el tipo de archivo que tenemos

file original
original: gzip compressed data, was "data2.bin", last modified: Thu Dec 28 13:34:36 2017,
max compression, from Unix

Nos informa de que es un gzip y que tiene un archivo data2.bin dentro

Si lo intentamos descomprimir con gzip nos dice que no reconoce la extension.

Lo renombramos.

Mv original original.zip

Al intentar descomprimir de nuevo nos informa de que no puede descomprimir, que probemos
con original.out

Mv original.zip original.out

Ahora si

Gunzip –S .out original.out

De esta forma ya tenemos otro tipo de archivo, le abrimos con file para que nos informe

file original
original: POSIX tar archive (GNU)

Ya tenemos un archivo tar, le desempaquetamos

tar xf original

ahora nos sale otro archivo llamado data5.bin que también es un tar y nos devolverá un
data6.bin que es del mismo tipo

el resultado de descomprimir estos 2 es el data8.bin el cual es un gzip

gunzip -S .bin data8.bin


cat data8
The password is 8ZjyCRiBWFYkneahHwxCv3wb2a1ORpYL

bandit level13

Tenemos un archivo con la clave privada ssh de bandit14, lo utilizamos para conectarnos a la
maquina desde el

ssh -i sshkey.private bandit14@localhost


cat /etc/bandit_pass/bandit14

4wcYUJFw0k0XLShlDzztnTBHiqxU3b3e

bandit level14

The password for the next level can be retrieved by submitting the password of the current
level to port 30000 on localhost.

Nos conectamos por nc al puerto 30000 como nos indican

nc -v localhost 30000

si le damos a intro nos dice:

login

Wrong! Please enter the correct current password

Por lo que volvemos a entrar con nc, pegamos la password y damos a intro.

nc -v localhost 30000
nc: connect to localhost port 30000 (tcp) failed: Connection refused
Connection to localhost 30000 port [tcp/*] succeeded!
4wcYUJFw0k0XLShlDzztnTBHiqxU3b3e
Correct!
BfMYroe26WYalil77FoDi9qh59eK5xNr

bandit level15

The password for the next level can be retrieved by submitting the password of the
current level to port 30001 on localhost using SSL encryption.

Helpful note: Getting “HEARTBEATING” and “Read R BLOCK”? Use -ign_eof


and read the “CONNECTED COMMANDS” section in the manpage. Next to ‘R’
and ‘Q’, the ‘B’ command also works in this version of that command…

Nos conectamos con openssl

openssl s_client -connect localhost:30001

openssl s_client -connect localhost:30001 -ign_eof

Nos pedirá la clave, se la ponemos

Correct!

cluFn7wTiGryunymYOu4RcffSxQluehd
bandit level16

The credentials for the next level can be retrieved by submitting the password of the current
level to a port on localhost in the range 31000 to 32000

nmap -sT -p 31000-32000 localhost

Starting Nmap 7.01 ( https://nmap.org ) at 2018-08-25 10:49 CEST


Nmap scan report for localhost (127.0.0.1)
Host is up (0.00027s latency).
Other addresses for localhost (not scanned): ::1
Not shown: 996 closed ports
PORT STATE SERVICE
31046/tcp open unknown
31518/tcp open unknown
31691/tcp open unknown
31790/tcp open unknown
31960/tcp open unknown

Probamos a conectarnos con openssl a todos los puertos abiertos

Nos conectamos al 31790 e introducimos la clave

openssl s_client -connect localhost:30001


-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAvmOkuifmMg6HL2YPIOjon6iWfbp7c3jx34YkYWqUH57SUdyJ
imZzeyGC0gtZPGujUSxiJSWI/oTqexh+cAMTSMlOJf7+BrJObArnxd9Y7YT2bRPQ
Ja6Lzb558YW3FZl87ORiO+rW4LCDCNd2lUvLE/GL2GWyuKN0K5iCd5TbtJzEkQTu
DSt2mcNn4rhAL+JFr56o4T6z8WWAW18BR6yGrMq7Q/kALHYW3OekePQAzL0VUYbW
JGTi65CxbCnzc/w4+mqQyvmzpWtMAzJTzAzQxNbkR2MBGySxDLrjg0LWN6sK7wNX
x0YVztz/zbIkPjfkU1jHS+9EbVNj+D1XFOJuaQIDAQABAoIBABagpxpM1aoLWfvD
KHcj10nqcoBc4oE11aFYQwik7xfW+24pRNuDE6SFthOar69jp5RlLwD1NhPx3iBl
J9nOM8OJ0VToum43UOS8YxF8WwhXriYGnc1sskbwpXOUDc9uX4+UESzH22P29ovd
d8WErY0gPxun8pbJLmxkAtWNhpMvfe0050vk9TL5wqbu9AlbssgTcCXkMQnPw9nC
YNN6DDP2lbcBrvgT9YCNL6C+ZKufD52yOQ9qOkwFTEQpjtF4uNtJom+asvlpmS8A
vLY9r60wYSvmZhNqBUrj7lyCtXMIu1kkd4w7F77k+DjHoAXyxcUp1DGL51sOmama
+TOWWgECgYEA8JtPxP0GRJ+IQkX262jM3dEIkza8ky5moIwUqYdsx0NxHgRRhORT
8c8hAuRBb2G82so8vUHk/fur85OEfc9TncnCY2crpoqsghifKLxrLgtT+qDpfZnx
SatLdt8GfQ85yA7hnWWJ2MxF3NaeSDm75Lsm+tBbAiyc9P2jGRNtMSkCgYEAypHd
HCctNi/FwjulhttFx/rHYKhLidZDFYeiE/v45bN4yFm8x7R/b0iE7KaszX+Exdvt
SghaTdcG0Knyw1bpJVyusavPzpaJMjdJ6tcFhVAbAjm7enCIvGCSx+X3l5SiWg0A
R57hJglezIiVjv3aGwHwvlZvtszK6zV6oXFAu0ECgYAbjo46T4hyP5tJi93V5HDi
Ttiek7xRVxUl+iU7rWkGAXFpMLFteQEsRr7PJ/lemmEY5eTDAFMLy9FL2m9oQWCg
R8VdwSk8r9FGLS+9aKcV5PI/WEKlwgXinB3OhYimtiG2Cg5JCqIZFHxD6MjEGOiu
L8ktHMPvodBwNsSBULpG0QKBgBAplTfC1HOnWiMGOU3KPwYWt0O6CdTkmJOmL8Ni
blh9elyZ9FsGxsgtRBXRsqXuz7wtsQAgLHxbdLq/ZJQ7YfzOKU4ZxEnabvXnvWkU
YOdjHdSOoKvDQNWu6ucyLRAWFuISeXw9a/9p7ftpxm0TSgyvmfLF2MIAEwyzRqaM
77pBAoGAMmjmIJdjp+Ez8duyn3ieo36yrttF5NSsJLAbxFpdlc1gvtGCWW+9Cq0b
dxviW8+TFVEBl1O4f7HVm6EpTscdDxU+bCXWkfjuRb7Dy9GOtt9JPsX8MBTakzh3
vBgsyi/sN3RqRBcGU40fOoZyfAMT8s1m/uYv52O6IgeuZ/ujbjY=
-----END RSA PRIVATE KEY-----

Obtendremos una clave rsa, la guardamos en un documento en nuestro equipo.

La cual utilizaremos para conectanos para el siguiente nivel.

bandit level17
There are 2 files in the homedirectory: passwords.old and passwords.new. The password for
the next level is in passwords.new and is the only line that has been changed between
passwords.old and passwords.new

Nos conectamos por ssh con la clave rsa que obtuvimos en el nivel anterior, en caso de que
nos diga que los permisos de la clave con muy abiertos cambiarlos.

Chmod 400 bandit17.key

Con esto ya podremos usar la clave para conectarnos.

ssh -i bandit17.key bandit17@bandit.labs.overthewire.org -p 2220

Comparamos los 2 archivos usando diff

diff -q passwords.old passwords.new

y nos da como resultado:

42c42

< 6vcSC74ROI95NqkKaeEC2ABVMDX9TyUr

---

> kfBf3eYk5BPBRzwjqutbbfE887SVc5Yd

bandit level18

no podemos iniciar sesión por ssh por lo que tendremos que mandar los comandos desde este

Lo primero hacemos un listado

ssh -l bandit18 bandit.labs.overthewire.org -p 2220 ls


This is a OverTheWire game server. More information on
http://www.overthewire.org/wargames
bandit18@bandit.labs.overthewire.org's password:
readme

ssh -l bandit18 bandit.labs.overthewire.org -p 2220 cat readme


This is a OverTheWire game server. More information on
http://www.overthewire.org/wargames
bandit18@bandit.labs.overthewire.org's password:
IueksS7Ubh8G3DCwVzrTd8rAVOwq3M5x

bandit level19

Nos encontramos con un ejecutable con el setuid activado, le ejecutamos

Y nos informa que lo que hace es ejecutar comandos como bandit20.


GbKksEFF4yrVs6il55v6gwY5aVje5f0j

bandit level20

Tenemos un programa suconect

Usage: ./suconnect <portnumber>

This program will connect to the given port on localhost using TCP. If it receives the correct
password from the other side, the next password is transmitted back.

Conecta con un puerto tcp y cuando recibe el pass correcto desde otro lado devuelve el pass
del siguiente nivel.

Nos conectamos 2 veces al mismo servidor por ssh dejando 2 consolas con conexiones
abiertas.

En una abrimos un nc y le dejamos en espera:

Nc –l 4444

Desde el otro usamos suconect para conectarnos con el equipo local y el puerto que usamos
en nc 4444

./suconect 4444

Si escribimos la clave en el lado del suconect no hace nada, pero si la ponemos en el lado
donde tenemos el nc abierto recibiremos la clave.

gE269g2h3mw3pwgrj0Ha9Uoqen1c9DGr

bandit level21

Nos informa de que un programa se ejecuta en intervalos regulares con crom, que miremos en
/etc/crom.d/ para ver la configuración

Dicho y echo nos vamos al directorio crom para ver que tenemos

bandit21@bandit:/etc/cron.d$ ls

cronjob_bandit22 cronjob_bandit23 cronjob_bandit24 popularity-contest

Comprobamos la tarea cromjob_bandit22

bandit21@bandit:/etc/cron.d$ cat cronjob_bandit22

@reboot bandit22 /usr/bin/cronjob_bandit22.sh &> /dev/null

* * * * * bandit22 /usr/bin/cronjob_bandit22.sh &> /dev/null

Abrimos el archivo que menciona para ver que tiene


bandit21@bandit:/etc/cron.d$ cat /usr/bin/cronjob_bandit22.sh

#!/bin/bash

chmod 644 /tmp/t7O6lds9S0RqQh9aMcz6ShpAoZKF7fgv

cat /etc/bandit_pass/bandit22 > /tmp/t7O6lds9S0RqQh9aMcz6ShpAoZKF7fgv

Comprobamos el archivo que crea

bandit21@bandit:/tmp$ cat t7O6lds9S0RqQh9aMcz6ShpAoZKF7fgv

Yk7owGAcWjwMVRwrTesJEwB7WVOiILLI

bandit level22

De nuevo nos habla de que miremos:

Look in /etc/cron.d/ for the configuration and see what command is being executed.

cat /etc/cron.d/cronjob_bandit23

@reboot bandit23 /usr/bin/cronjob_bandit23.sh &> /dev/null

* * * * * bandit23 /usr/bin/cronjob_bandit23.sh &> /dev/null

Ahora miramos que tiene dentro el archivo que menciona

cat /usr/bin/cronjob_bandit23.sh
#!/bin/bash

myname=$(whoami)
mytarget=$(echo I am user $myname | md5sum | cut -d ' ' -f 1)

echo "Copying passwordfile /etc/bandit_pass/$myname to /tmp/$mytarget"

cat /etc/bandit_pass/$myname > /tmp/$mytarget

Podemos comprobar que guarda en la variable $myname el usuario actual, hace el calculo de
la suma md5 para extraer la contraseña y crear el archivo con ella

echo I am user bandit23 | md5sum

8ca319486bfbbc3663ea0fbe81326349

echo I am user bandit23 | md5sum | cut -d ' ' -f 1

8ca319486bfbbc3663ea0fbe81326349

Después ya podemos intentar leer el archivo creado en la carpeta /tmp

cat /tmp/8ca319486bfbbc3663ea0fbe81326349

jc1udXuA1tiHqjIsL8yaapX5XIAI6i0n

bandit23

De nuevo nos dice que miremos en cron.d


cat /etc/cron.d/cronjob_bandit24

@reboot bandit24 /usr/bin/cronjob_bandit24.sh &> /dev/null

* * * * * bandit24 /usr/bin/cronjob_bandit24.sh &> /dev/null

cat /usr/bin/cronjob_bandit24.sh
#!/bin/bash

myname=$(whoami)

cd /var/spool/$myname
echo "Executing and deleting all scripts in /var/spool/$myname:"
for i in * .*;
do
if [ "$i" != "." -a "$i" != ".." ];
then
echo "Handling $i"
timeout -s 9 60 ./$i
rm -f ./$i
fi
done

Nos creamos un script en la ruta que nos indica que copiara la clave a una carpeta que
tengamos acceso

nano /var/spool/bandit24/miband.sh
#!/bin/bash

cat /etc/bandit_pass/bandit24 > /tmp/our_winner.txt

Despues le damos permisos de ejecución


$ chmod +x our_script.sh

Y ya podemos ver si se a copiador el archivo


UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ

bandit24

A daemon is listening on port 30002 and will give you the password for bandit25 if given the
password for bandit24 and a secret numeric 4-digit pincode. There is no way to retrieve the
pincode except by going through all of the 10000 combinations, called brute-forcing.

Como nos dice que es un pincode de 4 dígitos nos creamos un script con un bucle que pruebe
las distintas combinaciones.
#!/bin/bash

for i in {0000..9999}
do
$i
echo "UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ $i" | netcat localhost
30002
done

Le damos permisos de ejecución y le lanzamos. Pasado un rato nos saldrá la convinacion


correcta.
Correct!
The password of user bandit25 is uNG9O58gUE7snukf3bvZ0rxhtnjzSGzG

Bandit25

Logging in to bandit26 from bandit25 should be fairly easy… The shell for user bandit26 is not
/bin/bash, but something else. Find out what it is, how it works and how to break out of it.

Al entrar nos encontramos con la clave privada para poder conectarnos con la siguiente
maquina, nos intentamos conectar por ssh pero se cierra la sesión nada mas abrir.

Si intentamos ejecutar un comando desde ssh nos lanza este error

Failed to add the host to the list of known hosts (/home/bandit25/.ssh/known_hosts).

Desde el usuario actual podemos ver la Shell que tiene


cat /etc/passwd | grep "bandit26"
bandit26:x:11026:11026:bandit level 26:/home/bandit26:/usr/bin/showtext

Comprobamos que tiene el archivo

cat /usr/bin/showtext
#!/bin/sh

export TERM=linux

more ~/text.txt
exit 0

Ya que se cierra la conexión antes de mostrarnos todo el texto utilizaremos el comando more

Hacemos la pantalla lo mas pequeña que podamos para que nos nos muestre todo y
ejecutamos el comando more con la conexión a la maquina

ssh -i bandit26.sshkey bandit26@localhost

Una vez que nos salga el texto, pulsamos la tecla v y después : para poder introducir comandos
dentro del editor, una vez echo esto escribimos:
:set shell sh=/bin/bash
:sh
Para obtener una Shell y ya podemos leer el archivo de pass
cat /etc/bandit_pass/bandit26

5czgV9L3Xx8JPOyRbXh6lQbmIOWvPT6Z

Bandit26

Este nivel es exactamente igual que el anterior, solo que al entrar tienes un suid que interpreta
los comandos como bandit27 con el cual listaremos la pass.

./bandit27-do
Run a command as another user.
Example: ./bandit27-do id
bandit26@bandit:~$ ./bandit27-do id
uid=11026(bandit26) gid=11026(bandit26) euid=11027(bandit27) groups=11026(bandit26)
bandit26@bandit:~$ ./bandit27-do cat /etc/passwd
passwd passwd-
bandit26@bandit:~$ ./bandit27-do cat /etc/bandit_pass/bandit27
3ba3118a22e93127a4ed485be72ef5ea
bandit26@bandit:~$

Bandit27

There is a git repository at ssh://bandit27-git@localhost/home/bandit27-


git/repo. The password for the user bandit27-git is the same as for the user bandit27.

Tenemos que obtener la pass de un repositorio utilizando git, nos creamos una carpeta que
/tmp/ que tengamos permisos de escritura, clonamos el repositorio y visualizamos el archivo
README.

bandit27@bandit:/tmp$ mkdir user27


bandit27@bandit:/tmp$ cd user27
bandit27@bandit:/tmp/user27$ git clone ssh://bandit27-git@localhost/home/bandit27-
git/repo
Cloning into 'repo'...
Could not create directory '/home/bandit27/.ssh'.
The authenticity of host 'localhost (127.0.0.1)' can't be established.
ECDSA key fingerprint is SHA256:98UL0ZWr85496EtCRkKlo20X3OPnyPSB5tB5RPbhczc.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/bandit27/.ssh/known_hosts).
This is a OverTheWire game server. More information on
http://www.overthewire.org/wargames
bandit27-git@localhost's password:
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3/3), done.
Checking connectivity... done.
bandit27@bandit:/tmp/user27$ ls
repo
bandit27@bandit:/tmp/user27$ cd repo/
bandit27@bandit:/tmp/user27/repo$ ls
README
bandit27@bandit:/tmp/user27/repo$ cat README
The password to the next level is: 0ef186ac70e04ea33b4c1853d2526fa2
bandit27@bandit:/tmp/user27/repo$

Bandit 28

Primera parte igual que la anterior, clonamos el repositorio, pero al ver el REAMDE no tiene la
clave, después:

Utilizamos las versiones de git para ver una versión anterior en la que si se puede ver el pass

Vemos el historial de versiones con:

git log

Despues podemos ver una versión anterior especifica con:

git show

bandit28@bandit:/tmp/user28/repo$ git log


commit 04e2414585ba775805a49b78d662d0946d08f27a
Author: Morla Porla <morla@overthewire.org>
Date: Sun Jul 22 14:47:13 2018 +0200

fix info leak

commit 196c3edc79e362fe89e0d75cfeef079d8c67beef
Author: Morla Porla <morla@overthewire.org>
Date: Sun Jul 22 14:47:13 2018 +0200

add missing data

commit 80383714fa509a363756866425b0b697e87824a0
Author: Ben Dover <noone@overthewire.org>
Date: Sun Jul 22 14:47:13 2018 +0200

initial commit of README.md


bandit28@bandit:/tmp/user28/repo$ git show
04e2414585ba775805a49b78d662d0946d08f27a
commit 04e2414585ba775805a49b78d662d0946d08f27a
Author: Morla Porla <morla@overthewire.org>
Date: Sun Jul 22 14:47:13 2018 +0200

fix info leak

diff --git a/README.md b/README.md


index 3f7cee8..5c6457b 100644
--- a/README.md
+++ b/README.md
@@ -4,5 +4,5 @@ Some notes for level29 of bandit.
## credentials
- username: bandit29
-- password: bbc96594b4e001778eee9975372716b2
+- password: xxxxxxxxxx

bandit28@bandit:/tmp/user28/repo$ git show


196c3edc79e362fe89e0d75cfeef079d8c67beef
commit 196c3edc79e362fe89e0d75cfeef079d8c67beef
Author: Morla Porla <morla@overthewire.org>
Date: Sun Jul 22 14:47:13 2018 +0200

add missing data

diff --git a/README.md b/README.md


index 7ba2d2f..3f7cee8 100644
--- a/README.md
+++ b/README.md
@@ -4,5 +4,5 @@ Some notes for level29 of bandit.
## credentials

- username: bandit29
-- password: <TBD>
+- password: bbc96594b4e001778eee9975372716b2

Bandit 29

Al hacer los mismos pasos del anterior nos muestra en el README que no hay password en
producción, por lo que utilizaremos

git brach –a

bandit29@bandit:/tmp/usuario39/repo$ git branch -a


* (HEAD detached at origin/dev)
master
remotes/origin/HEAD -> origin/master
remotes/origin/dev
remotes/origin/master
remotes/origin/sploits-dev

para ver las distintas ramas, como nos dice que no hay passwords en producción cambiaremos
a la rama dev

git checkout remotes/origin/dev

Despues ya podemos ver las diferentes versiones que tenemos con git log y en una de ellas nos
saldrá la pass

bandit29@bandit:/tmp/usuario39/repo$ git grep password

README.md:- password: 5b90576bedb2cc04c86a9e924ce42faf

Bandit 30
Nos descargamos el repo, pero tanto el README como el log están vacios, nos vamos a la
carpeta .git y la investigamos, dentro del archivo packed-refs nos hace referencia a un secret,
por lo que le vamos a ver.

git show f17132340e8ee6c159e0a4a6bc6f80e1da3b1aea

47e603bb428404d265f59c42920d81e5

Bandit 31

Al abrir el README nos habla de un archivo key.txt que no esta ni en el log ni en branch, por lo
que vamos a crear uno para que nos le actualice.

Nano key.txt

Con el contenido que indica ‘Content: 'May I come in?'

Al hacer un key.add nos dice que este tipo de archivos son ignoramos. –f para forzar

bandit31@bandit:/tmp/ban31/repo$ git add key.txt


The following paths are ignored by one of your .gitignore files:
key.txt
Use -f if you really want to add them.

git add -f key.txt

Despues hacemos un

Git commit

Git push

De esta forma al actualizar lis devuelve la pass

Counting objects: 2, done.


Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 272 bytes | 0 bytes/s, done.
Total 2 (delta 0), reused 0 (delta 0)
remote: ### Attempting to validate files... ####
remote:
remote: .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.
remote:
remote: 56a9bf19c63d650ce78e6ec0354ee45e
remote:
remote: .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.
remote:
To ssh://bandit31-git@localhost/home/bandit31-git/repo
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://bandit31-git@localhost/home/bandit31-git/repo'

Bandit 32
Creamos un directorio en /tmp/ donde tengamos permisos de escritura y nos creamos un
SCRIPT.SH

#!/bin/bash
bash
Ahora le damos permisos de ejecucion

Chmod +x SCRIPT.SH

Desde el directorio temporal abrimos

bandit32@bandit:/tmp/user32$ ~/uppershell
WELCOME TO THE UPPERCASE SHELL
>> ./SCRIPT.SH
bandit33@bandit:/tmp/user32$ cat /etc/bandit_pass/bandit33
c9c3199ddf4121b10cf581a98d51caee
bandit33@bandit:/tmp/user32$

Vous aimerez peut-être aussi