RODGAR
  • Whoami
  • HackTheBox
    • Hard
      • ⛔HackTheBox Vintage
    • Medium
      • HackTheBox Cascade
      • HackTheBox TombWatcher
      • Copy of HackTheBox TombWatcher
      • HackTheBox Monteverde
      • HackTheBox Resolute
      • HackTheBox Administrator
      • HackTheBox Escape
      • HackTheBox Authority
    • Easy
      • HackTheBox Active
      • HackTheBox Sauna
      • HackTheBox Support
      • HackTheBox Forest
      • HackTheBox Cicada
      • HackTheBox Timelapse
      • HackTheBox Return
  • CTF WRITEUP's
    • TryHackme
      • TryHackme 0day
      • TryHackme Daily Bugle
      • TryHackme Blog
      • TryHackme Year of the Owl
      • TryHackme Wgel CTF
      • TryHackme Chill Hack
      • TryHackme Wonderland
      • TryHackne OhSINT
      • TryHackme Cold VVars
      • TryHackme Dav
      • TryHackme RootMe
      • TryHackMe Basic Pentesting
      • TryHackMe Simple-CTF
      • TryHackMe Vulnversity
      • Tryhackme Kenobi
    • Burp Suite
      • 1️⃣SQL Ijections
        • Laboratorio Uno
        • Laboratorio Dos
        • Laboratorio Tres
        • Laboratorio Cuatro
        • Laboratorio Cinco
        • Laboratorio Seis
        • Laboratorio Siete
    • VulnHub
      • Inferno
      • Election
      • SYMFONOS 3
      • SYMFONOS 2
      • DJinn-3
      • Durian 1
      • DarkHole 2
      • OffSec DC-9
      • OffSec Potato
      • OffSec Pwned1
      • OffSec VIKINGS
      • OffSec Tre
      • OffSec MoneyBox
      • OffSec DEATHNOTE
      • OffSec Gaara
      • OffSec NoName
      • OffSec Katana
      • OffSec Sick0s
    • The Hackers Labs
      • The Hackers Labs Offensive
      • The Hackers Labs Resident
      • The Hacker Labs Base
      • The Hackers Labs Statue
      • The Hackers Labs Luna
      • The Hackers Labs Templo
      • The Hackers Labs GOIKO
      • The Hackers Labs Microsoft
    • Hackmyvm
      • Hackmyvm UP
    • Pivoting
      • Pivoting
      • Internal TryHackme
      • Basic /Doctor
      • Pluck /Brain
  • Privilege escalation
    • Abuso de grupos de usuario especiales
      • Docker
      • LXD
      • ADM
    • Abuso de permisos incorrectamente implementados
    • Detección y explotación de Capabilities
    • Tareas Crom
    • Path Hijacking
    • Abusando de privilegios a nivel de Sudoers
    • Abusando de privilegios SUID
    • Linux Privilege Escalation
  • Shared Files
    • Share Windows Linux
      • Compartir de entre Windows y Linux
      • Compartir de Windows a linux [Impacket-Server]
    • Share Linux
      • Compartir de linux en [PHP]
  • OWASP TOP 10
    • SQL Injections
    • XSS
    • XXE
    • Path traversal Lab
    • LFI con Wrappers
    • Log Poisoning (LFI -> RCE)
    • Server-Side Template Injection (SSTI)
    • Ataque de oráculo de relleno (Padding Oracle)
    • Inyecciones LaTeX
    • Ataques de transferencia de zona (AXFR – Full Zone Transfer)
    • Enumeración y explotación de WebDAV
    • ShellShock
    • Enumeración y explotación de SQUID Proxies
    • Insecure Direct Object Reference (IDORs)
    • Json Web Token
    • Intercambio de recursos de origen cruzado (CORS)
    • Abuso de subidas de archivos
      • Laboratorio 1
      • Laboratorio 2
      • Laboratorio 3
      • Laboratorio 4
      • Laboratorio 5
      • Laboratorio 6
      • Laboratorio 7
      • Laboratorio 8
      • Laboratorio 9
  • Group 1
    • Recursos
Con tecnología de GitBook
En esta página
  1. CTF WRITEUP's
  2. VulnHub

Durian 1


Interface: eth0, type: EN10MB, MAC: 00:0c:29:07:19:cb, IPv4: 192.168.1.139
Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)
192.168.1.1	64:66:24:39:6c:a8	(Unknown)
192.168.1.129	38:f9:d3:39:de:c0	(Unknown)
192.168.1.130	00:7c:2d:1f:c0:93	(Unknown)
192.168.1.133	00:0c:29:f4:63:75	(Unknown)

Escaneamos la red en busca de la maquina .


sudo nmap -sS -Pn -n -vvv --open --min-rate 5000 192.168.1.133 -oG port | tail  -n 10 | grep -vE 'Read data files from:|Nmap done:| Raw packets sent:'
PORT     STATE SERVICE    REASON
22/tcp   open  ssh        syn-ack ttl 64
80/tcp   open  http       syn-ack ttl 64
8000/tcp open  http-alt   syn-ack ttl 64
8088/tcp open  radan-http syn-ack ttl 64
MAC Address: 00:0C:29:F4:63:75 (VMware)

Ahora buscamos los puertos abiertos para la maquina en cuestion.


nmap -sCV -p22,80,8000,8088 192.168.1.133 -oN target.txt
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-11-23 05:52 EST
Nmap scan report for blog.rod (192.168.1.133)
Host is up (0.00047s latency).

PORT     STATE SERVICE    VERSION
22/tcp   open  ssh        OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
| ssh-hostkey: 
|   2048 28:1c:64:fa:9c:c3:d2:d4:bb:76:3d:3b:10:e2:b1:25 (RSA)
|   256 da:b2:e1:7f:7c:1b:58:cf:fd:4f:74:e9:23:6d:51:d7 (ECDSA)
|_  256 41:e1:0c:2b:d4:26:e8:d3:71:bb:9d:f9:61:56:63:c0 (ED25519)
80/tcp   open  http       Apache httpd 2.4.38 ((Debian))
|_http-server-header: Apache/2.4.38 (Debian)
|_http-title: Durian
8000/tcp open  http       nginx 1.14.2
|_http-server-header: nginx/1.14.2
|_http-open-proxy: Proxy might be redirecting requests
|_http-title: Durian
8088/tcp open  radan-http LiteSpeed
|_http-title: Durian
| fingerprint-strings: 
|   GetRequest: 
|     HTTP/1.0 200 OK
|     etag: "2fd-5f56ea13-40590;;;"
|     last-modified: Tue, 08 Sep 2020 02:18:59 GMT
|     content-type: text/html
|     content-length: 765
|     accept-ranges: bytes
|     date: Sat, 23 Nov 2024 10:53:03 GMT
|     server: LiteSpeed
|     connection: close
|     <html>
|     <body bgcolor="white">
|     <head>
|     <title>Durian</title>
|     <meta name="description" content="We Are Still Alive!">
|     <meta name="keywords" content="Hacked by Ind_C0d3r">
|     <meta name="robots" content="index, follow">
|     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|     <meta name="language" content="English">
|     </head>
|     <link href="https://fonts.googleapis.com/css?family=Righteous|Saira+Stencil+One&display=swap" rel="stylesheet">
|     <style type="text/css">
|     @font-face {
|     font-family: 'Righteous', cursive;
|     font-family: 'Saira Stencil One', cursive;
|     </style>
|     <center><br><br>
|     <img src="https://www.producemarketguide.com/sites/default/files/Commoditi
|   Socks5: 
|     HTTP/1.1 400 Bad Request
|     content-type: text/html
|     cache-control: private, no-cache, max-age=0
|     pragma: no-cache
|     content-length: 1209
|     date: Sat, 23 Nov 2024 10:53:04 GMT
|     server: LiteSpeed
|     connection: close
|     <!DOCTYPE html>
|     <html style="height:100%">
|     <head>
|     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|     <title> 400 Bad Request
|     </title></head>
|     <body style="color: #444; margin:0;font: normal 14px/20px Arial, Helvetica, sans-serif; height:100%; background-color: #fff;">
|     <div style="height:auto; min-height:100%; "> <div style="text-align: center; width:800px; margin-left: -400px; position:absolute; top: 30%; left:50%;">
|     style="margin:0; font-size:150px; line-height:150px; font-weight:bold;">400</h1>
|     style="margin-top:20px;font-size: 30px;">Bad Request
|     </h2>
|     <p>It is not a valid request!</p>
|_    </div></div><div style="color:#f0f0
|_http-server-header: LiteSpeed
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port8088-TCP:V=7.94SVN%I=7%D=11/23%Time=6741B40F%P=x86_64-pc-linux-gnu%
SF:r(GetRequest,3EC,"HTTP/1\.0\x20200\x20OK\r\netag:\x20\"2fd-5f56ea13-405
SF:90;;;\"\r\nlast-modified:\x20Tue,\x2008\x20Sep\x202020\x2002:18:59\x20G
SF:MT\r\ncontent-type:\x20text/html\r\ncontent-length:\x20765\r\naccept-ra
SF:nges:\x20bytes\r\ndate:\x20Sat,\x2023\x20Nov\x202024\x2010:53:03\x20GMT
SF:\r\nserver:\x20LiteSpeed\r\nconnection:\x20close\r\n\r\n<html>\n<body\x
SF:20bgcolor=\"white\">\n<head>\n<title>Durian</title>\n<meta\x20name=\"de
SF:scription\"\x20content=\"We\x20Are\x20Still\x20Alive!\">\n<meta\x20name
SF:=\"keywords\"\x20content=\"Hacked\x20by\x20Ind_C0d3r\">\n<meta\x20name=
SF:\"robots\"\x20content=\"index,\x20follow\">\n<meta\x20http-equiv=\"Cont
SF:ent-Type\"\x20content=\"text/html;\x20charset=utf-8\">\n<meta\x20name=\
SF:"language\"\x20content=\"English\">\n</head>\n<link\x20href=\"https://f
SF:onts\.googleapis\.com/css\?family=Righteous\|Saira\+Stencil\+One&displa
SF:y=swap\"\x20rel=\"stylesheet\">\n<style\x20type=\"text/css\">\n@font-fa
SF:ce\x20{\n\tfont-family:\x20'Righteous',\x20cursive;\n\tfont-family:\x20
SF:'Saira\x20Stencil\x20One',\x20cursive;\n}\n</style>\n<center><br><br>\n
SF:<img\x20src=\"https://www\.producemarketguide\.com/sites/default/files/
SF:Commoditi")%r(Socks5,58E,"HTTP/1\.1\x20400\x20Bad\x20Request\r\ncontent
SF:-type:\x20text/html\r\ncache-control:\x20private,\x20no-cache,\x20max-a
SF:ge=0\r\npragma:\x20no-cache\r\ncontent-length:\x201209\r\ndate:\x20Sat,
SF:\x2023\x20Nov\x202024\x2010:53:04\x20GMT\r\nserver:\x20LiteSpeed\r\ncon
SF:nection:\x20close\r\n\r\n<!DOCTYPE\x20html>\n<html\x20style=\"height:10
SF:0%\">\n<head>\n<meta\x20name=\"viewport\"\x20content=\"width=device-wid
SF:th,\x20initial-scale=1,\x20shrink-to-fit=no\">\n<title>\x20400\x20Bad\x
SF:20Request\r\n</title></head>\n<body\x20style=\"color:\x20#444;\x20margi
SF:n:0;font:\x20normal\x2014px/20px\x20Arial,\x20Helvetica,\x20sans-serif;
SF:\x20height:100%;\x20background-color:\x20#fff;\">\n<div\x20style=\"heig
SF:ht:auto;\x20min-height:100%;\x20\">\x20\x20\x20\x20\x20<div\x20style=\"
SF:text-align:\x20center;\x20width:800px;\x20margin-left:\x20-400px;\x20po
SF:sition:absolute;\x20top:\x2030%;\x20left:50%;\">\n\x20\x20\x20\x20\x20\
SF:x20\x20\x20<h1\x20style=\"margin:0;\x20font-size:150px;\x20line-height:
SF:150px;\x20font-weight:bold;\">400</h1>\n<h2\x20style=\"margin-top:20px;
SF:font-size:\x2030px;\">Bad\x20Request\r\n</h2>\n<p>It\x20is\x20not\x20a\
SF:x20valid\x20request!</p>\n</div></div><div\x20style=\"color:#f0f0");
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Versiones y servicios de los puertos que estan abiertos.


wfuzz -c -t 200 --hc=403,404 -w /usr/share/wordlists/dirb/common.txt -u 'http://192.168.1.133/FUZZ'
********************************************************
* Wfuzz 3.1.0 - The Web Fuzzer                         *
********************************************************

Target: http://192.168.1.133/FUZZ
Total requests: 4615

=====================================================================
ID           Response   Lines    Word       Chars       Payload                                                                                      
=====================================================================

000000001:   200        20 L     51 W       765 Ch      "http://192.168.1.133/"                                                                      
000000646:   301        9 L      28 W       313 Ch      "blog"                                                                                       
000000822:   301        9 L      28 W       317 Ch      "cgi-data"                                                                                   
000002021:   200        20 L     51 W       765 Ch      "index.html"                                                                                 

Total time: 0

Si fuzzeamos la web encontramos algunos directorios.


curl -s http://192.168.1.133/cgi-data/getImage.php | html2text
/*
nclude $_GET['file']; */

Si con curl le lanzamos una peticion a la ruta cgi donde encontramos el archivo php, observamos que en el codigo fuente nos esta pasando el parametro file.


Si al parametro file le pasamos el /etc/passwd observamos que lo podemos leer, hemos encontrado un LFI, ahora vamos a tratar de deribarlo a un RCE.


El archivo /proc/self/cmdline contiene la línea de comandos completa que se utilizó para ejecutar el proceso actual. Esto incluye el nombre del programa y cualquier argumento que se haya pasado al ejecutarlo Sabiendo de antemano lo anterior ahora trataremos de llegar ah este punto El directorio /proc/self/fd contiene enlaces simbólicos a los archivos, sockets o dispositivos abiertos por el proceso actual (en este caso, el servidor web que estás explotando con LFI).


Yo eh encontrado el PID correcto que en este caso para mi es 6, en tu caso sera otro, me muestra los log al lado derecho, usted debe hacer un ataque tipo sniper con intruder para ver cual es su PID yo lo hice manual probando numero de uno en uno.


Ahora con Curl le lanzamos una peticion haber si la logramos observar en los logs del PID.


Si en los logs podemos ver, ahora bueno viene la parte de ganar acceso envenenando los logs.


Si envenenamos el User-Agent consultando un whoami.


Y filtramos por www-data observamos que tenemos respuesta ya podemos envenenar la consulta a traves del User-Agent.


Ok ahora en vez de inyectar un whoami, vamos inyectar un CMD para ganar acceso al sistma.


Y nos enviamos una revershell.


Intentando escalar privilegios a root, observamos dos capabilities.


Maquina Resuelta

AnteriorDJinn-3SiguienteDarkHole 2

Última actualización hace 6 meses