<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fernando Luis &#187; Seguridad</title>
	<atom:link href="http://www.fernandoluis.com/category/seguridad/feed" rel="self" type="application/rss+xml" />
	<link>http://www.fernandoluis.com</link>
	<description>Fernando Luis security linux  debian fotografia</description>
	<lastBuildDate>Wed, 17 Aug 2011 12:25:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Cambio firmware en la fonera</title>
		<link>http://www.fernandoluis.com/cambio-firmware-en-la-fonera/2010/01</link>
		<comments>http://www.fernandoluis.com/cambio-firmware-en-la-fonera/2010/01#comments</comments>
		<pubDate>Tue, 19 Jan 2010 12:13:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Seguridad]]></category>

		<guid isPermaLink="false">http://www.fernandoluis.com/?p=488</guid>
		<description><![CDATA[<p>Puede darse el caso, que el router no funcione bien, o simplemente se haya quedado en un estado que no sea posible utilizarlo.La solución consiste en cambiar el firmare por uno publico ( dd-wrt)</p>
<p>A continuación, os mostaré un esquema sencillo de poder hacerlo.</p>
<p>Lo primero que tendremos que hacer es conectar por ssh al dispositivo.Como podeis [...]]]></description>
			<content:encoded><![CDATA[<p>Puede darse el caso, que el router no funcione bien, o simplemente se haya quedado en un estado que no sea posible utilizarlo.La solución consiste en cambiar el firmare por uno publico (<em> dd-wr</em>t)</p>
<p>A continuación, os mostaré un esquema sencillo de poder hacerlo.</p>
<p>Lo primero que tendremos que hacer es conectar por ssh al dispositivo.Como podeis imaginar, el acceso está cerrado por defecto.La buena noticia, es que en versiones inferiores  de firmware  0.7.2, es relativamente sencillo  habilitar el acceso mediante el script de dropbear.En el caso que tengamos una versión mayor o igual a a esta, no tendremos más remedio que hacer lo siguiente:</p>
<p>Preparemos el siguiente entorno:</p>
<p><em>Fonera_Internet_connection: 213.134.45.200/255.255.255.0 GW: 213.134.45.129 DNS: 213.134.45.129<br />
PC: 213.134.45.x/255.255.255.0 GW: 213.134.45.129<br />
Router_Internet: 213.134.45.129/255.255.255.0  DNS:88.198.165.155</em></p>
<p>Si quereis, para mayor facilidad, el Router_internet puede ser cualquier PC que tenga acceso a internet, y así nos evitaremos tocarlo.Para cambiar los parametros de la fonera se hará accediendo  web a la dirección <em>192.168.10.1</em> via wifi, con el usuario root/admin</p>
<p>Una vez que tenemos el entorno listo, presionamos el boton reset de la fonera durante 30 segundos, con esto forzaremos al a fonera a hacer un autoupdate ,pero en vez de hacerlo al servidor oficial lo haremos a Kolofonium  (fake) Despues de esto, y en la web de gestión comprobaremos  que se ha hecho el downgrade del fw a la versión 0.7.1 r1, la cual es vulnerable.</p>
<p>Una vez conectado a la wifi, crearemos y ejecutaremos  un archivo html con el siguiente código:</p>
<blockquote><p>&lt;html&gt;</p>
<p>&lt;head&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;center&gt;<br />
&lt;form method=&#8221;post&#8221; action=&#8221;http://192.168.10.1/cgi-bin/webif/connection.sh &#8221; enctype=&#8221;multipart/form-data&#8221;&gt;<br />
&lt;input name=&#8221;username&#8221; value=&#8221;$(/etc/init.d/dropbear)&#8221; size=&#8221;68&#8243; &gt;<br />
&lt;input type=&#8221;submit&#8221; name=&#8221;submit&#8221; value=&#8221;Submit&#8221; onClick=&#8221;{this.form.wifimode.value=&#8217;&#8221;;&#8217; + this.form.wifimode.value +&#8217;;&#8221;&#8216;}&#8221; /&gt;<br />
&lt;/form&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>Después de hacer el submit, el navegador nos mostrará el web de gestion del router,y con ello tendremos el acceso ssh habilitado.Nos conectaremos con:<em> ssh 192.168.10.1</em> con el usuario generico<em> root/admin</em></p>
<p>Si queremos que los cambios sean permanetns y el acceso ssh este siempre disponisble:</p>
<blockquote><p>mv /etc/init.d/dropbear /etc/init.d/S50dropbear</p></blockquote>
<p>El siguiente paso será tener acceso a <em>RedBoot</em> para meterle un nuevo fw.<br />
Nos conectamos por ssh y hacemos los siguiente: ( ojo, el router_fonera tiene que tener acceso a internet)</p>
<blockquote><p>cd /tmp<br />
wget http://fonera.info/camicia/openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma<br />
mtd -e vmlinux.bin.l7 write openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma vmlinux.bin.l7<br />
reboot</p></blockquote>
<p>Una vez que haya reiniciado, volvemos a conectarnos por ssh y haremos:</p>
<blockquote><p>cd /tmp<br />
wget http://fonera.info/camicia/out.hex<br />
mtd -e &#8220;RedBoot config&#8221; write out.hex &#8220;RedBoot config&#8221;<br />
reboot</p></blockquote>
<p>Despues de hacer esto, no sera posible conectarse con el router via wireles y habra que hacerlo a través de un cable plano, ojo, no cruzado., siguiendo el siguiente esquema:</p>
<p><em>PC: 192.168.1.161<br />
Fonera: 192.168.1.254</em></p>
<p>Una vez que hay botado el router_fonera, solo dispondremos de unos segundos para poder conectarnos via telnet 192.168.1.254 al puerto 9000 .Para facilitar la tarea, dejaremos una consola abierta desde el PC  con un ping 192.168.1.254, y una vez que veamos la primera respuesta haremos inmediatamente el telnet.Si todo ha ido bien, tendremos acceso a  RedBoot.<br />
Esta no es la única forma de acceder a Redboot, tambien se puede hacer por hardware, conectandonos a traves del puerto serie.<br />
Una vez que tengamos acceso a RedBoot, estaremos preparados para meterle el firmware dd-wrt.<br />
Lo primero que tendremos que hacer es bajarnos los siguientes archivos:</p>
<blockquote><p>wget http://downloads.openwrt.org/kamikaze/7.09/atheros-2.6/openwrt-atheros-2.6-vmlinux.lzma<br />
wget http://downloads.openwrt.org/kamikaze/7.09/atheros-2.6/openwrt-atheros-2.6-root.squashfs</p></blockquote>
<p>El siguiente paso, será instalar un servidor <em>tftp</em> para ofrecer los archivos anteriores.Servidores tftp hay muchos, en linux /debian bastaría <em>apt-get install tftp tftpd xinetd</em><br />
Después tendremos que crear el servicio para que xinetd lo inicie, para ello, creamos el siguiente archivo <em> /etc/xinet.d/tftp </em>con el siguiente contenido:<em><br />
</em></p>
<blockquote><p>service tftp<br />
{<br />
protocol = udp<br />
port = 69<br />
socket_type = dgram<br />
wait = yes<br />
user = nobody<br />
server = /usr/sbin/in.tftpd<br />
server_args = /tftpboot<br />
disable = no<br />
}</p></blockquote>
<p>Y cambiamos el argumento server_args al lugar donde tengamos los archivos anteriormente descargados.Una vez que tengamos todo, reiniciamos el xinetd  con <em>/etc/init.d/xinetd restart</em><br />
El paso siguiente sera conectarse al RedBoot, y hacer lo siguiente, donde 192.168.1.161 es la dirección IP donde esta el servidor tftp:</p>
<blockquote><p>ip_address -l 192.168.1.254 -h 192.168.1.161<br />
load -r -b %{FREEMEMLO} openwrt-atheros-2.6-vmlinux.lzma<br />
fis init<br />
fis create -e 0×80041000 -r 0×80041000 vmlinux.bin.l7<br />
fis free<br />
load -r -b %{FREEMEMLO} openwrt-atheros-2.6-root.squashfs<br />
fis create -l 0×6f0000 rootfs<br />
fconfig<br />
reset</p></blockquote>
<p>Todo esto puede llevarnos unos 30 minutos.En el paso de fconfig, aceptaremos todo los valores por defecto que nos indica.</p>
<p>El siguiente paso será conectarnos via telnet a la IP que trae por defecto el nuevo fw que es la<em> 192.168.1.1</em>, ya que el acceso wifi esta deshabilitado. una vez que establezcamos una contraseña con el comando <em>passwd</em> el acceso telnet no estará disponible, pero si el acceso ssh.<br />
En este momento, solo nos quedara configurar el router, si queremos hacerlo via web, tendremos que instalar el paquete <em>webif</em>, que por defecto no viene instalado:</p>
<blockquote><p>echo &#8221; src X-Wrt http://downloads.x-wrt.org/xwrt/kamikaze/7.09/atheros-2.6/packages&#8221; &gt;&gt; /etc/ipkg.conf<br />
ipkg update<br />
ipkg install webif</p></blockquote>
<p>Si por un casual, os diese problemas las fuentes de paquetes, esto es lo que tenía yo en el fichero <em>/etc/ipkg.conf</em></p>
<blockquote><p>src release http://downloads.openwrt.org/kamikaze/7.09/atheros-2.6/packages<br />
# src packages http://downloads.openwrt.org/kamikaze/packages/mips<br />
dest root /<br />
dest ram /tmp<br />
src X-Wrt http://downloads.x-wrt.org/xwrt/kamikaze/7.09/atheros-2.6/packages<br />
#     src X-Wrt http://downloads.x-wrt.org/xwrt/kamikaze/snapshots/atheros-2.6/packages</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.fernandoluis.com/cambio-firmware-en-la-fonera/2010/01/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Herramienta para comprobar rendimiento servidor web</title>
		<link>http://www.fernandoluis.com/herramienta-para-comprobar-rendimiento-servidor-web/2009/11</link>
		<comments>http://www.fernandoluis.com/herramienta-para-comprobar-rendimiento-servidor-web/2009/11#comments</comments>
		<pubDate>Wed, 25 Nov 2009 10:23:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Redes]]></category>
		<category><![CDATA[Seguridad]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.fernandoluis.com/?p=452</guid>
		<description><![CDATA[<p>Se llama Webserver Stress Tool, ¿ Bonito nombre, no ?  </p>
<p>Para descargarse una versión de trial: http://www.paessler.com/download/webstress</p>
]]></description>
			<content:encoded><![CDATA[<p>Se llama Webserver Stress Tool, ¿ Bonito nombre, no ? <img src='http://www.fernandoluis.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Para descargarse una versión de trial: <a href="http://www.paessler.com/download/webstress">http://www.paessler.com/download/webstress</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fernandoluis.com/herramienta-para-comprobar-rendimiento-servidor-web/2009/11/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Evitar ataques de fuerza fruta en ssh</title>
		<link>http://www.fernandoluis.com/evitar-ataques-de-fuerza-fruta-en-ssh/2009/10</link>
		<comments>http://www.fernandoluis.com/evitar-ataques-de-fuerza-fruta-en-ssh/2009/10#comments</comments>
		<pubDate>Thu, 22 Oct 2009 14:32:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Seguridad]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.fernandoluis.com/?p=407</guid>
		<description><![CDATA[<p>¿ Estás cansado de  continuos ataques contra tu ssh ?</p>
<p>Iptables te dá la solución:</p>
<p>iptables -I INPUT -p tcp &#8211;dport 22 -i eth0 -m state &#8211;state NEW -m recent &#8211;set</p>
iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent--update --seconds 240 --hitcount 4 -j DROP


En este ejemplo, estaremos marcando las nuevas [...]]]></description>
			<content:encoded><![CDATA[<p>¿ Estás cansado de  continuos ataques contra tu ssh ?</p>
<p>Iptables te dá la solución:</p>
<blockquote><p><span style="font-family: verdana; font-size: 100%;">iptables -I INPUT -p tcp &#8211;dport 22 -i eth0 -m state &#8211;state NEW -m recent &#8211;set</span></p>
<pre style="font-family: verdana;"><span style="font-size: 100%;">iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent--update --seconds 240 --hitcount 4 -j DROP
</blockquote>

En este ejemplo, estaremos marcando las nuevas conexiones de ssh  que se produzcan, y en el caso de llegar a 4 desde la misma IP, denegaría el acceso durante 240 segundos.

</span>
<pre style="font-family: verdana;"><span style="font-size: 100%;">
</span></pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fernandoluis.com/evitar-ataques-de-fuerza-fruta-en-ssh/2009/10/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Como prevenir conectar memorias USB</title>
		<link>http://www.fernandoluis.com/como-prevenir-conectar-memorias-usb/2009/02</link>
		<comments>http://www.fernandoluis.com/como-prevenir-conectar-memorias-usb/2009/02#comments</comments>
		<pubDate>Fri, 27 Feb 2009 11:43:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Seguridad]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[devices]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://www.fernandoluis.com/wordpress/?p=59</guid>
		<description><![CDATA[<p>Muy útil, si quieres evitar fuga de información&#8230;</p>
<p>http://support.microsoft.com/kb/823732</p>
]]></description>
			<content:encoded><![CDATA[<p>Muy útil, si quieres evitar fuga de información&#8230;</p>
<p>http://support.microsoft.com/kb/823732</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fernandoluis.com/como-prevenir-conectar-memorias-usb/2009/02/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

