<?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>El Camello, el León y el niño. O la evolución del perro al lobo &#187; Networking</title>
	<atom:link href="http://www.javcasta.com/category/networking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javcasta.com</link>
	<description>Blog de Javier Castañón - JavCasta</description>
	<lastBuildDate>Tue, 29 Nov 2011 15:13:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>WipFW Script Generator V1 Beta</title>
		<link>http://www.javcasta.com/2011/11/29/wipfw-script-generator-v1-beta/</link>
		<comments>http://www.javcasta.com/2011/11/29/wipfw-script-generator-v1-beta/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 14:45:47 +0000</pubDate>
		<dc:creator>javcasta</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[seguridad]]></category>
		<category><![CDATA[Sistemas]]></category>
		<category><![CDATA[soporte]]></category>
		<category><![CDATA[Utilidades]]></category>

		<guid isPermaLink="false">http://www.javcasta.com/?p=7703</guid>
		<description><![CDATA[WipFW Script Generator V1 Beta. Descarga WipFWScriptGenerator. Esta utilidad ( WipFW Script Generator ) la he implementado con C# 4.0, en el IDE SharpDevelop 4.1, para .Net 4.0 client profile. Y la he probado en un Windows 7 ultimate SP1 con WipFW 0.5.5b en una LAN stub Su función es generar un batch script para [...]]]></description>
			<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2011%2F11%2F29%2Fwipfw-script-generator-v1-beta%2F"></g:plusone><br /><!-- tweet id : 141528691640508416 --><style type='text/css'>#bbpBox_141528691640508416 a { text-decoration:none; color:#2FC2EF; }#bbpBox_141528691640508416 a:hover { text-decoration:underline; }</style><div id='bbpBox_141528691640508416' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#1a1b1f; background-image:url(http://a0.twimg.com/profile_background_images/234683216/leonTwitter.JPG); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#666666; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>Nuevo Post: WipFW Script Generator V1.Beta - <a href="http://t.co/m5fo8DR7" rel="nofollow">http://t.co/m5fo8DR7</a></span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://www.javcasta.com/blog/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 29/11/2011 14:47' href='http://twitter.com/#!/javcasta/status/141528691640508416' target='_blank'>29/11/2011 14:47</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=141528691640508416' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=141528691640508416' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=141528691640508416' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=javcasta'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a2.twimg.com/profile_images/1316173538/avatar_normal.png' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=javcasta'>@javcasta</a><div style='margin:0; padding-top:2px'>Javier Casta&#241;&#243;n</div></div><div style='clear:both'></div></div></div><!-- end of tweet -->
<hr />
<h1><span style="text-decoration: underline;">WipFW Script Generator V1 Beta.</span></h1>
<ul>
<li><strong>Descarga</strong> <a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/WipFWScriptGenerator.zip">WipFWScriptGenerator</a>.</li>
</ul>
<p>Esta utilidad ( <em><strong>WipFW Script Generator</strong></em> ) la he implementado con<strong> C#</strong> 4.0, en el <strong>IDE</strong> <strong>SharpDevelop 4.1</strong>, para <strong><em>.Net 4.0 client profile</em></strong>. Y la he probado en un <strong>Windows 7 ultimate SP1</strong> con<strong> WipFW 0.5.5b</strong> en una<strong> LAN stub</strong></p>
<p><strong>Su función es generar un batch script para configurar el firewall WipFW</strong>, en un host o máquina de una <a href="http://en.wikipedia.org/wiki/Stub_network" target="_blank">red stub</a>, es decir que solo conoce una ruta de último recurso (un Gateway) para salir a Inet.</p>
<p>El script generado es simple, no contempla<strong> NAT</strong> ni<strong> redirección de puertos</strong>, ya que esta enfocado a configurar el <strong>cortafuegos</strong> <strong>WipFW</strong> a modo de &#8220;<strong>personal firewall</strong>&#8221; (<em><span style="color: #888888;">a grosso modo: capar/permitir redes, hosts, dominios y capar/permitir puertos tcp, udp) para una maquina que no haga funciones router y sea la típica maquina cliente en una típica LAN</span></em>.)</p>
<p>La utilidad detecta las <strong>NICs</strong> del<strong> host</strong> y sus parámetros <strong>TCP/IPv4</strong> (IPv4, mascara, dns, gw y proxy si lo hubiera), y se elegiria en un comboBox, mediante la <strong>MAC</strong>, la <strong>NIC con salida a Inet</strong>. Tambien se puede elegir la opción &#8220;interfaz ppp / modem 3G / &#8230;&#8221; donde se parametrizaria &#8220;a mano&#8221; (siempre se podran editar los parametros a mano, idenpendientemente de los valores que obtengan).</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/WipFWScriptGeneratorV1B-1.jpg"><img class="aligncenter size-full wp-image-7859" title="WipFWScriptGeneratorV1B-1" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/WipFWScriptGeneratorV1B-1.jpg" alt="" width="600" height="462" /></a></p>
<p>Una vez elegida la NIC por su Mac y completado sus parametros <strong>tcp/ip</strong>, se clikaria el<strong> boton OK</strong> para validar si estan todos los parametros necesarios, y si lo estuviesen, apareceria el mensaje &#8220;<strong>parametriza script</strong>&#8220;, donde el siguiente paso seria acceder al <strong>panel de configuración de WipFW</strong>, que se encuentra abajo y donde procederiamos a configurar cada pestaña.</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/WipFWScriptGeneratorV1B-2.jpg"><img class="aligncenter size-full wp-image-7860" title="WipFWScriptGeneratorV1B-2" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/WipFWScriptGeneratorV1B-2.jpg" alt="" width="600" height="463" /></a></p>
<p>Por defecto he marcado o habilitado y desmarcado o deshabilitado los <strong>checkBox</strong> de las reglas que me parece que son necesarias para optimizar la securización de la maquina con WipFW.</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/WipFWScriptGeneratorV1B-4.jpg"><img class="aligncenter size-full wp-image-7861" title="WipFWScriptGeneratorV1B-4" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/WipFWScriptGeneratorV1B-4.jpg" alt="" width="600" height="211" /></a></p>
<p>Los comoBox de cada regla permiten definir si la regla va a:</p>
<ul>
<li><strong>allow</strong> &#8211; permitir</li>
<li><strong>allow log</strong> &#8211; permitir y escribir en el log</li>
<li><strong>deny</strong> &#8211; denegar</li>
<li><strong>deny log</strong> &#8211; denegar y escribir en el log</li>
<li><strong>drop</strong> &#8211; descartar sin envio de icmp destination port unrechable</li>
<li><strong>drop log</strong> &#8211; descartar sin envio de icmp destination port unrechable y escribir en el log</li>
</ul>
<p>En la <strong>pestaña redes</strong>, se puede definir las reglas para redes como <strong>multicast</strong> (<span style="color: #888888;">224.0.0.0/3</span>), <strong>link-local</strong> (<span style="color: #888888;">169.254.0.0/16</span>), y las redes <strong>privadas y bogon</strong> (a marcar en un<strong> checkedListBox</strong> ), tambien se puede <strong>editar el fichero de la Lista Negra</strong>, donde se pueden incluir <strong>IPs de host</strong> ( 80.59.69.239) o <strong>de red</strong> ( 80.59.69.0/24 ) o <strong>dominios</strong> ( www.malware.com ) que se van a bloquear su acceso tanto de salida ( out ) como de entrada ( in )</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/WipFWScriptGeneratorV1B-5.jpg"><img class="aligncenter size-full wp-image-7862" title="WipFWScriptGeneratorV1B-5" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/WipFWScriptGeneratorV1B-5.jpg" alt="" width="600" height="461" /></a></p>
<p>En la pestaña puertos, podras editar los<strong> puertos</strong> a permitir o capar ya sean <strong>tcp</strong> o <strong>udp</strong> de entrada y salida</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/WipFWScriptGeneratorV1B-6.jpg"><img class="aligncenter size-full wp-image-7863" title="WipFWScriptGeneratorV1B-6" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/WipFWScriptGeneratorV1B-6.jpg" alt="" width="740" height="570" /></a></p>
<p>Para el usuario no avanzado, tan solo con elegir la nic con salida a Inet y dejar casi por defecto las opciones de la utilidad, tendra un batch script (ultima pestaña SCRIPT) muy funcional, donde solo se permitiria por defecto las consultas DNS a sus servidores DNS, el cliente ssh (tcp22), la navegación WEB (tcp80,tcp443), el correo (smtp, pop3, imap, &#8230;) y ser accesible via terminal server o remote desktop protocol (tcp3389)&#8230;</p>
<p>En la pestaña proxy, credenciales, IPv6, se podrá dar permisos o capar el proxy:port, definir las credenciales (usuario:contraseña del host) por si se desea ejecutar el script (hacen falta rivilegios de administrador local de la máquina) y dar permiso o capar IPv6.</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/WipFWScriptGeneratorV1B-8.jpg"><img class="size-full wp-image-7864" title="WipFWScriptGeneratorV1B-8" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/WipFWScriptGeneratorV1B-8.jpg" alt="" width="640" height="493" /></a></p>
<p>Tras esto en la pestaña <strong>SCRIPT</strong> podra ejecutar el script y/o guardarlo o copiarlo al portapapeles. Tan solo es condicion necesaria tener instalado<strong> WipFW</strong> en la maquina (obvio, pero siempre hay despistados <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  )</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/WipFWScriptGeneratorV1B-9.jpg"><img class="aligncenter size-full wp-image-7865" title="WipFWScriptGeneratorV1B-9" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/WipFWScriptGeneratorV1B-9.jpg" alt="" width="600" height="462" /></a></p>
<p>En el botón de &#8220;<strong>Monitorizar Log</strong>&#8221; he adjuntado otra utilidad, <strong><a href="http://www.javcasta.com/2011/09/15/revisado-tail-para-wipfw-con-c-%e2%80%93-monitorizar-logs-de-wipfw-%e2%80%93-tailcsharp2-exe/" target="_blank">Tail Con C#</a></strong>, que he implementado tanmbien en c#, para monitorizar el <strong>log</strong> de <strong>WipFW</strong></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/WipFWScriptGeneratorV1B-10.jpg"><img class="aligncenter size-full wp-image-7866" title="WipFWScriptGeneratorV1B-10" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/WipFWScriptGeneratorV1B-10.jpg" alt="" width="600" height="289" /></a></p>
<p>Y voila <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>El código del MainForm.cs</p>
<p><span id="more-7703"></span></p>
<p>MainForm.cs</p>
<pre class="brush: java; title: ; notranslate">
///*
// * Created by SharpDevelop.
// * User: JavCasta - http://javcasta.com/
// * Date: 19/09/2011
// * Time: 11:09
// *
// * To change this template use Tools | Options | Coding | Edit Standard Headers.
// */

using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Management;
using System.Net;
using System.Text.RegularExpressions;
using System.Windows.Forms;

namespace Prueba
{
	/// &lt;summary&gt;
	/// Description of MainForm.
	/// &lt;/summary&gt;
	public partial class MainForm : Form
	{
		ManagementClass objMC;
		ManagementObjectCollection objMOC;
		string[] ipaddresses;
		string[] subnets;
		string[] gateways;
		string[] dns;
		string hostname;
		int i = 0;
		public MainForm()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();

			//
			// TODO: Add constructor code after the InitializeComponent() call.
			//
			// Begin show
			richTextBox1.Text=&quot;&quot;;
			ListIP();
			// end show
		}
		public void fulldata()
		{
			if (comboBox2.Text!=&quot;&quot; &amp;&amp; comboBox3.Text!=&quot;&quot; &amp;&amp; comboBox4.Text!=&quot;&quot; &amp;&amp; textBox4.Text!=&quot;&quot;) {
				MessageBox.Show(&quot;Parametriza script&quot;);
				tabControl1.Enabled=true;
			}
			else {
				MessageBox.Show(&quot;Faltan parametros&quot;);
				tabControl1.Enabled=false;
			}
		}
		public void ListIP()
		{
			objMC = new ManagementClass(&quot;Win32_NetworkAdapterConfiguration&quot;);
 			objMOC = objMC.GetInstances();
 			i=0;
			foreach(ManagementObject objMO in objMOC)
			{
          		if(!(bool)objMO[&quot;ipEnabled&quot;])
                	 continue;
       			i=i+1; // i = nº de NICs
       			// j = nº de IPs
          		richTextBox1.Text=richTextBox1.Text + &quot;NIC: &quot; + objMO[&quot;Caption&quot;] + &quot;,&quot; +  objMO[&quot;ServiceName&quot;] + &quot;,&quot; + objMO[&quot;MACAddress&quot;] +&quot;\n&quot;;
          		comboBox1.Items.Add(objMO[&quot;MACAddress&quot;]);
          		ipaddresses = (string[]) objMO[&quot;IPAddress&quot;];
          		subnets = (string[]) objMO[&quot;IPSubnet&quot;];
          		gateways = (string[]) objMO[&quot;DefaultIPGateway&quot;];
          		dns = (string[]) objMO[&quot;DNSServerSearchOrder&quot;];
          		hostname = (String) objMO[&quot;DNSHostName&quot;];
          		groupBox1.Text = &quot;Info TCP/IPv4: &quot; + hostname;

          		try
        		{ 

          		richTextBox1.Text=richTextBox1.Text + &quot;Gateway: &quot;;
          		if (gateways != null)
          			foreach(string sGate in gateways) {
          				richTextBox1.Text=richTextBox1.Text + sGate + &quot;\n&quot;;
          			}
				else richTextBox1.Text=richTextBox1.Text + &quot;\n&quot;;

          		richTextBox1.Text=richTextBox1.Text + &quot;Ip: &quot;;

          		if (ipaddresses != null) {
					foreach(string sIP in ipaddresses) {
          				richTextBox1.Text=richTextBox1.Text + sIP + &quot;\n&quot;;
					}
          		}
          		else richTextBox1.Text=richTextBox1.Text + &quot;\n&quot;;

				richTextBox1.Text=richTextBox1.Text + &quot;Mascara: &quot;;

				if (subnets != null)
          		foreach(string sNet in subnets)
          			richTextBox1.Text=richTextBox1.Text + sNet + &quot;\n&quot;;
				else richTextBox1.Text=richTextBox1.Text + &quot;\n&quot;;

				richTextBox1.Text=richTextBox1.Text + &quot;DNS: &quot;;

				if (dns != null)
				foreach(string sDns in dns)
          			richTextBox1.Text=richTextBox1.Text + sDns + &quot;, &quot;;
				else richTextBox1.Text=richTextBox1.Text + &quot;\n&quot;;

          		} //fin try
          		catch(Exception ex)
        		{
              	MessageBox.Show(&quot;error : &quot; + ex.Message);
        		}
          		richTextBox1.Text=richTextBox1.Text + &quot;\n===================================================\n&quot;;
			}
			comboBox1.Items.Add(&quot;Interfaz ppp/modem 3G/ ...&quot;);
			//proxy
			//ref http://stackoverflow.com/questions/4254351/get-the-uri-from-the-default-web-proxy
			var proxy = HttpWebRequest.GetSystemWebProxy();
			string laurl=&quot;http://javcasta.com&quot;;
			string myproxy = &quot;&quot;;
			string myproxyport = &quot;&quot;;
			Uri proxyUri = proxy.GetProxy(new Uri(laurl));
			if (laurl == &quot;http://&quot;+proxyUri.Host.ToString())
			{
				//MessageBox.Show(&quot;No hay proxy&quot;);
				myproxy = &quot;&quot;;
				myproxyport = &quot;&quot;;
			}
			else
			{
				myproxy = proxyUri.Host.ToString();
				myproxyport = proxyUri.Port.ToString();
				//MessageBox.Show(&quot;Proxy: &quot;+myproxy+&quot; puerto: &quot;+myproxyport);

			}
			textBox6.Text = myproxy;
			textBox7.Text = myproxyport;
			comboBox5.SelectedIndex = 0;
			comboBox7.SelectedIndex = 0;
			comboBox8.SelectedIndex = 0;
			comboBox9.SelectedIndex = 0;
			comboBox10.SelectedIndex = 0;
			comboBox11.SelectedIndex = 0;
			comboBox13.SelectedIndex = 3;
			comboBox15.SelectedIndex = 0;
			comboBox17.SelectedIndex = 0;
			comboBox12.SelectedIndex = 3;
			comboBox14.SelectedIndex = 0;
			comboBox16.SelectedIndex = 0;
			comboBox18.SelectedIndex = 0;
			comboBox19.SelectedIndex = 0;
			comboBox20.SelectedIndex = 0;
			comboBox21.SelectedIndex = 0;
			comboBox26.SelectedIndex = 0;
			comboBox24.SelectedIndex = 0;
			comboBox22.SelectedIndex = 0;
			comboBox23.SelectedIndex = 0;
			comboBox25.SelectedIndex = 0;
			comboBox27.SelectedIndex = 0;
			comboBox28.SelectedIndex = 0;
			comboBox29.SelectedIndex = 0;
			for ( int ele=0; ele &lt; checkedListBox1.Items.Count; ++ele )
  				checkedListBox1.SetItemChecked( ele, true );
			for ( int ele=0; ele &lt; checkedListBox2.Items.Count; ++ele )
  				checkedListBox2.SetItemChecked( ele, true );
			for ( int ele=3; ele &lt; 9  ; ++ele )
  				checkedListBox3.SetItemChecked( ele, true );

	} //fin ListIP

		void ComboBox1SelectedIndexChanged(object sender, EventArgs e)
		{
			//elegir nic
			comboBox2.Items.Clear();
			comboBox3.Items.Clear();
			comboBox4.Items.Clear();
			comboBox2.Text = &quot;&quot;;
			comboBox3.Text = &quot;&quot;;
			comboBox4.Text = &quot;&quot;;
			textBox4.Text =&quot;&quot;;
			textBox5.Text =&quot;&quot;;
			string consulta=&quot;SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'TRUE' And MACAddress = '&quot;+
				comboBox1.SelectedItem.ToString()+&quot;' And (SettingID != NULL)&quot;;
			//MessageBox.Show(consulta);
			ManagementObjectSearcher query = new ManagementObjectSearcher(consulta);
        	ManagementObjectCollection queryCollection = query.Get();
        	try
        	{
        	foreach( ManagementObject mo in queryCollection )
        	{
        		string[] direcciones = (string[])mo[&quot;IPAddress&quot;];
        		if (direcciones != null) {
					foreach(string strIP in direcciones) {
        				comboBox2.Items.Add(strIP);
        				if (comboBox2.Text == &quot;&quot;) comboBox2.Text = strIP;
					}
        		}
        		string[] mascaras = (string[])mo[&quot;IPSubnet&quot;];
        		if (mascaras != null) {
					foreach(string strMascara in mascaras) {
        				comboBox3.Items.Add(strMascara);
        				if (comboBox3.Text == &quot;&quot;) comboBox3.Text = strMascara;
					}
        		}
        		string[] puertaDeEnlace = (string[])mo[&quot;DefaultIPGateway&quot;];
        		if (puertaDeEnlace != null) {
					foreach(string strGW in puertaDeEnlace) {
        				comboBox4.Items.Add(strGW);
        				if (comboBox4.Text == &quot;&quot;) comboBox4.Text = strGW;
					}
        		}
        		string[] sdns = (string[])mo[&quot;DNSServerSearchOrder&quot;];
        		if (sdns != null) {
					foreach(string strdns in sdns) {
        				if (textBox4.Text == &quot;&quot;) textBox4.Text=strdns;
        				textBox5.Text = strdns;
					}
        		}
			}
        	}//try
        	catch(Exception ex)
        	{
            	//MessageBox.Show(&quot;error : &quot; + ex.Message);
        	}
        	if (comboBox1.Text==&quot;Interfaz ppp/modem 3G/ ...&quot;) {
        		comboBox3.Text=&quot;255.255.255.255&quot;;
        		comboBox4.Text=&quot;0.0.0.0&quot;;
        		textBox4.Text=&quot;208.67.222.222&quot;;
        		textBox5.Text=&quot;208.67.220.220&quot;;
        	}

		} //fin evento combobox

		void ComboBox2SelectedIndexChanged(object sender, EventArgs e)
		{
			try
			{
				comboBox3.SelectedIndex = comboBox2.SelectedIndex;

			}
			catch(Exception ex)
        	{
            	//MessageBox.Show(&quot;error : &quot; + ex.Message);
        	}
		}//

		void ComboBox3SelectedIndexChanged(object sender, EventArgs e)
		{
			try
			{
				comboBox2.SelectedIndex = comboBox3.SelectedIndex;
			}
			catch(Exception ex)
        	{
            	//MessageBox.Show(&quot;error : &quot; + ex.Message);
        	}
		}

		void CheckBox1CheckedChanged(object sender, EventArgs e)
		{
			if (checkBox1.Checked) {
				textBox6.Enabled = true;
				textBox7.Enabled = true;
				checkBox27.Checked = true;
			}
			else {
				textBox6.Enabled = false;
				textBox7.Enabled = false;
				checkBox27.Checked = false;
			}
		}

		void Button1Click(object sender, EventArgs e)
		{
			Process.Start(&quot;TailCsharp2.exe&quot;);
			/*
			 * Process p= new Process();
				p.StartInfo.WorkingDirectory = @&quot;C:\whatever&quot;;
				p.StartInfo.FileName = @&quot;C:\some.exe&quot;;
				p.StartInfo.CreateNoWindow = true;
				p.Start();
				p.WaitForExit();
			 */
		}

		void Button2Click(object sender, EventArgs e)
		{
			//si no existe fichero lo creamos
			if (!File.Exists(&quot;table1.txt&quot;)) {
				StreamWriter Sw1 = new StreamWriter(&quot;table1.txt&quot;);
				Sw1.WriteLine(&quot;adultpornoxxx.info&quot;);
				Sw1.WriteLine(&quot;0.0.0.0/8&quot;);
				Sw1.WriteLine(&quot;5.64.0.0/10&quot;);
				Sw1.WriteLine(&quot;5.128.0.0/9&quot;);
				Sw1.WriteLine(&quot;216.252.162.8&quot;);
				Sw1.Close();
			}
			Process.Start(&quot;table1.txt&quot;);

		}

		void Button3Click(object sender, EventArgs e)
		{
			Process.Start(&quot;http://www.team-cymru.org/Services/Bogons/fullbogons-ipv4.txt&quot;);
		}

		void Button4Click(object sender, EventArgs e)
		{
			Process.Start(&quot;http://www.joewein.net/dl/bl/dom-bl-base.txt&quot;);
		}

		void Button5Click(object sender, System.EventArgs e)
		{
			//si no existe fichero lo creamos
			if (!File.Exists(&quot;portsout.txt&quot;)) {
				StreamWriter Sw1 = new StreamWriter(&quot;portsout.txt&quot;);
				Sw1.WriteLine(&quot;# tcp ports out - puertos tcp a los que podrás conectarte&quot;);
				Sw1.WriteLine(&quot;# ftp&quot;);
				Sw1.WriteLine(&quot;20&quot;);
				Sw1.WriteLine(&quot;21&quot;);
				Sw1.WriteLine(&quot;# ssh&quot;);
				Sw1.WriteLine(&quot;22&quot;);
				Sw1.WriteLine(&quot;# telnet&quot;);
				Sw1.WriteLine(&quot;23&quot;);
				Sw1.WriteLine(&quot;# smtp&quot;);
				Sw1.WriteLine(&quot;25&quot;);
				Sw1.WriteLine(&quot;# http&quot;);
				Sw1.WriteLine(&quot;80&quot;);
				Sw1.WriteLine(&quot;# pop3&quot;);
				Sw1.WriteLine(&quot;110&quot;);
				Sw1.WriteLine(&quot;# https&quot;);
				Sw1.WriteLine(&quot;443&quot;);
				Sw1.WriteLine(&quot;# secureImap&quot;);
				Sw1.WriteLine(&quot;993&quot;);
				Sw1.WriteLine(&quot;# Terminal server - remote desktop&quot;);
				Sw1.WriteLine(&quot;3389&quot;);
				Sw1.Close();
				}
			Process.Start(&quot;portsout.txt&quot;);
		}

		void Button6Click(object sender, System.EventArgs e)
		{
			//si no existe fichero lo creamos
			if (!File.Exists(&quot;portsin.txt&quot;)) {
				StreamWriter Sw1 = new StreamWriter(&quot;portsin.txt&quot;);
				Sw1.WriteLine(&quot;# tcp ports in - puertos tuyos tcp a los que podrán conectarse&quot;);
				Sw1.WriteLine(&quot;# Terminal server o Remote desktop for win: tcp3389&quot;);
				Sw1.WriteLine(&quot;3389&quot;);
				Sw1.Close();
				}
			Process.Start(&quot;portsin.txt&quot;);
		}

		void CheckBox12CheckedChanged(object sender, EventArgs e)
		{
			if (checkBox12.Checked)
			{
			 //checkedListBox5.Enabled = true;
			 button6.Enabled = true;
			 }
			else
			{
			//checkedListBox5.Enabled = false;
			button6.Enabled = false;
			}
		}

		void Button7Click(object sender, EventArgs e)
		{
			fulldata();
		}

		void Button8Click(object sender, EventArgs e)
		{
			Process.Start(&quot;http://wipfw.sourceforge.net/&quot;);
		}

		void Button9Click(object sender, EventArgs e)
		{
			//si no existe fichero lo creamos
			if (!File.Exists(&quot;udpout.txt&quot;)) {
				StreamWriter Sw1 = new StreamWriter(&quot;udpout.txt&quot;);
				Sw1.WriteLine(&quot;#No udp Ports out&quot;);
				Sw1.WriteLine(&quot;# tftp udp69&quot;);
				Sw1.WriteLine(&quot;69&quot;);
				Sw1.Close();
				}
			Process.Start(&quot;udpout.txt&quot;);
		}

		void Button10Click(object sender, EventArgs e)
		{
			Process.Start(&quot;http://www.javcasta.com/2011/07/31/wipfw-un-firewall-freebsd-por-consola-para-windows/&quot;);
		}

		void Button11Click(object sender, EventArgs e)
		{
			Process.Start(&quot;http://www.javcasta.com/?s=wipfw&quot;);
		}

		void TabPage3GotFocus(object sender, EventArgs e)
		{
			//evento foco
			richTextBox2.Select();
			richTextBox2.Text=&quot;@echo off\n&quot;;
			richTextBox2.Text+=&quot;@SETLOCAL ENABLEDELAYEDEXPANSION\n&quot;;
			richTextBox2.Text+=&quot;REM WipFW 0.5.5b Script Generator V1.Beta - By JavCasta - 2.011\n&quot;;
			richTextBox2.Text+=&quot;REM http://javcasta.com/\n&quot;;
			richTextBox2.Text+=&quot;set dns1=&quot;+textBox4.Text+&quot;\n&quot;;
			richTextBox2.Text+=&quot;set dns2=&quot;+textBox5.Text+&quot;\n&quot;;
			richTextBox2.Text+=&quot;set me=&quot;+comboBox2.Text+&quot;\n&quot;;
			richTextBox2.Text+=&quot;set mask=&quot;+comboBox3.Text+&quot;\n&quot;;
			richTextBox2.Text+=&quot;set gw=&quot;+comboBox4.Text+&quot;\n&quot;;
			if (checkBox1.Checked) {
				if (textBox6.Text!=&quot;&quot; &amp;&amp; textBox7.Text!=&quot;&quot;) {
					richTextBox2.Text+=&quot;set proxy=&quot;+textBox6.Text+&quot;\n&quot;;
					richTextBox2.Text+=&quot;set proxyport=&quot;+textBox7.Text+&quot;\n&quot;;
				}
			}
			richTextBox2.Text+=&quot;echo Limpiamos (flush) reglas del firewall wipfw.\n&quot;;
			richTextBox2.Text+=&quot;ipfw -q -f flush\n&quot;;
			if (checkBox2.Checked) richTextBox2.Text+=&quot;REM count\n&quot;+&quot;ipfw -q add count &quot;+comboBox6.Text+&quot;ip from any to any\n&quot;;
			if (checkBox3.Checked) richTextBox2.Text+=&quot;REM loopback\n&quot;+&quot;ipfw -q add &quot;+comboBox5.Text+&quot;ip from any to any via lo*\n&quot;;
			if (checkBox4.Checked) richTextBox2.Text+=&quot;REM debegamos trafico entrante aleatorio con probabilidad &gt;=5%\n&quot;+
				&quot;ipfw -q add prob 0.05 drop ip from any to any in\n&quot;;
			if (checkBox5.Checked) richTextBox2.Text+=&quot;REM denegamos localhost spoofing\n&quot;+&quot;ipfw -q add drop log ip from any to 127.0.0.0/8 in\n&quot;;
			if (checkBox6.Checked) richTextBox2.Text+=&quot;ipfw -q add drop log ip from 127.0.0.0/8 to any in\n&quot;;
			if (checkBox7.Checked) richTextBox2.Text+=&quot;REM denegamos trafico fragmentado\n&quot;+&quot;ipfw -q add drop log all from any to any frag\n&quot;;
			if (checkBox20.Checked) {
					richTextBox2.Text+=&quot;REM DHCP\n&quot;+&quot;ipfw -q add pass udp from 0.0.0.0 68 to 255.255.255.255 67 out\n&quot;+
						&quot;ipfw -q add pass udp from any 67 to any 68 in\n&quot;+
						&quot;ipfw -q add pass udp from any 67 to 255.255.255.255 68 in\n&quot;;
				}
			if (checkBox10.Checked) richTextBox2.Text+=&quot;REM ICMP\n&quot;+&quot;ipfw -q add &quot;+comboBox9.Text+&quot;icmp from any to any\n&quot;;
			if (checkBox32.Checked) richTextBox2.Text+=&quot;REM IPv6\n&quot;+&quot;ipfw -q add &quot;+comboBox29.Text+&quot;ipv6 from any to any\n&quot;;
			if (checkBox22.Checked) richTextBox2.Text+=&quot;REM Check-State\n&quot;+&quot;ipfw -q add check-state\n&quot;;
			if (checkBox23.Checked) richTextBox2.Text+=&quot;REM DNS\n&quot;+&quot;ipfw -q add &quot;+comboBox20.Text+&quot;udp from any to %dns1%,%dns2% 53 keep-state\n&quot;;
			if (checkBox24.Checked) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox21.Text+&quot;udp from %dns1%,%dns2% 53 to any keep-state\n&quot;;
			if (checkBox14.Checked) richTextBox2.Text+=&quot;REM Multicast / IGMP\n&quot;+&quot;ipfw -q add &quot;+comboBox13.Text+&quot;ip from any to 224.0.0.0/3\n&quot;;
			if (checkBox14.Checked) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox12.Text+&quot;ip from 224.0.0.0/3 to any\n&quot;;
			if (checkBox16.Checked) richTextBox2.Text+=&quot;REM link-local\n&quot;+&quot;ipfw -q add &quot;+comboBox15.Text+&quot;ip from any to 169.254.0.0/16\n&quot;;
			if (checkBox15.Checked) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox14.Text+&quot;ip from 169.254.0.0/16 to any\n&quot;;
			//redes privadas y bogon
			string poolnet1=&quot;&quot;;
			String poolnet2=&quot;&quot;;
			int countpool = 0;
			foreach(var item in checkedListBox3.CheckedItems){
				Regex ip = new Regex(@&quot;\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2}\b&quot;);
				MatchCollection result = ip.Matches(item.ToString());
				if (countpool &lt; 4) poolnet1+=result[0]+&quot;,&quot;;
				if (countpool &gt;= 4) poolnet2+=result[0]+&quot;,&quot;;
				countpool++;
			}
			poolnet1=poolnet1.TrimEnd(',');
			poolnet2=poolnet2.TrimEnd(',');
			//MessageBox.Show(poolnet1);
			if (checkBox18.Checked) {
				richTextBox2.Text+=&quot;REM redes privadas y bogon\n&quot;+
					&quot;ipfw -q add &quot;+comboBox17.Text+&quot;ip from any to &quot;+poolnet1+&quot;\n&quot;;
				richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox17.Text+&quot;ip from any to &quot;+poolnet2+&quot;\n&quot;;
			}
			if (checkBox29.Checked) {
				richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox26.Text+&quot;ip from &quot;+poolnet1+&quot; to any\n&quot;;
				richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox26.Text+&quot;ip from &quot;+poolnet2+&quot; to any\n&quot;;
			}
			richTextBox2.Text+=&quot;REM Lista Negra\n&quot;+&quot;ipfw -q table 1 flush\n&quot;;
			richTextBox2.Text+=&quot;if exist table1.txt FOR /F \&quot;eol=#\&quot; %%i IN (table1.txt) do ipfw -q table 1 add %%i\n&quot;;
			if (checkBox17.Checked) richTextBox2.Text+=&quot;if exist table1.txt ipfw -q add &quot;+comboBox16.Text+&quot;ip from \&quot;table(1)\&quot; to any\n&quot;;
			if (checkBox19.Checked) richTextBox2.Text+=&quot;if exist table1.txt ipfw -q add &quot;+comboBox18.Text+&quot;ip from any to \&quot;table(1)\&quot;\n&quot;;
			//no tcp ports out
			String vnoportsout=&quot;&quot;;
			if (checkBox30.Checked) {
				richTextBox2.Text+=&quot;REM denegamos puertos tcp out\n&quot;;
				//leemos noportsout.txt
				StreamReader ficheronpo = new StreamReader(&quot;noportsout.txt&quot;);
				int counternpo = 0;
				string linenpo=&quot;#&quot;;
				while((linenpo = ficheronpo.ReadLine()) != null){
					if (!linenpo.StartsWith(&quot;#&quot;)) {
						vnoportsout+=linenpo+&quot;,&quot;;
						counternpo++;
					}

    				if (counternpo&gt;4) {
    					vnoportsout=vnoportsout.TrimEnd(',');
    					if (vnoportsout!=&quot;&quot;) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox27.Text+&quot;tcp from %me% to any &quot;+vnoportsout+&quot;\n&quot;;
    					counternpo=0;
    					vnoportsout=&quot;&quot;;
    				}
				}
				ficheronpo.Close();
				vnoportsout=vnoportsout.TrimEnd(',');
				if (vnoportsout!=&quot;&quot;) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox27.Text+&quot;tcp from %me% to any &quot;+vnoportsout+&quot;\n&quot;;
			}
			//no tcp ports in
			String vnoportsin=&quot;&quot;;
			if (checkBox25.Checked) {
				richTextBox2.Text+=&quot;REM denegamos puertos tcp in\n&quot;;
				//leemos noportsin.txt
				StreamReader ficheronpi = new StreamReader(&quot;noportsin.txt&quot;);
				int counternpi = 0;
				string linenpi=&quot;#&quot;;
				while((linenpi = ficheronpi.ReadLine()) != null){
					if (!linenpi.StartsWith(&quot;#&quot;)) {
						vnoportsin+=linenpi+&quot;,&quot;;
						counternpi++;
					}

    				if (counternpi&gt;4) {
    					vnoportsin=vnoportsin.TrimEnd(',');
    					if (vnoportsin!=&quot;&quot;) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox22.Text+&quot;tcp from any to %me% &quot;+vnoportsin+&quot;\n&quot;;
    					counternpi=0;
    					vnoportsin=&quot;&quot;;
    				}
				}
				ficheronpi.Close();
				vnoportsin=vnoportsin.TrimEnd(',');
				if (vnoportsin!=&quot;&quot;) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox22.Text+&quot;tcp from any to %me% &quot;+vnoportsin+&quot;\n&quot;;
			}
			//no udp out
			String vnoudpout=&quot;&quot;;
			if (checkBox26.Checked) {
				richTextBox2.Text+=&quot;REM denegamos puertos udp out\n&quot;;
				//leemos noudpout.txt
				StreamReader ficheronuo = new StreamReader(&quot;noudpout.txt&quot;);
				int counternuo = 0;
				string linenuo=&quot;#&quot;;
				while((linenuo = ficheronuo.ReadLine()) != null){
					if (!linenuo.StartsWith(&quot;#&quot;)) {
						vnoudpout+=linenuo+&quot;,&quot;;
						counternuo++;
					}

    				if (counternuo&gt;4) {
    					vnoudpout=vnoudpout.TrimEnd(',');
    					if (vnoudpout!=&quot;&quot;) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox23.Text+&quot;udp from %me% to any &quot;+vnoudpout+&quot;\n&quot;;
    					counternuo=0;
    					vnoudpout=&quot;&quot;;
    				}
				}
				ficheronuo.Close();
				vnoudpout=vnoudpout.TrimEnd(',');
				if (vnoudpout!=&quot;&quot;) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox23.Text+&quot;udp from %me% to any &quot;+vnoudpout+&quot;\n&quot;;
			}
			//noudpin
			String vnoudpin=&quot;&quot;;
			if (checkBox28.Checked) {
				richTextBox2.Text+=&quot;REM denegamos puertos udp in\n&quot;;
				//leemos noudpin.txt
				StreamReader ficheronui = new StreamReader(&quot;noudpin.txt&quot;);
				int counternui = 0;
				string linenui=&quot;#&quot;;
				while((linenui = ficheronui.ReadLine()) != null){
					if (!linenui.StartsWith(&quot;#&quot;)) {
						vnoudpin+=linenui+&quot;,&quot;;
						counternui++;
					}

    				if (counternui&gt;4) {
    					vnoudpin=vnoudpin.TrimEnd(',');
    					if (vnoudpin!=&quot;&quot;) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox25.Text+&quot;udp from any to %me% &quot;+vnoudpin+&quot;\n&quot;;
    					counternui=0;
    					vnoudpin=&quot;&quot;;
    				}
				}
				ficheronui.Close();
				vnoudpin=vnoudpin.TrimEnd(',');
				if (vnoudpin!=&quot;&quot;) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox25.Text+&quot;udp from any to %me% &quot;+vnoudpin+&quot;\n&quot;;
			}
			richTextBox2.Text+=&quot;REM si trafico entre %me% y any saltamos a 50000\n&quot;;
			richTextBox2.Text+=&quot;ipfw -q add skipto 50000 ip from %me% to any\n&quot;;
			richTextBox2.Text+=&quot;ipfw -q add skipto 50000 ip from any to %me%\n&quot;;
			richTextBox2.Text+=&quot;REM lo permitido ya ha saltado a 50000, denegamos establecidas\n&quot;;
			richTextBox2.Text+=&quot;ipfw -q add drop log tcp from any to any established\n&quot;;
			richTextBox2.Text+=&quot;REM saltamos a 65534 - drop all from any to any\n&quot;;
			richTextBox2.Text+=&quot;ipfw -q add skipto 65534 ip from any to any\n&quot;;
			//established
			richTextBox2.Text+=&quot;REM Established y si tcp out\n&quot;+&quot;ipfw -q add 50000 allow tcp from %me% to any established out\n&quot;;
			richTextBox2.Text+=&quot;ipfw -q add allow tcp from any to %me% established in\n&quot;;
			//sitcpout
			string vportsout=&quot;&quot;;
			if (checkBox11.Checked) {
				//leemos portsout.txt
				StreamReader fichero = new StreamReader(&quot;portsout.txt&quot;);
				int counter = 0;
				string line=&quot;#&quot;;
				while((line = fichero.ReadLine()) != null){
					if (!line.StartsWith(&quot;#&quot;)) {
						vportsout+=line+&quot;,&quot;;
						counter++;
					}

    				if (counter&gt;4) {
    					vportsout=vportsout.TrimEnd(',');
    					if (vportsout!=&quot;&quot;) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox10.Text+&quot;tcp from %me% to any &quot;+vportsout+&quot; setup keep-state\n&quot;;
    					counter=0;
    					vportsout=&quot;&quot;;
    				}
				}
				fichero.Close();
				vportsout=vportsout.TrimEnd(',');
				if (vportsout!=&quot;&quot;) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox10.Text+&quot;tcp from %me% to any &quot;+vportsout+&quot; setup keep-state\n&quot;;
			}
			//proxy
			if (checkBox27.Checked) richTextBox2.Text+=&quot;if defined proxy if defined proxyport ipfw -q add &quot;+comboBox24.Text+&quot;tcp from %me% to %proxy% %proxyport% setup keep-state\n&quot;;
			//si tcp ports in
			String vsiportsin=&quot;&quot;;
			if (checkBox12.Checked) {
				richTextBox2.Text+=&quot;REM permitimos puertos tcp in - entrantes\n&quot;;
				//leemos portsin.txt
				StreamReader ficherospi = new StreamReader(&quot;portsin.txt&quot;);
				int counterspi = 0;
				string linespi=&quot;#&quot;;
				while((linespi = ficherospi.ReadLine()) != null){
					if (!linespi.StartsWith(&quot;#&quot;)) {
						vsiportsin+=linespi+&quot;,&quot;;
						counterspi++;
					}

    				if (counterspi&gt;4) {
    					vsiportsin=vsiportsin.TrimEnd(',');
    					if (vsiportsin!=&quot;&quot;) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox11.Text+&quot;tcp from any to %me% &quot;+vsiportsin+&quot; setup keep-state\n&quot;;
    					counterspi=0;
    					vsiportsin=&quot;&quot;;
    				}
				}
				ficherospi.Close();
				vsiportsin=vsiportsin.TrimEnd(',');
				if (vsiportsin!=&quot;&quot;) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox11.Text+&quot;tcp from any to %me% &quot;+vsiportsin+&quot; setup keep-state\n&quot;;
			}
			//si udp in
			String vudpin=&quot;&quot;;
			if (checkBox31.Checked) {
				richTextBox2.Text+=&quot;REM denegamos puertos udp in\n&quot;;
				//leemos udpin.txt
				StreamReader ficherosui = new StreamReader(&quot;udpin.txt&quot;);
				int counterui = 0;
				string linenui=&quot;#&quot;;
				while((linenui = ficherosui.ReadLine()) != null){
					if (!linenui.StartsWith(&quot;#&quot;)) {
						vudpin+=linenui+&quot;,&quot;;
						counterui++;
					}

    				if (counterui&gt;4) {
    					vudpin=vudpin.TrimEnd(',');
    					if (vudpin!=&quot;&quot;) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox18.Text+&quot;udp from any to %me% &quot;+vudpin+&quot;\n&quot;;
    					counterui=0;
    					vudpin=&quot;&quot;;
    				}
				}
				ficherosui.Close();
				vudpin=vudpin.TrimEnd(',');
				if (vudpin!=&quot;&quot;) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox18.Text+&quot;udp from any to %me% &quot;+vudpin+&quot;\n&quot;;
			}
			//si udp out
			String vudpout=&quot;&quot;;
			if (checkBox21.Checked) {
				richTextBox2.Text+=&quot;REM permitimos puertos udp out\n&quot;;
				//leemos udpout.txt
				StreamReader ficherosuo = new StreamReader(&quot;udpout.txt&quot;);
				int counteruo = 0;
				string linenuo=&quot;#&quot;;
				while((linenuo = ficherosuo.ReadLine()) != null){
					if (!linenuo.StartsWith(&quot;#&quot;)) {
						vudpout+=linenuo+&quot;,&quot;;
						counteruo++;
					}

    				if (counteruo&gt;4) {
    					vudpout=vudpout.TrimEnd(',');
    					if (vudpout!=&quot;&quot;) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox19.Text+&quot;udp from %me% to %any% &quot;+vudpout+&quot; keep-state\n&quot;;
    					counteruo=0;
    					vudpout=&quot;&quot;;
    				}
				}
				ficherosuo.Close();
				vudpout=vudpout.TrimEnd(',');
				if (vudpout!=&quot;&quot;) richTextBox2.Text+=&quot;ipfw -q add &quot;+comboBox19.Text+&quot;udp from %me% to any &quot;+vudpout+&quot; keep-state\n&quot;;
			}
			richTextBox2.Text+=&quot;ipfw -q add 65534 drop log all from any to any\n&quot;;
			richTextBox2.Text+=&quot;pause&quot;;

		}

		void Button15Click(object sender, EventArgs e)
		{
			Process.Start(&quot;https://secure.wikimedia.org/wikipedia/en/wiki/List_of_IP_protocol_numbers&quot;);
		}

		void Button14Click(object sender, EventArgs e)
		{
			//si no existe fichero lo creamos
			if (!File.Exists(&quot;noportsout.txt&quot;)) {
				StreamWriter Sw1 = new StreamWriter(&quot;noportsout.txt&quot;);
				Sw1.WriteLine(&quot;#No tcp Ports out&quot;);
				Sw1.WriteLine(&quot;#vnc tcp5800, tcp5900&quot;);
				Sw1.WriteLine(&quot;5800&quot;);
				Sw1.WriteLine(&quot;5900&quot;);
				Sw1.Close();
				}
			Process.Start(&quot;noportsout.txt&quot;);
		}

		void Button16Click(object sender, EventArgs e)
		{
			richTextBox2.SelectAll();
			richTextBox2.Copy();
		}

		void Button17Click(object sender, EventArgs e)
		{
			if (!File.Exists(&quot;noportsin.txt&quot;)) {
				StreamWriter Sw1 = new StreamWriter(&quot;noportsin.txt&quot;);
				Sw1.WriteLine(&quot;# No tcp Ports in - Puertos tuyos tcp a los que no se podran conectar&quot;);
				Sw1.WriteLine(&quot;21&quot;);
				Sw1.WriteLine(&quot;23&quot;);
				Sw1.WriteLine(&quot;25&quot;);
				Sw1.WriteLine(&quot;80&quot;);
				Sw1.WriteLine(&quot;443&quot;);
				Sw1.WriteLine(&quot;162&quot;);
				Sw1.WriteLine(&quot;169&quot;);
				Sw1.Close();
				}
			Process.Start(&quot;noportsin.txt&quot;);
		}

		void Button12Click(object sender, EventArgs e)
		{
			//ejecutar
			StreamWriter defaultScript = new StreamWriter(&quot;MyWipFWScript.cmd&quot;);
			defaultScript.Write(richTextBox2.Text);
			defaultScript.Close();
			//string pass = &quot;&quot;;
			var pass = new System.Security.SecureString();
			foreach (Char c in maskedTextBox1.Text.ToCharArray()){
				pass.AppendChar(c);
			}
			try {
				Process.Start(&quot;MyWipFWScript.cmd&quot;,textBox1.Text, pass, &quot;&quot;);
			}
			catch(Exception ex) {
				MessageBox.Show(&quot;error : &quot; + ex.Message + &quot;\n Revisa en la pestaña anterior, las credenciales de &quot;+textBox1.Text);
			}
			/*
			var psi = new ProcessStartInfo
			{
    			FileName = &quot;MyWipFWScript.cmd&quot;,
    			UserName = &quot;administrador&quot;,
    			Domain = &quot;&quot;,
    			Password = pass,
    			UseShellExecute = false,
    			RedirectStandardOutput = true,
    			RedirectStandardError = true
			};
			Process.Start(psi);
			*/
		}

		void Button13Click(object sender, EventArgs e)
		{
			//guardar MyWipFWScript
			string ahora = DateTime.Now.Day.ToString()+&quot;-&quot;+DateTime.Now.Month.ToString()+&quot;-&quot;+
				DateTime.Now.Year.ToString()+&quot;-&quot;+DateTime.Now.Hour.ToString()+&quot;-&quot;+DateTime.Now.Minute.ToString();
			string script = &quot;MyWipFWScript&quot;+&quot;-&quot;+ahora+&quot;.cmd&quot;;
			//creamos fichero
			StreamWriter myscript = new StreamWriter(script);
			myscript.Write(richTextBox2.Text);
			myscript.Close();
			MessageBox.Show(&quot;Se ha guardado &quot;+script);

		}

		void Button18Click(object sender, EventArgs e)
		{
			//no udp out
			if (!File.Exists(&quot;noudpout.txt&quot;)) {
				StreamWriter Sw1 = new StreamWriter(&quot;noudpout.txt&quot;);
				Sw1.WriteLine(&quot;# No udp ports out&quot;);
				Sw1.WriteLine(&quot;161&quot;);
				Sw1.Close();
				}
			Process.Start(&quot;noudpout.txt&quot;);
		}

		void Button20Click(object sender, EventArgs e)
		{
			//si udp in
			if (!File.Exists(&quot;udpin.txt&quot;)) {
				StreamWriter Sw1 = new StreamWriter(&quot;udpin.txt&quot;);
				Sw1.WriteLine(&quot;# udp ports in&quot;);
				Sw1.WriteLine(&quot;# tftp69&quot;);
				Sw1.WriteLine(&quot;#69&quot;);
				Sw1.Close();
				}
			Process.Start(&quot;udpin.txt&quot;);
		}

		void Button19Click(object sender, EventArgs e)
		{
			//no udp in
			if (!File.Exists(&quot;noudpin.txt&quot;)) {
				StreamWriter Sw1 = new StreamWriter(&quot;noudpin.txt&quot;);
				Sw1.WriteLine(&quot;# no udp ports in&quot;);
				Sw1.WriteLine(&quot;69&quot;);
				Sw1.Close();
				}
			Process.Start(&quot;noudpin.txt&quot;);
		}

		void Button21Click(object sender, EventArgs e)
		{
			//FAQ
			Process.Start(&quot;http://www.javcasta.com/2011/11/29/wipfw-script-generator-v1-beta/&quot;);
		}
	}
}
</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.javcasta.com%2F2011%2F11%2F29%2Fwipfw-script-generator-v1-beta%2F&amp;title=WipFW%20Script%20Generator%20V1%20Beta" id="wpa2a_2"><img src="http://www.javcasta.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2011/11/29/wipfw-script-generator-v1-beta/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Slik SVN &#8211; Subversion para win Y Sqlite3 como alternativa a MySQL en instalación de UMO en Windows</title>
		<link>http://www.javcasta.com/2011/11/15/slik-svn-subversion-para-win-y-sqlite3-como-alternativa-a-mysql-en-instalacion-de-umo-en-windows/</link>
		<comments>http://www.javcasta.com/2011/11/15/slik-svn-subversion-para-win-y-sqlite3-como-alternativa-a-mysql-en-instalacion-de-umo-en-windows/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 17:28:08 +0000</pubDate>
		<dc:creator>javcasta</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[seguridad]]></category>
		<category><![CDATA[Sistemas]]></category>
		<category><![CDATA[soporte]]></category>
		<category><![CDATA[Utilidades]]></category>

		<guid isPermaLink="false">http://www.javcasta.com/?p=7843</guid>
		<description><![CDATA[Referencias: http://subversion.apache.org/packages.html http://www.sliksvn.com/en/download http://code.google.com/p/umo/source/checkout http://www.securityartwork.es/2011/07/13/instalacion-de-umo-0-1b-beta-url-malware-owned/ http://www.securityartwork.es/2011/11/14/url-malware-owned-umo-ejemplos-de-uso/ http://www.sqlite.org Hay ciertas utilidades que no se pueden descargar sus scripts y/o paquetes directamente desde web. Y hay que hacerlo vía un cliente de subversion. El cliente svn es muy simple de instalar en linux. Por ejemplo para Ubuntu, se instala con: usuario@maquina$sudo apt-get install subversion usuario@maquina$sudo apt-get install [...]]]></description>
			<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2011%2F11%2F15%2Fslik-svn-subversion-para-win-y-sqlite3-como-alternativa-a-mysql-en-instalacion-de-umo-en-windows%2F"></g:plusone><br /><p><!-- tweet id : 136496643381006337 --><style type='text/css'>#bbpBox_136496643381006337 a { text-decoration:none; color:#2FC2EF; }#bbpBox_136496643381006337 a:hover { text-decoration:underline; }</style><div id='bbpBox_136496643381006337' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#1a1b1f; background-image:url(http://a0.twimg.com/profile_background_images/234683216/leonTwitter.JPG); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#666666; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>Nuevo Post: Slik SVN - Subversion para win Y Sqlite3 como alternativa a MySQL en instalaci&#243;n de UMO en Windows   <a href="http://t.co/t0UtgQJM" rel="nofollow">http://t.co/t0UtgQJM</a></span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://www.javcasta.com/blog/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 15/11/2011 17:31' href='http://twitter.com/#!/javcasta/status/136496643381006337' target='_blank'>15/11/2011 17:31</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=136496643381006337' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=136496643381006337' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=136496643381006337' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=javcasta'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a2.twimg.com/profile_images/1316173538/avatar_normal.png' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=javcasta'>@javcasta</a><div style='margin:0; padding-top:2px'>Javier Casta&#241;&#243;n</div></div><div style='clear:both'></div></div></div><!-- end of tweet --><br />
<hr />
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/sqlite370_banner.gif"><img class="aligncenter size-full wp-image-7844" title="sqlite370_banner" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/sqlite370_banner.gif" alt="" width="220" height="101" /></a></p>
<p>Referencias:</p>
<ul>
<li><a href="http://subversion.apache.org/packages.html" target="_blank">http://subversion.apache.org/packages.html</a></li>
<li><a href="http://www.sliksvn.com/en/download" target="_blank">http://www.sliksvn.com/en/download</a></li>
<li><a href="http://code.google.com/p/umo/source/checkout" target="_blank">http://code.google.com/p/umo/source/checkout</a></li>
<li><a href="http://www.securityartwork.es/2011/07/13/instalacion-de-umo-0-1b-beta-url-malware-owned/" target="_blank">http://www.securityartwork.es/2011/07/13/instalacion-de-umo-0-1b-beta-url-malware-owned/</a></li>
<li><a href="http://www.securityartwork.es/2011/11/14/url-malware-owned-umo-ejemplos-de-uso/" target="_blank">http://www.securityartwork.es/2011/11/14/url-malware-owned-umo-ejemplos-de-uso/</a></li>
<li><a href="http://www.sqlite.org" target="_blank">http://www.sqlite.org</a></li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/Slik-SVN-for-win-0.jpg"><img class="aligncenter size-full wp-image-7845" title="Slik-SVN-for-win-0" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/Slik-SVN-for-win-0.jpg" alt="" width="500" height="396" /></a></p>
<p>Hay ciertas utilidades que no se pueden descargar sus scripts y/o paquetes directamente desde web.<br />
Y hay que hacerlo vía un <strong>cliente de subversion</strong>.</p>
<p>El <strong>cliente svn</strong> es muy simple de instalar en<strong> linux</strong>.<br />
Por ejemplo para <strong>Ubuntu</strong>, se instala con:</p>
<blockquote><p><span style="color: #888888;">usuario@maquina$</span><strong>sudo apt-get install subversion</strong><br />
<span style="color: #888888;">usuario@maquina$</span><strong>sudo apt-get install libapache2-svn</strong></p></blockquote>
<p>En la pagina <a href="http://subversion.apache.org/packages.html" target="_blank">http://subversion.apache.org/packages.html</a> nos indican que para <strong>windows</strong> existen:</p>
<blockquote>
<ul>
<li>CollabNet (client only; supported and certified by CollabNet; requires registration)</li>
<li><strong>SlikSVN</strong> (32- and 64-bit client MSI; maintained by Bert Huijben, SharpSvn project)</li>
<li>VisualSVN (client and server; supported and maintained by VisualSVN)</li>
<li>WANdisco (32- and 64-bit client and server; supported and certified by WANdisco)</li>
<li>Win32Svn (32-bit client, server and bindings, MSI and ZIPs; maintained by David Darj)</li>
</ul>
</blockquote>
<p style="text-align: left;">He elegido para probar <strong>Skil</strong>.</p>
<p><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/Slik-SVN-for-win-1.jpg"><img class="aligncenter size-full wp-image-7846" title="Slik-SVN-for-win-1" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/Slik-SVN-for-win-1.jpg" alt="" width="500" height="285" /></a><br />
Se descarga y se instala como cualquier paquete <strong>msi</strong> de win.</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/Slik-SVN-for-win-2.jpg"><img class="aligncenter size-full wp-image-7847" title="Slik-SVN-for-win-2" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/Slik-SVN-for-win-2.jpg" alt="" width="500" height="390" /></a></p>
<p>Solo instalo el cliente <strong>svn</strong> (no el servidor)</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/Slik-SVN-for-win-3.jpg"><img class="aligncenter size-full wp-image-7848" title="Slik-SVN-for-win-3" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/Slik-SVN-for-win-3.jpg" alt="" width="500" height="390" /></a></p>
<p>Ahora instalo <strong>UMO</strong> via <strong>svn</strong>.<br />
Y sigo (no al pie de la letra ya que es para un debian) la guía de:</p>
<p><a href="http://www.securityartwork.es/2011/07/13/instalacion-de-umo-0-1b-beta-url-malware-owned/" target="_blank">http://www.securityartwork.es/2011/07/13/instalacion-de-umo-0-1b-beta-url-malware-owned/</a></p>
<p>Abro una shell e instalo umo vía svn:</p>
<blockquote><p><span style="color: #888888;">svn checkout http://umo.googlecode.com/svn/ umo-read-only</span></p></blockquote>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/Slik-SVN-for-win-4.jpg"><img class="aligncenter size-full wp-image-7849" title="Slik-SVN-for-win-4" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/Slik-SVN-for-win-4.jpg" alt="" width="500" height="345" /></a></p>
<p>Ahora, si lees el <strong>README</strong> de la carpeta <strong>C:\umo-read-only\trunk\safebrowsing</strong></p>
<blockquote><p><em><span style="color: #888888;"># In this directory safebrowsing python library</span></em><br />
<em><span style="color: #888888;">http://code.google.com/p/safebrowsing-python/</span></em><br />
<em><span style="color: #888888;"># Modificaciones sobre la versión </span></em><br />
<em><span style="color: #888888;">(</span></em><br />
<em><span style="color: #888888;">Cuando se importa la librería MySQLdb el script backend.py tiene un fallo y es que la D está en mayúsculas.</span></em><br />
<em><span style="color: #888888;"> Hay que dejarlo así:</span></em><br />
<em><span style="color: #888888;">línea 55: import MySQLDb</span></em><br />
<em><span style="color: #888888;">línea 63: kwargs['db'] = self.db_name</span></em><br />
<em><span style="color: #888888;">línea 73: self.connection = MySQLdb.connect(**kwargs)</span></em><br />
<em><span style="color: #888888;">Con esto ya funciona.</span></em><br />
<em><span style="color: #888888;">El parche se ha sugerido en el proyecto (issue 11)</span></em></p></blockquote>
<p>Instalo <strong>safebrowsing-python-read-only</strong> vía svn</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/Slik-SVN-for-win-5.jpg"><img class="aligncenter size-full wp-image-7850" title="Slik-SVN-for-win-5" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/Slik-SVN-for-win-5.jpg" alt="" width="500" height="175" /></a></p>
<blockquote><p><strong><span style="color: #888888;">svn checkout http://safebrowsing-python.googlecode.com/svn/trunk/ safebrowsing-python-read-only</span></strong></p></blockquote>
<p>Y copio el contenido de la carpeta C:\safebrowsing-python-read-only\safebrowsing a C:\umo-read-only\trunk\safebrowsing</p>
<blockquote><p><span style="color: #888888;">copy C:\safebrowsing-python-read-only\safebrowsing\*.* C:\umo-read-only\trunk\safebrowsing\</span></p></blockquote>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/Slik-SVN-for-win-6.jpg"><img class="aligncenter size-full wp-image-7851" title="Slik-SVN-for-win-6" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/Slik-SVN-for-win-6.jpg" alt="" width="600" height="95" /></a></p>
<p>Y hago las correcciones en <strong>C:\umo-read-only\trunk\safebrowsing\backend.py</strong> (lineas 55,63,73), pero <strong>me da error</strong>, asi que pruebo con:</p>
<p><a href=" http://code.google.com/p/safebrowsing-python/issues/attachmentText?id=11&amp;aid=110000000&amp;name=backend.py.patch&amp;token=4ace29b27293ed1f22be86e1e156cea8" target="_blank"> http://code.google.com/p/safebrowsing-python/issues/attachmentText?id=11&amp;aid=110000000&amp;name=backend.py.patch&amp;token=4ace29b27293ed1f22be86e1e156cea8</a></p>
<p>que proponen como solucion <a href="http://code.google.com/p/safebrowsing-python/issues/detail?id=11" target="_blank">http://code.google.com/p/safebrowsing-python/issues/detail?id=11</a><br />
Pero me sigue dando error &#8230; así que usaré <strong>Sqlite3</strong> como bbdd <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Ahora si lees el contenido del <strong>README</strong> en <strong>C:\umo-read-only\trunk\xgoogle</strong>, ves que hay que instalar xgoogle</p>
<p>Descargo<strong> xgoogle.zip</strong> de <a href="http://www.catonmat.net/blog/python-library-for-google-search/" target="_blank">http://www.catonmat.net/blog/python-library-for-google-search/</a><br />
Y descomprimo el contenido de la carperta xgoogle en <strong>C:\umo-read-only\trunk\xgoogle</strong></p>
<p>Obviamente <strong>UMO</strong> necesita de <strong>python</strong> (.py) por lo que debes de instalarlo ( <a href="http://www.python.org/getit/" target="_blank">http://www.python.org/getit/</a>), si no lo tuvieses.</p>
<p>He usado la version <strong>2.6.6 de python</strong><br />
Es conveniente que definas la variable de entorno <strong>%PATH%</strong> con el camino a python.</p>
<p>Por ejemplo vía consola:</p>
<blockquote><p><span style="color: #888888;"><strong>set path=%path%;C:\Python26</strong></span></p></blockquote>
<p>Ahora instalo vía svn <strong>pybing</strong> (necesario para UMO)</p>
<p>Instalo pybing vía el cliente SlikSvn</p>
<blockquote><p><span style="color: #888888;"><strong>svn checkout http://pybing.googlecode.com/svn/trunk/ pybing</strong></span></p></blockquote>
<p>Y copio la carpeta <strong>C:\pybing\pybing</strong> en <strong>C:\umo-read-only\trunk\</strong></p>
<p><strong>Obtengo una API de Bing</strong> en <a href="http://www.bing.com/developers/" target="_blank">http://www.bing.com/developers/</a><br />
Algo parecido a:</p>
<blockquote><p><strong><span style="color: #888888;">674B8C83AB48A2ABEB1553FE313AE1F211DAF559</span></strong></p></blockquote>
<p>(ojo, que no es una API Key de Bing real, solo indica como es)</p>
<p>Si no tenes instalado <strong>MySQL</strong> en win, puedes decsargar el instalador en <a href="http://dev.mysql.com/downloads/mirror.php?id=404238" target="_blank">http://dev.mysql.com/downloads/mirror.php?id=404238</a></p>
<p>Aunque ya he comentado que usaré <strong>Sqlite3</strong> como motor de bbdd</p>
<p>Una vez instalado MySQL, creamos la base de datos <strong>safebrowsing</strong> y su esquema en MySQL</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/Slik-SVN-for-win-7.jpg"><img class="aligncenter size-full wp-image-7852" title="Slik-SVN-for-win-7" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/Slik-SVN-for-win-7.jpg" alt="" width="500" height="513" /></a></p>
<p>El script sql para crear el esquema de la bbdd safebrowsing:</p>
<pre class="brush: sql; title: ; notranslate">
#creamos la bbdd safebrowsing
CREATE DATABASE safebrowsing;
#usamos la bbdd safebrowsing
use safebrowsing;
#creamos tablas y esquema - http://code.google.com/p/safebrowsing-python/wiki/SQLSchema
CREATE TABLE black_version(
        version_number varchar(20) not null primary key
);

CREATE TABLE malware_version(
        version_number varchar(20) not null primary key
);

CREATE TABLE url_hashes_table(
	badware_type varchar(1) not null,
	url_hash varchar(32) not null
);

CREATE INDEX url_hash_index on url_hashes_table (url_hash);

#usuario
CREATE USER 'umosb'@'localhost' IDENTIFIED BY 'Contraseña'; 123456
#permisos
GRANT ALL PRIVILEGES ON safebrowsing.* TO 'umosb'@'localhost';
flush privileges;
</pre>
<p>Como el error con MySQL, no lo he podido subsanar, he decidido usar Sqlite3 como bbdd, por lo que convierto la bbdd de MySQL a Sqlite<br />
Lo hago con el siguiente shell script MySQL2Sqlite3.sh ( vía <a href="http://forums.mysql.com/read.php?145,68269,92627">http://forums.mysql.com/read.php?145,68269,92627 )</a></p>
<pre class="brush: bash; title: ; notranslate">
./mysqldump.exe -u umosb --password=contraseña --compact --compatible=ansi --default-character-set=binary safebrowsing
 |
grep -v ' KEY &quot;' |
grep -v ' UNIQUE KEY &quot;' | 

perl -e 'local $/;$_=&lt;&gt;;s/,\n\)/\n\)/gs;
 print &quot;begin;\n&quot;;print;print &quot;commit;\n&quot;' | 

perl -pe
 '
if (/^(INSERT.+?)\(/) {
$a=$1;
s/\\'\''/'\'\''/g;
s/\\n/\n/g;
s/\),\(/\);\n$a\(/g;
}
' |
 ./sqlite3 safebrowsing.db
# debes descargar el ejecutable de la shell de sqlite3: sqlite3.exe
</pre>
<p>Que ejecuto bajo <strong>MobaXterm</strong> con el plugin de <strong>perl</strong></p>
<p>Si no deseas convertir la bbdd de <strong>MySQL</strong> a <strong>Sqlite3</strong> y quieres recrear la bbdd <strong>safebrowsing</strong> visualmente, altamente recomendable la utilidad free <strong>Sqlite Browser</strong>. Hay versión para win. Sqlite3 no se instala, tan solo se debe de tener un fichero .db con el formato de Sqlite3 y un programa cliente que soporte conexión a ese tipo de fichero</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/UMO-SQlite-0.jpg"><img class="aligncenter size-full wp-image-7854" title="UMO-SQlite-0" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/UMO-SQlite-0.jpg" alt="" width="600" height="279" /></a></p>
<p>Ahora Obtenemos una <strong>API Key safebrowsing de Google</strong> en</p>
<p><a href="http://code.google.com/intl/es-ES/apis/safebrowsing/key_signup.html">http://code.google.com/intl/es-ES/apis/safebrowsing/key_signup.html</a></p>
<p>algo parecido a:</p>
<blockquote><p><span style="color: #888888;">ABQIBBACqCVqfJGA2Vf-CA0wTSsBbhTLLj6Gdx00Kuh7jyEJnQ82anOMNg</span></p></blockquote>
<p>Editamos <strong>C:\umo-read-only\trunk\safebrowsing\conf.py</strong> y parametrizamos</p>
<blockquote><p><span style="color: #888888;"># Inspired from Django&#8217;s settings.py</span><br />
<span style="color: #888888;">DATABASE_ENGINE = &#8216;sqlite3&#8242; # Possible values being &#8216;postgresql&#8217;, &#8216;mysql&#8217;, &#8216;sqlite3&#8242; or &#8216;memcached&#8217;</span><br />
<span style="color: #888888;">DATABASE_NAME = &#8216;c:\camino-a-bbdd-sqlite3\safebrowsing.db&#8217; # Or path to database file if using sqlite3.</span><br />
<span style="color: #888888;">DATABASE_USER = &#8216;umosb&#8217; # Not used with sqlite3.</span><br />
<span style="color: #888888;">DATABASE_PASSWORD = &#8216;Contraseña&#8217; # Not used with sqlite3.</span><br />
<span style="color: #888888;">DATABASE_HOST = &#8216;localhost&#8217; # Set to empty string for localhost. Not used with sqlite3.</span><br />
<span style="color: #888888;">DATABASE_PORT = &#8221; # Set to empty string for default. Not used with sqlite3.</span><br />
<span style="color: #888888;">DATABASE_IN_MEMORY = True       # Copy url_hashes_table to in-memory SQLite DB for Lookups</span><br />
<span style="color: #888888;">API_KEY = &#8216;ABQIBBACqCVqfJGA2Vf-CA0wTSsBbhTLLj6Gdx00Kuh7jyEJnQ82anOMNg&#8217; # API Key provided by Google.</span></p></blockquote>
<p>editamos <strong>C:\umo-read-only\trunk\umoconfig.py</strong> y parametrizamos (bingkey)</p>
<blockquote><p><span style="color: #888888;">skippages = 0</span><br />
<span style="color: #888888;">pages = 10</span><br />
<span style="color: #888888;">results = 100</span><br />
<span style="color: #888888;">googlesleep = 5</span><br />
<span style="color: #888888;">user_agent = &#8216;code.google.com/umo&#8217;</span><br />
<span style="color: #888888;">bingresults = 400</span><br />
<span style="color: #888888;">bingkey = &#8217;674B8C83AB48A2ABEB1553FE313AE1F211DAF559&#8242; #&#8217;API Key Bing&#8217;</span><br />
<span style="color: #888888;">depth = &#8217;1&#8242;</span><br />
<span style="color: #888888;">malware = &#8216;umomalware.log&#8217;</span><br />
<span style="color: #888888;">safebrowsing = &#8216;True&#8217;</span><br />
<span style="color: #888888;">updatesafebrowsing = &#8216;False&#8217;</span><br />
<span style="color: #888888;">maxtries = 5</span></p></blockquote>
<p>Ahora instalo la libreria para python <strong>httplib2</strong> ( <a href="http://code.google.com/p/httplib2/downloads/detail?name=httplib2-0.7.2.zip&amp;can=2&amp;q=">http://code.google.com/p/httplib2/downloads/detail?name=httplib2-0.7.2.zip&amp;can=2&amp;q=</a> )<br />
Descomprimo <strong>httplib2-0.7.2</strong> de httplib2-0.7.2.zip  en <strong>c:\python266\lib\</strong> e instalo:</p>
<blockquote><p><strong>c:\python266\lib\httplib2-0.7.2\python setup.py install</strong></p></blockquote>
<p><span style="text-decoration: underline;"><strong>Ejecutando UMO:</strong></span></p>
<p>* Actualizar la base de datos</p>
<blockquote><p><strong>C:\umo-read-only\trunk\python umo.py &#8211;update-safebrowsing</strong></p></blockquote>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/Slik-SVN-for-win-8.jpg"><img class="aligncenter size-full wp-image-7855" title="Slik-SVN-for-win-8" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/Slik-SVN-for-win-8.jpg" alt="" width="507" height="92" /></a></p>
<p>* Prueba de <strong>UMO</strong> con  <strong>Crawling</strong>:</p>
<blockquote><p><strong>python umo.py &#8211;safebrowsing -H -u &#8216;http://javcasta.com&#8217; -d 1</strong></p></blockquote>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/UMO-SQlite-1.jpg"><img class="aligncenter size-full wp-image-7856" title="UMO-SQlite-1" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/UMO-SQlite-1.jpg" alt="" width="600" height="167" /></a></p>
<p>* Prueba de UMO vía google:</p>
<blockquote><p><strong>python umo.py -g -q &#8216;src=http://www.lizamoon.com/ur.php&#8217;</strong></p></blockquote>
<p>Ya tenemos UMO obtenido vía svn y casi operativo en Windows 7.</p>
<p>Digo casi, ya que ejecutando UMO me ha salido, a veces, un error de &#8220;<span style="color: #888888;"><em>Invalid URL</em></span>&#8221; en <strong>query_lookup.py</strong></p>
<p>Pero bueno, esto era solo una prueba de la utilidad, este tipo de problemas se lo dejo a los avezados chicos del python scripting</p>
<p>Y voila <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.javcasta.com%2F2011%2F11%2F15%2Fslik-svn-subversion-para-win-y-sqlite3-como-alternativa-a-mysql-en-instalacion-de-umo-en-windows%2F&amp;title=Slik%20SVN%20%26%238211%3B%20Subversion%20para%20win%20Y%20Sqlite3%20como%20alternativa%20a%20MySQL%20en%20instalaci%C3%B3n%20de%20UMO%20en%20Windows" id="wpa2a_4"><img src="http://www.javcasta.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2011/11/15/slik-svn-subversion-para-win-y-sqlite3-como-alternativa-a-mysql-en-instalacion-de-umo-en-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Obtener elementos marcados de un checkedListBox en C#</title>
		<link>http://www.javcasta.com/2011/11/11/obtener-elementos-marcados-de-un-checkedlistbox-en-c/</link>
		<comments>http://www.javcasta.com/2011/11/11/obtener-elementos-marcados-de-un-checkedlistbox-en-c/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 09:09:57 +0000</pubDate>
		<dc:creator>javcasta</dc:creator>
				<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[seguridad]]></category>
		<category><![CDATA[Sistemas]]></category>
		<category><![CDATA[soporte]]></category>
		<category><![CDATA[Utilidades]]></category>

		<guid isPermaLink="false">http://www.javcasta.com/?p=7841</guid>
		<description><![CDATA[Referencia: http://msdn.microsoft.com/en-us/library/system.windows.forms.checkedlistbox.checkeditems.aspx Para recorrer u obtener los elementos (Items) marcados o chequeados (chedkedItems) de un CheckedListBox en C# Por ejemplo, si los elementos de un checkedListBox contienen cadenas con formato de redes IPv4 ( p.e: 192.168.0.0/16 )Una forma de obtener la primera IP de red de cada elemento del checkedListBox seria: Donde la variable de [...]]]></description>
			<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2011%2F11%2F11%2Fobtener-elementos-marcados-de-un-checkedlistbox-en-c%2F"></g:plusone><br /><p><!-- tweet id : 134921362362990593 --><style type='text/css'>#bbpBox_134921362362990593 a { text-decoration:none; color:#2FC2EF; }#bbpBox_134921362362990593 a:hover { text-decoration:underline; }</style><div id='bbpBox_134921362362990593' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#1a1b1f; background-image:url(http://a0.twimg.com/profile_background_images/234683216/leonTwitter.JPG); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#666666; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>Nuevo Post: Obtener elementos marcados de un checkedListBox en C# <a href="http://t.co/Hq0FR1mu" rel="nofollow">http://t.co/Hq0FR1mu</a></span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://www.javcasta.com/blog/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 11/11/2011 09:12' href='http://twitter.com/#!/javcasta/status/134921362362990593' target='_blank'>11/11/2011 09:12</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=134921362362990593' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=134921362362990593' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=134921362362990593' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=javcasta'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a2.twimg.com/profile_images/1316173538/avatar_normal.png' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=javcasta'>@javcasta</a><div style='margin:0; padding-top:2px'>Javier Casta&#241;&#243;n</div></div><div style='clear:both'></div></div></div><!-- end of tweet --><br />
<hr />
<p>Referencia:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.checkedlistbox.checkeditems.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/system.windows.forms.checkedlistbox.checkeditems.aspx</a></li>
</ul>
<p>Para recorrer u obtener los elementos <strong>(Items</strong>) marcados o chequeados (<strong>chedkedItems</strong>) de un <strong>CheckedListBox</strong> en<strong> C#</strong></p>
<pre class="brush: java; title: ; notranslate">
foreach(var item in checkedListBox1.CheckedItems){
	MessageBox.Show(item.ToString());
}
</pre>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/checkedlistbox.jpg"><img class="aligncenter size-full wp-image-7842" title="checkedlistbox" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/checkedlistbox.jpg" alt="" width="335" height="103" /></a></p>
<p>Por ejemplo, si los elementos de un checkedListBox contienen cadenas con formato de <strong>redes IPv4</strong> ( p.e: 192.168.0.0/16 )<br />Una forma de <strong>obtener la primera IP de red de cada elemento del checkedListBox</strong> seria:</p>
<pre class="brush: java; title: ; notranslate">
string poolnet1=&quot;&quot;;
foreach(var item in checkedListBox1.CheckedItems){
	Regex ip = new Regex(@&quot;\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2}\b&quot;);
	MatchCollection result = ip.Matches(item.ToString());
	poolnet1+=result[0]+&quot;,&quot;;
	}
poolnet1=poolnet1.TrimEnd(',');
</pre>
<p>Donde la variable de tipo cadena (string) poolnet1 seria su valor &#8220;<span style="color: #888888;">192.168.0.0/16,192.0.0.0/24</span>&#8220;</p>
<p>Y voila <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.javcasta.com%2F2011%2F11%2F11%2Fobtener-elementos-marcados-de-un-checkedlistbox-en-c%2F&amp;title=Obtener%20elementos%20marcados%20de%20un%20checkedListBox%20en%20C%23" id="wpa2a_6"><img src="http://www.javcasta.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2011/11/11/obtener-elementos-marcados-de-un-checkedlistbox-en-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seguridad &#8211; Batch Scripting &#8211; Permitir protocolo gre en WipFW 0.5.5.b y Establecer VPN vía consola o vía batch script</title>
		<link>http://www.javcasta.com/2011/11/05/seguridad-batch-scripting-permitir-protocolo-gre-en-wipfw-0-5-5-b-y-establecer-vpn-via-consola-o-via-batch-script/</link>
		<comments>http://www.javcasta.com/2011/11/05/seguridad-batch-scripting-permitir-protocolo-gre-en-wipfw-0-5-5-b-y-establecer-vpn-via-consola-o-via-batch-script/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 14:04:22 +0000</pubDate>
		<dc:creator>javcasta</dc:creator>
				<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[seguridad]]></category>
		<category><![CDATA[Sistemas]]></category>
		<category><![CDATA[soporte]]></category>
		<category><![CDATA[Utilidades]]></category>

		<guid isPermaLink="false">http://www.javcasta.com/?p=7826</guid>
		<description><![CDATA[Referencias: http://www.javcasta.com/2011/10/14/script-bat-cmd-conectar-modem-3g-via-consola-o-via-batch-script/ http://www.jessebowes.com/blog/vpn-batch-script/ http://es.wikipedia.org/wiki/PPTP http://es.wikipedia.org/wiki/L2TP http://es.wikipedia.org/wiki/GRE http://en.wikipedia.org/wiki/Secure_Socket_Tunneling_Protocol http://es.wikipedia.org/wiki/Red_privada_virtual Escenario: Windows 7 Ultimate SP1 Para establecer una conexión VPN vía consola o vía batch script, de una conexión de red VPN existente. Uso la utilidad rasdial. El proceso es similar a como lo use para establecer una conexión ppp ( http://www.javcasta.com/2011/10/14/script-bat-cmd-conectar-modem-3g-via-consola-o-via-batch-script/ ) rasdial &#8220;Nombre-Conexión-de-red&#8221; usuario contraseña [...]]]></description>
			<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2011%2F11%2F05%2Fseguridad-batch-scripting-permitir-protocolo-gre-en-wipfw-0-5-5-b-y-establecer-vpn-via-consola-o-via-batch-script%2F"></g:plusone><br /><p><!-- tweet id : 132820853552459776 --><style type='text/css'>#bbpBox_132820853552459776 a { text-decoration:none; color:#2FC2EF; }#bbpBox_132820853552459776 a:hover { text-decoration:underline; }</style><div id='bbpBox_132820853552459776' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#1a1b1f; background-image:url(http://a0.twimg.com/profile_background_images/234683216/leonTwitter.JPG); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#666666; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>Seguridad - Batch Scripting - Permitir protocolo gre en WipFW 0.5.5.b y Establecer VPN v&#237;a consola o v&#237;a batch script <a href="http://t.co/h2aY9XEk" rel="nofollow">http://t.co/h2aY9XEk</a></span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://www.javcasta.com/blog/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 05/11/2011 14:05' href='http://twitter.com/#!/javcasta/status/132820853552459776' target='_blank'>05/11/2011 14:05</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=132820853552459776' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=132820853552459776' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=132820853552459776' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=javcasta'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a2.twimg.com/profile_images/1316173538/avatar_normal.png' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=javcasta'>@javcasta</a><div style='margin:0; padding-top:2px'>Javier Casta&#241;&#243;n</div></div><div style='clear:both'></div></div></div><!-- end of tweet --><br />
<hr />
<p>Referencias:</p>
<ul>
<li><a href="http://www.javcasta.com/2011/10/14/script-bat-cmd-conectar-modem-3g-via-consola-o-via-batch-script/" target="_blank">http://www.javcasta.com/2011/10/14/script-bat-cmd-conectar-modem-3g-via-consola-o-via-batch-script/</a></li>
<li><a href="http://www.jessebowes.com/blog/vpn-batch-script/" target="_blank">http://www.jessebowes.com/blog/vpn-batch-script/</a></li>
<li><a href="http://es.wikipedia.org/wiki/PPTP" target="_blank">http://es.wikipedia.org/wiki/PPTP</a></li>
<li><a href="http://es.wikipedia.org/wiki/L2TP" target="_blank">http://es.wikipedia.org/wiki/L2TP</a></li>
<li><a href="http://es.wikipedia.org/wiki/GRE" target="_blank">http://es.wikipedia.org/wiki/GRE</a></li>
<li><a href="http://en.wikipedia.org/wiki/Secure_Socket_Tunneling_Protocol" target="_blank">http://en.wikipedia.org/wiki/Secure_Socket_Tunneling_Protocol</a></li>
<li><a href="http://es.wikipedia.org/wiki/Red_privada_virtual" target="_blank">http://es.wikipedia.org/wiki/Red_privada_virtual</a></li>
</ul>
<p><strong>Escenario:</strong> <span style="color: #888888;"><strong>Windows 7 Ultimate SP1</strong></span></p>
<p>Para establecer una <strong>conexión VPN</strong> vía <strong>consola</strong> o vía <strong>batch script</strong>, de una conexión de red VPN existente. Uso la utilidad <strong>rasdial</strong>.<br /> El proceso es similar a como lo use para establecer una conexión <strong>ppp</strong> ( <a href="http://www.javcasta.com/2011/10/14/script-bat-cmd-conectar-modem-3g-via-consola-o-via-batch-script/" target="_blank">http://www.javcasta.com/2011/10/14/script-bat-cmd-conectar-modem-3g-via-consola-o-via-batch-script/</a> )</p>
<blockquote><p><strong><span style="color: #888888;">rasdial &#8220;Nombre-Conexión-de-red&#8221; usuario contraseña /PHONE:Servidor-VPN-o-su-Ip.com</span></strong></p>
</blockquote>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-0.jpg"><img class="aligncenter size-full wp-image-7828" title="vpn-0" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-0.jpg" alt="" width="500" height="248" /></a></p>
<p>si pones *, en lugar de la contraseña, te pedirá la contraseña por consola.</p>
<p>Lo practico del caso es que una vez tengas definida una conexión de red VPN en el panel conexiones de red, la puedes usar como modelo generico para mediante el modificador <strong>/PHONE:dominio-o-ip</strong> conectarte a un <strong>servidor de VPN</strong> a elección.<br />Al crear una conexión VPN en windows, se configura por defecto para que negocie y detecte automaticamente si va a establcer la VPN mediante:</p>
<ul>
<li><strong>PPTP</strong></li>
<li><strong>L2TP/IPsec</strong></li>
<li><strong>SSTP</strong></li>
<li><strong>IKEv2</strong></li>
</ul>
<p>O también puedes indicar que <strong>protocolo de tunel</strong> para establecer la vpn deseas:</p>
<p>conexion de red vpn &gt; propiedades &gt; seguridad &gt; tipo de vpn</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-0b.jpg"><img class="aligncenter size-full wp-image-7827" title="vpn-0b" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-0b.jpg" alt="" width="300" height="382" /></a></p>
<p>Hay que mencionar que, si usas<strong> PPTP</strong> debes de <strong>no capar en el firewall</strong> el puerto<strong> tcp1723</strong> entre tu ip wan y la ip del servidor vpn.<br />A pesar de que este protocolo (PPTP) es inseguro (<a href="http://es.wikipedia.org/wiki/PPTP#Vulnerabilidades_de_PPTP" target="_blank"> http://es.wikipedia.org/wiki/PPTP#Vulnerabilidades_de_PPTP</a> ), se sigue usando bastante &#8230;<br /><strong>L2tp</strong>, parece que es algo más seguro. Pero tampoco lo suficiente.</p>
<p><strong>Una forma de dar mayor robustez a la seguridad de un tunel vpn mediante pptp o l2tp en un cliente windows</strong>, es usar<strong> <a href="http://en.wikipedia.org/wiki/Secure_Socket_Tunneling_Protocol" target="_blank">sstp</a></strong>.<br />Que en definitiva es<strong> transportar el tráfico pptp o l2tp a través de SSL</strong>, con lo que el tráfico va <strong>encriptado de forma robusta y con chequeo de integridad</strong>.</p>
<p><span style="text-decoration: underline;"><strong>Permitir protocolo gre en WipFW 0.5.5.b</strong></span></p>
<p>Si usas PPTP, deberás permitir el protocolo <a href="http://es.wikipedia.org/wiki/GRE" target="_blank"><strong>gre</strong></a>:</p>
<p><strong>GRE</strong> es un<strong> protocolo de capa 4 o de transporte</strong>: <span style="color: #888888;"><strong>Generic Routing Encapsulation</strong></span>, que sirve para establecimiento de tuneles</p>
<p>Si usas <strong>IPsec</strong> deberá permitir el puerto<strong> udp500</strong> en el<strong> firewall</strong>.</p>
<p>Por ejemplo, para el firewall <strong>WipFW 0.5.5b</strong>, un <strong>batch script</strong> que haga lo indicado, seria:</p>
<pre class="brush: bash; title: ; notranslate">
@echo off
REM sstp / IPsec
set mi-ip-wan=80.59.69.239
set servidorVPN=1.2.3.4
set dns=8.8.8.8
REM DNS
ipfw -q add check-state
ipfw -q add allow udp from any to %dns% 53 keep-state
ipfw -q add allow udp from %dns% 53 to any keep-state
REM udp500 - ipsec
ipfw -q add allow udp from %mi-ip-wan% to %servidorVPN% 500
REM gre (P:47), wipfw 0.5.5b no admite usar gre como indicativo del protocolo gre (P:47)
REM las reglas para permitir gre en ipfw de FreeBSD seria:
REM ipfw -q add pass gre from %mi-ip-wan% to %servidorVPN%
REM ipfw -q add pass gre from %servidorVPN% to %mi-ip-wan%
REM Esto anterior,da error en WipFW 0.5.5b, por lo que una solución
REM es permitir todo el trafico entre tu host y el servidor vpn
REM suponiendo que sea un servidor vpn confiable (corporativo) ... : - )
ipfw -q add allow all from %mi-ip-wan% to %servidorVPN%
ipfw -q add allow all from %servidorVPN% to %mi-ip-wan%
REM pptp (tcp1723) tunel entre mi-ip-wan y servidorVPN (tras las reglas allow all, esto sobraria ...)
ipfw -q add allow tcp from %mi-ip-wan% to %servidorVPN% 1723
ipfw -q add allow tcp from %servidorVPN% 1723 to %mi-ip-wan%
REM established - navegación web vía tunel
ipfw -q add allow tcp from %mi-ip-vpn% to any established
REM tcp80,443 navegacion web solo para la vpn
ipfw -q add allow tcp from %mi-ip-vpn% to any 80,443 setup
</pre>
<p><span style="text-decoration: underline;"><strong>Preparativos previos:</strong></span></p>
<p>Vamos a centro de redes y recursos compartidos &gt; Configurar una nueva conexión de red</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-1.jpg"><img class="aligncenter size-full wp-image-7829" title="vpn-1" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-1.jpg" alt="" width="458" height="385" /></a></p>
<p>Conectarse a un área de trabajo</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-2.jpg"><img class="aligncenter size-full wp-image-7830" title="vpn-2" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-2.jpg" alt="" width="600" height="439" /></a></p>
<p>Como no disponemos de una conexión existente, creamos una nueva conexión</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-3.jpg"><img class="aligncenter size-full wp-image-7831" title="vpn-3" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-3.jpg" alt="" width="400" height="292" /></a></p>
<p>Usaremos nuestra conexión a internet para conectarnos a la VPN</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-4.jpg"><img class="aligncenter size-full wp-image-7832" title="vpn-4" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-4.jpg" alt="" width="400" height="292" /></a></p>
<p>definimos la dirección del servidorVPN, ya sea su dominio o su ip</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-5.jpg"><img class="aligncenter size-full wp-image-7833" title="vpn-5" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-5.jpg" alt="" width="500" height="366" /></a></p>
<p>usuario, contraseña y si queremos que la recuerde</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-6.jpg"><img class="aligncenter size-full wp-image-7834" title="vpn-6" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-6.jpg" alt="" width="400" height="292" /></a></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-7.jpg"><img class="aligncenter size-full wp-image-7835" title="vpn-7" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-7.jpg" alt="" width="400" height="292" /></a></p>
<p>Vamos a conexiones de red y opciones en propiedades de la conexión de red VPN creada</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-8.jpg"><img class="aligncenter size-full wp-image-7836" title="vpn-8" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-8.jpg" alt="" width="336" height="158" /></a></p>
<p>desmarcamos mostrar progreso, pedir usuario:contraseña ya que lodefiniremos vía consola o script</p>
<p><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-9.jpg"><img class="aligncenter size-full wp-image-7837" title="vpn-9" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-9.jpg" alt="" width="377" height="481" /></a></p>
<p>Ejecutamos por consola:</p>
<blockquote><p><strong>rasdial &#8220;Nombre-Conexión-de-red&#8221; usuario * /PHONE:Servidor-VPN-o-su-Ip</strong></p>
</blockquote>
<p>Y comprobamos si nos ha asignado<strong> ip de una red privada virtual</strong> (VPN).</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-01.jpg"><img class="aligncenter size-full wp-image-7838" title="vpn-0" src="http://www.javcasta.com/blog/wp-content/uploads/2011/11/vpn-01.jpg" alt="" width="500" height="248" /></a></p>
<p>en mi caso observo que me asigna el servidor una<strong> IP privada de clase B</strong> ( <span style="color: #888888;">172.16.0.0/12</span> )</p>
<p>Un ejemplo de script:</p>
<p>conectaVPN.cmd</p>
<pre class="brush: bash; title: ; notranslate">
@echo off
set conexion=dial-VPN
set usuario=miusuario
set password=micontraseña
set servidorvpn=unservidorVPN.com
echo nos desconectamos de la vpn
rasdial &quot;dial-VPN&quot; /disconnect
echo Nos conectamos a la VPN
rasdial &quot;%conexion%&quot; %usuario% %password% /PHONE:%servidorvpn%
REM comprobamos parametros tcp/ip
@ipconfig /all
pause
</pre>
<p>Y voila <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.javcasta.com%2F2011%2F11%2F05%2Fseguridad-batch-scripting-permitir-protocolo-gre-en-wipfw-0-5-5-b-y-establecer-vpn-via-consola-o-via-batch-script%2F&amp;title=Seguridad%20%26%238211%3B%20Batch%20Scripting%20%26%238211%3B%20Permitir%20protocolo%20gre%20en%20WipFW%200.5.5.b%20y%20Establecer%20VPN%20v%C3%ADa%20consola%20o%20v%C3%ADa%20batch%20script" id="wpa2a_8"><img src="http://www.javcasta.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2011/11/05/seguridad-batch-scripting-permitir-protocolo-gre-en-wipfw-0-5-5-b-y-establecer-vpn-via-consola-o-via-batch-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash shell Script &#8211; Instalación y configuración del Firewall IPFW3 (Dummynet) en Ubuntu 10.04 LTS</title>
		<link>http://www.javcasta.com/2011/10/30/bash-shell-script-instalacion-y-configuracion-del-firewall-ipfw3-dummynet-en-ubuntu-10-04-lts/</link>
		<comments>http://www.javcasta.com/2011/10/30/bash-shell-script-instalacion-y-configuracion-del-firewall-ipfw3-dummynet-en-ubuntu-10-04-lts/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 16:20:12 +0000</pubDate>
		<dc:creator>javcasta</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[seguridad]]></category>
		<category><![CDATA[Sistemas]]></category>
		<category><![CDATA[soporte]]></category>
		<category><![CDATA[Utilidades]]></category>

		<guid isPermaLink="false">http://www.javcasta.com/?p=7821</guid>
		<description><![CDATA[Referencias: http://info.iet.unipi.it/~luigi/dummynet/ http://ubuntuforums.org/showthread.php?t=1337587 Un bash shell script que acabo de implementar para la instalación del firewall IPFW3 en Ubuntu server i386 10.04 LTS. IPFW3toUbu1004.sh El script de configuración MyIpfw3.sh:solo permite consultas dns a openDNS, icmp y ssh en la lan, y navegación web (tcp80, tcp443).No olvidar dar permisos de ejecución ( chmod +x MyIpfw3.sh ) [...]]]></description>
			<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F30%2Fbash-shell-script-instalacion-y-configuracion-del-firewall-ipfw3-dummynet-en-ubuntu-10-04-lts%2F"></g:plusone><br /><p><!-- tweet id : 130681357297922049 --><style type='text/css'>#bbpBox_130681357297922049 a { text-decoration:none; color:#2FC2EF; }#bbpBox_130681357297922049 a:hover { text-decoration:underline; }</style><div id='bbpBox_130681357297922049' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#1a1b1f; background-image:url(http://a0.twimg.com/profile_background_images/234683216/leonTwitter.JPG); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#666666; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>Nuevo Post: Bash shell Script &#8211; Instalaci&#243;n y configuraci&#243;n del Firewall IPFW3 (Dummynet) en Ubuntu 10.04 LTS <a href="http://t.co/5PBf0KJO" rel="nofollow">http://t.co/5PBf0KJO</a></span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://www.javcasta.com/blog/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 30/10/2011 16:23' href='http://twitter.com/#!/javcasta/status/130681357297922049' target='_blank'>30/10/2011 16:23</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=130681357297922049' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=130681357297922049' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=130681357297922049' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=javcasta'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a2.twimg.com/profile_images/1316173538/avatar_normal.png' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=javcasta'>@javcasta</a><div style='margin:0; padding-top:2px'>Javier Casta&#241;&#243;n</div></div><div style='clear:both'></div></div></div><!-- end of tweet --><br />
<hr />
<p>Referencias:</p>
<ul>
<li><a href="http://info.iet.unipi.it/~luigi/dummynet/" target="_blank">http://info.iet.unipi.it/~luigi/dummynet/</a></li>
</ul>
<ul>
<li><a href="http://ubuntuforums.org/showthread.php?t=1337587" target="_blank">http://ubuntuforums.org/showthread.php?t=1337587</a></li>
</ul>
<p>Un <strong>bash shell script</strong> que acabo de implementar para la instalación del <strong>firewall</strong> <strong>IPFW3</strong> en <strong>Ubuntu server i386 10.04 LTS</strong>.</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/ipfw3-ubu1004lts-1.jpg"><img class="aligncenter size-full wp-image-7822" title="ipfw3-ubu1004lts-1" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/ipfw3-ubu1004lts-1.jpg" alt="" width="640" height="352" /></a></p>
<p>IPFW3toUbu1004.sh</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
############################################################################
# Bash Script para Instalar Firewall IPFW3 en Ubuntu server 10.04.03 LTS   #
############################################################################
# Ref: guide I saw for implement this script in :       #
# http://ubuntuforums.org/showthread.php?t=1337587      #
# By JavCasta - 2011 - http://javcasta.com/             #
#########################################################
#       Script para ser ejecutado como root             #
#########################################################
#si no existe dir /ipfw3 lo creamos
if ! [ -d /ipfw3 ]; then
	mkdir /ipfw3
fi
# actualizamos
apt-get update
# Añadimos el paquete libncurses development -  ??? linux-source-2.6.17 kernel-package libncurses5-dev fakeroot
apt-get install libncurses5-dev
# añadimos el paquete make, en ubuntu server 10.04 lts ya esta instalado
apt-get install make
#añadimos linux-headers para el sistema especifico, necesario para crear ipfw_mod.ko
apt-get install linux-headers-$(uname -r)

#Dummynet Installation
#vamos a tmp
cd /tmp
#Descarga Source code and tools, 20100319 de Dummynet
wget http://info.iet.unipi.it/~luigi/dummynet/20100319-ipfw3.tgz
#descomprimismos ( destino /tmp/ipfw3 )
tar xvzf 20100319-ipfw3.tgz
cd ipfw3
#make
make
#copiamos ficheros a /ipfw3
cp /tmp/ipfw3/ipfw/ipfw /ipfw3
cp /tmp/ipfw3/dummynet2/ipfw_mod.ko /ipfw3
#copia a /usr/local/sbin
cp /ipfw3/ipfw /usr/local/sbin
#copia ipfw_mod.ko
cp /ipfw3/ipfw_mod.ko /lib/modules/`uname -r`
#ejecutamos depmod para actualizar modulos .dep
depmod
#instalamos el modulo del kernel
modprobe ipfw_mod
# mostrar la regla por defecto de ipfw, si sale: 65535 allow ip from any to any - es que esta correcto
ipfw list
# añadimos ipfw_mod como ultima entrada a /etc/modules
sh -c 'echo &quot;ipfw_mod&quot; &gt;&gt; /etc/modules'
# hay que reiniciar
echo &quot;debes de reniciar &gt; shutdown -r now&quot;
# y eso es todo, ya puedes configurar ipfw con un script o desde shell
</pre>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/ipfw3-ubu1004lts-2.jpg"><img class="aligncenter size-full wp-image-7823" title="ipfw3-ubu1004lts-2" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/ipfw3-ubu1004lts-2.jpg" alt="" width="500" height="520" /></a></p>
<p><span style="text-decoration: underline;">El script de configuración <strong>MyIpfw3.sh</strong>:</span><br />solo permite consultas<strong> dns</strong> a <strong>openDNS</strong>,<strong> icmp</strong> y <strong>ssh</strong> en la<strong> lan</strong>, y navegación <strong>web</strong> (<strong>tcp80</strong>, <strong>tcp443</strong>).<br />No olvidar dar permisos de ejecución ( chmod +x MyIpfw3.sh )</p>
<p>MyIpfw3.sh</p>
<pre class="brush: bash; title: ; notranslate">
#! /bin/sh
lan=192.168.42.0/24
dns1=208.67.222.222
dns2=208.67.220.220
trustedhost=192.168.42.1
meinlan=$(/sbin/ifconfig eth0 | grep &quot;inet addr:&quot; | cut -f2 -d:|cut -f1 -d' ')
ipfw -q -f flush
ipfw -q add check-state
ipfw -q add allow ip from any to any via lo*
ipfw -q add prob 0.05 drop ip from any to any in
ipfw -q add drop log ip from any to 127.0.0.0/8 in
ipfw -q add drop log ip from 127.0.0.0/8 to any in
ipfw -q add drop log all from any to any frag
ipfw -q add allow icmp from $lan to $lan
ipfw -q add pass udp from 0.0.0.0 68 to 255.255.255.255 67 out
ipfw -q add pass udp from any 67 to me 68 in
ipfw -q add pass udp from any 67 to 255.255.255.255 68 in
ipfw -q add drop log ip from any to 224.0.0.0/4 in
ipfw -q add drop log ip from 224.0.0.0/4 to any out
ipfw -q add drop log ip from any to 169.254.0.0/16 in
ipfw -q add drop log ip from 169.254.0.0/16 to any out
ipfw -q add drop log ip from any to 172.16.0.0/12
ipfw -q add drop log ip from 172.16.0.0/12 to any
ipfw -q add drop log ip from any to 10.0.0.0/8
ipfw -q add drop log ip from 10.0.0.0/8 to any
ipfw -q add drop log tcp from any to any 135
ipfw -q add drop log udp from any to any 135
ipfw -q add drop log tcp from any to any 137,138,139
ipfw -q add drop log udp from any to any 137,138,139
ipfw -q add allow log tcp from $trustedhost to $meinlan 22
ipfw -q add allow udp from $lan to $dns1,$dns2 53 keep-state
ipfw -q add allow udp from $dns1,$dns2 53 to $lan keep-state
ipfw -q add allow tcp from $lan to any established out
ipfw -q add allow tcp from any to $lan established in
ipfw -q add allow tcp from $meinlan to $lan 22 setup
ipfw -q add allow tcp from $lan to any 80,443 setup
ipfw -q add 65534 drop all from any to any
</pre>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/ipfw3-ubu1004lts-3.jpg"><img class="aligncenter size-full wp-image-7824" title="ipfw3-ubu1004lts-3" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/ipfw3-ubu1004lts-3.jpg" alt="" width="640" height="351" /></a></p>
<p>Y voila <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F30%2Fbash-shell-script-instalacion-y-configuracion-del-firewall-ipfw3-dummynet-en-ubuntu-10-04-lts%2F&amp;title=Bash%20shell%20Script%20%26%238211%3B%20Instalaci%C3%B3n%20y%20configuraci%C3%B3n%20del%20Firewall%20IPFW3%20%28Dummynet%29%20en%20Ubuntu%2010.04%20LTS" id="wpa2a_10"><img src="http://www.javcasta.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2011/10/30/bash-shell-script-instalacion-y-configuracion-del-firewall-ipfw3-dummynet-en-ubuntu-10-04-lts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instalar vía consola IPv6 en Windows XP SP3</title>
		<link>http://www.javcasta.com/2011/10/29/instalar-via-consola-ipv6-en-windows-xp-sp3/</link>
		<comments>http://www.javcasta.com/2011/10/29/instalar-via-consola-ipv6-en-windows-xp-sp3/#comments</comments>
		<pubDate>Sat, 29 Oct 2011 18:58:03 +0000</pubDate>
		<dc:creator>javcasta</dc:creator>
				<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Sistemas]]></category>
		<category><![CDATA[soporte]]></category>
		<category><![CDATA[Utilidades]]></category>

		<guid isPermaLink="false">http://www.javcasta.com/?p=7816</guid>
		<description><![CDATA[Referencias: http://es.wikipedia.org/wiki/IPv6 http://es.wikipedia.org/wiki/ICMPv6 http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_ip_v6_pro_inst.mspx?mfr=true http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_ip_v6_add_utils.mspx?mfr=true Libro Gratuito &#8220;IPv6 para Todos&#8221; http://www.consulintel.es/pdf/ipv6paratodos.pdf Un apunte rápido de como instalar el protocolo IPv6 en Windows XP SP3. IPv6 se puede instalar vía gui o de forma gráfica añadiendo este protocolo desde las propiedades de una conexión de red. El procedimiento vía gui se describe en:http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_ip_v6_pro_inst.mspx?mfr=true Pero para batch [...]]]></description>
			<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F29%2Finstalar-via-consola-ipv6-en-windows-xp-sp3%2F"></g:plusone><br /><p><!-- tweet id : 130358159201157120 --><style type='text/css'>#bbpBox_130358159201157120 a { text-decoration:none; color:#2FC2EF; }#bbpBox_130358159201157120 a:hover { text-decoration:underline; }</style><div id='bbpBox_130358159201157120' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#1a1b1f; background-image:url(http://a0.twimg.com/profile_background_images/234683216/leonTwitter.JPG); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#666666; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>Nuevo Post: Instalar via consola IPv6 en Windows XP SP3 <a href="http://t.co/VHskKAEI" rel="nofollow">http://t.co/VHskKAEI</a></span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://www.javcasta.com/blog/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 29/10/2011 18:59' href='http://twitter.com/#!/javcasta/status/130358159201157120' target='_blank'>29/10/2011 18:59</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=130358159201157120' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=130358159201157120' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=130358159201157120' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=javcasta'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a2.twimg.com/profile_images/1316173538/avatar_normal.png' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=javcasta'>@javcasta</a><div style='margin:0; padding-top:2px'>Javier Casta&#241;&#243;n</div></div><div style='clear:both'></div></div></div><!-- end of tweet --><br />
<hr />
<p>Referencias:</p>
<ul>
<li><a href="http://es.wikipedia.org/wiki/IPv6" target="_blank">http://es.wikipedia.org/wiki/IPv6</a></li>
<li><a href="http://es.wikipedia.org/wiki/ICMPv6" target="_blank">http://es.wikipedia.org/wiki/ICMPv6</a></li>
<li><a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_ip_v6_pro_inst.mspx?mfr=true" target="_blank">http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_ip_v6_pro_inst.mspx?mfr=true</a></li>
<li><a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_ip_v6_add_utils.mspx?mfr=true" target="_blank">http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_ip_v6_add_utils.mspx?mfr=true</a></li>
<li>Libro Gratuito &#8220;IPv6 para Todos&#8221; <a href="http://www.consulintel.es/pdf/ipv6paratodos.pdf" target="_blank">http://www.consulintel.es/pdf/ipv6paratodos.pdf</a></li>
</ul>
<p>Un apunte rápido de como instalar el <strong>protocolo IPv6</strong> en <strong>Windows XP SP3</strong>.</p>
<p><strong>IPv6</strong> se puede instalar vía <strong>gui</strong> o de forma gráfica añadiendo este protocolo desde las propiedades de una conexión de red.</p>
<p>El procedimiento vía gui se describe en:<br /><a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_ip_v6_pro_inst.mspx?mfr=true" target="_blank">http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_ip_v6_pro_inst.mspx?mfr=true</a></p>
<p>Pero para <strong>batch scripting</strong> vía <strong>consola</strong> es el camino.</p>
<p>Iniciamos una <strong>shell</strong> cmd como administrador del sistema:</p>
<blockquote><p><span style="color: #888888;">WIN  + R &gt; abrir:</span> <strong>runas /u:administrador cmd</strong></p>
</blockquote>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/ipv6-xpsp3-0.jpg"><img class="aligncenter size-full wp-image-7817" title="ipv6-xpsp3-0" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/ipv6-xpsp3-0.jpg" alt="" width="318" height="162" /></a></p>
<p><strong>Instalamos el protocolo IPv6 con la utilidad netsh</strong></p>
<blockquote><p><strong>netsh interface ipv6 install</strong></p>
</blockquote>
<p>tambien se se podria con la utilidad <strong>ipv6.exe</strong></p>
<blockquote><p><strong>ipv6 install</strong></p>
</blockquote>
<p><strong>Mostramos las interfaces y sus direccionamiento IPv6</strong></p>
<p>con ipv6.exe</p>
<blockquote><p><strong>ipv6 -v if [IfIndex]</strong></p>
</blockquote>
<p>con netsh</p>
<blockquote><p><strong>netsh interface ipv6 show address</strong></p>
</blockquote>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/ipv6-xpsp3-1.jpg"><img class="aligncenter size-full wp-image-7818" title="ipv6-xpsp3-1" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/ipv6-xpsp3-1.jpg" alt="" width="500" height="340" /></a></p>
<p>Y comprobamos si la dirección de<strong> loopback</strong> de IPv6 (<strong> ::1</strong> ) responde a <strong>ping6</strong> (ping para ipv6)</p>
<blockquote><p><strong>ping6 ::1</strong></p>
</blockquote>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/ipv6-xpsp3-2.jpg"><img class="aligncenter size-full wp-image-7819" title="ipv6-xpsp3-2" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/ipv6-xpsp3-2.jpg" alt="" width="500" height="292" /></a></p>
<p>Me llama la atención que la versión de ping para IPv6 traiga la opción <strong>-s</strong> para indicar la dirección de origen desde donde se efectua el ping.<br />es decir se puede definir desde que dirección IPv6 se envian los paquetes <strong>ICMPv6 echo request</strong><br />Segun pone Microsoft en su doc :</p>
<p><a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_ip_v6_add_utils.mspx?mfr=true" target="_blank">http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_ip_v6_add_utils.mspx?mfr=true</a></p>
<blockquote><p><span style="color: #888888;"><strong>-s specifies the source address in the Echo Request messages. This is required for link-local destination addresses.</strong></span></p>
</blockquote>
<p>Esta opción, -s, (especificar dirección de origen) es un requisito necesario para direcciones de destino de enlace local</p>
<p>Otra opción que difiere del ping para IPv4 es la<strong> -r</strong>, que hace:</p>
<blockquote><p><strong><span style="color: #888888;">-r &#8220;usar encabezado de rutina para comprobar la ruta contraria&#8221;</span></strong></p>
</blockquote>
<p>Que segun Microsoft es:</p>
<blockquote><p><span style="color: #888888;"><strong>-r specifies that the IPv6 Routing extension header be used to send an Echo Request message to the local host, using the destination as an intermediate destination</strong></span></p>
</blockquote>
<p>Que viene a decir que se use el encabezado de extension del enrutamiento IPv6 para enviar un mensaje <strong>Echo request</strong> al host local, <strong>usando el destino como un destino intermedio (intermediario)</strong></p>
<p>Y por último indicar que tambien existe<strong> tracert para IPv6</strong>:<strong> tracert6</strong>, <strong>para mostrar el camino o los saltos o routers o nodos entre el origen y el destino</strong></p>
<p>Y voila <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F29%2Finstalar-via-consola-ipv6-en-windows-xp-sp3%2F&amp;title=Instalar%20v%C3%ADa%20consola%20IPv6%20en%20Windows%20XP%20SP3" id="wpa2a_12"><img src="http://www.javcasta.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2011/10/29/instalar-via-consola-ipv6-en-windows-xp-sp3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configurar interfaz PPP con modem usb 3G en firewall pfSense 2 release (amd64)  bajo VMware</title>
		<link>http://www.javcasta.com/2011/10/25/configurar-interfaz-ppp-con-modem-usb-3g-en-firewall-pfsense-2-release-amd64-bajo-vmware/</link>
		<comments>http://www.javcasta.com/2011/10/25/configurar-interfaz-ppp-con-modem-usb-3g-en-firewall-pfsense-2-release-amd64-bajo-vmware/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 16:12:09 +0000</pubDate>
		<dc:creator>javcasta</dc:creator>
				<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[seguridad]]></category>
		<category><![CDATA[Sistemas]]></category>
		<category><![CDATA[soporte]]></category>
		<category><![CDATA[Utilidades]]></category>
		<category><![CDATA[virtualización]]></category>

		<guid isPermaLink="false">http://www.javcasta.com/?p=7799</guid>
		<description><![CDATA[Escenario: - VMware® Player 4.0.0 build-471780 en anfitrion Windows 7 Ultimate SP1 - Maquina virtual corriendo pfSense 2.0 release (amd64) con 3 nics - WAN: NIC 1 en modo bridge a interfaz WAN del anfitrion - LAN: NIC 2 en modo NAT para LAN virtual entre anfitrion y huesped - OPT1: NIC 3 en modo [...]]]></description>
			<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F25%2Fconfigurar-interfaz-ppp-con-modem-usb-3g-en-firewall-pfsense-2-release-amd64-bajo-vmware%2F"></g:plusone><br /><p><!-- tweet id : 128867357845233664 --><style type='text/css'>#bbpBox_128867357845233664 a { text-decoration:none; color:#2FC2EF; }#bbpBox_128867357845233664 a:hover { text-decoration:underline; }</style><div id='bbpBox_128867357845233664' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#1a1b1f; background-image:url(http://a0.twimg.com/profile_background_images/234683216/leonTwitter.JPG); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#666666; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>Nuevo Post: Configurar interfaz ppp con modem usb 3G en firewall pfSense 2 release (amd64)  bajo VMware <a href="http://t.co/TNEheXNu" rel="nofollow">http://t.co/TNEheXNu</a></span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://www.javcasta.com/blog/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 25/10/2011 16:15' href='http://twitter.com/#!/javcasta/status/128867357845233664' target='_blank'>25/10/2011 16:15</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=128867357845233664' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=128867357845233664' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=128867357845233664' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=javcasta'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a2.twimg.com/profile_images/1316173538/avatar_normal.png' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=javcasta'>@javcasta</a><div style='margin:0; padding-top:2px'>Javier Casta&#241;&#243;n</div></div><div style='clear:both'></div></div></div><!-- end of tweet --><br />
<hr />
<p><span style="text-decoration: underline;"><strong>Escenario:</strong></span></p>
<ul>
<li>- VMware® Player 4.0.0 build-471780 en anfitrion Windows 7 Ultimate SP1</li>
<li>- Maquina virtual corriendo pfSense 2.0 release (amd64) con 3 nics</li>
<li>
<ul>
<li>- WAN: NIC 1 en modo bridge a interfaz WAN del anfitrion</li>
<li>- LAN: NIC 2 en modo NAT para LAN virtual entre anfitrion y huesped</li>
<li>- OPT1: NIC 3 en modo NAT para asignar al interfaz ppp del modem usb 3G</li>
</ul>
</li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/pfSense-ICON225-6.jpg"><img class="aligncenter size-full wp-image-7800" title="pfSense-ICON225-6" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/pfSense-ICON225-6.jpg" alt="" width="640" height="400" /></a></p>
<p><span style="text-decoration: underline;"><strong>Preparativos previos:</strong></span></p>
<ul>
<li>- Añadir si no se tenia ya, la interfaz OPT1 o nic en modo NAT a la maquina virtual en VMware</li>
<li>- Añadir si no lo tenia a la maquina virtual un USB Controller.</li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/pfSense-ICON225-0.jpg"><img class="aligncenter size-full wp-image-7801" title="pfSense-ICON225-0" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/pfSense-ICON225-0.jpg" alt="" width="600" height="334" /></a></p>
<ul>
<li>- Una vez iniciada la maquina, conectar el modem usb 3G desde VMware Player</li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/pfSense-ICON225-01.jpg"><img class="aligncenter size-full wp-image-7802" title="pfSense-ICON225-01" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/pfSense-ICON225-01.jpg" alt="" width="600" height="390" /></a></p>
<ul>
<li>- Asignamos interfaces en pfSense y direccionamientos (esto es trivial y no lo explico en este post)</li>
<li>- Desde la GUI via browser de pfSense vamos a la interfaz OPT1: interfaces &gt; OPT1</li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/pfSense-ICON225-1.jpg"><img class="aligncenter size-full wp-image-7804" title="pfSense-ICON225-1" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/pfSense-ICON225-1.jpg" alt="" width="450" height="533" /></a></p>
<p>Habilitamos la interfaz y la definimos tipo PPP. Y en <strong>PPP configuration</strong> parametrizamos PPP segun sea nuestro ISP.<br /> Habilitamos bloquear redes bogon,<strong> pero no redes privadas</strong>, ya que, por ejemplo mi isp usa direccionamiento privado para el Gateway de la conexion ppp ( 10.x.x.x )<br /> Y elegimos el puerto del modem (Modem port <span style="color: #888888;">/dev/cuaU0.x</span> )</p>
<p>En <strong>Advanced PPP</strong> ( <span style="color: #888888;">Click here to edit PPP configuration.</span> ) podemos configurar a fondo la conexion PPP, como por ejemplo el<strong> PIN</strong> de la SIM del modem usb 3G.<br /> Otra opcion interesante es habilitar <strong>dial-on-demand</strong> si quieres que cada vez que haya trafico se active la conexión PPP .. al gusto</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/pfSense-ICON225-2.jpg"><img class="aligncenter size-full wp-image-7805" title="pfSense-ICON225-2" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/pfSense-ICON225-2.jpg" alt="" width="600" height="559" /></a></p>
<p>Como se supone que el<strong> firewall/Router</strong> pfSense ya tiene salida a Inet por el interfaz WAN, y estamos añadiendo otra ruta con salida a Inet (por lo tanto otro Gateway, con lo que estamosen un escenario <strong>Multi-WAN</strong>), deberemos configurar en <strong>System &gt; Routing &gt; Groups</strong>, un grupo de gateways tal que se definan las prioridades de los Gateways ante eventos de conectividad (perdida de paquetes, latencia alta, etc)</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/pfSense-ICON225-3.jpg"><img class="aligncenter size-full wp-image-7806" title="pfSense-ICON225-3" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/pfSense-ICON225-3.jpg" alt="" width="640" height="306" /></a></p>
<p>Es importante definir en la reglas del firewall, en <strong>Advanced features</strong>, que el Gateway sea el grupo creado y no un Gateway determinado, si queremos que el firewall/router haga<strong> balanceo de carga</strong> entre las interfaces WAN y OPT1 ante perdidas de conectividad o latencia alta en uno de los interfaces</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/pfSense-ICON225-4.jpg"><img class="aligncenter size-full wp-image-7807" title="pfSense-ICON225-4" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/pfSense-ICON225-4.jpg" alt="" width="640" height="451" /></a></p>
<p>Si no usas en la configuracion ppp la opción <strong>Dial-on-demand</strong> (marcado por demanda o petición) puedes conectar/desconectar el interfaz OPT1 manualmente:</p>
<p><strong>Satus &gt; Interfaces &gt; Opt1 &gt; connect / disconnect</strong></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/pfSense-ICON225-5.jpg"><img class="aligncenter size-full wp-image-7808" title="pfSense-ICON225-5" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/pfSense-ICON225-5.jpg" alt="" width="640" height="403" /></a></p>
<p>Otra opcion que he marcado es, en <strong>System: Advanced: Miscellaneous &gt; Load Balancing &gt; Allow default gateway switching</strong></p>
<blockquote><p><span style="color: #888888;"><em>&#8220;If the link where the default gateway resides fails switch the default gateway to another available one.&#8221;</em></span></p>
</blockquote>
<p>Es decir que se supone que si el enlace del Gateway por defecto falla, se conmuta (cambia) a otro Gateway disponible.</p>
<p>Hay muchos más detalles, pero son de orden menor y se resuelven según cada escenario.</p>
<p>Y voila <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F25%2Fconfigurar-interfaz-ppp-con-modem-usb-3g-en-firewall-pfsense-2-release-amd64-bajo-vmware%2F&amp;title=Configurar%20interfaz%20PPP%20con%20modem%20usb%203G%20en%20firewall%20pfSense%202%20release%20%28amd64%29%20%20bajo%20VMware" id="wpa2a_14"><img src="http://www.javcasta.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2011/10/25/configurar-interfaz-ppp-con-modem-usb-3g-en-firewall-pfsense-2-release-amd64-bajo-vmware/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Script bat, cmd &#8211; Conectar modem 3G vía consola o vía batch script</title>
		<link>http://www.javcasta.com/2011/10/14/script-bat-cmd-conectar-modem-3g-via-consola-o-via-batch-script/</link>
		<comments>http://www.javcasta.com/2011/10/14/script-bat-cmd-conectar-modem-3g-via-consola-o-via-batch-script/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 09:53:05 +0000</pubDate>
		<dc:creator>javcasta</dc:creator>
				<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[seguridad]]></category>
		<category><![CDATA[Sistemas]]></category>
		<category><![CDATA[soporte]]></category>
		<category><![CDATA[Utilidades]]></category>

		<guid isPermaLink="false">http://www.javcasta.com/?p=7773</guid>
		<description><![CDATA[Referencias: http://es.wikipedia.org/wiki/Rasdial http://support.microsoft.com/kb/125393/es Un script cmd para establecer conexión del modem 3g y obtener su ip dinámica mediante rasdial, que proporciona marcado desatendido.: Preperativos previos: Escenario: Windows = Windows Ultimate SP1Modem 3g = GlobeTrotter HSxPAISP = Orange España (Usuario: CLIENTE, contraseña: AMENA, nºtelefono: *99#, IMPORTANTE: desactivar PIM de la sim del modem (esto se hace [...]]]></description>
			<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F14%2Fscript-bat-cmd-conectar-modem-3g-via-consola-o-via-batch-script%2F"></g:plusone><br /><p><!-- tweet id : 124786214720114688 --><style type='text/css'>#bbpBox_124786214720114688 a { text-decoration:none; color:#2FC2EF; }#bbpBox_124786214720114688 a:hover { text-decoration:underline; }</style><div id='bbpBox_124786214720114688' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#1a1b1f; background-image:url(http://a0.twimg.com/profile_background_images/234683216/leonTwitter.JPG); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#666666; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>Nuevo Post: Script bat, cmd &#8211; Conectar modem 3G v&#237;a consola o v&#237;a batch script <a href="http://t.co/MlQ1NjK3" rel="nofollow">http://t.co/MlQ1NjK3</a></span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://www.javcasta.com/blog/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 14/10/2011 09:58' href='http://twitter.com/#!/javcasta/status/124786214720114688' target='_blank'>14/10/2011 09:58</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=124786214720114688' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=124786214720114688' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=124786214720114688' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=javcasta'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a2.twimg.com/profile_images/1316173538/avatar_normal.png' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=javcasta'>@javcasta</a><div style='margin:0; padding-top:2px'>Javier Casta&#241;&#243;n</div></div><div style='clear:both'></div></div></div><!-- end of tweet --><br />
<hr />
<p>Referencias:</p>
<ul>
<li><a href="http://es.wikipedia.org/wiki/Rasdial" target="_blank">http://es.wikipedia.org/wiki/Rasdial</a></li>
<li><a href="http://support.microsoft.com/kb/125393/es" target="_blank">http://support.microsoft.com/kb/125393/es</a></li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-10.jpg"><img class="aligncenter size-full wp-image-7786" title="modem-3g-10" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-10.jpg" alt="" width="418" height="121" /></a></p>
<p>Un <strong>script cmd</strong> para <strong>establecer conexión del modem 3g</strong> y <strong>obtener su ip dinámica</strong> mediante <strong>rasdial</strong>, que proporciona <strong>marcado desatendido</strong>.:</p>
<pre class="brush: bash; title: ; notranslate">
@echo off
REM desconectamos
rasdial &quot;ICON225&quot; /disconnect
REM conectamos
echo iniciamos el marcador de la conexion del modem 3G
rasdial &quot;ICON225&quot;
REM sabiendo el rango de IPs que nuestro ISP nos asigna, p.e: 80.59.0.0/16
REM obtenemos la IP dinamica que nos han asignado
@ipconfig | findstr 80.59 &gt; %tmp%\mewan3g.txt
for /F &quot;tokens=4,5,6,7 delims=. &quot; %%i in (%tmp%\mewan3g.txt) do set mewan3g=%%i.%%j.%%k.%%l
ECHO ip OBTENIDA VIA 3G: %mewan3g%
pause
</pre>
<p><span style="text-decoration: underline;"><strong>Preperativos previos:</strong></span></p>
<p><strong>Escenario:</strong></p>
<p>Windows = Windows Ultimate SP1<br />Modem 3g = GlobeTrotter HSxPA<br />ISP = Orange España (Usuario: CLIENTE, contraseña: AMENA, nºtelefono: *99#, IMPORTANTE: desactivar PIM de la sim del modem (esto se hace trivialmente con cualquier movil))</p>
<p style="text-align: left;">* Lo primero es instalar el driver del modem 3g (esto es obvio y no es el objeto de este post <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ).<br /> Una vez se tenga instalado el driver:</p>
<p>Si no tienes configurado el <strong>&#8220;dialer</strong>&#8221; o <strong>marcador de acceso telefónico</strong> para el <strong>modem 3G</strong>:<br />- Lo primero es conectar el modem a tu PC.<br />Abrimos desde el Panel de control el <strong>centro de redes y recursos compartidos</strong> y clikar en:</p>
<p><strong>Configurar una nueva conexión de red</strong></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-1.jpg"><img class="aligncenter size-full wp-image-7774" title="modem-3g-1" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-1.jpg" alt="" width="600" height="447" /></a></p>
<p style="text-align: left;">Configurar una conexión de acceso telefónico</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-2.jpg"><img class="aligncenter size-full wp-image-7775" title="modem-3g-2" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-2.jpg" alt="" width="600" height="439" /></a></p>
<p style="text-align: left;">Se define el Nº de teléfono a marcar, el USUARIO y la CONTRASEÑA. Y el nombre de la conexión: ICON225</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-3.jpg"><img class="aligncenter size-full wp-image-7776" title="modem-3g-3" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-3.jpg" alt="" width="600" height="447" /></a></p>
<p style="text-align: left;">Se establecerá la conexión</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-4.jpg"><img class="aligncenter size-full wp-image-7777" title="modem-3g-4" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-4.jpg" alt="" width="600" height="447" /></a></p>
<p style="text-align: left;">Si todo ha ido bien, se verá algo así:</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-5.jpg"><img class="aligncenter size-full wp-image-7778" title="modem-3g-5" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-5.jpg" alt="" width="600" height="447" /></a></p>
<p style="text-align: left;">Y te pedirán que ubiques la nueva red (hogar, trabajo, pública. Donde pública es la que windows dota de mayor seguridad)</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-5b.jpg"><img class="aligncenter size-full wp-image-7779" title="modem-3g-5b" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-5b.jpg" alt="" width="600" height="369" /></a></p>
<p style="text-align: left;">Ahora en Panel de control\Redes e Internet\Conexiones de red, deberá aparecer el icono del &#8220;dialer&#8221; o marcador del modem, al que he llamado ICON225.<br />Selecciono ICON225, Botón derecho y clicko en propiedades</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-6.jpg"><img class="aligncenter size-full wp-image-7780" title="modem-3g-6" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-6.jpg" alt="" width="438" height="275" /></a></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-6b.jpg"><img class="aligncenter size-full wp-image-7781" title="modem-3g-6b" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-6b.jpg" alt="" width="378" height="481" /></a></p>
<p style="text-align: left;">En opciones desmarcamos: Mostrar el progreso al conectar, Pedir el nombre y contraseña, pedir el nº de telefono.<br />Este paso es importate si deseamos poder establecer marcados desde consola o batch script (bat, cmd)</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-7.jpg"><img class="aligncenter size-full wp-image-7782" title="modem-3g-7" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-7.jpg" alt="" width="378" height="481" /></a></p>
<p style="text-align: left;">Ahora ya podemos establecer las conexiones del modem 3G ya sea por consola o por batch script (bat, cmd).</p>
<p><span style="text-decoration: underline;"><strong>* De forma interactiva con el usuario:</strong></span></p>
<p>Desde consola, ejecutar<strong> rasphone</strong>, y podremos elegir el marcador que deseemos</p>
<blockquote><p style="text-align: left;"><span style="color: #888888;">c:\&gt;</span> <strong>rasphone</strong></p>
</blockquote>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-8.jpg"><img class="aligncenter size-full wp-image-7783" title="modem-3g-8" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-8.jpg" alt="" width="424" height="209" /></a></p>
<p style="text-align: left;">para un batch script , conviene usar</p>
<blockquote><p style="text-align: left;"><span style="color: #333399;">start /WAIT</span> <strong>rasphone</strong></p>
</blockquote>
<p style="text-align: left;">De esta manera, el script <strong>detendrá el flujo de ejecución (opción /wait del start) hasta que la conexión se haya establecido</strong></p>
<p><span style="text-decoration: underline;"><strong>* De forma desatendida:</strong></span></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-9.jpg"><img class="aligncenter size-full wp-image-7784" title="modem-3g-9" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/modem-3g-9.jpg" alt="" width="483" height="221" /></a></p>
<p style="text-align: left;">Desde consola, ejecutar</p>
<p>Nos aseguramos que el modem este desconectado</p>
<blockquote><p style="text-align: left;"><span style="color: #808080;">c:\</span>&gt; <strong>rasdial &#8220;ICON225&#8243; /disconnect</strong></p>
</blockquote>
<p style="text-align: left;">Establecemos la conexión</p>
<blockquote><p style="text-align: left;"><span style="color: #808080;">c:\&gt;</span> <strong>rasdial &#8220;ICON225&#8243;</strong></p>
</blockquote>
<p style="text-align: left;">Y voila <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F14%2Fscript-bat-cmd-conectar-modem-3g-via-consola-o-via-batch-script%2F&amp;title=Script%20bat%2C%20cmd%20%26%238211%3B%20Conectar%20modem%203G%20v%C3%ADa%20consola%20o%20v%C3%ADa%20batch%20script" id="wpa2a_16"><img src="http://www.javcasta.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2011/10/14/script-bat-cmd-conectar-modem-3g-via-consola-o-via-batch-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tip WipFW &#8211; Permitir DHCP</title>
		<link>http://www.javcasta.com/2011/10/13/tip-wipfw-permitir-dhcp/</link>
		<comments>http://www.javcasta.com/2011/10/13/tip-wipfw-permitir-dhcp/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 10:42:10 +0000</pubDate>
		<dc:creator>javcasta</dc:creator>
				<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[seguridad]]></category>
		<category><![CDATA[Sistemas]]></category>
		<category><![CDATA[soporte]]></category>
		<category><![CDATA[Utilidades]]></category>

		<guid isPermaLink="false">http://www.javcasta.com/?p=7771</guid>
		<description><![CDATA[Referencias: http://www.javcasta.com/2011/07/31/wipfw-un-firewall-freebsd-por-consola-para-windows/ http://www.javcasta.com/2011/07/31/batch-script-mywipfw-cmd-script-cmd-para-configurar-firewall-wipfw-0-5-0b/ http://www.javcasta.com/2011/09/10/networking-wipfw-limitar-ancho-de-banda-en-puerto/ http://www.javcasta.com/2011/08/06/batch-script-%E2%80%93-mywipfw2-cmd-%E2%80%93-crear-tabla-en-wipfw-para-denegar-redes-desde-fichero-de-lista-negra/ http://www.javcasta.com/2011/08/11/wipfw-logs-del-firewall/ &#160; Un post rápido, para recordar las reglas que permiten a un host con cliente dhcp, que pueda obtener la ip y sus parámetros tcp/ip de un servidor dhcp. Estas reglas, se pueden incluir en un batch scrip (bat, cmd) e irian casi al principio de todas las demás [...]]]></description>
			<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F13%2Ftip-wipfw-permitir-dhcp%2F"></g:plusone><br /><p><!-- tweet id : 124435811772014592 --><style type='text/css'>#bbpBox_124435811772014592 a { text-decoration:none; color:#2FC2EF; }#bbpBox_124435811772014592 a:hover { text-decoration:underline; }</style><div id='bbpBox_124435811772014592' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#1a1b1f; background-image:url(http://a0.twimg.com/profile_background_images/234683216/leonTwitter.JPG); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#666666; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>Nuevo Post: Tip WipFW &#8211; Permitir DHCP <a href="http://t.co/LJvHo08a" rel="nofollow">http://t.co/LJvHo08a</a></span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://www.javcasta.com/blog/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 13/10/2011 10:46' href='http://twitter.com/#!/javcasta/status/124435811772014592' target='_blank'>13/10/2011 10:46</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=124435811772014592' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=124435811772014592' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=124435811772014592' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=javcasta'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a2.twimg.com/profile_images/1316173538/avatar_normal.png' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=javcasta'>@javcasta</a><div style='margin:0; padding-top:2px'>Javier Casta&#241;&#243;n</div></div><div style='clear:both'></div></div></div><!-- end of tweet --><br />
<hr />
<p>Referencias:</p>
<ul>
<li><a href="http://www.javcasta.com/2011/07/31/wipfw-un-firewall-freebsd-por-consola-para-windows/" target="_blank">http://www.javcasta.com/2011/07/31/wipfw-un-firewall-freebsd-por-consola-para-windows/</a></li>
<li><a href="http://www.javcasta.com/2011/07/31/batch-script-mywipfw-cmd-script-cmd-para-configurar-firewall-wipfw-0-5-0b/" target="_blank">http://www.javcasta.com/2011/07/31/batch-script-mywipfw-cmd-script-cmd-para-configurar-firewall-wipfw-0-5-0b/</a></li>
<li><a href="../../2011/09/10/networking-wipfw-limitar-ancho-de-banda-en-puerto/">http://www.javcasta.com/2011/09/10/networking-wipfw-limitar-ancho-de-banda-en-puerto/</a></li>
<li><a href="../../2011/08/06/batch-script-%E2%80%93-mywipfw2-cmd-%E2%80%93-crear-tabla-en-wipfw-para-denegar-redes-desde-fichero-de-lista-negra/">http://www.javcasta.com/2011/08/06/batch-script-%E2%80%93-mywipfw2-cmd-%E2%80%93-crear-tabla-en-wipfw-para-denegar-redes-desde-fichero-de-lista-negra/</a></li>
<li><a href="../../2011/08/11/wipfw-logs-del-firewall/">http://www.javcasta.com/2011/08/11/wipfw-logs-del-firewall/</a></li>
</ul>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/09/beastie.png"><img class="aligncenter size-full wp-image-7727" title="beastie" src="http://www.javcasta.com/blog/wp-content/uploads/2011/09/beastie.png" alt="" width="178" height="196" /></a></p>
<p>Un post rápido, para recordar las reglas que permiten a un host con <strong>cliente dhcp</strong>, que pueda obtener la ip y sus parámetros tcp/ip de un servidor dhcp.</p>
<pre class="brush: bash; title: ; notranslate">
ipfw -q add pass udp from 0.0.0.0 68 to 255.255.255.255 67 out
ipfw -q add pass udp from any 67 to me 68 in
ipfw -q add pass udp from any 67 to 255.255.255.255 68 in
</pre>
<p>Estas reglas, se pueden incluir en un batch scrip (bat, cmd) e irian casi al principio de todas las demás y posteriores a las referentes a localhost (127.0.0.1). Ver referencias</p>
<p>Y voila <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F13%2Ftip-wipfw-permitir-dhcp%2F&amp;title=Tip%20WipFW%20%26%238211%3B%20Permitir%20DHCP" id="wpa2a_18"><img src="http://www.javcasta.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2011/10/13/tip-wipfw-permitir-dhcp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Batch Scripting &#8211; Dig for Win Y solución al error &#8220;configuración en paralelo no es correcta&#8221;</title>
		<link>http://www.javcasta.com/2011/10/06/batch-scripting-dig-for-win-y-solucion-al-error-configuracion-en-paralelo-no-es-correcta/</link>
		<comments>http://www.javcasta.com/2011/10/06/batch-scripting-dig-for-win-y-solucion-al-error-configuracion-en-paralelo-no-es-correcta/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 13:22:31 +0000</pubDate>
		<dc:creator>javcasta</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[seguridad]]></category>
		<category><![CDATA[Sistemas]]></category>
		<category><![CDATA[soporte]]></category>
		<category><![CDATA[Utilidades]]></category>

		<guid isPermaLink="false">http://www.javcasta.com/?p=7764</guid>
		<description><![CDATA[Referencias: Internet Systems Consortium http://www.isc.org/ http://www.isc.org/software/bind/981/download/bind981zip http://en.wikipedia.org/wiki/Domain_Information_Groper http://www.team-cymru.org/Services/Bogons/dns.html http://support.microsoft.com/kb/948619/es BIND, el servidor de DNS , tiene su versión para Windows, y por lo tanto trae, entre otras, su estupenda utilidad Dig en su versión win. BIND ya va por la versión 9.8.1. lanzada el 31/08/2011. Para bajarse BIND 9.8.1 para Win : http://www.isc.org/software/bind/981/download/bind981zip ftp://ftp.isc.org/isc/bind9/9.8.1/BIND9.8.1.zip Una [...]]]></description>
			<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F06%2Fbatch-scripting-dig-for-win-y-solucion-al-error-configuracion-en-paralelo-no-es-correcta%2F"></g:plusone><br /><p><!-- tweet id : 121938605210996736 --><style type='text/css'>#bbpBox_121938605210996736 a { text-decoration:none; color:#2FC2EF; }#bbpBox_121938605210996736 a:hover { text-decoration:underline; }</style><div id='bbpBox_121938605210996736' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#1a1b1f; background-image:url(http://a0.twimg.com/profile_background_images/234683216/leonTwitter.JPG); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#666666; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>Nuevo Post: Batch Scripting - Dig for Win Y soluci&#243;n al error "configuraci&#243;n en paralelo no es correcta" <a href="http://t.co/oRArimSx" rel="nofollow">http://t.co/oRArimSx</a></span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://www.javcasta.com/blog/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 06/10/2011 13:23' href='http://twitter.com/#!/javcasta/status/121938605210996736' target='_blank'>06/10/2011 13:23</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=121938605210996736' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=121938605210996736' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=121938605210996736' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=javcasta'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a2.twimg.com/profile_images/1316173538/avatar_normal.png' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=javcasta'>@javcasta</a><div style='margin:0; padding-top:2px'>Javier Casta&#241;&#243;n</div></div><div style='clear:both'></div></div></div><!-- end of tweet --><br />
<hr />
<p>Referencias:</p>
<ul>
<li>Internet Systems Consortium <a href="http://www.isc.org/" target="_blank">http://www.isc.org/</a></li>
<li><a href="http://www.isc.org/software/bind/981/download/bind981zip" target="_blank">http://www.isc.org/software/bind/981/download/bind981zip</a></li>
<li><a href="http://en.wikipedia.org/wiki/Domain_Information_Groper" target="_blank">http://en.wikipedia.org/wiki/Domain_Information_Groper</a></li>
<li><a href="http://www.team-cymru.org/Services/Bogons/dns.html" target="_blank">http://www.team-cymru.org/Services/Bogons/dns.html</a></li>
<li><a href="http://support.microsoft.com/kb/948619/es" target="_blank">http://support.microsoft.com/kb/948619/es</a></li>
</ul>
<p><strong>BIND</strong>, el servidor de DNS , tiene su versión para Windows, y por lo tanto trae, entre otras, su estupenda utilidad <strong>Dig</strong> en su versión win.<br />
BIND ya va por la versión<strong> 9.8.1</strong>. lanzada el 31/08/2011.</p>
<p>Para bajarse <strong>BIND 9.8.1 para Win</strong> :</p>
<ul>
<li><a href="http://www.isc.org/software/bind/981/download/bind981zip" target="_blank">http://www.isc.org/software/bind/981/download/bind981zip</a></li>
<li><a href="ftp://ftp.isc.org/isc/bind9/9.8.1/BIND9.8.1.zip" target="_blank">ftp://ftp.isc.org/isc/bind9/9.8.1/BIND9.8.1.zip</a></li>
</ul>
<p>Una vez lo hayas bajado, descomprimes y extraes el contenido a la carpeta que desees: por ejemplo x:\BIND\BIND9.8.1</p>
<p>Pruebo <strong>dig.exe</strong> en un<strong> W7 Ultimate de 32bits</strong>, desde linea de comandos. Y me sale el mensaje de error:</p>
<blockquote><p><span style="color: #888888;">X:\BIND\BIND9.8.1&gt;</span> <strong>dig</strong><br />
<span style="color: #993300;">No se pudo iniciar la aplicación; la configuración en paralelo no es correcta. Consulte el registro de eventos de la aplicación o use la herramienta sxstrace.exe de la línea de comandos para obtener más detalles.</span></p></blockquote>
<p>Si consultas el <strong>registro de eventos</strong>, sale algo tal que:</p>
<blockquote><p><em><span style="color: #808080;">Error al generar el contexto de activación para &#8220;X:\BIND\BIND9.8.1\rndc.exe&#8221;.</span></em><br />
<em><span style="color: #808080;"><strong> No se encontró el ensamblado dependiente Microsoft.VC80.CRT</strong>,processorArchitecture=&#8221;x86&#8243;,publicKeyToken=&#8221;1fc8b3b9a1e18e3b&#8221;,type=&#8221;win32&#8243;,version=&#8221;8.0.50727.6195&#8243;.</span></em><br />
<em><span style="color: #808080;"> Use sxstrace.exe para obtener un diagnóstico detallado.</span></em></p></blockquote>
<p>Según nos cuenta <strong>Microsoft</strong> <a href="http://support.microsoft.com/kb/948619/es" target="_blank">http://support.microsoft.com/kb/948619/es</a> :<br />
Una posible solución es bajarte e instalar o reinstalar, <strong>Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)</strong>:</p>
<p><strong>vcredist_x86.exe</strong>: Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)<br />
<a href="http://www.microsoft.com/downloads/es-es/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&amp;displaylang=es" target="_blank">http://www.microsoft.com/downloads/es-es/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&amp;displaylang=es</a></p>
<p>Pero el error persiste. &#8230; <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>Y al final tras probar otros caminos, como siempre la solución la trae el propio instalador de BIND9:</p>
<p><span style="text-decoration: underline;"><strong>Solución:</strong></span><br />
Ejecutar el instalador de BIN9 BINDInstall.exe como<strong> Tools Only</strong> (solo herramientas se instalarán). Tan simpe como eso <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/BIND9-onlyTools.jpg"><img class="aligncenter size-full wp-image-7765" title="BIND9-onlyTools" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/BIND9-onlyTools.jpg" alt="" width="331" height="544" /></a></p>
<p>En la instalación que realice, el path a las utilidades (entre ellas dig), es <strong>%systemroot%\system32\dns\bin\</strong></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/BIND9-onlyTools2.jpg"><img class="aligncenter size-full wp-image-7766" title="BIND9-onlyTools2" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/BIND9-onlyTools2.jpg" alt="" width="438" height="358" /></a></p>
<p>Ahora ya puedo hablar de dig en Windows:</p>
<p><strong>Dig</strong> es las siglas de <strong>Domain Information Groper</strong>, una utilidad de linea de comando que sirve como cliente para efectuar &#8220;<strong>DNS queries</strong>&#8221; o peticiones de resolución de nombres de dominio para cualquier registro DNS deseado.<br />
Es similar al<strong> nslookup</strong>, pero para mi gusto más versatil y más potente para Batch scripting.</p>
<p>Según la wikipedia: <a href="http://en.wikipedia.org/wiki/Domain_Information_Groper" target="_blank">http://en.wikipedia.org/wiki/Domain_Information_Groper</a></p>
<blockquote><p><em><span style="color: #ff6600;">Domain Information Groper (dig) is a network administration command-line tool for querying Domain Name System (DNS) name servers for any desired DNS records.</span></em></p></blockquote>
<p>¿Que se puede hacer con Dig?, por ejemplo un <strong>script que consulte</strong> a<a href="http://www.team-cymru.org/Services/Bogons/dns.html" target="_blank"> http://www.team-cymru.org/Services/Bogons/dns.html</a> <strong>si una ip pertenece a una red bogon</strong>:</p>
<p>consultaBogon.cmd</p>
<pre class="brush: bash; title: ; notranslate">
@echo off
set camino=%systemroot%\System32\dns\bin
echo introduce IP a consultar:
set /p ipori=
set ip=%ipori%
%camino%\arpaname.exe %ip% | findstr ARPA &gt; %TMP%\arpaIP.tmp
for /F &quot;tokens=1,2,3,4 delims=. &quot; %%i in (%TMP%\arpaIP.tmp) do set ip=%%i.%%j.%%k.%%l.bogons.cymru.com
%camino%\dig +short %ip% &gt; %TMP%\resultadoDIG.tmp
for /F &quot;tokens=1,2,3,4 delims=. &quot; %%i in (%TMP%\resultadoDIG.tmp) do set ip=%%i.%%j.%%k.%%l
if &quot;%ip%&quot;==&quot;127.0.0.2&quot; echo %ipori% SI pertenece a una red Bogon
if NOT &quot;%ip%&quot;==&quot;127.0.0.2&quot; echo %ipori% NO es de una red Bogon
pause
</pre>
<p><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/Consulta-redBogon.jpg"><img class="aligncenter size-full wp-image-7767" title="Consulta-redBogon" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/Consulta-redBogon.jpg" alt="" width="355" height="142" /></a><br />
Y voila <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F06%2Fbatch-scripting-dig-for-win-y-solucion-al-error-configuracion-en-paralelo-no-es-correcta%2F&amp;title=Batch%20Scripting%20%26%238211%3B%20Dig%20for%20Win%20Y%20soluci%C3%B3n%20al%20error%20%26%238220%3Bconfiguraci%C3%B3n%20en%20paralelo%20no%20es%20correcta%26%238221%3B" id="wpa2a_20"><img src="http://www.javcasta.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2011/10/06/batch-scripting-dig-for-win-y-solucion-al-error-configuracion-en-paralelo-no-es-correcta/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IPConfig con C# &#8211; Get TCP/IP config with C# &#8211; Obtener configuración TCP/IP con C#</title>
		<link>http://www.javcasta.com/2011/10/05/ipconfig-con-c-get-tcpip-config-with-c-obtener-configuracion-tcpip-con-c/</link>
		<comments>http://www.javcasta.com/2011/10/05/ipconfig-con-c-get-tcpip-config-with-c-obtener-configuracion-tcpip-con-c/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 16:40:10 +0000</pubDate>
		<dc:creator>javcasta</dc:creator>
				<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Sistemas]]></category>
		<category><![CDATA[soporte]]></category>
		<category><![CDATA[Utilidades]]></category>

		<guid isPermaLink="false">http://www.javcasta.com/?p=7760</guid>
		<description><![CDATA[Referencias: WMI &#38; C# Un divertimento en C# creado con Sharpdevelop, para obtener las NICs y sus parámetros TCP/IP de la maquina local. Un buen ejercicio para practicar C# y  la clase System.Management. El código: MainForm.cs Y voila]]></description>
			<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F05%2Fipconfig-con-c-get-tcpip-config-with-c-obtener-configuracion-tcpip-con-c%2F"></g:plusone><br /><p><!-- tweet id : 121625942115352577 --><style type='text/css'>#bbpBox_121625942115352577 a { text-decoration:none; color:#2FC2EF; }#bbpBox_121625942115352577 a:hover { text-decoration:underline; }</style><div id='bbpBox_121625942115352577' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#1a1b1f; background-image:url(http://a0.twimg.com/profile_background_images/234683216/leonTwitter.JPG); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#666666; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>Nuevo Post: IPConfig con C# - Get TCP/IP config with C# - Obtener configuraci&#243;n TCP/IP con C# <a href="http://t.co/WBE31v4E" rel="nofollow">http://t.co/WBE31v4E</a></span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://www.javcasta.com/blog/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 05/10/2011 16:40' href='http://twitter.com/#!/javcasta/status/121625942115352577' target='_blank'>05/10/2011 16:40</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=121625942115352577' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=121625942115352577' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=121625942115352577' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=javcasta'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a2.twimg.com/profile_images/1316173538/avatar_normal.png' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=javcasta'>@javcasta</a><div style='margin:0; padding-top:2px'>Javier Casta&#241;&#243;n</div></div><div style='clear:both'></div></div></div><!-- end of tweet --><br />
<hr />
<p>Referencias: WMI &amp; C#</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/IPconfig-with-Csharp-1.jpg"><img class="aligncenter size-full wp-image-7761" title="IPconfig-with-Csharp-1" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/IPconfig-with-Csharp-1.jpg" alt="" width="547" height="306" /></a></p>
<p>Un divertimento en <strong>C#</strong> creado con <strong>Sharpdevelop</strong>, para obtener las<strong> NIC</strong>s y sus parámetros <strong>TCP/IP</strong> de la maquina local.</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/IPconfig-with-Csharp-2.jpg"><img class="aligncenter size-full wp-image-7762" title="IPconfig-with-Csharp-2" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/IPconfig-with-Csharp-2.jpg" alt="" width="544" height="306" /></a></p>
<p>Un buen ejercicio para practicar C# y  la clase <strong>System.Management</strong>.</p>
<p>El código: MainForm.cs</p>
<pre class="brush: java; title: ; notranslate">
/*
 * Created by SharpDevelop.
 * User: JavCasta - 2.011 - http://javcasta.com
 * Date: 05/10/2011
 * Time: 17:18
 *
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.Management;

namespace IPConfigCSharp
{
	/// &lt;summary&gt;
	/// Description of MainForm.
	/// &lt;/summary&gt;
	public partial class MainForm : Form
	{
		public MainForm()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();

			// begin
			ManagementClass objMC;
			ManagementObjectCollection objMOC;
			string[] ipaddresses;
			string[] subnets;
			string[] gateways;
			string[] dns;
			string hostname;
			int i = 0;
			objMC = new ManagementClass(&quot;Win32_NetworkAdapterConfiguration&quot;);
 			objMOC = objMC.GetInstances();
			foreach(ManagementObject objMO in objMOC)
			{
          		if(!(bool)objMO[&quot;ipEnabled&quot;])
                	 continue;
       			i=i+1; // i = nº de NICs
          		//comboBox6.Items.Add(objMO[&quot;Caption&quot;]);
          		ipaddresses = (string[]) objMO[&quot;IPAddress&quot;];
          		subnets = (string[]) objMO[&quot;IPSubnet&quot;];
          		gateways = (string[]) objMO[&quot;DefaultIPGateway&quot;];
          		dns = (string[]) objMO[&quot;DNSServerSearchOrder&quot;];
          		hostname = (String) objMO[&quot;DNSHostName&quot;];
          		groupBox1.Text = &quot;Info TCP/IPv4: &quot; + hostname;
          		comboBox6.Items.Add(objMO[&quot;Caption&quot;]);
			}
			//end

		}

		void ComboBox6SelectedIndexChanged(object sender, EventArgs e)
		{
			//elegir nic
			textBox1.Text = &quot;&quot;;
			comboBox2.Items.Clear();
			comboBox3.Items.Clear();
			comboBox4.Items.Clear();
			comboBox5.Items.Clear();
			comboBox2.Text = &quot;&quot;;
			comboBox3.Text = &quot;&quot;;
			comboBox4.Text = &quot;&quot;;
			comboBox5.Text = &quot;&quot;;

			string consulta=&quot;SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'TRUE' And Caption = '&quot;+
				comboBox6.SelectedItem.ToString()+&quot;' And (SettingID != NULL)&quot;;

			ManagementObjectSearcher query = new ManagementObjectSearcher(consulta);
        	ManagementObjectCollection queryCollection = query.Get();
        	try
        	{
        	foreach( ManagementObject mo in queryCollection )
        	{

        		string mac = (string)mo[&quot;MACAddress&quot;];
        		textBox1.Text = mac;

        		string[] direcciones = (string[])mo[&quot;IPAddress&quot;];
        		if (direcciones != null) {
					foreach(string strIP in direcciones) {
        				comboBox2.Items.Add(strIP);
        				if (comboBox2.Text == &quot;&quot;) comboBox2.Text = strIP;
					}
        		}
        		string[] mascaras = (string[])mo[&quot;IPSubnet&quot;];
        		if (mascaras != null) {
					foreach(string strMascara in mascaras) {
        				comboBox3.Items.Add(strMascara);
        				if (comboBox3.Text == &quot;&quot;) comboBox3.Text = strMascara;
					}
        		}
        		string[] puertaDeEnlace = (string[])mo[&quot;DefaultIPGateway&quot;];
        		if (puertaDeEnlace != null) {
					foreach(string strGW in puertaDeEnlace) {
        				comboBox4.Items.Add(strGW);
        				if (comboBox4.Text == &quot;&quot;) comboBox4.Text = strGW;
					}
        		}
        		string[] sdns = (string[])mo[&quot;DNSServerSearchOrder&quot;];
        		if (sdns != null) {
					foreach(string strdns in sdns) {
        				comboBox5.Items.Add(strdns);
        				if (comboBox5.Text == &quot;&quot;) comboBox5.Text=strdns;
					}
        		}
			}
        	}//try
        	catch(Exception ex)
        	{
            	MessageBox.Show(&quot;error : &quot; + ex.Message);
        	}
		}
	}
}
</pre>
<p>Y voila <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F05%2Fipconfig-con-c-get-tcpip-config-with-c-obtener-configuracion-tcpip-con-c%2F&amp;title=IPConfig%20con%20C%23%20%26%238211%3B%20Get%20TCP%2FIP%20config%20with%20C%23%20%26%238211%3B%20Obtener%20configuraci%C3%B3n%20TCP%2FIP%20con%20C%23" id="wpa2a_22"><img src="http://www.javcasta.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2011/10/05/ipconfig-con-c-get-tcpip-config-with-c-obtener-configuracion-tcpip-con-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Virtualización: Compartir red entre VirtualBOX y VMware &#8211; Bridging a virtual VMware NIC in VirtualBOX</title>
		<link>http://www.javcasta.com/2011/10/05/virtualizacion-compartir-red-entre-virtualbox-y-vmware-bridging-a-virtual-vmware-nic-in-virtualbox/</link>
		<comments>http://www.javcasta.com/2011/10/05/virtualizacion-compartir-red-entre-virtualbox-y-vmware-bridging-a-virtual-vmware-nic-in-virtualbox/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 10:46:32 +0000</pubDate>
		<dc:creator>javcasta</dc:creator>
				<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Sistemas]]></category>
		<category><![CDATA[soporte]]></category>
		<category><![CDATA[Utilidades]]></category>
		<category><![CDATA[virtualización]]></category>

		<guid isPermaLink="false">http://www.javcasta.com/?p=7756</guid>
		<description><![CDATA[Referencias: http://en.wikipedia.org/wiki/Proxy_ARP http://doc.pfsense.org/index.php/What_are_Virtual_IP_Addresses%3F http://www.cisco.com/en/US/tech/tk648/tk361/technologies_tech_note09186a0080094adb.shtml Necesitaba que una maquina virtual que corre bajo VirtualBOX estuviera en el mismo segmento de red que otra maquina virtual que corre bajo VMware. Una primera cosa que probé fue implementar en my router/firewall pfSense un Proxy ARP mediante IP virtual (VIP) del tipo Proxy ARP, que presenta las siguientes características: [...]]]></description>
			<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F05%2Fvirtualizacion-compartir-red-entre-virtualbox-y-vmware-bridging-a-virtual-vmware-nic-in-virtualbox%2F"></g:plusone><br /><p><!-- tweet id : 121537672169787392 --><style type='text/css'>#bbpBox_121537672169787392 a { text-decoration:none; color:#2FC2EF; }#bbpBox_121537672169787392 a:hover { text-decoration:underline; }</style><div id='bbpBox_121537672169787392' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#1a1b1f; background-image:url(http://a0.twimg.com/profile_background_images/234683216/leonTwitter.JPG); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#666666; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>Nuevo Post: Virtualizaci&#243;n: Compartir red entre VirtualBOX y VMware &#8211; Bridging a virtual VMware NIC in VirtualBOX  <a href="http://t.co/mulGU3Iq" rel="nofollow">http://t.co/mulGU3Iq</a></span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://www.javcasta.com/blog/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 05/10/2011 10:50' href='http://twitter.com/#!/javcasta/status/121537672169787392' target='_blank'>05/10/2011 10:50</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=121537672169787392' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=121537672169787392' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=121537672169787392' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=javcasta'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a2.twimg.com/profile_images/1316173538/avatar_normal.png' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=javcasta'>@javcasta</a><div style='margin:0; padding-top:2px'>Javier Casta&#241;&#243;n</div></div><div style='clear:both'></div></div></div><!-- end of tweet --><br />
<hr />
<p>Referencias:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Proxy_ARP" target="_blank">http://en.wikipedia.org/wiki/Proxy_ARP</a></li>
<li><a href="http://doc.pfsense.org/index.php/What_are_Virtual_IP_Addresses%3F" target="_blank">http://doc.pfsense.org/index.php/What_are_Virtual_IP_Addresses%3F</a></li>
<li><a href="http://www.cisco.com/en/US/tech/tk648/tk361/technologies_tech_note09186a0080094adb.shtml" target="_blank">http://www.cisco.com/en/US/tech/tk648/tk361/technologies_tech_note09186a0080094adb.shtml</a></li>
</ul>
<p>Necesitaba que una maquina virtual que corre bajo VirtualBOX estuviera en el mismo segmento de red que otra maquina virtual que corre bajo VMware.</p>
<p>Una primera cosa que probé fue implementar en my router/firewall <strong>pfSense</strong> un <strong>Proxy ARP</strong> mediante <strong>IP virtual (VIP)</strong> del tipo Proxy ARP, que presenta las siguientes características:</p>
<p><a href="http://doc.pfsense.org/index.php/What_are_Virtual_IP_Addresses%3F" target="_blank">http://doc.pfsense.org/index.php/What_are_Virtual_IP_Addresses%3F</a></p>
<blockquote><ol>
<li><em><span style="color: #888888;">1 Can not be used by the firewall itself but can be forwarded</span></em></li>
<li><em><span style="color: #888888;">2 Generates Layer2 traffic for the VIP</span></em></li>
<li><em><span style="color: #888888;">3 The VIP can be in a different subnet than the real interface&#8217;s IP</span></em></li>
<li><em><span style="color: #888888;">4 Will not respond to ICMP ping.</span></em></li>
</ol>
</blockquote>
<p>1 <span style="color: #ff6600;">No las puede usar el firewall por si mismo, pero las puede reenviar</span><br />2<span style="color: #008000;"> <strong>Genera trafico de capa 2 para la IP virtual</strong></span><br />3 <span style="color: #008000;"><strong>la IP virtual puede estar en una diferente subred que la IP real del interfaz</strong></span><br />4 <span style="color: #ff6600;">No responden a ping (no hacen ICMP echo reply)</span></p>
<p>Las caracteríticas 1 y 4, son para mis propositos desventajas y la 2 y 3 claras ventajas.</p>
<p>Un Proxy ARP es según la Wikipedia: <a href="http://en.wikipedia.org/wiki/Proxy_ARP" target="_blank">http://en.wikipedia.org/wiki/Proxy_ARP</a></p>
<blockquote><p><em><span style="color: #808080;">Proxy ARP (Address Resolution Protocol) is a technique by which a device on a given network answers the ARP queries</span></em><em><span style="color: #808080;"> for a network address that is not on that network. The ARP Proxy is aware of the location of the traffic&#8217;s destination,</span></em><em><span style="color: #808080;"> and offers its own MAC address in reply, effectively saying, &#8220;send it to me, and I&#8217;ll get it to where it needs to go.&#8221;</span></em><em><span style="color: #808080;"> Serving as an ARP Proxy for another host effectively directs LAN traffic to the Proxy. The &#8220;captured&#8221; traffic is then</span></em><em><span style="color: #808080;"> typically routed by the Proxy to the intended destination via another interface or via a tunnel.</span></em></p>
</blockquote>
<p>Un <strong>proxy ARP</strong> es una técnica por la que <strong>un dispositivo de una red responde a las peticiones ARP para una dirección de red que no</strong> <strong>esta en esa red</strong>. Resumiendo, que<strong> es un proxy de capa 2</strong> (para el protocolo ARP o de resolución de direcciones de enlace o mac).</p>
<p>En la siguiente página de <strong>Cisco</strong>, explican muy bien el mecanismo del <strong>Proxy ARP</strong>:<br /><a href="http://www.cisco.com/en/US/tech/tk648/tk361/technologies_tech_note09186a0080094adb.shtml" target="_blank">http://www.cisco.com/en/US/tech/tk648/tk361/technologies_tech_note09186a0080094adb.shtml</a></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/proxy-arp.gif"><img class="aligncenter size-full wp-image-7757" title="proxy-arp" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/proxy-arp.gif" alt="" width="400" height="410" /></a></p>
<p>Como curiosidad,<strong> los dispositivos Cisco tienen el Proxy ARP habilitado por defecto</strong>, para dehabilitarlo en un interfaz seria con:</p>
<blockquote><p><span style="color: #808080;">Router(config-if)#</span><strong><span style="color: #ff6600;">no ip proxy-arp</span></strong></p>
</blockquote>
<p>Con el Proxy ARP podria conseguir el objetivo de que dos NICs en distintos segmentos de red se comportaran como si estuviesen en el mismo medio conmutado  &#8230;</p>
<p>Pero al final, tras varias pruebas, la solución más eficaz fue la más simple: <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><strong>Conseguí Compartir la red entre VirtualBOX y VMware conectando la maquina de VirtualBOX con NIC como adaptador puente a una NIC de  VMware.</strong><br />Y es tan facil como muestra la imagen: donde en las settings de la maquina virtual bajo VirtualBOX configuro una NIC conectada como adaptador puente (bridging) a una nic virtual de VMware</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/VirtualBoxNic-bridging-toVMwareNic-1.jpg"><img class="aligncenter size-full wp-image-7758" title="VirtualBoxNic-bridging-toVMwareNic-1" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/VirtualBoxNic-bridging-toVMwareNic-1.jpg" alt="" width="640" height="452" /></a></p>
<p>Tras esto la maquina virtual de VirtualBOX pudo usar la red y los recursos de la de la maquina virtual de VMware<br />Y es que a veces el camino más corto sigue siendo la linea recta &#8230;</p>
<p>Y voila <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F05%2Fvirtualizacion-compartir-red-entre-virtualbox-y-vmware-bridging-a-virtual-vmware-nic-in-virtualbox%2F&amp;title=Virtualizaci%C3%B3n%3A%20Compartir%20red%20entre%20VirtualBOX%20y%20VMware%20%26%238211%3B%20Bridging%20a%20virtual%20VMware%20NIC%20in%20VirtualBOX" id="wpa2a_24"><img src="http://www.javcasta.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2011/10/05/virtualizacion-compartir-red-entre-virtualbox-y-vmware-bridging-a-virtual-vmware-nic-in-virtualbox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Seguridad: pfSense &#8211; Firewall Rules Schedules or time based rules &#8211; Reglas basadas en tiempo</title>
		<link>http://www.javcasta.com/2011/10/04/seguridad-pfsense-firewall-rules-schedules-or-time-based-rules-reglas-basadas-en-tiempo/</link>
		<comments>http://www.javcasta.com/2011/10/04/seguridad-pfsense-firewall-rules-schedules-or-time-based-rules-reglas-basadas-en-tiempo/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 10:24:16 +0000</pubDate>
		<dc:creator>javcasta</dc:creator>
				<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[seguridad]]></category>
		<category><![CDATA[Sistemas]]></category>
		<category><![CDATA[soporte]]></category>
		<category><![CDATA[Utilidades]]></category>

		<guid isPermaLink="false">http://www.javcasta.com/?p=7751</guid>
		<description><![CDATA[Referencias: http://pfsense.org/ http://doc.pfsense.org/ http://doc.pfsense.org/index.php/Firewall_Rule_Schedules En el firewall pfSense, se pueden definir reglas de filtrado basadas en tiempo.Es decir, que se pueden definir un rango de tiempo (schedules) y aplicar ese rango en una (o varias) regla del firewall. En su doc ( http://doc.pfsense.org/index.php/Firewall_Rule_Schedules ) nos cuentan sobre este tema: Firewall rules can be scheduled so [...]]]></description>
			<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F04%2Fseguridad-pfsense-firewall-rules-schedules-or-time-based-rules-reglas-basadas-en-tiempo%2F"></g:plusone><br /><p><!-- tweet id : 121169051518124033 --><style type='text/css'>#bbpBox_121169051518124033 a { text-decoration:none; color:#2FC2EF; }#bbpBox_121169051518124033 a:hover { text-decoration:underline; }</style><div id='bbpBox_121169051518124033' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#1a1b1f; background-image:url(http://a0.twimg.com/profile_background_images/234683216/leonTwitter.JPG); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#666666; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>Nuevo Post: Seguridad: pfSense - Firewall Rules Schedules or time based rules - Reglas basadas en tiempo <a href="http://t.co/znFGqAZR" rel="nofollow">http://t.co/znFGqAZR</a></span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://www.javcasta.com/blog/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 04/10/2011 10:25' href='http://twitter.com/#!/javcasta/status/121169051518124033' target='_blank'>04/10/2011 10:25</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=121169051518124033' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=121169051518124033' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=121169051518124033' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=javcasta'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a2.twimg.com/profile_images/1316173538/avatar_normal.png' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=javcasta'>@javcasta</a><div style='margin:0; padding-top:2px'>Javier Casta&#241;&#243;n</div></div><div style='clear:both'></div></div></div><!-- end of tweet --><br />
<hr />
<p>Referencias:</p>
<ul>
<li><a href=" http://pfsense.org/" target="_blank">http://pfsense.org/</a></li>
<li><a href="http://doc.pfsense.org/" target="_blank">http://doc.pfsense.org/</a></li>
<li><a href="http://doc.pfsense.org/index.php/Firewall_Rule_Schedules" target="_blank">http://doc.pfsense.org/index.php/Firewall_Rule_Schedules</a></li>
</ul>
<p>En el <strong>firewall pfSense</strong>, se pueden definir <strong>reglas de filtrado basadas en tiempo</strong>.<br />Es decir, que se pueden definir un rango de tiempo (<strong>schedules</strong>) y aplicar ese rango en una (o varias) regla del firewall.</p>
<p>En su doc ( <a href="http://doc.pfsense.org/index.php/Firewall_Rule_Schedules" target="_blank">http://doc.pfsense.org/index.php/Firewall_Rule_Schedules</a> ) nos cuentan sobre este tema:</p>
<blockquote><p><span style="color: #888888;"><em>Firewall rules can be scheduled so that they are only active at certain times of day or on certain specific days or days of the week.</em></span><br /><span style="color: #888888;"><em>Before you can apply a schedule to the rule, you must create a schedule under Firewall &gt; Schedules. Then, when creating a rule,</em></span><br /><span style="color: #888888;"><em> pick the defined schedule from the list.</em></span><br /><span style="color: #888888;"><em>Keep in mind that when the rule is inactive, the rules is not skipped &#8212; the opposite action is applied.</em></span><br /><span style="color: #888888;"><em> If you schedule a block, a pass is assumed at all other times. If you schedule a pass, a block is assumed.</em></span><br /><span style="color: #888888;"><em>In 2.0 this behavior has been changed, and the schedules rules will instead act as though they do not exist when the scheduled time is not active.</em></span></p>
</blockquote>
<p>Antes de la versión 2.0, cuando se crea una regla sometida a un rango de tiempo, fuera de ese rango la acción opuesta a esa regla se aplica.<br />Es decir que si creo una regla que permita el acceso a una red vía el socket tcp22 de 08:00 a 18:00, entonces de 18:01 a 07:59 se aplicaría su contraria, que seria no permitir (block) el acceso a esa red vía tcp22</p>
<p>A partir de la versión 2.0 de pfSense, esto ha cambiado, y cuando se esta fuera del rango de tiempo aplicado a la regla, el firewall se comportará como si esa regla no existiera.</p>
<p>Por lo que a partir de la versión 2.0, si creo una regla que permita el acceso a una red vía tcp22 en el rango de tiempo de 08:00 a 18:00.<br />Para asegurarme que no se permita fuera de ese rango de tiempo, deberé crear otra regla que deniegue o bloquee el acceso a la red vía tcp22<br />desde las 18:01 hasta las 07:59.<br />Aunque esto es relativo, ya que puedo configurar el firewall como un deny o drop por defecto, es decir que aquello que no este permitido esta denegado.<br />Pero nunca viene mal la redundancia en seguridad <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Para crear un schedule o rango de tiempo, voy al menú <span style="color: #ff6600;">firewall &gt; schedules</span>, y defino el nombre y el rango de tiempo.</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/schedules-11.jpg"><img class="aligncenter size-full wp-image-7753" title="schedules-1" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/schedules-11.jpg" alt="" width="500" height="500" /></a></p>
<p style="text-align: left;">En este ejemplo, uso el rango de 08:00 a 18:00 de lunes a viernes</p>
<p>Ahora podría aplicar ese rango a una regla del firewall, editando la en su apartado advanced features y eligiendo en <strong>schedule</strong> el rango anteriormente definido</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/schedules-2.jpg"><img class="aligncenter size-full wp-image-7754" title="schedules-2" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/schedules-2.jpg" alt="" width="427" height="434" /></a></p>
<p style="text-align: left;">Y voila <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F04%2Fseguridad-pfsense-firewall-rules-schedules-or-time-based-rules-reglas-basadas-en-tiempo%2F&amp;title=Seguridad%3A%20pfSense%20%26%238211%3B%20Firewall%20Rules%20Schedules%20or%20time%20based%20rules%20%26%238211%3B%20Reglas%20basadas%20en%20tiempo" id="wpa2a_26"><img src="http://www.javcasta.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2011/10/04/seguridad-pfsense-firewall-rules-schedules-or-time-based-rules-reglas-basadas-en-tiempo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Seguridad: pfSense &#8211; Reglas de filtrado de Capa de aplicación &#8211; deep packet inspection</title>
		<link>http://www.javcasta.com/2011/10/03/seguridad-pfsense-reglas-de-filtrado-de-capa-de-aplicacion-deep-packet-inspection/</link>
		<comments>http://www.javcasta.com/2011/10/03/seguridad-pfsense-reglas-de-filtrado-de-capa-de-aplicacion-deep-packet-inspection/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 17:19:37 +0000</pubDate>
		<dc:creator>javcasta</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[seguridad]]></category>
		<category><![CDATA[Sistemas]]></category>
		<category><![CDATA[soporte]]></category>
		<category><![CDATA[Utilidades]]></category>

		<guid isPermaLink="false">http://www.javcasta.com/?p=7744</guid>
		<description><![CDATA[Referencias: http://doc.pfsense.org/index.php/Traffic_Shaping_Guide http://pfsense.org/ http://doc.pfsense.org/ En el firewall pfSense 2.0-Release, se pueden definir reglas de filtrado de capa de aplicación o capa 7. Según nos cuentan en su doc: http://doc.pfsense.org/index.php/Traffic_Shaping_Guide Layer 7 filtering or shaping is identifying traffic at layer 7 (Application Layer) of the OSI model.Instead of shaping/filtering based on the port and source/destination, you [...]]]></description>
			<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F03%2Fseguridad-pfsense-reglas-de-filtrado-de-capa-de-aplicacion-deep-packet-inspection%2F"></g:plusone><br /><p><!-- tweet id : 120911255740493825 --><style type='text/css'>#bbpBox_120911255740493825 a { text-decoration:none; color:#2FC2EF; }#bbpBox_120911255740493825 a:hover { text-decoration:underline; }</style><div id='bbpBox_120911255740493825' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#1a1b1f; background-image:url(http://a0.twimg.com/profile_background_images/234683216/leonTwitter.JPG); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#666666; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>Nuevo Post: Seguridad: pfSense &#8211; Reglas de filtrado de Capa de aplicaci&#243;n &#8211; deep packet inspection  <a href="http://t.co/yfa8Jhgi" rel="nofollow">http://t.co/yfa8Jhgi</a></span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://www.javcasta.com/blog/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 03/10/2011 17:21' href='http://twitter.com/#!/javcasta/status/120911255740493825' target='_blank'>03/10/2011 17:21</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=120911255740493825' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=120911255740493825' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=120911255740493825' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=javcasta'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a2.twimg.com/profile_images/1316173538/avatar_normal.png' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=javcasta'>@javcasta</a><div style='margin:0; padding-top:2px'>Javier Casta&#241;&#243;n</div></div><div style='clear:both'></div></div></div><!-- end of tweet --><br />
<hr />
<p>Referencias:</p>
<ul>
<li><a href="http://doc.pfsense.org/index.php/Traffic_Shaping_Guide" target="_blank">http://doc.pfsense.org/index.php/Traffic_Shaping_Guide</a></li>
<li><a href="http://pfsense.org/" target="_blank">http://pfsense.org/</a></li>
<li><a href="http://doc.pfsense.org/" target="_blank">http://doc.pfsense.org/</a></li>
</ul>
<p>En el firewall <strong>pfSense 2.0-Release</strong>, se pueden definir <strong>reglas de filtrado de capa de aplicación o capa 7</strong>.</p>
<p>Según nos cuentan en su doc:<a href="http://doc.pfsense.org/index.php/Traffic_Shaping_Guide" target="_blank"> http://doc.pfsense.org/index.php/Traffic_Shaping_Guide</a></p>
<blockquote><p><em><span style="color: #888888;">Layer 7 filtering or shaping is identifying traffic at layer 7 (Application Layer) of the OSI model.</span></em><br /><em><span style="color: #888888;">Instead of shaping/filtering based on the port and source/destination, you are identifying a stream</span></em><br /><em><span style="color: #888888;">based on its contents. This is also sometimes called<span style="color: #ff6600;"><strong> deep packet inspection</strong></span> since it works by looking</span></em><br /><em><span style="color: #888888;">into the contents of the packets not just the headers.</span></em></p>
</blockquote>
<p><strong>pfSense</strong> identifica <strong>tráfico de capa 7</strong> (capa de aplicación) del modelo<strong> OSI</strong>.<br />En lugar de determinar el filtrado basandose en el puerto de origen y destino, se identifica un <em><strong>&#8220;stream</strong></em>&#8221; (flujo de datos) basandose en su contenido (también llamado<strong> inspección profunda de paquete &#8211; deep packet inspection</strong>).</p>
<p>Este método trabaja observando el contenido de los paquetes y no solo los <strong>encabezados (headers)</strong></p>
<p>¿Y si quiero deshabilitar tráfico del tipo<strong> citrix</strong>, <strong>cisco-vpn</strong>, <strong>ares</strong>,<strong> bittorrent</strong>,<strong> vnc</strong>, etc, en una red corporativa?. Seria muy ingenuo suponer que alguien que instale un Software, llamemosle no corporativo o no permitido, usara los puertos estandars.</p>
<p>Es decir que si alguien instalara un cliente/servidor VNC no usaria el tcp5800/5900, con lo que mediante una regla de filtrado a esos puertos no bastaria para impedir el uso de un reverse VNC vía tcp80,tcp443.</p>
<p>Y es aqui donde entran en juego las capacidades de deep packet inspection de pfSense.</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/Reglas_FW_pfsense_de_Capa_Aplicacion-1.jpg"><img class="aligncenter size-full wp-image-7745" title="Reglas_FW_pfsense_de_Capa_Aplicacion-1" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/Reglas_FW_pfsense_de_Capa_Aplicacion-1.jpg" alt="" width="640" height="459" /></a></p>
<p>Vamos al menú <span style="color: #ff6600;"><em>Firewall &gt; Traffic Shaper &gt; Layer 7</em></span> &gt;<span style="color: #333399;">Create new l7 rules group</span> (Crer un grupo de reglas de capa 7).</p>
<p>Habilitamos <strong>Layer 7 Container</strong>, le damos un nombre y descripción y añadimos las reglas, en definitiva los protocolos que deseamos bloquear, en este ejemplo: <strong>vnc</strong>, <strong>ares</strong>, <strong>bittorrent</strong>, <strong>ciscovpn</strong> y <strong>citrix</strong> .Con la acción block.<br />Salvamos (save) y aplicamos cambios.</p>
<p>Ahora creamos una regla del firewall ( menú <strong><span style="color: #ff6600;"><em>Firewall &gt; Rules</em></span></strong> ) para un interfaz determinado (Wan, lan, DMZ, etc)</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/Reglas_FW_pfsense_de_Capa_Aplicacion-2a.jpg"><img class="aligncenter size-full wp-image-7746" title="Reglas_FW_pfsense_de_Capa_Aplicacion-2a" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/Reglas_FW_pfsense_de_Capa_Aplicacion-2a.jpg" alt="" width="640" height="547" /></a></p>
<p>Donde se define si se permite (pass) o se deniega, el origen ( ip o red &#8211; rango de puertos) y el destino (ip o red &#8211; rango de puertos) y si se activa el log. Más abajo podemos definir el  OS (sistema operativo) de origen del paquete a filtrar que esta permitido</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/Reglas_FW_pfsense_de_Capa_Aplicacion-2.jpg"><img class="aligncenter size-full wp-image-7747" title="Reglas_FW_pfsense_de_Capa_Aplicacion-2" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/Reglas_FW_pfsense_de_Capa_Aplicacion-2.jpg" alt="" width="392" height="215" /></a></p>
<p>También se puede definir el mecanismo de seguimiento de estado del flujo de datos, normalmente<strong> keep-state</strong> (para una regla a ciertos proxies conviene <strong>synproxy-state</strong>)</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/Reglas_FW_pfsense_de_Capa_Aplicacion-3.jpg"><img class="aligncenter size-full wp-image-7748" title="Reglas_FW_pfsense_de_Capa_Aplicacion-3" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/Reglas_FW_pfsense_de_Capa_Aplicacion-3.jpg" alt="" width="640" height="185" /></a></p>
<p style="text-align: left;">Y entre otras opciones, al final aparece el apartado <strong>Layer 7</strong> (capa 7), donde decidimos si a esta regla le aplicamos el <strong>deep packet inspection</strong> según el grupo de reglas de capa 7 que elijamos, previamente ya definido (en este ejmplo el grupo de capa 7: My7Rules, anteriormente creado)</p>
<p style="text-align: left;"> </p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/10/Reglas_FW_pfsense_de_Capa_Aplicacion-4.jpg"><img class="aligncenter size-full wp-image-7749" title="Reglas_FW_pfsense_de_Capa_Aplicacion-4" src="http://www.javcasta.com/blog/wp-content/uploads/2011/10/Reglas_FW_pfsense_de_Capa_Aplicacion-4.jpg" alt="" width="640" height="86" /></a></p>
<p style="text-align: left;">Salvamos, aplicamos cambios &#8230;</p>
<p>Y voila <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.javcasta.com%2F2011%2F10%2F03%2Fseguridad-pfsense-reglas-de-filtrado-de-capa-de-aplicacion-deep-packet-inspection%2F&amp;title=Seguridad%3A%20pfSense%20%26%238211%3B%20Reglas%20de%20filtrado%20de%20Capa%20de%20aplicaci%C3%B3n%20%26%238211%3B%20deep%20packet%20inspection" id="wpa2a_28"><img src="http://www.javcasta.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2011/10/03/seguridad-pfsense-reglas-de-filtrado-de-capa-de-aplicacion-deep-packet-inspection/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Seguridad: pfSense &#8211; Bloqueo de sitios web anulando entradas de DNS &#8211; Blocking websites with override DNS entries</title>
		<link>http://www.javcasta.com/2011/09/29/seguridad-pfsense-bloqueo-de-sitios-web-anulando-entradas-de-dns-blocking-websites-with-override-dns-entries/</link>
		<comments>http://www.javcasta.com/2011/09/29/seguridad-pfsense-bloqueo-de-sitios-web-anulando-entradas-de-dns-blocking-websites-with-override-dns-entries/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 20:13:47 +0000</pubDate>
		<dc:creator>javcasta</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[seguridad]]></category>
		<category><![CDATA[Sistemas]]></category>
		<category><![CDATA[soporte]]></category>

		<guid isPermaLink="false">http://www.javcasta.com/?p=7732</guid>
		<description><![CDATA[Referencia: http://doc.pfsense.org/index.php/Blocking_websites En la web de documentación de pfSense , te indican que para bloquear el acceso a una web se puede hacer por distintos métodos:  Usando DNS  Usando reglas del Firewall  Usando el proxy con filtro de contenido Squidguard  Previniendo saltarse el bloqueo por proxy &#8220;Prevent Bypassing of Blocking&#8221;: con servicios como OpenDNS La [...]]]></description>
			<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2011%2F09%2F29%2Fseguridad-pfsense-bloqueo-de-sitios-web-anulando-entradas-de-dns-blocking-websites-with-override-dns-entries%2F"></g:plusone><br /><p><!-- tweet id : 119505563989184512 --><style type='text/css'>#bbpBox_119505563989184512 a { text-decoration:none; color:#2FC2EF; }#bbpBox_119505563989184512 a:hover { text-decoration:underline; }</style><div id='bbpBox_119505563989184512' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#1a1b1f; background-image:url(http://a0.twimg.com/profile_background_images/234683216/leonTwitter.JPG); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#666666; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>Post: Seguridad: pfSense &#8211; Bloqueo de sitios web anulando entradas de DNS &#8211; Blocking websites with override DNS entries <a href="http://t.co/VHevpqpl" rel="nofollow">http://t.co/VHevpqpl</a></span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://www.javcasta.com/blog/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 29/09/2011 20:15' href='http://twitter.com/#!/javcasta/status/119505563989184512' target='_blank'>29/09/2011 20:15</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=119505563989184512' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=119505563989184512' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=119505563989184512' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=javcasta'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a2.twimg.com/profile_images/1316173538/avatar_normal.png' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=javcasta'>@javcasta</a><div style='margin:0; padding-top:2px'>Javier Casta&#241;&#243;n</div></div><div style='clear:both'></div></div></div><!-- end of tweet --><br />
<hr />
<p>Referencia:</p>
<p><a href="http://doc.pfsense.org/index.php/Blocking_websites" target="_blank">http://doc.pfsense.org/index.php/Blocking_websites</a></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/09/pfsense.jpg"><img class="aligncenter size-full wp-image-7738" title="pfsense" src="http://www.javcasta.com/blog/wp-content/uploads/2011/09/pfsense.jpg" alt="" width="336" height="90" /></a></p>
<p>En la web de documentación de<strong> pfSense</strong> , te indican que para<strong> bloquear el acceso a una web</strong> se puede hacer por distintos métodos:</p>
<blockquote><ol>
<li><span style="color: #888888;"><em> Usando DNS</em></span></li>
<li><span style="color: #888888;"><em> Usando reglas del Firewall</em></span></li>
<li><span style="color: #888888;"><em> Usando el proxy con filtro de contenido Squidguard</em></span></li>
<li><span style="color: #888888;"><em> Previniendo saltarse el bloqueo por proxy &#8220;Prevent Bypassing of Blocking&#8221;: con servicios como OpenDNS</em></span></li>
</ol>
</blockquote>
<p>La que más me ha gustado, por su sencillez y eficacia (<em><span style="color: #808080;"> make it easy</span></em> ) es la 1: <strong>Usando DNS</strong>.</p>
<p>Para ello debes tener activo el <strong>servicio DNS Forward</strong> en pfSense<br /> El servicio DNS Forward hace las <strong>funciones de proxy cache para las consultas y resoluciones DNS</strong>, por lo que en tus clientes de la <strong>LAN</strong> deben de apuntar como único servidor de DNS la ip LAN del firewall pfSense<br /> Y por supuesto debes tener configurado uno o dos servidores DNS en tu pfSense.</p>
<p>Para bloquear la web <strong>www.google.com</strong>:</p>
<p>En la gui de administración de pfSense &gt; <strong>Services</strong> &gt; <strong>DNS Forward</strong></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/09/blocking-website-pfsense-1.jpg"><img class="aligncenter size-full wp-image-7733" title="blocking-website-pfsense-1" src="http://www.javcasta.com/blog/wp-content/uploads/2011/09/blocking-website-pfsense-1.jpg" alt="" width="499" height="319" /></a></p>
<p>Añades un registro al final (Domain &#8211; IP ) que haga que www.google.com apunte a una ip no valida (como por ejemplo 169.254.x.x o 127.0.0.1 o 127.4.5.6)</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/09/blocking-website-pfsense-2.jpg"><img class="aligncenter size-full wp-image-7734" title="blocking-website-pfsense-2" src="http://www.javcasta.com/blog/wp-content/uploads/2011/09/blocking-website-pfsense-2.jpg" alt="" width="600" height="489" /></a></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/09/blocking-website-pfsense-3.jpg"><img class="aligncenter size-full wp-image-7735" title="blocking-website-pfsense-3" src="http://www.javcasta.com/blog/wp-content/uploads/2011/09/blocking-website-pfsense-3.jpg" alt="" width="628" height="227" /></a></p>
<p>Aplicas cambios</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/09/blocking-website-pfsense-4.jpg"><img class="aligncenter size-full wp-image-7736" title="blocking-website-pfsense-4" src="http://www.javcasta.com/blog/wp-content/uploads/2011/09/blocking-website-pfsense-4.jpg" alt="" width="547" height="272" /></a></p>
<p>Y comprobamos si se resuelve www.google.com desde un host de la LAN, por ejemplo desde un win, haciendo un nslookup a www.google.com</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2011/09/blocking-website-pfsense-5.jpg"><img class="aligncenter size-full wp-image-7737" title="blocking-website-pfsense-5" src="http://www.javcasta.com/blog/wp-content/uploads/2011/09/blocking-website-pfsense-5.jpg" alt="" width="474" height="192" /></a></p>
<p>Y efectivamente, no resuelve.</p>
<p>Esta tecnica se podria usar en un windows añadiendo entradas incorrectas en el fichero:</p>
<blockquote><p><span style="color: #ff6600;"><em>%SystemRoot%\System32\drivers\etc\<span style="color: #0000ff;">hosts</span></em></span></p>
</blockquote>
<p>Por defecto un windows resuelve un dominio o nombre de hosts consultando antes este fichero que haciendo una consulta al servidor dns.<br />Y de hecho los &#8220;<em>bad boys</em>&#8221; usan esta sencilla técnica de modificar el fichero<strong> hosts</strong> para hacer un <strong>spoofing de dns</strong> y redirigir el trafico del pc de la victima desde una web aparentemente legitima a una falsa &#8230;</p>
<p>Y voila <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.javcasta.com%2F2011%2F09%2F29%2Fseguridad-pfsense-bloqueo-de-sitios-web-anulando-entradas-de-dns-blocking-websites-with-override-dns-entries%2F&amp;title=Seguridad%3A%20pfSense%20%26%238211%3B%20Bloqueo%20de%20sitios%20web%20anulando%20entradas%20de%20DNS%20%26%238211%3B%20Blocking%20websites%20with%20override%20DNS%20entries" id="wpa2a_30"><img src="http://www.javcasta.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2011/09/29/seguridad-pfsense-bloqueo-de-sitios-web-anulando-entradas-de-dns-blocking-websites-with-override-dns-entries/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

