<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="http://www.booservers.com/styles/rss.css" type="text/css"?>
<rdf:RDF 
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
  xmlns="http://my.netscape.com/rdf/simple/0.9/"
>

 <channel>
  <title>Booservers - All about dedicated servers</title>
  <link>http://www.booservers.com</link>
  <description></description>
 </channel>
    <item>
   <title>Chkrootkit</title>
   <description>&lt;p&gt;Installing CHKROOTKIT &lt;/p&gt;&lt;p&gt;(Version 0.42b Sep 20 2003)&lt;/p&gt;&lt;p&gt;SSH as admin to your server. DO NOT use telnet&lt;/p&gt;&lt;p&gt;#Change to root&lt;br /&gt;su -&lt;/p&gt;&lt;br/&gt;&lt;center&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-7209259988091090&quot;;
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = &quot;300x250_as&quot;;
google_ad_type = &quot;text_image&quot;;
google_ad_channel =&quot;3498328464&quot;;
google_color_border = &quot;FFFFFF&quot;;
google_color_bg = &quot;FFFFFF&quot;;
google_color_link = &quot;006633&quot;;
google_color_url = &quot;000000&quot;;
google_color_text = &quot;0033CC&quot;;
//--&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
  src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;&lt;/center&gt;&lt;br&gt;&lt;p&gt;#Type the following&lt;br /&gt;wget &lt;a href=&quot;ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz&quot;&gt;ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz&lt;/a&gt;&lt;/p&gt;&lt;p&gt;#Unpack the tarball using the command &lt;br /&gt;tar xvzf chkrootkit.tar.gz &lt;/p&gt;&lt;p&gt;#Change to the directory it created&lt;br /&gt;cd chkrootkit*&lt;/p&gt;&lt;p&gt;#Compile by typing&lt;br /&gt;make sense &lt;/p&gt;&lt;p&gt;#To use chkrootkit, just type the command&lt;br /&gt;./chkrootkit &lt;/p&gt;&lt;p&gt;#Everything it outputs should be &#039;not found&#039; or &#039;not infected&#039;... &lt;/p&gt;&lt;p&gt;#Now, &lt;br /&gt;cd .. &lt;br /&gt;#Then remove the .gz file&lt;br /&gt;rm chkrootkit.tar.gz &lt;/p&gt;&lt;p&gt;Credits: &lt;a href=&quot;http://www.cheetaweb.com/&quot;&gt;http://www.cheetaweb.com/&lt;/a&gt;&lt;/p&gt;</description>
   <link>http://www.booservers.com/archivo/38_chkrootkit.html</link>
      <pubDate>Thu, 15 Dec 2005 21:43:05 +0000</pubDate>   
  </item>
    <item>
   <title>APF Firewall 0.9.4-7</title>
   <description>&lt;p&gt;Just thought I&#039;d update the howto&#039;s for APF.&lt;/p&gt;&lt;p&gt;Type ifconfig&lt;/p&gt;&lt;p&gt;Find out if it’s using eth0 or eth1.&lt;/p&gt;&lt;p&gt;Usually its eth0 but if its not, change it in conf.apf or you’ll be completely blocking the server from access&lt;/p&gt;&lt;p&gt;wget &lt;a href=&quot;http://www.rfxnetworks.com/downloads/apf-current.tar.gz&quot;&gt;http://www.rfxnetworks.com/downloads/apf-current.tar.gz&lt;/a&gt;&lt;/p&gt;&lt;p&gt;tar -xvzf apf-current.tar.gz&lt;br /&gt;cd apf*&lt;br /&gt;./install.sh&lt;br /&gt;pico -w /etc/apf/conf.apf&lt;/p&gt;&lt;p&gt;RESV_DNS=&amp;quot;1&amp;quot;&lt;/p&gt;&lt;p&gt;All SYSCTL options should be set to 1 EXCEPT for&lt;br /&gt;SYSCTL_OVERFLOW=&amp;quot;0&amp;quot;&lt;br /&gt;SYSCTL_SYNCOOKIES=&amp;quot;0&amp;quot;&lt;/p&gt;&lt;p&gt;USE_DS=&amp;quot;1&amp;quot;&lt;br /&gt;USE_AD=&amp;quot;1&amp;quot;&lt;/p&gt;&lt;br/&gt;&lt;center&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-7209259988091090&quot;;
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = &quot;300x250_as&quot;;
google_ad_type = &quot;text_image&quot;;
google_ad_channel =&quot;3498328464&quot;;
google_color_border = &quot;FFFFFF&quot;;
google_color_bg = &quot;FFFFFF&quot;;
google_color_link = &quot;006633&quot;;
google_color_url = &quot;000000&quot;;
google_color_text = &quot;0033CC&quot;;
//--&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
  src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;&lt;/center&gt;&lt;br&gt;FOR PLESK:&lt;p&gt;IG_TCP_CPORTS=&amp;quot;20,21,22,25,53,80,110,143,443,465,993,995,8443&amp;quot;&lt;br /&gt;IG_UDP_CPORTS=&amp;quot;37,53,873&amp;quot;&lt;/p&gt;&lt;p&gt;EGF=&amp;quot;1&amp;quot;&lt;br /&gt;EG_TCP_CPORTS=&amp;quot;20,21,22,25,53,37,43,80,113,443,465,873&amp;quot;&lt;br /&gt;EG_UDP_CPORTS=&amp;quot;53,873&amp;quot;&lt;/p&gt;&lt;p&gt;For CPANEL:&lt;/p&gt;&lt;p&gt;IG_TCP_CPORTS=&amp;quot;20,21,22,25,53,80,110,143,443,993,995,2082,2083,20 86,2087,2095,2096&amp;quot;&lt;br /&gt;IG_UDP_CPORTS=&amp;quot;37,53,873&amp;quot;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;EGF=&amp;quot;1&amp;quot;&lt;br /&gt;EG_TCP_CPORTS=&amp;quot;20,21,22,25,37,53,43,80,113,443,465,873,2087,2089&amp;quot;&lt;br /&gt;EG_UDP_CPORTS=&amp;quot;53,873&amp;quot;&lt;/p&gt;&lt;p&gt;apf –s to start firewall.&lt;/p&gt;&lt;p&gt;If you are not kicked out of SSH and you can type commands after it loads, that means it’s installed correctly.&lt;/p&gt;&lt;p&gt;pico -w /etc/apf/ad/conf.antidos&lt;/p&gt;&lt;p&gt;LP_KLOG=&amp;quot;1&amp;quot;&lt;/p&gt;&lt;p&gt;USR_ALERT=&amp;quot;1&amp;quot;&lt;br /&gt;USER = “root”&lt;br /&gt;ARIN_ALERT=&amp;quot;1&amp;quot;&lt;/p&gt;&lt;p&gt;pico -w /etc/apf/conf.apf&lt;/p&gt;&lt;p&gt;change DEVM to 0&lt;/p&gt;&lt;p&gt;apf -r&lt;/p&gt;</description>
   <link>http://www.booservers.com/archivo/34_apf_firewall_094-7.html</link>
      <pubDate>Thu, 15 Dec 2005 21:32:07 +0000</pubDate>   
  </item>
    <item>
   <title>Antidos via APF Firewall</title>
   <description>&lt;p&gt;Antidos is a really nice feature of the APF firewall, but it&#039;s not automatically turned on when you install and run APF.&lt;/p&gt;&lt;p&gt;First you probably want to make sure APF is running nicely for a few days and you have your own IP listed in the &amp;quot;allow_hosts.rules&amp;quot; file so you can&#039;t lock yourself out. You also want to understand how to access the EV1 remote console (from your EV1 account manager), just in case you do lock yourself out.&lt;/p&gt;&lt;p&gt;And to be even more safe, lets set DEVEL_MODE to &amp;quot;1&amp;quot; (on) and we need to setup USE_AD to enable the use of antidos, so find and edit these:&lt;/p&gt;&lt;p&gt;pico -w /etc/apf/conf.apf&lt;/p&gt;&lt;p&gt;DEVEL_MODE=&amp;quot;1&amp;quot;&lt;/p&gt;&lt;p&gt;USE_AD=&amp;quot;1&amp;quot;&lt;/p&gt;&lt;p&gt;apf -r&lt;/p&gt;&lt;p&gt;Now APF will quit in 5 minutes. Don&#039;t forget to put DEVEL_MODE back when everything is OK!&lt;/p&gt;&lt;br/&gt;&lt;center&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-7209259988091090&quot;;
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = &quot;300x250_as&quot;;
google_ad_type = &quot;text_image&quot;;
google_ad_channel =&quot;3498328464&quot;;
google_color_border = &quot;FFFFFF&quot;;
google_color_bg = &quot;FFFFFF&quot;;
google_color_link = &quot;006633&quot;;
google_color_url = &quot;000000&quot;;
google_color_text = &quot;0033CC&quot;;
//--&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
  src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;&lt;/center&gt;&lt;br&gt;&lt;p&gt;Your server will not be firewalled after 5 minutes! If you are under attack right now this might not be such a good thing to disable.&lt;/p&gt;&lt;p&gt;If you installed APF with the normal installer most of the settings for antidos should be OK. We only need to change a few things, find and change these:&lt;/p&gt;&lt;p&gt;pico -w /etc/apf/ad/conf.antidos&lt;/p&gt;&lt;p&gt;LP_KLOG=&amp;quot;1&amp;quot;&lt;br /&gt;IPT_BL=&amp;quot;1&amp;quot;&lt;/p&gt;&lt;p&gt;USR_ALERT=&amp;quot;1&amp;quot;&lt;br /&gt;USER = “root”&lt;br /&gt;ARIN_ALERT=&amp;quot;1&amp;quot;&lt;/p&gt;&lt;p&gt;You can test run it manually (it&#039;s just a shell script):&lt;/p&gt;&lt;p&gt;/etc/apf/ad/antidos -a&lt;/p&gt;&lt;p&gt;It doesn&#039;t say anything if it liked the config file and your system, and if you ran it for the first time, you will find it created a blank log file at:&lt;/p&gt;&lt;p&gt;/var/log/apfados_log&lt;/p&gt;&lt;p&gt;You need to have antidos set to run via cron. If you have &amp;quot;crontab -e&amp;quot; all set up you can use that to set it up. Some panels let you edit the root cron job file from the panel.&lt;/p&gt;&lt;p&gt;This is a critical setup point, if not done, antidos will simply not operate.&lt;/p&gt;&lt;p&gt;Here&#039;s an example line, I added this to my root crontab:&lt;/p&gt;&lt;p&gt;*/2 * * * * /etc/apf/ad/antidos -a &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;/p&gt;&lt;p&gt;This will run antidos every two minutes. The author of antidos doesn&#039;t recommend running it once a minute as it may cause a bottleneck for itself and the CPU. Likewise running it beyond a period of once every 5 minutes is not recommended either, for obvious reasons.&lt;/p&gt;&lt;p&gt;You can check to see if it&#039;s being run with something like this:&lt;/p&gt;&lt;p&gt;tail -30 /var/log/cron&lt;/p&gt;&lt;p&gt;Now restart apf again:&lt;/p&gt;&lt;p&gt;apf -r&lt;/p&gt;&lt;p&gt;Try to access a few of your sites and if you are not locked out and happy with everything you can set DEVEL_MODE to &amp;quot;0&amp;quot; (off) :&lt;/p&gt;&lt;p&gt;pico -w /etc/apf/conf.apf&lt;/p&gt;&lt;p&gt;DEVEL_MODE=&amp;quot;0&amp;quot;&lt;/p&gt;&lt;p&gt;apf -r&lt;/p&gt;&lt;p&gt;&lt;br /&gt;At this point it would be nice to test to see if it actually works, I leave that up to you to figure out how or maybe someone else can post some ideas. I would be very careful, you don&#039;t want to DOS the wrong server.&lt;/p&gt;&lt;p&gt;If for some reason you find out it&#039;s locking the wrong people out and want to turn it off, take this line out of root cron:&lt;/p&gt;&lt;p&gt;*/2 * * * * /etc/apf/ad/antidos -a &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;/p&gt;&lt;p&gt;And blank out this file:&lt;/p&gt;&lt;p&gt;/etc/apf/ad/ad.rules&lt;/p&gt;&lt;p&gt;You can look in the log file to see what went wrong:&lt;/p&gt;&lt;p&gt;/etc/apf/ad/apfados_log&lt;/p&gt;&lt;p&gt;And don&#039;t forget to restart apf:&lt;/p&gt;&lt;p&gt;apf -r&lt;/p&gt;&lt;p&gt;&lt;br /&gt;For more info on the settings, see the doc files at:&lt;br /&gt;&lt;a href=&quot;http://rfxnetworks.com/apf.php&quot;&gt;http://rfxnetworks.com/apf.php&lt;/a&gt;&lt;/p&gt;</description>
   <link>http://www.booservers.com/archivo/33_antidos_via_apf_firewall.html</link>
      <pubDate>Thu, 15 Dec 2005 21:30:45 +0000</pubDate>   
  </item>
    <item>
   <title>Banning over-aggressive web crawlers</title>
   <description>&lt;p&gt;Not all web crawlers obey robots.txt like they should&lt;/p&gt;&lt;p&gt;One in particular was getting on my nerves, the Inktomi Slurp crawler. Essentially, it would go to my site (&lt;a href=&quot;http://rpg-works.net&quot;&gt;http://rpg-works.net&lt;/a&gt;) and load ALL my clients sites in quick succession, bogging down my server to the point of becoming unresponsive. &lt;/p&gt;&lt;p&gt;So, for your benefit, here&#039;s my current ban list (I put this in rc.local)&lt;/p&gt;&lt;br/&gt;&lt;center&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-7209259988091090&quot;;
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = &quot;300x250_as&quot;;
google_ad_type = &quot;text_image&quot;;
google_ad_channel =&quot;3498328464&quot;;
google_color_border = &quot;FFFFFF&quot;;
google_color_bg = &quot;FFFFFF&quot;;
google_color_link = &quot;006633&quot;;
google_color_url = &quot;000000&quot;;
google_color_text = &quot;0033CC&quot;;
//--&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
  src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;&lt;/center&gt;&lt;br&gt;&lt;p&gt;# Ban Slurpy (Inktomi/Yahoo) NetBlock&lt;br /&gt;/sbin/iptables -A INPUT -s 66.196.64.0/18 -j DROP&lt;br /&gt;# Ban nameprotect.com&lt;br /&gt;/sbin/iptables -A INPUT -s 12.175.0.32/28 -j DROP&lt;br /&gt;# AskJeeves.Com&lt;br /&gt;/sbin/iptables -A INPUT -s 65.214.36.0/22 -j DROP&lt;br /&gt;# Alexa&lt;br /&gt;/sbin/iptables -A INPUT -s 209.237.238.0/24 -j DROP&lt;br /&gt;# Turnitin.com Bot&lt;br /&gt;/sbin/iptables -A INPUT -s 64.140.49.66 -j DROP&lt;br /&gt;# Cyveillance.com (RIAA enforcement)&lt;br /&gt;/sbin/iptables -A INPUT -s 63.148.99.224/27 -j DROP&lt;/p&gt;&lt;p&gt;Others here, such as nameprotect.com are &amp;quot;intellectual property&amp;quot; crawlers that basically check your site for compliance. Even though they use your bandwidth and resources, you get nothing in return (such as listing on a search engine), they&#039;re just looking for someone to sue on behalf of one of their clients.&lt;/p&gt;&lt;p&gt;If you&#039;re having problems with your server randomly becoming unresponsive, this is worth a shot.&lt;/p&gt;&lt;p&gt;How did I get these IPs?&lt;/p&gt;&lt;p&gt;Check your access logs for &amp;quot;robots.txt&amp;quot;, most bots at least attempt to look at the file. The enter those IPs into &lt;a href=&quot;http://arin.net&quot;&gt;http://arin.net&lt;/a&gt;&lt;br /&gt;for information on who they belong to, as well as the netblock you can ban if the bot is an extreme nuisance.&lt;/p&gt;</description>
   <link>http://www.booservers.com/archivo/24_banning_over-aggressive_web_crawlers.html</link>
      <pubDate>Thu, 15 Dec 2005 21:03:11 +0000</pubDate>   
  </item>
    <item>
   <title>Mount /tmp with noexec</title>
   <description>&lt;p&gt;What we are doing it creating a file that we will use to mount at /tmp.&lt;/p&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;div dir=&quot;ltr&quot; style=&quot;TEXT-ALIGN: left&quot;&gt;cd /dev&lt;/div&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;p&gt;Create 100MB file for our /tmp partition. If you need more space, make count size larger.&lt;/p&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;p&gt;dd if=/dev/zero of=tmpMnt bs=1024 count=100000&lt;/p&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;p&gt;Make an extended filesystem for our tmpMnt file&lt;/p&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;p&gt;mke2fs /dev/tmpMnt&lt;/p&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;br/&gt;&lt;center&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-7209259988091090&quot;;
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = &quot;300x250_as&quot;;
google_ad_type = &quot;text_image&quot;;
google_ad_channel =&quot;3498328464&quot;;
google_color_border = &quot;FFFFFF&quot;;
google_color_bg = &quot;FFFFFF&quot;;
google_color_link = &quot;006633&quot;;
google_color_url = &quot;000000&quot;;
google_color_text = &quot;0033CC&quot;;
//--&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
  src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;&lt;/center&gt;&lt;br&gt;&lt;p&gt;Backup your /tmp dir- I had mysql.sock file that I needed to recreate the symbolic link for. Other programs may use it to store cache files or whatever.&lt;/p&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;p&gt;cd /&lt;/p&gt;&lt;p&gt;cp -R /tmp /tmp_backup&lt;/p&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;p&gt;Mount the new /tmp filesystem with noexec&lt;/p&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;p&gt;mount -o loop,noexec,nosuid,rw /dev/tmpMnt /tmp&lt;/p&gt;&lt;div dir=&quot;ltr&quot; style=&quot;TEXT-ALIGN: left&quot;&gt;chmod 0777 /tmp&lt;/div&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;p&gt;Copy everything back to new /tmp and remove backup&lt;/p&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;div dir=&quot;ltr&quot; style=&quot;TEXT-ALIGN: left&quot;&gt;cp -R /tmp_backup/* /tmp/&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;TEXT-ALIGN: left&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;TEXT-ALIGN: left&quot;&gt;rm -rf /tmp_backup&lt;/div&gt;&lt;/div&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;p&gt;Now we need to add this to fstab so it mounts automatically on reboots.&lt;/p&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;p&gt;pico -w /etc/fstab&lt;/p&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;p&gt;You should see something like this:&lt;/p&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;p&gt;/dev/hda3               /                       ext3    defaults,usrquota        1 1&lt;br /&gt;/dev/hda1               /boot                   ext3    defaults        1 2&lt;br /&gt;none                    /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;none                    /proc                   proc    defaults        0 0&lt;br /&gt;none                    /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;/dev/hda2               swap                    swap    defaults        0 0&lt;/p&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;p&gt;At the bottom add&lt;/p&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;p&gt;/dev/tmpMnt             /tmp                    ext2    loop,noexec,nosuid,rw  0 0&lt;/p&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;p&gt;(Each space is a tab)&lt;/p&gt;&lt;p&gt;Ctrl + X and Y&lt;/p&gt;&lt;p&gt;Your done- /tmp is now mounted as noexec. You can sleep a little bit safer tonight. I created a hello world c++ and compiled it then moved it to /tmp. Upon trying to run it (even chmod +x&#039;ed), it gives the following error:&lt;/p&gt;&lt;p&gt;--------------&lt;/p&gt;&lt;p&gt;bash: ./a.out: Permission denied&lt;/p&gt;&lt;p&gt;--------------&lt;/p&gt;</description>
   <link>http://www.booservers.com/archivo/15_mount_tmp_with_noexec.html</link>
      <pubDate>Thu, 15 Dec 2005 20:20:01 +0000</pubDate>   
  </item>
    <item>
   <title>HOW-TO: Secure cPanel</title>
   <description>&lt;p&gt;First and foremost I want to say that this is not going to make your server 100% cracker proof, there is always a possibility that somebody will find a way in. I have listed a lot of things you can do to protect your server and that will help you secure it. While securing your server you have to find a median between what is secure and what restricts your clients or websites. You can easily make your server 100% secure from remote attacks by unplugging the ethernet cable, but chances are you will not get much good with it. This is not a complete guide and I will update it when I find time or it needs it. Overall it is a very good start and it is probably more then most servers have. &lt;/p&gt;&lt;p&gt;If you have any problems with the guide please post them and I will try and help/update the guide. I have not included everything you can do but it is a very good start. If you need somebody to secure server please feel free to private message or email me.&lt;/p&gt;&lt;p&gt;All commands meant to be run in ssh will begin with &amp;quot;#&amp;quot;&lt;/p&gt;&lt;br/&gt;&lt;center&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-7209259988091090&quot;;
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = &quot;300x250_as&quot;;
google_ad_type = &quot;text_image&quot;;
google_ad_channel =&quot;3498328464&quot;;
google_color_border = &quot;FFFFFF&quot;;
google_color_bg = &quot;FFFFFF&quot;;
google_color_link = &quot;006633&quot;;
google_color_url = &quot;000000&quot;;
google_color_text = &quot;0033CC&quot;;
//--&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
  src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;&lt;/center&gt;&lt;br&gt;&lt;p&gt;--------------------------&lt;/p&gt;&lt;p&gt;First step is to updated your software. Make sure up2date says you are fully updated:&lt;br /&gt;#up2date -u&lt;/p&gt;&lt;p&gt;Now update the kernel. Below I have posted the directions for a server using lilo as the bootloader. I will add in directions for grub later as I do not run grub on any of my servers. If you are using grub please skip this section and upgrade the kernel at another time.&lt;/p&gt;&lt;p&gt;#cd /var/spool/up2date&lt;/p&gt;&lt;p&gt;If you have a dual processor server: &lt;/p&gt;&lt;p&gt;#up2date --download --force kernel-smp &lt;br /&gt;#rpm -ivh kernel-smp-2.4.21-15.0.4.EL.i686.rpm &lt;br /&gt;#lilo -v -v &lt;br /&gt;#lilo -R 2.4.21-15.0.4.1&lt;br /&gt;#shutdown -r now&lt;/p&gt;&lt;p&gt;If you have a single processor server:&lt;br /&gt;#up2date --download --force kernel&lt;br /&gt;#rpm -ivh kernel-2.4.21-15.0.4.EL.i686.rpm &lt;br /&gt;#lilo -v -v &lt;br /&gt;#lilo -R 2.4.21-15.0.4.1E&lt;br /&gt;#shutdown -r now&lt;/p&gt;&lt;p&gt;&lt;br /&gt;When you run lilo -v -v make sure that no errors appear, if so you probably need to look at the lilo.conf for the problem.&lt;/p&gt;&lt;p&gt;The lilo -R command will make it reboot only once to the new kernel. If for some reason just put in a reboot TT and it will automatically boot to the old kernel. If it comes back up fine then you can edit the /etc/lilo.conf and set &amp;quot;default=&amp;quot; the new kernel label.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;--------------------------&lt;/p&gt;&lt;p&gt;&lt;br /&gt;A firewall should be the first thing installed.. I recommend advanced protection firewall (APF) by rfxnetworks. APF will block unused outgoing and incoming ports. It can also be configured to use information from some block lists. &lt;br /&gt;&lt;a href=&quot;http://rfxnetworks.net/apf.php&quot;&gt;http://rfxnetworks.net/apf.php&lt;/a&gt; &lt;br /&gt;#cd /usr/src&lt;br /&gt;#wget &lt;a href=&quot;http://rfxnetworks.net/downloads/apf-current.tar.gz&quot;&gt;http://rfxnetworks.net/downloads/apf-current.tar.gz&lt;/a&gt;&lt;br /&gt;#tar -zxf apf-current.tar.gz&lt;br /&gt;#cd apf-0.*&lt;br /&gt;#./install.sh&lt;/p&gt;&lt;p&gt;Now edit config file&lt;br /&gt;#pico -w /etc/apf/conf.apf&lt;/p&gt;&lt;p&gt;Change the following:&lt;br /&gt;USE_DS=&amp;quot;1&amp;quot; &lt;br /&gt;USE_AD=&amp;quot;1&amp;quot;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Scroll down to this section:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;# Common ingress (inbound) TCP ports IG_TCP_CPORTS=&amp;quot;20,21,22,25,26,53,80,110,143,443,465,993,995,2082, 2083,2086,2087,2095,2096&amp;quot;&lt;br /&gt;# Common ingress (inbound) UDP ports &lt;br /&gt;IG_UDP_CPORTS=&amp;quot;21,53,465,873&amp;quot;&lt;/p&gt;&lt;p&gt;# Common ICMP (inbound) types&lt;br /&gt;# &#039;internals/icmp.types&#039; for type definition; &#039;all&#039; is wildcard for any&lt;br /&gt;IG_ICMP_TYPES=&amp;quot;3,5,11,0,30,8&amp;quot;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Scroll down a bit then find this section:&lt;/p&gt;&lt;p&gt;EGF=&amp;quot;1&amp;quot;&lt;br /&gt;# Common egress (outbound) TCP ports EG_TCP_CPORTS=&amp;quot;21,22,25,26,27,37,43,53,80,110,113,443,465,873,208 9&amp;quot;&lt;br /&gt;# Common egress (outbound) UDP ports &lt;br /&gt;EG_UDP_CPORTS=&amp;quot;20,21,53,123,465,873&amp;quot;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Save the file and start apf via.&lt;br /&gt;apf -s&lt;br /&gt;If everything still works then edit the config file and turn dev mode off. &lt;br /&gt;DEVM=&amp;quot;0&amp;quot;&lt;/p&gt;&lt;p&gt;Now restart APF&lt;br /&gt;#apf -r&lt;/p&gt;&lt;p /&gt;&lt;p&gt;&lt;br /&gt;--------------------------&lt;/p&gt;&lt;p&gt;&lt;br /&gt;The following scripts are fairly easy to use and install, I might add documentation later but for now I will not.&lt;/p&gt;&lt;p&gt;Along with installing APF I would suggest installing brute force monitor (BFD) also by rfxnetworks. BFD will monitor your ssh and ftp services and automatically ban users that try to brute force a password. If you install BFD make sure you can get a separate ip to ssh into your server incase it blocks you for some reason! You can add your ip to the allow list via &amp;quot;apf -a IP&amp;quot; if you have a static ip. &lt;br /&gt;&lt;a href=&quot;http://rfxnetworks.net/bfd.php&quot;&gt;http://rfxnetworks.net/bfd.php&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Yet another very handy tool by rfxnetworks is socket monitor (PMON). This tool will alert you whenever a new port is opened on the server. This is very helpful in detecting any users running weird processes or attempting to run backdoors. When any program that it does not recognized is started it will email you with the information.&lt;br /&gt;&lt;a href=&quot;http://rfxnetworks.net/pmon.php&quot;&gt;http://rfxnetworks.net/pmon.php&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Another tool I would suggest, but that is not really part of securing your server, is system integrity monitor (SIM) which is also by rfxnetworks. SIM will automatically detect when a service is down and restarts it.&lt;br /&gt;&lt;a href=&quot;http://rfxnetworks.net/sim.php&quot;&gt;http://rfxnetworks.net/sim.php&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;I always recommend to turn off compilers. Most rootkits come precompiled but not all of them do. It will also prevent shell users from trying to compile any irc related programs. To turn the compilers on switch the off to on. &lt;br /&gt;/scripts/compilers off&lt;/p&gt;&lt;p&gt;&lt;br /&gt;--------------------------&lt;/p&gt;&lt;p&gt;&lt;br /&gt;mod_security&lt;/p&gt;&lt;p&gt;First we will download and unzip mod_security. This guide compiles for apache1.3.x which is what cPanel currently uses. &lt;br /&gt;#wget &lt;a href=&quot;http://www.modsecurity.org/download...ty-1.8.4.tar.gz&quot;&gt;http://www.modsecurity.org/download...ty-1.8.4.tar.gz&lt;/a&gt;&lt;br /&gt;#tar zxf mod_security-1.8.4.tar.gz&lt;br /&gt;#cd mod_security-1.8.4/apache1&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Next compile mod_security at a module:&lt;br /&gt;#/etc/httpd//bin/apxs -cia mod_security.c&lt;/p&gt;&lt;p&gt;Make a backup of your httpd.conf before touching anything so you have something to go back to if it does not work.&lt;br /&gt;#cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf-mod_sec&lt;/p&gt;&lt;p&gt;Now edit the httpd.conf&lt;br /&gt;pico -w /etc/httpd/conf/httpd.conf&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Scroll down below the following line:&lt;br /&gt;AddModule mod_security.c&lt;br /&gt;The rules listed in the text file below can just be pasted in. They are a collection of rules, many of them taken from snort, that block most of the common attacks while still letting normal requests by.&lt;br /&gt;&lt;a href=&quot;http://eth0.us/faq/modsec.txt&quot;&gt;http://eth0.us/faq/modsec.txt&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Create the error log file:&lt;br /&gt;#touch /var/log/httpd/audit_log&lt;/p&gt;&lt;p&gt;Restart apache&lt;br /&gt;#service httpd restart&lt;/p&gt;&lt;p&gt;If sites start to have problems look at error log. &lt;br /&gt;/var/log/httpd/audit_log&lt;/p&gt;&lt;p&gt;&lt;br /&gt;--------------------------&lt;/p&gt;&lt;p&gt;&lt;br /&gt;The /tmp partition is one the common places for script kiddies and crackers alike to place trojans or scripts. Because of that you should have the /tmp partition mounted noexec. First we need to check if your /tmp is secure. &lt;br /&gt;#df -h |grep tmp&lt;/p&gt;&lt;p&gt;If that displays nothing then go below to create a tmp partition. If you do have a tmp partition you need to see if it mounted with noexec. &lt;br /&gt;#cat /etc/fstab |grep tmp&lt;/p&gt;&lt;p&gt;If there is a line that includes /tmp and noexec then it is already mounted as non-executable. You will also want to check if /var/tmp is linked to /tmp.&lt;br /&gt;ls -alh /var/ |grep tmp&lt;/p&gt;&lt;p&gt;If it shows something to the effect of &amp;quot;tmp -&amp;gt; /tmp/&amp;quot; then you are ok. If not go ahead an remove the old /var/tmp and replace it with a sym link to /tmp.&lt;br /&gt;#rm -rf /var/tmp/&lt;br /&gt;#ln -s /tmp/ /var/&lt;/p&gt;&lt;p /&gt;&lt;p&gt;&lt;br /&gt;If you do not have any /tmp partition you will need to follow the directions below to create and mount a partition. &lt;/p&gt;&lt;p&gt;Create a 190Mb partition&lt;br /&gt;#cd /dev/; dd if=/dev/zero of=tmpMnt bs=1024 count=200000&lt;/p&gt;&lt;p&gt;Format the partion&lt;br /&gt;#mke2fs /dev/tmpMnt &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Make a backup of the old data&lt;br /&gt;#cp -Rp /tmp /tmp_backup&lt;/p&gt;&lt;p&gt;Mount the temp filesystem &lt;br /&gt;#mount -o loop,noexec,nosuid,rw /dev/tmpMnt /tmp &lt;/p&gt;&lt;p&gt;Set the permissions&lt;br /&gt;#chmod 0777 /tmp&lt;/p&gt;&lt;p&gt;Copy the old files back&lt;br /&gt;#cp -Rp /tmp_backup/* /tmp/&lt;/p&gt;&lt;p&gt;Once you do that go ahead and start mysql and make sure it works ok. If it does you can add this line to the bottom of the /etc/fstab to automatically have it mounted:&lt;br /&gt;/dev/tmpMnt /tmp ext2 loop,noexec,nosuid,rw 0 0&lt;/p&gt;&lt;p&gt;Next delete the old /var/tmp and create a link to /tmp&lt;br /&gt;#rm -rf /var/tmp/&lt;br /&gt;#ln -s /tmp/ /var/&lt;/p&gt;&lt;p&gt;If everything still works fine you can go ahead and delete the /tmp_backup directory. &lt;br /&gt;#rm -rf /tmp_backup&lt;/p&gt;&lt;p&gt;&lt;br /&gt;--------------------------&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Many php exploit scritps use common *nix tools to download rootkits or backdoors. By simply chmod&#039;ing the files so that no none-wheel or root user can use them we can eliminate many possible problems. The downside to doing this is that shell users will be inconvenienced by not being able to use the the commands below. Mod_security really removes the need to chmod this, but it is an added layer of protection.&lt;/p&gt;&lt;p&gt;#chmod 750 /usr/bin/rcp&lt;br /&gt;#chmod 750 /usr/bin/wget&lt;br /&gt;#chmod 750 /usr/bin/lynx&lt;br /&gt;#chmod 750 /usr/bin/links&lt;br /&gt;#chmod 750 /usr/bin/scp&lt;/p&gt;&lt;p /&gt;&lt;p&gt;--------------------------&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Now we will install rkhunter so we will atleast know if the server has been cracked.&lt;/p&gt;&lt;p&gt;Download and unzip rkhunter&lt;br /&gt;#cd /usr/local/src/&lt;br /&gt;#wget &lt;a href=&quot;http://downloads.rootkit.nl/rkhunter-1.1.4.tar.gz&quot;&gt;http://downloads.rootkit.nl/rkhunter-1.1.4.tar.gz&lt;/a&gt;&lt;br /&gt;#tar -zxf rkhunter-1.1.4.tar.gz &lt;br /&gt;#cd rkhunter&lt;/p&gt;&lt;p&gt;Install it&lt;br /&gt;#./install.sh&lt;/p&gt;&lt;p&gt;Now create a cronjob so it will email you with notifications to the root mailbox:&lt;br /&gt;#crontab -e&lt;/p&gt;&lt;p&gt;At the bottom add the following line&lt;br /&gt;16 0 * * * /usr/local/bin/rkhunter -c --nocolors --cronjob --report-mode --createlogfile --skip-keypress --quiet&lt;/p&gt;&lt;p&gt;Press control x to save&lt;/p&gt;&lt;p&gt;&lt;br /&gt;--------------------------&lt;/p&gt;&lt;p&gt;Credits: John W - &lt;a href=&quot;http://www.eth0.us/&quot; target=&quot;_blank&quot;&gt;Security and general linux how-to&#039;s&lt;/a&gt;&lt;/p&gt;</description>
   <link>http://www.booservers.com/archivo/7_how-to_secure_cpanel.html</link>
      <pubDate>Wed, 30 Nov 2005 21:43:35 +0000</pubDate>   
  </item>
  </rdf:RDF>
