<?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>MDLog:/sysadmin &#187; Security</title> <atom:link href="http://www.ducea.com/category/security/feed/" rel="self" type="application/rss+xml" /><link>http://www.ducea.com</link> <description>The Journal Of A Linux Sysadmin</description> <lastBuildDate>Tue, 07 Feb 2012 19:40:06 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3</generator> <item><title>iptables geoip match on debian lenny</title><link>http://www.ducea.com/2009/03/18/iptables-geoip-match-on-debian-lenny/</link> <comments>http://www.ducea.com/2009/03/18/iptables-geoip-match-on-debian-lenny/#comments</comments> <pubDate>Wed, 18 Mar 2009 13:56:31 +0000</pubDate> <dc:creator>- Marius -</dc:creator> <category><![CDATA[Debian]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Tips & Tricks]]></category> <category><![CDATA[Tools]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[geoip]]></category> <category><![CDATA[iptables]]></category> <category><![CDATA[kernel_modules]]></category> <category><![CDATA[lenny]]></category><guid
isPermaLink="false">http://www.ducea.com/?p=818</guid> <description><![CDATA[The geoip iptables extension allows you to filter, nat or mangle packets based on the country&#8217;s source or destination. This does exactly what the geoip apache module does, or the regular geoip binary, but at the iptables level. I would not go into the details why you would want to use that, but there are [...]<p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p> ]]></description> <content:encoded><![CDATA[<p>The <strong>geoip iptables extension</strong> allows you to filter, nat or mangle packets based on the country&#8217;s source or destination. This does exactly what the geoip apache module does, or the regular geoip binary, but at the iptables level. I would not go into the details <strong>why </strong>you would want to use that, but there are many &#8216;positive&#8217; ways it can be useful&#8230; For example myself I use it in a project where we want to<em> serve customized content for different countries</em>. Since this is a high traffic site running on many web servers behind a loadbalanced setup, we prefer to split this at the <em>loadbalancer level</em> and not at apache level, to simplify our setup. We serve customized content to the US based visitors, while for the other countries we serve another international site.</p><p>Now this has been working fine for a long time now, using the <a
href="http://people.netfilter.org/peejix/geoip/" target="_blank">original geoip module</a> and <strong>patch-o-matic-ng</strong> method of installation (similar to what is very well <a
href="http://www.debian-administration.org/articles/518" target="_blank">described here</a>). Still, this is unmaintained, and starting with <strong>kernel 2.6.22</strong> it is no longer working. There is a <a
href="http://bjerkeset.com/patches/geoip-match-2.6.22.patch.gz" target="_blank">patch</a> that will make it work with a newer kernel, but if you run <strong>iptables 1.4.x</strong> this will again fail and even if there are some manual walkarounds this is still not the best solution.</p><p>The solution is called <strong>Xtables-addons</strong>. <a
href="http://xtables-addons.sourceforge.net/" target="_blank">Xtables-addons</a> is the successor to patch-o-matic-ng. Likewise, <em>it contains extensions that were not, or are not yet, accepted in the main kernel/iptables packages. Xtables-addons is different from patch-o-matic in that you do not have to patch or recompile the kernel, sometimes recompiling iptables is also not needed.</em><br
/> The latest version <strong>1.12</strong> <a
href="http://xtables-addons.git.sourceforge.net/git/gitweb.cgi?p=xtables-addons;a=blob;hb=master;f=INSTALL" target="_blank">supports</a>: iptables &gt;= 1.4.1 and kernel-source &gt;= 2.6.17.</p><p><span
id="more-818"></span>The installation is very simple and requires only the following steps exemplified on a <strong>debian lenny</strong> machine (kernel 2.6.26 and iptables 1.4.2):</p><p><strong>1.</strong> Install the needed <strong>dependencies</strong>: kernel headers and iptables dev:<br
/> <code>aptitude install linux-headers-2.6.26-1-amd64 iptables-dev</code><br
/> <em>libtext-csv-xs-perl</em> will be also needed if you plan to update the database (normally you will want this to be able to update the db from time to time):<br
/> <code>aptitude install libtext-csv-xs-perl</code></p><p><strong>2.</strong> <strong>Download </strong>the xtables-addons package and the supplied <a
href="http://jengelh.medozas.de/files/geoip/" target="_blank">database</a> (or the <a
href="http://jengelh.medozas.de/files/geoip/geoip_src.tar.bz2" target="_blank">sources</a> to build your own):<br
/> <code>wget http://switch.dl.sourceforge.net/sourceforge/xtables-addons/xtables-addons-1.12.tar.bz2<br
/> wget http://jengelh.medozas.de/files/geoip/geoip_iv0_database-20090201.tar.bz2<br
/> </code><br
/> <strong>3.</strong> Configure and <strong>compile </strong>the package. There are several iptables modules included; you can leave them all enabled or choose to compile and install only the ones needed. For this edit the <strong>mconfig </strong>file and leave only the ones you want:<br
/> <code>build_CHAOS=m<br
/> build_DELUDE=m<br
/> build_DHCPADDR=m<br
/> build_ECHO=<br
/> build_IPMARK=m<br
/> build_LOGMARK=m<br
/> build_SYSRQ=m<br
/> build_TARPIT=m<br
/> build_TEE=m<br
/> build_condition=m<br
/> build_fuzzy=m<br
/> <strong>build_geoip=m</strong><br
/> build_ipp2p=m<br
/> build_ipset=m<br
/> build_length2=m<br
/> build_lscan=m<br
/> build_quota2=m</code></p><p>Compile and install:<br
/> <code>./configure --with-xtlibdir=/lib/xtables<br
/> make<br
/> make install</code></p><p>this will add the iptables extension <strong>/lib/xtables/libxt_geoip.so</strong> and the kernel module in /lib/modules/&lt;kernel&gt;<strong>/extra/xt_geoip.ko</strong></p><p><strong>4.</strong> Now we have to put the <strong>geoip database files</strong> under the expected location (<strong>/var/geoip</strong>); this is hardcoded in the code, but you can change it if really needed and recompile. I would like to add that even if this uses the same geoip source (the <a
href="http://www.maxmind.com/app/geolitecountry" target="_blank">free GeoLite Country database</a>) as the original geoip iptables module, but the format has changed. You can either get the database from the source, or build your own with the supplied script. Once you have that copy the files to /var/geoip</p><p><code>wget http://www.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip<br
/> unzip GeoIPCountryCSV.zip<br
/> ./runme.sh<br
/> cp -R var/geoip/ /var/</code></p><p>That&#8217;s it! All you have to do is use the module based on your needs. The syntax is the same as the original geoip iptables module:<br
/> <em> [!] &#8211;src-cc, &#8211;source-country country[,country...] = Match packet coming from (one of) the specified country(ies)<br
/> [!] &#8211;dst-cc, &#8211;destination-country country[,country...] = Match packet going to (one of) the specified country(ies)<br
/> NOTE:  The country is inputed by its ISO3166 code.</em></p><p>We use something like this to mark and send each type of traffic to its own destination:<br
/> <code>iptables -t mangle -A PREROUTING -p tcp -m geoip --src-cc US -d &lt;IP&gt; --dport 80 -j MARK --set-mark 1<br
/> iptables -t mangle -A PREROUTING -p tcp -m geoip ! --src-cc US -d &lt;IP&gt; --dport 80 -j MARK --set-mark 2</code></p><p>I hope you found this article useful, and as me, are grateful that <strong>Xtables-addons</strong> project took over the patch-o-matic-ng broken modules and made them available on current distributions. Xtables-addons was also accepted in debian repository (in <a
href="http://packages.debian.org/squeeze/xtables-addons-source" target="_blank">testing</a>) and this will make it even simpler to install and use in the future.</p><p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p>]]></content:encoded> <wfw:commentRss>http://www.ducea.com/2009/03/18/iptables-geoip-match-on-debian-lenny/feed/</wfw:commentRss> <slash:comments>12</slash:comments> </item> <item><title>HowTo ignore some files/folders from awstats reports</title><link>http://www.ducea.com/2009/02/09/howto-ignore-some-filesfolders-from-awstats-reports/</link> <comments>http://www.ducea.com/2009/02/09/howto-ignore-some-filesfolders-from-awstats-reports/#comments</comments> <pubDate>Mon, 09 Feb 2009 12:14:42 +0000</pubDate> <dc:creator>- Marius -</dc:creator> <category><![CDATA[Centos]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[Fedora]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[News from Outside]]></category> <category><![CDATA[RHEL]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Tools]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[awstats]]></category><guid
isPermaLink="false">http://www.ducea.com/?p=565</guid> <description><![CDATA[Awstats will consider as a page hit any entry from the log it processes. By default some file extensions (for regular image types and css/js) are excluded from what awstats will consider as a page: NotPageList="css js class gif jpg jpeg png bmp ico"(this is the default). All other file types will be counted as [...]<p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p> ]]></description> <content:encoded><![CDATA[<p><strong>Awstats </strong>will consider as a page hit any entry from the log it processes. <em>By default some file extensions</em> (for regular image types and css/js) are excluded from what awstats will consider as a page:<br
/> <code>NotPageList="css js class gif jpg jpeg png bmp ico"</code>(this is the default). All other file types will be counted as pages. Now, if we want to completely ignore some files, or even all the content of one folder from the awstats processing we can use the <strong>SkipFiles </strong>parameter. We might want to do this to ignore some frames, hidden pages, ajax calls, etc.</p><p><span
id="more-565"></span>The <strong>SkipFiles </strong>parameter is <em>by default empty</em>, and in order to use it we have to add the appropriate config in our <em>awstats.conf</em> file.  For example to ignore a file called <em>somefile.php</em> we will add <em>&#8220;/somefile.php</em>&#8220;:<br
/> <code>SkipFiles="/somefile.php"</code><br
/> while if we want to ignore all the pages in a folder called <em>somefolder </em>we will have to use a regex value like: <em>&#8220;REGEX[^\/somefolder]&#8220;</em><br
/> We can add several rules separated by spaces:<br
/> <code>SkipFiles="/somefile.php REGEX[^\/somefolder]"</code></p><p><em>Note</em>: this will be effective only for <strong>new updates</strong>; meaning existing data will not be affected by this (if really needed you will have to regenerate your stats to get rid of those pages in old stats).</p><p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p>]]></content:encoded> <wfw:commentRss>http://www.ducea.com/2009/02/09/howto-ignore-some-filesfolders-from-awstats-reports/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Lighty Tips &amp; Tricks: Hide lighttpd software version</title><link>http://www.ducea.com/2009/02/08/lighty-tips-tricks-hide-lighttpd-software-version/</link> <comments>http://www.ducea.com/2009/02/08/lighty-tips-tricks-hide-lighttpd-software-version/#comments</comments> <pubDate>Sun, 08 Feb 2009 23:24:56 +0000</pubDate> <dc:creator>- Marius -</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Tips & Tricks]]></category> <category><![CDATA[lighttpd]]></category> <category><![CDATA[lighty-tips-and-tricks]]></category><guid
isPermaLink="false">http://www.ducea.com/?p=551</guid> <description><![CDATA[Description: This will show how to hide the lighttpd version to remote requests. Useful: there is really no need to disclose this information to everyone. As shown in “Discover the web server software and version of a remote server” anyone can find valuable information from our web server banner. Hiding it  will not protect in [...]<p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p> ]]></description> <content:encoded><![CDATA[<p><strong>Description</strong>: This will show how to hide the lighttpd version to remote requests.<strong></strong></p><p><strong>Useful</strong>: there is really no need to disclose this information to everyone. As shown in “<a
href="http://www.ducea.com/2006/06/09/apache-tips-tricks-discover-the-web-server-software-and-version-of-a-remote-server/">Discover the web server software and version of a remote server</a>” anyone can find valuable information from our web server banner. Hiding it  will not protect in any way from real vulnerabilities if they exist, but it will at least make their life harder. This will also not stop more complex fingerprinting programs to detect some information on the web server, but at least we should not make their life easier <img
src='http://www.ducea.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p><p><span
id="more-551"></span>Compared with <a
href="http://www.ducea.com/2006/06/15/apache-tips-tricks-hide-apache-software-version/">Apache</a> (apache by default will show a lot of information even about the linux distribution and installed apache modules), <strong>lighttpd </strong>will only show its <strong>server version</strong> in the header. This is good enough, but still we probably want to hide that information anyway. For this, we will use the global lighttpd variable <strong>server.tag</strong> that defines the string returned by the server. The <a
href="http://redmine.lighttpd.net/projects/lighttpd/wiki/Server.use-tagDetails" target="_blank">default</a> (if not defined) is:</p><pre><code>server.tag = "lighttpd &lt;current-version&gt;"</code></pre><p>and this will look in a regular header output like:<br
/> <code>...<br
/> Server: lighttpd/1.4.19<br
/> ...</code></p><p>To overwrite this, we just have to define our own output for the <strong>server.tag</strong> variable in <strong>lighttpd.conf.</strong> Usually I like to define it like this:<br
/> <code><strong>server.tag = "lighttpd"</strong></code><br
/> leaving the lighty name, but taking out the version;  you can of course enter anything you like (even to forge an apache or iis server output, etc.)<br
/> <code>server.tag = "Apache/1.3.29 (Unix) mod_perl/1.29 PHP/4.4.1 mod_ssl/2.8.16 OpenSSL/0.9.7g"</code></p><p><strong>Conclusion</strong>: if you want to provide minimum information about your system then customize your lighty server.tag:<br
/> <code>server.tag = "lighttpd"</code></p><p>Go to:<br
/> Main page of all my Lighty Tips &amp; Tricks</p><p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p>]]></content:encoded> <wfw:commentRss>http://www.ducea.com/2009/02/08/lighty-tips-tricks-hide-lighttpd-software-version/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>HowTo use Dig to check if a DNS server is using random source ports</title><link>http://www.ducea.com/2008/12/02/howto-use-dig-to-check-if-a-dns-server-is-using-random-source-ports/</link> <comments>http://www.ducea.com/2008/12/02/howto-use-dig-to-check-if-a-dns-server-is-using-random-source-ports/#comments</comments> <pubDate>Tue, 02 Dec 2008 12:09:52 +0000</pubDate> <dc:creator>- Marius -</dc:creator> <category><![CDATA[Security]]></category> <category><![CDATA[bind]]></category> <category><![CDATA[dns]]></category> <category><![CDATA[named]]></category><guid
isPermaLink="false">http://www.ducea.com/?p=459</guid> <description><![CDATA[You can quickly test with dig if a DNS resolver is using random source ports for queries: dig +short @&#60;IP_DNS_SERVER&#62; porttest.dns-oarc.net txt for more details check out my post about this: &#8220;How to check if your DNS server implements source port randomization&#8220;<p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p> ]]></description> <content:encoded><![CDATA[<p>You can quickly test with <strong>dig </strong>if a DNS resolver is using <strong>random source ports</strong> for queries:<br
/> <code>dig +short @&lt;IP_DNS_SERVER&gt; porttest.dns-oarc.net txt</code><br
/> for more details check out my post about this: &#8220;<a
href="http://linuxsysadminblog.com/2008/12/how-to-check-if-your-dns-server-implements-source-port-randomization/">How to check if your DNS server implements source port randomization</a>&#8220;</p><p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p>]]></content:encoded> <wfw:commentRss>http://www.ducea.com/2008/12/02/howto-use-dig-to-check-if-a-dns-server-is-using-random-source-ports/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Amazon announces its own content delivery network: CloudFront</title><link>http://www.ducea.com/2008/11/18/amazon-announces-its-own-content-delivery-network-cloudfront/</link> <comments>http://www.ducea.com/2008/11/18/amazon-announces-its-own-content-delivery-network-cloudfront/#comments</comments> <pubDate>Tue, 18 Nov 2008 22:30:20 +0000</pubDate> <dc:creator>- Marius -</dc:creator> <category><![CDATA[Cloud Computing]]></category> <category><![CDATA[News from Outside]]></category> <category><![CDATA[Scaling]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[amazon]]></category> <category><![CDATA[aws]]></category> <category><![CDATA[cdn]]></category> <category><![CDATA[CloudFront]]></category> <category><![CDATA[s3]]></category><guid
isPermaLink="false">http://www.ducea.com/?p=425</guid> <description><![CDATA[Today Amazon announced the public beta of Amazon CloudFront, their AWS service for content delivery. This is the service that many users of Amazon S3 (Simple Storage Service) have been waiting for a long time. Even if S3 was never a &#8216;real&#8217; CDN (content delivery network) it was used by many sites to serve static [...]<p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p> ]]></description> <content:encoded><![CDATA[<p>Today Amazon <a
href="http://aws.amazon.com/about-aws/whats-new/2008/11/18/whats-new-cloudfront/" target="_blank">announced</a> the public beta of <strong>Amazon CloudFront</strong>, their AWS service for content delivery. This is the service that many users of <strong>Amazon S3</strong> (<em>Simple Storage Service</em>) have been waiting for a long time. Even if S3 was never a &#8216;real&#8217; CDN (content delivery network) it was used by many sites to serve static content. The main limitation of this approach was that it had no geographical awareness as content delivery networks usually have; the fact that S3 is highly scalable and well priced made this solution acceptable on S3.</p><p><strong>CloudFront </strong>is the answer to all users’ requests about <strong>using S3 as a CDN</strong>, delivering the content using a global network of <strong>14 edge locations</strong>. <em>CloudFront uses S3 to store the original file</em>, and caches copies of the content close to end users locations, lowering latency when they download the objects.</p><p><span
id="more-425"></span>Amazon CloudFront uses the following edge locations:<br
/> <span
style="text-decoration: underline;"><em>United States</em></span><br
/> * Ashburn, VA<br
/> * Dallas/Fort Worth, TX<br
/> * Los Angeles, CA<br
/> * Miami, FL<br
/> * Newark, NJ<br
/> * Palo Alto, CA<br
/> * Seattle, WA<br
/> * St. Louis, MO<br
/> <span
style="text-decoration: underline;"><em>Europe</em></span><br
/> * Amsterdam<br
/> * Dublin<br
/> * Frankfurt<br
/> * London<br
/> <span
style="text-decoration: underline;"><em>Asia</em></span><br
/> * Hong Kong<br
/> * Tokyo</p><p><strong>CloudFront advantages:</strong></p><ul><li><strong>simple </strong>to implement; uses S3 as a &#8216;backend&#8217;;</li><li><strong>cost effective</strong> &#8211; pay only for what you use; <a
href="http://aws.amazon.com/cloudfront/" target="_blank">priced</a> very well just as S3 with prices starting at $0.170 per GB for content delivered in the US and Europe, and $0.210 per GB for content delivered in Asia;</li><li><strong>reliable </strong>- even though this is launched as <strong>beta </strong>and there is <strong>no SLA</strong>, we can expect to have a very reliable service from Amazon built on the experiences of s3 and ec2.</li></ul><p><strong>CloudFront disadvantages:</strong></p><ul><li>this is a <strong>http only</strong> service; if you will need https for ex. you will not be able to do that.</li><li><strong>no control </strong>over caching; CloudFront will cache the file from your S3 bucket and serve it based on the closest dns location; this cache can expire in case of infrequent used files.</li><li><strong>no stats</strong> (besides the aws bill of course <img
src='http://www.ducea.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ).</li><li>this is not trying to compete with the big CDN solutions out there, as it will be hard to match their features, but to provide a simple and cost effective solution that everybody can use.</li></ul><p>In conclusion, this is great news from Amazon, and I am sure that even as I am writing this, many users that are serving their content from S3 have just finished switching over to CloudFront. For more details about <strong>CloudFront </strong>check out the <a
href="http://aws.amazon.com/cloudfront/ " target="_blank">AWS CloudFront page</a>.</p><p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p>]]></content:encoded> <wfw:commentRss>http://www.ducea.com/2008/11/18/amazon-announces-its-own-content-delivery-network-cloudfront/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Setting up a PPTP VPN server on Debian Etch</title><link>http://www.ducea.com/2008/06/19/setting-up-a-pptp-vpn-server-on-debian-etch/</link> <comments>http://www.ducea.com/2008/06/19/setting-up-a-pptp-vpn-server-on-debian-etch/#comments</comments> <pubDate>Thu, 19 Jun 2008 16:28:02 +0000</pubDate> <dc:creator>- Marius -</dc:creator> <category><![CDATA[Debian]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[pptp]]></category> <category><![CDATA[vpn]]></category><guid
isPermaLink="false">http://www.ducea.com/?p=249</guid> <description><![CDATA[PPTP is known to be less secure than other VPN software, but if you need a quick solution for a VPN server that will connect out of the box from Windows workstations PPTP is the obvious choice. This post will show how easy it is to setup a pptp vnp server on Debian Etch. A [...]<p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p> ]]></description> <content:encoded><![CDATA[<p><a
href="http://www.poptop.org/" target="_blank"><strong>PPTP</strong></a> is known to be less secure than other VPN software, but if you need a quick solution for a VPN server that will connect out of the box from Windows workstations PPTP is the obvious choice. <em>This post will show how easy it is to setup a pptp vnp server on Debian Etch.</em></p><p>A while ago setting up a <strong>pptp server</strong> was not so simple. It involved <em>patching the kernel</em> and the <em>ppp daemon</em>. These days in <strong>Debian Etch</strong> everything comes out of the box and we just have to install the pptpd server and configure it based on our needs. First let&#8217;s install pptpd:<br
/> <code>aptitude install pptpd</code><br
/> (this will install also some dependencies: bcrelay and ppp). The default pptpd configuration file is installed under <strong>/etc/pptpd.conf</strong> ; you can change any of the available options (samples are included in the configuration file as comments), but really the only thing that needs to be configured is the ip of the local server used by pptpd as the local gateway for the remote hosts and the remote users assigned ips:<span
id="more-249"></span><br
/> <code>localip 192.168.1.1<br
/> remoteip 192.168.1.100-120</code><br
/> here we will use the local ip 192.168.1.1 as the pptpd ip and the remote users will be allocated the first available ip from the range 192.168.1.100 &#8211; 192.168.1.120 (meaning we can have a maximum of 20 simultaneous vpn users connected to this pptp server). These ips are assigned based on the particular setup, being either a pair of private ips (just like in my example above) or even real ips.</p><p>The debian package also uses the file <strong>/etc/ppp/pptpd-options</strong> containing the main pptpd server configs. A typical config will look like this:</p><pre><code>name My.VPN

refuse-pap
refuse-chap
refuse-mschap
require-mschap-v2
require-mppe-128

ms-dns 192.168.1.1

proxyarp
nodefaultroute
lock
nobsdcomp
noipx
mtu 1490
mru 1490</code></pre><p>Finally, you will need to add your <em>vpn users</em> in <strong>/etc/ppp/chap-secrets</strong>, each user on a separate line using the regular pppd format:</p><pre><code># client        server  secret                 IP addresses
user            *       password               *</code></pre><p>To limit connections from specific hosts, add the allowed ip instead of the * at the end.</p><p>Activate the changes restarting the pptp server:<br
/> <code>/etc/init.d/pptpd restart</code><br
/> and look for the logs under /var/log/syslog to troubleshoot any problems.</p><p>You can now connect to your new PPTP VPN server using the built-in pptp vpn client from any modern windows workstation (except probably vista that is broken by sp1) using the default connection settings.</p><p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p>]]></content:encoded> <wfw:commentRss>http://www.ducea.com/2008/06/19/setting-up-a-pptp-vpn-server-on-debian-etch/feed/</wfw:commentRss> <slash:comments>32</slash:comments> </item> <item><title>Adding a secondary IP address on a Cisco ASA Ethernet interface</title><link>http://www.ducea.com/2008/05/31/adding-a-secondary-ip-address-on-a-cisco-asa-ethernet-interface/</link> <comments>http://www.ducea.com/2008/05/31/adding-a-secondary-ip-address-on-a-cisco-asa-ethernet-interface/#comments</comments> <pubDate>Sat, 31 May 2008 08:37:21 +0000</pubDate> <dc:creator>- Marius -</dc:creator> <category><![CDATA[Security]]></category> <category><![CDATA[asa]]></category> <category><![CDATA[cisco]]></category> <category><![CDATA[pix]]></category><guid
isPermaLink="false">http://www.ducea.com/?p=241</guid> <description><![CDATA[I have been working with various Cisco devices for many years now. Even though I hold a valid CCNP, I didn&#8217;t had the chance to work during the past months with Cisco devices as much as I was when I was actively working in the ISP field. Sill, from time to time I take on [...]<p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p> ]]></description> <content:encoded><![CDATA[<p>I have been working with various <a
href="http://www.cisco.com/" target="_blank">Cisco</a> devices for many years now. Even though I hold a valid <em>CCNP</em>, I didn&#8217;t had the chance to work during the past months with Cisco devices as much as I was when I was actively working in the ISP field. Sill, from time to time I take on small consulting Cisco related projects. This post will show how to overcome the frustration on the top line <strong>Cisco ASA firewalls not supporting interface ip aliases</strong>.</p><p>Cisco <strong>PIX </strong>firewalls have been around for many years and I was aware of the stupid limitation they had about not being able to add ip aliases on their interfaces. Again this was many years ago&#8230; Today when I had to configure a small <strong>Cisco ASA 5505</strong> device, I didn&#8217;t even thought that the fanciest line of Cisco firewalls still has this limitation. You could say that the 5505 is the cheapest models and this is the reason for the limitation. Well, it costs much more than any other similar hardware firewall and honestly every other box I have seen support this (I can&#8217;t even call it feature)&#8230; I can&#8217;t be certain as I don&#8217;t have such a device to test out, but from what I can tell, all the ASA product line has the same issue, including the higher level 5550 and 5580.</p><p><span
id="more-241"></span>Now, why would I need this? Maybe I have several network ranges behind the ASA, and for whatever reason I don&#8217;t need them in separate vlans (my switches don&#8217;t support vlans, I have ips from both ranges configured on some systems, etc.) and I don’t what to pay a lot of money to just enable more vlans on the box, etc.</p><p>I will not give a linux system as an example as this is quite obvious to anyone that you can add as many ip aliases you want on one ethernet interface. Still the ASA will not be able to do this. You could try out to use the familiar ios command to add a secondary ip on the interface/vlan, as you might hope it is undocumented feature, but you will see it is just not there&#8230;</p><p>Let&#8217;s see what <strong>trick </strong>we can use to overcome this stupid limitation: <em>we will be using the <strong>Proxy-ARP</strong> facility in order to respond for another IP requests on the same ethernet interface, without actually bringing it up</em>. In my example I will be using eth0/1 and the &#8216;inside&#8217; vlan, vlan1 with an existing &#8216;main&#8217; ip range configured: 192.168.0.1/24; I will add another ip 192.168.1.1 so hosts from this range will also work behind the ASA:</p><ol><li>first find out the mac address of the ethernet interface you will be using.<br
/> <code>sh interface Ethernet0/1</code><br
/> this should show you the MAC address of the network interface.</li><li>force this arp address on the internal vlan:<br
/> <code>interface Vlan1<br
/> mac-address 0019.0726.xxxx<br
/> nameif inside</code></li><li>now let&#8217;s <strong>define a static arp</strong> entry for the IP we want to use as secondary, using the same mac address as the one from above, and enable proxy ARP on it:<br
/> <code>arp inside 192.168.1.1 0019.0726.xxx alias</code><br
/> you can verify this is working properly using the show arp command that should return you the ip and mac address, like this:<br
/> <code>sh arp<br
/> inside 192.168.1.1 0019.0726.xxx alias<br
/> ...</code></li><li>at this point any system on the local interface can use the ip as its default gateway and it will work just fine. We just need to ensure that return packets are coming back to the source, and this means we have to <strong>add a static route</strong> for this network on the inside interface (pointing to the main ip of the interface, let&#8217;s say 192.168.0.1 in my case):<br
/> <code>route inside 192.168.1.0 255.255.255.0 192.168.0.1 1</code></li><li>also we need to ensure that traffic is allowed between the same interface hosts, and same level of security interfaces:<br
/> <code>same-security-traffic permit inter-interface<br
/> same-security-traffic permit intra-interface</code><br
/> and you probably want to be sure that access lists will allow the traffic from/to the newly added network.</li></ol><p>That&#8217;s it&#8230;</p><p>The &#8220;Cisco way&#8221; to achieve this is to use separate vlans for each network range. Let&#8217;s try to speculate why doesn&#8217;t Cisco want this &#8216;feature&#8217; in their firewalls? Maybe because on the standard license the box doesn&#8217;t support more than 2 full vlans (and 1 DMZ &#8211; limited)? and so you can&#8217;t do this using vlans even if you wanted&#8230; And you have to buy a license upgrade to support more? Or just to trunk them? What do you think? Do you think this is intentional to make peoples buy their higher end ASAs or upgrade to Security Plus license? (about 400-500$ extra)?</p><p><em> Note: the only limitation this method has is that the ‘secondary’ ip will work as expected as a gateway for the systems behind the asa, but will obviously not respond itself to network requests (like ping for ex.). If this is not acceptable, you should then go ahead and use the vlan method.</em><em></em></p><p>I hope this post will help other peoples that have the same frustration and will show them how to use any number of secondary ip they want. Even though this post was examplified using one ASA5505 it should work just fine on other ASAs and even on PIXes.</p><p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p>]]></content:encoded> <wfw:commentRss>http://www.ducea.com/2008/05/31/adding-a-secondary-ip-address-on-a-cisco-asa-ethernet-interface/feed/</wfw:commentRss> <slash:comments>48</slash:comments> </item> <item><title>Securing Memcached</title><link>http://www.ducea.com/2008/01/11/securing-memcached/</link> <comments>http://www.ducea.com/2008/01/11/securing-memcached/#comments</comments> <pubDate>Fri, 11 Jan 2008 20:49:18 +0000</pubDate> <dc:creator>- Marius -</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[memcached]]></category><guid
isPermaLink="false">http://www.ducea.com/2008/01/11/securing-memcached/</guid> <description><![CDATA[Memcached is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load. Memcached is a great piece of software that was designed with performance in mind. Still, memcached has little (or should I say none?) security features built-in. If we run [...]<p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p> ]]></description> <content:encoded><![CDATA[<p><a
href="http://www.danga.com/memcached/" target="_blank"><strong>Memcached</strong></a> is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load. Memcached is a great piece of software that was designed with performance in mind. Still, memcached has little (or should I say none?) security features built-in. If we run memcached on a public ip and unprotected, anyone will be able to reach it and make memcached connections. This guide is intended to show some simple steps that can be used <strong>to secure your memcached setup</strong>.</p><p>You might say that you are not saving any private information in memcached and just cache parts of your public pages. Well, even in this case you will want your memcached daemon protected and not open to DOS attacks. Basically, regardless of the data you will cache (even if this is public or backend sql private data), you will probably want to control who can access it and since memcached doesn&#8217;t have any built-in authentication and doesnâ€™t require any user or password we will have to use external protection methods like a iptables  or other firewall rules  for protection.<span
id="more-205"></span></p><h3>1. Run the memcached daemon under a non-privileged user.</h3><p>You should run the memcached daemon under a user with the least privileges needed for its purpose. You can safely run it with a user with minimal privileges like <strong>nobody </strong>for ex. as <em>memcached doesn&#8217;t require any special privileges</em>. Still, many people will run this as <strong>root</strong>, because they start it directly from a root shell (<em>rc.local</em> or similar) like:<br
/> <code>./memcached -d -m 2048 -p 11211</code><br
/> (as it will start as the running user). Also this happens for ex. in the debian etch memcached package where the default is to run it as root (this is fixed in the lenny package that will run by default as nobody).</p><p>To run as a regular unprivileged user just use the<strong> -u</strong> switch to start memcached:<br
/> <code>./memcached -d -m 2048 -p 11211 -u nobody</code><br
/> or if you use a configuration file like in the debian package edit it and add (<strong>-u nobody</strong>) and comment out the default entry -u root, inside<em> /etc/memcached.conf</em>.</p><h3>2. Specify which IP address to listen on.</h3><p>Since memcached has no built-in authentication as it is concerned to be as fast as possible the only way we can protect our memcached daemon is by blocking access to the daemon to anyone else than the hosts that need to have access. By default, memcached will <strong>listen on all IP addresses </strong>if the -l switch is not used. I recommend to use <strong>-l</strong> and have memcached listen <strong>only </strong>on the ip you need.</p><p>- if memcached is used just by the local system then use <strong>-l 127.0.0.1</strong> and run it like:<br
/> <code>./memcached -d -m 2048 -p 11211 -u nobody -l 127.0.0.1</code><br
/> - if you have a backend private network used by your servers use that to bind it only on the private ip, for ex: <strong>-l 192.168.0.1</strong> like:<br
/> <code>./memcached -d -m 2048 -p 11211 -u nobody -l 192.168.0.1</code><br
/> - if you really need to run this on a public ip, in this case just bind it on a single ip anyway (to ease maintenance if the box has more ips, etc.) using <strong>-l &lt;ip&gt;</strong>:<br
/> <code>./memcached -d -m 2048 -p 11211 -u nobody -l &lt;ip&gt;</code><br
/> and depending from your setup filter the access to the <strong>TCP port 11211</strong> for that IP to only the hosts that need to reach it and block all other access. If you run it on a different port (-p) or use more daemons on the same machine, do this for each one of them.</p><p>I hope you found this information useful and will help you have a safer and more secure memcached setup.</p><p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p>]]></content:encoded> <wfw:commentRss>http://www.ducea.com/2008/01/11/securing-memcached/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>EnGarde Secure Community 3.0.18 Released</title><link>http://www.ducea.com/2007/12/05/engarde-secure-community-3018-released/</link> <comments>http://www.ducea.com/2007/12/05/engarde-secure-community-3018-released/#comments</comments> <pubDate>Wed, 05 Dec 2007 16:38:43 +0000</pubDate> <dc:creator>- Marius -</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[distributions]]></category> <category><![CDATA[engarde]]></category> <category><![CDATA[releases]]></category><guid
isPermaLink="false">http://www.ducea.com/2007/12/05/engarde-secure-community-3018-released/</guid> <description><![CDATA[Guardian Digital released yesterday, December 4, 2007 the latest version of their security targeted distribution: EnGarde Secure Community 3.0.18 (Version 3.0, Release 18). ISOs for i686 and x86_64 are available for direct download and also as torrent images. The download size is very small ~570 MB but it includes all the necessary tools to run [...]<p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p> ]]></description> <content:encoded><![CDATA[<p><img
src="http://www.ducea.com/images/engarde686.png" alt="" width="125" height="100" align="right" /><a
href="http://www.engardelinux.org/" target="_blank"><strong>Guardian Digital</strong></a> released yesterday, December 4, 2007 the latest version of their security targeted distribution: <strong>EnGarde Secure Community 3.0.18</strong> (Version 3.0, Release 18). ISOs for i686 and x86_64 are <a
href="http://www.engardelinux.org/modules/download/" target="_blank">available</a> for direct download and also as torrent images. The download size is very small <em>~570 MB</em> but it includes all the necessary tools to run a secure standalone or application server.</p><p>Changes in 3.0.18 include among others:</p><ul><li>New Guardian Digital Health Center for proactive hardware monitoring</li><li>FwkNop and PSAD Tools for new levels of Security (featured in the the new <a
href="http://www.cipherdyne.org/LinuxFirewalls/" target="_blank">Linux Firewalls</a> book by Michael Rash)</li><li>New stress-kernel package with a new stress testing suite</li><li>Several new packages such as drbd (8.2.1), dsniff (2.3), psad (2.1), quota (3.15), sdparm (1.02), stress-kernel (3.0).</li><li>The latest stable versions of MySQL (5.0.45), asterisk (1.4.14), kernel (2.6.23), openswan (2.4.10), samba (3.0.27a), syslog-ng (2.0.5), webtool (3.18), etc.</li><li>Numerous fixes and features enhancements</li></ul><p><span
id="more-197"></span>A full list of changes in this release can be found <a
href="http://www.engardelinux.org/modules/index/releases/3.0.18.cgi" target="_blank">here</a>.</p><p>To download EnGarde Secure Linux Community 3.0.18 go <a
href="http://www.engardelinux.org/modules/download/" target="_blank">here</a>.</p><p><img
src="http://www.ducea.com/images/engarde-health-center-thumb.png" alt="" width="400" height="246" align="middle" /></p><p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p>]]></content:encoded> <wfw:commentRss>http://www.ducea.com/2007/12/05/engarde-secure-community-3018-released/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Apache Tips: Disable the HTTP TRACE method</title><link>http://www.ducea.com/2007/10/22/apache-tips-disable-the-http-trace-method/</link> <comments>http://www.ducea.com/2007/10/22/apache-tips-disable-the-http-trace-method/#comments</comments> <pubDate>Mon, 22 Oct 2007 11:11:39 +0000</pubDate> <dc:creator>- Marius -</dc:creator> <category><![CDATA[Centos]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[Fedora]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[RHEL]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Tips & Tricks]]></category> <category><![CDATA[Ubuntu]]></category><guid
isPermaLink="false">http://www.ducea.com/2007/10/22/apache-tips-disable-the-http-trace-method/</guid> <description><![CDATA[Applies: apache 1.3.x / apache 2.0.x Required apache module: - Scope: global server configuration Type: security Description: How to disable the HTTP TRACE method on recent apache versions. Most vulnerability scanners (like the popular nessus, but commercial ones also) will complain (normally as a low thread or warning level) about TRACE method being enabled on [...]<p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p> ]]></description> <content:encoded><![CDATA[<p><strong>Applies</strong>: apache 1.3.x / apache 2.0.x<br
/> Required apache module: <strong>-</strong><br
/> <strong>Scope</strong>: global server configuration<br
/> <strong>Type</strong>: security</p><p><strong>Description</strong>: How to disable the HTTP TRACE method on recent apache versions.</p><p>Most vulnerability scanners (like the popular nessus, but commercial ones also) will complain (normally as a low thread or warning level) about <strong>TRACE </strong>method being enabled on the web server tested.</p><p><span
id="more-189"></span>Normally you will have this enabled by default, but if you want to test if it is really enabled on your server you just have to telnet on the port your web server is running and request for &#8220;<strong>TRACE / HTTP/1.0</strong>&#8221; if you get a positive reply it means TRACE is enabled on your system. The output of a server with TRACE enabled will look like:</p><pre><code>telnet 127.0.0.1 80
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
TRACE / HTTP/1.0
Host: foo
Any text entered here will be echoed back in the response <strong>&lt;- ENTER twice to finish</strong>

HTTP/1.1 200 OK
Date: Sat, 20 Oct 2007 20:39:36 GMT
Server: Apache/2.2.6 (Debian) PHP/4.4.4-9 mod_ruby/1.2.6 Ruby/1.8.6(2007-06-07)
Connection: close
Content-Type: message/http

TRACE / HTTP/1.0
Host: foo
Any text entered here will be echoed back in the response

Connection closed by foreign host.</code></pre><p>Traditionally experts will suggest to disable this using some rewrite rules like:</p><p><code>RewriteEngine On<br
/> RewriteCond %{REQUEST_METHOD} ^TRACE<br
/> RewriteRule .* - [F]</code><br
/> (this needs to be added somewhere in your main apache config file outside of any vhost or directory config).</p><p>Still this has the disadvantage that you need to have <em>mod_rewrite enabled</em> on the server just to mention one. But for apache versions newer than 1.3.34 for the legacy branch, and 2.0.55 (or newer) for apache2 this can be done very easily because there is a new apache variable that controls if TRACE method is enabled or not:<br
/> <code>TraceEnable off</code><br
/> This needs to be added in the main server config and the default is enabled (on). <strong>TraceEnable off</strong> causes apache  to return a 403 FORBIDDEN error to the client.</p><p>After setting this and reloading the apache config the same server as above shows:</p><pre><code>telnet 127.0.0.1 80
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
TRACE / HTTP/1.0
Host: foo
testing...  &lt;- ENTER twice

HTTP/1.1 403 Forbidden
Date: Sat, 20 Oct 2007 20:38:31 GMT
Server: Apache/2.2.6 (Debian) PHP/4.4.4-9 mod_ruby/1.2.6 Ruby/1.8.6(2007-06-07)
Content-Length: 320
Connection: close
Content-Type: text/html; charset=iso-8859-1

&lt;!DOCTYPE <abbr class="uttInitialism" title="HyperText Markup Language">HTML</abbr>(<a class="ubernym" href="http://www.w3.org/MarkUp/">link</a>) PUBLIC "-//IETF//DTD <abbr class="uttInitialism" title="HyperText Markup Language">HTML</abbr>(<a class="ubernym" href="http://www.w3.org/MarkUp/">link</a>) 2.0//EN"&gt;
&lt;html&gt;&lt;head&gt;
&lt;title&gt;403 Forbidden&lt;/title&gt;
&lt;/head&gt;&lt;body&gt;
&lt;h1&gt;Forbidden&lt;/h1&gt;
&lt;p&gt;You don't have permission to access /
on this server.&lt;/p&gt;
&lt;hr&gt;
&lt;address&gt;Apache/2.2.6 (Debian) PHP/4.4.4-9 mod_ruby/1.2.6 Ruby/1.8.6(2007-06-07) Server at foo Port 80&lt;/address&gt;
&lt;/body&gt;&lt;/html&gt;
Connection closed by foreign host. </code></pre><p>Go to:<br
/> <a
href="http://www.ducea.com/2006/06/08/apache-tips-tricks/">Main page of all my Apache Tips &amp; Tricks</a></p><p><a
href="http://www.thycotic.com/zSS_Ducea.html?utm_source=ducea&utm_medium=banner&utm_content=iquit&utm_campaign=SSDucea"><img
src="http://www.ducea.com/images/SS468by60.jpg"></a></p>]]></content:encoded> <wfw:commentRss>http://www.ducea.com/2007/10/22/apache-tips-disable-the-http-trace-method/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> </channel> </rss>
<!-- Served from: www.ducea.com @ 2012-02-08 10:20:51 by W3 Total Cache -->
