<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosurestitles.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemtitles.css"?><rss 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/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>El Camello, el León y el niño. O la evolución del perro al lobo</title>
	
	<link>http://www.javcasta.com</link>
	<description>Blog de Javier Castañón - JavCasta</description>
	<lastBuildDate>Sun, 21 Apr 2013 17:53:26 +0000</lastBuildDate>
	<language>en-US</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" />
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" /><feedburner:info uri="elcamelloelleonyelnioolaevolucindelperroallobo" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><media:copyright>Built by JavCasta 2.009</media:copyright><media:thumbnail url="http://javcasta.com/imagenes/mandy_transp.jpeg" /><media:keywords>ciencia,zen,técnico,sistemas,script,informática,currículum,aforismos,literatura,filosofía,linux,windows</media:keywords><media:category scheme="http://www.itunes.com/dtds/podcast-1.0.dtd">Arts</media:category><itunes:owner><itunes:email>fj.castanon@gmail.com</itunes:email><itunes:name>Javier Castañón</itunes:name></itunes:owner><itunes:author>Javier Castañón</itunes:author><itunes:explicit>no</itunes:explicit><itunes:image href="http://javcasta.com/imagenes/mandy_transp.jpeg" /><itunes:keywords>ciencia,zen,técnico,sistemas,script,informática,currículum,aforismos,literatura,filosofía,linux,windows</itunes:keywords><itunes:subtitle>Evolución del perro al lobo</itunes:subtitle><itunes:summary>El camello, el Leon y el niño. O la evolución del perro al lobo</itunes:summary><itunes:category text="Arts" /><geo:lat>28.1</geo:lat><geo:long> -15.4167</geo:long><creativeCommons:license>http://creativecommons.org/licenses/by-sa/3.0/</creativeCommons:license><image><link>http://creativecommons.org/licenses/by-sa/3.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image><feedburner:emailServiceId>ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://www.podnova.com/add.srf?url=http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://www.podnova.com/img_chicklet_podnova.gif">Subscribe with Podnova</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://odeo.com/listen/subscribe?feed=http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://odeo.com/img/badge-channel-black.gif">Subscribe with ODEO</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsalloy.com/?rss=http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://www.newsalloy.com/subrss3.gif">Subscribe with NewsAlloy</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare href="http://download.attensa.com/app/get_attensa.html?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://www.attensa.com/blogs/attensa/WindowsLiveWriter/BadgeredintoBadges_10C02/attensa_feed_button5.gif">Subscribe with Attensa for Outlook</feedburner:feedFlare><feedburner:feedFlare href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare href="http://www.flurry.com/pushRssFeed.do?r=fb&amp;url=http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://www.flurry.com/images/flurry_rss_logo2.gif">Subscribe with Flurry</feedburner:feedFlare><feedburner:feedFlare href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2FElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><feedburner:browserFriendly>Lista de posts</feedburner:browserFriendly><item>
		<title>PowerShell Script – Operaciones-con-Router-ComTrend.ps1 y Modulo Like-a-Zenity.psm1 para dotar de GUI</title>
		<link>http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~3/q10XCHotT2s/</link>
		<comments>http://www.javcasta.com/2013/04/21/powershell-script-operaciones-con-router-comtrend-ps1-y-modulo-like-a-zenity-psm1-para-dotar-de-gui/#comments</comments>
		<pubDate>Sun, 21 Apr 2013 17:45:38 +0000</pubDate>
		<dc:creator>fj.castanon@gmail.com (Javier Castañón)</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=8148</guid>
		<description><![CDATA[Referencias: http://poshcode.org/2683 http://technet.microsoft.com/en-us/library/ff730952.aspx http://technet.microsoft.com/en-us/library/ff730941.aspx PowerShell viene a ser un interprete de comandos de una shell cmd que interactua con objetos .Net Por lo que para dotar de GUI (Interfaz visual gráfico) a los scripts, se puede implementar con objetos de .Net ( System.Windows.Forms.Form , System.Windows.Forms.Button, &#8230; label, textBox, richtextbox, etc) Para ello creo un módulo: [...]]]></description>
				<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2013%2F04%2F21%2Fpowershell-script-operaciones-con-router-comtrend-ps1-y-modulo-like-a-zenity-psm1-para-dotar-de-gui%2F"></g:plusone><br /><p><!-- tweet id : 326028646630428672 --><style type='text/css'>#bbpBox_326028646630428672 a { text-decoration:none; color:#2FC2EF; }#bbpBox_326028646630428672 a:hover { text-decoration:underline; }</style><div id='bbpBox_326028646630428672' 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;'>PowerShell Script - Operaciones-con-Router-ComTrend.ps1 y Modulo Like-a-Zenity.psm1 para dotar de GUI <a href="http://t.co/okUEydlpqg" rel="nofollow">http://t.co/okUEydlpqg</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 21/04/2013 17:44' href='http://twitter.com/#!/javcasta/status/326028646630428672' target='_blank'>21/04/2013 17:44</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=326028646630428672' 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=326028646630428672' 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=326028646630428672' 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://a0.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>Referencias:</strong></span></p>
<ul>
<li><a href="http://poshcode.org/2683" target="_blank">http://poshcode.org/2683</a></li>
<li><a href="http://technet.microsoft.com/en-us/library/ff730952.aspx" target="_blank"> http://technet.microsoft.com/en-us/library/ff730952.aspx</a></li>
<li><a href="http://technet.microsoft.com/en-us/library/ff730941.aspx" target="_blank"> http://technet.microsoft.com/en-us/library/ff730941.aspx</a></li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/04/OperacionesComtrend-1.jpg"><img class="aligncenter size-full wp-image-8155" alt="OperacionesComtrend-1" src="http://www.javcasta.com/blog/wp-content/uploads/2013/04/OperacionesComtrend-1.jpg" width="502" height="500" /></a></p>
<p><strong>PowerShell</strong> viene a ser un interprete de comandos de una<strong> shell cmd</strong> que interactua con <strong>objetos .Net</strong> Por lo que para dotar de <strong>GUI</strong> (Interfaz visual gráfico) a los<strong> scripts</strong>, se puede implementar con objetos de .Net (<span style="color: #888888;"> System.Windows.Forms.Form , System.Windows.Forms.Button, &#8230; label, textBox, richtextbox</span>, etc)</p>
<p>Para ello creo un <strong>módulo</strong>: <strong>Like-a-Zenity.psm1</strong></p>
<p>Este módulo tiene las funciones:</p>
<ul>
<li>-<strong> flogin</strong>: formulario de login (usuario, clave, servidor)</li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/04/flogin.jpg"><img class="aligncenter size-full wp-image-8152" alt="flogin" src="http://www.javcasta.com/blog/wp-content/uploads/2013/04/flogin.jpg" width="300" height="250" /></a></p>
<ul>
<li>-<strong> ftextbox</strong>: Formulario con textbox con opción de texto plano o password</li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/04/ftextbox.jpg"><img class="aligncenter size-full wp-image-8151" alt="ftextbox" src="http://www.javcasta.com/blog/wp-content/uploads/2013/04/ftextbox.jpg" width="314" height="234" /></a></p>
<ul>
<li>-<strong> fcalendario</strong>: Formulario con calendario</li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/04/fcalendario.jpg"><img class="aligncenter size-full wp-image-8150" alt="fcalendario" src="http://www.javcasta.com/blog/wp-content/uploads/2013/04/fcalendario.jpg" width="355" height="241" /></a></p>
<ul>
<li>- <strong>fnotificacion</strong>: notificaciones en la barra de tareas</li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/04/OperacionesComtrend-2.jpg"><img class="aligncenter size-full wp-image-8154" alt="OperacionesComtrend-2" src="http://www.javcasta.com/blog/wp-content/uploads/2013/04/OperacionesComtrend-2.jpg" width="365" height="270" /></a></p>
<ul>
<li>- <strong>fmessagebox</strong>: un MessageBox</li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/04/OperacionesComtrend-4.jpg"><img src="http://www.javcasta.com/blog/wp-content/uploads/2013/04/OperacionesComtrend-4.jpg" alt="OperacionesComtrend-4" width="251" height="154" class="aligncenter size-full wp-image-8153" /></a></p>
<ul>
<li>- <strong>fRichTextBox</strong>: Formulario con un richtextBox</li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/04/fRichTextBox.jpg"><img class="aligncenter size-full wp-image-8149" alt="fRichTextBox" src="http://www.javcasta.com/blog/wp-content/uploads/2013/04/fRichTextBox.jpg" width="298" height="300" /></a></p>
<p>El código del módulo<strong> Like-a-Zenity.psm1</strong></p>
<pre class="brush: bash; title: ; notranslate">
&lt;#
############################################################
#         PowerShell Modulo: Like-a-Zenity.psm1            #
############################################################
#      Modulo para dotar de GUI a los Scripts              #
#   By Javier Castañón - http://javcasta.com/ - 2.013      #
############################################################
# Referencias:                                             #
# http://technet.microsoft.com/en-us/library/ff730952.aspx #
# http://technet.microsoft.com/en-us/library/ff730941.aspx #
############################################################
#&gt;
 
#$ErrorActionPreference = &quot;silentlycontinue&quot;
$ErrorActionPreference = &quot;Inquire&quot;
Clear-Host
[void] [System.Reflection.Assembly]::LoadWithPartialName(&quot;System.Windows.Forms&quot;)
[void] [System.Reflection.Assembly]::LoadWithPartialName(&quot;System.Drawing&quot;)
#$camino =  Split-Path -Parent $MyInvocation.MyCommand.Path

function flogin {
    $usuario = &quot;&quot;
    $clave = &quot;&quot;

    $objForm = New-Object System.Windows.Forms.Form 
    $objForm.Text = &quot;Login&quot;
    $objForm.Size = New-Object System.Drawing.Size(300,250) 
    $objForm.StartPosition = &quot;CenterScreen&quot;

    $objForm.KeyPreview = $True
    $objForm.Add_KeyDown({if ($_.KeyCode -eq &quot;Enter&quot;) 
        {$x=$objTextBox.Text;$y=$objTextBox2.Text;$z=$objTextBox3.Text;$objForm.Close()}})
    $objForm.Add_KeyDown({if ($_.KeyCode -eq &quot;Escape&quot;) 
        {$objForm.Close()}})

    $OKButton = New-Object System.Windows.Forms.Button
    $OKButton.Location = New-Object System.Drawing.Size(75,190)
    $OKButton.Size = New-Object System.Drawing.Size(75,23)
    $OKButton.Text = &quot;OK&quot;
    $OKButton.Add_Click({$x=$objTextBox.Text;$y=$objTextBox2.Text;$z=$objTextBox3.Text;$objForm.Close()})
    $objForm.Controls.Add($OKButton)

    $CancelButton = New-Object System.Windows.Forms.Button
    $CancelButton.Location = New-Object System.Drawing.Size(150,190)
    $CancelButton.Size = New-Object System.Drawing.Size(75,23)
    $CancelButton.Text = &quot;Cancelar&quot;
    $CancelButton.Add_Click({$objForm.Close()})
    $objForm.Controls.Add($CancelButton)

    $objLabel = New-Object System.Windows.Forms.Label
    $objLabel.Location = New-Object System.Drawing.Size(10,20) 
    $objLabel.Size = New-Object System.Drawing.Size(280,20) 
    $objLabel.Text = &quot;Usuario:&quot;
    $objLabel2 = New-Object System.Windows.Forms.Label
    $objLabel2.Location = New-Object System.Drawing.Size(10,70) 
    $objLabel2.Size = New-Object System.Drawing.Size(280,20) 
    $objLabel2.Text = &quot;Clave:&quot;
    $objLabel3 = New-Object System.Windows.Forms.Label
    $objLabel3.Location = New-Object System.Drawing.Size(10,120) 
    $objLabel3.Size = New-Object System.Drawing.Size(280,20) 
    $objLabel3.Text = &quot;Servidor:&quot;
    $objForm.Controls.Add($objLabel) 
    $objForm.Controls.Add($objLabel2) 
    $objForm.Controls.Add($objLabel3) 

    $objTextBox = New-Object System.Windows.Forms.TextBox 
    $objTextBox.Location = New-Object System.Drawing.Size(10,40) 
    $objTextBox.Size = New-Object System.Drawing.Size(260,20) 
    $objTextBox2 = New-Object System.Windows.Forms.TextBox 
    $objTextBox2.Location = New-Object System.Drawing.Size(10,90) 
    $objTextBox2.Size = New-Object System.Drawing.Size(260,20) 
    $objTextBox2.PasswordChar = '*'
    $objTextBox3 = New-Object System.Windows.Forms.TextBox 
    $objTextBox3.Location = New-Object System.Drawing.Size(10,140) 
    $objTextBox3.Size = New-Object System.Drawing.Size(260,20) 
    ########## PERSONALIZAR ######################
    $objTextBox.Text = &quot;admin&quot;
    $objTextBox2.Text = &quot;1234&quot;
    $objTextBox3.Text = &quot;192.168.1.1&quot;
    ########## ############ ######################
    $objForm.Controls.Add($objTextBox) 
    $objForm.Controls.Add($objTextBox2)
    $objForm.Controls.Add($objTextBox3)

    $objForm.Topmost = $True

    $objForm.Add_Shown({$objForm.Activate()})
    [void] $objForm.ShowDialog()
    #return 
    $usuario = $objTextBox.Text; $clave = $objTextBox2.Text; $servidor = $objTextBox3.Text
    return $usuario + &quot;`n&quot; + $clave + &quot;`n&quot; + $servidor
     
}

function ftextbox {
    
    # ref http://technet.microsoft.com/en-us/library/ff730941.aspx
    # argumentos: 0 = titulo, 1 = etiqueta textbox, 2 = Es password: true | false
    $objForm = New-Object System.Windows.Forms.Form 
    $objForm.Text = $Args[0]
    $objForm.Size = New-Object System.Drawing.Size(300,200) 
    $objForm.StartPosition = &quot;CenterScreen&quot;

    $objForm.KeyPreview = $True
    $objForm.Add_KeyDown({if ($_.KeyCode -eq &quot;Enter&quot;) 
        {$x=$objTextBox.Text;$objForm.Close()}})
    $objForm.Add_KeyDown({if ($_.KeyCode -eq &quot;Escape&quot;) 
        {$objForm.Close()}})

    $OKButton = New-Object System.Windows.Forms.Button
    $OKButton.Location = New-Object System.Drawing.Size(75,120)
    $OKButton.Size = New-Object System.Drawing.Size(75,23)
    $OKButton.Text = &quot;OK&quot;
    $OKButton.Add_Click({$objForm.Close()})
    $objForm.Controls.Add($OKButton)

    $CancelButton = New-Object System.Windows.Forms.Button
    $CancelButton.Location = New-Object System.Drawing.Size(150,120)
    $CancelButton.Size = New-Object System.Drawing.Size(75,23)
    $CancelButton.Text = &quot;Cancelar&quot;
    $CancelButton.Add_Click({$objForm.Close()})
    $objForm.Controls.Add($CancelButton)

    $objLabel = New-Object System.Windows.Forms.Label
    $objLabel.Location = New-Object System.Drawing.Size(10,20) 
    $objLabel.Size = New-Object System.Drawing.Size(280,20) 
    $objLabel.Text = $Args[1]
    $objForm.Controls.Add($objLabel) 

    $objTextBox = New-Object System.Windows.Forms.TextBox 
    $objTextBox.Location = New-Object System.Drawing.Size(10,40) 
    $objTextBox.Size = New-Object System.Drawing.Size(260,20) 
    if ($Args[2] -eq &quot;true&quot;) { $objTextBox.PasswordChar = '*'}
    $objForm.Controls.Add($objTextBox) 

    $objForm.Topmost = $True

    $objForm.Add_Shown({$objForm.Activate()})
    [void] $objForm.ShowDialog()
    return $objTextBox.Text
     
}

function fcalendario {
    $objForm = New-Object Windows.Forms.Form 
    $objForm.Text = &quot;Seleccione fecha y pulse OK/intro&quot; 
    $objForm.Size = New-Object Drawing.Size @(340,200) 
    $objForm.StartPosition = &quot;CenterScreen&quot;
    $objForm.KeyPreview = $True
    $objForm.Add_KeyDown({
        if ($_.KeyCode -eq &quot;Enter&quot;) 
            {
                $objForm.Close();
            }
        })

    $objForm.Add_KeyDown({
        if ($_.KeyCode -eq &quot;Escape&quot;) 
            {
                $objForm.Close()
            }
        })
        
    $objCalendar = New-Object System.Windows.Forms.MonthCalendar 
    $objCalendar.ShowTodayCircle = $False
    $objCalendar.MaxSelectionCount = 1   
    $objForm.Controls.Add($objCalendar) 

    $OKButton = New-Object System.Windows.Forms.Button
    $OKButton.Location = New-Object System.Drawing.Size(240,70)
    $OKButton.Size = New-Object System.Drawing.Size(75,23)
    $OKButton.Text = &quot;OK&quot;
    $OKButton.Add_Click({$objForm.Close()})    
    $objForm.Controls.Add($OKButton)
    
    $objForm.Topmost = $True

    $objForm.Add_Shown({$objForm.Activate()})  
    [void] $objForm.ShowDialog()
    
    return (Get-Date ($objCalendar.SelectionEnd.Date) -Format dd/MM/yyyy).ToString()
}

function fnotificacion {
    # ref http://technet.microsoft.com/en-us/library/ff730952.aspx
    #Argumentos: 0 = tipo (Error, Warning, Info, None), 1 = mensaje, 2 = titulo, 3 = tiempo en msg
    $objNotifyIcon = New-Object System.Windows.Forms.NotifyIcon 
    #$camino =  Split-Path -Parent $MyInvocation.MyCommand.Path
    $objNotifyIcon.Icon = [System.Drawing.SystemIcons]::Information
    $objNotifyIcon.BalloonTipIcon = $Args[0] # Error, Warning, Info, None
    $objNotifyIcon.BalloonTipText = $Args[1] # mensaje&quot; 
    $objNotifyIcon.BalloonTipTitle = $Args[2] # titulo
    $objNotifyIcon.Visible = $True 
    $objNotifyIcon.ShowBalloonTip([int] $Args[3]) # delay
    [Threading.Thread]::Sleep([int] $Args[3])
    $objNotifyIcon.Dispose()
}

function fmessageBox {
    #Argumentos: 0 = mensaje, 1 = titulo, 2 = tipo boton (OK, OKCancel, AbortRetryIgnore, YesNoCancel, YesNo, RetryCancel)
    [System.Windows.Forms.MessageBox]::Show($args[0],$args[1],$args[2])
}

function fRichTextBox {
    #argumentos: 0 = titulo, 1 = texto
    $objForm = New-Object System.Windows.Forms.Form 
    $objForm.Text = $Args[0]
    $objForm.Size = New-Object System.Drawing.Size(300,300) 
    $objForm.StartPosition = &quot;CenterScreen&quot;

    $OKButton = New-Object System.Windows.Forms.Button
    $OKButton.Location = New-Object System.Drawing.Size(55,240)
    $OKButton.Size = New-Object System.Drawing.Size(175,23)
    $OKButton.Text = &quot;Cerrar y copiar al portapapeles&quot;
    $OKButton.Add_Click({
        $copiar = $richTextBox1.Text
        [Windows.Forms.Clipboard]::SetText($copiar)
        $objForm.Close()})
    $objForm.Controls.Add($OKButton)

    $richTextBox1 = New-Object System.Windows.Forms.RichTextBox
    $System_Drawing_Point = New-Object System.Drawing.Point
    $System_Drawing_Point.X = 10
    $System_Drawing_Point.Y = 20
    $richTextBox1.Location = $System_Drawing_Point
    $richTextBox1.Name = &quot;richTextBox1&quot;
    $System_Drawing_Size = New-Object System.Drawing.Size
    $System_Drawing_Size.Height = 200
    $System_Drawing_Size.Width = 255
    $richTextBox1.Size = $System_Drawing_Size
    $richTextBox1.Text = $Args[1]
    $objForm.Controls.Add($richTextBox1) 

    $objForm.Topmost = $True

    $objForm.Add_Shown({$objForm.Activate()})
    [void] $objForm.ShowDialog()
    $copiar = $richTextBox1.Text

}
</pre>
<p>La función flogin o el formulario de login (flogin) con los campos: usuario, clave y servidor, lo usaré para obtener los parámetros de validación de sesión vía telnet contra un router ComTrend</p>
<p>El cliente telnet en PowerShell lo he obtenido de <a href="http://poshcode.org/2683" target="_blank">http://poshcode.org/2683</a> , con apenas modificaciones</p>
<p>El código del módulo <strong>clienteTelnet.psm1</strong></p>
<pre class="brush: bash; title: ; notranslate">
# ref http://poshcode.org/2683
$ErrorActionPreference = &quot;SilentlyContinue&quot;
 function read-stream ([System.Net.Sockets.NetworkStream]$stream,[String]$expect = &quot;&quot;)
    {
            $buffer = new-object system.byte[] 1024
            $enc = new-object system.text.asciiEncoding
     
            ## Read all the data available from the stream, writing it to the
            ## screen when done.
     
            ## Allow data to buffer
            start-sleep -m 100
            $output = &quot;&quot;
            while($stream.DataAvailable -or $output -notmatch $expect)
            {  
                    $read = $stream.Read($buffer, 0, 1024)    
                    $output = &quot;$output$($enc.GetString($buffer, 0, $read))&quot;
                    ## Allow data to buffer for a bit
                    start-sleep -m 100
            }
            $output.split(&quot;`n&quot;)
    }
     
    function send-command ([String]$hostname,
                    [String]$User,
            [parameter(position=2,Mandatory=$true)][validatenotnull()]
                    [String]$Password,
            [parameter(position=3,Mandatory=$true,valuefrompipeline=$true)][validatenotnull()]
                    [String]$InputObject,
                    [string]$Expect = &quot;&quot;)
    {
            begin
            {
                   
                    $sock = new-object system.net.sockets.tcpclient($hostname,23)
                    $str = $sock.GetStream()
                    $wrt = new-object system.io.streamwriter($str)
                   
                    read-stream($str)
                    $wrt.writeline($user)
                    $wrt.flush()
                    read-stream($str)
                    $wrt.writeline($password)
                    $wrt.flush()
                    read-stream($str, $expect)
                    #read-stream($str, '&gt;')
            }
            process
            {
                    $wrt.writeline($InputObject)
                    $wrt.flush()
                    read-stream($str, $expect)
                    #read-stream($str, '&gt;')
            }
            end
            {
                    #$wrt.writeline(&quot;exit&quot;)
                    start-sleep -m 3000
                    $wrt.writeline(&quot;logout&quot;)
                    $wrt.flush()
                    read-stream($str)
     
                    ## Close the streams
                    $wrt.Close()
                    $str.Close()
                    $sock.close()
            }
    }
    
</pre>
<p>El script <strong>Operaciones-con-Router-ComTrend.ps1</strong> obtiene con flogin los parametros para efectuar el login contra el router Y ejecuta una serie de comandos vía la función send-command del módulo <strong>clienteTelnet.psm1</strong>:</p>
<blockquote><p><span style="color: #ff9900;">send-command -hostname &#8220;$servidor&#8221; -user &#8220;$usuario&#8221; -password &#8220;$clave&#8221; &#8220;$comando&#8221;</span></p></blockquote>
<p>Los comandosdel <strong>ComTrend</strong> usados son:</p>
<ul>
<li>&#8220;<strong>adsl info</strong>&#8221; : para obtener la velocidad de subida y bajada</li>
<li>&#8220;<strong>wan show</strong>&#8221; : para obtener la IP pública del router</li>
<li>&#8220;<strong>voice stop</strong>&#8221; : para parar el cliente VoIP del router</li>
<li>&#8220;<strong>reboot</strong>&#8221; : para reiniciar el router, en caso de contestar si al fmessageBox</li>
</ul>
<p>El código del script <strong>Operaciones-con-Router-ComTrend.ps1</strong></p>
<pre class="brush: bash; title: ; notranslate">
&lt;#
##########################################################
# PowerShell Script: Operaciones-con-Router-Comtrend.ps1 #
##########################################################
   # Test de modulos:                                  #
   # - Like-a-Zenity.psm1                              #
   # - clienteTelnet.psm1                              #
   #####################################################
   # By Javier Castañón - http://javcasta.com/ - 2.013 #
   #####################################################
   # Uso: PS &gt; .\Operaciones-con-Router-Comtrend.ps1   #
   #####################################################
#&gt;
Import-Module .\modulos\Like-a-Zenity.psm1
Import-Module .\modulos\clienteTelnet.psm1

Function ExtractValidIPAddress($String){
    # ref https://chrisjwarwick.wordpress.com/2012/09/16/more-regular-expressions-regex-for-ip-v4-addresses/
    $IPregex=‘(?&lt;Address&gt;((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))’
    If ($String -Match $IPregex) {$Matches.Address}
} 

# router ComTrend Usuario ,pass, IP
$usuario = &quot;&quot;;$clave = &quot;&quot;;$servidor = &quot;&quot;
$login = flogin
if ($login -eq $null -or $login -eq &quot;`n`n&quot;) {
    Write-Host &quot;Faltan parametros ... salimos&quot;
    exit 0
}

$aux = $login.Split(&quot;`n&quot;)
$usuario = $aux[0]
$clave = $aux[1]
$servidor = $aux[2]

#$ErrorActionPreference = &quot;SilentlyContinue&quot;
$ErrorActionPreference = &quot;Inquire&quot;

# Obtenemos velocidad de bajada y subida con &quot;adsl info&quot;
[string] $salida = send-command -hostname &quot;$servidor&quot; -user &quot;$usuario&quot; -password &quot;$clave&quot; &quot;adsl info&quot;
 $salida = $salida.Trim(&quot;`n&quot;)
if ($salida.Contains(&quot;Upstream rate = &quot;) -or $salida.Contains(&quot;Downstream rate = &quot;)) {
    $posUp = $salida.IndexOf(&quot;Upstream rate&quot;)
    $posDown = $salida.IndexOf(&quot;Downstream rate&quot;)
    $subida = $salida.Substring($posUp, 25)
    $bajada = $salida.Substring($posDown, 26)
    Write-Host $subida
    Write-Host $bajada
    fnotificacion &quot;info&quot; &quot;$subida`n$bajada&quot; &quot;Velocidad de Subida / Bajada&quot; &quot;3500&quot;
}
# Obtenemos IP wan con &quot;wan show&quot;
[string] $salida = send-command -hostname &quot;$servidor&quot; -user &quot;$usuario&quot; -password &quot;$clave&quot; &quot;wan show&quot;
$salida = $salida.Trim(&quot;`n&quot;)
if ($salida.Contains(&quot;logout&quot;)) {
    $pos = $salida.IndexOf(&quot;logout&quot;) - 22
    $laip = ExtractValidIPAddress($salida.Substring($pos, 20))
    write-host &quot;IP = &quot; $laip
    fnotificacion &quot;info&quot; &quot;$laip&quot; &quot;IP Wan&quot; &quot;3500&quot;
}

# Paramos cliente VoIP - si el router comtrend no soporta VoIP (Vodsl SIP) no pasa nada, solo dara un error de sintaxis
[string] $salida = send-command -hostname &quot;$servidor&quot; -user &quot;$usuario&quot; -password &quot;$clave&quot; &quot;voice stop&quot;
fRichTextBox &quot;Voice Stop&quot; $salida

# ¿Reiniciamos router?
$reiniciar = fmessageBox &quot;¿Reiniciamos el Router?&quot; &quot;Responda SI o NO&quot; &quot;YesNo&quot;
switch($reiniciar){
    &quot;Yes&quot; { 
        [string] $salida = send-command -hostname &quot;$servidor&quot; -user &quot;$usuario&quot; -password &quot;$clave&quot; &quot;reboot&quot;
        #Write-Host $salida
        Write-Host &quot;Ha respondido: Si, reinicimaos router&quot; -ForegroundColor Green
        fnotificacion &quot;Warning&quot; &quot;Ha respondido: Si, reiniciamos router&quot; &quot;Notificacion&quot; &quot;2500&quot;
        }
    &quot;No&quot; { 
        Write-Host &quot;Ha respondido: No, no se reinicia el router&quot; -ForegroundColor Yellow
        fnotificacion &quot;info&quot; &quot;Ha respondido: No, no se reinicia el router&quot; &quot;Notificacion&quot; &quot;1500&quot;
        }
}
</pre>
<p>Nota: Una buena herramienta (free) para diseñar GUIs en PowerShell es:</p>
<p><span style="color: #808080;">SAPIEN Technologies PrimalForms (Community Edition) v1.0.10.0</span></p>
<p>Si te das de alta en su página, <a href="http://www.sapien.com/auth/register" target="_blank">http://www.sapien.com/auth/register</a> , podrás descargarlo.</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%2F2013%2F04%2F21%2Fpowershell-script-operaciones-con-router-comtrend-ps1-y-modulo-like-a-zenity-psm1-para-dotar-de-gui%2F&amp;title=PowerShell%20Script%20%E2%80%93%20Operaciones-con-Router-ComTrend.ps1%20y%20Modulo%20Like-a-Zenity.psm1%20para%20dotar%20de%20GUI" 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><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=q10XCHotT2s:pJGOQvZs4ew:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=q10XCHotT2s:pJGOQvZs4ew:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=q10XCHotT2s:pJGOQvZs4ew:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=q10XCHotT2s:pJGOQvZs4ew:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=q10XCHotT2s:pJGOQvZs4ew:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=q10XCHotT2s:pJGOQvZs4ew:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=q10XCHotT2s:pJGOQvZs4ew:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=q10XCHotT2s:pJGOQvZs4ew:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=q10XCHotT2s:pJGOQvZs4ew:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=q10XCHotT2s:pJGOQvZs4ew:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=q10XCHotT2s:pJGOQvZs4ew:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=q10XCHotT2s:pJGOQvZs4ew:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=q10XCHotT2s:pJGOQvZs4ew:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=q10XCHotT2s:pJGOQvZs4ew:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=q10XCHotT2s:pJGOQvZs4ew:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=q10XCHotT2s:pJGOQvZs4ew:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=q10XCHotT2s:pJGOQvZs4ew:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=q10XCHotT2s:pJGOQvZs4ew:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~4/q10XCHotT2s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2013/04/21/powershell-script-operaciones-con-router-comtrend-ps1-y-modulo-like-a-zenity-psm1-para-dotar-de-gui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javcasta.com/2013/04/21/powershell-script-operaciones-con-router-comtrend-ps1-y-modulo-like-a-zenity-psm1-para-dotar-de-gui/</feedburner:origLink></item>
		<item>
		<title>PowerShell script – IPreputation.ps1 – Analizador de reputación de IPs remotas con IPVoid.com de NoVirusThanks</title>
		<link>http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~3/Y2qBGAGvWSE/</link>
		<comments>http://www.javcasta.com/2013/04/09/powershell-script-ipreputation-ps1-analizador-de-reputacion-de-ips-remotas-con-ipvoid-com-de-novirusthanks/#comments</comments>
		<pubDate>Tue, 09 Apr 2013 08:27:39 +0000</pubDate>
		<dc:creator>fj.castanon@gmail.com (Javier Castañón)</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[html]]></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=8145</guid>
		<description><![CDATA[Referencias: http://www.ipvoid.com/ http://www.novirusthanks.org/ IPreputattion.ps1 : Script en PowerShell para obtener la reputación de las IPs remotas a las que se conecta una máquina bajo windows. En el script se obtienen las conexiones a IPs remotas mediante netstat y se consulta vía http (método POST) al servicio web http://www.ipvoid.com/ la reputación de la IP. IPVoid.com is a [...]]]></description>
				<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2013%2F04%2F09%2Fpowershell-script-ipreputation-ps1-analizador-de-reputacion-de-ips-remotas-con-ipvoid-com-de-novirusthanks%2F"></g:plusone><br /><p><!-- tweet id : 321540550970982400 --><style type='text/css'>#bbpBox_321540550970982400 a { text-decoration:none; color:#2FC2EF; }#bbpBox_321540550970982400 a:hover { text-decoration:underline; }</style><div id='bbpBox_321540550970982400' 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;'>PS script IPreputation.ps1 - Analizador reputaci&#243;n IPs remotas con <a href="http://t.co/zwne2nCb9V" rel="nofollow">http://t.co/zwne2nCb9V</a> de NoVirusThanks <a href="http://t.co/TjDPOLpZ33" rel="nofollow">http://t.co/TjDPOLpZ33</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 09/04/2013 08:30' href='http://twitter.com/#!/javcasta/status/321540550970982400' target='_blank'>09/04/2013 08:30</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=321540550970982400' 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=321540550970982400' 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=321540550970982400' 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://a0.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.ipvoid.com/" target="_blank">http://www.ipvoid.com/</a></li>
<li><a href="http://www.novirusthanks.org/" target="_blank">http://www.novirusthanks.org/</a></li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/04/IPreputation-1.jpg"><img class="aligncenter size-full wp-image-8146" alt="IPreputation-1" src="http://www.javcasta.com/blog/wp-content/uploads/2013/04/IPreputation-1.jpg" width="650" height="461" /></a></p>
<p>IPreputattion.ps1 : <strong>Script en PowerShell</strong> para obtener la <strong>reputación de las IPs remotas</strong> a las que se conecta una máquina bajo windows.</p>
<p>En el script se obtienen las conexiones a IPs remotas mediante <strong>netstat</strong> y se consulta vía http (método POST) al servicio web <a href="http://www.ipvoid.com/" target="_blank">http://www.ipvoid.com/</a> la reputación de la IP.</p>
<blockquote><p><em><span style="color: #888888;">IPVoid.com is a free service developed by <a href="http://www.novirusthanks.org/" target="_blank">NoVirusThanks Company Srl</a> that allows users to scan an IP address with multiple IP reputation engines and DNS based blacklists to facilitate the detection of possible dangerous IP addresses, used for spam campaigns or related to the distribution of malware and spyware</span></em></p>
</blockquote>
<p>Este servicio web ( <a href="http://www.ipvoid.com/" target="_blank">http://www.ipvoid.com/</a> ) obtiene la reputación de la IP consultando  sobre un total de unos 38 servicios de reputación y/o <strong>DNSBL</strong> (DNS Blacklist)</p>
<p>Por ejemplo, para la IP 220.161.148.178: El servicio nos muestra 6 detecciones o positivos:  <a href="http://www.ipvoid.com/scan/220.161.148.178/" target="_blank">http://www.ipvoid.com/scan/220.161.148.178/</a> </p>
<blockquote><p>&nbsp;</p>
<table>
<thead>
<tr>
<th width="220">Engine</th>
<th width="250">Status</th>
<th>Info</th>
</tr>
</thead>
<tbody>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.blocklist.de" /> BlockList_de</td>
<td><img title="Detected!" alt="Alert" src="http://www.ipvoid.com/images/alert.ico" /> <span style="color: red;">DETECTED</span></td>
<td><a title="View more details" href="http://www.blocklist.de/en/view.html?ip=220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.spamhaus.org" /> Spamhaus</td>
<td><img title="Detected!" alt="Alert" src="http://www.ipvoid.com/images/alert.ico" /> <span style="color: red;">DETECTED</span></td>
<td><a title="View more details" href="http://www.spamhaus.org/query/ip/220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.mywot.com" /> MyWOT</td>
<td><img title="Detected!" alt="Alert" src="http://www.ipvoid.com/images/alert.ico" /> <span style="color: red;">DETECTED</span></td>
<td><a title="View more details" href="http://www.mywot.com/en/scorecard/220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=cbl.abuseat.org" /> CBL_AbuseAt</td>
<td><img title="Detected!" alt="Alert" src="http://www.ipvoid.com/images/alert.ico" /> <span style="color: red;">DETECTED</span></td>
<td><a title="View more details" href="http://cbl.abuseat.org/lookup.cgi?ip=220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.emergingthreats.net" /> EmergingThreats</td>
<td><img title="Detected!" alt="Alert" src="http://www.ipvoid.com/images/alert.ico" /> <span style="color: red;">DETECTED</span></td>
<td><a title="View more details" href="http://www.emergingthreats.net/" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.openbl.org" /> OpenBL_org</td>
<td><img title="Detected!" alt="Alert" src="http://www.ipvoid.com/images/alert.ico" /> <span style="color: red;">DETECTED</span></td>
<td><a title="View more details" href="https://www.openbl.org/" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=dnsbl.tornevall.org" />  TornevallNET</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://dnsbl.tornevall.org/" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.spamrats.com" />  SpamRATS</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.spamrats.com/lookup.php?ip=220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=dnsbl.abuse.ch" />  DNSBL_AbuseCH</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://dnsbl.abuse.ch/lookup.php?ipaddress=220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=rbl.efnetrbl.org" />  EFnet_RBL</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://rbl.efnetrbl.org/multicheck.php" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.spamcop.net" />  SpamCop</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.spamcop.net/w3m?action=checkblock&amp;ip=220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=psbl.org" />  PSBL</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://psbl.org/listing?ip=220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.wpbl.info" />  WPBL</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.wpbl.info/cgi-bin/detail.cgi?ip=220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.malwaredomainlist.com" />  MalwareDomainList</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.malwaredomainlist.com/mdl.php?search=220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=malc0de.com" />  Malc0de</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://malc0de.com/database/index.php?search=220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=zeustracker.abuse.ch" />  ZeuS Tracker</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="https://zeustracker.abuse.ch/monitor.php?host=220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=spyeyetracker.abuse.ch" />  SpyEye Tracker</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="https://spyeyetracker.abuse.ch/monitor.php?host=220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.phishtank.com" />  PhishTank</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.phishtank.com/" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.autoshun.org" />  Autoshun</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.autoshun.org/" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.dshield.org" />  DShield</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.dshield.org/" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.snortattack.org" />  SnortAttack</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.snortattack.org/" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.msrbl.com" />  MSRBL</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.msrbl.com/check?ip=220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.team-cymru.org" />  Bogons_Team_Cymru</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.team-cymru.org/Services/Bogons/" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.scumware.org" />  SCUMWARE</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.scumware.org/search.scumware" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.uribl.com" />  URIBL</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.uribl.com/" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.malwareblacklist.com" />  MalwareBlacklist</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.malwareblacklist.com/searchClearingHouse.php?search=220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.google.com" /> GoogleSafeBrowsing</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.google.com/safebrowsing/diagnostic?site=220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.surbl.org" />  SURBL</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.surbl.org/surbl-analysis" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=urlvir.com" />  URLVir</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://urlvir.com/search/220.161.148.178/" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.threatlog.com" />  ThreatLog</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.threatlog.com/search/220.161.148.178/" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=vscan.novirusthanks.org" />  VScan</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://vscan.novirusthanks.org/" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.projecthoneypot.org" />  ProjectHoneypot</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.projecthoneypot.org/ip_220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.ahbl.org" />  AHBL</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.ahbl.org/lktool" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.backscatterer.org" />  Backscatterer</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.backscatterer.org/?target=test" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=virbl.bit.nl" />  VirBL</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://virbl.bit.nl/lookup/index.php?ip=220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.au.sorbs.net" />  SORBS</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.au.sorbs.net/lookup.shtml" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=www.nixspam.org" />  NiX_Spam</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://www.dnsbl.manitu.net/?language=en" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
<tr>
<td><img alt="Favicon" src="http://www.google.com/s2/favicons?domain=antispam.imp.ch" />  Swinog_DNSRBL</td>
<td><img title="Clean" alt="Clean" src="http://www.ipvoid.com/images/valid.ico" /> NOT FOUND</td>
<td><a title="View more details" href="http://antispam.imp.ch/spamikaze/spamlisting.php?ipfirst=220.161.148.178" target="_blank" rel="nofollow"><img alt="Link" src="http://www.ipvoid.com/images/link.ico" /></a></td>
</tr>
</tbody>
</table>
</blockquote>
<p>El código de IPreputattion.ps1</p>
<pre class="brush: bash; title: ; notranslate">
&lt;#
##############################################################################
#                 PowerShell script - IPreputation.ps1                       #
# -------------------------------------------------------------------------- #
# Analizador de reputación de IPs remotas con IPVoid.com de NoVirusThanks    #
# -------------------------------------------------------------------------- #
#             By Javier Castañon - http://javcasta.com/                      #
##############################################################################
# IPVoid.com: http://www.ipvoid.com/                                         #
# NoVirusThanks: http://www.novirusthanks.org/                               #
##############################################################################
# Uso: &gt; .\IPreputation.ps1                                                  #
##############################################################################
#&gt;
#$ErrorActionPreference = &quot;Inquire&quot;
$ErrorActionPreference = &quot;SilentlyContinue&quot;
del *.tmp
function post_http($url,$parameters)
{
    $http_request = New-Object -ComObject Msxml2.XMLHTTP
    $http_request.open(&quot;POST&quot;, $url, $false)
    $http_request.setRequestHeader(&quot;Content-type&quot;,&quot;application/x-www-form-urlencoded&quot;)
    $http_request.setRequestHeader(&quot;Content-length&quot;, $parameters.length);
    $http_request.setRequestHeader(&quot;Connection&quot;, &quot;close&quot;)
    $http_request.send($parameters)
    $script:response = $http_request.responseText
    return $response
}

function reputacion($ip) {
    if ((Test-Path resultados.tmp -PathType Leaf) -and (Get-Content .\resultados.tmp | Select-String &quot;$ip&quot; -quiet)) {
        Get-Content .\resultados.tmp  | sort -Unique &gt; mira.tmp
        $devolver = (Get-Content .\mira.tmp | Select-String &quot;$ip&quot;)
        return &quot;Ya consultada &quot; + $devolver
    }
    else
    {
    $parametros = &quot;ip=$ip&quot;
    [string] $wget = post_http &quot;http://www.ipvoid.com/&quot; $parametros
    if ($wget.Contains('&lt;td&gt;Blacklist Status&lt;/td&gt;')){
        $inicio = $wget.IndexOf('Blacklist Status&lt;/td&gt;')
        $final = $wget.IndexOf('%) &lt;/td&gt;&lt;/tr&gt;') 
        if (($final - $inicio) -le 0) { $final = $wget.IndexOf('%&lt;/strong&gt;&lt;/font&gt;) &lt;/td&gt;') }
        $resultado = $wget.Substring($inicio, $final - $inicio)
        if ($resultado.Contains(&quot;NOT BLACKLISTED&quot;)) { 
            $resultado = $resultado.Split(&quot;`n&quot;)
            $resultado = $resultado[1].Replace(&quot;&lt;tr&gt;&quot;,&quot;&quot;)
            $resultado = $resultado.Replace(&quot;&lt;td&gt;&quot;,&quot;&quot;)
            $resultado = $resultado.Replace(&quot;&lt;/td&gt;&quot;,&quot;: &quot;)
            echo &quot;$ip OK $resultado % )&quot; &gt;&gt; resultados.tmp
            
            return &quot;OK &quot; + $resultado + &quot;% )&quot;
        }
        else { 
            if ($resultado.Contains(&quot;BLACKLISTED&quot;)) { 
                $resultado = $resultado.Split(&quot;`n&quot;)
                $resultado = $resultado[1].Replace(&quot;&lt;tr&gt;&quot;,&quot;&quot;)
                $resultado = $resultado.Replace(&quot;&lt;td&gt;&quot;,&quot;&quot;)
                $resultado = $resultado.Replace(&quot;&lt;/td&gt;&quot;,&quot;: &quot;)
                $resultado = $resultado.Replace(&quot;&lt;font color=&quot;, &quot;&quot;)
                $resultado = $resultado.Replace('&quot;red&quot;&gt;&lt;strong&gt;',&quot;&quot;)
                $resultado = $resultado.Replace(&quot;&lt;/strong&gt;&lt;/font&gt;&quot;,&quot;&quot;)
                echo &quot;$ip NO_OK $resultado % )&quot; &gt;&gt; resultados.tmp
                
                return &quot;NO_OK &quot; + $resultado + &quot;% )&quot;
            } 
              
         }
    }
    }
    else { return &quot;error???&quot; }
}

function begin {

$netstats = netstat -ano
$datos = $netstats[4..($netstats.count)] #info comienza en 4
$linea = &quot;&quot;
$color = &quot;&quot;
$lareputacion = &quot;&quot;
 foreach ($linea in $datos) {
    [string] $conexion = $linea -split ' ' | ? {$_ -ne ''}
    $componente = $conexion.Split(' ')
    
    if ($componente[3] -eq &quot;ESTABLISHED&quot; -and !$componente[2].Contains(&quot;127.0.0.&quot;) -and
     !$componente[2].StartsWith(&quot;192.168.&quot;) -and !$componente[2].StartsWith(&quot;5.135.242.&quot;) -and !$componente[2].StartsWith(&quot;10.&quot;) -and
     !$componente[2].StartsWith(&quot;172.16.&quot;) -and !$componente[2].StartsWith(&quot;172.17.&quot;) -and !$componente[2].StartsWith(&quot;172.18.&quot;) -and
     !$componente[2].StartsWith(&quot;172.19.&quot;) -and !$componente[2].StartsWith(&quot;172.20.&quot;) -and !$componente[2].StartsWith(&quot;172.21.&quot;) -and
     !$componente[2].StartsWith(&quot;172.22.&quot;) -and !$componente[2].StartsWith(&quot;172.23.&quot;) -and !$componente[2].StartsWith(&quot;172.24.&quot;) -and
     !$componente[2].StartsWith(&quot;172.25.&quot;) -and !$componente[2].StartsWith(&quot;172.26.&quot;) -and !$componente[2].StartsWith(&quot;172.27.&quot;) -and
     !$componente[2].StartsWith(&quot;172.28.&quot;) -and !$componente[2].StartsWith(&quot;172.29.&quot;) -and !$componente[2].StartsWith(&quot;172.30.&quot;) -and
     !$componente[2].StartsWith(&quot;172.31.&quot;)) {
        $socket = $componente[2].Split(':')
        [string] $lareputacion = reputacion $socket[0]
        if ($lareputacion.Contains(&quot;NO_OK&quot;)) { $color = &quot;Red&quot; } else { if ($lareputacion.Contains(&quot;OK&quot;)) { $color = &quot;Green&quot; } }
        if ($lareputacion.Contains(&quot;error???&quot;)) { $color = &quot;Yellow&quot; }
        if($lareputacion.Contains(&quot;Ya consultada&quot;)) { Write-Host &quot;Reputacion &quot; $lareputacion &quot;, conexion al puerto: &quot; $socket[1] -ForegroundColor $color }
        else { write-host &quot;Reputacion de &quot; $socket[0] &quot; :&quot; $lareputacion  &quot;, conexion al puerto: &quot; $socket[1] -ForegroundColor $color }
    }
    
 }
 Start-Sleep -s 10
 $fecha = Get-Date
 Write-Host &quot;-----------&quot; $fecha &quot;-------------------------------&quot; -ForegroundColor &quot;Cyan&quot;
 begin
 }
 
 $fecha = Get-Date
 Write-Host &quot;-----------&quot; $fecha &quot;-------------------------------&quot; -ForegroundColor &quot;Cyan&quot;
 begin
</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%2F2013%2F04%2F09%2Fpowershell-script-ipreputation-ps1-analizador-de-reputacion-de-ips-remotas-con-ipvoid-com-de-novirusthanks%2F&amp;title=PowerShell%20script%20%E2%80%93%20IPreputation.ps1%20%E2%80%93%20Analizador%20de%20reputaci%C3%B3n%20de%20IPs%20remotas%20con%20IPVoid.com%20de%20NoVirusThanks" 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><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=Y2qBGAGvWSE:AiDyO2j02cM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=Y2qBGAGvWSE:AiDyO2j02cM:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=Y2qBGAGvWSE:AiDyO2j02cM:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=Y2qBGAGvWSE:AiDyO2j02cM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=Y2qBGAGvWSE:AiDyO2j02cM:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=Y2qBGAGvWSE:AiDyO2j02cM:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=Y2qBGAGvWSE:AiDyO2j02cM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=Y2qBGAGvWSE:AiDyO2j02cM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=Y2qBGAGvWSE:AiDyO2j02cM:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=Y2qBGAGvWSE:AiDyO2j02cM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=Y2qBGAGvWSE:AiDyO2j02cM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=Y2qBGAGvWSE:AiDyO2j02cM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=Y2qBGAGvWSE:AiDyO2j02cM:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=Y2qBGAGvWSE:AiDyO2j02cM:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=Y2qBGAGvWSE:AiDyO2j02cM:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=Y2qBGAGvWSE:AiDyO2j02cM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=Y2qBGAGvWSE:AiDyO2j02cM:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=Y2qBGAGvWSE:AiDyO2j02cM:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~4/Y2qBGAGvWSE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2013/04/09/powershell-script-ipreputation-ps1-analizador-de-reputacion-de-ips-remotas-con-ipvoid-com-de-novirusthanks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javcasta.com/2013/04/09/powershell-script-ipreputation-ps1-analizador-de-reputacion-de-ips-remotas-con-ipvoid-com-de-novirusthanks/</feedburner:origLink></item>
		<item>
		<title>PowerShell Script – Notificación en barra de tareas</title>
		<link>http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~3/YQvFQ1FGGGQ/</link>
		<comments>http://www.javcasta.com/2013/04/04/powershell-script-notificacion-en-barra-de-tareas/#comments</comments>
		<pubDate>Thu, 04 Apr 2013 14:05:23 +0000</pubDate>
		<dc:creator>fj.castanon@gmail.com (Javier Castañón)</dc:creator>
				<category><![CDATA[HelpDesk]]></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=8142</guid>
		<description><![CDATA[Referencia: http://poshcode.org/4006 En el link de referencia (repositorio de código) , encontré una forma de crear notificaciones en PowerShell con un icono en la barra de tareas. En el script defino una función: notifcation, con 7 parámetros: &#160; notification &#8220;2500&#8221; &#8220;mensaje &#8230;&#8221; &#8220;Cyan&#8221; &#8220;`n mensaje de debug para consola`n Notificacion tipo info &#8221; &#8220;info&#8221; &#8220;titulo&#8221; [...]]]></description>
				<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2013%2F04%2F04%2Fpowershell-script-notificacion-en-barra-de-tareas%2F"></g:plusone><br /><p><!-- tweet id : 319812617990447104 --><style type='text/css'>#bbpBox_319812617990447104 a { text-decoration:none; color:#2FC2EF; }#bbpBox_319812617990447104 a:hover { text-decoration:underline; }</style><div id='bbpBox_319812617990447104' 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;'>PowerShell Script - Notificaci&#243;n en barra de tareas <a href="http://t.co/Sht9qJSsZ3" rel="nofollow">http://t.co/Sht9qJSsZ3</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/04/2013 14:04' href='http://twitter.com/#!/javcasta/status/319812617990447104' target='_blank'>04/04/2013 14:04</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=319812617990447104' 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=319812617990447104' 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=319812617990447104' 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://a0.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://poshcode.org/4006" target="_blank">http://poshcode.org/4006</a></li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/04/Notificacion-PS-0.jpg"><img src="http://www.javcasta.com/blog/wp-content/uploads/2013/04/Notificacion-PS-0.jpg" alt="Notificacion-PS-0" width="166" height="132" class="aligncenter size-full wp-image-8144" /></a></p>
<p>En el link de referencia (repositorio de código) , encontré una forma de <strong>crear notificaciones en PowerShell con un icono en la barra de tareas</strong>.</p>
<p>En el script defino una función: notifcation, con 7 parámetros:</p>
<p>&nbsp;</p>
<blockquote><p><span style="color: #888888;"><span style="color: #0000ff;">notification</span> &#8220;<span style="color: #ff9900;">2500</span>&#8221; &#8220;<span style="color: #008000;">mensaje &#8230;</span>&#8221; &#8220;<span style="color: #3366ff;">Cyan</span>&#8221; <span style="color: #800000;">&#8220;`n mensaje de debug para consola`n Notificacion tipo info</span> &#8221; &#8220;<span style="color: #008080;">info</span>&#8221; &#8220;<span style="color: #333399;">titulo</span>&#8221; &#8220;<span style="color: #993366;">true</span>&#8220;</span></p>
</blockquote>
<p>&nbsp;</p>
<ol>
<li>&#8220;<span style="color: #ff6600;">2500</span>&#8220;: El primer parámetro o argumento 0 de la función define el tiempo en msg que aparecerá la notificación</li>
<li>&#8220;<span style="color: #339966;">mensaje &#8230;</span>&#8220;: El mensaje que aparecerá en la notificación</li>
<li>&#8220;<span style="color: #3366ff;">Cyan</span>&#8220;: El color del mensaje de debug por la consola de powershell</li>
<li>&#8220;<span style="color: #800000;">`n mensaje de debug para consola`n Notificacion tipo info</span> &#8220;: mensaje de debug para consola</li>
<li>&#8220;<span style="color: #008080;">info</span>&#8220;: el tipo de notificación ( none, warning, error, info )</li>
<li>&#8220;<span style="color: #333399;">título</span>&#8220;: el título de la notificación</li>
<li>&#8220;<span style="color: #800080;">true</span>&#8220;: si se van a mostrar mensaje de debug por la consola (true = si, false = no)</li>
</ol>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/04/Notificacion-PS-1.jpg"><img class="aligncenter size-full wp-image-8143" alt="Notificacion-PS-1" src="http://www.javcasta.com/blog/wp-content/uploads/2013/04/Notificacion-PS-1.jpg" width="650" height="417" /></a></p>
<p>El código del script en PowerShell:</p>
<pre class="brush: bash; title: ; notranslate">
# Icono de notificación en barra de tareas
# referencia http://poshcode.org/4006
$ErrorActionPreference = &quot;silentlycontinue&quot;
[void] [System.Reflection.Assembly]::LoadWithPartialName(&quot;System.Windows.Forms&quot;)
[void] [System.Reflection.Assembly]::LoadWithPartialName(&quot;System.Drawing&quot;)
Function notification {
    #Arguementos: 0=delay,1=mensaje,2=color del mensaje de debug,3=mensaje de debug,4=tipo de notificacion,5=Titulo,6=debug false | true ]
    # delay = tiempo que se muestra la notificacion
    $Icon = [System.Drawing.SystemIcons]::Information
    $Notify = new-object system.windows.forms.notifyicon
    $Notify.icon = $Icon # warning, info, error, none
    $Notify.visible = $true
     # debug = false -&gt; se deshabilitan los mensajes por consola
    if ($Args[6] -eq &quot;false&quot;) { $Debug = $False } else { $Debug = $True }
    $titulo = $Args[5]
    $tipo = $Args[4]
    if ($Args[3] -eq &quot;&quot;){$Args[3] = $Args[1]}
    switch($tipo) {
        &quot;info&quot; {$Notify.ShowBalloonTip($Args[0],$titulo,$Args[1],[system.windows.forms.tooltipicon]::info)}
        &quot;warning&quot; {$Notify.ShowBalloonTip($Args[0],$titulo,$Args[1],[system.windows.forms.tooltipicon]::warning)}
        &quot;error&quot; {$Notify.ShowBalloonTip($Args[0],$titulo,$Args[1],[system.windows.forms.tooltipicon]::error)}
        &quot;none&quot; {$Notify.ShowBalloonTip($Args[0],$titulo,$Args[1],[system.windows.forms.tooltipicon]::none)}
        default {$Notify.ShowBalloonTip($Args[0],$titulo,$Args[1],[system.windows.forms.tooltipicon]::none)}
    }
    #}
    if ($debug){write-host $Args[3] -ForegroundColor $Args[2] }
    [Threading.Thread]::Sleep([int] $Args[0])
    $Notify.Dispose()
}
notification &quot;1500&quot; &quot;mensaje ...&quot; &quot;White&quot; &quot;`n mensaje de debug para consola`n Notificacion tipo none &quot; &quot;none&quot; &quot;titulo&quot; &quot;true&quot;
notification &quot;1500&quot; &quot;mensaje ...&quot; &quot;Yellow&quot; &quot;`n mensaje de debug para consola`n Notificacion tipo warning &quot; &quot;warning&quot; &quot;titulo&quot; &quot;true&quot;
notification &quot;1500&quot; &quot;mensaje ...&quot; &quot;Red&quot; &quot;`n mensaje de debug para consola`n Notificacion tipo error &quot; &quot;error&quot; &quot;titulo&quot; &quot;true&quot;
notification &quot;2500&quot; &quot;mensaje ...&quot; &quot;Cyan&quot; &quot;`n mensaje de debug para consola`n Notificacion tipo info &quot; &quot;info&quot; &quot;titulo&quot; &quot;true&quot;
</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%2F2013%2F04%2F04%2Fpowershell-script-notificacion-en-barra-de-tareas%2F&amp;title=PowerShell%20Script%20%E2%80%93%20Notificaci%C3%B3n%20en%20barra%20de%20tareas" 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><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=YQvFQ1FGGGQ:TaoPui4q-no:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=YQvFQ1FGGGQ:TaoPui4q-no:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=YQvFQ1FGGGQ:TaoPui4q-no:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=YQvFQ1FGGGQ:TaoPui4q-no:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=YQvFQ1FGGGQ:TaoPui4q-no:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=YQvFQ1FGGGQ:TaoPui4q-no:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=YQvFQ1FGGGQ:TaoPui4q-no:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=YQvFQ1FGGGQ:TaoPui4q-no:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=YQvFQ1FGGGQ:TaoPui4q-no:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=YQvFQ1FGGGQ:TaoPui4q-no:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=YQvFQ1FGGGQ:TaoPui4q-no:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=YQvFQ1FGGGQ:TaoPui4q-no:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=YQvFQ1FGGGQ:TaoPui4q-no:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=YQvFQ1FGGGQ:TaoPui4q-no:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=YQvFQ1FGGGQ:TaoPui4q-no:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=YQvFQ1FGGGQ:TaoPui4q-no:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=YQvFQ1FGGGQ:TaoPui4q-no:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=YQvFQ1FGGGQ:TaoPui4q-no:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~4/YQvFQ1FGGGQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2013/04/04/powershell-script-notificacion-en-barra-de-tareas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javcasta.com/2013/04/04/powershell-script-notificacion-en-barra-de-tareas/</feedburner:origLink></item>
		<item>
		<title>PowerShell Script – Analizador de Procesos y Servicios con Malware Hash Registry de Team Cymru</title>
		<link>http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~3/6fnwynbAHaI/</link>
		<comments>http://www.javcasta.com/2013/04/02/powershell-script-analizador-de-procesos-y-servicios-con-malware-hash-registry-de-team-cymru/#comments</comments>
		<pubDate>Tue, 02 Apr 2013 14:35:50 +0000</pubDate>
		<dc:creator>fj.castanon@gmail.com (Javier Castañón)</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[virtualización]]></category>

		<guid isPermaLink="false">http://www.javcasta.com/?p=8137</guid>
		<description><![CDATA[Referencias:  https://www.team-cymru.org/Services/MHR/ http://poshcode.org/1515 The Team Cymru Malware Hash Registry (MHR) compliments an anti-virus (AV) strategy by helping to identify unknown or suspicious files. While your AV posture helps you perform detection based on signatures, heuristics and polymorphism, the MHR provides you additional layer of detection, for known badness El Registro de Hash de Malware (MHR) [...]]]></description>
				<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2013%2F04%2F02%2Fpowershell-script-analizador-de-procesos-y-servicios-con-malware-hash-registry-de-team-cymru%2F"></g:plusone><br /><p><!-- tweet id : 319095328869580800 --><style type='text/css'>#bbpBox_319095328869580800 a { text-decoration:none; color:#2FC2EF; }#bbpBox_319095328869580800 a:hover { text-decoration:underline; }</style><div id='bbpBox_319095328869580800' 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;'>PowerShell Script - Analizador de Procesos y Servicios con Malware Hash Registry de Team Cymru <a href="http://t.co/Xkiya9LuvH" rel="nofollow">http://t.co/Xkiya9LuvH</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 02/04/2013 14:33' href='http://twitter.com/#!/javcasta/status/319095328869580800' target='_blank'>02/04/2013 14:33</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=319095328869580800' 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=319095328869580800' 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=319095328869580800' 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://a0.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/2013/04/tc-community-logo.png"><img class="aligncenter size-full wp-image-8139" alt="tc-community-logo" src="http://www.javcasta.com/blog/wp-content/uploads/2013/04/tc-community-logo.png" width="210" height="207" /></a></p>
<p><strong><span style="text-decoration: underline;">Referencias:</span></strong></p>
<ul>
<li> <a href="https://www.team-cymru.org/Services/MHR/">https://www.team-cymru.org/Services/MHR/</a></li>
<li><a href="http://poshcode.org/1515">http://poshcode.org/1515</a></li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/04/AnalizadorPSyServicios2MHR-2.jpg"><img class="aligncenter size-full wp-image-8138" alt="AnalizadorPSyServicios2MHR-2" src="http://www.javcasta.com/blog/wp-content/uploads/2013/04/AnalizadorPSyServicios2MHR-2.jpg" width="650" height="346" /></a></p>
<blockquote><p><span style="color: #888888;"><em>The Team Cymru Malware Hash Registry (MHR) compliments an anti-virus (AV) strategy by helping to identify unknown or suspicious files. While your AV posture helps you perform detection based on signatures, heuristics and polymorphism, the MHR provides you additional layer of detection, for known badness</em></span></p>
<p>El <strong>Registro de Hash de Malware (MHR) del equipo de Cymru</strong> se complementa estrategicamente con un antivirus (AV), ayudando a identificar ficheros desconocidos o sospechosos. Mientras que su AV le ayuda a realizar la detección basada en firmas, heurística y polimorfismo, el MHR le proporciona una capa adicional de detección, para los conocidos malwares (virus, trollanos, gusanos, &#8230;)</p>
</blockquote>
<p style="text-align: center;">
<p>Con este <strong>script en PowerShell</strong>, en definitiva, se trata de obtener el <strong>hash md5</strong> de los <strong>ficheros asociados a los procesos (módulos) y a los ejecutables de los servicios</strong> y consultarlos contra <strong>la base de datos de MHR de Team Cymru</strong>. La consulta se puede hacer vía <strong>whois, dns, http/s</strong>.</p>
<p>He optado por implementar las consultas del script vía dns (es el método más rápido) y<strong> si encuentra un positivo o falla la resolución de dns, usar la consulta vía whois (puerto tcp 43)</strong>. Y he observado que tarda una media de 3 consultas / sg . Por lo que para unos 850 ficheros (entre procesos y sus módulos y ejecutables de los servicios) tardaria unos 5 minutos. Tambien he observado que a veces el servidor <strong>hash.cymru.com</strong> debe de estar saturado o simplemente hemos excedido el &#8220;ratio&#8221; de consultas que ellos consideran aceptable (<strong>MHR es un servicio free y para uso no comercial</strong>) y simplemente no responden.</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/04/AnalizadorPSyServicios2MHR-1.jpg"><img class="aligncenter size-full wp-image-8140" alt="AnalizadorPSyServicios2MHR-1" src="http://www.javcasta.com/blog/wp-content/uploads/2013/04/AnalizadorPSyServicios2MHR-1.jpg" width="762" height="93" /></a></p>
<p>El <strong>MHR de Team Cymru</strong>, esta basado en la <strong>detección por hash de malware</strong> y según cuentan ellos utilizan unos<strong> 30 motores de antivirus</strong>. Desde luego es<strong> más rápido que Virus Total</strong> (aunque estos, como ventaja, suelen usar hasta 45 motores de antivirus).</p>
<p><span style="text-decoration: underline;"><strong>El código del script en PowerShell</strong></span></p>
<pre class="brush: bash; title: ; notranslate">
&lt;#
##############################################################################
#        PowerShell V3 script - AnalizadorProcesos-y-Servicios2MHR.ps1       #
# -------------------------------------------------------------------------- #
# Analizador de Procesos y Servicios con Malware Hash Registry de Team Cymru #
# -------------------------------------------------------------------------- #
#             By Javier Castañon - http://javcasta.com/                      #
##############################################################################
# MHR de Team Cymru : https://www.team-cymru.org/Services/MHR/               #
##############################################################################
# Uso: &gt; .\AnalizadorProcesos-y-Servicios2MHR.ps1                            #
##############################################################################
#&gt;
$ErrorActionPreference = &quot;SilentlyContinue&quot;
mode con: cols=256 # importante: sino mal funcionamiento para paths &gt; 120 cols
#$ErrorActionPreference = &quot;Inquire&quot;
$log = [string] (Get-Date -Format ddMMyyyy) + &quot;resultados.csv&quot;

function fmd5($camino) {
    $md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
	$hash = [System.BitConverter]::ToString($md5.ComputeHash([System.IO.File]::ReadAllBytes($elfichero))).Replace(&quot;-&quot;, &quot;&quot;).ToLower()
    return [string] $hash
}

function fwhois($domain) {
    # ref http://poshcode.org/1515
	try {
    $Servidor = &quot;hash.cymru.com&quot;
	#$Servidor = &quot;38.229.0.11&quot;
    $socket = New-Object System.Net.Sockets.Socket ([System.Net.Sockets.AddressFamily]::InterNetwork, [System.Net.Sockets.SocketType]::Stream, [System.Net.Sockets.ProtocolType]::Tcp)
    $Socket.Connect($Servidor, 43) | out-null
    $bytes = [System.Text.Encoding]::ASCII.GetBytes($domain + &quot;`n&quot;)
    $Socket.Send($bytes) | out-null
    #$bytes = [Array]::CreateInstance(&quot;byte&quot;, 2048)
    $bytes = [Array]::CreateInstance(&quot;byte&quot;, 59)
    $Socket.Receive($bytes) | out-null
    $result = [System.Text.Encoding]::ASCII.GetString($bytes).Trim() -split &quot;`n&quot;
    $Socket.Close()
    $salida = $result[0].Split(' ');
    return [string] $salida[2]
	} catch [System.Exception] {
		Write-Host &quot;Error de Whois / red / Internet ... compruebe conectividad a Inet &quot; -ForegroundColor Red
		Write-Host &quot;Puede que el servidor hash.cymru.com este saturado. Salimos ...&quot; -ForegroundColor Red
		exit 0
	}
}

function fdig($domain) {
	try {
		# $domain = &quot;dcca4b04af87e52ef9eaa2190e06cbac&quot;
		$cadena = $domain + &quot;.malware.hash.cymru.com&quot;
		$resultado = ([System.Net.Dns]::GetHostAddresses($cadena.ToString())[0]).IPAddressToString;
		if ($resultado -eq $null  -or $resultado -eq &quot;&quot;) { $resultado = &quot;NO_DATA&quot; }
		if ($resultado.Contains(&quot;127.0.0.2&quot;)  -or $resultado -eq &quot;127.0.0.2&quot;) { 
			$resultado = &quot;infeccion&quot;
			$resultado = fwhois $domain
		}
		else { $resultado = &quot;NO_DATA&quot; }		
		return $resultado
    } catch [System.Exception] {
		Write-Host &quot;Error de DNS / red / internet, consultamos vía Whois.&quot;
		return fwhois $domain
    }
}


#BEGIN
#try {
   Write-Host &quot;Obteniendo procesos y servicios ... tarda unos sgs&quot;
   Write-Host
   $regex = '\b[A-Za-z]+\:+\\\b' # c:\loquesea - z:\loquesea
   # Obtenemos los modulos de todos los procesos
   (Get-Process -Module).FileName | Out-File p.tmp -append
   # Quitamos duplicados
   Get-Content p.tmp | sort -Unique &gt; procesos.tmp
   # Obtenemos ejecutables de servicios
   echo &quot;&quot; &gt; todoservicios.tmp
   foreach ($unservicio in (gwmi win32_service).pathname) {
        #echo $unservicio
        if (!$unservicio.StartsWith('&quot;')) {
            $longitud = $unservicio.IndexOf(&quot;.exe&quot;)
            $slinea = $unservicio.Substring(0, $longitud + 4)
            echo $slinea &gt;&gt; todoservicios.tmp
        }
        if ($unservicio.StartsWith('&quot;')) {
            $slinea = $unservicio.Split('&quot;')
            if (!$slinea[1].ToLower().EndsWith(&quot;.exe&quot;)) { $slinea[1] = $slinea[1] + &quot;.exe&quot; }
            echo $slinea[1] &gt;&gt; todoservicios.tmp
        }
        $slinea = &quot;&quot;
    }
   # quitamos duplicados
   Get-Content todoservicios.tmp | sort -Unique &gt; servicios.tmp
   # Unimos procesos y servicios
   cat procesos.tmp, servicios.tmp &gt; todo.tmp
   Get-Content todo.tmp | Select-String $regex | sort -Unique &gt; todo.dat
   del *.tmp
   $procesos = Get-Content todo.dat | Select-String $regex
   # Contamos el nº total de ficheros asociados a procesos y servicios
   $nlineas = 0
   $linea = &quot;&quot;
   foreach ($linea in $procesos) { $nlineas++ }
   $totalficheros = $nlineas
   $linea = &quot;&quot;
   Write-Host &quot;Nº total de ficheros asociados a procesos y servicios : &quot;  -ForegroundColor Yellow -NoNewline
   Write-Host $totalficheros -ForegroundColor Green
   Write-Host &quot;-------------------------------------------------------&quot; -ForegroundColor Yellow
   Write-Host &quot;Comenzamos a analizar ...&quot; -ForegroundColor Cyan
   $nlineas = 0
   foreach ($linea in $procesos) {
        $nlineas++
        [string] $elfichero = $linea
        $elfichero = $elfichero.Trim()
        # comprobamos si todavia existe el fichero
        $FileExists = (Test-Path $elfichero -PathType Leaf)
        # si no existe
        if (!$FileExists) { Write-Host &quot;Ya no existe: &quot; $nlineas &quot; de &quot; $totalficheros &quot; : &quot; $elfichero -ForegroundColor Yellow }
        # si existe
        if ($FileExists) {
            $elmd5 = fmd5 $elfichero
            #----TEST ------- introduzco un hash md5 de una ifección positiva para ver si el script funciona correctamente
			# if ($nlineas -eq 10) { $elmd5 = &quot;733a48a9cb49651d72fe824ca91e8d00&quot; }
            # if ($nlineas -eq 11) { Write-Host &quot;Ya no existe: &quot; $nlineas &quot; de &quot; $totalficheros &quot; : &quot; $elfichero -ForegroundColor Yellow }
            #----TEST -------
            $resultado = fdig $elmd5
            if ($resultado.Contains(&quot;NO_DATA&quot;)) {
                 $resultado = &quot;Limpio&quot;; $color = &quot;Green&quot;

            } else {
				if ($resultado.Contains(&quot;Error de&quot;)) { $resultado = &quot;Error de red / internet&quot;; $color = &quot;Yellow&quot; }
				else { $resultado = $resultado + &quot; % infeccion&quot;; $color = &quot;Red&quot; }
            }
            $linealog = $nlineas.ToString() + &quot;,&quot; + $elfichero + &quot;,&quot; + $elmd5 + &quot;,&quot; + $resultado
            echo $linealog | Out-File $log -append
            Write-Host $nlineas -ForegroundColor $color -NoNewline
            Write-Host &quot; de &quot; $totalficheros &quot; : &quot; -ForegroundColor White -NoNewline
            Write-Host $elfichero -ForegroundColor Cyan -NoNewline
            Write-Host  &quot; - md5 = &quot; $elmd5 -ForegroundColor Gray -NoNewline
            Write-Host  &quot; resultado = &quot; $resultado -ForegroundColor $color
        }
    }
   Write-Host
   Write-Host &quot;Log de resultados en:&quot; $log -ForegroundColor White
    
#} catch [System.Exception] { }
</pre>
<p>Y voila <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>&nbsp;</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%2F2013%2F04%2F02%2Fpowershell-script-analizador-de-procesos-y-servicios-con-malware-hash-registry-de-team-cymru%2F&amp;title=PowerShell%20Script%20%E2%80%93%20Analizador%20de%20Procesos%20y%20Servicios%20con%20Malware%20Hash%20Registry%20de%20Team%20Cymru" 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><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=6fnwynbAHaI:McXkDAhteuc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=6fnwynbAHaI:McXkDAhteuc:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=6fnwynbAHaI:McXkDAhteuc:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=6fnwynbAHaI:McXkDAhteuc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=6fnwynbAHaI:McXkDAhteuc:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=6fnwynbAHaI:McXkDAhteuc:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=6fnwynbAHaI:McXkDAhteuc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=6fnwynbAHaI:McXkDAhteuc:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=6fnwynbAHaI:McXkDAhteuc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=6fnwynbAHaI:McXkDAhteuc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=6fnwynbAHaI:McXkDAhteuc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=6fnwynbAHaI:McXkDAhteuc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=6fnwynbAHaI:McXkDAhteuc:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=6fnwynbAHaI:McXkDAhteuc:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=6fnwynbAHaI:McXkDAhteuc:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=6fnwynbAHaI:McXkDAhteuc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=6fnwynbAHaI:McXkDAhteuc:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=6fnwynbAHaI:McXkDAhteuc:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~4/6fnwynbAHaI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2013/04/02/powershell-script-analizador-de-procesos-y-servicios-con-malware-hash-registry-de-team-cymru/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javcasta.com/2013/04/02/powershell-script-analizador-de-procesos-y-servicios-con-malware-hash-registry-de-team-cymru/</feedburner:origLink></item>
		<item>
		<title>PowerShell Script – myZenQuery2SpamHaus.ps1 Consulta de dominio o ip a ZEN BlackList de SpamHaus</title>
		<link>http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~3/-_HruHdp8Uw/</link>
		<comments>http://www.javcasta.com/2013/03/29/powershell-script-myzenquery2spamhaus-ps1-consulta-de-dominio-o-ip-a-zen-blacklist-de-spamhaus/#comments</comments>
		<pubDate>Fri, 29 Mar 2013 10:40:59 +0000</pubDate>
		<dc:creator>fj.castanon@gmail.com (Javier Castañón)</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[spam]]></category>
		<category><![CDATA[Utilidades]]></category>

		<guid isPermaLink="false">http://www.javcasta.com/?p=8132</guid>
		<description><![CDATA[Referencias: http://www.spamhaus.org/ http://www.spamhaus.org/zen/ ZEN is the combination of all Spamhaus IP-based DNSBLs into one single powerful and comprehensive blocklistto make querying faster and simpler. It contains the SBL, SBLCSS, XBL and PBL blocklists. Traduzco: ZEN (de SpamHaus) es la combinación de todas las listas negras (o de bloqueo) DNS (DNSBL) basadas en IP en una [...]]]></description>
				<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2013%2F03%2F29%2Fpowershell-script-myzenquery2spamhaus-ps1-consulta-de-dominio-o-ip-a-zen-blacklist-de-spamhaus%2F"></g:plusone><br /><p><!-- tweet id : 317587384747307009 --><style type='text/css'>#bbpBox_317587384747307009 a { text-decoration:none; color:#2FC2EF; }#bbpBox_317587384747307009 a:hover { text-decoration:underline; }</style><div id='bbpBox_317587384747307009' 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;'>PowerShell Script - myZenQuery2SpamHaus.ps1 Consulta de dominio o ip a ZEN BlackList de SpamHaus <a href="http://t.co/jv34gyrmoQ" rel="nofollow">http://t.co/jv34gyrmoQ</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/03/2013 10:41' href='http://twitter.com/#!/javcasta/status/317587384747307009' target='_blank'>29/03/2013 10:41</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=317587384747307009' 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=317587384747307009' 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=317587384747307009' 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://a0.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.spamhaus.org/" target="_blank">http://www.spamhaus.org/</a></li>
<li><a href="http://www.spamhaus.org/zen/" target="_blank">http://www.spamhaus.org/zen/</a></li>
</ul>
<blockquote><p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/03/zen_badge3.gif"><img class="aligncenter size-full wp-image-8133" alt="zen_badge3" src="http://www.javcasta.com/blog/wp-content/uploads/2013/03/zen_badge3.gif" width="168" height="36" /></a></p>
<p><span style="color: #808080;"><em>ZEN is the combination of all Spamhaus IP-based DNSBLs into one single powerful and comprehensive blocklist</em></span><br /><span style="color: #808080;"><em>to make querying faster and simpler. It contains the SBL, SBLCSS, XBL and PBL blocklists.</em></span></p>
</blockquote>
<p>Traduzco: <span style="color: #333399;"><strong>ZEN</strong> (de <strong>SpamHaus</strong>) es la combinación de todas las <strong>listas negras</strong> (o de bloqueo) DNS (DNSBL) basadas en IP en una sola lista de bloqueo para hacer consultas más simples y rapidas. Contiene las listas SBL, SBLCSS, XBL y PBL</span></p>
<p>Para <strong>hacer una consulta a la lista ZEN de SpamHaus</strong>, simplemente hay que hacer una consulta de resolución de dominio de: la IPv4 invertida del dominio añadiendo<em> .zen.spamhaus.org</em> y según la respuesta sabremos si esta en lista negra o no.</p>
<p>Si la respuesta es que no resuelve, es que no esta en ninguna lista negra, si la respuesta es 127.0.0.x (donde x = [2, 11]) es que si esta en lista negra.:</p>
<p><a href="http://www.spamhaus.org/faq/section/DNSBL%20Usage#202" target="_blank">http://www.spamhaus.org/faq/section/DNSBL%20Usage#202</a></p>
<p style="text-align: center;"> </p>
<table class=" aligncenter" border="0" cellspacing="1" cellpadding="5">
<tbody>
<tr>
<td bgcolor="#ffcc00"><b>Return Code</b></td>
<td align="center" bgcolor="#ffcc00"><b>Zone</b></td>
<td bgcolor="#ffcc00"><b>Description</b></td>
</tr>
<tr>
<td bgcolor="#dcdcdc">127.0.0.2</td>
<td align="center" bgcolor="#c6c6c6">SBL</td>
<td bgcolor="#dcdcdc">Spamhaus SBL Data</td>
</tr>
<tr>
<td bgcolor="#dcdcdc">127.0.0.3</td>
<td align="center" bgcolor="#c6c6c6">SBL</td>
<td bgcolor="#dcdcdc">Spamhaus SBL CSS Data</td>
</tr>
<tr>
<td bgcolor="#dcdcdc">127.0.0.4</td>
<td align="center" bgcolor="#c6c6c6">XBL</td>
<td bgcolor="#dcdcdc">CBL Data</td>
</tr>
<tr>
<td bgcolor="#dcdcdc">127.0.0.10</td>
<td align="center" bgcolor="#c6c6c6">PBL</td>
<td bgcolor="#dcdcdc">ISP Maintained</td>
</tr>
<tr>
<td bgcolor="#dcdcdc">127.0.0.11</td>
<td align="center" bgcolor="#c6c6c6">PBL</td>
<td bgcolor="#dcdcdc">Spamhaus Maintained</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>Un <strong>script en PowerShell para consultar un dominio o IP a la lista ZEN de SpamHaus</strong>:</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/03/myZenQuery2SpamHaus-0.jpg"><img class="aligncenter size-full wp-image-8134" alt="myZenQuery2SpamHaus-0" src="http://www.javcasta.com/blog/wp-content/uploads/2013/03/myZenQuery2SpamHaus-0.jpg" width="650" height="144" /></a></p>
<p><strong>myZenQuery2SpamHaus.ps1</strong></p>
<pre class="brush: bash; title: ; notranslate">
&lt;#
###########################################################################
#           PowerShell script - myZenQuery2SpamHaus.ps1                   #
# ----------------------------------------------------------------------- #
#         Consulta de dominio/ip en lista negra de SpamHaus               #
# ----------------------------------------------------------------------- #
#             By Javier Castañon - http://javcasta.com/                   #
###########################################################################
# SpamHaus  : http://www.spamhaus.org/                                    #
###########################################################################
# Uso: .\myZenQuery2SpamHaus.ps { &lt;undominio&gt; | &lt;IPv4&gt; } - Por ejemplo:   #
# PS &gt; .\myZenQuery2SpamHaus.ps gmail.com                                 #
# PS &gt; .\myZenQuery2SpamHaus.ps 115.184.193.167                           #
###########################################################################
#&gt;
#$ErrorActionPreference = &quot;SilentlyContinue&quot;

Param( [Parameter(Position = 0, Mandatory = $True)] [String] $dominio)

function fconsulta($dominio) 
 {
    $resultado = &quot;&quot;; $laip = &quot;&quot;; $octetos = &quot;&quot;; $inversaIP = &quot;&quot;; $consulta = &quot;&quot;
    # Obtenemos la IPv4 del dominio
    try {
        $laip = ([System.Net.Dns]::GetHostAddresses($dominio)[0]).IPAddressToString;
    } catch [System.Exception] {
        Write-Host &quot;Error reolviendo &quot; $dominio
        exit 0
    }
    Write-Host $dominio &quot; tiene la IP: &quot; $laip
    $octetos = $laip.Split('.');
    # Invertimos la IP
    $inversaIP = $octetos[3] + &quot;.&quot; + $octetos[2] + &quot;.&quot; + $octetos[1] + &quot;.&quot; + $octetos[0]
    # Construimos la consulta
    $consulta = $inversaIP + &quot;.zen.spamhaus.org&quot;
    # Consultamos
    try {
        $resultado = ([System.Net.Dns]::GetHostAddresses($consulta.ToString())[0]).IPAddressToString;
    } catch [System.Exception] {
        if ($resultado -eq $null  -or $resultado -eq &quot;&quot;) { Write-Host &quot; -.- &quot; $dominio &quot; limpio &quot; } else { Write-Host &quot;Excepcion&quot;}
    }
    if ($resultado.Contains(&quot;127.0.0.&quot;)) {
        Write-Host &quot;El dominio &quot; $dominio &quot; esta en la lista negra de SpamHauss con resultado: &quot; $resultado -ForegroundColor Yellow -BackgroundColor Red
    } else {
        Write-Host &quot;El dominio &quot; $dominio &quot; no esta en la lista negra de SpamHauss&quot; $resultado -ForegroundColor Green
    }
    # si en blacklist: 115.184.193.167 , 113.142.37.114, ...
 }

fconsulta $dominio
</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%2F2013%2F03%2F29%2Fpowershell-script-myzenquery2spamhaus-ps1-consulta-de-dominio-o-ip-a-zen-blacklist-de-spamhaus%2F&amp;title=PowerShell%20Script%20%E2%80%93%20myZenQuery2SpamHaus.ps1%20Consulta%20de%20dominio%20o%20ip%20a%20ZEN%20BlackList%20de%20SpamHaus" 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><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=-_HruHdp8Uw:D27hYOBOTS4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=-_HruHdp8Uw:D27hYOBOTS4:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=-_HruHdp8Uw:D27hYOBOTS4:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=-_HruHdp8Uw:D27hYOBOTS4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=-_HruHdp8Uw:D27hYOBOTS4:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=-_HruHdp8Uw:D27hYOBOTS4:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=-_HruHdp8Uw:D27hYOBOTS4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=-_HruHdp8Uw:D27hYOBOTS4:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=-_HruHdp8Uw:D27hYOBOTS4:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=-_HruHdp8Uw:D27hYOBOTS4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=-_HruHdp8Uw:D27hYOBOTS4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=-_HruHdp8Uw:D27hYOBOTS4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=-_HruHdp8Uw:D27hYOBOTS4:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=-_HruHdp8Uw:D27hYOBOTS4:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=-_HruHdp8Uw:D27hYOBOTS4:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=-_HruHdp8Uw:D27hYOBOTS4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=-_HruHdp8Uw:D27hYOBOTS4:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=-_HruHdp8Uw:D27hYOBOTS4:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~4/-_HruHdp8Uw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2013/03/29/powershell-script-myzenquery2spamhaus-ps1-consulta-de-dominio-o-ip-a-zen-blacklist-de-spamhaus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javcasta.com/2013/03/29/powershell-script-myzenquery2spamhaus-ps1-consulta-de-dominio-o-ip-a-zen-blacklist-de-spamhaus/</feedburner:origLink></item>
		<item>
		<title>PowerShell V3 Script – myClamWinPS2VirusTotal.ps1 Analizador de Procesos en memoria con ClamWin &amp; Virus Total</title>
		<link>http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~3/1ZDriCj-Iv0/</link>
		<comments>http://www.javcasta.com/2013/03/12/powershell-v3-script-myclamwinps2virustotal-ps1-analizador-de-procesos-en-memoria-con-clamwin-virus-total/#comments</comments>
		<pubDate>Tue, 12 Mar 2013 12:50:10 +0000</pubDate>
		<dc:creator>fj.castanon@gmail.com (Javier Castañón)</dc:creator>
				<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[html]]></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=8121</guid>
		<description><![CDATA[Referencias:     http://labofapenetrationtester.blogspot.com.es/2013/01/introducing-prasadhak.html     http://code.google.com/p/nishang    https://www.virustotal.com/es/documentation/public-api/    http://es.clamwin.com/ Descargar Script y ficheros necesarios de ClamWin: myCWPS2VT.zip. Este script en PowerShell V3 es un analizador de los procesos en memoria con ClamWin y Virus Total. Lanzamos la consola de PowerShell con privilegios de administrador. Y ejecutamos el script PS x:\camino &#62; .\myClamWinPS2VirusTotal.ps1 Tras lanzar el [...]]]></description>
				<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2013%2F03%2F12%2Fpowershell-v3-script-myclamwinps2virustotal-ps1-analizador-de-procesos-en-memoria-con-clamwin-virus-total%2F"></g:plusone><br /><p><!-- tweet id : 311459917015949312 --><style type='text/css'>#bbpBox_311459917015949312 a { text-decoration:none; color:#2FC2EF; }#bbpBox_311459917015949312 a:hover { text-decoration:underline; }</style><div id='bbpBox_311459917015949312' 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: PowerShell V3 myClamWinPS2VirusTotal.ps1 Analizador d Procesos n memoria con ClamWin&amp;VirusTotal <a href="http://t.co/53I1y6m5RM" rel="nofollow">http://t.co/53I1y6m5RM</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 12/03/2013 12:53' href='http://twitter.com/#!/javcasta/status/311459917015949312' target='_blank'>12/03/2013 12:53</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=311459917015949312' 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=311459917015949312' 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=311459917015949312' 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://a0.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 />
<pre class="brush: bash; title: ; notranslate">
#Requires -Version 3
&lt;#
###########################################################################
#           PowerShell V3 script - myClamWinPS2VirusTotal.ps1             #
# ----------------------------------------------------------------------- #
#         Analizador de Procesos en memoria con ClamWin &amp; Virus Total     #
# ----------------------------------------------------------------------- #
#             By Javier Castañon - http://javcasta.com/                   #
###########################################################################
# Virus Total  : https://www.virustotal.com/                              #
# ClamWin      : http://es.clamwin.com/                                   #
# Prasadhak.ps1: https://nishang.googlecode.com/svn/trunk/Prasadhak.ps1   #
###########################################################################
 Prerequisitos
 =============
 Este script requiere la versión 3 de Power Shell.
 Descarga Version 3 de PoweShell en:

https://www.microsoft.com/en-us/download/details.aspx?id=34595

 --------------------------------------------------------------------------
 Origen de la idea
 =================
 Este script es un Mod (modificación) de Prasadhak.ps1 del  repositorio 
 http://code.google.com/p/nishang By Nikhil &quot;SamratAshok&quot; Mittal 
--------------------------------------------------------------------------
 Referencias:
 ============

http://labofapenetrationtester.blogspot.com.es/2013/01/introducing-prasadhak.html


http://code.google.com/p/nishang


https://www.virustotal.com/es/documentation/public-api/


http://es.clamwin.com/

--------------------------------------------------------------------------
 Procedimiento:
 ==============
 1 - Registrarse en https://www.virustotal.com/ y obtener la API Key pública de tu perfil
 2 - Edita el script y definir en la variable $apikey tu API Key pública de Virus Total
	por ejemplo: $apikey = &quot;39d14574f34bcd6b3597cfa8d69heafa9b8904ae5ef98bd4a8a615d25c4f6ff1&quot;
	(ojo que no es valida, es un ejemplo)
 3 - Lanzamos la consola de PowerShell con privilegios de admin
 6 - Lanzamos el script desde la consola de PowerShell: .\myClamWinPS2VirusTotal.ps1
 7 - El report o log se genera en el fichero ddMMyyyyResultadosVT.html ( 11032013Resultados.html )
 --------------------------------------------------------------------------
 Comentarios:
 ============
 1 - ClamWin se actualizará al lanzar el script el actualizador freshclam.exe (la primera vez tarda unos minutos)
 2 - Los ficheros de los procesos en memoria se obtienen del report obtenido tras lanzar clamscan.exe
     tras esto, al script solo le queda parsear y consultar los ficheros con Virus Total
 1 - Virus Total solo permite 5 consultas por minuto, por lo que se introduce un retardo (delay) de 14sg
	entre consulta y consulta. Para unos 772 ficheros encontrados en memoria se tardaria (772*14/3600)
     = unas 3 horas.
#&gt;
</pre>
<p><span style="text-decoration: underline;"><strong>Referencias:</strong></span></p>
<ul>
<li>    <a href="http://labofapenetrationtester.blogspot.com.es/2013/01/introducing-prasadhak.html" target="_blank">http://labofapenetrationtester.blogspot.com.es/2013/01/introducing-prasadhak.html</a></li>
<li>    <a href="http://code.google.com/p/nishang" target="_blank">http://code.google.com/p/nishang</a></li>
<li>   <a href="https://www.virustotal.com/es/documentation/public-api/" target="_blank"> https://www.virustotal.com/es/documentation/public-api/</a></li>
<li>   <a href="http://es.clamwin.com/" target="_blank">http://es.clamwin.com/</a></li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/03/myClamWinPS2VirusTotal-0.jpg"><img class="aligncenter size-full wp-image-8122" alt="myClamWinPS2VirusTotal-0" src="http://www.javcasta.com/blog/wp-content/uploads/2013/03/myClamWinPS2VirusTotal-0.jpg" width="650" height="506" /></a></p>
<ul>
<li><strong><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/03/myCWPS2VT.zip">Descargar Script y ficheros necesarios de ClamWin: myCWPS2VT.zip</a></strong>.</li>
</ul>
<p>Este <strong>script</strong> en <strong>PowerShell V3 </strong>es un <strong>analizador de los procesos en memoria con ClamWin y Virus Total</strong>.</p>
<p>Lanzamos la consola de <strong>PowerShell</strong> con <strong>privilegios de administrador</strong>. Y ejecutamos el script</p>
<blockquote><p><span style="color: #888888;">PS x:\camino &gt;</span> <span style="color: #ff6600;"><strong>.\myClamWinPS2VirusTotal.ps1</strong></span></p>
</blockquote>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/03/myClamWinPS2VirusTotal-1.jpg"><img class="aligncenter size-full wp-image-8127" alt="myClamWinPS2VirusTotal-1" src="http://www.javcasta.com/blog/wp-content/uploads/2013/03/myClamWinPS2VirusTotal-1.jpg" width="614" height="378" /></a></p>
<p>Tras lanzar el script se actualizará el ClamWin (si es la 1ª vez tarda un par de minutos).</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/03/myClamWinPS2VirusTotal-2.jpg"><img class="aligncenter size-full wp-image-8126" alt="myClamWinPS2VirusTotal-2" src="http://www.javcasta.com/blog/wp-content/uploads/2013/03/myClamWinPS2VirusTotal-2.jpg" width="652" height="424" /></a></p>
<p>Luego el script lanza clamscan.exe para que analice la memoria y obtenga en el log los procesos/ficheros que hay en la memoria. Dependiendo de tu PC y de lo que haya en memoria puede tardar entre 5 a 10 minutos</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/03/myClamWinPS2VirusTotal-3.jpg"><img class="aligncenter size-full wp-image-8125" alt="myClamWinPS2VirusTotal-3" src="http://www.javcasta.com/blog/wp-content/uploads/2013/03/myClamWinPS2VirusTotal-3.jpg" width="700" height="430" /></a></p>
<p>tras esto, al script solo le queda parsear y consultar los ficheros con Virus Total<br /> Virus Total solo permite<strong> 5 consultas por minuto</strong>, por lo que se introduce un retardo (delay) de 14sg   entre consulta y consulta. Para unos 772 ficheros encontrados en memoria se tardaria (772*14/3600)  = unas 3 horas.</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/03/myClamWinPS2VirusTotal-4.jpg"><img class="aligncenter size-full wp-image-8124" alt="myClamWinPS2VirusTotal-4" src="http://www.javcasta.com/blog/wp-content/uploads/2013/03/myClamWinPS2VirusTotal-4.jpg" width="700" height="340" /></a></p>
<p>Por la consola nos va mostrando el resultado del análisis. Al finalizar, se abrirá el fichero de logs o resultados.</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/03/myClamWinPS2VirusTotal-5.jpg"><img class="aligncenter size-full wp-image-8123" alt="myClamWinPS2VirusTotal-5" src="http://www.javcasta.com/blog/wp-content/uploads/2013/03/myClamWinPS2VirusTotal-5.jpg" width="650" height="433" /></a></p>
<p>Los resultados podrán ser:</p>
<ul>
<li>* Limpio: Virus Total nos indica que es un fichero no infectado</li>
</ul>
<ul>
<li>* Positivo: Virus Total nos indica que entre los 40/45 motores de antivirus, alguno reporta el fichero como infectado. Hay que abrir el link info para ver más detalles del informe de Virus Total. Si por ejemplo se trata del fichero</li>
</ul>
<blockquote><p><span style="color: #808080;">C:\Windows\System32\svchost.exe</span> con hash md5<span style="color: #808080;"> 54a47f6b5e09a77e61649109c6a08866</span></p>
</blockquote>
<p>El informe nos dice que hay un positivo entre 45 motores antivirus (1/45), por lo que al 97,8% es un<strong> falso positivo</strong> <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<ul>
<li>* ClamWin ha encontrado un positivo.: El propio ClamWin encuentra una infección</li>
</ul>
<ul>
<li>* Este fichero ya no existe: Probablemente era un temporal &#8230;</li>
</ul>
<ul>
<li>* No se encuentra en la bbdd de VT: Puedes enviarlo a <a href=" https://www.virustotal.com/" target="_blank">Virus Total</a> para su analisis.</li>
</ul>
<p>El código:<span style="color: #888888;"> (continuar &#8230;)</span></p>
<p><span id="more-8121"></span></p>
<pre class="brush: bash; title: ; notranslate">
#Requires -Version 3
&lt;#
###########################################################################
#           PowerShell V3 script - myClamWinPS2VirusTotal.ps1             #
# ----------------------------------------------------------------------- #
#         Analizador de Procesos en memoria con ClamWin &amp; Virus Total     #
# ----------------------------------------------------------------------- #
#             By Javier Castañon - http://javcasta.com/                   #
###########################################################################
# Virus Total  : https://www.virustotal.com/                              #
# ClamWin      : http://es.clamwin.com/                                   #
# Prasadhak.ps1: https://nishang.googlecode.com/svn/trunk/Prasadhak.ps1   #
###########################################################################
 Prerequisitos
 =============
 Este script requiere la versión 3 de Power Shell.
 Descarga Version 3 de PoweShell en:

https://www.microsoft.com/en-us/download/details.aspx?id=34595

 --------------------------------------------------------------------------
 Origen de la idea
 =================
 Este script es un Mod (modificación) de Prasadhak.ps1 del  repositorio 
 http://code.google.com/p/nishang By Nikhil &quot;SamratAshok&quot; Mittal 
--------------------------------------------------------------------------
 Referencias:
 ============

http://labofapenetrationtester.blogspot.com.es/2013/01/introducing-prasadhak.html


http://code.google.com/p/nishang


https://www.virustotal.com/es/documentation/public-api/


http://es.clamwin.com/

--------------------------------------------------------------------------
 Procedimiento:
 ==============
 1 - Registrarse en https://www.virustotal.com/ y obtener la API Key pública de tu perfil
 2 - Edita el script y definir en la variable $apikey tu API Key pública de Virus Total
	por ejemplo: $apikey = &quot;39d14574f34bcd6b3597cfa8d69heafa9b8904ae5ef98bd4a8a615d25c4f6ff1&quot;
	(ojo que no es valida, es un ejemplo)
 3 - Lanzamos la consola de PowerShell con privilegios de admin
 6 - Lanzamos el script desde la consola de PowerShell: .\myClamWinPS2VirusTotal.ps1
 7 - El report o log se genera en el fichero ddMMyyyyResultadosVT.html ( 11032013Resultados.html )
 --------------------------------------------------------------------------
 Comentarios:
 ============
 1 - ClamWin se actualizará al lanzar el script el actualizador freshclam.exe (la primera vez tarda unos minutos)
 2 - Los ficheros de los procesos en memoria se obtienen del report obtenido tras lanzar clamscan.exe
     tras esto, al script solo le queda parsear y consultar los ficheros con Virus Total
 1 - Virus Total solo permite 5 consultas por minuto, por lo que se introduce un retardo (delay) de 14sg
	entre consulta y consulta. Para unos 772 ficheros encontrados en memoria se tardaria (772*14/3600)
     = unas 3 horas.
#&gt;
######################################################################
# Registrate en https://www.virustotal.com y obten tu Public API Key #
######################################################################
$apikey = &quot;TU API KEY&quot;
######################################################################
$reqcount = 1
#Obtenemos procesos en memoria con clamwin con resultados a ddMMyyyyps.txt (p.e: 11032013ps.txt )
Write-Host &quot;Actualizando ClamWin ...&quot; -ForegroundColor Cyan
$namearchivo = Get-Date -Format ddMMyyyy
$namearchivo = $namearchivo + &quot;ps.txt&quot;
$clamwin = &quot;clamscan.exe&quot;
$comando = &quot; --memory -l $namearchivo&quot;
#actualizamos clamwin
Start-Process -FilePath &quot;freshclam.exe&quot; -ArgumentList &quot; --datadir=.\&quot; -Wait
#lanzamos clamscan para analizar la memoria y obtener procesos
Write-Host &quot;Obteniendo y analizando procesos en memoria con ClamWin ... tarda unos minutos (alrededor de 5 a 10 minutos)&quot; -ForegroundColor Yellow
Start-Process -FilePath $clamwin -ArgumentList $comando -Wait
# seleccionamos solo los path\fichero del report de clamwin
$regex = '\b[A-Za-z]+\:+\\\b' # c:\loquesea - z:\loquesea
$archivo = get-content $namearchivo | Select-String $regex
# numero de ficheros a escanear
$nlineas = 0
foreach ($linea in $archivo) {
		$nlineas++
}
Write-Host &quot;Analizando Procesos en memoria con Virus Total&quot; -ForegroundColor Cyan
Write-Host &quot;Tiempo estimado del analisis para &quot; $nlineas &quot;ficheros =&quot; (($nlineas * 14)/60) &quot;minutos o&quot;  (($nlineas * 14)/3600) &quot;horas&quot;
$ErrorActionPreference = &quot;SilentlyContinue&quot;
$hash = &quot;&quot;
$milog = [string] (Get-Date -Format ddMMyyyy) + &quot;ResultadosVT.html&quot;
Write-Host &quot;El log en &quot; $milog
echo &quot;&lt;html&gt;
&lt;head&gt;
&lt;style type='text/css'&gt;
.style1 {
	background-color: #FF0000;
}
.style2 {
	border: 1px solid #808080;
}
.style3 {
	background-color: #FFFF00;
}
.style4 {
	background-color: #00FF00;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;myClamWinPS2VirusTotal.ps1&lt;/h1&gt;
&lt;h3&gt;By JavCasta - &lt;a target='_blank' href='http://javcasta.com/'&gt;JavCasta.com&lt;/a&gt;&lt;/h3&gt;&quot; | Out-File $milog
# sellado de tiempo del analisis al fichero de logs
echo &quot;&lt;h2&gt;&quot; | Out-File $milog -append 
Get-Date | Out-File $milog -append 
echo &quot;&lt;/h2&gt;&quot; | Out-File $milog -append 
echo &quot;&lt;p&gt;Los ficheros que no se encuentren en la bbdd de VT se pueden enviar via web para su analisis 
a:&lt;a target='_blank' href='https://www.virustotal.com/es/'&gt;https://www.virustotal.com/es/&lt;/a&gt;&lt;/p&gt;
&lt;hr /&gt;&lt;h3&gt;Resultado analisis:&lt;/h3&gt;
&lt;table style='width: 100%'&gt;
	&lt;tr&gt;
		&lt;td class='style2'&gt;Fichero / Proceso&lt;/td&gt;
		&lt;td class='style2'&gt;hash md5&lt;/td&gt;
		&lt;td class='style2'&gt;Resultado&lt;/td&gt;
		&lt;td class='style2'&gt;Info&lt;/td&gt;
	&lt;/tr&gt;

&quot; | Out-File $milog -append 

function post_http($url,$parameters)
{
	$http_request = New-Object -ComObject Msxml2.XMLHTTP
	$http_request.open(&quot;POST&quot;, $url, $false)
	$http_request.setRequestHeader(&quot;Content-type&quot;,&quot;application/x-www-form-urlencoded&quot;)
	$http_request.setRequestHeader(&quot;Content-length&quot;, $parameters.length);
	$http_request.setRequestHeader(&quot;Connection&quot;, &quot;close&quot;)
	$http_request.send($parameters)
	$script:response = $http_request.responseText
}

function check
{
	$res = $response | ConvertFrom-JSON
	foreach ($code in $res)
	{
		if ($code.response_code -eq 0)
		{
			Write-Host $reqcount &quot;de&quot; $nlineas &quot;:&quot; $elfichero $hash &quot;No se encuentra en la base de datos de VT. &quot; -ForegroundColor Yellow
			echo &quot;&lt;tr&gt;&lt;td class='style2'&gt;&lt;strong&gt;&quot; $elfichero &quot;&lt;/strong&gt;&lt;/td&gt;&lt;td class='style2'&gt;&quot; $hash &quot;&lt;/td&gt;&lt;td class='style2'&gt;&lt;span class='style3'&gt;No se encuentra&lt;/span&gt; en la base de datos de VT. &quot; &quot;&lt;/td&gt;&lt;td class='style2'&gt;&lt;/td&gt;&lt;/tr&gt;&quot; | Out-File $milog -append 
		}
		elseif (($code.response_code -eq 1) -and ($code.positives -ne 0))
		{
			Write-Host $reqcount &quot;de&quot; $nlineas &quot;:&quot; $elfichero $hash &quot;Se ha encontrado un positivo. &quot; -ForegroundColor Yellow  -backgroundcolor Red
			$code.Permalink
			echo &quot;&lt;tr&gt;&lt;td class='style2'&gt;&lt;strong&gt;&quot; $elfichero &quot;&lt;/strong&gt;&lt;/td&gt;&lt;td class='style2'&gt;&quot; $hash &quot;&lt;/td&gt;&lt;td class='style2'&gt;Se ha encontrado un &lt;span class='style1'&gt; positivo.&lt;/span&gt;&quot; &quot;&lt;/td&gt;&lt;td class='style2'&gt;&lt;a target='_blank' href='&quot; $code.Permalink &quot;'&gt; Info&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&quot; | Out-File $milog -append 
		}
		elseif (($code.response_code -eq 1))
		{
			Write-Host $reqcount &quot;de&quot; $nlineas &quot;:&quot; $elfichero $hash &quot;Reportado como Limpio. &quot; -ForegroundColor Green
			echo &quot;&lt;tr&gt;&lt;td class='style2'&gt;&lt;strong&gt;&quot; $elfichero &quot;&lt;/strong&gt;&lt;/td&gt;&lt;td class='style2'&gt;&quot; $hash &quot;&lt;/td&gt;&lt;td class='style2'&gt;Reportado como &lt;span class='style4'&gt;Limpio&lt;/span&gt;. &quot; &quot;&lt;/td&gt;&lt;td class='style2'&gt;&lt;/td&gt;&quot; | Out-File $milog -append 
		}
		elseif ($res.response_code -eq -2)
		{
			Write-Host $reqcount &quot;de&quot; $nlineas &quot;:&quot; $elfichero $hash &quot;Archivo en cola para análisis. &quot; -ForegroundColor Cyan
			$code.Permalink
			echo &quot;&lt;tr&gt;&lt;td class='style2'&gt;&lt;strong&gt;&quot; $elfichero &quot;&lt;/strong&gt;&lt;/td&gt;&lt;td class='style2'&gt;&quot; $hash &quot;&lt;/td&gt;&lt;td class='style2'&gt;Archivo en cola para análisis. &quot; &quot;&lt;/td&gt;&lt;td class='style2'&gt;&lt;a target='_blank' href='&quot; $code.Permalink &quot;'&gt;Info&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&quot; | Out-File $milog -append 
		}
	}
}

# BEGIN PP
foreach ($linea in $archivo){
	[string] $elfichero = $linea
	[string] $elfichero = $elfichero.Replace(&quot;: OK&quot;, &quot;&quot;)
	if ($elfichero.Contains(&quot; FOUND&quot;)) { 
		$reqcount++
		Write-Host $reqcount &quot;de&quot; $nlineas &quot;:&quot; $elfichero &quot; ClamWin ha encontrado un positivo &quot; -ForegroundColor Red  -backgroundcolor Yellow
		echo &quot;&lt;tr&gt;&lt;td class='style2'&gt;&lt;strong&gt;&quot; $linea &quot;&lt;/strong&gt;&lt;/td&gt;&lt;td class='style2'&gt;&lt;/td&gt;&lt;td class='style2'&gt; Clamwin ha encontrado un &lt;span class='style1'&gt; positivo.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&quot; | Out-File $milog -append 
	}
	else {  
		$FileExists = (Test-Path $elfichero -PathType Leaf)
		if (!$FileExists) {
			Write-Host $reqcount &quot;de&quot; $nlineas &quot;:&quot; $elfichero &quot; Este fichero ya no existe&quot; -ForegroundColor Cyan
			echo &quot;&lt;tr&gt;&lt;td class='style2'&gt;&lt;strong&gt;&quot; $elfichero &quot;&lt;/strong&gt;&lt;/td&gt;&lt;td class='style2'&gt;&lt;/td&gt;&lt;td class='style2'&gt;Este fichero ya no existe. &quot; &quot;&lt;/td&gt;&lt;/tr&gt;&quot; | Out-File $milog -append 
			$reqcount++
		}
		if ($FileExists) {
			$md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
			$hash = [System.BitConverter]::ToString($md5.ComputeHash([System.IO.File]::ReadAllBytes($elfichero))).Replace(&quot;-&quot;, &quot;&quot;).ToLower()
			Post_http &quot;https://www.virustotal.com/vtapi/v2/file/report&quot; &quot;resource=$hash&amp;apikey=$apikey&quot;
			check
			if ($reqcount -lt $nlineas) { Start-Sleep -seconds 14 }
			$reqcount++
		}
	}
}

echo &quot;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;&quot; | Out-File $milog -append 
Start-Process $milog
</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%2F2013%2F03%2F12%2Fpowershell-v3-script-myclamwinps2virustotal-ps1-analizador-de-procesos-en-memoria-con-clamwin-virus-total%2F&amp;title=PowerShell%20V3%20Script%20%E2%80%93%20myClamWinPS2VirusTotal.ps1%20Analizador%20de%20Procesos%20en%20memoria%20con%20ClamWin%20%26%20Virus%20Total" 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><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=1ZDriCj-Iv0:q5WbCFKliNY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=1ZDriCj-Iv0:q5WbCFKliNY:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=1ZDriCj-Iv0:q5WbCFKliNY:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=1ZDriCj-Iv0:q5WbCFKliNY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=1ZDriCj-Iv0:q5WbCFKliNY:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=1ZDriCj-Iv0:q5WbCFKliNY:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=1ZDriCj-Iv0:q5WbCFKliNY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=1ZDriCj-Iv0:q5WbCFKliNY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=1ZDriCj-Iv0:q5WbCFKliNY:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=1ZDriCj-Iv0:q5WbCFKliNY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=1ZDriCj-Iv0:q5WbCFKliNY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=1ZDriCj-Iv0:q5WbCFKliNY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=1ZDriCj-Iv0:q5WbCFKliNY:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=1ZDriCj-Iv0:q5WbCFKliNY:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=1ZDriCj-Iv0:q5WbCFKliNY:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=1ZDriCj-Iv0:q5WbCFKliNY:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=1ZDriCj-Iv0:q5WbCFKliNY:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=1ZDriCj-Iv0:q5WbCFKliNY:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~4/1ZDriCj-Iv0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2013/03/12/powershell-v3-script-myclamwinps2virustotal-ps1-analizador-de-procesos-en-memoria-con-clamwin-virus-total/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<media:content url="http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~5/zWnkUyf66jY/myCWPS2VT.zip" fileSize="1298859" type="application/zip" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>Referencias:     http://labofapenetrationtester.blogspot.com.es/2013/01/introducing-prasadhak.html     http://code.google.com/p/nishang    https://www.virustotal.com/es/documentation/public-api/    http://es.clamwin.com/ Descargar Script y ficheros necesa</itunes:subtitle><itunes:author>Javier Castañón</itunes:author><itunes:summary>Referencias:     http://labofapenetrationtester.blogspot.com.es/2013/01/introducing-prasadhak.html     http://code.google.com/p/nishang    https://www.virustotal.com/es/documentation/public-api/    http://es.clamwin.com/ Descargar Script y ficheros necesarios de ClamWin: myCWPS2VT.zip. Este script en PowerShell V3 es un analizador de los procesos en memoria con ClamWin y Virus Total. Lanzamos la consola de PowerShell con privilegios de administrador. Y ejecutamos el script PS x:\camino &amp;#62; .\myClamWinPS2VirusTotal.ps1 Tras lanzar el [...]</itunes:summary><itunes:keywords>ciencia,zen,técnico,sistemas,script,informática,currículum,aforismos,literatura,filosofía,linux,windows</itunes:keywords><feedburner:origLink>http://www.javcasta.com/2013/03/12/powershell-v3-script-myclamwinps2virustotal-ps1-analizador-de-procesos-en-memoria-con-clamwin-virus-total/</feedburner:origLink><enclosure url="http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~5/zWnkUyf66jY/myCWPS2VT.zip" length="1298859" type="application/zip" /><feedburner:origEnclosureLink>http://www.javcasta.com/blog/wp-content/uploads/2013/03/myCWPS2VT.zip</feedburner:origEnclosureLink></item>
		<item>
		<title>PhP – Baneador de IPs con PhP mediante redirect 301 en .htaccess</title>
		<link>http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~3/JJ05JpdGkQ0/</link>
		<comments>http://www.javcasta.com/2013/03/08/php-baneador-de-ips-con-php-mediante-redirect-301-en-htaccess/#comments</comments>
		<pubDate>Fri, 08 Mar 2013 09:25:49 +0000</pubDate>
		<dc:creator>fj.castanon@gmail.com (Javier Castañón)</dc:creator>
				<category><![CDATA[Blogs]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[PhP]]></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=8118</guid>
		<description><![CDATA[Referencia: http://devildrey33.es/SeguridadServidorWeb.php En la página web http://devildrey33.es/ ( que es un ejemplo de la potencia de HTML5 y CSS3 ) , me encontré con un script en PhP para evitar accesos a ciertos directorios o carpetas (existentes o no) en una web. El método es simple: En el fichero .htaccess implementa un redirect 301 (hay [...]]]></description>
				<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2013%2F03%2F08%2Fphp-baneador-de-ips-con-php-mediante-redirect-301-en-htaccess%2F"></g:plusone><br /><!-- tweet id : 309958142672916481 --><style type='text/css'>#bbpBox_309958142672916481 a { text-decoration:none; color:#2FC2EF; }#bbpBox_309958142672916481 a:hover { text-decoration:underline; }</style><div id='bbpBox_309958142672916481' 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: PhP - Baneador de IPs con PhP mediante redirect 301 en .htaccess - <a href="http://t.co/o9W9zvjSym" rel="nofollow">http://t.co/o9W9zvjSym</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 08/03/2013 09:25' href='http://twitter.com/#!/javcasta/status/309958142672916481' target='_blank'>08/03/2013 09:25</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=309958142672916481' 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=309958142672916481' 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=309958142672916481' 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://a0.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 />
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/03/banear.jpg"><img class="aligncenter size-full wp-image-8119" alt="banear" src="http://www.javcasta.com/blog/wp-content/uploads/2013/03/banear.jpg" width="650" height="166" /></a></p>
<p>Referencia:</p>
<ul>
<li><a href="http://devildrey33.es/SeguridadServidorWeb.php" target="_blank">http://devildrey33.es/SeguridadServidorWeb.php</a></li>
</ul>
<p>En la página web <a href="http://devildrey33.es/" target="_blank">http://devildrey33.es/</a> ( que es un ejemplo de la potencia de<strong> <a href="https://es.wikipedia.org/wiki/HTML5" target="_blank">HTML5</a></strong> y<strong> CSS3</strong> ) , me encontré con un <strong>script</strong> en <strong>PhP</strong> para<strong> evitar accesos a ciertos directorios o carpetas (existentes o no) en una web</strong>.</p>
<p>El método es simple: En el fichero<strong> .htaccess</strong> implementa un <strong>redirect 301</strong> (hay que tener  habilitado en <strong>Apache</strong> la directiva redirect) por cada carpeta a proteger, hacia el script php que se encarga: 1º de avisar al intruso, y si es reiterado el intento, de <strong>banear la ip</strong> del visitante indiscreto.</p>
<p>Por ejemplo sea un <strong>.htaccess</strong> :</p>
<blockquote><p><span style="color: #888888;">&lt;Limit GET&gt;</span><br /> <span style="color: #888888;">order allow,deny</span><br /> <span style="color: #888888;">#INICIO ips baneadas</span><br /> <span style="color: #888888;">deny from 213.5.64.19         #spamer conocido</span><br /> <span style="color: #888888;">deny from 37.28.156.211</span><br /> <span style="color: #888888;">#FIN ips baneadas</span><br /> <span style="color: #888888;">allow from all</span><br /> <span style="color: #888888;">&lt;/Limit&gt;</span></p>
<p><span style="color: #888888;">#Redirecciones </span><br /> <span style="color: #888888;">Redirect 301 /sprawdza.php    http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /muieblackcat                 http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /admin                     http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /admin/pma                 http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /db                     http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /dbadmin                 http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /myadmin                 http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /mysql                     http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /mysqladmin                 http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /typo3/phpmyadmin             http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /phpadmin                 http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /phpMyAdmin                 http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /phpmyadmin                 http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /phpmyadmin1                 http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /phpmyadmin2                 http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /pma                     http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /web/phpMyAdmin             http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /xampp/phpmyadmin             http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /websql                 http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /phpMyAdmin-2                 http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /php-my-admin                 http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /phpMyAdmin-2.2.3             http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /phpMyAdmin-2.2.6             http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /phpMyAdmin-2.5.1             http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /phpMyAdmin-2.5.4             http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /phpMyAdmin-2.5.5-rc1         http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /phpMyAdmin-2.5.5-rc2         http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /phpMyAdmin-2.5.5-pl1         http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /phpMyAdmin-2.5.6-rc1         http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /phpMyAdmin-2.5.6-rc2         http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /phpMyAdmin-2.5.6             http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /phpMyAdmin-2.5.7             http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /phpMyAdmin-2.5.7-pl1         http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /wp-login.php                 http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /blog/wp-login.php             http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /wordpress/wp-login.php         http://piymenta.dyndns-at-work.com/BanearIP.php</span><br /> <span style="color: #888888;">Redirect 301 /wp/wp-login.php             http://piymenta.dyndns-at-work.com/BanearIP.php</span></p>
</blockquote>
<p>Cada linea con el redirect 301 y la carpeta redirigen el tráfico hasta el script php <strong>BanearIP.php</strong></p>
<p>Si el intento de intrusión es más de una vez, incluye la ip ( <span style="color: #808080;">$_SERVER['REMOTE_ADDR']</span> ) del intruso en la sección <span style="color: #808080;">&lt; limit &gt;</span> del .htaccess con un<span style="color: #808080;"> deny from laIP</span></p>
<p>El código de BanearIP.php<br /> <span style="color: #888888;">Continuar &#8230;</span> <span id="more-8118"></span></p>
<blockquote><p><span style="color: #ff6600;">&lt;?php</span><br /> <span style="color: #ff6600;">    if (!isset($_SESSION)) session_start();</span><br /> <span style="color: #ff6600;">    </span><br /> <span style="color: #ff6600;">    // Contador de actividades no permitidas</span><br /> <span style="color: #ff6600;">    if (isset($_SESSION["AvisoDeBaneado"])) $_SESSION["AvisoDeBaneado"] ++;</span><br /> <span style="color: #ff6600;">    else                                    $_SESSION["AvisoDeBaneado"] = 1;</span><br /> <span style="color: #ff6600;">    </span><br /> <span style="color: #ff6600;">    if ($_SESSION["AvisoDeBaneado"] == 1) {</span><br /> <span style="color: #ff6600;">        // Aviso de actividad no permitida</span><br /> <span style="color: #ff6600;">        echo &#8220;&lt;html&gt;&lt;head&gt;&lt;meta http-equiv=&#8217;Content-Type&#8217; content=&#8217;text/html; charset=utf-8&#8242; /&gt;&lt;/head&gt;&lt;body&gt;</span><br /> <span style="color: #ff6600;">        &lt;h1&gt;Atencion! has realizado una actividad no permitida, si lo vuelves a intentar seras baneado.&lt;/h1&gt;</span><br /> <span style="color: #ff6600;">    &lt;a target=&#8217;_blank&#8217; href=&#8217;http://devildrey33.es/SeguridadServidorWeb.php&#8217;&gt;PhP Script Powered By devildrey33.es&lt;/a&gt;&lt;br /&gt;</span><br /> <span style="color: #ff6600;">     &lt;a target=&#8217;_blank&#8217; href=&#8217;http://piymenta.dyndns-at-work.com&#8217;&gt;PIyMenta&lt;/a&gt;</span></p>
<p><span style="color: #ff6600;">        &lt;/body&gt;&lt;/html&gt;&#8221;;</span><br /> <span style="color: #ff6600;">    }</span><br /> <span style="color: #ff6600;">    else {</span><br /> <span style="color: #ff6600;">        if (BanearIP() == TRUE) {</span><br /> <span style="color: #ff6600;">            // Banear actividad no permitida</span><br /> <span style="color: #ff6600;">            echo &#8220;&lt;html&gt;&lt;body&gt;</span><br /> <span style="color: #ff6600;">            &lt;h1&gt;IP &#8220;.$_SERVER['REMOTE_ADDR'].&#8221; BANEADA que tengas un buen dia.&lt;/h1&gt;</span><br /> <span style="color: #ff6600;">            &lt;/body&gt;&lt;/html&gt;&#8221;;        </span><br /> <span style="color: #ff6600;">        }</span><br /> <span style="color: #ff6600;">    }</span><br /> <span style="color: #ff6600;">    </span><br /> <span style="color: #ff6600;">    function BanearIP($HTACCESS = &#8220;.htaccess&#8221;) {</span><br /> <span style="color: #ff6600;">        // Leo el .htaccess en la variable $Txthta</span><br /> <span style="color: #ff6600;">        $Archivo = fopen($HTACCESS, &#8220;r&#8221;);</span><br /> <span style="color: #ff6600;">        $Txthta = fread($Archivo, filesize($HTACCESS));</span><br /> <span style="color: #ff6600;">        fclose($Archivo);</span><br /> <span style="color: #ff6600;">            </span><br /> <span style="color: #ff6600;">        // Nueva IP para banear (\r\n es un salto de l�nea valido para windows, en linux se omite \r)</span><br /> <span style="color: #ff6600;">        $NuevaIP = &#8220;\n&#8221;.&#8221;deny from &#8220;.$_SERVER['REMOTE_ADDR'];</span><br /> <span style="color: #ff6600;">        // Comentario que debemos buscar</span><br /> <span style="color: #ff6600;">        $TxtIpBaneada = &#8220;#INICIO ips baneadas&#8221;;</span><br /> <span style="color: #ff6600;">        // Obtenemos la posici�n donde empieza el comentario</span><br /> <span style="color: #ff6600;">        $Posicion = strpos($Txthta, $TxtIpBaneada);</span><br /> <span style="color: #ff6600;">        // No se ha encontrado el comentario salimos&#8230;..</span><br /> <span style="color: #ff6600;">        if ($Posicion === FALSE) return FALSE;</span><br /> <span style="color: #ff6600;">        // Sumamos el tama�o del comentario</span><br /> <span style="color: #ff6600;">        $Posicion += strlen($TxtIpBaneada);</span><br /> <span style="color: #ff6600;">        // Guardo el .htaccess con la nueva ip baneada</span><br /> <span style="color: #ff6600;">        $Archivo = fopen($HTACCESS, &#8220;w&#8221;);</span><br /> <span style="color: #ff6600;">        // Guardamos desde el inicio hasta el comentario (incluyendo el mismo)</span><br /> <span style="color: #ff6600;">        fwrite($Archivo, substr($Txthta, 0, $Posicion), $Posicion);</span><br /> <span style="color: #ff6600;">        // Guardamos la nueva ip</span><br /> <span style="color: #ff6600;">        fwrite($Archivo, $NuevaIP, strlen($NuevaIP));</span><br /> <span style="color: #ff6600;">        // Guardamos el resto del archivo</span><br /> <span style="color: #ff6600;">        fwrite($Archivo, substr($Txthta, $Posicion, strlen($Txthta) &#8211; $Posicion), strlen($Txthta) &#8211; $Posicion);</span><br /> <span style="color: #ff6600;">        fclose($Archivo);</span><br /> <span style="color: #ff6600;">        return TRUE;</span><br /> <span style="color: #ff6600;">    }</span><br /> <span style="color: #ff6600;">?&gt;</span></p>
</blockquote>
<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%2F2013%2F03%2F08%2Fphp-baneador-de-ips-con-php-mediante-redirect-301-en-htaccess%2F&amp;title=PhP%20%E2%80%93%20Baneador%20de%20IPs%20con%20PhP%20mediante%20redirect%20301%20en%20.htaccess" 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><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=JJ05JpdGkQ0:nyVmSJUnxeQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=JJ05JpdGkQ0:nyVmSJUnxeQ:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=JJ05JpdGkQ0:nyVmSJUnxeQ:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=JJ05JpdGkQ0:nyVmSJUnxeQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=JJ05JpdGkQ0:nyVmSJUnxeQ:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=JJ05JpdGkQ0:nyVmSJUnxeQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=JJ05JpdGkQ0:nyVmSJUnxeQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=JJ05JpdGkQ0:nyVmSJUnxeQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=JJ05JpdGkQ0:nyVmSJUnxeQ:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=JJ05JpdGkQ0:nyVmSJUnxeQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=JJ05JpdGkQ0:nyVmSJUnxeQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=JJ05JpdGkQ0:nyVmSJUnxeQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=JJ05JpdGkQ0:nyVmSJUnxeQ:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=JJ05JpdGkQ0:nyVmSJUnxeQ:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=JJ05JpdGkQ0:nyVmSJUnxeQ:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=JJ05JpdGkQ0:nyVmSJUnxeQ:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~4/JJ05JpdGkQ0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2013/03/08/php-baneador-de-ips-con-php-mediante-redirect-301-en-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javcasta.com/2013/03/08/php-baneador-de-ips-con-php-mediante-redirect-301-en-htaccess/</feedburner:origLink></item>
		<item>
		<title>PhP phpqrcode – Generador de QRCode</title>
		<link>http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~3/7ZVYaa15xBM/</link>
		<comments>http://www.javcasta.com/2013/03/02/php-phpqrcode-generador-de-qrcode/#comments</comments>
		<pubDate>Sat, 02 Mar 2013 17:22:07 +0000</pubDate>
		<dc:creator>fj.castanon@gmail.com (Javier Castañón)</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[PhP]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Tecnología]]></category>
		<category><![CDATA[Utilidades]]></category>

		<guid isPermaLink="false">http://www.javcasta.com/?p=8108</guid>
		<description><![CDATA[Referencia:  http://phpqrcode.sourceforge.net/ https://es.wikipedia.org/wiki/C%C3%B3digo_QR En Sourceforge.net , encontré un proyecto minimalista (un solo fichero PhP) para generar QRCode con PhP. Y lo implementé de esta manera: No soporto iframes El código: Y voila]]></description>
				<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2013%2F03%2F02%2Fphp-phpqrcode-generador-de-qrcode%2F"></g:plusone><br /><p><!-- tweet id : 307903317139402753 --><style type='text/css'>#bbpBox_307903317139402753 a { text-decoration:none; color:#2FC2EF; }#bbpBox_307903317139402753 a:hover { text-decoration:underline; }</style><div id='bbpBox_307903317139402753' 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: PhP phpqrcode - Generador de QRCode <a href="http://t.co/HGprS2IZOO" rel="nofollow">http://t.co/HGprS2IZOO</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 02/03/2013 17:20' href='http://twitter.com/#!/javcasta/status/307903317139402753' target='_blank'>02/03/2013 17:20</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=307903317139402753' 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=307903317139402753' 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=307903317139402753' 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://a0.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://phpqrcode.sourceforge.net/" target="_blank"> http://phpqrcode.sourceforge.net/</a></li>
<li><a href="https://es.wikipedia.org/wiki/C%C3%B3digo_QR" target="_blank">https://es.wikipedia.org/wiki/C%C3%B3digo_QR</li>
</ul>
<p>En<a href="http://sourceforge.net/" target="_blank"> Sourceforge.net</a> , encontré un proyecto minimalista (un solo fichero PhP) para generar QRCode con PhP. Y lo implementé de esta manera:</p>
<p><iframe src="http://piymenta.dyndns-at-work.com/qrcode/generarqrcode.php" width="100%" height="250">No soporto iframes</iframe><br />
<img src="http://piymenta.dyndns-at-work.com/qrcode/qrcode.gif"></p>
<p>El código:</p>
<p><span id="more-8108"></span></p>
<pre class="brush: php; title: ; notranslate">
&lt;h2&gt;Generador de QR-Code&lt;/h2&gt;
&lt;form action=&quot;generarqrcode.php&quot; method=&quot;post&quot; &gt;
        Datos:&amp;nbsp;&lt;input name=&quot;data&quot; value=&quot;http://javcasta.com/&quot; /&gt;&amp;nbsp;
        &lt;input type=&quot;submit&quot; value=&quot;GENERAR QR-Code&quot;&gt;
&lt;/form&gt;
&lt;a href=&quot;http://phpqrcode.sourceforge.net/&quot; target=&quot;_blank&quot;&gt;Powered By http://phpqrcode.sourceforge.net/&lt;/a&gt;&lt;hr /&gt;
&lt;a href=&quot;http://piymenta.dyndns-at-work.com/&quot; target=&quot;_blank&quot;&gt;PIyMenta&lt;/a&gt;&lt;hr /&gt;

&lt;?PhP
class QR {//Licensed under GPLv3, full text at http://www.gnu.org/licenses/gpl-3.0.txt
	const ECC_L = 1;
	const ECC_M = 0;
	const ECC_Q = 3;
	const ECC_H = 2;
	const NUM = 1;
	const ALPHA = 2;
	const APP = 3;
	const BIN = 4;
	const FNC1_1 = 5;
	const ECI = 7;
	const KANJI = 8;
	const FNC1_2 = 9;
	public function __construct($data,$ecc=self::ECC_M){//Main Routine
	$this-&gt;prepare((string)$data,(integer)$ecc);
	$this-&gt;frame();
	$this-&gt;reedsolomon();
	$this-&gt;mask();
	$this-&gt;format();
	}
	private function prepare($data,$ecc){//Validate Data
	$ver=0;$len=strlen($data);$this-&gt;type=self::BIN;$ecc=min(max(intval($ecc),self::ECC_M),self::ECC_Q);
	if(!preg_match('{[^0-9]}',$data)){$this-&gt;type=self::NUM;}
	elseif(!preg_match('{[^A-Z0-9 $%*+\-./:]}',$data)){$this-&gt;type=self::ALPHA;}
	elseif(mb_detect_encoding($data,'SJIS',true) &amp;&amp; preg_match('{[\x81-\x9F\xE0-\xEF]}',$data)){$this-&gt;type=self::KANJI;}
	while($ver!=40){if(self::$ver[$this-&gt;type][$ver*4+$ecc]&gt;$len){break;}$ver++;}//Check string length
	if($ver==40){die('String Length Exceeded for Datatype '.$this-&gt;type);}
	$this-&gt;data=$data;$this-&gt;vers=$ver;$this-&gt;dim=4*($ver+1)+17;$this-&gt;ecc=$ecc;//Register properties
	$this-&gt;img=str_split(str_pad('',pow($this-&gt;dim,2),'4'),$this-&gt;dim);
	$data=$this-&gt;data;$c=strlen($data);$rem='';//Begin formatting data
	switch($this-&gt;type){
	case self::NUM:$data=str_split($data,3);if($c%3!=0){$rem=self::bits(intval(array_pop($data)),($c%3)*3+1);}
		foreach($data as &amp;$d){$d=self::bits(intval($d),10);}$data[]=$rem;break;
	case self::ALPHA:$data=str_split($data,2);if($c%2==1){$rem=self::bits(self::$alpha[array_pop($data)],6);}
		foreach($data as &amp;$d){$d=self::bits(self::$alpha[$d[0]]*45+self::$alpha[$d[1]],11);}$data[]=$rem;break;
	case self::BIN:$data=str_split($data);foreach($data as &amp;$d){$d=self::bits(ord($d),8);}break;
	case self::KANJI:$data=str_split($data,2);foreach($data as &amp;$d){if($d&gt;=0xe040){$d-=0xc140;}else{$d-=0x8140;}
		$d=self::bits(($d&gt;&gt;8)*0xC0+($d&amp;0xFF),13);}break;}//Combine strings
	$this-&gt;data=self::bits($this-&gt;type,4).self::bits($c,self::$char[floor($this-&gt;vers/17+7/17)][$this-&gt;type]).implode('',$data);
	$cap=self::$ebl[$this-&gt;vers*4+$this-&gt;ecc];$cap=($cap[0]*$cap[1]+(isset($cap[2])?$cap[2]*$cap[3]:0))*8;
	$rem=$cap-strlen($this-&gt;data);//Terminate, pad, split
	if($rem&gt;0){$this-&gt;data.=str_pad('',min(4,$rem),'0');$this-&gt;data.=str_pad('',8-strlen($this-&gt;data)%8,'0');
	$this-&gt;data.=str_pad('',$cap-strlen($this-&gt;data),'11101100'.'00010001');}
	$this-&gt;data=str_split($this-&gt;data,8);foreach($this-&gt;data as &amp;$d){$d=bindec($d);}
	}
	private function frame(){//Initialize frame
	$align='1111110001101011000111111';$time=str_pad('',$this-&gt;dim-14,'01');
	$pos='1111111100000110111011011101101110110000011111111';$blank=str_pad('',8,'0');
	$this-&gt;place($pos,7,0,0);$this-&gt;place($pos,7,$this-&gt;dim-7,0);//Position
	$this-&gt;place($pos,7,0,$this-&gt;dim-7);$this-&gt;place($blank,1,$this-&gt;dim-8,0);//Format Regions
	$this-&gt;place($blank,8,0,$this-&gt;dim-8);$blank.=$blank;
	$this-&gt;place($blank,8,$this-&gt;dim-8,7);$this-&gt;place($blank,2,7,$this-&gt;dim-8);
	$this-&gt;place($blank,2,7,0);$blank.='00';$this-&gt;place($blank,9,0,7);//Timing, Dark Module
	$this-&gt;place($time,$this-&gt;dim-14,7,6);$this-&gt;place($time,1,6,7);$this-&gt;img[$this-&gt;dim-8][8]='1';
	if($this-&gt;vers&gt;0){$this-&gt;place($align,5,$this-&gt;dim-9,$this-&gt;dim-9);//Alignment
	if($this-&gt;vers&gt;5){$a=floor(($this-&gt;dim-17)/28)+2;$p=($this-&gt;dim-13)/($a-1);
	$c=0;while($c&lt;$a){$r=0;if($c==0 || $c==$a-1){$r=1;}
	while($r&lt;$a){$this-&gt;place($align,5,$p*$c+4,$p*$r+4);$r++;
	if($r==$a-1 &amp;&amp; ($c==0 || $c==$a-1)){break;}}$c++;}//Version Regions
	$this-&gt;place($blank,3,$this-&gt;dim-11,0);$this-&gt;place($blank,6,0,$this-&gt;dim-11);}}
	}//0,1 = frame, 2,3 = data, 4 = empty
	private function reedSolomon(){$b=self::$ebl[$this-&gt;vers*4+$this-&gt;ecc];//Get ECC structure
	$c=$b[0]+(isset($b[2])?$b[2]:0);$d=$b[0]*$b[1]+(isset($b[2])?$b[2]*$b[3]:0);
	$e=(floor(self::$cap[$this-&gt;vers]/8)-$d)/$c;$ecc=array();//Process, build
	foreach(array_chunk($b,2) as $a){for($i=0;$i&lt;$a[0];$i++){$ecc['d'][]=array_splice($this-&gt;data,0,$a[1]);
	$ecc['e'][]=self::crc2(end($ecc['d']),$e);}}$e*=$c;
	$this-&gt;data='';$d=$c*$b[1];//Reorganize, decimal to binary
	for($i=0;$i&lt;$d;$i++){$this-&gt;data.=self::bits(array_shift($ecc['d'][$i%$c]),8);}
	if(isset($b[2])){for($i=$b[0];$i&lt;$c;$i++){$this-&gt;data.=self::bits(array_shift($ecc['d'][$i%$c]),8);}}
	for($i=0;$i&lt;$e;$i++){$this-&gt;data.=self::bits(array_shift($ecc['e'][$i%$c]),8);}
	$this-&gt;data.=str_pad('',self::$cap[$this-&gt;vers]%8,'0');//Remainder Bits
	$this-&gt;data=str_replace(array('0','1'),array('2','3'),$this-&gt;data);//Write to temp
	$a=array(array($this-&gt;dim-1,-1,-1),array(0,$this-&gt;dim,1));$b=reset($a);$e=0;
	for($c=$this-&gt;dim-1;$c&gt;0;$c-=2){if($c==6){$c--;}//Skip vertical timing column?
		for($d=$b[0];$d!=$b[1];$d+=$b[2]){
		if($this-&gt;img[$d][$c]=='4'){$this-&gt;img[$d][$c]=$this-&gt;data[$e];$e++;}
		if($this-&gt;img[$d][$c-1]=='4'){$this-&gt;img[$d][$c-1]=$this-&gt;data[$e];$e++;}}
		$b=($b[0])?end($a):reset($a);}
	}
	private function mask(){$masks=array();$scores=array();//Try all masks
	for($m=0;$m&lt;8;$m++){$masks[$m]=$this-&gt;img;$scores[$m]=array(array(),0,0,0);switch($m){
	case 0:for($i=0;$i&lt;$this-&gt;dim;$i++){for($j=0;$j&lt;$this-&gt;dim;$j++){
		if(($i+$j)%2==0 &amp;&amp; $masks[$m][$j][$i]&gt;1){$masks[$m][$j][$i]=($masks[$m][$j][$i]%2)?'0':'1';}}}break;
	case 1:for($i=0;$i&lt;$this-&gt;dim;$i++){for($j=0;$j&lt;$this-&gt;dim;$j++){
		if($j%2==0 &amp;&amp; $masks[$m][$j][$i]&gt;1){$masks[$m][$j][$i]=($masks[$m][$j][$i]%2)?'0':'1';}}}break;
	case 2:for($i=0;$i&lt;$this-&gt;dim;$i++){for($j=0;$j&lt;$this-&gt;dim;$j++){
		if($i%3==0 &amp;&amp; $masks[$m][$j][$i]&gt;1){$masks[$m][$j][$i]=($masks[$m][$j][$i]%2)?'0':'1';}}}break;
	case 3:for($i=0;$i&lt;$this-&gt;dim;$i++){for($j=0;$j&lt;$this-&gt;dim;$j++){
		if(($i+$j)%3==0 &amp;&amp; $masks[$m][$j][$i]&gt;1){$masks[$m][$j][$i]=($masks[$m][$j][$i]%2)?'0':'1';}}}break;
	case 4:for($i=0;$i&lt;$this-&gt;dim;$i++){for($j=0;$j&lt;$this-&gt;dim;$j++){
		if((($i&gt;&gt;1)+(int)($j/3))%2==0 &amp;&amp; $masks[$m][$j][$i]&gt;1){$masks[$m][$j][$i]=($masks[$m][$j][$i]%2)?'0':'1';}}}break;
	case 5:for($i=0;$i&lt;$this-&gt;dim;$i++){for($j=0;$j&lt;$this-&gt;dim;$j++){
		if($i*$j%2+$i*$j%3==0 &amp;&amp; $masks[$m][$j][$i]&gt;1){$masks[$m][$j][$i]=($masks[$m][$j][$i]%2)?'0':'1';}}}break;
	case 6:for($i=0;$i&lt;$this-&gt;dim;$i++){for($j=0;$j&lt;$this-&gt;dim;$j++){
		if(($i*$j%2+$i*$j%3)%2==0 &amp;&amp; $masks[$m][$j][$i]&gt;1){$masks[$m][$j][$i]=($masks[$m][$j][$i]%2)?'0':'1';}}}break;
	case 7:for($i=0;$i&lt;$this-&gt;dim;$i++){for($j=0;$j&lt;$this-&gt;dim;$j++){
		if(($i*$j%3+$i*$j%2)%2==0 &amp;&amp; $masks[$m][$j][$i]&gt;1){$masks[$m][$j][$i]=($masks[$m][$j][$i]%2)?'0':'1';}}}break;
	}//Process and score
	$masks[$m]=explode(',',str_replace(array('2','3'),array('0','1'),implode(',',$masks[$m])));
	foreach($masks[$m] as $a){$scores[$m][2]+=substr_count($a,'1011101');
	preg_match_all('/1{5,}/',$a,$b);$scores[$m][0]=array_merge($scores[$m][0],$b[0]);
	$a=count_chars($a);$scores[$m][3]+=$a[49];}//Transpose for vertical regions
	foreach(self::transpose($masks[$m],$this-&gt;dim,true) as $a){$scores[$m][2]+=substr_count($a,'1011101');
	preg_match_all('/1{5,}/',$a,$b);$scores[$m][0]=array_merge($scores[$m][0],$b[0]);}
	foreach($scores[$m][0] as &amp;$a){$a=strlen($a)-5;}$scores[$m][0]=max($scores[$m][0]);//Process data
	$scores[$m][3]=round(abs(100*$scores[$m][3]/pow($this-&gt;dim,2)-50)/5)*5;
	$scores[$m]=3+$scores[$m][0]+40*$scores[$m][2]+10*$scores[$m][3];}//Choose mask
	$m=array_keys($scores,min($scores));$this-&gt;mask=$m[0];$this-&gt;img=$masks[$this-&gt;mask];
	}
	private function format(){//Build format string
	$f=$this-&gt;mask+($this-&gt;ecc&lt;&lt;3);
	$f=self::bits((self::crc($f,1335)+($f&lt;&lt;10))^21522,15);
	$this-&gt;place(substr($f,7,8),8,$this-&gt;dim-8,8);$this-&gt;place(strrev(substr($f,0,7)),1,8,$this-&gt;dim-7);
	$this-&gt;place(strrev(substr($f,9,6)),1,8,0);$this-&gt;place(strrev(substr($f,7,2)),1,8,7);
	$this-&gt;place(substr($f,6,1),1,7,8);
	$this-&gt;place(substr($f,0,6),6,0,8);//Build version string
	if($this-&gt;vers&gt;5){$v=$this-&gt;vers+1;$v=strrev(self::bits(self::crc($v,7973)+($v&lt;&lt;12),18));
	$this-&gt;place($v,3,$this-&gt;dim-11,0);$this-&gt;place(self::transpose($v,3),6,0,$this-&gt;dim-11);}
	}
	public function image($z=4){$im=imagecreate($this-&gt;dim,$this-&gt;dim);//Initialize image
	imagecolorallocate($im,255,255,255);$c=imagecolorallocate($im,0,0,0);//Begin writing
	for($i=0;$i&lt;$this-&gt;dim;$i++){for($j=0;$j&lt;$this-&gt;dim;$j++){if($this-&gt;img[$j][$i]){imagesetpixel($im,$i,$j,$c);}}}
	$img=imagecreate(($this-&gt;dim+8)*$z,($this-&gt;dim+8)*$z);//New zoomed image with margin
	imagecolorallocate($img,255,255,255);imagecolorallocate($img,0,0,0);
	imagecopyresized($img,$im,4*$z,4*$z,0,0,$this-&gt;dim*$z,$this-&gt;dim*$z,$this-&gt;dim,$this-&gt;dim);
	imagedestroy($im);ob_start();imagegif($img);imagedestroy($img);//Capture output
	return ob_get_clean();
	}
	public function text($a=false){//Either console or document
	$c=($a)?array(&quot;\xDB\xDB&quot;,'  '):array('  ','¦¦');
	$a=str_pad('',$this-&gt;dim*2+8,$c[0]);$a=array($a.&quot;\n&quot;.$a.&quot;\n&quot;,$c[0].$c[0]);
	return $a[0].$a[1].str_replace(array('0','1'),$c,implode($a[1].&quot;\n&quot;.$a[1],$this-&gt;img)).$a[1].&quot;\n&quot;.$a[0];
	}
	//Utility Function
	private function place($data,$phase,$x,$y){
	$data=str_split($data,$phase);foreach($data as $d){
	for($i=0;$i&lt;$phase;$i++){$this-&gt;img[$y][$i+$x]=$d[$i];}
	$y++;}
	}//Static Utility Functions
	private static function crc($m,$k){$a=strlen(decbin($m));$l=strlen(decbin($k))-1;
	$m=$m&lt;&lt;$l;while($a&gt;-1){if($m&amp;1&lt;&lt;$l+$a){$m=$m^($k&lt;&lt;$a);}$a--;}
	return $m;
	}
	private static function crc2($d,$b){$d=array_values($d);$i=count($d);
	$g=self::$sr[$b];$j=count($g)-1;$d=array_pad($d,$j+$i,0);
	while($i&gt;0){$b=self::$n2a[$d[0]];array_shift($d);for($c=0;$c&lt;$j;$c++){$d[$c]=$d[$c]^(self::$a2n[($b+$g[$c+1])%255]);}$i--;}
	return $d;
	}
	private static function bits($d,$l){return str_pad(decbin($d),$l,'0',STR_PAD_LEFT);}
	private static function transpose($a,$b,$arr=false){$a=($arr)?$a:str_split($a,$b);$c=count($a);$j=0;$t='';
	while($j&lt;$b){$i=0;while($i&lt;$c){$t.=$a[$i][$j];$i++;}$j++;}
	return ($arr)?str_split($t,$b):$t;
	}//Calculable?
	private static $cap = array(208,359,567,807,1079,1383,1568,1936,2336,2768,3232,3728,4256,4651,5243,5867,6523,7211,7931,8683,9252,10068,10916,11796,12708,13652,14628,15371,16411,17483,18587,19723,20891,22091,23008,24272,25568,26896,28256,29648);
	private static $ver = array(1=&gt;array(34,41,17,27,63,77,34,48,101,127,58,77,149,187,82,111,202,255,106,144,255,322,139,178,293,370,154,207,365,461,202,259,432,552,235,312,513,652,288,364,604,772,331,427,691,883,374,489,796,1022,427,580,871,1101,468,621,991,1250,530,703,1082,1408,602,775,1212,1548,674,876,1346,1725,746,948,1500,1903,813,1063,1600,2061,919,1159,1708,2232,969,1224,1872,2409,1056,1358,2059,2620,1108,1468,2188,2812,1228,1588,2395,3057,1286,1718,2544,3283,1425,1804,2701,3514,1501,1933,2857,3669,1581,2085,3035,3909,1677,2181,3289,4158,1782,2358,3486,4417,1897,2473,3693,4686,2022,2670,3909,4965,2157,2805,4134,5253,2301,2949,4343,5529,2361,3081,4588,5836,2524,3244,4775,6153,2625,3417,5039,6479,2735,3599,5313,6743,2927,3791,5596,7089,3057,3993),2=&gt;array(20,25,10,16,38,47,20,29,61,77,35,47,90,114,50,67,122,154,64,87,154,195,84,108,178,224,93,125,221,279,122,157,262,335,143,189,311,395,174,221,366,468,200,259,419,535,227,296,483,619,259,352,528,667,283,376,600,758,321,426,656,854,365,470,734,938,408,531,816,1046,452,574,909,1153,493,644,970,1249,557,702,1035,1352,587,742,1134,1460,640,823,1248,1588,672,890,1326,1704,744,963,1451,1853,779,1041,1542,1990,864,1094,1637,2132,910,1172,1732,2223,958,1263,1839,2369,1016,1322,1994,2520,1080,1429,2113,2677,1150,1499,2238,2840,1226,1618,2369,3009,1307,1700,2506,3183,1394,1787,2632,3351,1431,1867,2780,3537,1530,1966,2894,3729,1591,2071,3054,3927,1658,2181,3220,4087,1774,2298,3391,4296,1852,2420),4=&gt;array(14,17,7,11,26,32,14,20,42,53,24,32,62,78,34,46,84,106,44,60,106,134,58,74,122,154,64,86,152,192,84,108,180,230,98,130,213,271,119,151,251,321,137,177,287,367,155,203,331,425,177,241,362,458,194,258,412,520,220,292,450,586,250,322,504,644,280,364,560,718,310,394,624,792,338,442,666,858,382,482,711,929,403,509,779,1003,439,565,857,1091,461,611,911,1171,511,661,997,1273,535,715,1059,1367,593,751,1125,1465,625,805,1190,1528,658,868,1264,1628,698,908,1370,1732,742,982,1452,1840,790,1030,1538,1952,842,1112,1628,2068,898,1168,1722,2188,958,1228,1809,2303,983,1283,1911,2431,1051,1351,1989,2563,1093,1423,2099,2699,1139,1499,2213,2809,1219,1579,2331,2953,1273,1663),8=&gt;array(8,10,4,7,16,20,8,12,26,32,15,20,38,48,21,28,52,65,27,37,65,82,36,45,75,95,39,53,93,118,52,66,111,141,60,80,131,167,74,93,155,198,85,109,177,226,96,125,204,262,109,149,223,282,120,159,254,320,136,180,277,361,154,198,310,397,173,224,345,442,191,243,384,488,208,272,410,528,235,297,438,572,248,314,480,618,270,348,528,672,284,376,561,721,315,407,614,784,330,440,652,842,365,462,692,902,385,496,732,940,405,534,778,1002,430,559,843,1066,457,604,894,1132,486,634,947,1201,518,684,1002,1273,553,719,1060,1347,590,756,1113,1417,605,790,1176,1496,647,832,1224,1577,673,876,1292,1661,701,923,1362,1729,750,972,1435,1817,784,1024));
	//Confirmed Arbitrary
	private static $ebl = array(array(1,16),array(1,19),array(1,9),array(1,13),array(1,28),array(1,34),array(1,16),array(1,22),array(1,44),array(1,55),array(2,13),array(2,17),array(2,32),array(1,80),array(4,9),array(2,24),array(2,43),array(1,108),array(2,11,2,12),array(2,15,2,16),array(4,27),array(2,68),array(4,15),array(4,19),array(4,31),array(2,78),array(4,13,1,14),array(2,14,4,15),array(2,38,2,39),array(2,97),array(4,14,2,15),array(4,18,2,19),array(3,36,2,37),array(2,116),array(4,12,4,13),array(4,16,4,17),array(4,43,1,44),array(2,68,2,69),array(6,15,2,16),array(6,19,2,20),array(1,50,4,51),array(4,81),array(3,12,8,13),array(4,22,4,23),array(6,36,2,37),array(2,92,2,93),array(7,14,4,15),array(4,20,6,21),array(8,37,1,38),array(4,107),array(12,11,4,12),array(8,20,4,21),array(4,40,5,41),array(3,115,1,116),array(11,12,5,13),array(11,16,5,17),array(5,41,5,42),array(5,87,1,88),array(11,12,7,13),array(5,24,7,25),array(7,45,3,46),array(5,98,1,99),array(3,15,13,16),array(15,19,2,20),array(10,46,1,47),array(1,107,5,108),array(2,14,17,15),array(1,22,15,23),array(9,43,4,44),array(5,120,1,121),array(2,14,19,15),array(17,22,1,23),array(3,44,11,45),array(3,113,4,114),array(9,13,16,14),array(17,21,4,22),array(3,41,13,42),array(3,107,5,108),array(15,15,10,16),array(15,24,5,25),array(17,42),array(4,116,4,117),array(19,16,6,17),array(17,22,6,23),array(17,46),array(2,111,7,112),array(34,13),array(7,24,16,25),array(4,47,14,48),array(4,121,5,122),array(16,15,14,16),array(11,24,14,25),array(6,45,14,46),array(6,117,4,118),array(30,16,2,17),array(11,24,16,25),array(8,47,13,48),array(8,106,4,107),array(22,15,13,16),array(7,24,22,25),array(19,46,4,47),array(10,114,2,115),array(33,16,4,17),array(28,22,6,23),array(22,45,3,46),array(8,122,4,123),array(12,15,28,16),array(8,23,26,24),array(3,45,23,46),array(3,117,10,118),array(11,15,31,16),array(4,24,31,25),array(21,45,7,46),array(7,116,7,117),array(19,15,26,16),array(1,23,37,24),array(19,47,10,48),array(5,115,10,116),array(23,15,25,16),array(15,24,25,25),array(2,46,29,47),array(13,115,3,116),array(23,15,28,16),array(42,24,1,25),array(10,46,23,47),array(17,115),array(19,15,35,16),array(10,24,35,25),array(14,46,21,47),array(17,115,1,116),array(11,15,46,16),array(29,24,19,25),array(14,46,23,47),array(13,115,6,116),array(59,16,1,17),array(44,24,7,25),array(12,47,26,48),array(12,121,7,122),array(22,15,41,16),array(39,24,14,25),array(6,47,34,48),array(6,121,14,122),array(2,15,64,16),array(46,24,10,25),array(29,46,14,47),array(17,122,4,123),array(24,15,46,16),array(49,24,10,25),array(13,46,32,47),array(4,122,18,123),array(42,15,32,16),array(48,24,14,25),array(40,47,7,48),array(20,117,4,118),array(10,15,67,16),array(43,24,22,25),array(18,47,31,48),array(19,118,6,119),array(20,15,61,16),array(34,24,34,25));
	private static $sr = array(7=&gt;array(1,87,229,146,149,238,102,21),10=&gt;array(1,251,67,46,61,118,70,64,94,32,45),13=&gt;array(1,74,152,176,100,86,100,106,104,130,218,206,140,78),15=&gt;array(1,8,183,61,91,202,37,51,58,58,237,140,124,5,99,105),16=&gt;array(1,120,104,107,109,102,161,76,3,91,191,147,169,182,194,225,120),17=&gt;array(1,43,139,206,78,43,239,123,206,214,147,24,99,150,39,243,163,136),18=&gt;array(1,215,234,158,94,184,97,118,170,79,187,152,148,252,179,5,98,96,153),20=&gt;array(1,17,60,79,50,61,163,26,187,202,180,221,225,83,239,156,164,212,212,188,190),22=&gt;array(1,210,171,247,242,93,230,14,109,221,53,200,74,8,172,98,80,219,134,160,105,165,231),24=&gt;array(1,229,121,135,48,211,117,251,126,159,180,169,152,192,226,228,218,111,0,117,232,87,96,227,21),26=&gt;array(1,173,125,158,2,103,182,118,17,145,201,111,28,165,53,161,21,245,142,13,102,48,227,153,145,218,70),28=&gt;array(1,168,223,200,104,224,234,108,180,110,190,195,147,205,27,232,201,21,43,245,87,42,195,212,119,242,37,9,123),30=&gt;array(1,41,173,145,152,216,31,179,182,50,48,110,86,239,96,222,125,42,173,226,193,224,130,156,37,251,216,238,40,192,180),32=&gt;array(1,10,6,106,190,249,167,4,67,209,138,138,32,242,123,89,27,120,185,80,156,38,69,171,60,28,222,80,52,254,185,220,241),34=&gt;array(1,111,77,146,94,26,21,108,19,105,94,113,193,86,140,163,125,58,158,229,239,218,103,56,70,114,61,183,129,167,13,98,62,129,51),36=&gt;array(1,200,183,98,16,172,31,246,234,60,152,115,0,167,152,113,248,238,107,18,63,218,37,87,210,105,177,120,74,121,196,117,251,113,233,30,120),40=&gt;array(1,59,116,79,161,252,98,128,205,128,161,247,57,163,56,235,106,53,26,187,174,226,104,170,7,175,35,181,114,88,41,47,163,125,134,72,20,232,53,35,15),42=&gt;array(1,250,103,221,230,25,18,137,231,0,3,58,242,221,191,110,84,230,8,188,106,96,147,15,131,139,34,101,223,39,101,213,199,237,254,201,123,171,162,194,117,50,96),44=&gt;array(1,190,7,61,121,71,246,69,55,168,188,89,243,191,25,72,123,9,145,14,247,1,238,44,78,143,62,224,126,118,114,68,163,52,194,217,147,204,169,37,130,113,102,73,181),46=&gt;array(1,112,94,88,112,253,224,202,115,187,99,89,5,54,113,129,44,58,16,135,216,169,211,36,1,4,96,60,241,73,104,234,8,249,245,119,174,52,25,157,224,43,202,223,19,82,15),48=&gt;array(1,228,25,196,130,211,146,60,24,251,90,39,102,240,61,178,63,46,123,115,18,221,111,135,160,182,205,107,206,95,150,120,184,91,21,247,156,140,238,191,11,94,227,84,50,163,39,34,108),50=&gt;array(1,232,125,157,161,164,9,118,46,209,99,203,193,35,3,209,111,195,242,203,225,46,13,32,160,126,209,130,160,242,215,242,75,77,42,189,32,113,65,124,69,228,114,235,175,124,170,215,232,133,205),52=&gt;array(1,116,50,86,186,50,220,251,89,192,46,86,127,124,19,184,233,151,215,22,14,59,145,37,242,203,134,254,89,190,94,59,65,124,113,100,233,235,121,22,76,86,97,39,242,200,220,101,33,239,254,116,51),54=&gt;array(1,183,26,201,87,210,221,113,21,46,65,45,50,238,184,249,225,102,58,209,218,109,165,26,95,184,192,52,245,35,254,238,175,172,79,123,25,122,43,120,108,215,80,128,201,235,8,153,59,101,31,198,76,31,156),56=&gt;array(1,106,120,107,157,164,216,112,116,2,91,248,163,36,201,202,229,6,144,254,155,135,208,170,209,12,139,127,142,182,249,177,174,190,28,10,85,239,184,101,124,152,206,96,23,163,61,27,196,247,151,154,202,207,20,61,10),58=&gt;array(1,82,116,26,247,66,27,62,107,252,182,200,185,235,55,251,242,210,144,154,237,176,141,192,248,152,249,206,85,253,142,65,165,125,23,24,30,122,240,214,6,129,218,29,145,127,134,206,245,117,29,41,63,159,142,233,125,148,123),60=&gt;array(1,107,140,26,12,9,141,243,197,226,197,219,45,211,101,219,120,28,181,127,6,100,247,2,205,198,57,115,219,101,109,160,82,37,38,238,49,160,209,121,86,11,124,30,181,84,25,194,87,65,102,190,220,70,27,209,16,89,7,33,240),62=&gt;array(1,65,202,113,98,71,223,248,118,214,94,0,122,37,23,2,228,58,121,7,105,135,78,243,118,70,76,223,89,72,50,70,111,194,17,212,126,181,35,221,117,235,11,229,149,147,123,213,40,115,6,200,100,26,246,182,218,127,215,36,186,110,106),64=&gt;array(1,45,51,175,9,7,158,159,49,68,119,92,123,177,204,187,254,200,78,141,149,119,26,127,53,160,93,199,212,29,24,145,156,208,150,218,209,4,216,91,47,184,146,47,140,195,195,125,242,238,63,99,108,140,230,242,31,204,11,178,243,217,156,213,231),66=&gt;array(1,5,118,222,180,136,136,162,51,46,117,13,215,81,17,139,247,197,171,95,173,65,137,178,68,111,95,101,41,72,214,169,197,95,7,44,154,77,111,236,40,121,143,63,87,80,253,240,126,217,77,34,232,106,50,168,82,76,146,67,106,171,25,132,93,45,105),68=&gt;array(1,247,159,223,33,224,93,77,70,90,160,32,254,43,150,84,101,190,205,133,52,60,202,165,220,203,151,93,84,15,84,253,173,160,89,227,52,199,97,95,231,52,177,41,125,137,241,166,225,118,2,54,32,82,215,175,198,43,238,235,27,101,184,127,3,5,8,163,238));
	private static $char = array(array(1=&gt;10,2=&gt;9,4=&gt;8,8=&gt;8),array(1=&gt;12,2=&gt;11,4=&gt;16,8=&gt;10),array(1=&gt;14,2=&gt;13,4=&gt;16,8=&gt;12));
	private static $alpha = array('0'=&gt;0,'1'=&gt;1,'2'=&gt;2,'3'=&gt;3,'4'=&gt;4,'5'=&gt;5,'6'=&gt;6,'7'=&gt;7,'8'=&gt;8,'9'=&gt;9,'A'=&gt;10,'B'=&gt;11,'C'=&gt;12,'D'=&gt;13,'E'=&gt;14,'F'=&gt;15,'G'=&gt;16,'H'=&gt;17,'I'=&gt;18,'J'=&gt;19,'K'=&gt;20,'L'=&gt;21,'M'=&gt;22,'N'=&gt;23,'O'=&gt;24,'P'=&gt;25,'Q'=&gt;26,'R'=&gt;27,'S'=&gt;28,'T'=&gt;29,'U'=&gt;30,'V'=&gt;31,'W'=&gt;32,'X'=&gt;33,'Y'=&gt;34,'Z'=&gt;35,' '=&gt;36,'$'=&gt;37,'%'=&gt;38,'*'=&gt;39,'+'=&gt;40,'-'=&gt;41,'.'=&gt;42,'/'=&gt;43,':'=&gt;44);
	private static $n2a = array(null,0,1,25,2,50,26,198,3,223,51,238,27,104,199,75,4,100,224,14,52,141,239,129,28,193,105,248,200,8,76,113,5,138,101,47,225,36,15,33,53,147,142,218,240,18,130,69,29,181,194,125,106,39,249,185,201,154,9,120,77,228,114,166,6,191,139,98,102,221,48,253,226,152,37,179,16,145,34,136,54,208,148,206,143,150,219,189,241,210,19,92,131,56,70,64,30,66,182,163,195,72,126,110,107,58,40,84,250,133,186,61,202,94,155,159,10,21,121,43,78,212,229,172,115,243,167,87,7,112,192,247,140,128,99,13,103,74,222,237,49,197,254,24,227,165,153,119,38,184,180,124,17,68,146,217,35,32,137,46,55,63,209,91,149,188,207,205,144,135,151,178,220,252,190,97,242,86,211,171,20,42,93,158,132,60,57,83,71,109,65,162,31,45,67,216,183,123,164,118,196,23,73,236,127,12,111,246,108,161,59,82,41,157,85,170,251,96,134,177,187,204,62,90,203,89,95,176,156,169,160,81,11,245,22,235,122,117,44,215,79,174,213,233,230,231,173,232,116,214,244,234,168,80,88,175);
	private static $a2n = array(1,2,4,8,16,32,64,128,29,58,116,232,205,135,19,38,76,152,45,90,180,117,234,201,143,3,6,12,24,48,96,192,157,39,78,156,37,74,148,53,106,212,181,119,238,193,159,35,70,140,5,10,20,40,80,160,93,186,105,210,185,111,222,161,95,190,97,194,153,47,94,188,101,202,137,15,30,60,120,240,253,231,211,187,107,214,177,127,254,225,223,163,91,182,113,226,217,175,67,134,17,34,68,136,13,26,52,104,208,189,103,206,129,31,62,124,248,237,199,147,59,118,236,197,151,51,102,204,133,23,46,92,184,109,218,169,79,158,33,66,132,21,42,84,168,77,154,41,82,164,85,170,73,146,57,114,228,213,183,115,230,209,191,99,198,145,63,126,252,229,215,179,123,246,241,255,227,219,171,75,150,49,98,196,149,55,110,220,165,87,174,65,130,25,50,100,200,141,7,14,28,56,112,224,221,167,83,166,81,162,89,178,121,242,249,239,195,155,43,86,172,69,138,9,18,36,72,144,61,122,244,245,247,243,251,235,203,139,11,22,44,88,176,125,250,233,207,131,27,54,108,216,173,71,142,1);
}
		//$a=new QR('234DSKJFH23YDFKJHaS');$a-&gt;image(4);
		if (isset($_POST['data'])) $lacadena=$_POST['data'];
		if (isset($lacadena)){
			$laimagen = new QR($lacadena);
			file_put_contents('qrcode.gif',$laimagen-&gt;image(8));
			echo &quot;$lacadena&quot;.&quot;&lt;br /&gt;&quot;;
			echo &quot;&lt;img src='qrcode.gif' &gt;&quot;;
		}
?&gt;
</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%2F2013%2F03%2F02%2Fphp-phpqrcode-generador-de-qrcode%2F&amp;title=PhP%20phpqrcode%20%E2%80%93%20Generador%20de%20QRCode" 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><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=7ZVYaa15xBM:ZkSDJiRFwYM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=7ZVYaa15xBM:ZkSDJiRFwYM:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=7ZVYaa15xBM:ZkSDJiRFwYM:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=7ZVYaa15xBM:ZkSDJiRFwYM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=7ZVYaa15xBM:ZkSDJiRFwYM:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=7ZVYaa15xBM:ZkSDJiRFwYM:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=7ZVYaa15xBM:ZkSDJiRFwYM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=7ZVYaa15xBM:ZkSDJiRFwYM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=7ZVYaa15xBM:ZkSDJiRFwYM:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=7ZVYaa15xBM:ZkSDJiRFwYM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=7ZVYaa15xBM:ZkSDJiRFwYM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=7ZVYaa15xBM:ZkSDJiRFwYM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=7ZVYaa15xBM:ZkSDJiRFwYM:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=7ZVYaa15xBM:ZkSDJiRFwYM:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=7ZVYaa15xBM:ZkSDJiRFwYM:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=7ZVYaa15xBM:ZkSDJiRFwYM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=7ZVYaa15xBM:ZkSDJiRFwYM:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=7ZVYaa15xBM:ZkSDJiRFwYM:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~4/7ZVYaa15xBM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2013/03/02/php-phpqrcode-generador-de-qrcode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javcasta.com/2013/03/02/php-phpqrcode-generador-de-qrcode/</feedburner:origLink></item>
		<item>
		<title>Cambiar puerto por defecto UDP514 del cliente rsyslog en pfSense 2.02</title>
		<link>http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~3/koz9uE4-oCA/</link>
		<comments>http://www.javcasta.com/2013/02/24/cambiar-puerto-por-defecto-udp514-del-cliente-rsyslog-en-pfsense-2-02/#comments</comments>
		<pubDate>Sun, 24 Feb 2013 20:54:27 +0000</pubDate>
		<dc:creator>fj.castanon@gmail.com (Javier Castañón)</dc:creator>
				<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[PhP]]></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=8102</guid>
		<description><![CDATA[Referencias: http://forum.pfsense.org/index.php?topic=47086.0;prev_next=prev http://forum.pfsense.org/index.php/topic,59326.0.html El cliente de rsyslog (remote syslog) de pfsense trabaja por defecto con el puerto UDP514, es decir que si defines un servidor remoto de syslog para el firewall pFsense 2.02, mediante la GUI no hay forma de indicar otro puerto de conexión. Pero se puede hacer un truco,  que me dio la [...]]]></description>
				<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2013%2F02%2F24%2Fcambiar-puerto-por-defecto-udp514-del-cliente-rsyslog-en-pfsense-2-02%2F"></g:plusone><br /><p><!-- tweet id : 307904784319533056 --><style type='text/css'>#bbpBox_307904784319533056 a { text-decoration:none; color:#2FC2EF; }#bbpBox_307904784319533056 a:hover { text-decoration:underline; }</style><div id='bbpBox_307904784319533056' 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: Cambiar puerto por defecto UDP514 del cliente rsyslog en pfSense 2.02 - <a href="http://t.co/yIerHxYNww" rel="nofollow">http://t.co/yIerHxYNww</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 02/03/2013 17:26' href='http://twitter.com/#!/javcasta/status/307904784319533056' target='_blank'>02/03/2013 17:26</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=307904784319533056' 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=307904784319533056' 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=307904784319533056' 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://a0.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://forum.pfsense.org/index.php?topic=47086.0;prev_next=prev" target="_blank">http://forum.pfsense.org/index.php?topic=47086.0;prev_next=prev</a></li>
<li><a href="http://forum.pfsense.org/index.php/topic,59326.0.html" target="_blank">http://forum.pfsense.org/index.php/topic,59326.0.html</a></li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/02/changeRsyslogClientPortPfsense.jpg"><img class="aligncenter size-full wp-image-8104" alt="changeRsyslogClientPortPfsense" src="http://www.javcasta.com/blog/wp-content/uploads/2013/02/changeRsyslogClientPortPfsense.jpg" width="682" height="403" /></a></p>
<p>El cliente de <strong>rsyslog</strong> (remote <strong>syslog</strong>) de <strong>pfsense</strong> trabaja por defecto con el puerto <strong>UDP514</strong>, es decir que si defines un servidor remoto de syslog para el <strong>firewall pFsense 2.02</strong>, mediante la GUI no hay forma de indicar otro puerto de conexión.</p>
<p>Pero se puede hacer un <strong>truco</strong>,  que me dio la idea al leer a <strong>jimp</strong> en el hilo:</p>
<blockquote><p><a href="http://forum.pfsense.org/index.php/topic,43602.msg226871.html#msg226871" target="_blank">That should be as easy as putting something like &#8220;192.168.x.x:2000&#8243; in the server box, but it looks like our input validation doesn&#8217;t allow that. Would be easy to disable that input validation in /usr/local/www/diag_logs_settings.php and try that out</a></p></blockquote>
<p>Edito:  <strong>/usr/local/www/diag_logs_settings.php</strong></p>
<p><span style="color: #888888;"><em>Seguir leyendo</em></span> <span id="more-8102"></span></p>
<p>Y en el condicional if:</p>
<blockquote><p><span style="color: #ff6600;">if (!$input_errors) {</span><br />
<span style="color: #ff6600;"> $config['syslog']['reverse'] = $_POST['reverse'] ? true : false;</span><br />
<span style="color: #ff6600;"> $config['syslog']['nentries'] = (int)$_POST['nentries'];</span><br />
<span style="color: #ff6600;">                /* add by javcasta 24-2-2013  http://javcasta.com */</span><br />
<strong><span style="color: #ff6600;"> $config['syslog']['remoteserver'] = $_POST['remoteserver'].&#8217;:594&#8242;;</span></strong><br />
<span style="color: #ff6600;"> $config['syslog']['remoteserver2'] = $_POST['remoteserver2'];</span><br />
<span style="color: #ff6600;"> $config['syslog']['remoteserver3'] = $_POST['remoteserver3'];</span><br />
<span style="color: #ff6600;"> $config['syslog']['filter'] = $_POST['filter'] ? true : false;</span><br />
<span style="color: #ff6600;"> $config['syslog']['dhcp'] = $_POST['dhcp'] ? true : false;</span><br />
<span style="color: #ff6600;"> $config['syslog']['portalauth'] = $_POST['portalauth'] ? true : false;</span><br />
<span style="color: #ff6600;"> $config['syslog']['vpn'] = $_POST['vpn'] ? true : false;</span><br />
<span style="color: #ff6600;"> $config['syslog']['apinger'] = $_POST['apinger'] ? true : false;</span><br />
<span style="color: #ff6600;"> $config['syslog']['relayd'] = $_POST['relayd'] ? true : false;</span><br />
<span style="color: #ff6600;"> $config['syslog']['hostapd'] = $_POST['hostapd'] ? true : false;</span><br />
<span style="color: #ff6600;">                $config['syslog']['logall'] = $_POST['logall'] ? true : false;</span><br />
<span style="color: #ff6600;"> $config['syslog']['system'] = $_POST['system'] ? true : false;</span><br />
<span style="color: #ff6600;"> $config['syslog']['disablelocallogging'] = $_POST['disablelocallogging'] ? true : false;</span><br />
<span style="color: #ff6600;"> $config['syslog']['enable'] = $_POST['enable'] ? true : false;</span><br />
<span style="color: #ff6600;"> $oldnologdefaultblock = isset($config['syslog']['nologdefaultblock']);</span><br />
<span style="color: #ff6600;"> $config['syslog']['nologdefaultblock'] = $_POST['logdefaultblock'] ? false : true;</span><br />
<span style="color: #ff6600;"> $config['syslog']['rawfilter'] = $_POST['rawfilter'] ? true : false;</span><br />
<span style="color: #ff6600;"> if($config['syslog']['enable'] == false) {</span><br />
<span style="color: #ff6600;"> unset($config['syslog']['remoteserver']);</span><br />
<span style="color: #ff6600;"> unset($config['syslog']['remoteserver2']);</span><br />
<span style="color: #ff6600;"> unset($config['syslog']['remoteserver3']);</span><br />
<span style="color: #ff6600;"> }</span></p></blockquote>
<p>Cambio la linea</p>
<blockquote><p><span style="color: #ff6600;">$config['syslog']['remoteserver'] = $_POST['remoteserver'];</span></p></blockquote>
<p>por</p>
<blockquote><p><strong><span style="color: #ff6600;">$config['syslog']['remoteserver'] = $_POST['remoteserver'].<span style="color: #333399;">&#8216;:594&#8242;</span>;</span></strong></p></blockquote>
<p>Configuro los logs del sistema para que envien al servidor remoto:</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/02/changeRsyslogClientPortPfsense2.jpg"><img class="aligncenter size-full wp-image-8103" alt="changeRsyslogClientPortPfsense2" src="http://www.javcasta.com/blog/wp-content/uploads/2013/02/changeRsyslogClientPortPfsense2.jpg" width="513" height="572" /></a></p>
<p>Y funciona perfectamente, el servidor remoto de syslog, recoge los logs de pfSense 2.02 en el puerto UDP594</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%2F2013%2F02%2F24%2Fcambiar-puerto-por-defecto-udp514-del-cliente-rsyslog-en-pfsense-2-02%2F&amp;title=Cambiar%20puerto%20por%20defecto%20UDP514%20del%20cliente%20rsyslog%20en%20pfSense%202.02" 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><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=koz9uE4-oCA:n04j0jG45gM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=koz9uE4-oCA:n04j0jG45gM:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=koz9uE4-oCA:n04j0jG45gM:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=koz9uE4-oCA:n04j0jG45gM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=koz9uE4-oCA:n04j0jG45gM:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=koz9uE4-oCA:n04j0jG45gM:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=koz9uE4-oCA:n04j0jG45gM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=koz9uE4-oCA:n04j0jG45gM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=koz9uE4-oCA:n04j0jG45gM:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=koz9uE4-oCA:n04j0jG45gM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=koz9uE4-oCA:n04j0jG45gM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=koz9uE4-oCA:n04j0jG45gM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=koz9uE4-oCA:n04j0jG45gM:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=koz9uE4-oCA:n04j0jG45gM:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=koz9uE4-oCA:n04j0jG45gM:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=koz9uE4-oCA:n04j0jG45gM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=koz9uE4-oCA:n04j0jG45gM:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=koz9uE4-oCA:n04j0jG45gM:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~4/koz9uE4-oCA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2013/02/24/cambiar-puerto-por-defecto-udp514-del-cliente-rsyslog-en-pfsense-2-02/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javcasta.com/2013/02/24/cambiar-puerto-por-defecto-udp514-del-cliente-rsyslog-en-pfsense-2-02/</feedburner:origLink></item>
		<item>
		<title>Rsyslog – Servidor de logs remoto en debian con MySQL</title>
		<link>http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~3/oQChzmN48rU/</link>
		<comments>http://www.javcasta.com/2013/02/24/rsyslog-servidor-de-logs-remoto-en-debian-con-mysql/#comments</comments>
		<pubDate>Sun, 24 Feb 2013 11:43:29 +0000</pubDate>
		<dc:creator>fj.castanon@gmail.com (Javier Castañón)</dc:creator>
				<category><![CDATA[HelpDesk]]></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=8099</guid>
		<description><![CDATA[Referencias: http://wiki.rsyslog.com/index.php/HOWTO_:_Rsyslog_%2B_MySQL_on_FreeBSD Procedimiento de instalación de Rsyslog y habilitar que almacene logs en syslog y en MySQL Seguir leyendo # Si no tienes instalado MySQL apt-get install mysql-server # instalamos rsyslog (con los modulos de MySQL y PostgreSQL) apt-get install rsyslog rsyslog-doc rsyslog-mysql rsyslog-pgsql rsyslog-gnutls rsyslog-gssapi rsyslog-relp doc-base &#8230; # Omito el proceso de instalación [...]]]></description>
				<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2013%2F02%2F24%2Frsyslog-servidor-de-logs-remoto-en-debian-con-mysql%2F"></g:plusone><br /><p><!-- tweet id : 307908626734002176 --><style type='text/css'>#bbpBox_307908626734002176 a { text-decoration:none; color:#2FC2EF; }#bbpBox_307908626734002176 a:hover { text-decoration:underline; }</style><div id='bbpBox_307908626734002176' 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: Rsyslog - Servidor de logs remoto en debian con MySQL - <a href="http://t.co/DwKvKDdVhq" rel="nofollow">http://t.co/DwKvKDdVhq</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 02/03/2013 17:41' href='http://twitter.com/#!/javcasta/status/307908626734002176' target='_blank'>02/03/2013 17:41</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=307908626734002176' 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=307908626734002176' 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=307908626734002176' 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://a0.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://wiki.rsyslog.com/index.php/HOWTO_:_Rsyslog_%2B_MySQL_on_FreeBSD" target="_blank">http://wiki.rsyslog.com/index.php/HOWTO_:_Rsyslog_%2B_MySQL_on_FreeBSD</a></li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/02/rsyslog-mysql.jpg"><img class="aligncenter size-full wp-image-8100" alt="rsyslog-mysql" src="http://www.javcasta.com/blog/wp-content/uploads/2013/02/rsyslog-mysql.jpg" width="748" height="257" /></a></p>
<h3><span style="text-decoration: underline;">Procedimiento de instalación de Rsyslog y habilitar que almacene logs en syslog y en MySQL</span></h3>
<p><span style="color: #888888;"><em>Seguir leyendo</em></span><span id="more-8099"></span></p>
<blockquote><p><span style="color: #008000;"># Si no tienes instalado MySQL</span><br />
<strong>apt-get install mysql-server</strong><br />
<span style="color: #008000;"># instalamos rsyslog (con los modulos de MySQL y PostgreSQL)</span><br />
<strong>apt-get install rsyslog rsyslog-doc rsyslog-mysql rsyslog-pgsql rsyslog-gnutls rsyslog-gssapi rsyslog-relp doc-base</strong></p>
<p>&#8230;</p>
<p><span style="color: #666699;"># Omito el proceso de instalación que es trivial</span></p>
<p><span style="color: #008000;"># editamos el fichero de configuración de rsyslog &#8211; omito las lineas que no edito</span><br />
<strong>nano /etc/rsyslog.conf</strong></p>
<p><span style="color: #008000;">#añadir en modulos: $ModLoad ommysql # load MySQL functionality &#8211; leer funcionalidad para MySQL</span></p>
<p>#################<br />
#### MODULES ####<br />
#################<br />
# leer funcionalidad para MySQL<br />
<strong><span style="color: #000000;">$ModLoad ommysql # load MySQL functionality</span></strong><br />
<span style="color: #008000;"># proporcionar soporte para local system logging</span><br />
<strong>$ModLoad imuxsock # provides support for local system logging</strong><br />
$ModLoad imklog # provides kernel logging support (previously done by rklogd)<br />
#$ModLoad immark # provides &#8211;MARK&#8211; message capability</p>
<p><span style="color: #008000;">#Proporcionar recepción de UDP syslog</span><br />
# provides UDP syslog reception<br />
<strong>$ModLoad imudp </strong><br />
<strong>$UDPServerRun 514</strong> <span style="color: #008000;">#escuchará en el Puerto UDP 514</span></p>
<p>#<br />
# Include all config files in /etc/rsyslog.d/<br />
#<br />
<span style="color: #008000;"># Defino que incluya la conf de mysql</span><br />
<strong>$IncludeConfig /etc/rsyslog.d/mysql.conf</strong></p>
<p><span style="color: #008000;"><strong>Salvo el fichero.</strong></span></p>
<p><span style="color: #008000;">en <strong>/etc/rsyslog.d/mysql.conf</strong> defino la conexión a la bbdd de MySQL Syslog con el usuario rsyslog y la calve lacontraseña</span></p>
<p>### Configuration file for rsyslog-mysql<br />
### Changes are preserved</p>
<p>$ModLoad ommysql<br />
<strong>*.* : ommysql:localhost,Syslog,rsyslog,lacontraseña</strong></p>
<p><strong><span style="color: #008000;">Salvo el fichero</span></strong></p>
<p><span style="color: #008000;">Creo el script sql para crear la bbdd Syslog y sus tablas (SystemEvents y SystemEventsProperties)</span></p>
<p>rsyslog-createdb.sql<br />
============<br />
CREATE DATABASE Syslog;<br />
USE Syslog;<br />
CREATE TABLE SystemEvents<br />
(<br />
ID int unsigned not null auto_increment primary key,<br />
CustomerID bigint,<br />
ReceivedAt datetime NULL,<br />
DeviceReportedTime datetime NULL,<br />
Facility smallint NULL,<br />
Priority smallint NULL,<br />
FromHost varchar(60) NULL,<br />
Message text,<br />
NTSeverity int NULL,<br />
Importance int NULL,<br />
EventSource varchar(60),<br />
EventUser varchar(60) NULL,<br />
EventCategory int NULL,<br />
EventID int NULL,<br />
EventBinaryData text NULL,<br />
MaxAvailable int NULL,<br />
CurrUsage int NULL,<br />
MinUsage int NULL,<br />
MaxUsage int NULL,<br />
InfoUnitID int NULL ,<br />
SysLogTag varchar(60),<br />
EventLogType varchar(60),<br />
GenericFileName VarChar(60),<br />
SystemID int NULL<br />
);</p>
<p>CREATE TABLE SystemEventsProperties<br />
(<br />
ID int unsigned not null auto_increment primary key,<br />
SystemEventID int NULL ,<br />
ParamName varchar(255) NULL ,<br />
ParamValue text NULL<br />
);</p>
<p><span style="color: #008000;">#Creamos la bbdd en MySQL</span><br />
<span style="color: #666699;">root@maquina:~/scripts#</span> <strong>mysql -h 127.0.0.1 -u root -p &lt; rsyslog-createdb.sql</strong></p>
<p>Enter password:</p>
<p><span style="color: #008000;"># damos privilegios de usar, consultar, insertar y actualizar al usuario rsyslog sobre la bbdd Syslog</span> <span style="color: #666699;">root@maquina:~/scripts#</span> mysql -h 127.0.0.1 -u root -p</p>
<p>Enter password: Welcome to the MySQL monitor. Commands end with ; or \g.</p>
<p><span style="color: #666699;">mysql&gt;</span> <strong>GRANT SELECT, UPDATE, INSERT ON Syslog.* TO rsyslog@localhost IDENTIFIED BY &#8216;lacontraseña&#8217;;</strong><br />
Query OK, 0 rows affected (0.00 sec)</p>
<p><span style="color: #666699;">mysql&gt;</span> <strong>SHOW GRANTS FOR &#8216;rsyslog&#8217;@'localhost&#8217;;</strong><br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br />
| Grants for rsyslog@localhost |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br />
| GRANT USAGE ON *.* TO &#8216;rsyslog&#8217;@'localhost&#8217; IDENTIFIED BY PASSWORD &#8216;*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&#8217; |<br />
| GRANT SELECT, INSERT, UPDATE ON `Syslog`.* TO &#8216;rsyslog&#8217;@'localhost&#8217; |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br />
2 rows in set (0.00 sec)</p>
<p><span style="color: #666699;">mysql&gt;</span> <strong>exit</strong></p>
<p><span style="color: #008000;">#Reiniciar servicio rsyslog</span></p>
<p><strong>/etc/init.d/rsyslog restart</strong></p>
<p><span style="color: #008000;"># comprobamos si esta escribiendo logs con prioridad 1 en la tabla SystemEvents de la bbdd Syslog</span><br />
<strong>mysql -u root -p Syslog</strong><br />
<strong>select * from SystemEvents where Priority=1;</strong></p>
<p><span style="color: #666699;">mysql&gt;</span> <strong>select * from SystemEvents where Priority=1;</strong></p>
<p>| ID | CustomerID | ReceivedAt | DeviceReportedTime | Facility | Priority | FromHost | Message | NTSeverity | Importance | EventSource | EventUser | EventCategory | EventID | EventBinaryData | MaxAvailable | CurrUsage | MinUsage | MaxUsage | InfoUnitID | SysLogTag | EventLogType | GenericFileName | SystemID |<br />
&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;-+<br />
| 6 | NULL | 2013-02-24 14:39:14 | 2013-02-24 14:39:14 | 0 | 1 | myservr.dyndnsatwild.com | kernel: Intrusion -&gt; IN=ppp_3_31_1 OUT= MAC= SRC=116.66.197.138 DST=80.59.69.239 LEN=48 TOS=0&#215;00 PREC=0&#215;00 TTL=110 ID=60982 DF PROTO=TCP SPT=3190 DPT=445 WINDOW=65535 RES=0&#215;00 SYN URGP=0 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | 1 | | NULL | NULL | NULL |<br />
+&#8212;-+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;-+<br />
1 row in set (0.00 sec)</p>
<p><span style="color: #666699;">mysql&gt;</span> <strong>exit</strong></p>
<p><span style="color: #008000;">Compruebo que tambien se reflejen lo logs en /var/log/syslog</span></p>
<p><strong>tail -f /var/log/syslog | grep Intrusion</strong><br />
#&#8230;<br />
Feb 24 14:39:14 myservr.dyndnsatwild.com kernel: Intrusion -&gt; IN=ppp_3_31_1 OUT= MAC= SRC=116.66.197.138 DST=80.59.69.239 LEN=48 TOS=0&#215;00 PREC=0&#215;00 TTL=110 ID=60982 DF PROTO=TCP SPT=3190 DPT=445 WINDOW=65535 RES=0&#215;00 SYN URGP=0<br />
#&#8230;</p></blockquote>
<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%2F2013%2F02%2F24%2Frsyslog-servidor-de-logs-remoto-en-debian-con-mysql%2F&amp;title=Rsyslog%20%E2%80%93%20Servidor%20de%20logs%20remoto%20en%20debian%20con%20MySQL" 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><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=oQChzmN48rU:X8TLyBj2_yk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=oQChzmN48rU:X8TLyBj2_yk:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=oQChzmN48rU:X8TLyBj2_yk:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=oQChzmN48rU:X8TLyBj2_yk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=oQChzmN48rU:X8TLyBj2_yk:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=oQChzmN48rU:X8TLyBj2_yk:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=oQChzmN48rU:X8TLyBj2_yk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=oQChzmN48rU:X8TLyBj2_yk:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=oQChzmN48rU:X8TLyBj2_yk:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=oQChzmN48rU:X8TLyBj2_yk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=oQChzmN48rU:X8TLyBj2_yk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=oQChzmN48rU:X8TLyBj2_yk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=oQChzmN48rU:X8TLyBj2_yk:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=oQChzmN48rU:X8TLyBj2_yk:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=oQChzmN48rU:X8TLyBj2_yk:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=oQChzmN48rU:X8TLyBj2_yk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=oQChzmN48rU:X8TLyBj2_yk:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=oQChzmN48rU:X8TLyBj2_yk:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~4/oQChzmN48rU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2013/02/24/rsyslog-servidor-de-logs-remoto-en-debian-con-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javcasta.com/2013/02/24/rsyslog-servidor-de-logs-remoto-en-debian-con-mysql/</feedburner:origLink></item>
		<item>
		<title>Debian – Instalar mod-security en Apache</title>
		<link>http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~3/0tPkb0_Jz9k/</link>
		<comments>http://www.javcasta.com/2013/02/20/debian-instalar-mod-security-en-apache/#comments</comments>
		<pubDate>Wed, 20 Feb 2013 21:11:37 +0000</pubDate>
		<dc:creator>fj.castanon@gmail.com (Javier Castañón)</dc:creator>
				<category><![CDATA[HelpDesk]]></category>
		<category><![CDATA[html]]></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=8097</guid>
		<description><![CDATA[Indexo este post rápido como apunte de procedimiento para instalar el conocido WAF para Apache: mod-security Debian &#8211; Instalar mod-security en Apache por javcasta » Mié 20 Feb 2013, 9:00 pm Debian &#8211; Instalar mod-security en Apache Seguir leyendo Ref: http://www.faqforge.com/linux/apache-mod-security-installation-on-debian-6-0-squeeze/ Código: Seleccionar todo apt-get install libapache-mod-security mkdir /etc/apache2/mod-security chmod 600 /etc/apache2/mod-security cd /tmp wget [...]]]></description>
				<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2013%2F02%2F20%2Fdebian-instalar-mod-security-en-apache%2F"></g:plusone><br /><p><!-- tweet id : 307904293095231490 --><style type='text/css'>#bbpBox_307904293095231490 a { text-decoration:none; color:#2FC2EF; }#bbpBox_307904293095231490 a:hover { text-decoration:underline; }</style><div id='bbpBox_307904293095231490' 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: Debian - Instalar mod-security en Apache - <a href="http://t.co/6agSu1c4A4" rel="nofollow">http://t.co/6agSu1c4A4</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 02/03/2013 17:24' href='http://twitter.com/#!/javcasta/status/307904293095231490' target='_blank'>02/03/2013 17:24</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=307904293095231490' 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=307904293095231490' 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=307904293095231490' 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://a0.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 />
<div>
<p><span style="color: #888888;">Indexo este post rápido como apunte de procedimiento para instalar el conocido <strong>WAF</strong> para <strong>Apache</strong>: <strong>mod-security</strong></span></p>
<h3><a href="http://www.javcasta.com/Boletin/viewtopic.php?f=11&amp;t=11#p11">Debian &#8211; Instalar mod-security en Apache</a></h3>
<p><a href="http://www.javcasta.com/Boletin/viewtopic.php?p=11#p11"><img title="Nota" alt="Nota" src="http://www.javcasta.com/Boletin/styles/prosilver/imageset/icon_post_target.gif" width="11" height="9" /></a>por <strong><a href="http://www.javcasta.com/Boletin/memberlist.php?mode=viewprofile&amp;u=54">javcasta</a></strong> » Mié 20 Feb 2013, 9:00 pm</p>
<div>Debian &#8211; Instalar mod-security en Apache</div>
<p><span style="color: #888888;"><em>Seguir leyendo</em></span><span id="more-8097"></span>
<div>
Ref: <a href="http://www.faqforge.com/linux/apache-mod-security-installation-on-debian-6-0-squeeze/">http://www.faqforge.com/linux/apache-mod-security-installation-on-debian-6-0-squeeze/</a>
<dl>
<dt>Código: <a href="http://www.javcasta.com/Boletin/viewtopic.php?f=11&amp;t=11#">Seleccionar todo</a></dt>
<dd><code>apt-get install libapache-mod-security<br />
mkdir /etc/apache2/mod-security<br />
chmod 600 /etc/apache2/mod-security<br />
cd /tmp<br />
wget http://www.modsecurity.org/download/modsecurity-core-rules_2.5-1.6.1.tar.gz<br />
tar fvx modsecurity-core-rules_2.5-1.6.1.tar.gz<br />
mv *.conf /etc/apache2/mod-security/<br />
ln -s /var/log/apache2 /etc/apache2/logs</code></dd>
</dl>
<blockquote>
<div>nano /etc/apache2/conf.d/mod-security.conf<br />
Include /etc/apache2/mod-security/*.conf</div>
</blockquote>
<blockquote>
<div>nano /etc/apache2/mod-security/modsecurity_crs_10_config.conf<br />
#remove the # in front of the line:<br />
SecDefaultAction “phase:2,log,deny,status:403,t:lowercase,t:replaceNulls,t:compressWhitespace”</div>
</blockquote>
<p>reload apache.</p>
<dl>
<dt>Código: <a href="http://www.javcasta.com/Boletin/viewtopic.php?f=11&amp;t=11#">Seleccionar todo</a></dt>
<dd><code>/etc/init.d/apache2 force-reload</code></dd>
</dl>
<p>logs</p>
<dl>
<dt>Código: <a href="http://www.javcasta.com/Boletin/viewtopic.php?f=11&amp;t=11#">Seleccionar todo</a></dt>
<dd><code>tail /var/log/apache2/modsec_audit.log</code></dd>
</dl>
<p><img alt="Imagen" src="http://piymenta.dyndns-at-work.com/img/log-mod-security.JPG" /></p>
<p>Falsos positivos:</p>
<blockquote>
<div>You will see very likely some falsely blocked URL’s. To whitelist them, you can add the ID’s of the rules that should not be used in the whitelist file.<br />
Example:<br />
nano /etc/apache2/mod-security/modsecurity_crs_99_whitelist.conf<br />
SecRuleRemoveById 960015<br />
SecRuleRemoveById 960016</div>
</blockquote>
</div>
<div id="sig11">- Javier Castañón -<br />
Técnico de sistemas, comunicaciones (CCNA) y soporte<br />
- Scripter (Batch, bash, C#, &#8230;) -<br />
- <a href="http://javcasta.com">http://javcasta.com</a> -</div>
</div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.javcasta.com%2F2013%2F02%2F20%2Fdebian-instalar-mod-security-en-apache%2F&amp;title=Debian%20%E2%80%93%20Instalar%20mod-security%20en%20Apache" 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><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=0tPkb0_Jz9k:Dh7hAoA7YiM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=0tPkb0_Jz9k:Dh7hAoA7YiM:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=0tPkb0_Jz9k:Dh7hAoA7YiM:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=0tPkb0_Jz9k:Dh7hAoA7YiM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=0tPkb0_Jz9k:Dh7hAoA7YiM:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=0tPkb0_Jz9k:Dh7hAoA7YiM:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=0tPkb0_Jz9k:Dh7hAoA7YiM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=0tPkb0_Jz9k:Dh7hAoA7YiM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=0tPkb0_Jz9k:Dh7hAoA7YiM:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=0tPkb0_Jz9k:Dh7hAoA7YiM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=0tPkb0_Jz9k:Dh7hAoA7YiM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=0tPkb0_Jz9k:Dh7hAoA7YiM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=0tPkb0_Jz9k:Dh7hAoA7YiM:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=0tPkb0_Jz9k:Dh7hAoA7YiM:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=0tPkb0_Jz9k:Dh7hAoA7YiM:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=0tPkb0_Jz9k:Dh7hAoA7YiM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=0tPkb0_Jz9k:Dh7hAoA7YiM:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=0tPkb0_Jz9k:Dh7hAoA7YiM:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~4/0tPkb0_Jz9k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2013/02/20/debian-instalar-mod-security-en-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javcasta.com/2013/02/20/debian-instalar-mod-security-en-apache/</feedburner:origLink></item>
		<item>
		<title>Bash script – Actualizar host con dns dinámico en fichero /etc/hosts en debian o ubuntu</title>
		<link>http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~3/32oqop2upj0/</link>
		<comments>http://www.javcasta.com/2013/02/07/bash-script-actualizar-host-con-dns-dinamico-en-fichero-etchosts-en-debian-o-ubuntu/#comments</comments>
		<pubDate>Thu, 07 Feb 2013 08:40:55 +0000</pubDate>
		<dc:creator>fj.castanon@gmail.com (Javier Castañón)</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=8091</guid>
		<description><![CDATA[Referencia: http://lists.debian.org/debian-devel/1999/12/msg01202.html Necesito que un alias (mialias) de un host (loquesea.dyndns-at-home.com) con dns dinámico (dyndns) tenga su ip actualiada en el fichero /etc/hosts Por ejemplo un fichero /etc/hosts: 127.0.0.1 localhost.localdomain localhost 80.59.69.239 loquesea.dyndns-at-home.com mialias Cada vez que cambie la IP de loquesea.dyndns-at-home.com el sistema no podra resolver  correctamente la ip del alias &#8220;mialias&#8221;. Obviamente, si [...]]]></description>
				<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2013%2F02%2F07%2Fbash-script-actualizar-host-con-dns-dinamico-en-fichero-etchosts-en-debian-o-ubuntu%2F"></g:plusone><br /><!-- tweet id : 299437353263570944 --><style type='text/css'>#bbpBox_299437353263570944 a { text-decoration:none; color:#2FC2EF; }#bbpBox_299437353263570944 a:hover { text-decoration:underline; }</style><div id='bbpBox_299437353263570944' 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 script - Actualizar host con dns din&#225;mico en fichero /etc/hosts en debian o ubuntu <a href="http://t.co/0nTwp7V6" rel="nofollow">http://t.co/0nTwp7V6</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 07/02/2013 08:40' href='http://twitter.com/#!/javcasta/status/299437353263570944' target='_blank'>07/02/2013 08:40</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=299437353263570944' 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=299437353263570944' 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=299437353263570944' 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://a0.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 />
<p>Referencia:</p>
<ul>
<li><a href="http://lists.debian.org/debian-devel/1999/12/msg01202.html" target="_blank">http://lists.debian.org/debian-devel/1999/12/msg01202.html</a></li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/02/clientessh.jpeg"><img class="aligncenter size-full wp-image-8092" alt="clientessh" src="http://www.javcasta.com/blog/wp-content/uploads/2013/02/clientessh.jpeg" width="400" height="274" /></a></p>
<p>Necesito que un <strong>alias</strong> (mialias) de un <strong>host</strong> (loquesea.dyndns-at-home.com) con <strong>dns dinámico</strong> (<a href="http://dyn.com/dns/" target="_blank">dyndns</a>) tenga su<strong> ip actualiada</strong> en el fichero <strong>/etc/hosts</strong></p>
<p>Por ejemplo un fichero <strong>/etc/hosts</strong>:</p>
<blockquote><p><span style="color: #808080;">127.0.0.1 localhost.localdomain localhost</span></p>
<p>80.59.69.239 <span style="color: #339966;"> loquesea.dyndns-at-home.com</span> <span style="color: #ff6600;">mialias</span></p>
</blockquote>
<p>Cada vez que cambie la IP de <span style="color: #808080;">loquesea.dyndns-at-home.com</span> el sistema no podra resolver  correctamente la ip del alias &#8220;mialias&#8221;. Obviamente, si tienes acceso a configurar el servidor DNS (binds) no haria falta tirar de fichero hosts, pero no siempre se tiene un servidor DNS o permisos y acceso a el <img src='http://www.javcasta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Para reolver esto creo un <strong>bash script</strong> que actualice el fichero <strong>/etc/host</strong><br /><strong>update-hosts.sh</strong> :</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
##########################################
# update-hosts
# actualizar /etc/hosts
# by javcasta 2.013 - http://javcasta.com
##########################################

dindns=loquesea.dyndns-at-home.com
# obtenemos la ip del host dinamico por resolución de nombre contra servidor dns
unalias=`dig +short $dindns`
# obtengo la vieja ip del host dinamico en el fichero /etc/hosts
old=`grep $dindns /etc/hosts | cut -d &quot; &quot; -f 1`

# si la vieja ip y la nueva no coinciden, procedemos a actualizar /etc/hosts
if [ $unalias != $old ] ; then
   # cambiamos la vieja ip por la nueva y volcamos la salida en /etc/host.new
   sed -e &quot;s/$old/$unalias/g&quot; /etc/hosts &gt; /etc/hosts.new
   # si existe /etc/host.new
   if [ -s /etc/hosts.new ] ; then
      # backup de /etc/host en /etc/host.bak
      cp /etc/hosts /etc/hosts.bak
      # actualizamos /etc/hosts
      mv /etc/hosts.new /etc/hosts
      # enviamos notificacion de cambio vía mail
      echo &quot; actualizado host $dindns &quot; | mail -s &quot; cambio de ip $old a $unalias &quot; alguien @ undominio.com

      #
   else
      echo &quot;Error creando el fichero: /etc/hosts.new esta vacio, ninguna actualización efectuada&quot;
      echo &quot;modificar /etc/hosts a mano : - ).&quot;
   fi
else
   echo &quot;sin cambios, no se necesita actualizar $dindns.&quot;
fi
</pre>
<p><span style="color: #888888;"><em>Seguir leyendo</em></span>
<p><span id="more-8091"></span></p>
<p>Damos permisos al script</p>
<blockquote><p><span style="color: #808080;"><strong>chmod +x update-hosts.sh</strong></span></p>
</blockquote>
<p>Lo pongo en un <strong>cron</strong> para que se ejecute <strong>cada hora</strong> (nota: con WebMin se crean las tareas planificadas o cron de manera visual o con GUI de una forma rápida y sencilla).</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/02/webmin-cron.jpg"><img class="aligncenter size-full wp-image-8093" alt="webmin-cron" src="http://www.javcasta.com/blog/wp-content/uploads/2013/02/webmin-cron.jpg" width="650" height="346" /></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%2F2013%2F02%2F07%2Fbash-script-actualizar-host-con-dns-dinamico-en-fichero-etchosts-en-debian-o-ubuntu%2F&amp;title=Bash%20script%20%E2%80%93%20Actualizar%20host%20con%20dns%20din%C3%A1mico%20en%20fichero%20%2Fetc%2Fhosts%20en%20debian%20o%20ubuntu" 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><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=32oqop2upj0:y2GFuLLm57A:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=32oqop2upj0:y2GFuLLm57A:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=32oqop2upj0:y2GFuLLm57A:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=32oqop2upj0:y2GFuLLm57A:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=32oqop2upj0:y2GFuLLm57A:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=32oqop2upj0:y2GFuLLm57A:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=32oqop2upj0:y2GFuLLm57A:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=32oqop2upj0:y2GFuLLm57A:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=32oqop2upj0:y2GFuLLm57A:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=32oqop2upj0:y2GFuLLm57A:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=32oqop2upj0:y2GFuLLm57A:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=32oqop2upj0:y2GFuLLm57A:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=32oqop2upj0:y2GFuLLm57A:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=32oqop2upj0:y2GFuLLm57A:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=32oqop2upj0:y2GFuLLm57A:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=32oqop2upj0:y2GFuLLm57A:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=32oqop2upj0:y2GFuLLm57A:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=32oqop2upj0:y2GFuLLm57A:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~4/32oqop2upj0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2013/02/07/bash-script-actualizar-host-con-dns-dinamico-en-fichero-etchosts-en-debian-o-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javcasta.com/2013/02/07/bash-script-actualizar-host-con-dns-dinamico-en-fichero-etchosts-en-debian-o-ubuntu/</feedburner:origLink></item>
		<item>
		<title>Lanzador en C# de VNC inverso sobre tunel SSH para Soporte remoto</title>
		<link>http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~3/vqjcLIFBD1Y/</link>
		<comments>http://www.javcasta.com/2013/01/30/lanzador-en-c-de-vnc-inverso-sobre-tunel-ssh-para-soporte-remoto/#comments</comments>
		<pubDate>Wed, 30 Jan 2013 17:36:39 +0000</pubDate>
		<dc:creator>fj.castanon@gmail.com (Javier Castañón)</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=8086</guid>
		<description><![CDATA[Referencias: ReverseVNC – Lanzador en C# de VNC inverso para Soporte remoto Demo de Soporte remoto con ReverseVNC sobre tunel SSH Seguridad – Navegar con Tunel sobre SSH – Browse to tunnel over SSH Tal como dije en el post &#8220;Demo de Soporte remoto con ReverseVNC sobre tunel SSH&#8220;, publico el código con las opciones [...]]]></description>
				<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2013%2F01%2F30%2Flanzador-en-c-de-vnc-inverso-sobre-tunel-ssh-para-soporte-remoto%2F"></g:plusone><br /><!-- tweet id : 296673048243888128 --><style type='text/css'>#bbpBox_296673048243888128 a { text-decoration:none; color:#2FC2EF; }#bbpBox_296673048243888128 a:hover { text-decoration:underline; }</style><div id='bbpBox_296673048243888128' 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: Lanzador en C# de VNC inverso sobre tunel SSH para Soporte remoto <a href="http://t.co/LvyEkLo7" rel="nofollow">http://t.co/LvyEkLo7</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/01/2013 17:35' href='http://twitter.com/#!/javcasta/status/296673048243888128' target='_blank'>30/01/2013 17:35</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=296673048243888128' 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=296673048243888128' 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=296673048243888128' 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://a0.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 />
<p><span style="text-decoration: underline;"><strong>Referencias:</strong></span></p>
<ul>
<li>
<h4><a title="Permanent Link to Demo de Soporte remoto con ReverseVNC sobre tunel SSH" href="http://www.javcasta.com/2013/01/26/demo-de-soporte-remoto-con-reversevnc-sobre-tunel-ssh/" target="_blank" rel="bookmark">ReverseVNC – Lanzador en C# de VNC inverso para Soporte remoto</a></h4>
</li>
<li>
<h4><a title="Permanent Link to Seguridad – Navegar con Tunel sobre SSH – Browse to tunnel over SSH" href="http://www.javcasta.com/2013/01/20/seguridad-navegar-con-tunel-sobre-ssh-browse-to-tunnel-over-ssh/" target="_blank" rel="bookmark">Demo de Soporte remoto con ReverseVNC sobre tunel SSH</a></h4>
</li>
<li>
<h4><a title="Permanent Link to Seguridad – Navegar con Tunel sobre SSH – Browse to tunnel over SSH" href="http://www.javcasta.com/2013/01/20/seguridad-navegar-con-tunel-sobre-ssh-browse-to-tunnel-over-ssh/" target="_blank" rel="bookmark">Seguridad – Navegar con Tunel sobre SSH – Browse to tunnel over SSH</a></h4>
</li>
</ul>
<p>Tal como dije en el post &#8220;<a title="Permanent Link to Seguridad – Navegar con Tunel sobre SSH – Browse to tunnel over SSH" href="http://www.javcasta.com/2013/01/20/seguridad-navegar-con-tunel-sobre-ssh-browse-to-tunnel-over-ssh/" target="_blank" rel="bookmark">Demo de Soporte remoto con ReverseVNC sobre tunel SSH</a>&#8220;, publico el código con las opciones para parametrizar o personalizar el lanzador de soporte remoto con reverseVNC over tunnel SSH.</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/01/OpenreverseVNCoverSSH-2.jpg"><img class="aligncenter size-full wp-image-8087" alt="OpenreverseVNCoverSSH-2" src="http://www.javcasta.com/blog/wp-content/uploads/2013/01/OpenreverseVNCoverSSH-2.jpg" width="570" height="307" /></a></p>
<p style="text-align: left;">Si se va a establecer un <strong>tunel ssh</strong>, lo primero es <strong>definir el servidor del soporte y el puerto</strong> en la pestaña <strong><span style="color: #888888;">Reverse VNC</span></strong>, y luego  <strong>parametrizar el tunel</strong> en la pestaña <span style="color: #888888;"><strong>Tunel SSH</strong></span>. Tras parametrizar, se lanza el tunel en el boton <strong><span style="color: #888888;">Crear tunel SSH</span></strong>, y nos vamos a la pestaña <strong><span style="color: #888888;">Reverse VNC</span></strong> y lanzamos el reverse VNC con el botón <strong><span style="color: #888888;">Solicitar soporte</span></strong></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/01/OpenreverseVNCoverSSH-1.jpg"><img class="aligncenter size-full wp-image-8088" alt="OpenreverseVNCoverSSH-1" src="http://www.javcasta.com/blog/wp-content/uploads/2013/01/OpenreverseVNCoverSSH-1.jpg" width="570" height="307" /></a></p>
<p>El código del MainForm.cs</p>
<p><span style="color: #888888;"><em>Seguir leyendo</em></span>
<p><span id="more-8086"></span></p>
<pre class="brush: java; title: ; notranslate">
 //* Created by SharpDevelop. 4.2
 //* ReverseVNC over tunnel SSH is a tool for launch ultraVNC
 //* in reverse mode over tunnel SSH
 //* Write in C# 4.0 &amp; compiled in .Net 2.0
 //* User: JavCasta - Javier Castañón - 2.013
 //* http://javcasta.com/
 //* Date: 24/01/2013
 //* Time: 15:53
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Net;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading;
using System.Windows.Forms;

namespace ReverseVNC
{

	public partial class MainForm : Form
	{

		Process Cmd = new Process();
		Process Cmd2 = new Process();
		Process clienteSSH = new Process();
		int tiempo = 0;
		int sshport = 22;
		int vncport = 5500;
		string soporte = &quot;&quot;;

		public MainForm()
		{

			InitializeComponent();

		}

		void Button1Click(object sender, EventArgs e)
		{
			if (!checkBox1.Checked) {soporte = textBox1.Text; vncport = int.Parse(textBox2.Text);}
			if (checkBox1.Checked) {soporte = &quot;127.0.0.1&quot;; vncport = int.Parse(textBox7.Text);}
			try {
				timer1.Start();
				if (Process.GetProcessesByName(&quot;winvnc&quot;).Length == 0) {
            		Cmd.StartInfo.FileName = &quot;winvnc.exe&quot;;
            		Cmd.StartInfo.CreateNoWindow = true;
            		Cmd.StartInfo.UseShellExecute = true;
            		Cmd.Start();
            		label2.Text = &quot;Iniciamos winvnc y lanzamos la conexion inversa&quot;;
				} else label2.Text = &quot;Ya estaba iniciado winvnc. Lanzamos la conexion inversa&quot;;
            	Thread.Sleep(3000);
            	Cmd2.StartInfo.FileName = &quot;winvnc.exe&quot;;
            	Cmd2.StartInfo.CreateNoWindow = true;
            	Cmd2.StartInfo.UseShellExecute = true;
            	Cmd2.StartInfo.Arguments = &quot;-connect &quot; + soporte + &quot;::&quot; + vncport;
            	Cmd2.Start();
            	button1.Enabled = false;
            	button2.Enabled = true;
            	label2.Text = &quot;Estado: &quot; + estado();
			} catch (Exception ex) {
				label2.Text = &quot;Estado: &quot; + ex.Message;
				throw;
			}
		}

		string estado()
		{
			sshport = int.Parse(textBox8.Text);
			vncport = int.Parse(textBox2.Text);
			if (!checkBox1.Checked) {soporte = textBox1.Text; vncport = int.Parse(textBox2.Text);}
			if (checkBox1.Checked) {soporte = &quot;127.0.0.1&quot;; vncport = int.Parse(textBox7.Text);}
			IPGlobalProperties ipProperties = IPGlobalProperties.GetIPGlobalProperties();
			IPEndPoint[] endPoints = ipProperties.GetActiveTcpListeners();
			TcpConnectionInformation[] tcpConnections = ipProperties.GetActiveTcpConnections();
			string cadena = &quot;Sin conexion a soporte remoto&quot;;
			foreach (TcpConnectionInformation info in tcpConnections)
			{
				if (info.RemoteEndPoint.Port.ToString() == vncport.ToString() &amp;&amp; info.State.ToString().Contains(&quot;Established&quot;))
					cadena =  info.State.ToString() + &quot;: Local: &quot; + info.LocalEndPoint.Address.ToString() + &quot;:&quot; + info.LocalEndPoint.Port.ToString() +
					&quot; Remote: &quot; + info.RemoteEndPoint.Address.ToString() + &quot;:&quot; + info.RemoteEndPoint.Port.ToString();

				if (info.RemoteEndPoint.Port.ToString() == sshport.ToString() &amp;&amp; info.State.ToString().Contains(&quot;Established&quot;))
					cadena += &quot;\r\nSSH: &quot; + info.State.ToString() + &quot;: Local: &quot; + info.LocalEndPoint.Address.ToString() + &quot;:&quot; + info.LocalEndPoint.Port.ToString() +
					&quot; Remote: &quot; + info.RemoteEndPoint.Address.ToString() + &quot;:&quot; + info.RemoteEndPoint.Port.ToString();
			}
			return cadena;
		}

		void Button2Click(object sender, EventArgs e)
		{
			try {
				Cmd.Kill(); Cmd2.Kill();
				foreach(Process myProc in Process.GetProcesses())
				{
					if (myProc.ProcessName == &quot;winvnc&quot;)
					{
						myProc.Kill();
					}
				}
				button1.Enabled = true;
				button2.Enabled = false;
			}
			catch (Exception err) { label2.Text = &quot;Estado: &quot; + err.Message; };
			//button4.PerformClick();
			Button4Click(null,null);
			button1.Enabled = true;
			button2.Enabled = false;
		}

		void MainFormFormClosing(object sender, FormClosingEventArgs e)
		{
			Button2Click(null,null);
		}

		void Timer1Tick(object sender, EventArgs e)
		{
			if (estado().Contains(&quot;Sin conexion a soporte remoto&quot;))
			{
				pictureBox2.Visible = false;
				pictureBox1.Visible = true;
			} else
			{
				tiempo++;
				pictureBox1.Visible = false;
				pictureBox2.Visible = true;
			}
			label2.Text = &quot;Estado: &quot; + estado();
			textBox3.Text = tiempo.ToString() + &quot; sg&quot;;
		}

		void Button3Click(object sender, EventArgs e)
		{
			try {
				Cursor.Current = Cursors.WaitCursor;
				if (!timer1.Enabled) timer1.Start();
				textBox1.Enabled = false; textBox2.Enabled = false;
				//if (Process.GetProcessesByName(&quot;PLINK&quot;).Length == 0) {
            		clienteSSH.StartInfo.FileName = &quot;plink.exe&quot;;
            		clienteSSH.StartInfo.CreateNoWindow = true;
            		clienteSSH.StartInfo.UseShellExecute = false;
            		//winvnc -connect 127.0.0.1::9999
            		clienteSSH.StartInfo.Arguments = &quot; -2 -N -L &quot; + textBox7.Text + &quot;:&quot; + textBox1.Text +
            			&quot;:&quot; + textBox2.Text + &quot; -P &quot; + textBox8.Text + &quot; -pw &quot; + textBox6.Text + &quot; -C &quot; +
            			textBox5.Text + @&quot;@&quot; + textBox4.Text;
            		MessageBox.Show(clienteSSH.StartInfo.Arguments.ToString());
            		clienteSSH.Start();
            		label2.Text = &quot;Iniciamos cliente SSH plink de putty y lanzamos el tunel SSH&quot;;
				//}
				//else label2.Text = &quot;Ya esta iniciado PLINK&quot;;
            	Thread.Sleep(3000);
            	label2.Text = &quot;Estado: &quot; + estado();
            	button3.Enabled = false; button4.Enabled = true;
            	Cursor.Current = Cursors.Default;
			} catch (Exception ex) {
				label2.Text = &quot;Estado: &quot; + ex.Message;
				textBox1.Enabled = true; textBox2.Enabled = true;
				Cursor.Current = Cursors.Default;
				throw;
			}

		}

		void Button4Click(object sender, EventArgs e)
		{
			try {
				clienteSSH.Kill();
				foreach(Process myProc in Process.GetProcesses())
				{
					if (myProc.ProcessName == &quot;plink&quot;)
					{
						myProc.Kill();
					}
				}
			}
			catch (Exception err) { label2.Text = &quot;Estado: &quot; + err.Message; };
			button3.Enabled = true; button4.Enabled = false;
			textBox1.Enabled = true; textBox2.Enabled = true;
		}

		void TabPage3Enter(object sender, EventArgs e)
		{
			Uri miuri = new Uri(&quot;http://www.javcasta.com/?p=8086&quot;);
			Process.Start(miuri.ToString());
		}

		void LinkLabel1LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
		{
			Process.Start(&quot;http://javcasta.com/&quot;);
		}

		void CheckBox1CheckedChanged(object sender, EventArgs e)
		{
			if (!checkBox1.Checked) {soporte = textBox1.Text; vncport = int.Parse(textBox2.Text);}
			if (checkBox1.Checked) {soporte = &quot;127.0.0.1&quot;; vncport = int.Parse(textBox7.Text);}
		}
	}
}

</pre>
<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%2F2013%2F01%2F30%2Flanzador-en-c-de-vnc-inverso-sobre-tunel-ssh-para-soporte-remoto%2F&amp;title=Lanzador%20en%20C%23%20de%20VNC%20inverso%20sobre%20tunel%20SSH%20para%20Soporte%20remoto" 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><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=vqjcLIFBD1Y:ZeWFwUuA2H8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=vqjcLIFBD1Y:ZeWFwUuA2H8:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=vqjcLIFBD1Y:ZeWFwUuA2H8:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=vqjcLIFBD1Y:ZeWFwUuA2H8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=vqjcLIFBD1Y:ZeWFwUuA2H8:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=vqjcLIFBD1Y:ZeWFwUuA2H8:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=vqjcLIFBD1Y:ZeWFwUuA2H8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=vqjcLIFBD1Y:ZeWFwUuA2H8:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=vqjcLIFBD1Y:ZeWFwUuA2H8:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=vqjcLIFBD1Y:ZeWFwUuA2H8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=vqjcLIFBD1Y:ZeWFwUuA2H8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=vqjcLIFBD1Y:ZeWFwUuA2H8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=vqjcLIFBD1Y:ZeWFwUuA2H8:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=vqjcLIFBD1Y:ZeWFwUuA2H8:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=vqjcLIFBD1Y:ZeWFwUuA2H8:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=vqjcLIFBD1Y:ZeWFwUuA2H8:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=vqjcLIFBD1Y:ZeWFwUuA2H8:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=vqjcLIFBD1Y:ZeWFwUuA2H8:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~4/vqjcLIFBD1Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2013/01/30/lanzador-en-c-de-vnc-inverso-sobre-tunel-ssh-para-soporte-remoto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javcasta.com/2013/01/30/lanzador-en-c-de-vnc-inverso-sobre-tunel-ssh-para-soporte-remoto/</feedburner:origLink></item>
		<item>
		<title>PXE DHCP Server en windows con tftp32 y ERPXE – Instalar Ubuntu 12.04 por red</title>
		<link>http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~3/loxgVwE9K7w/</link>
		<comments>http://www.javcasta.com/2013/01/27/pxe-dhcp-server-en-windows-con-tftp32-y-erpxe-instalar-ubuntu-12-04-por-red/#comments</comments>
		<pubDate>Sun, 27 Jan 2013 18:03:25 +0000</pubDate>
		<dc:creator>fj.castanon@gmail.com (Javier Castañón)</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=8073</guid>
		<description><![CDATA[Referencias: https://es.wikipedia.org/wiki/PXE http://sourceforge.net/projects/erpxe/ http://erpxe.com/ Preboot eXecution Environment (PXE) (Entorno de ejecución de prearranque), es un entorno para arrancar  e instalar el  sistema operativo en ordenadores a través de una red, de manera independiente de los  dispositivos de almacenamiento de datos disponibles (como discos duros) o de los sistemas operativos instalados. Tengo un viejo portatil (Fujitsu [...]]]></description>
				<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2013%2F01%2F27%2Fpxe-dhcp-server-en-windows-con-tftp32-y-erpxe-instalar-ubuntu-12-04-por-red%2F"></g:plusone><br /><!-- tweet id : 295592648683683840 --><style type='text/css'>#bbpBox_295592648683683840 a { text-decoration:none; color:#2FC2EF; }#bbpBox_295592648683683840 a:hover { text-decoration:underline; }</style><div id='bbpBox_295592648683683840' 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: PXE DHCP Server en windows con tftp32 y ERPXE - Instalar Ubuntu 12.04 por red <a href="http://t.co/0inw0Gxg" rel="nofollow">http://t.co/0inw0Gxg</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 27/01/2013 18:02' href='http://twitter.com/#!/javcasta/status/295592648683683840' target='_blank'>27/01/2013 18:02</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=295592648683683840' 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=295592648683683840' 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=295592648683683840' 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://a0.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 />
<p>Referencias:</p>
<ul>
<li><a href="https://es.wikipedia.org/wiki/PXE" target="_blank">https://es.wikipedia.org/wiki/PXE</a></li>
<li><a href="http://sourceforge.net/projects/erpxe/" target="_blank">http://sourceforge.net/projects/erpxe/</a></li>
<li><a href="http://erpxe.com/" target="_blank">http://erpxe.com/</a></li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/01/oldPortatil-1.jpg"><img class="aligncenter size-full wp-image-8079" alt="oldPortatil-1" src="http://www.javcasta.com/blog/wp-content/uploads/2013/01/oldPortatil-1.jpg" width="622" height="508" /></a></p>
<blockquote><p>Preboot eXecution Environment (<strong>PXE</strong>) (Entorno de ejecución de prearranque), es un entorno para arrancar  e instalar el  sistema operativo en ordenadores a través de una red, de manera independiente de los  dispositivos de almacenamiento de datos disponibles (como discos duros) o de los sistemas operativos instalados.</p>
</blockquote>
<p>Tengo un <strong>viejo portatil</strong> (<span style="color: #888888;">Fujitsu Amilo M7440</span>) con el<strong> cd/dvd dañado</strong>, y <strong>sin disquetera</strong> y sin posibilidad de  arrancarlo vía usb (pendrive).<br /> Pero<strong> si tiene la posibilidad de arrancarlo en red vía PXE</strong>. Y obviamente<strong> instalar Ubuntu</strong> (u otro OS, XP,  CentOS, &#8230;)</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/01/oldPortatil-0.jpg"><img class="aligncenter size-full wp-image-8075" alt="oldPortatil-0" src="http://www.javcasta.com/blog/wp-content/uploads/2013/01/oldPortatil-0.jpg" width="650" height="306" /></a></p>
<p><span style="text-decoration: underline;"><strong>Asi que esto es lo que hice:</strong></span></p>
<p><span style="color: #888888;"><em>Seguir leyendo</em></span>
<p><span id="more-8073"></span></p>
<p>En un PC con W7 ultimate:</p>
<p>Descargo <a href="http://tftpd32.jounin.net/download/Tftpd32_SE-4.00-setup.exe"><strong>tftp32 service edition</strong></a>  y lo instalo en<strong> c:\tftpboot</strong><br />Descargo<strong><a href="http://erpxe.com/download/" target="_blank"> ERPXE</a></strong>  y lo descomprimo en<strong> c:\tftpboot</strong></p>
<p>Ejecuto los paso de la <a href="http://erpxe.org/Windows_installation_instructions" target="_blank"><strong>wiki de ERPEX</strong></a> para dotarle de <strong>soporte de samba</strong> (<span style="color: #888888;">compartir ficheros vía smb</span>)</p>
<p>con el siguiente<strong> batch script</strong> desde consola <strong>con privilegios de administrador</strong><br />(<span style="color: #888888;">win+R &gt; runas /u:administrador cmd</span>)</p>
<pre class="brush: bash; title: ; notranslate">
REM # Añadimos el usuario erpxe con clave erpxe - Add a user named erpxe, Set erpxe password to &quot;erpxe&quot;
net user erpxe erpxe /ADD
REM # Compartimos c:\tftpboot\er\shares como erpxe - Share the tftpboot\er\shares folder as &quot;erpxe&quot;
net share erpxe=c:\tftpboot\er\shares
</pre>
<p>
<p>Descargo el <a href="http://sourceforge.net/projects/erpxe/files/plugins/ubuntu/" target="_blank">plugin de Ubuntu 12.04 i386</a> <br />Y descomprimo la carpeta <strong>ubuntu</strong> en <strong>C:\tftpboot\er\plugins\</strong></p>
<p>Descargo para <strong>Ubuntu 12.04</strong> desde</p>
<p><a href="http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-i386/current/images/netboot/" target="_blank"> http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-i386/current/images/netboot/</a></p>
<ul>
<li><a href="http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-i386/current/images/netboot/ubuntu-installer/i386/initrd.gz" target="_blank">initrd.gz</a></li>
<li><a href="http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-i386/current/images/netboot/ubuntu-installer/i386/linux" target="_blank">linux</a></li>
<li><a href="http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-i386/current/images/netboot/ubuntu-installer/i386/pxelinux.0" target="_blank">pxelinux.0</a></li>
</ul>
<p>en <strong>C:\tftpboot\er\plugins\ubuntu\i386</strong></p>
<p><a href="http://erpxe.org/Install_TFTPD32_Server" target="_blank"><strong>Configuro una ip el pool del tftp32/dhcp y configuro el fichero de boot</strong></a> (gpxelinux.0)</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/01/ERPXE-tftp32-1.jpg"><img class="aligncenter size-full wp-image-8084" alt="ERPXE-tftp32-1" src="http://www.javcasta.com/blog/wp-content/uploads/2013/01/ERPXE-tftp32-1.jpg" width="529" height="342" /></a></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/01/ERPXE-tftp32-2.jpg"><img class="aligncenter size-full wp-image-8083" alt="ERPXE-tftp32-2" src="http://www.javcasta.com/blog/wp-content/uploads/2013/01/ERPXE-tftp32-2.jpg" width="383" height="383" /></a></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/01/ERPXE-tftp32-3.jpg"><img class="aligncenter size-full wp-image-8082" alt="ERPXE-tftp32-3" src="http://www.javcasta.com/blog/wp-content/uploads/2013/01/ERPXE-tftp32-3.jpg" width="381" height="543" /></a></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/01/ERPXE-tftp32-4.jpg"><img class="aligncenter size-full wp-image-8081" alt="ERPXE-tftp32-4" src="http://www.javcasta.com/blog/wp-content/uploads/2013/01/ERPXE-tftp32-4.jpg" width="378" height="461" /></a></p>
<p>reinicio el servicio <strong>Tftpd32_svc</strong></p>
<blockquote><p><span style="color: #888888;">C:\&gt;<strong>net stop Tftpd32_svc</strong></span></p>
<p><span style="color: #888888;">El servicio de Tftpd32 service edition se detuvo correctamente.</span></p>
<p><span style="color: #888888;">C:\&gt;<strong>net start Tftpd32_svc</strong></span><br /><span style="color: #888888;">El servicio de Tftpd32 service edition está iniciándose..</span><br /><span style="color: #888888;">El servicio de Tftpd32 service edition se ha iniciado correctamente.</span></p>
</blockquote>
<p>Arranco un viejo portatil (sin cd/dvd ni disquetera ni boot via usb, pero si bootable en red con PXE).<br />Observo que el servidor dhcp le asigna una ip y en el log viewer observo la actividad</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/01/ERPXE-tftp32-5.jpg"><img class="aligncenter size-full wp-image-8080" alt="ERPXE-tftp32-5" src="http://www.javcasta.com/blog/wp-content/uploads/2013/01/ERPXE-tftp32-5.jpg" width="471" height="546" /></a></p>
<p>tras unos sgs al aparece la pantalla de <strong>ERPXE</strong> en el portatil, pulso<strong> shift (mayusculas) e intro</strong> y navego por los menus<br /> hasta el menú de la instalación de Ubuntu 12.04 &#8230; y lo instalo</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/01/oldPortatil-1.jpg"><img class="aligncenter size-full wp-image-8079" alt="oldPortatil-1" src="http://www.javcasta.com/blog/wp-content/uploads/2013/01/oldPortatil-1.jpg" width="622" height="508" /></a></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/01/oldPortatil-1b.jpg"><img class="aligncenter size-full wp-image-8074" alt="oldPortatil-1b" src="http://www.javcasta.com/blog/wp-content/uploads/2013/01/oldPortatil-1b.jpg" width="650" height="487" /></a></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/01/oldPortatil-2.jpg"><img class="aligncenter size-full wp-image-8078" alt="oldPortatil-2" src="http://www.javcasta.com/blog/wp-content/uploads/2013/01/oldPortatil-2.jpg" width="650" height="487" /></a></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/01/oldPortatil-3.jpg"><img class="aligncenter size-full wp-image-8077" alt="oldPortatil-3" src="http://www.javcasta.com/blog/wp-content/uploads/2013/01/oldPortatil-3.jpg" width="650" height="469" /></a></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/01/oldPortatil-4.jpg"><img class="aligncenter size-full wp-image-8076" alt="oldPortatil-4" src="http://www.javcasta.com/blog/wp-content/uploads/2013/01/oldPortatil-4.jpg" width="586" height="487" /></a></p>
<p>Y por fin pude instalar Ubuntu en un viejo portatil sin cd/dvd ni disquetera ni arranque por usb, pero con arranque en red vía PXE<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%2F2013%2F01%2F27%2Fpxe-dhcp-server-en-windows-con-tftp32-y-erpxe-instalar-ubuntu-12-04-por-red%2F&amp;title=PXE%20DHCP%20Server%20en%20windows%20con%20tftp32%20y%20ERPXE%20%E2%80%93%20Instalar%20Ubuntu%2012.04%20por%20red" 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><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=loxgVwE9K7w:DXkI5wms14o:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=loxgVwE9K7w:DXkI5wms14o:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=loxgVwE9K7w:DXkI5wms14o:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=loxgVwE9K7w:DXkI5wms14o:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=loxgVwE9K7w:DXkI5wms14o:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=loxgVwE9K7w:DXkI5wms14o:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=loxgVwE9K7w:DXkI5wms14o:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=loxgVwE9K7w:DXkI5wms14o:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=loxgVwE9K7w:DXkI5wms14o:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=loxgVwE9K7w:DXkI5wms14o:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=loxgVwE9K7w:DXkI5wms14o:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=loxgVwE9K7w:DXkI5wms14o:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=loxgVwE9K7w:DXkI5wms14o:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=loxgVwE9K7w:DXkI5wms14o:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=loxgVwE9K7w:DXkI5wms14o:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=loxgVwE9K7w:DXkI5wms14o:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=loxgVwE9K7w:DXkI5wms14o:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=loxgVwE9K7w:DXkI5wms14o:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~4/loxgVwE9K7w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2013/01/27/pxe-dhcp-server-en-windows-con-tftp32-y-erpxe-instalar-ubuntu-12-04-por-red/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<media:content url="http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~5/P_QTzztbQwI/Tftpd32_SE-4.00-setup.exe" fileSize="609978" type="application/x-msdos-program" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>Referencias: https://es.wikipedia.org/wiki/PXE http://sourceforge.net/projects/erpxe/ http://erpxe.com/ Preboot eXecution Environment (PXE) (Entorno de ejecución de prearranque), es un entorno para arrancar  e instalar el  sistema operativo en ordenadores</itunes:subtitle><itunes:author>Javier Castañón</itunes:author><itunes:summary>Referencias: https://es.wikipedia.org/wiki/PXE http://sourceforge.net/projects/erpxe/ http://erpxe.com/ Preboot eXecution Environment (PXE) (Entorno de ejecución de prearranque), es un entorno para arrancar  e instalar el  sistema operativo en ordenadores a través de una red, de manera independiente de los  dispositivos de almacenamiento de datos disponibles (como discos duros) o de los sistemas operativos instalados. Tengo un viejo portatil (Fujitsu [...]</itunes:summary><itunes:keywords>ciencia,zen,técnico,sistemas,script,informática,currículum,aforismos,literatura,filosofía,linux,windows</itunes:keywords><feedburner:origLink>http://www.javcasta.com/2013/01/27/pxe-dhcp-server-en-windows-con-tftp32-y-erpxe-instalar-ubuntu-12-04-por-red/</feedburner:origLink><enclosure url="http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~5/P_QTzztbQwI/Tftpd32_SE-4.00-setup.exe" length="609978" type="application/x-msdos-program" /><feedburner:origEnclosureLink>http://tftpd32.jounin.net/download/Tftpd32_SE-4.00-setup.exe</feedburner:origEnclosureLink></item>
		<item>
		<title>Demo de Soporte remoto con ReverseVNC sobre tunel SSH</title>
		<link>http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~3/w9Iu2zLSrWQ/</link>
		<comments>http://www.javcasta.com/2013/01/26/demo-de-soporte-remoto-con-reversevnc-sobre-tunel-ssh/#comments</comments>
		<pubDate>Sat, 26 Jan 2013 17:22:58 +0000</pubDate>
		<dc:creator>fj.castanon@gmail.com (Javier Castañón)</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=8065</guid>
		<description><![CDATA[Referencias: http://www.javcasta.com/2012/12/28/reversevnc-lanzador-en-c-de-vnc-inverso-para-soporte-remoto/ http://www.javcasta.com/2013/01/20/seguridad-navegar-con-tunel-sobre-ssh-browse-to-tunnel-over-ssh/ Descargar Demo soporte remoto con reverseVNC over tunnel SSH.: Demo-Soporte-rVNCoverSSH He implementado una utilidad en C# como lanzador de ReverseVNC sobre tunel SSH para soporte remoto. La demo está compilada para .Net 2.0. En un proximo post, publicaré el código y la utilidad de forma que sea  parametrizable (poder editar el usuario:servidor [...]]]></description>
				<content:encoded><![CDATA[<g:plusone size="" href="http%3A%2F%2Fwww.javcasta.com%2F2013%2F01%2F26%2Fdemo-de-soporte-remoto-con-reversevnc-sobre-tunel-ssh%2F"></g:plusone><br /><p><!-- tweet id : 295220052976869377 --><style type='text/css'>#bbpBox_295220052976869377 a { text-decoration:none; color:#2FC2EF; }#bbpBox_295220052976869377 a:hover { text-decoration:underline; }</style><div id='bbpBox_295220052976869377' 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: Demo de Soporte remoto con ReverseVNC sobre tunel SSH <a href="http://t.co/kasRQdXk" rel="nofollow">http://t.co/kasRQdXk</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 26/01/2013 17:22' href='http://twitter.com/#!/javcasta/status/295220052976869377' target='_blank'>26/01/2013 17:22</a> via <a href="http://javcasta.com/" rel="nofollow" target="blank">MobileLitteBird</a><a href='https://twitter.com/intent/tweet?in_reply_to=295220052976869377' 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=295220052976869377' 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=295220052976869377' 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://a0.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/2012/12/28/reversevnc-lanzador-en-c-de-vnc-inverso-para-soporte-remoto/" target="_blank">http://www.javcasta.com/2012/12/28/reversevnc-lanzador-en-c-de-vnc-inverso-para-soporte-remoto/</a></li>
<li><a href="http://www.javcasta.com/2013/01/20/seguridad-navegar-con-tunel-sobre-ssh-browse-to-tunnel-over-ssh/" target="_blank">http://www.javcasta.com/2013/01/20/seguridad-navegar-con-tunel-sobre-ssh-browse-to-tunnel-over-ssh/</a></li>
</ul>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/01/ReverseVNCoverSSHDemo-0.jpg"><img class="aligncenter size-full wp-image-8068" alt="ReverseVNCoverSSHDemo-0" src="http://www.javcasta.com/blog/wp-content/uploads/2013/01/ReverseVNCoverSSHDemo-0.jpg" width="626" height="204" /></a></p>
<ul>
<li>Descargar Demo soporte remoto con reverseVNC over tunnel SSH.: <a href="http://www.javcasta.com/blog/wp-content/uploads/2013/01/Demo-Soporte-rVNCoverSSH.zip">Demo-Soporte-rVNCoverSSH</a></li>
</ul>
<p>He implementado una utilidad en<strong> C#</strong> como <strong>lanzador de ReverseVNC sobre tunel SSH</strong> para <strong>soporte remoto</strong>. La demo está compilada para<strong> .Net 2.0</strong>. En un proximo post, publicaré el código y la utilidad de forma que sea  parametrizable (poder editar el usuario:servidor para el tunel SSH, los puertos y el  servidor del soporte).</p>
<p><strong><span style="text-decoration: underline;">Lado del cliente:</span></strong></p>
<p>La utilidad usa en el <strong>lado del cliente</strong> (<strong><span style="color: #888888;">el que solicita soporte</span></strong>) el <strong>servidor winvnc</strong> de <a href="http://www.uvnc.com/" target="_blank"><strong>UltraVNC</strong></a><br />y <strong>plink</strong>, el <strong>cliente por consola ssh para windows de <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" target="_blank">Putty</a></strong>.</p>
<p>El lanzador en C# hace vía GUI la mecánica de los siguientes <strong>batch scripts</strong> ( .bat, .cmd):</p>
<pre class="brush: bash; title: ; notranslate">
@echo off
REM Lanzamos tunel SSH
REM echo y :es para contestar si a la pregunta :  Store key in cache? (y/n), del cliente plink
cmd /c echo y | PLINK.EXE -2 -N -L 9999:ip-o-dominio-del-soporte:443 -P 22 -C usuarioSSH@servidorSSH -pw laclave
</pre>
<p><strong>Si la autenticación y establecimineto del tunel ssh es OK, desde otra consola lanzamos el ReverseVNC sobre localhost al puerto 9999 que sera redirigido a ip-o-dominio-del-soporte al puerto 443 via el tunel ssh</strong></p>
<pre class="brush: bash; title: ; notranslate">
@echo off
start winvnc -connect 127.0.0.1::9999
</pre>
<p><strong>La topología:</strong></p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/01/tunel-ssh-arquitectura2.jpg"><img class="aligncenter size-full wp-image-8066" alt="tunel-ssh-arquitectura2" src="http://www.javcasta.com/blog/wp-content/uploads/2013/01/tunel-ssh-arquitectura2.jpg" width="650" height="366" /></a></p>
<p><span style="text-decoration: underline;"><strong>Lado del soporte:</strong></span></p>
<p>Necesita un <strong>servidor ssh</strong> para configurar el <strong>usuario:clave</strong> que establecerá el <strong>tunel desde el cliente al servidor</strong> y permitir que el servidor ssh haga <strong><em>port forwarding</em></strong>. Esto en el servidor <strong>openSSH</strong> se haria editando el fichero de conf del daemon sshd. Que Para mi servidor bajo <strong>debian</strong> es <em><strong>/etc/ssh/sshd_config</strong></em> y añadiendo o editando la linea</p>
<blockquote><p>AllowTcpForwarding yes</p>
</blockquote>
<p>Si el soporte se encuentra detras de un router con<strong> NAT</strong>, el puerto que es redireccionado desde el servidor ssh  hacia el equipo del soporte, debe ser nateado desde su router hacia su equipo.</p>
<p>Y por último necvesita tener el visor <strong>vncviewer.exe a la escucha</strong> en ese puerto. p.e:</p>
<blockquote><p>vncviewer /listen 443</p>
</blockquote>
<p>Como no me suelo encontrar mucho tiempo delante del pc, mediante <strong>autoit v3</strong> he implementado un script en el lado del soporte para que haga de <strong>robot de chat del vnc</strong> y conteste a aquel que se conecte y a los 10 sg rompa la conexión  ssh y vnc.</p>
<p style="text-align: center;"><a href="http://www.javcasta.com/blog/wp-content/uploads/2013/01/ReverseVNCoverSSHDemo-00.jpg"><img class="aligncenter size-full wp-image-8067" alt="ReverseVNCoverSSHDemo-00" src="http://www.javcasta.com/blog/wp-content/uploads/2013/01/ReverseVNCoverSSHDemo-00.jpg" width="650" height="439" /></a></p>
<p>El script en autoit3 <strong>robotChatVNC.au3</strong></p>
<pre class="brush: vb; title: ; notranslate">
#region --- Autoit Script Robot de chat de VNC  ---
;by JavCasta - 2.013 - http://javcasta.com
; Javier Castañón
#endregion --- Autoit Script Robot de chat de VNC End ---
Run(&quot;c:\UltraVNC\vncviewer.exe /8bit /listen 443 /scale 95/100&quot;)
Func ChatRobot()
	WinWait(&quot;[CLASS:VNCMDI_Window]&quot;)
	WinWaitActive(&quot;[CLASS:VNCMDI_Window]&quot;)
	Sleep(5000)
	MouseClick(&quot;left&quot;,450,44,1)
	Sleep(1000)
	Send(&quot;Hola,{SPACE}soy{SPACE}el{SPACE}robot{SPACE}de{SPACE}soporte{SPACE}remoto{SPACE}de{SPACE}javcasta.com{ENTER}&quot;)
	Send(&quot;ahora{SPACE}mismo{SPACE}no{SPACE}estoy{SPACE}disponible.{ENTER}&quot;)
	Send(&quot;{SHIFTDOWN}s{SHIFTUP}i{SPACE}necesitas{SPACE}soporte.{SPACE}{SHIFTDOWN}m{SHIFTUP}andame{SPACE}un{SPACE}email{SPACE}a{SPACE}javier{CTRLDOWN}{ALTDOWN}2{CTRLUP}{ALTUP}javcasta.com{SPACE}{ENTER}&quot;)
	Send(&quot;con{SPACE}el{SPACE}asunto{SPACE}{CAPSLOCK}soporte{CAPSLOCK}{ENTER}{SHIFTDOWN}s{SHIFTUP}aludos.{ENTER}http{SHIFTDOWN}.{SHIFTUP}{SHIFTDOWN}77{SHIFTUP}javcasta.com{ENTER}&quot;)
	Send(&quot;========================================================={ENTER}&quot;)
	Send(&quot;{SPACE}{ENTER}&quot;)
	Send(&quot;Para{SPACE}terminar{SPACE}clika{SPACE}en{SPACE}close{SPACE}este{SPACE}chat{ENTER}y{SPACE}luego{SPACE}en{SPACE}Terminar{SPACE}Soporte{ENTER}&quot;)
	Send(&quot;o{SPACE}espera{SPACE}10{SPACE}sg{SPACE}.{ENTER}&quot;)
	Sleep(10000)
	WinClose(&quot;[CLASS:#32770]&quot;)
	Sleep(1000)
	WinClose(&quot;[CLASS:VNCMDI_Window]&quot;)
	Sleep(5000)
	ChatRobot()
EndFunc
ChatRobot()
</pre>
<p>Muy util autoit, y como se aprecia en el script, permite <strong>recursividad</strong> en las funciones.</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%2F2013%2F01%2F26%2Fdemo-de-soporte-remoto-con-reversevnc-sobre-tunel-ssh%2F&amp;title=Demo%20de%20Soporte%20remoto%20con%20ReverseVNC%20sobre%20tunel%20SSH" 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><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=w9Iu2zLSrWQ:eHwoXS67eVI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=w9Iu2zLSrWQ:eHwoXS67eVI:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=w9Iu2zLSrWQ:eHwoXS67eVI:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=w9Iu2zLSrWQ:eHwoXS67eVI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=w9Iu2zLSrWQ:eHwoXS67eVI:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=w9Iu2zLSrWQ:eHwoXS67eVI:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=w9Iu2zLSrWQ:eHwoXS67eVI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=w9Iu2zLSrWQ:eHwoXS67eVI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=w9Iu2zLSrWQ:eHwoXS67eVI:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=w9Iu2zLSrWQ:eHwoXS67eVI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=w9Iu2zLSrWQ:eHwoXS67eVI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=w9Iu2zLSrWQ:eHwoXS67eVI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=w9Iu2zLSrWQ:eHwoXS67eVI:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=w9Iu2zLSrWQ:eHwoXS67eVI:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=w9Iu2zLSrWQ:eHwoXS67eVI:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=w9Iu2zLSrWQ:eHwoXS67eVI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?i=w9Iu2zLSrWQ:eHwoXS67eVI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?a=w9Iu2zLSrWQ:eHwoXS67eVI:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~4/w9Iu2zLSrWQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javcasta.com/2013/01/26/demo-de-soporte-remoto-con-reversevnc-sobre-tunel-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<media:content url="http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~5/_0caZMCBm6I/Demo-Soporte-rVNCoverSSH.zip" fileSize="1060002" type="application/zip" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>Referencias: http://www.javcasta.com/2012/12/28/reversevnc-lanzador-en-c-de-vnc-inverso-para-soporte-remoto/ http://www.javcasta.com/2013/01/20/seguridad-navegar-con-tunel-sobre-ssh-browse-to-tunnel-over-ssh/ Descargar Demo soporte remoto con reverseVNC o</itunes:subtitle><itunes:author>Javier Castañón</itunes:author><itunes:summary>Referencias: http://www.javcasta.com/2012/12/28/reversevnc-lanzador-en-c-de-vnc-inverso-para-soporte-remoto/ http://www.javcasta.com/2013/01/20/seguridad-navegar-con-tunel-sobre-ssh-browse-to-tunnel-over-ssh/ Descargar Demo soporte remoto con reverseVNC over tunnel SSH.: Demo-Soporte-rVNCoverSSH He implementado una utilidad en C# como lanzador de ReverseVNC sobre tunel SSH para soporte remoto. La demo está compilada para .Net 2.0. En un proximo post, publicaré el código y la utilidad de forma que sea  parametrizable (poder editar el usuario:servidor [...]</itunes:summary><itunes:keywords>ciencia,zen,técnico,sistemas,script,informática,currículum,aforismos,literatura,filosofía,linux,windows</itunes:keywords><feedburner:origLink>http://www.javcasta.com/2013/01/26/demo-de-soporte-remoto-con-reversevnc-sobre-tunel-ssh/</feedburner:origLink><enclosure url="http://feedproxy.google.com/~r/ElCamelloElLeonYElNioOLaEvolucinDelPerroAlLobo/~5/_0caZMCBm6I/Demo-Soporte-rVNCoverSSH.zip" length="1060002" type="application/zip" /><feedburner:origEnclosureLink>http://www.javcasta.com/blog/wp-content/uploads/2013/01/Demo-Soporte-rVNCoverSSH.zip</feedburner:origEnclosureLink></item>
	<copyright>Built by JavCasta 2.009</copyright><media:credit role="author">Javier Castañón</media:credit><media:rating>nonadult</media:rating><media:description type="plain">Evolución del perro al lobo</media:description></channel>
</rss>
