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

<channel>
	<title>Linux 360° &#124; Italia</title>
	<atom:link href="http://www.linux360.it/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linux360.it</link>
	<description>Notizie, guide e tutorial per il mondo Linux a 360°</description>
	<lastBuildDate>Tue, 16 Dec 2014 14:03:33 +0000</lastBuildDate>
	<language>it-IT</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.9.40</generator>
	<item>
		<title>DHCP Options: Rotte Statiche via DHCP</title>
		<link>http://www.linux360.it/2014/12/16/dhcp-options-rotte-statiche-via-dhcp/</link>
		<comments>http://www.linux360.it/2014/12/16/dhcp-options-rotte-statiche-via-dhcp/#comments</comments>
		<pubDate>Tue, 16 Dec 2014 09:15:48 +0000</pubDate>
		<dc:creator><![CDATA[Paolo Daniele]]></dc:creator>
				<category><![CDATA[Vari]]></category>
		<category><![CDATA[121]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[mikrotik]]></category>
		<category><![CDATA[pfsense]]></category>
		<category><![CDATA[rotte]]></category>
		<category><![CDATA[statiche]]></category>

		<guid isPermaLink="false">http://www.paolodaniele.it/?p=2051</guid>
		<description><![CDATA[<p>Ciao Ragazzi, oggi andiamo sull&#8217;avanzato. Tutti conoscono il DHCP e cosa fa un DHCP Server, ma pochi sanno che tramite DHCP si possono passare altre informazioni agli utenti che si collegano. In diversi casi, specie in grandi aziende, con molte subnet diverse, è necessario passare delle rotte statiche ai client che si collegano in automatico: ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/12/16/dhcp-options-rotte-statiche-via-dhcp/">DHCP Options: Rotte Statiche via DHCP</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Ciao Ragazzi,</p>
<p>oggi andiamo sull&#8217;avanzato. Tutti conoscono il DHCP e cosa fa un DHCP Server, ma pochi sanno che tramite DHCP si possono passare altre informazioni agli utenti che si collegano.</p>
<p>In diversi casi, specie in grandi aziende, con molte subnet diverse, è necessario passare delle rotte statiche ai client che si collegano in automatico: questo per semplificare l&#8217;aggiunta di rotte statiche sui pc degli utenti.</p>
<p>Per lavoro utilizzo molto due strumenti che permettono l&#8217;inserimento di queste opzioni, ma che sono leggermente diversi tra loro.</p>
<p>Il primo è PfSense, uno dei migliori firewall open source presenti in circolazione.</p>
<p>Il secondo è Mikrotik.</p>
<p>Analizziamoli:</p>
<p><strong>1) PfSense</strong></p>
<p>Su PfSense è possibile definire due tipi di rotte statiche via DHCP:</p>
<ul>
<li>Single route (<a href="http://www.networksorcery.com/enp/protocol/bootp/option033.htm">DHCP Option 33</a>)</li>
<li>Classless Static Route (<a href="http://tools.ietf.org/html/rfc3442">DHCP Option 121</a>)</li>
</ul>
<p>Nel primo caso si definisce solo l&#8217;IP di destinazione ed il Gateway come nella figura:</p>
<p><a href="http://www.paolodaniele.it/wp-content/uploads/2014/12/pfsense-dhcp-option-33_2.png"><img class="alignnone  wp-image-2052" src="http://www.paolodaniele.it/wp-content/uploads/2014/12/pfsense-dhcp-option-33_2.png" alt="pfsense-dhcp-option-33_2" width="558" height="114" /></a></p>
<p>Il valore Esadecimale è calcolato in questo modo:</p>
<ul>
<li>IP Destinazione: 192.168.123.234 (Hex: C0:A8:7B:EA)</li>
<li>IP Gateway: 10.34.72.42 (Hex: 0A:22:48:2A)</li>
</ul>
<p>Quindi il valore da inserire sulla PFSense sarà: <strong>C0:A8:7B:EA:0A:22:48:2A</strong></p>
<p>Nel secondo caso, si definisce IP destinazione, Subnet Mask e Gateway:</p>
<p><a href="http://www.paolodaniele.it/wp-content/uploads/2014/12/pfsense-dhcp-option-121.png"><img class="alignnone  wp-image-2053" src="http://www.paolodaniele.it/wp-content/uploads/2014/12/pfsense-dhcp-option-121.png" alt="pfsense-dhcp-option-121" width="556" height="112" /></a></p>
<p>Come si nota anche dall&#8217;immagine, la differenza è che il valore che precede tutto è la conversione in Hex della netmask.</p>
<ul>
<li>IP Destinazione: 192.168.123.234 (Hex: C0:A8:7B:EA)</li>
<li>IP Gateway: 10.34.72.42 (Hex: 0A:22:48:2A)</li>
<li>Netmask: 24 (Hex: 18)</li>
</ul>
<p>Quindi il valore da inserire sulla PFSense sarà: <strong>18:C0:A8:7B:EA:0A:22:48:2A</strong></p>
<p>&nbsp;</p>
<p><strong>2) Mikrotik</strong></p>
<p>Sui dispositivi Mikrotik, a partire dalla versione <strong>6.00 </strong>(prima non funziona correttamente) è possibile impostare le rotte statiche via DHCP, utilizzando il seguente formato:</p>
<p>0xnnddddddddgggggggg</p>
<p>Dove:</p>
<ul>
<li>nn = Netmask</li>
<li>dddddddd = IP Destinazione</li>
<li>gggggggg = IP Gateway</li>
</ul>
<p>Quindi per aggiungere la regola di esempio precedente dovremmo eseguire:</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;"><span class="sy0">/</span>ip dhcp<span class="sy0">-</span>server option add name<span class="sy0">=</span>classlessroutes code<span class="sy0">=</span><span class="nu0">121</span> value<span class="sy0">=</span>0x18C0A87BEA0A22482A</pre></div></div>
<p>&nbsp;</p>
<p>Per semplificare la vita a chi non ha &#8220;voglia&#8221; di fare le conversioni ho realizzato un piccolo tool in Java che permette di effettuare la conversione direttamente per il tipo di sistema desiderato.</p>
<p>Da questo <a href="http://we.tl/A3ofi5t96Y">link</a> è possibile scaricare il programma da eseguire semplicemente con:</p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">java <span class="re5">-jar</span> frank.jar</pre></div></div>
<p>Il programma ovviamente si chiama come l&#8217;amico che mi ha dato l&#8217;idea di realizzarlo!</p>
<p>Enjoy!</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/12/16/dhcp-options-rotte-statiche-via-dhcp/">DHCP Options: Rotte Statiche via DHCP</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/12/16/dhcp-options-rotte-statiche-via-dhcp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sito Web attaccato? Strategie di Difesa</title>
		<link>http://www.linux360.it/2014/11/22/sito-web-attaccato-strategie-di-difesa/</link>
		<comments>http://www.linux360.it/2014/11/22/sito-web-attaccato-strategie-di-difesa/#comments</comments>
		<pubDate>Sat, 22 Nov 2014 11:03:48 +0000</pubDate>
		<dc:creator><![CDATA[Paolo Daniele]]></dc:creator>
				<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[Vari]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[base64]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[compromesso]]></category>
		<category><![CDATA[eval]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sito]]></category>

		<guid isPermaLink="false">http://www.paolodaniele.it/?p=2043</guid>
		<description><![CDATA[<p>Ciao Ragazzi, oggi ho deciso di affrontare un argomento interessante. La maggior parte dei siti web php based oggi utilizza un CMS (Content Management System) come Joomla, WordPress, phpBB, siti di ecommerce etc. Questi hanno semplificato di molto la vita degli utenti ma hanno anche aperto le porte ad attacchi di cracker sempre più frequenti. ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/11/22/sito-web-attaccato-strategie-di-difesa/">Sito Web attaccato? Strategie di Difesa</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Ciao Ragazzi,</p>
<p>oggi ho deciso di affrontare un argomento interessante.</p>
<p>La maggior parte dei siti web php based oggi utilizza un CMS (Content Management System) come Joomla, WordPress, phpBB, siti di ecommerce etc.</p>
<p>Questi hanno semplificato di molto la vita degli utenti ma hanno anche aperto le porte ad attacchi di cracker sempre più frequenti.</p>
<p>Molto spesso il nostro sito è sotto attacco e noi non ce ne accorgiamo nemmeno!</p>
<p>Vediamo un po&#8217; come accorgersi se un sito web è stato attaccato e quindi compromesso!</p>
<p><strong>ATTENZIONE: questa guida presuppone che voi possiate accedere ai log del vostro server web e soprattutto al terminale.</strong></p>
<p>Possiamo cominciare.</p>
<p>Per prima cosa si cercano i file .php che sono stati modificati negli ultimi giorni:</p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">find</span> . <span class="re5">-type</span> f <span class="re5">-name</span> <span class="st_h">'*.php'</span> <span class="sy0">|</span> <span class="kw2">xargs</span> <span class="kw2">grep</span> <span class="re5">-l</span> <span class="st0">&quot;eval *(&quot;</span> <span class="re5">--color</span>
<span class="kw2">find</span> . <span class="re5">-type</span> f <span class="re5">-name</span> <span class="st_h">'*.php'</span> <span class="sy0">|</span> <span class="kw2">xargs</span> <span class="kw2">grep</span> <span class="re5">-l</span> <span class="st0">&quot;base64_decode *(&quot;</span> <span class="re5">--color</span>
<span class="kw2">find</span> . <span class="re5">-type</span> f <span class="re5">-name</span> <span class="st_h">'*.php'</span> <span class="sy0">|</span> <span class="kw2">xargs</span> <span class="kw2">grep</span> <span class="re5">-l</span> <span class="st0">&quot;gzinflate *(&quot;</span> <span class="re5">--color</span></pre></div></div>
<p>In genere gli autori degli script utilizzati per attaccare i siti li mascherano per evitare eventuali antivirus o software capaci di identificare codice maligno.</p>
<p>In questo modo i file che verranno restituiti saranno al 90% sicuramente compromessi (a meno che non abbiate acquisto un qualche script php che non viene fornito con codice sorgente ma viene mascherato!)</p>
<p>Vediamo un esempio pratico che cerca nella cartella wp-content di WordPress:</p>
<div id="wpshdo_4" class="wp-synhighlighter-outer"><div id="wpshdt_4" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_4"></a><a id="wpshat_4" class="wp-synhighlighter-title" href="#codesyntax_4"  onClick="javascript:wpsh_toggleBlock(4)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_4" onClick="javascript:wpsh_code(4)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_4" onClick="javascript:wpsh_print(4)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_4" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">find</span> wp-content <span class="re5">-type</span> f <span class="re5">-name</span> <span class="st_h">'*.php'</span> <span class="sy0">|</span> <span class="kw2">xargs</span> <span class="kw2">grep</span> <span class="re5">-l</span> <span class="st0">&quot;gzinflate *(&quot;</span> <span class="re5">--color</span></pre></div></div>
<p>In alcuni casi, dove gli script sono in chiaro alcune delle opzioni che usano sono quelle di aprire dei socket oppure lanciare comandi per eseguire operazioni sul server: Ecco come cercare questo tipo di files:</p>
<div id="wpshdo_5" class="wp-synhighlighter-outer"><div id="wpshdt_5" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_5"></a><a id="wpshat_5" class="wp-synhighlighter-title" href="#codesyntax_5"  onClick="javascript:wpsh_toggleBlock(5)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_5" onClick="javascript:wpsh_code(5)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_5" onClick="javascript:wpsh_print(5)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_5" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">find</span> . <span class="re5">-type</span> f <span class="re5">-name</span> <span class="st_h">'*.php'</span> <span class="sy0">|</span> <span class="kw2">xargs</span> <span class="kw2">egrep</span> <span class="re5">-i</span> <span class="st0">&quot;(mail|fsockopen|pfsockopen|stream_socket_client|exec|system|passthru|eval|base64_decode) *(&quot;</span></pre></div></div>
<p>Ma chi attacca i siti queste cose le sa bene, per cui spesso maschera questo tipo di operazioni utilizzando direttamente la codifica Esadecimale (HEX)</p>
<p>In questo modo noi non troveremmo niente eppure il sito rimane compromesso&#8230;</p>
<p>Ecco come fare:</p>
<div id="wpshdo_6" class="wp-synhighlighter-outer"><div id="wpshdt_6" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_6"></a><a id="wpshat_6" class="wp-synhighlighter-title" href="#codesyntax_6"  onClick="javascript:wpsh_toggleBlock(6)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_6" onClick="javascript:wpsh_code(6)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_6" onClick="javascript:wpsh_print(6)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_6" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">find</span> . <span class="re5">-type</span> f <span class="re5">-name</span> <span class="st_h">'*.php'</span> <span class="sy0">|</span> <span class="kw2">xargs</span> <span class="kw2">egrep</span> <span class="re5">-i</span> <span class="st0">&quot;preg_replace *((['|&quot;</span><span class="br0">]</span><span class="br0">&#41;</span><span class="br0">&#40;</span>.<span class="br0">&#41;</span>.<span class="sy0">*</span><span class="nu0">2</span><span class="br0">[</span>a-z<span class="br0">]</span><span class="sy0">*</span>e<span class="br0">[</span>^<span class="nu0">1</span><span class="br0">]</span><span class="sy0">*</span><span class="nu0">1</span> <span class="sy0">*</span>,<span class="st0">&quot; --color</span></pre></div></div>
<p>Con il codice che ho scritto sopra si vanno a cercare tutti i preg_replace dove si cerca di inserire del codice esadecimale!</p>
<p>Continuiamo con l&#8217;esempio di WordPress.</p>
<p>Mettiamo il caso di avere il sospetto o la certezza che il sito sia stato compromesso.</p>
<p>Possiamo effettuare un upload sul server di una versione &#8220;pulita&#8221; di wordpress( o un altro cms) in un&#8217;altra cartella ed effettuare un <strong>diff</strong> per notare eventuali differenze (Attenzione perchè in questo caso le versioni del CMS devono essere uguali!)</p>
<div id="wpshdo_7" class="wp-synhighlighter-outer"><div id="wpshdt_7" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_7"></a><a id="wpshat_7" class="wp-synhighlighter-title" href="#codesyntax_7"  onClick="javascript:wpsh_toggleBlock(7)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_7" onClick="javascript:wpsh_code(7)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_7" onClick="javascript:wpsh_print(7)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_7" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">diff</span> <span class="re5">-r</span> wordpress-ok<span class="sy0">/</span> wordpress-hack<span class="sy0">/</span> <span class="re5">-x</span> wp-content</pre></div></div>
<p>Inoltre la maggior parte degli attacchi prolificano su server dove vengono concessi (volontariamente o meno) i permessi di scrittura sulle cartelle.</p>
<p>Di seguito un breve script per aiutare a capire i file .php presenti nelle cartelle con permessi 777:</p>
<div id="wpshdo_8" class="wp-synhighlighter-outer"><div id="wpshdt_8" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_8"></a><a id="wpshat_8" class="wp-synhighlighter-title" href="#codesyntax_8"  onClick="javascript:wpsh_toggleBlock(8)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_8" onClick="javascript:wpsh_code(8)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_8" onClick="javascript:wpsh_print(8)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_8" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="co0">#!/bin/bash</span>
&nbsp;
<span class="re2">search_dir</span>=$<span class="br0">&#40;</span><span class="kw3">pwd</span><span class="br0">&#41;</span>
<span class="re2">writable_dirs</span>=$<span class="br0">&#40;</span><span class="kw2">find</span> <span class="re1">$search_dir</span> <span class="re5">-type</span> d <span class="re5">-perm</span> 0777<span class="br0">&#41;</span>
&nbsp;
<span class="kw1">for</span> <span class="kw2">dir</span> <span class="kw1">in</span> <span class="re1">$writable_dirs</span>
<span class="kw1">do</span>
    <span class="co0">#echo $dir</span>
    <span class="kw2">find</span> <span class="re1">$dir</span> <span class="re5">-type</span> f <span class="re5">-name</span> <span class="st_h">'*.php'</span>
<span class="kw1">done</span></pre></div></div>
<p>Reso eseguibile lo script è possibile verificare i file in questo modo:</p>
<div id="wpshdo_9" class="wp-synhighlighter-outer"><div id="wpshdt_9" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_9"></a><a id="wpshat_9" class="wp-synhighlighter-title" href="#codesyntax_9"  onClick="javascript:wpsh_toggleBlock(9)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_9" onClick="javascript:wpsh_code(9)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_9" onClick="javascript:wpsh_print(9)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_9" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">.<span class="sy0">/</span>search_php777 <span class="sy0">&gt;</span> results.txt</pre></div></div>
<p>Questo script può essere variato nel seguente modo (in base a quanto abbiamo detto prima):</p>
<div id="wpshdo_10" class="wp-synhighlighter-outer"><div id="wpshdt_10" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_10"></a><a id="wpshat_10" class="wp-synhighlighter-title" href="#codesyntax_10"  onClick="javascript:wpsh_toggleBlock(10)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_10" onClick="javascript:wpsh_code(10)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_10" onClick="javascript:wpsh_print(10)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_10" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="co0">#!/bin/bash</span>
&nbsp;
<span class="re2">IFS</span>=$<span class="st_h">'n'</span>
&nbsp;
<span class="kw1">while</span> <span class="kw2">read</span> php_file
<span class="kw1">do</span>
    <span class="kw2">egrep</span> <span class="re5">-i</span> <span class="st0">&quot;(mail|eval|base64_decode|str_rot13|chmod|fwrite|exec|passthru|shell_exec|system|proc_open|popen|curl_exec|curl_multi_exec|show_source|fsockopen|pfsockopen|stream_socket_client) *(&quot;</span> <span class="st0">&quot;<span class="es2">$php_file</span>&quot;</span>
<span class="kw1">done</span> <span class="sy0">&lt;</span> php_in_writable.txt</pre></div></div>
<p>Da eseguire in questo modo:</p>
<div id="wpshdo_11" class="wp-synhighlighter-outer"><div id="wpshdt_11" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_11"></a><a id="wpshat_11" class="wp-synhighlighter-title" href="#codesyntax_11"  onClick="javascript:wpsh_toggleBlock(11)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_11" onClick="javascript:wpsh_code(11)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_11" onClick="javascript:wpsh_print(11)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_11" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">.<span class="sy0">/</span>find_malicious</pre></div></div>
</div>
<p>Ultima ma non meno importante delle cose da verificare, è la possibilità che del codice php sia &#8220;nascosto&#8221; dentro una immagine:</p>
<div id="wpshdo_12" class="wp-synhighlighter-outer"><div id="wpshdt_12" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_12"></a><a id="wpshat_12" class="wp-synhighlighter-title" href="#codesyntax_12"  onClick="javascript:wpsh_toggleBlock(12)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_12" onClick="javascript:wpsh_code(12)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_12" onClick="javascript:wpsh_print(12)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_12" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">find</span> wp-content<span class="sy0">/</span>uploads <span class="re5">-type</span> f <span class="re5">-iname</span> <span class="st_h">'*.jpg'</span> <span class="sy0">|</span> <span class="kw2">xargs</span> <span class="kw2">grep</span> <span class="re5">-i</span> php</pre></div></div>
<p>Per chi preferisce avere un unico script che fa tutto, può utilizzare <a href="https://github.com/neohapsis/neopi">NeoPI</a> che racchiunde gran parte delle analisi che vi ho mostrato solo scritte in Python!</p>
<p>Buona analisi a tutti.</p>
<p>Enjoy!</p>
</div>
</div>
</div>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/11/22/sito-web-attaccato-strategie-di-difesa/">Sito Web attaccato? Strategie di Difesa</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/11/22/sito-web-attaccato-strategie-di-difesa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aumentare Sicurezza SSL Apache2</title>
		<link>http://www.linux360.it/2014/11/18/aumentare-sicurezza-ssl-apache2/</link>
		<comments>http://www.linux360.it/2014/11/18/aumentare-sicurezza-ssl-apache2/#comments</comments>
		<pubDate>Tue, 18 Nov 2014 17:44:04 +0000</pubDate>
		<dc:creator><![CDATA[Paolo Daniele]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[check]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[vulnerability]]></category>

		<guid isPermaLink="false">http://www.paolodaniele.it/?p=2040</guid>
		<description><![CDATA[<p>SSLCompression offCiao Ragazzi, oggi vi spiego un po&#8217; di info basilari su come implementare delle policy di strong security per Apache2. Quello che andremo a fare sarà principalmente la disattivazione della compressione SSL, per evitare attacchi di tipo CRIME e la disabilitazione di SSL v.3 Per chi volesse saperne di più sui tipi di attacchi ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/11/18/aumentare-sicurezza-ssl-apache2/">Aumentare Sicurezza SSL Apache2</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>SSLCompression offCiao Ragazzi,</p>
<p>oggi vi spiego un po&#8217; di info basilari su come implementare delle policy di strong security per Apache2.</p>
<p>Quello che andremo a fare sarà principalmente la disattivazione della compressione SSL, per evitare attacchi di tipo CRIME e la disabilitazione di SSL v.3</p>
<p>Per chi volesse saperne di più sui tipi di attacchi che può subire un server Apache2 con SSL:</p>
<ul>
<li><a href="https://en.wikipedia.org/wiki/Transport_Layer_Security#BEAST_attack">BEAST Attack</a></li>
<li><a href="https://en.wikipedia.org/wiki/CRIME_%28security_exploit%29">CRIME Attack</a></li>
<li><a href="https://en.wikipedia.org/wiki/Perfect_forward_secrecy">Perfect Forward Secrecy</a></li>
<li><a href="https://en.wikipedia.org/wiki/Transport_Layer_Security#Dealing_with_RC4_and_BEAST">Dealing with RC4 and BEAST</a></li>
</ul>
<p>&nbsp;</p>
<p>Vediamo adesso come proteggerci.</p>
<p>Per prima cosa aprire il file di configurazione del webserver che utilizza SSL e aggiungiamo la seguente riga:</p>
<p>&nbsp;</p>
<div id="wpshdo_13" class="wp-synhighlighter-outer"><div id="wpshdt_13" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_13"></a><a id="wpshat_13" class="wp-synhighlighter-title" href="#codesyntax_13"  onClick="javascript:wpsh_toggleBlock(13)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_13" onClick="javascript:wpsh_code(13)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_13" onClick="javascript:wpsh_print(13)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_13" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">SSLCompression off</pre></div></div>
<p>In questo modo disattiviamo la compressione SSL e quindi si evitamo attacchi Crime.</p>
<p>Per evitare problemi di sicurezza relativi alle versioni 2 e 3 di SSL quello che si fa è abilitare solo la versione 1 con la seguente stringa:</p>
<div id="wpshdo_14" class="wp-synhighlighter-outer"><div id="wpshdt_14" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_14"></a><a id="wpshat_14" class="wp-synhighlighter-title" href="#codesyntax_14"  onClick="javascript:wpsh_toggleBlock(14)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_14" onClick="javascript:wpsh_code(14)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_14" onClick="javascript:wpsh_print(14)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_14" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">SSLProtocol All <span class="re5">-SSLv2</span> <span class="re5">-SSLv3</span></pre></div></div>
<p>Infine vanno modificate le cifrature possibili&#8230;Diciamo che le ideali sono 2-3 ma purtroppo per rendere il sito retrocompatibile con IE e Windows è necessario abilitarne diverse:</p>
<div id="wpshdo_15" class="wp-synhighlighter-outer"><div id="wpshdt_15" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_15"></a><a id="wpshat_15" class="wp-synhighlighter-title" href="#codesyntax_15"  onClick="javascript:wpsh_toggleBlock(15)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_15" onClick="javascript:wpsh_code(15)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_15" onClick="javascript:wpsh_print(15)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_15" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">SSLCipherSuite ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:<span class="sy0">!</span>aNULL:<span class="sy0">!</span>eNULL:<span class="sy0">!</span>EXPORT:<span class="sy0">!</span>DES:<span class="sy0">!</span>MD5:<span class="sy0">!</span>PSK:<span class="sy0">!</span>RC4</pre></div></div>
<p>&nbsp;</p>
<p>Il gioco è fatto.</p>
<p>Salvare e verificare la configurazione di apache, se tutto è ok si può fare un restart:</p>
<div id="wpshdo_16" class="wp-synhighlighter-outer"><div id="wpshdt_16" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_16"></a><a id="wpshat_16" class="wp-synhighlighter-title" href="#codesyntax_16"  onClick="javascript:wpsh_toggleBlock(16)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_16" onClick="javascript:wpsh_code(16)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_16" onClick="javascript:wpsh_print(16)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_16" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="co0">#Controllo Config</span>
&nbsp;
apache2ctl <span class="re5">-t</span>
&nbsp;
<span class="co0">#Riavvio Apache</span>
&nbsp;
<span class="sy0">/</span>etc<span class="sy0">/</span>init.d<span class="sy0">/</span>apache2 restart</pre></div></div>
<p>Per controllare il risultato:</p>
<p>https://www.ssllabs.com/ssltest/analyze.html?d=miodominio.it</p>
<p>Enjoy!</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/11/18/aumentare-sicurezza-ssl-apache2/">Aumentare Sicurezza SSL Apache2</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/11/18/aumentare-sicurezza-ssl-apache2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configurare Postfix come smtp Gmail Relay</title>
		<link>http://www.linux360.it/2014/10/27/configurare-postfix-come-smtp-gmail-relay/</link>
		<comments>http://www.linux360.it/2014/10/27/configurare-postfix-come-smtp-gmail-relay/#comments</comments>
		<pubDate>Mon, 27 Oct 2014 09:06:37 +0000</pubDate>
		<dc:creator><![CDATA[Francesco Gabriele]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[relaygmail]]></category>
		<category><![CDATA[relaygoogle]]></category>

		<guid isPermaLink="false">http://www.ubuntuserver.it/?p=801</guid>
		<description><![CDATA[<p>Installiamo i pacchetti necessari: Rinconfiguriamo Postfix selezionando &#8220;Sito internet con SmartHost&#8221; ed inseriamo il seguente server: Una volta ultimato il wizard editiamo il file /etc/postfix/main.cf ed aggiungiamo le seguenti righe: Adesso creiamo il file contenente il nome utente e la password dell&#8217;email google: Modifichiamo i permessi del file: Modifichiamo il file per essere letto da ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/10/27/configurare-postfix-come-smtp-gmail-relay/">Configurare Postfix come smtp Gmail Relay</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p><strong>Installiamo i pacchetti necessari:</strong><br />
<div id="wpshdo_17" class="wp-synhighlighter-outer"><div id="wpshdt_17" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_17"></a><a id="wpshat_17" class="wp-synhighlighter-title" href="#codesyntax_17"  onClick="javascript:wpsh_toggleBlock(17)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_17" onClick="javascript:wpsh_code(17)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_17" onClick="javascript:wpsh_print(17)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_17" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">apt-get</span> <span class="kw2">install</span> postfix libsasl2-<span class="nu0">2</span> ca-certificates libsasl2-modules mailutils</pre></div></div>
<p><strong>Rinconfiguriamo Postfix selezionando &#8220;Sito internet con SmartHost&#8221; ed inseriamo il seguente</strong> <strong>server:</strong><br />
<div id="wpshdo_18" class="wp-synhighlighter-outer"><div id="wpshdt_18" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_18"></a><a id="wpshat_18" class="wp-synhighlighter-title" href="#codesyntax_18"  onClick="javascript:wpsh_toggleBlock(18)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_18" onClick="javascript:wpsh_code(18)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_18" onClick="javascript:wpsh_print(18)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_18" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="br0">[</span>smtp.gmail.com<span class="br0">]</span>:<span class="nu0">587</span></pre></div></div>
<p><strong>Una volta ultimato il wizard editiamo il file /etc/postfix/main.cf ed aggiungiamo le seguenti righe:</strong><br />
<div id="wpshdo_19" class="wp-synhighlighter-outer"><div id="wpshdt_19" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_19"></a><a id="wpshat_19" class="wp-synhighlighter-title" href="#codesyntax_19"  onClick="javascript:wpsh_toggleBlock(19)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_19" onClick="javascript:wpsh_code(19)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_19" onClick="javascript:wpsh_print(19)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_19" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">smtp_sasl_auth_enable = <span class="kw2">yes</span>
smtp_sasl_password_maps = <span class="kw3">hash</span>:<span class="sy0">/</span>etc<span class="sy0">/</span>postfix<span class="sy0">/</span>sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = <span class="sy0">/</span>etc<span class="sy0">/</span>postfix<span class="sy0">/</span>cacert.pem
smtp_use_tls = <span class="kw2">yes</span>
sender_canonical_maps = <span class="kw3">hash</span>:<span class="sy0">/</span>etc<span class="sy0">/</span>postfix<span class="sy0">/</span>sender_canonical</pre></div></div>
<p><strong>Adesso creiamo il file contenente il nome utente e la password dell&#8217;email google:</strong><br />
<div id="wpshdo_20" class="wp-synhighlighter-outer"><div id="wpshdt_20" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_20"></a><a id="wpshat_20" class="wp-synhighlighter-title" href="#codesyntax_20"  onClick="javascript:wpsh_toggleBlock(20)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_20" onClick="javascript:wpsh_code(20)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_20" onClick="javascript:wpsh_print(20)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_20" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">vim</span> <span class="sy0">/</span>etc<span class="sy0">/</span>postfix<span class="sy0">/</span>sasl_passwd
<span class="br0">[</span>smtp.gmail.com<span class="br0">]</span>:<span class="nu0">587</span>    username<span class="sy0">@</span>gmail.com:password</pre></div></div>
<p><strong>Modifichiamo i permessi del file:</strong><br />
<div id="wpshdo_21" class="wp-synhighlighter-outer"><div id="wpshdt_21" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_21"></a><a id="wpshat_21" class="wp-synhighlighter-title" href="#codesyntax_21"  onClick="javascript:wpsh_toggleBlock(21)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_21" onClick="javascript:wpsh_code(21)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_21" onClick="javascript:wpsh_print(21)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_21" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">chmod</span> <span class="nu0">400</span> <span class="sy0">/</span>etc<span class="sy0">/</span>postfix<span class="sy0">/</span>sasl_passwd</pre></div></div>
<p><strong>Modifichiamo il file per essere letto da postfix:</strong><br />
<div id="wpshdo_22" class="wp-synhighlighter-outer"><div id="wpshdt_22" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_22"></a><a id="wpshat_22" class="wp-synhighlighter-title" href="#codesyntax_22"  onClick="javascript:wpsh_toggleBlock(22)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_22" onClick="javascript:wpsh_code(22)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_22" onClick="javascript:wpsh_print(22)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_22" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">postmap <span class="sy0">/</span>etc<span class="sy0">/</span>postfix<span class="sy0">/</span>sasl_passwd</pre></div></div>
<p><strong>Risciviamo il mittente sostituendo root con la nostra email:</strong><br />
<div id="wpshdo_23" class="wp-synhighlighter-outer"><div id="wpshdt_23" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_23"></a><a id="wpshat_23" class="wp-synhighlighter-title" href="#codesyntax_23"  onClick="javascript:wpsh_toggleBlock(23)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_23" onClick="javascript:wpsh_code(23)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_23" onClick="javascript:wpsh_print(23)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_23" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">vim</span> <span class="sy0">/</span>etc<span class="sy0">/</span>postfix<span class="sy0">/</span>sender_canonical
root        username<span class="sy0">@</span>gmail.com</pre></div></div>
<p><strong>Modifichiamo i permessi anche di questo file:</strong><br />
<div id="wpshdo_24" class="wp-synhighlighter-outer"><div id="wpshdt_24" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_24"></a><a id="wpshat_24" class="wp-synhighlighter-title" href="#codesyntax_24"  onClick="javascript:wpsh_toggleBlock(24)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_24" onClick="javascript:wpsh_code(24)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_24" onClick="javascript:wpsh_print(24)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_24" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">chmod</span> <span class="nu0">400</span> <span class="sy0">/</span>etc<span class="sy0">/</span>postfix<span class="sy0">/</span>sender_canonical</pre></div></div>
<p><strong>Modifichiamo anche questo file per essere letto da postfix:</strong><br />
<div id="wpshdo_25" class="wp-synhighlighter-outer"><div id="wpshdt_25" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_25"></a><a id="wpshat_25" class="wp-synhighlighter-title" href="#codesyntax_25"  onClick="javascript:wpsh_toggleBlock(25)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_25" onClick="javascript:wpsh_code(25)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_25" onClick="javascript:wpsh_print(25)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_25" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">postmap <span class="sy0">/</span>etc<span class="sy0">/</span>postfix<span class="sy0">/</span>sender_canonical</pre></div></div>
<p><strong>Ora usiamo un certificato compatibile per la negoziazione con i server di google:</strong><br />
<div id="wpshdo_26" class="wp-synhighlighter-outer"><div id="wpshdt_26" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_26"></a><a id="wpshat_26" class="wp-synhighlighter-title" href="#codesyntax_26"  onClick="javascript:wpsh_toggleBlock(26)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_26" onClick="javascript:wpsh_code(26)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_26" onClick="javascript:wpsh_print(26)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_26" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">cat</span> <span class="sy0">/</span>etc<span class="sy0">/</span>ssl<span class="sy0">/</span>certs<span class="sy0">/</span>Equifax_Secure_CA.pem <span class="sy0">&gt;&gt;</span> <span class="sy0">/</span>etc<span class="sy0">/</span>postfix<span class="sy0">/</span>cacert.pem</pre></div></div>
<p><strong>Per terminare facciamo un bel restart del servizio:</strong><br />
<div id="wpshdo_27" class="wp-synhighlighter-outer"><div id="wpshdt_27" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_27"></a><a id="wpshat_27" class="wp-synhighlighter-title" href="#codesyntax_27"  onClick="javascript:wpsh_toggleBlock(27)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_27" onClick="javascript:wpsh_code(27)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_27" onClick="javascript:wpsh_print(27)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_27" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="sy0">/</span>etc<span class="sy0">/</span>init.d<span class="sy0">/</span>postfix restart</pre></div></div>
<p><strong>Facciamo una prova d&#8217;invio da console:</strong><br />
<div id="wpshdo_28" class="wp-synhighlighter-outer"><div id="wpshdt_28" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_28"></a><a id="wpshat_28" class="wp-synhighlighter-title" href="#codesyntax_28"  onClick="javascript:wpsh_toggleBlock(28)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_28" onClick="javascript:wpsh_code(28)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_28" onClick="javascript:wpsh_print(28)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_28" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw3">echo</span> <span class="st0">&quot;Questa è una prova d'invio tramite Gmail.&quot;</span> <span class="sy0">|</span> mail <span class="re5">-s</span> <span class="st0">&quot;Email di Test&quot;</span> francesco.gabriele<span class="sy0">@</span>gmail.com</pre></div></div>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/10/27/configurare-postfix-come-smtp-gmail-relay/">Configurare Postfix come smtp Gmail Relay</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/10/27/configurare-postfix-come-smtp-gmail-relay/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configurare un Server Rsync in modalità Demone</title>
		<link>http://www.linux360.it/2014/10/22/configurare-un-server-rsync-in-modalita-demone/</link>
		<comments>http://www.linux360.it/2014/10/22/configurare-un-server-rsync-in-modalita-demone/#comments</comments>
		<pubDate>Wed, 22 Oct 2014 15:15:39 +0000</pubDate>
		<dc:creator><![CDATA[Francesco Gabriele]]></dc:creator>
				<category><![CDATA[rsync]]></category>
		<category><![CDATA[backuprsync]]></category>

		<guid isPermaLink="false">http://www.ubuntuserver.it/?p=781</guid>
		<description><![CDATA[<p>Se abbiamo la necessità di eseguire dei backup corposi tra due macchine della stessa rete locale ci viene in aiuto il fantastico tool Rsync. Rsync è un potentissimo software a riga di comando per la sincronizzazione di file e cartelle in ambiente Unix, Windows e Mac OS. Esso può funzionare in due modalità 1) Come ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/10/22/configurare-un-server-rsync-in-modalita-demone/">Configurare un Server Rsync in modalità Demone</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Se abbiamo la necessità di eseguire dei backup corposi tra due macchine della stessa rete locale ci viene in aiuto il fantastico tool Rsync.</p>
<p>Rsync è un potentissimo software a riga di comando per la sincronizzazione di file e cartelle in ambiente Unix, Windows e Mac OS.</p>
<p>Esso può funzionare in due modalità<br />
1) Come Demone Rsyncd<br />
2) All&#8217;interno di un Tunnell SSH</p>
<p>Oggi andremo a vedere la prima modalità,  la modalità Demone rispetto al tunnell ssh ha un trasferimento è molto più veloce  in quanto non usando nessuna crittografia impegna meno banda ed elimina eventuali overhead dovuto proprio alla crittografia.</p>
<p>Ho effettuato alcuni test di trasferimento su rete gigabit &#8220;Rsyncd vs SSH&#8221; di seguito i risultati:<br />
<strong>rsync with ssh &#8211; 200-300 Mbps</strong><br />
<strong>rsyncd &#8211; 800 Mbps</strong></p>
<p>Veniamo a noi, procediamo con la parte Server</p>
<p><strong>Installiamo il demone lato server</strong></p>
<div id="wpshdo_29" class="wp-synhighlighter-outer"><div id="wpshdt_29" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_29"></a><a id="wpshat_29" class="wp-synhighlighter-title" href="#codesyntax_29"  onClick="javascript:wpsh_toggleBlock(29)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_29" onClick="javascript:wpsh_code(29)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_29" onClick="javascript:wpsh_print(29)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_29" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">apt-get</span> <span class="kw2">install</span> rsync</pre></div></div>
<p><strong>Abilitiamo il servizio</strong></p>
<div id="wpshdo_30" class="wp-synhighlighter-outer"><div id="wpshdt_30" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_30"></a><a id="wpshat_30" class="wp-synhighlighter-title" href="#codesyntax_30"  onClick="javascript:wpsh_toggleBlock(30)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_30" onClick="javascript:wpsh_code(30)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_30" onClick="javascript:wpsh_print(30)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_30" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">vim</span> <span class="sy0">/</span>etc<span class="sy0">/</span>default<span class="sy0">/</span>rsync
&nbsp;
<span class="re2">RSYNC_ENABLE</span>=<span class="kw2">true</span></pre></div></div>
<p><strong>Creiamo il file di configurazione in questo modo</strong></p>
<div id="wpshdo_31" class="wp-synhighlighter-outer"><div id="wpshdt_31" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_31"></a><a id="wpshat_31" class="wp-synhighlighter-title" href="#codesyntax_31"  onClick="javascript:wpsh_toggleBlock(31)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_31" onClick="javascript:wpsh_code(31)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_31" onClick="javascript:wpsh_print(31)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_31" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">vim</span> <span class="sy0">/</span>etc<span class="sy0">/</span>rsyncd.conf
&nbsp;
log <span class="kw2">file</span> = <span class="sy0">/</span>var<span class="sy0">/</span>log<span class="sy0">/</span>rsyncd
transfer logging = <span class="kw2">yes</span>
hosts allow = 192.168.7.200, 192.168.7.110
max connections = 2
hosts deny = <span class="sy0">*</span>
uid = root
gid = root
list = <span class="kw2">true</span>
use <span class="kw2">chroot</span> = <span class="kw2">false</span>
strict modes = <span class="kw2">false</span>
<span class="kw2">read</span> only = <span class="kw2">false</span>
ignore nonreadable = <span class="kw2">yes</span>
dont compress = <span class="sy0">*</span>.gz <span class="sy0">*</span>.tgz <span class="sy0">*</span>.zip <span class="sy0">*</span>.rpm <span class="sy0">*</span>.deb <span class="sy0">*</span>.iso <span class="sy0">*</span>.bz2 <span class="sy0">*</span>.jpg <span class="sy0">*</span>.mpg <span class="sy0">*</span>.mpeg
reverse lookup = no <span class="co0"># Solo dalla versione 3.1.x</span>
&nbsp;
<span class="br0">[</span>Backup<span class="br0">]</span>
path = <span class="sy0">/</span>backup
comment = Cartella Backup</pre></div></div>
<p><strong>Creiamo la cartella </strong></p>
<div id="wpshdo_32" class="wp-synhighlighter-outer"><div id="wpshdt_32" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_32"></a><a id="wpshat_32" class="wp-synhighlighter-title" href="#codesyntax_32"  onClick="javascript:wpsh_toggleBlock(32)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_32" onClick="javascript:wpsh_code(32)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_32" onClick="javascript:wpsh_print(32)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_32" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">mkdir</span> <span class="sy0">/</span>backup</pre></div></div>
<p><strong>Riavviamo il servizio</strong></p>
<div id="wpshdo_33" class="wp-synhighlighter-outer"><div id="wpshdt_33" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_33"></a><a id="wpshat_33" class="wp-synhighlighter-title" href="#codesyntax_33"  onClick="javascript:wpsh_toggleBlock(33)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_33" onClick="javascript:wpsh_code(33)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_33" onClick="javascript:wpsh_print(33)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_33" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">service rsync restart</pre></div></div>
<p><strong>Ora proviamo a sincronizzare una cartella verso il server rsync</strong></p>
<div id="wpshdo_34" class="wp-synhighlighter-outer"><div id="wpshdt_34" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_34"></a><a id="wpshat_34" class="wp-synhighlighter-title" href="#codesyntax_34"  onClick="javascript:wpsh_toggleBlock(34)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_34" onClick="javascript:wpsh_code(34)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_34" onClick="javascript:wpsh_print(34)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_34" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">ex. rsync <span class="re5">-avzP</span> folder <span class="br0">[</span>hostname<span class="sy0">/</span>IP address<span class="br0">]</span>::Backup<span class="sy0">/</span>
&nbsp;
rsync <span class="re5">-avzP</span> documenti 192.168.7.50::Backup</pre></div></div>
<p>Questo comando copiera la cartella documenti sul server rsync.<br />
Una cosa da notare, per impostazione predefinita il demone Rsync utilizza la porta<br />
<strong>TCP 873</strong> per comunicare con i client, quindi ricordiamoci di aprire questa porta<br />
se abbiamo firewall intermedi</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/10/22/configurare-un-server-rsync-in-modalita-demone/">Configurare un Server Rsync in modalità Demone</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/10/22/configurare-un-server-rsync-in-modalita-demone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mikrotik Site to Site IPsec VPN</title>
		<link>http://www.linux360.it/2014/10/20/mikrotik-site-to-site-ipsec-vpn/</link>
		<comments>http://www.linux360.it/2014/10/20/mikrotik-site-to-site-ipsec-vpn/#comments</comments>
		<pubDate>Mon, 20 Oct 2014 08:45:34 +0000</pubDate>
		<dc:creator><![CDATA[Paolo Daniele]]></dc:creator>
				<category><![CDATA[Mikrotik]]></category>
		<category><![CDATA[Wireless & Networking]]></category>
		<category><![CDATA[ipsec]]></category>
		<category><![CDATA[mikrotik]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[vpn]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.paolodaniele.it/?p=2005</guid>
		<description><![CDATA[<p>Ciao Ragazzi, dopo qualche giorno di pausa si ritorna alla carica! Oggi vi spiego come mettere su una VPN tra due siti che utilizzano come punto di accesso alla rete. Una VPN (Virtual Private Network) è una rete che permette a due punti, connessi ad internet, distanti fisicamente tra loro di apparire come se fossero ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/10/20/mikrotik-site-to-site-ipsec-vpn/">Mikrotik Site to Site IPsec VPN</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Ciao Ragazzi,</p>
<p>dopo qualche giorno di pausa si ritorna alla carica!</p>
<p>Oggi vi spiego come mettere su una VPN tra due siti che utilizzano come punto di accesso alla rete.</p>
<p><a href="http://www.paolodaniele.it/wp-content/uploads/2014/10/mikrotik_vpn.jpg"><img class="alignnone wp-image-2008" src="http://www.paolodaniele.it/wp-content/uploads/2014/10/mikrotik_vpn.jpg" alt="mikrotik_vpn" width="725" height="279" /></a></p>
<p>Una <strong>VPN</strong> (Virtual Private Network) è una rete che permette a due punti, connessi ad internet, distanti fisicamente tra loro di apparire come se fossero sulla stessa rete fisica.</p>
<p>Generalmente questo tipo di tunnel viene cifrato per evitare lo &#8220;sniffing&#8221; dei pacchetti dalla rete.</p>
<p>Esistono diversi sistemi per realizzare VPN sui dispositivi Mikrotik ognuno con vantaggi e svantaggi, ma quello più diffuso è sicuramente IPSec.</p>
<p>Nella figura sopra possiamo vedere come le due rete private abbiano indirizzi ip di classi diverse, <strong>192.168.1.0/24</strong> e <strong>192.168.2.0/24</strong> questo <strong>non è fondamentale ma è preferibile</strong> per evitare conflitti IP tra le due sedi remote.</p>
<p>Gli indirizzi 1.1.1.1 e 2.2.2.2 sono invece gli IP Pubblici con i quali le due sedi &#8220;escono&#8221; su Internet.</p>
<p>Quello che dobbiamo configurare principalmente sono 3 cose:</p>
<p>- Policy IPSec;</p>
<p>- Peers IPSec;</p>
<p>- NAT Firewall per permettere il passaggio dei pacchetti</p>
<p>Iniziamo!</p>
<p><strong> SITO 1</strong></p>
<p>IP Pubblico: 1.1.1.1</p>
<p>IP privato: 192.168.1.0/24</p>
<p>Configurazione Indirizzi IP:</p>
<div id="wpshdo_35" class="wp-synhighlighter-outer"><div id="wpshdt_35" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_35"></a><a id="wpshat_35" class="wp-synhighlighter-title" href="#codesyntax_35"  onClick="javascript:wpsh_toggleBlock(35)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_35" onClick="javascript:wpsh_code(35)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_35" onClick="javascript:wpsh_print(35)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_35" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;"><span class="sy0">/</span>ip address
add address<span class="sy0">=</span>192.168.1.1<span class="sy0">/</span><span class="nu0">24</span> interface<span class="sy0">=</span>ether1<span class="sy0">-</span>local network<span class="sy0">=</span>192.168.1.0</pre></div></div>
<p>Aggiungiamo le regole di NAT per permettere il traffico VPN da e verso le antenne:</p>
<div id="wpshdo_36" class="wp-synhighlighter-outer"><div id="wpshdt_36" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_36"></a><a id="wpshat_36" class="wp-synhighlighter-title" href="#codesyntax_36"  onClick="javascript:wpsh_toggleBlock(36)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_36" onClick="javascript:wpsh_code(36)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_36" onClick="javascript:wpsh_print(36)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_36" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;"><span class="sy0">/</span>ip firewall nat
add chain<span class="sy0">=</span>srcnat comment<span class="sy0">=</span><span class="st0">&quot;Nat Bypass VPN&quot;</span> dst<span class="sy0">-</span>address<span class="sy0">=</span>192.168.0.0<span class="sy0">/</span><span class="nu0">16</span>
add action<span class="sy0">=</span>masquerade chain<span class="sy0">=</span>srcnat out<span class="sy0">-</span>interface<span class="sy0">=</span>pppoe<span class="sy0">-</span>out1</pre></div></div>
<p>&nbsp;</p>
<p>Come avrete notato come dst-address ho usato una <strong>/16</strong> questo perchè le due subnet sono differenti, quindi così sono sicuro di inglobare entrambe.</p>
<p>Fatto questo possiamo creare il tunnell VPN con IPSec:</p>
<div id="wpshdo_37" class="wp-synhighlighter-outer"><div id="wpshdt_37" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_37"></a><a id="wpshat_37" class="wp-synhighlighter-title" href="#codesyntax_37"  onClick="javascript:wpsh_toggleBlock(37)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_37" onClick="javascript:wpsh_code(37)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_37" onClick="javascript:wpsh_print(37)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_37" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;"><span class="sy0">/</span>ip ipsec peer
add address<span class="sy0">=</span>2.2.2.2<span class="sy0">/</span><span class="nu0">32</span> dpd<span class="sy0">-</span>interval<span class="sy0">=</span>disable<span class="sy0">-</span>dpd enc<span class="sy0">-</span>algorithm<span class="sy0">=</span>3des hash<span class="sy0">-</span>algorithm<span class="sy0">=</span>md5 nat<span class="sy0">-</span>traversal<span class="sy0">=</span>no secret<span class="sy0">=!</span>mys3cr3t
&nbsp;
<span class="sy0">/</span>ip ipsec policy
add dst<span class="sy0">-</span>address<span class="sy0">=</span>192.168.0.0<span class="sy0">/</span><span class="nu0">16</span> sa<span class="sy0">-</span>dst<span class="sy0">-</span>address<span class="sy0">=</span>2.2.2.2 sa<span class="sy0">-</span>src<span class="sy0">-</span>address<span class="sy0">=</span>1.1.1.1 src<span class="sy0">-</span>address<span class="sy0">=</span>192.168.1.0<span class="sy0">/</span><span class="nu0">24</span> tunnel<span class="sy0">=</span>yes</pre></div></div>
<p>Per il Sito 1 abbiamo finito&#8230;passiamo al Sito 2</p>
<p><strong>SITO 2</strong></p>
<p>IP Pubblico: 2.2.2.2</p>
<p>IP privato: 192.168.2.0/24</p>
<p>Configurazione Indirizzi IP:</p>
<div id="wpshdo_38" class="wp-synhighlighter-outer"><div id="wpshdt_38" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_38"></a><a id="wpshat_38" class="wp-synhighlighter-title" href="#codesyntax_38"  onClick="javascript:wpsh_toggleBlock(38)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_38" onClick="javascript:wpsh_code(38)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_38" onClick="javascript:wpsh_print(38)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_38" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;"><span class="sy0">/</span>ip address
add address<span class="sy0">=</span>192.168.2.1<span class="sy0">/</span><span class="nu0">24</span> interface<span class="sy0">=</span>ether1<span class="sy0">-</span>local network<span class="sy0">=</span>192.168.2.0</pre></div></div>
<p>Aggiungiamo le regole di NAT per permettere il traffico VPN da e verso le antenne:</p>
<div id="wpshdo_39" class="wp-synhighlighter-outer"><div id="wpshdt_39" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_39"></a><a id="wpshat_39" class="wp-synhighlighter-title" href="#codesyntax_39"  onClick="javascript:wpsh_toggleBlock(39)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_39" onClick="javascript:wpsh_code(39)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_39" onClick="javascript:wpsh_print(39)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_39" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;"><span class="sy0">/</span>ip firewall nat
add chain<span class="sy0">=</span>srcnat comment<span class="sy0">=</span><span class="st0">&quot;Nat Bypass VPN&quot;</span> dst<span class="sy0">-</span>address<span class="sy0">=</span>192.168.0.0<span class="sy0">/</span><span class="nu0">16</span>
add action<span class="sy0">=</span>masquerade chain<span class="sy0">=</span>srcnat out<span class="sy0">-</span>interface<span class="sy0">=</span>pppoe<span class="sy0">-</span>out1</pre></div></div>
<p>Anche per il Sito 2 come dst-address ho usato una <strong>/16</strong> questo perchè le due subnet sono differenti, quindi così sono sicuro di inglobare entrambe.</p>
<p>Fatto questo possiamo creare il tunnell VPN con IPSec:</p>
<div id="wpshdo_40" class="wp-synhighlighter-outer"><div id="wpshdt_40" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_40"></a><a id="wpshat_40" class="wp-synhighlighter-title" href="#codesyntax_40"  onClick="javascript:wpsh_toggleBlock(40)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_40" onClick="javascript:wpsh_code(40)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_40" onClick="javascript:wpsh_print(40)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_40" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;"><span class="sy0">/</span>ip ipsec peer
add address<span class="sy0">=</span>1.1.1.1<span class="sy0">/</span><span class="nu0">32</span> dpd<span class="sy0">-</span>interval<span class="sy0">=</span>disable<span class="sy0">-</span>dpd enc<span class="sy0">-</span>algorithm<span class="sy0">=</span>3des hash<span class="sy0">-</span>algorithm<span class="sy0">=</span>md5 nat<span class="sy0">-</span>traversal<span class="sy0">=</span>no secret<span class="sy0">=!</span>mys3cr3t
&nbsp;
<span class="sy0">/</span>ip ipsec policy
add dst<span class="sy0">-</span>address<span class="sy0">=</span>192.168.0.0<span class="sy0">/</span><span class="nu0">16</span> sa<span class="sy0">-</span>dst<span class="sy0">-</span>address<span class="sy0">=</span>1.1.1.1 sa<span class="sy0">-</span>src<span class="sy0">-</span>address<span class="sy0">=</span>2.2.2.2 src<span class="sy0">-</span>address<span class="sy0">=</span>192.168.2.0<span class="sy0">/</span><span class="nu0">24</span> tunnel<span class="sy0">=</span>yes</pre></div></div>
<p>Il gioco è fatto!</p>
<p>Enjoy!</p>
<p>&nbsp;</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/10/20/mikrotik-site-to-site-ipsec-vpn/">Mikrotik Site to Site IPsec VPN</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/10/20/mikrotik-site-to-site-ipsec-vpn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reboot Forzato su Linux</title>
		<link>http://www.linux360.it/2014/10/08/reboot-forzato-su-linux/</link>
		<comments>http://www.linux360.it/2014/10/08/reboot-forzato-su-linux/#comments</comments>
		<pubDate>Wed, 08 Oct 2014 13:17:20 +0000</pubDate>
		<dc:creator><![CDATA[Francesco Gabriele]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[emergenza]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[reboot]]></category>

		<guid isPermaLink="false">http://www.ubuntuserver.it/?p=772</guid>
		<description><![CDATA[<p>Se anche voi come me avete un server linux che è parzialmente bloccato e che non riuscite a riavviare in nessun modo (reboot,init 6 ecc..) E vi sentite male solo al pensiero di farvi 37KM per riavviarlo fisicamente.. potete eseguire questi magici comandi. Riavvio immediato: Se invece per qualche motivo vogliamo spegnerla completamente basta fare: ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/10/08/reboot-forzato-su-linux/">Reboot Forzato su Linux</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Se anche voi come me avete un server linux che è parzialmente bloccato<br />
e che non riuscite a riavviare in nessun modo (reboot,init 6 ecc..)<br />
E vi sentite male solo al pensiero di farvi 37KM per riavviarlo fisicamente.. <img src="http://www.linux360.it/wp-includes/images/smilies/icon_biggrin.gif" alt=":-D" class="wp-smiley" /><br />
potete eseguire questi magici comandi.</p>
<p><strong>Riavvio immediato</strong>:</p>
<div id="wpshdo_41" class="wp-synhighlighter-outer"><div id="wpshdt_41" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_41"></a><a id="wpshat_41" class="wp-synhighlighter-title" href="#codesyntax_41"  onClick="javascript:wpsh_toggleBlock(41)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_41" onClick="javascript:wpsh_code(41)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_41" onClick="javascript:wpsh_print(41)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_41" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw3">echo</span> 1 <span class="sy0">&gt;</span> <span class="sy0">/</span>proc<span class="sy0">/</span>sys<span class="sy0">/</span>kernel<span class="sy0">/</span>sysrq 
<span class="kw3">echo</span> b <span class="sy0">&gt;</span> <span class="sy0">/</span>proc<span class="sy0">/</span>sysrq-trigger</pre></div></div>
<p><strong>Se invece per qualche motivo vogliamo spegnerla completamente basta fare:</strong></p>
<div id="wpshdo_42" class="wp-synhighlighter-outer"><div id="wpshdt_42" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_42"></a><a id="wpshat_42" class="wp-synhighlighter-title" href="#codesyntax_42"  onClick="javascript:wpsh_toggleBlock(42)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_42" onClick="javascript:wpsh_code(42)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_42" onClick="javascript:wpsh_print(42)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_42" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw3">echo</span> 1 <span class="sy0">&gt;</span> <span class="sy0">/</span>proc<span class="sy0">/</span>sys<span class="sy0">/</span>kernel<span class="sy0">/</span>sysrq 
<span class="kw3">echo</span> o <span class="sy0">&gt;</span> <span class="sy0">/</span>proc<span class="sy0">/</span>sysrq-trigger</pre></div></div>
<p>Spero di aver rallegrato la giornata a molti con questa soluzione <img src="http://www.linux360.it/wp-includes/images/smilies/icon_biggrin.gif" alt=":-D" class="wp-smiley" /> </p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/10/08/reboot-forzato-su-linux/">Reboot Forzato su Linux</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/10/08/reboot-forzato-su-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Informatica Forense: Disattivare il blocco schermo Android</title>
		<link>http://www.linux360.it/2014/10/03/informatica-forense-disattivare-blocco-schermo-android/</link>
		<comments>http://www.linux360.it/2014/10/03/informatica-forense-disattivare-blocco-schermo-android/#comments</comments>
		<pubDate>Fri, 03 Oct 2014 16:31:02 +0000</pubDate>
		<dc:creator><![CDATA[Paolo Daniele]]></dc:creator>
				<category><![CDATA[Hacking & Sicurezza]]></category>
		<category><![CDATA[adb]]></category>
		<category><![CDATA[andorid]]></category>
		<category><![CDATA[forense]]></category>
		<category><![CDATA[informatica]]></category>
		<category><![CDATA[lockscreen]]></category>
		<category><![CDATA[pattern]]></category>

		<guid isPermaLink="false">http://www.paolodaniele.it/?p=1996</guid>
		<description><![CDATA[<p>Ciao Ragazzi, oggi parliamo di Informatica Forense. Se non lo sapete, la prima regola per l&#8217;informatica forense è quella di &#8220;non alterare i dati originali&#8221; Questa cosa è fondamentale perchè altrimenti si rischia di compromettere le eventuali prove rinvenute sui dispositivi elettronici (pc, tablet, smartphone etc.) Oggi vi insegno come disattivare il blocco schermo di ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/10/03/informatica-forense-disattivare-blocco-schermo-android/">Informatica Forense: Disattivare il blocco schermo Android</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Ciao Ragazzi,</p>
<p>oggi parliamo di Informatica Forense.</p>
<p>Se non lo sapete, la prima regola per l&#8217;informatica forense è quella di <strong>&#8220;non alterare i dati originali&#8221; </strong></p>
<p>Questa cosa è fondamentale perchè altrimenti si rischia di compromettere le eventuali prove rinvenute sui dispositivi elettronici (pc, tablet, smartphone etc.)</p>
<p>Oggi vi insegno come disattivare il blocco schermo di Android, non quello numerico, ma la combinazione visiva precedentemente memorizzata.</p>
<p>Questo ovviamente può servire anche a chi ha scordato erroneamente la combinazione!</p>
<p>Elemento fondamentale per questa operazione è <strong>ADB </strong> anche conosciuto come <strong>Android Debug Bridge</strong> ed è l&#8217;elemento che ci permette di entrare in modalità debug del telefono via pc.</p>
<p>Seconda cosa fondamentale è che sul telefono sia abilitata la modalità <strong>USB Debugging</strong>.</p>
<p>Per installare ADB esistono diverse guide, quella classica si trova sul sito ufficiale di android a questo <a href="http://developer.android.com/tools/help/adb.html">link</a></p>
<p>Cominciamo!</p>
<p>Esistono 2 Metodi per farlo:</p>
<p><strong>METODO 1</strong></p>
<p>Per prima cosa aprite il terminale (o il prompt di windows) e digitate i seguenti comandi:</p>
<div id="wpshdo_43" class="wp-synhighlighter-outer"><div id="wpshdt_43" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_43"></a><a id="wpshat_43" class="wp-synhighlighter-title" href="#codesyntax_43"  onClick="javascript:wpsh_toggleBlock(43)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_43" onClick="javascript:wpsh_code(43)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_43" onClick="javascript:wpsh_print(43)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_43" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">adb shell
<span class="kw3">cd</span> <span class="sy0">/</span>data<span class="sy0">/</span>data<span class="sy0">/</span>com.android.providers.settings<span class="sy0">/</span>databases
sqlite3 settings.db
update system <span class="kw1">set</span> <span class="re2">value</span>=0 where <span class="re2">name</span>=<span class="st_h">'lock_pattern_autolock'</span>;
update system <span class="kw1">set</span> <span class="re2">value</span>=0 where <span class="re2">name</span>=<span class="st_h">'lockscreen.lockedoutpermanently'</span>;
.quit</pre></div></div>
<p>Riavviate il dispositivo.</p>
<p>&nbsp;</p>
<p><strong>METODO 2</strong></p>
<p>Aprite un terminale (o il prompt di windows) e digitate:</p>
<div id="wpshdo_44" class="wp-synhighlighter-outer"><div id="wpshdt_44" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_44"></a><a id="wpshat_44" class="wp-synhighlighter-title" href="#codesyntax_44"  onClick="javascript:wpsh_toggleBlock(44)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_44" onClick="javascript:wpsh_code(44)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_44" onClick="javascript:wpsh_print(44)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_44" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">adb shell <span class="kw2">rm</span> <span class="sy0">/</span>data<span class="sy0">/</span>system<span class="sy0">/</span>gesture.key</pre></div></div>
<p>Edit.</p>
<p>In molti mi hanno chiesto la possibilità di attivare la modalità Usb Debug in caso di telefono con lo schermo danneggiato. Non c&#8217;é una soluzione precisa, ma un buon metodo é quello di utilizzare <strong>Android Screencast </strong>un&#8217;applicazione che permette di controllare il dispositivo android anche con lo schermo danneggiato collegandolo al pc!</p>
<p>Il software é disponibile a questo <a href="http://code.google.com/p/androidscreencast/">link</a></p>
<p><a href="http://www.paolodaniele.it/wp-content/uploads/2014/10/screenshot.jpg"><img class="alignnone wp-image-2000 size-medium" src="http://www.paolodaniele.it/wp-content/uploads/2014/10/screenshot-224x300.jpg" alt="screenshot" width="224" height="300" /></a></p>
<p>&nbsp;</p>
<p>Enjoy!</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/10/03/informatica-forense-disattivare-blocco-schermo-android/">Informatica Forense: Disattivare il blocco schermo Android</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/10/03/informatica-forense-disattivare-blocco-schermo-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix: Autenticazione SASL</title>
		<link>http://www.linux360.it/2014/10/02/postfix-sasl-auth/</link>
		<comments>http://www.linux360.it/2014/10/02/postfix-sasl-auth/#comments</comments>
		<pubDate>Thu, 02 Oct 2014 16:14:48 +0000</pubDate>
		<dc:creator><![CDATA[Paolo Daniele]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[sasl]]></category>
		<category><![CDATA[smtp]]></category>

		<guid isPermaLink="false">http://www.paolodaniele.it/?p=1990</guid>
		<description><![CDATA[<p>Ciao Ragazzi, oggi andiamo sul tecnico. Questo articolo server a chi utilizza Postfix come SMTP Server e nel caso specifico ad implementare l&#8217;autenticazione mediante il sistema Simple Authentication and Security Layer (SASL) Questo sistema prevede la possibilità di integrare diverse modalità di autenticazione: - EXTERNAL, in cui l&#8217;autenticazione è implicita nel contesto (per esempio, nei ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/10/02/postfix-sasl-auth/">Postfix: Autenticazione SASL</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Ciao Ragazzi,</p>
<p>oggi andiamo sul tecnico.</p>
<p>Questo articolo server a chi utilizza Postfix come SMTP Server e nel caso specifico ad implementare l&#8217;autenticazione mediante il sistema <b>Simple Authentication and Security Layer</b> (SASL)</p>
<p>Questo sistema prevede la possibilità di integrare diverse modalità di autenticazione:</p>
<p>- EXTERNAL, in cui l&#8217;autenticazione è implicita nel contesto (per esempio, nei protocolli che già utilizzano IPsec o TLS)<br />
- ANONYMOUS, per accessi guest non autenticati<br />
- PLAIN, per gli accessi in testo chiaro<br />
- OTP, un meccanismo one-time password. (OTP è stato reso obsoleto da SKEY)<br />
- SKEY, meccanismo S/KEY.<br />
- CRAM-MD5, un semplice schema challenge-response basato su HMAC-MD5.<br />
- DIGEST-MD5 (storico), meccanismo challenge-response compatibile parzialmente con HTTP Digest basato su MD5.<br />
- SCRAM (RFC 5802), schema moderno challenge-response con supporto al binding del canale<br />
- NTLM, schema di autenticazione NT LAN Manage<br />
- GSSAPI, per Kerberos V5 authentication attraverso il GSSAPI.<br />
- BROWSERID-AES128, per Mozilla Persona authentication<br />
- EAP-AES128, per GSS EAP authentication<br />
- GateKeeper (&amp; GateKeeperPassport), meccanismo challenge-response sviluppato da Microsoft per MSN Chat</p>
<p>Quello che vediamo oggi per Postfix è il più semplice ovvero il <strong>PLAIN</strong> con login tramite username e password memorizzati in un Database MySQL.</p>
<p>In questo articolo do per scontato che Postfix sia installato e funzionante.</p>
<p>Installiamo il demone di SASL:</p>
<div id="wpshdo_45" class="wp-synhighlighter-outer"><div id="wpshdt_45" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_45"></a><a id="wpshat_45" class="wp-synhighlighter-title" href="#codesyntax_45"  onClick="javascript:wpsh_toggleBlock(45)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_45" onClick="javascript:wpsh_code(45)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_45" onClick="javascript:wpsh_print(45)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_45" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">apt-get</span> <span class="kw2">install</span> libsasl2-<span class="nu0">2</span> libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql</pre></div></div>
<p>&nbsp;</p>
<p>Fatto questo modifichiamo il file <strong>/etc/default/saslauthd </strong>sostituendo START=no con START=yes così il demone partirà all&#8217;avvio del pc.</p>
<p>Inoltre modificate la stringa OPTIONS=&#8230;. così OPTIONS=&#8221;-c -r -m /var/spool/postfix/var/run/saslauthd&#8221; questo è necessario perchè Postfix è eseguito come chroot e ha bisogno di accedere al socket di saslauthd</p>
<p>Inoltre dobbiamo creare la directory:</p>
<div id="wpshdo_46" class="wp-synhighlighter-outer"><div id="wpshdt_46" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_46"></a><a id="wpshat_46" class="wp-synhighlighter-title" href="#codesyntax_46"  onClick="javascript:wpsh_toggleBlock(46)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_46" onClick="javascript:wpsh_code(46)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_46" onClick="javascript:wpsh_print(46)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_46" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">mkdir</span> <span class="re5">-p</span> <span class="sy0">/</span>var<span class="sy0">/</span>spool<span class="sy0">/</span>postfix<span class="sy0">/</span>var<span class="sy0">/</span>run<span class="sy0">/</span>saslauthd</pre></div></div>
<p>Sempre per l&#8217;ambiente chroot è necessario creare il link simbolico:</p>
<div id="wpshdo_47" class="wp-synhighlighter-outer"><div id="wpshdt_47" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_47"></a><a id="wpshat_47" class="wp-synhighlighter-title" href="#codesyntax_47"  onClick="javascript:wpsh_toggleBlock(47)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_47" onClick="javascript:wpsh_code(47)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_47" onClick="javascript:wpsh_print(47)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_47" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">rm</span> <span class="re5">-rf</span> <span class="sy0">/</span>var<span class="sy0">/</span>run<span class="sy0">/</span>saslauthd
<span class="kw2">ln</span> <span class="re5">-s</span> <span class="sy0">/</span>var<span class="sy0">/</span>spool<span class="sy0">/</span>postfix<span class="sy0">/</span>var<span class="sy0">/</span>run<span class="sy0">/</span>saslauthd <span class="sy0">/</span>var<span class="sy0">/</span>run<span class="sy0">/</span>saslauthd</pre></div></div>
<p><span style="color: #ff0000;">ATTENZIONE</span>: se non cancellate il file /var/run/saslauthd testando il sistema avrete l&#8217;errore <em>&#8220;connect() : No such file or directory 0&#8243;</em></p>
<p>Creiamo un nuovo file:</p>
<div id="wpshdo_48" class="wp-synhighlighter-outer"><div id="wpshdt_48" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_48"></a><a id="wpshat_48" class="wp-synhighlighter-title" href="#codesyntax_48"  onClick="javascript:wpsh_toggleBlock(48)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_48" onClick="javascript:wpsh_code(48)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_48" onClick="javascript:wpsh_print(48)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_48" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">vi</span> <span class="sy0">/</span>etc<span class="sy0">/</span>pam.d<span class="sy0">/</span>smtp</pre></div></div>
<p>Modifichiamo il file come segue:</p>
<div id="wpshdo_49" class="wp-synhighlighter-outer"><div id="wpshdt_49" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_49"></a><a id="wpshat_49" class="wp-synhighlighter-title" href="#codesyntax_49"  onClick="javascript:wpsh_toggleBlock(49)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_49" onClick="javascript:wpsh_code(49)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_49" onClick="javascript:wpsh_print(49)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_49" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">auth    required   pam_mysql.so <span class="re2">user</span>=mailadmin <span class="kw2">passwd</span>=newpassword <span class="re2">host</span>=127.0.0.1 <span class="re2">db</span>=mail <span class="re2">table</span>=mailbox <span class="re2">usercolumn</span>=username <span class="re2">passwdcolumn</span>=password <span class="re2">crypt</span>=1
account sufficient pam_mysql.so <span class="re2">user</span>=mailadmin <span class="kw2">passwd</span>=newpassword <span class="re2">host</span>=127.0.0.1 <span class="re2">db</span>=mail <span class="re2">table</span>=mailbox <span class="re2">usercolumn</span>=username <span class="re2">passwdcolumn</span>=password <span class="re2">crypt</span>=<span class="nu0">1</span></pre></div></div>
<p>Abbiamo necessità di un secondo file:</p>
<div id="wpshdo_50" class="wp-synhighlighter-outer"><div id="wpshdt_50" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_50"></a><a id="wpshat_50" class="wp-synhighlighter-title" href="#codesyntax_50"  onClick="javascript:wpsh_toggleBlock(50)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_50" onClick="javascript:wpsh_code(50)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_50" onClick="javascript:wpsh_print(50)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_50" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">vi</span> <span class="sy0">/</span>etc<span class="sy0">/</span>postfix<span class="sy0">/</span>sasl<span class="sy0">/</span>smtpd.conf</pre></div></div>
<p>Che editiamo come segue:</p>
<div id="wpshdo_51" class="wp-synhighlighter-outer"><div id="wpshdt_51" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_51"></a><a id="wpshat_51" class="wp-synhighlighter-title" href="#codesyntax_51"  onClick="javascript:wpsh_toggleBlock(51)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_51" onClick="javascript:wpsh_code(51)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_51" onClick="javascript:wpsh_print(51)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_51" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">pwcheck_method: saslauthd
mech_list: plain <span class="kw2">login</span>
allow_plaintext: <span class="kw2">true</span></pre></div></div>
<p>Nel caso di autenticazione basata su DB MySQL il file va editato come segue (attenzione a mettere i nomi giusti del db e delle tabelle!):</p>
<div id="wpshdo_52" class="wp-synhighlighter-outer"><div id="wpshdt_52" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_52"></a><a id="wpshat_52" class="wp-synhighlighter-title" href="#codesyntax_52"  onClick="javascript:wpsh_toggleBlock(52)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_52" onClick="javascript:wpsh_code(52)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_52" onClick="javascript:wpsh_print(52)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_52" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">pwcheck_method: saslauthd
mech_list: plain <span class="kw2">login</span>
allow_plaintext: <span class="kw2">true</span>
auxprop_plugin: sql
sql_engine: mysql
sql_hostnames: 127.0.0.1
sql_user: dbuser
sql_passwd: dbpassword
sql_database: dbname
sql_select: SELECT password FROM user WHERE username = <span class="st_h">'%u@%r'</span></pre></div></div>
<p>Aggiungiamo l&#8217;utente postfix al gruppo sasl:</p>
<div id="wpshdo_53" class="wp-synhighlighter-outer"><div id="wpshdt_53" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_53"></a><a id="wpshat_53" class="wp-synhighlighter-title" href="#codesyntax_53"  onClick="javascript:wpsh_toggleBlock(53)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_53" onClick="javascript:wpsh_code(53)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_53" onClick="javascript:wpsh_print(53)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_53" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">adduser postfix sasl</pre></div></div>
<p>Poi provvediamo ad inserire le voci per l&#8217;autenticazione SASL dentro il main.cf di Postfix:</p>
<div id="wpshdo_54" class="wp-synhighlighter-outer"><div id="wpshdt_54" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_54"></a><a id="wpshat_54" class="wp-synhighlighter-title" href="#codesyntax_54"  onClick="javascript:wpsh_toggleBlock(54)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_54" onClick="javascript:wpsh_code(54)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_54" onClick="javascript:wpsh_print(54)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_54" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">smtpd_sender_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination</pre></div></div>
<p>Riavviamo i servizi:</p>
<div id="wpshdo_55" class="wp-synhighlighter-outer"><div id="wpshdt_55" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_55"></a><a id="wpshat_55" class="wp-synhighlighter-title" href="#codesyntax_55"  onClick="javascript:wpsh_toggleBlock(55)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_55" onClick="javascript:wpsh_code(55)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_55" onClick="javascript:wpsh_print(55)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_55" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="sy0">/</span>etc<span class="sy0">/</span>init.d<span class="sy0">/</span>postfix restart
<span class="sy0">/</span>etc<span class="sy0">/</span>init.d<span class="sy0">/</span>saslauthd restart</pre></div></div>
<p>E proviamo che tutto funziona correttamente:</p>
<div id="wpshdo_56" class="wp-synhighlighter-outer"><div id="wpshdt_56" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_56"></a><a id="wpshat_56" class="wp-synhighlighter-title" href="#codesyntax_56"  onClick="javascript:wpsh_toggleBlock(56)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_56" onClick="javascript:wpsh_code(56)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_56" onClick="javascript:wpsh_print(56)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_56" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">razorblade:~<span class="co0"># testsaslauthd -s smtp -u root@example.com -p newpassword</span>
<span class="nu0">0</span>: OK <span class="st0">&quot;Success.&quot;</span></pre></div></div>
<p>Enjoy!</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/10/02/postfix-sasl-auth/">Postfix: Autenticazione SASL</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/10/02/postfix-sasl-auth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrade e Downgrade Mikrotik da Linea di Comando</title>
		<link>http://www.linux360.it/2014/10/01/upgrade-e-downgrade-mikrotik-da-linea-di-comando/</link>
		<comments>http://www.linux360.it/2014/10/01/upgrade-e-downgrade-mikrotik-da-linea-di-comando/#comments</comments>
		<pubDate>Wed, 01 Oct 2014 14:00:11 +0000</pubDate>
		<dc:creator><![CDATA[Francesco Gabriele]]></dc:creator>
				<category><![CDATA[Mikrotik]]></category>
		<category><![CDATA[MikrotikDowngrade]]></category>
		<category><![CDATA[MikrotikUpgrade]]></category>

		<guid isPermaLink="false">http://www.ubuntuserver.it/?p=769</guid>
		<description><![CDATA[<p>Può capitare che dobbiamo effettuare l&#8217;upgrade o il downgrade di una routerboard da linea di comando, magari collegati ad ex. in ssh. Qui ci viene incontro il comando fetch, di seguito alcuni esempi: 1) Upgrade all&#8217;ultima versione, che alla stesura di questo post è la 6.20. Ovviamente scarichiamo la versione in base all&#8217;architettura della nostra ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/10/01/upgrade-e-downgrade-mikrotik-da-linea-di-comando/">Upgrade e Downgrade Mikrotik da Linea di Comando</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Può capitare che dobbiamo effettuare l&#8217;upgrade o il downgrade di una routerboard da linea di comando, magari collegati ad ex. in ssh.<br />
Qui ci viene incontro il comando fetch, di seguito alcuni esempi:</p>
<p><strong>1) Upgrade all&#8217;ultima versione, che alla stesura di questo post è la 6.20.</strong><br />
Ovviamente scarichiamo la versione in base all&#8217;architettura della nostra routerboard che in questo esempio è la &#8220;mipsbe&#8221; (mipsbe CRS series, RB4xx series, RB7xx series, RB9xx series, RB2011 series, SXT, OmniTik, Groove, METAL, SEXTANT)</p>
<p>Di seguito le altre serie</p>
<p>&#8220;powerpc&#8221; (RB3xx series, RB600 series, RB800 series, RB1xxx series)</p>
<p>&#8220;mipsle&#8221; (RB1xx series, RB5xx series, RB Crossroads)</p>
<p>&#8220;tile&#8221; (CCR series)</p>
<p>&#8220;x86&#8243; (PC / X86, RB230 series)</p>
<div id="wpshdo_57" class="wp-synhighlighter-outer"><div id="wpshdt_57" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_57"></a><a id="wpshat_57" class="wp-synhighlighter-title" href="#codesyntax_57"  onClick="javascript:wpsh_toggleBlock(57)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_57" onClick="javascript:wpsh_code(57)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_57" onClick="javascript:wpsh_print(57)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_57" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="sy0">/</span>tool fetch <span class="re2">url</span>=<span class="st0">&quot;http://download2.mikrotik.com/routeros/6.20/routeros-mipsbe-6.20.npk&quot;</span> <span class="re2">mode</span>=http</pre></div></div>
<p>&nbsp;</p>
<p>Appena vediamo uscire la scritta <strong> “status: finished”</strong> possiamo fare un bel reboot e dopo troveremo la nostra routerboard alla 6.20.</p>
<p><strong>2) Downgrade all&#8217;ultima versione rilasciata della serie 5 che nel dettaglio è la 5.26</strong></p>
<p><strong><div id="wpshdo_58" class="wp-synhighlighter-outer"><div id="wpshdt_58" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_58"></a><a id="wpshat_58" class="wp-synhighlighter-title" href="#codesyntax_58"  onClick="javascript:wpsh_toggleBlock(58)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_58" onClick="javascript:wpsh_code(58)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_58" onClick="javascript:wpsh_print(58)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_58" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="sy0">/</span>tool fetch <span class="re2">url</span>=<span class="st0">&quot;http://download2.mikrotik.com/routeros/5.26/routeros-mipsbe-5.26.npk&quot;</span> <span class="re2">mode</span>=http</pre></div></div></strong></p>
<p>Qui invece di effettuare il reboot dobbiamo dirgli di fare il downgrade e lo facciamo in questo modo:</p>
<p><strong>system package downgrade;</strong></p>
<p>Questo comando esegue in automatico un reboot ed effettua il downgrade dei pacchetti al primo avvio.</p>
<p>Spero sia utile a molti</p>
<p>&#8212;-<br />
Frank<strong>                  </strong></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/10/01/upgrade-e-downgrade-mikrotik-da-linea-di-comando/">Upgrade e Downgrade Mikrotik da Linea di Comando</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/10/01/upgrade-e-downgrade-mikrotik-da-linea-di-comando/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
