<?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>SecureSlash.com &#187; Server Administration</title>
	<atom:link href="http://secureslash.com/category/server-administration/feed/" rel="self" type="application/rss+xml" />
	<link>http://secureslash.com</link>
	<description>Because security matters</description>
	<lastBuildDate>Fri, 20 Jan 2012 10:58:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Simple Linux Server Security Tips</title>
		<link>http://secureslash.com/system-security/simple-linux-server-security-tips/</link>
		<comments>http://secureslash.com/system-security/simple-linux-server-security-tips/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 15:31:10 +0000</pubDate>
		<dc:creator>KarthiKeyan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking & Security]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[System Security]]></category>
		<category><![CDATA[Web Administration]]></category>
		<category><![CDATA[basic level server security]]></category>
		<category><![CDATA[basic linux server security]]></category>
		<category><![CDATA[linux server security tips]]></category>

		<guid isPermaLink="false">http://secureslash.com/?p=185</guid>
		<description><![CDATA[Tweet Linux is one of the secured operating system. However, With the world of crackers (Evil minded Geeks &#38; Hackers) Linux is also not so secure as we think. Step 1: How to secure SSH port in Linux server? Gaining SSH root access is the primary goal of every crackers around. Once they could get [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsecureslash.com%2Fsystem-security%2Fsimple-linux-server-security-tips%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://secureslash.com/system-security/simple-linux-server-security-tips/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://secureslash.com/system-security/simple-linux-server-security-tips/"  data-text="Simple Linux Server Security Tips" data-count="horizontal">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://secureslash.com/system-security/simple-linux-server-security-tips/" data-counter="right"></script></div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://secureslash.com/system-security/simple-linux-server-security-tips/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>Linux is one of the secured operating system. However, With the world of crackers (Evil minded Geeks &amp; Hackers) Linux is also not so secure as we think.</p>
<p><span style="text-decoration: underline;"><strong>Step 1: How to secure SSH port in Linux server?</strong></span></p>
<p>Gaining SSH root access is the primary goal of every crackers around. Once they could get root access., They will install rookkits, keyloggers, mail bombs and etc. So, They usually try to gain access to your server using some formal password combinations.  They attempt to login to your server using bruteforce method.</p>
<p>SSH always runs on port number 22</p>
<p>You have to change it to some non-default number like., 2323 or 3009  some number that is hard to guess.</p>
<blockquote><p><tt>/etc/ssh/sshd_config</tt></p></blockquote>
<p>above file is the default ssh configuration file. You can change its &#8220;Port&#8221; value by opening it using Vi or Nano.  <a href="http://wiki.centos.org/HowTos/Network/SecuringSSH#head-3579222198adaf43a3ecbdc438ebce74da40d8ec" target="_blank">CentOS Documentation</a> has clear information about how to change linux server ssh port to a non-standard number. This instructions applies for any redhat kernel based distro.</p>
<p><strong><span style="text-decoration: underline;">Step 2: Always check your /tmp folder</span></strong></p>
<p>It is like., Checking your trash can of your bedroom for any hidden cams. Yes., Some crackers upload a *.php  *.py *.sh files to your server&#8217;s /tmp file and let them to become a primary spamming bot in your server.  You have to always try to find if there are any suspicious file around there in /tmp and delete them.  Usually deleting the file wont pay off. You have to find the source loop hole that allows such file in /tmp . You have to audit your web applications that allows file-uploads and anonymous FTP uploads to your server.</p>
<p><span style="text-decoration: underline;"><strong>Step 3: Disable Anonymous FTP Service</strong></span></p>
<p>Enabling anonymous FTP service is most like., Inviting robbers by opening your house window.</p>
<p>&nbsp;</p>
<blockquote><p>/etc/proftpd.conf</p>
<p>/etc/vsftpdvsftpd.conf</p></blockquote>
<p>Simply disable anonymous FTP.</p>
<p><span style="text-decoration: underline;"><strong>Step 3:  Always use SFTP and completely stop using FTP</strong></span></p>
<p>SFTP is more secure than you think. Most windows based ftp clients such as filezilla, smartftp &amp; coreftp could be affected by many malwares and it will upload &#8220;Trojan Horse JavaScript&#8221; code to your website files. I personally got affected my many javascript trojans because of virus infected ftp client transfers.  This<a href="http://wiki.vpslink.com/Configuring_vsftpd_for_secure_connections_%28TLS/SSL/SFTP%29#Install_vsftpd" target="_blank"> wiki page</a> has clear &amp; simple information about how to install SFTP</p>
<p><span style="text-decoration: underline;"><strong>Step 4:  How to disable direct file or image hotlinking?</strong></span></p>
<p>Lets say you have a cool picture file in your website. http://mywebsite.com/images/picture.jpg  . If  a guy puts your file in his website and lets say his website has thousands of visitors per day., Then, You will be endup paying money for your excessive bandwidth. Disabling hotlink is like., Saving money in your server bandwidth. This is one of the best tool that lets your to <a href="http://www.htaccesstools.com/hotlink-protection/" target="_blank">generate .htaccess code for hotlink protection</a>.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://secureslash.com/system-security/simple-linux-server-security-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add SPF &amp; Domain Keys in a Server</title>
		<link>http://secureslash.com/server-administration/how-to-add-spf-domain-keys-in-a-server/</link>
		<comments>http://secureslash.com/server-administration/how-to-add-spf-domain-keys-in-a-server/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 12:40:10 +0000</pubDate>
		<dc:creator>Sugan</dc:creator>
				<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[command to check spf record]]></category>
		<category><![CDATA[command to check spf record.how to add domain key]]></category>
		<category><![CDATA[how to add domain key in linux server]]></category>
		<category><![CDATA[how to add spf record]]></category>
		<category><![CDATA[how to setup spf and domain key.syntax of domain keys]]></category>

		<guid isPermaLink="false">http://secureslash.com/?p=166</guid>
		<description><![CDATA[Tweet Hi, Using the below steps you can add SPF record on a linux server running WHM control panel For example: Domain name: www.secureslash.com Username: secure Command to add SPF record for a domain name: # /usr/local/cpanel/bin/domain_keys_installer secure once done restart the dns service (/etc/init.d/httpd restart) Steps to enable SPF record in Cpanel 1.Login into [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsecureslash.com%2Fserver-administration%2Fhow-to-add-spf-domain-keys-in-a-server%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://secureslash.com/server-administration/how-to-add-spf-domain-keys-in-a-server/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://secureslash.com/server-administration/how-to-add-spf-domain-keys-in-a-server/"  data-text="How to add SPF &#038; Domain Keys in a Server" data-count="horizontal">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://secureslash.com/server-administration/how-to-add-spf-domain-keys-in-a-server/" data-counter="right"></script></div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://secureslash.com/server-administration/how-to-add-spf-domain-keys-in-a-server/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>Hi,</p>
<p>Using the below steps you can add SPF record on a linux server running WHM control panel</p>
<p><strong>For example:</strong><br />
<strong>Domain name:</strong> www.secureslash.com<br />
<strong>Username:</strong> secure</p>
<p><strong>Command to add SPF record for a domain name:</strong></p>
<p># /usr/local/cpanel/bin/domain_keys_installer secure</p>
<p>once done restart the dns service (/etc/init.d/httpd restart)</p>
<p><strong>Steps to enable SPF record in Cpanel</strong></p>
<p>1.Login into Cpanel</p>
<p>2.Under Mail Menu Click &#8221; E-Mail Authentication&#8221;</p>
<p>3.Click on enable under &#8221; SPF&#8221;</p>
<p><strong>Command to  check SPF record for a domain </strong></p>
<p># host -t txt secureslash.com</p>
<p><strong>Command to add Domain keys for a domain name:</strong></p>
<p><strong>#</strong>/usr/local/cpanel/bin/domain_keys_installer secure</p>
<p>once done restart the exim service (service exim restart)</p>
<p><strong>Steps to enable Domain keys in Cpanel</strong></p>
<p>1.Login into Cpanel</p>
<p>2.Under Mail Menu Click &#8221; E-Mail Authentication&#8221;</p>
<p>3.Click on enable under &#8221; Domain Keys&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://secureslash.com/server-administration/how-to-add-spf-domain-keys-in-a-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Trojan Virus Everywhere and How to fix it</title>
		<link>http://secureslash.com/uncategorized/javascript-trojan-virus-everywhere-and-how-to-fix-it/</link>
		<comments>http://secureslash.com/uncategorized/javascript-trojan-virus-everywhere-and-how-to-fix-it/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 12:54:28 +0000</pubDate>
		<dc:creator>paimpozhil</dc:creator>
				<category><![CDATA[Computer Users]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security Tools]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[System Security]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Website Security]]></category>
		<category><![CDATA[Javascript Trojan]]></category>
		<category><![CDATA[Javascript Trojan virus deletion fix]]></category>
		<category><![CDATA[Latest Virus 2008]]></category>

		<guid isPermaLink="false">http://secureslash.com/uncategorized/javascript-trojan-virus-everywhere-and-how-to-fix-it/</guid>
		<description><![CDATA[Tweet Its getting hit by Trojan virus: Read the News about Thousands of infected websites. A lot of sites are now being attacked with JavaScript Trojans the server is not attacked by virus , this happens to both Linux and windows server sites. so it is doesnt look like a server based attack How this [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsecureslash.com%2Funcategorized%2Fjavascript-trojan-virus-everywhere-and-how-to-fix-it%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://secureslash.com/uncategorized/javascript-trojan-virus-everywhere-and-how-to-fix-it/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://secureslash.com/uncategorized/javascript-trojan-virus-everywhere-and-how-to-fix-it/"  data-text="Javascript Trojan Virus Everywhere and How to fix it" data-count="horizontal">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://secureslash.com/uncategorized/javascript-trojan-virus-everywhere-and-how-to-fix-it/" data-counter="right"></script></div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://secureslash.com/uncategorized/javascript-trojan-virus-everywhere-and-how-to-fix-it/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p><strong>Its getting hit by Trojan virus:</strong></p>
<p>Read the News about <a href="http://www.onestopclick.com/news/Thousands-of-websites-now-infected-with-Trojan_18435798.html" target="_blank">Thousands of infected websites</a>.</p>
<p>A lot of sites are now being attacked with <strong>JavaScript Trojans</strong></p>
<p>the server is not attacked by virus , this <strong>happens to both Linux and windows server</strong> sites.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-1553934370392546";
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = "300x250_as";
google_ad_type = "text";
//2007-08-15: SecureSlash - SideBox
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "2f63b3";
google_color_text = "000000";
google_color_url = "CCCCCC";

//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
so it is doesnt look like a server based attack</p>
<p><strong>How this happens?</strong></p>
<p>when the computer from where you upload data thru FTP/fp is infected , it injects some JavaScript to all html files.</p>
<p>so how you can prevent this happening is keep your pc up2date by having recent antivirus,antispyware and then change your ftp logins.</p>
<p>If there is a Repeating same pattern of JavaScript on 100s of your files you have a shell script for Linux server users that can remove these injected javascript .</p>
<p>so you can request your host or you yourself can run this on your shell</p>
<pre></pre>
<blockquote><p>find ./ -type f -exec sed -i &#8216;/unescape/d&#8217; {} \;</p></blockquote>
<p>this command will remove all the lines with pattern &#8216;unescape&#8217;</p>
<p>some virus has lines of function <strong>okban</strong>, in that case you can try pattern <strong>&#8216;okban&#8217;</strong></p>
<p>it depends on your need.</p>
<p>you can do the same with a software called <strong>GrepWin</strong> for replacing/searching PERL Regular Expression patterns on your files</p>
<p><a href="http://tools.tortoisesvn.net/grepWin" title="http://tools.tortoisesvn.net/grepWin">http://tools.tortoisesvn.net/grepWin</a></p>
<p>use it to search for patterns and replace with null or use the options to delete those lines</p>
<p>this can be either used on a windows server or client side (but then you have to upload all modified files again )</p>
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://secureslash.com/uncategorized/javascript-trojan-virus-everywhere-and-how-to-fix-it/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Finding binary/executabe paths on linux/unix</title>
		<link>http://secureslash.com/server-administration/finding-binary-executabe-paths-on-linux-unix/</link>
		<comments>http://secureslash.com/server-administration/finding-binary-executabe-paths-on-linux-unix/#comments</comments>
		<pubDate>Sun, 30 Dec 2007 07:14:39 +0000</pubDate>
		<dc:creator>paimpozhil</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server Administration]]></category>

		<guid isPermaLink="false">http://secureslash.com/server-administration/finding-binary-executabe-paths-on-linux-unix/</guid>
		<description><![CDATA[Tweet Many scripts and softwares may ask you a path for another tool, For its main or additional functionality For example: many php scripts will ask you path to imagemagic, GD Library like path to convert utility. You can use tool like which , whereis which [command or binary name] man which whereis [command or [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsecureslash.com%2Fserver-administration%2Ffinding-binary-executabe-paths-on-linux-unix%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://secureslash.com/server-administration/finding-binary-executabe-paths-on-linux-unix/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://secureslash.com/server-administration/finding-binary-executabe-paths-on-linux-unix/"  data-text="Finding binary/executabe paths on linux/unix" data-count="horizontal">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://secureslash.com/server-administration/finding-binary-executabe-paths-on-linux-unix/" data-counter="right"></script></div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://secureslash.com/server-administration/finding-binary-executabe-paths-on-linux-unix/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>Many scripts and softwares may ask you a path for another tool, For its main or additional functionality</p>
<p><strong>For example:</strong> many php scripts will ask you path to imagemagic, GD Library like path to convert utility.</p>
<p>You can use tool like which , whereis<br />
<script type="text/javascript"><!--
google_ad_client = "pub-1553934370392546";
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = "300x250_as";
google_ad_type = "text";
//2007-08-15: SecureSlash - SideBox
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "2f63b3";
google_color_text = "000000";
google_color_url = "CCCCCC";

//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
<code>which [command or binary name]</code><br />
<a href="http://www.ss64.com/bash/which.html">man which</a></p>
<p><code>whereis [command or binary name]</code><br />
<a href="http://www.ss64.com/bash/whereis.html">man whereis</a><br />
<strong>Example</strong></p>
<p><code>which php</code><br />
<code>whereis php</code><br />
<code>which convert</code><br />
<code>whereis convert</code></p>
<p>and whereis will show more information than which command</p>
]]></content:encoded>
			<wfw:commentRss>http://secureslash.com/server-administration/finding-binary-executabe-paths-on-linux-unix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Program terminating without any error message</title>
		<link>http://secureslash.com/server-administration/program-terminating-without-any-error-message/</link>
		<comments>http://secureslash.com/server-administration/program-terminating-without-any-error-message/#comments</comments>
		<pubDate>Tue, 25 Dec 2007 11:21:18 +0000</pubDate>
		<dc:creator>paimpozhil</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server Administration]]></category>

		<guid isPermaLink="false">http://secureslash.com/server-administration/program-terminating-without-any-error-message/</guid>
		<description><![CDATA[Tweet In some situations a program could terminate without even showing an error message. In such cases, the best tool to use and check the problem is strace If you dont have it pre-installed, then install it by yum, or using rpms Yum Command to install strace yum install strace This command will install in [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsecureslash.com%2Fserver-administration%2Fprogram-terminating-without-any-error-message%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://secureslash.com/server-administration/program-terminating-without-any-error-message/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://secureslash.com/server-administration/program-terminating-without-any-error-message/"  data-text="Program terminating without any error message" data-count="horizontal">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://secureslash.com/server-administration/program-terminating-without-any-error-message/" data-counter="right"></script></div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://secureslash.com/server-administration/program-terminating-without-any-error-message/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>In some situations a program could terminate without even showing an error message. In such cases, the best tool to use and check the problem is </p>
<h3>strace</h3>
<p>If you dont have it pre-installed, then install it by yum, or using rpms</p>
<p><strong>Yum Command to install strace</strong><br />
<code>yum install strace</code></p>
<p>This command will install in most redhat based distros.<br />
<!--adsense--><br />
<strong>Install strace using RPM</strong><br />
<code>wget ftp://rpmfind.net/linux/fedora/core/development/i386/os/Fedora/strace-4.5.15-1.fc7.i386.rpm</code></p>
<h2>How to use strace command?</h2>
<p><code>strace [command that crashes here]</code></p>
<p>For getting help,</p>
<p># <code>strace --help</code></p>
<p>usage: strace [-dffhiqrtttTvVxx] [-a column] [-e expr] &#8230; [-o file]<br />
              [-p pid] &#8230; [-s strsize] [-u username] [-E var=val] &#8230;<br />
              [command [arg ...]]<br />
   or: strace -c [-e expr] &#8230; [-O overhead] [-S sortby] [-E var=val] &#8230;<br />
              [command [arg ...]]<br />
-c &#8212; count time, calls, and errors for each syscall and report summary<br />
-f &#8212; follow forks, -ff &#8212; with output into separate files<br />
-F &#8212; attempt to follow vforks, -h &#8212; print help message<br />
-i &#8212; print instruction pointer at time of syscall<br />
-q &#8212; suppress messages about attaching, detaching, etc.<br />
-r &#8212; print relative timestamp, -t &#8212; absolute timestamp, -tt &#8212; with usecs<br />
-T &#8212; print time spent in each syscall, -V &#8212; print version<br />
-v &#8212; verbose mode: print unabbreviated argv, stat, termio[s], etc. args<br />
-x &#8212; print non-ascii strings in hex, -xx &#8212; print all strings in hex<br />
-a column &#8212; alignment COLUMN for printing syscall results (default 40)<br />
-e expr &#8212; a qualifying expression: option=[!]all or<br />
option=[!]val1[,val2]&#8230;<br />
   options: trace, abbrev, verbose, raw, signal, read, or write<br />
-o file &#8212; send trace output to FILE instead of stderr<br />
-O overhead &#8212; set overhead for tracing syscalls to OVERHEAD usecs<br />
-p pid &#8212; trace process with process id PID, may be repeated<br />
-s strsize &#8212; limit length of print strings to STRSIZE chars (default 32)<br />
-S sortby &#8212; sort syscall counts by: time, calls, name, nothing (default<br />
time)<br />
-u username &#8212; run command as username handling setuid and/or setgid<br />
-E var=val &#8212; put var=val in the environment for command<br />
-E var &#8212; remove var from the environment for command</p>
<p>In rare cases , the command may be a script , And it might internally call other command or program and then it could get mixed up somewhere. So, Simple strace might not help much in this situation.</p>
<p>In those cases</p>
<p><code>strace -f [command]</code><br />
will help</p>
<p>It will follow the forks and show detailed strace output for even the internal calls,etc.</p>
<p>you can suppress some unwanted info (for sys admins) like attaching &#038; detaching by using,</p>
<p><code>strace -q -f [command]</code></p>
<p>Advanced programmers might look for this as well.</p>
<p>Go through man pages of strace and know more options.<br />
<a href="http://www.netadmintools.com/html/1strace.man.html">man strace</a></p>
]]></content:encoded>
			<wfw:commentRss>http://secureslash.com/server-administration/program-terminating-without-any-error-message/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Port is blocked by some program</title>
		<link>http://secureslash.com/apache/port-is-blocked-by-some-program/</link>
		<comments>http://secureslash.com/apache/port-is-blocked-by-some-program/#comments</comments>
		<pubDate>Tue, 25 Dec 2007 05:30:20 +0000</pubDate>
		<dc:creator>paimpozhil</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server Administration]]></category>

		<guid isPermaLink="false">http://secureslash.com/apache/port-is-blocked-by-some-program/</guid>
		<description><![CDATA[Tweet Port access related problems will occur, During the fresh installation or reinstallation of programs such as Apache/MySQL. When you are starting a service in linux/unix and it says Address already in use or similar error.. It is common in Apache and solution is, Case 1: You dont know which service is blocking that port [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsecureslash.com%2Fapache%2Fport-is-blocked-by-some-program%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://secureslash.com/apache/port-is-blocked-by-some-program/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://secureslash.com/apache/port-is-blocked-by-some-program/"  data-text="Port is blocked by some program" data-count="horizontal">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://secureslash.com/apache/port-is-blocked-by-some-program/" data-counter="right"></script></div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://secureslash.com/apache/port-is-blocked-by-some-program/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>Port access related problems will occur, During the fresh installation or reinstallation of programs such as Apache/MySQL. When you are starting a service in linux/unix and it says  Address already in use or similar error..</p>
<p>It is common in Apache and solution is,<br />
 <!--adsense--><br />
<strong>Case 1:</strong> You dont know which service is blocking that port<br />
in this case.</p>
<p><code>fuser -k [portnumber]/[protocol]</code></p>
<p><strong>Examples:</strong></p>
<p><code>fuser -k 80/tcp</code><br />
<code>fuser -k 443/tcp</code><br />
<code>fuser -k 576/udp<br />
</code><br />
<a href="http://nixdoc.net/man-pages/Linux/fuser.1.html">fuser man page</a></p>
<p><strong>Case 2:</strong> You know the name of program.</p>
<p><code>killall -9 programname</code></p>
<p><strong>Examples</strong></p>
<p><code>killall -9 httpd</code></p>
<p><code>killall -9 exim</code></p>
<p>once done.. restart the service now and remember this to handle port<br />
blocks with  &#8220;Ease in breadth&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://secureslash.com/apache/port-is-blocked-by-some-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to completely redirect a subdomain to a domain</title>
		<link>http://secureslash.com/apache/how-to-completely-redirect-a-subdomain-to-a-domain/</link>
		<comments>http://secureslash.com/apache/how-to-completely-redirect-a-subdomain-to-a-domain/#comments</comments>
		<pubDate>Thu, 20 Dec 2007 14:31:20 +0000</pubDate>
		<dc:creator>KarthiKeyan</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[Web Administration]]></category>
		<category><![CDATA[Website Security]]></category>

		<guid isPermaLink="false">http://secureslash.com/website-security/how-to-completely-redirect-a-subdomain-to-a-domain/</guid>
		<description><![CDATA[Tweet Write a simple .htaccess file to redirect your subdomain to a domain. This .htaccess will redirect all dead subdomains to a domain name. Ex: It will redirect http://dead.domainname.com to http://IamMRabc.com. ############################# ############################# ####Subdomain to Domain redirection### ####From SecureSlash.com########## RewriteEngine On RewriteCond %{HTTP_HOST} dead\.domainname\.com ############Place your subdomain info### RewriteRule ^(.*) http://IamMrAbc.com$1 ############Place the destination domain [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsecureslash.com%2Fapache%2Fhow-to-completely-redirect-a-subdomain-to-a-domain%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://secureslash.com/apache/how-to-completely-redirect-a-subdomain-to-a-domain/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://secureslash.com/apache/how-to-completely-redirect-a-subdomain-to-a-domain/"  data-text="How to completely redirect a subdomain to a domain" data-count="horizontal">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://secureslash.com/apache/how-to-completely-redirect-a-subdomain-to-a-domain/" data-counter="right"></script></div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://secureslash.com/apache/how-to-completely-redirect-a-subdomain-to-a-domain/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>Write a simple .htaccess file to redirect your subdomain to a domain. This .htaccess will redirect all dead subdomains to a domain name. Ex: It will redirect http://dead.domainname.com to http://IamMRabc.com.</p>
<p><!--adsense--></p>
<p>#############################<br />
#############################<br />
####Subdomain to Domain redirection###<br />
####From SecureSlash.com##########<br />
RewriteEngine On<br />
RewriteCond %{HTTP_HOST} dead\.domainname\.com<br />
############Place your subdomain info###<br />
RewriteRule ^(.*) http://IamMrAbc.com$1<br />
############Place the destination domain<br />
############################<br />
############################</p>
<p>Save above code as .htaccess and place it under your subdomain folder,<br />
Ex: /subdomains/dead/.htaccess<br />
/public_html/dead/.htaccess</p>
<p>It depends upon server&#8217;s directory structure. </p>
<p><!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://secureslash.com/apache/how-to-completely-redirect-a-subdomain-to-a-domain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>chrooting Apache</title>
		<link>http://secureslash.com/system-security/chrooting-apache/</link>
		<comments>http://secureslash.com/system-security/chrooting-apache/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 13:19:56 +0000</pubDate>
		<dc:creator>KarthiKeyan</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[System Security]]></category>

		<guid isPermaLink="false">http://secureslash.com/apache/chrooting-apache/</guid>
		<description><![CDATA[Tweet Installing Apache binary There are no special steps needed to build the Apache binary in order to install it in a chroot jail. The following steps apply equally to a precompiled binary (such as an RPM) or one you have compiled yourself. Starting with a working binary helps with debugging later, if necessary. Just [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsecureslash.com%2Fsystem-security%2Fchrooting-apache%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://secureslash.com/system-security/chrooting-apache/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://secureslash.com/system-security/chrooting-apache/"  data-text="chrooting Apache" data-count="horizontal">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://secureslash.com/system-security/chrooting-apache/" data-counter="right"></script></div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://secureslash.com/system-security/chrooting-apache/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p><strong>Installing Apache binary</strong><br />
There are no special steps needed to build the Apache binary in order to install it in a chroot jail. The following steps apply equally to a precompiled binary (such as an RPM) or one you have compiled yourself. Starting with a working binary helps with debugging later, if necessary. Just make sure that you are using the latest patched version of the server, install Apache normally, and ensure that it is working as expected.<br />
<!--adsense--><br />
Finally, make sure you configure Apache to run with its own user and group IDs. Create a user and group with the commands:</p>
<p><span class="code"># groupadd apache<br />
# useradd -c &#8220;Apache Server&#8221; -d /dev/null -g apache -s  /bin/false apache </span><br />
These commands create the regular user apache and the apache group. Apache runs as nobody by default. User nobody may be used by many processes, and if it is compromised an intruder will gain access to all processes on your system running under that UID.<br />
<strong>Creating the chroot tree</strong><br />
Our chroot jail is a mini-version of the Linux filesystem. I prefer to use a seperate partition mounted as /chroot, with Apache under a directory named httpd on my chroot partition.</p>
<p align="justify">&nbsp;</p>
<pre class="code"># mkdir /chroot/httpd</pre>
<pre class="code"># mkdir /chroot/httpd/dev</pre>
<pre class="code"># mkdir /chroot/httpd/lib</pre>
<pre class="code"># mkdir /chroot/httpd/etc</pre>
<pre class="code"># mkdir -p /chroot/httpd/usr/sbin</pre>
<pre class="code"># mkdir /chroot/httpd/usr/lib</pre>
<pre class="code"># mkdir /chroot/httpd/usr/libexec</pre>
<pre class="code"># mkdir -p /chroot/httpd/var/run</pre>
<pre class="code"># mkdir -p /chroot/httpd/var/log/apache</pre>
<pre class="code"># mkdir -p /chroot/httpd/home/httpd</pre>
<p align="justify">Now set the permissions on your directory structure:</p>
<p align="justify">&nbsp;</p>
<pre class="code"># chown -R root /chroot/httpd</pre>
<pre class="code"># chmod -R 0755 /chroot/httpd</pre>
<pre class="code"># chmod 750 /chroot/httpd/var/log/apache/</pre>
<p align="justify">Your exact structure may vary slightly depending upon what features of Apache you are using and where the nescessary libraries live on your main file system.<br />
Once you have created the nescessary directories you need to create the null device.</p>
<p align="justify">&nbsp;</p>
<pre class="code"># mknod  /chroot/httpd/dev/null c 1 3</pre>
<pre class="code"># chown root.sys /chroot/httpd/dev/null</pre>
<pre class="code"># chmod 666 /chroot/httpd/dev/null</pre>
<p align="justify">You need the null device and /chroot/httpd/var/log/httpd/ because, when run in chroot jail, Apache sees the /chroot/httpd directory as the equivalent of /. This means that it cannot access /dev/null or /var/log on the normal filesystem.<br />
<strong>Copying the nescessary files</strong><br />
Now shut down Apache, run killall httpd, and you&#8217;re ready to start copying across the necessary files. Note that some directory names may be different in your case depending upon how you originally installed Apache. First, copy your configuration files:<br />
<span class="code"># cp -r /etc/apache /chroot/httpd/etc/ </span><br />
Next, copy your Apache DocumentRoot and CGI scripts:<br />
<span class="code"># cp -r /home/httpd/html  /chroot/httpd/home/httpd/<br />
# cp -r /home/httpd/cgi-bin /chroot/httpd/home/httpd/ </span><br />
Now copy your httpd binary (and, if you use them, the Apache scripts) from /usr/sbin:<br />
<span class="code"># cp /usr/sbin/httpd /chroot/usr/sbin/<br />
# cp /usr/sbin/apache* /chroot/usr/sbin/ </span><br />
If you use mod_ssl you need to copy the /etc/ssl  directory and its contents too:<br />
<span class="code"># cp -a /etc/ssl /chroot/httpd/etc/ </span><br />
You should also copy any modules from your original install:<br />
<span class="code">cp -r /usr/libexec/apache  /chroot/httpd/usr/libexec/ </span><br />
Once you have copied Apache itself (and ssl if needed) you need to copy all of the shared libraries Apache relies on to run. To find out which libraries you need, execute # ldd /chroot/httpd/usr/sbin/httpd. This should give output something like:</p>
<p align="justify">&nbsp;</p>
<pre class="code">/lib/libsafe.so.2 =&gt; /lib/libsafe.so.2 (0x40017000)</pre>
<pre class="code">libm.so.6 =&gt; /lib/libm.so.6 (0x40037000)</pre>
<pre class="code">libcrypt.so.1 =&gt; /lib/libcrypt.so.1 (0x40059000)</pre>
<pre class="code">libdb.so.2 =&gt; /lib/libdb.so.2 (0x40086000)</pre>
<pre class="code">libexpat.so.0 =&gt; /usr/lib/libexpat.so.0 (0x40096000)</pre>
<pre class="code">libdl.so.2 =&gt; /lib/libdl.so.2 (0x400b6000)</pre>
<pre class="code">libc.so.6 =&gt; /lib/libc.so.6 (0x400b9000)</pre>
<pre class="code">/lib/ld-linux.so.2 =&gt; /lib/ld-linux.so.2 (0x40000000)</pre>
<p align="justify">The exact output will depend upon how your httpd binary was built in the first place. Copy the required files to their respective directories in your chroot:</p>
<p align="justify">&nbsp;</p>
<pre class="code"># cp /lib/libsafe* /chroot/httpd/lib/</pre>
<pre class="code"># cp /lib/libm* /chroot/httpd/lib/</pre>
<pre class="code"># cp /lib/libcrypt* /chroot/httpd/lib/</pre>
<pre class="code"># cp /lib/libdb* /chroot/httpd/lib/</pre>
<pre class="code"># cp /usr/lib/libexpat* /chroot/httpd/usr/lib/</pre>
<pre class="code"># cp /lib/libdl* /chroot/httpd/lib/</pre>
<pre class="code"># cp /lib/libc* /chroot/httpd/lib/</pre>
<pre class="code"># cp /lib/ld-* /chroot/httpd/lib/</pre>
<p align="justify">You need certain libraries for some standard networking functionality:</p>
<p align="justify">&nbsp;</p>
<pre class="code"># cp /lib/libnss_compat* /chroot/httpd/lib/</pre>
<pre class="code"># cp /lib/libnss_dns* /chroot/httpd/lib/</pre>
<pre class="code"># cp /lib/libnss_files* /chroot/httpd/lib/</pre>
<pre class="code"># cp /lib/libnsl* /chroot/httpd/lib/</pre>
<p align="justify"><strong>The /chroot/httpd/etc configuration files</strong><br />
For Apache to function properly you also need several configuration files from /etc. First, edit the /etc/passwd and /etc/group files. These should contain only entries for the Apache user and group you created earlier. For example:</p>
<p align="justify">&nbsp;</p>
<pre class="code">/etc/passwd:</pre>
<pre class="code">apache:x:12347:12348:Apache Server:/dev/null:/bin/false</pre>
<pre class="code">/etc/group:</pre>
<pre class="code">apache:x:12347:</pre>
<p align="justify">You also need several network configuration files:</p>
<p align="justify">&nbsp;</p>
<pre class="code"># cp /etc/hosts /chroot/httpd/etc/</pre>
<pre class="code"># cp /etc/host.conf /chroot/httpd/etc/</pre>
<pre class="code"># cp /etc/resolv.conf /chroot/httpd/etc/</pre>
<pre class="code"># cp /etc/nsswitch.conf /chroot/httpd/etc/</pre>
<p align="justify">For extra security you can set the immutable bit on these configuration files. When the immutable bit is set, root has to specifically unset it before a file can be modified, making it much harder for an intruder to tamper with the files:</p>
<p align="justify">&nbsp;</p>
<pre class="code"># chattr +i /chroot/httpd/etc/hosts</pre>
<pre class="code"># chattr +i /chroot/httpd/etc/host.conf</pre>
<pre class="code"># chattr +i /chroot/httpd/etc/resolv.conf</pre>
<pre class="code"># chattr +i /chroot/httpd/etc/nsswitch.conf</pre>
<pre class="code"># chattr +i /chroot/httpd/etc/passwd</pre>
<pre class="code"># chattr +i /chroot/httpd/etc/group</pre>
<p align="justify">In order that the log files be written with the correct time, you need to check /etc/localtime. localtime is a symlink to a file in /usr/share/zoneinfo. To find out which file, run ls -l /etc/localtime and copy the appropriate file to /chroot/httpd/etc/localtime.<br />
By default, syslogd monitors log files only in /var/log. The chrooted httpd daemon will write its logs to /chroot/httpd/var/log, however, so you need to tell syslogd to monitor this directory too. To change this you need to edit the appropriate startup script, /etc/rc.d/rc.syslog or /etc/rc.d/init.d/syslog, depending upon your distro.<br />
For /etc/rc.d/rc.syslog change daemon syslogd -m 0 to daemon syslogd -m 0 -a /chroot/httpd/dev/log.<br />
For /etc/rc.d/rc.syslog  change:</p>
<p align="justify">&nbsp;</p>
<pre class="code">    echo -n " /usr/sbin/syslogd"</pre>
<pre class="code">    /usr/sbin/syslogd</pre>
<p align="justify">to:</p>
<p align="justify">&nbsp;</p>
<pre class="code">    echo -n " /usr/sbin/syslogd"</pre>
<pre class="code">    /usr/sbin/syslogd -m 0 -a /chroot/httpd/dev/log</pre>
<p align="justify">It is a good idea to create the nescessary log files and set the appendable  bit on them too.</p>
<p align="justify">&nbsp;</p>
<pre class="code"># touch /chroot/httpd/var/log/apache/access_log</pre>
<pre class="code"># touch /chroot/httpd/var/log/apache/error_log</pre>
<pre class="code"># chmod 600 /chroot/httpd/var/log/apache/*</pre>
<pre class="code"># chattr +a /chroot/httpd/var/log/apache/*</pre>
<p>Finally, you need to change the httpd startup script to run the chrooted httpd. Depending on your distro, open up /etc/rc.d/rc.httpd or /etc/rc.d/init.d/httpd and change the command that starts the httpd daemon to read /usr/sbin/chroot /chroot/httpd/ /usr/sbin/httpd.<br />
<strong>Testing the server</strong><br />
If you have not already done so you should shut down the httpd daemon now. Next, restart the syslog daemon:<span class="code"> /etc/rc.d/rc.syslog  restart</span> (or <span class="code">/etc/rc.d/init.d/syslog  restart</span> accordingly). Now start the chrooted version of Apache  with<span class="code"> /etc/rc.d/rc.httpd start</span> (or<span class="code"> /etc/rc.d/init.d/httpd start</span>).<br />
If there are no errors, check the daemon is running with the command ps -aux | grep httpd. You should see several entries indicating a running httpd process. Taking the process number from the output of ps and running ls<span class="code"> -l /proc/PROC_NUMBER/root/ </span>should show the structure of your <span class="code">/chroot/httpd</span> rather than your server&#8217;s /  filesystem.<br />
If something has gone wrong, you should try running your chrooted httpd with strace. The command # strace chroot /chroot/httpd /usr/sbin/httpd 2&gt; httpd.strace redirects the output of strace to a file named httpd.strace which should give you an idea where the problem lies.<br />
Once everything is running you can remove your original Apache install.<br />
<strong>Summary</strong><br />
<!--adsense--><br />
Although chroot can be used to help create a more secure environment, it is not perfect. You still need to keep your Web server patched up to date and monitor your logs. Your chroot environment should help to contain a potential breakin and protect your system&#8217;s main filesystem from unseen vulnerabilities in your Web server.</p>
]]></content:encoded>
			<wfw:commentRss>http://secureslash.com/system-security/chrooting-apache/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fedora Core Security</title>
		<link>http://secureslash.com/system-security/fedora-core-security/</link>
		<comments>http://secureslash.com/system-security/fedora-core-security/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 13:15:59 +0000</pubDate>
		<dc:creator>KarthiKeyan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[System Security]]></category>

		<guid isPermaLink="false">http://secureslash.com/system-security/fedora-core-security/</guid>
		<description><![CDATA[Tweet Fedora is the thought and action leader in many cutting-edge Linux security initiatives. The following security features were developed by Fedora engineers. In line with the Fedora policy, these security features have been pushed upstream and they are available to all Linux distributions who choose to take advantage of them. SELinux Fedora is the [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsecureslash.com%2Fsystem-security%2Ffedora-core-security%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://secureslash.com/system-security/fedora-core-security/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://secureslash.com/system-security/fedora-core-security/"  data-text="Fedora Core Security" data-count="horizontal">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://secureslash.com/system-security/fedora-core-security/" data-counter="right"></script></div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://secureslash.com/system-security/fedora-core-security/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>Fedora is the thought and action leader in many cutting-edge Linux  security<br />
initiatives. The following security features were developed by  Fedora engineers.<br />
In line with the Fedora policy, these security  features have been pushed<br />
upstream and they are available to all Linux  distributions who choose<br />
to take advantage of them.</p>
<h5 align="justify">SELinux</h5>
<p><!--adsense--></p>
<p align="justify">Fedora is the first mainstream operating system to provide MAC (Mandatory Access Control) based security using <a href="http://fedoraproject.org/wiki/SELinux">SELinux</a> enabled by default. SELinux was developed in partnership with the NSA (National Security Agency) &#8211; A US based goverment security organisation and Red Hat with developers from projects such as Gentoo and Debian. Security Enhanced Linux protects users and processes by watching all actions on the system, from opening a file to using a socket. Users may write their own SELinux security policies according to their risk tolerance. By default, Fedora runs a targeted security policy that protects network daemons that have a higher chance of being attacked. If compromised, these programs are extremely limited in the damage they can do, even if the root account is cracked.</p>
<p align="justify">For example, Apache is protected in four different ways. The executable for Apache, httpd, is protected at compile time by PIE and Exec-Shield. The executable binary file on the system is protected by ELF hardening. Finally, SELinux policies are in place so that if httpd is cracked, it can only append to the Apache logs and mangle content in specific directories; it cannot roam around home directories or otherwise interact with the rest of the system.</p>
<p align="justify">References:</p>
<p align="justify"><a href="http://fedoraproject.org/wiki/SELinux"> http://fedoraproject.org/wiki/SELinux</a></p>
<h5 align="justify">Exec-Shield</h5>
<p align="justify"> <strong>No eXecute (NX)</strong></p>
<p align="justify">Modern processors support a feature called NX which allows a system to control the execution of various portions of memory. Data memory is flagged as non-executable and program memory is flagged as non-writeable. This help prevent certain types of buffer overflow exploits from working as expected.</p>
<p align="justify">Since not all processors support the NX feature, attemptes have been made to support this feature via segment limits. A segment limit will prevent certain portions of memory from being executed. This provides very similar functionality to NX technology.</p>
<p align="justify"> <strong>Position Independent Executables (PIE)</strong></p>
<p align="justify">PIE is an Exec-Shield technology that allows a programmer to make the executable load at a different memory address each time it starts. Attackers cannot predict where the application will start, making it very hard to exploit. Not all packages are compiled as PIE executables in Fedora Core. Using PIE causes a fair amount of processing overhead, so only select packages are compiled as PIE executables.</p>
<p align="justify">Applications that are not compiled as PIE, still have a small amount of added protection. The usage of prelink does place binaries and libraries at known locations. Fedora Core contains a feature which runs prelink every two weeks at which time the memory locations of binaries and libraries is randomized. Applications that are compiled as PIE do not use prelink, all memory addresses are randomized with each execution.</p>
<h5 align="justify">Compile Time Buffer Checks (FORTIFY_SOURCE)</h5>
<p align="justify">GCC compiler and GLIBC C library from Fedora Core 4 onwards has gained a feature called &#8220;FORTIFY_SOURCE&#8221; that will detect and prevent a subset of the buffer overflows before they can do damage. The idea behind FORTIFY_SOURCE is relatively simple: there are cases where the compiler can know the size of a buffer (if it&#8217;s a fixed sized buffer on the stack, as in the example, or if the buffer just came from a malloc() function call). With a known buffer size, functions that operate on the buffer can make sure the buffer will not overflow.</p>
<p align="justify">References:</p>
<p align="justify"><a href="http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html"> http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html</a></p>
<h5 align="justify">ELF (Executable and Linkable Format) Data Hardening</h5>
<p align="justify">These are changes to the file components that protect the structure of the file itself.</p>
<p align="justify">References:</p>
<p align="justify"><a href="http://people.redhat.com/drepper/nonselsec.pdf"> http://people.redhat.com/drepper/nonselsec.pdf</a></p>
<h5 align="justify">Restricted Kernel Memory access</h5>
<p align="justify">Fedora restricts how the kernel memory (/dev/mem) can be overwritten. This prevents several rootkits from functioning resulting in a safer and more secure system.</p>
<p align="justify">References:</p>
<p align="justify"><a href="http://lwn.net/Articles/160380/"> http://lwn.net/Articles/160380/</a></p>
<h5 align="justify">Stack Smash Protection, Buffer Overflow Detection and Variable Reordering</h5>
<p align="justify">For this release, all of the software in the Fedora Core and Fedora Extras software repositories is compiled using a security feature called fstack-protector. fstack-protector puts a canary value on the stack of key functions. Just before the return address and just before returning from that value, that canary value is verified. If there was a buffer overflow, the canary no longer matches and the program aborts. The canary value is random for each time the application is started and makes it impossible to guess remotely. This is a security feature that has been backported from GCC 4.1 to the version of the GCC compiler used in Fedora Core 5 test1. This feature<br />
<!--adsense--><br />
[<a href="http://gcc.gnu.org/ml/gcc-patches/2005-05/msg01193.html">http://gcc.gnu.org/ml/gcc-patches/2005-05/msg01193.html</a>) has been written by Red Hat developers and provides similar functionality to the IBM propolice/ssp patches.</p>
<p align="justify">This is in addition to using FORTIFY_SOURCE from Fedora Core 4 onwards.</p>
<p align="justify">References:</p>
<p align="justify"><a href="http://gcc.gnu.org/gcc-4.1/changes.html"> http://gcc.gnu.org/gcc-4.1/changes.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://secureslash.com/system-security/fedora-core-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rootkit Detectors</title>
		<link>http://secureslash.com/security-tools/rootkit-detectors/</link>
		<comments>http://secureslash.com/security-tools/rootkit-detectors/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 07:52:47 +0000</pubDate>
		<dc:creator>KarthiKeyan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security Tools]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[System Security]]></category>

		<guid isPermaLink="false">http://secureslash.com/security-tools/rootkit-detectors/</guid>
		<description><![CDATA[Tweet Sysinternals : An extensive collection of powerful windows utilities Sysinternals provides many small windows utilities that are quite useful for low-level windows hacking. Some are free of cost and/or include source code, while others are proprietary. Survey respondents were most enamored with: ProcessExplorer for keeping an eye on the files and directories open by [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsecureslash.com%2Fsecurity-tools%2Frootkit-detectors%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://secureslash.com/security-tools/rootkit-detectors/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://secureslash.com/security-tools/rootkit-detectors/"  data-text="Rootkit Detectors" data-count="horizontal">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://secureslash.com/security-tools/rootkit-detectors/" data-counter="right"></script></div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://secureslash.com/security-tools/rootkit-detectors/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p><a href="http://www.microsoft.com/technet/sysinternals/default.mspx">Sysinternals</a> : An extensive collection of powerful windows utilities</p>
<p>Sysinternals provides many small windows utilities that are quite useful for low-level windows hacking. Some are free of cost and/or include source code, while others are proprietary. Survey respondents were most enamored with:<!--adsense--></p>
<ul>
<li><a href="http://www.microsoft.com/technet/sysinternals/utilities/ProcessExplorer.mspx">ProcessExplorer</a> for keeping an eye on the files and directories open by any process (like LSoF on UNIX).</li>
<li><a href="http://www.microsoft.com/technet/sysinternals/utilities/PsTools.mspx">PsTools</a> for managing (executing, suspending, killing, detailing) local and remote processes.</li>
<li><a href="http://www.microsoft.com/technet/sysinternals/utilities/Autoruns.mspx">Autoruns</a> for discovering what executables are set to run during system boot up or login.</li>
<li><a href="http://www.microsoft.com/technet/sysinternals/utilities/RootkitRevealer.mspx">RootkitRevealer</a> for detecting registry and file system API discrepancies that may indicate the presence of a user-mode or kernel-mode rootkit.</li>
<li><a href="http://www.microsoft.com/technet/sysinternals/utilities/TcpView.mspx">TCPView</a>, for viewing TCP and UDP traffic endpoints used by each process (like Netstat on UNIX).</li>
</ul>
<p><strong>Update:</strong> Microsoft <a href="http://www.winternals.com/Company/PressRelease92.aspx">acquired Sysinternals</a> in July 2006, <a href="http://www.winternals.com/Company/PressRelease92.aspx">promising</a> that â€œCustomers will be able to continue building on Sysinternals&#8217; advanced utilities, technical information and source codeâ€. Less than four months later, Microsoft <a href="http://seclists.org/dailydave/2006/q4/0134.html">removed</a> most of that source code.  Future product direction is uncertain.</p>
<p><a href="http://www.tripwire.com/">Tripwire</a> : The grand-daddy of file integrity checkers<br />
A file and directory integrity checker. Tripwire is a tool that aids system administrators and users in monitoring a designated set of files for any changes. Used with system files on a regular (e.g., daily) basis, Tripwire can notify system administrators of corrupted or tampered files, so damage control measures can be taken in a timely manner. An open source Linux version is freely available at <a href="http://www.tripwire.org/">Tripwire.Org</a>.  UNIX users may also want to consider <a href="http://www.cs.tut.fi/%7Erammer/aide.html">AIDE</a>, which has been designed to be a free Tripwire replacement.  Or you may wish to investigate <a href="http://www.radmind.org/">Radmind</a>, RKHunter, or chkrootkit.  Windows users may like <a href="http://www.sysinternals.com/utilities/rootkitrevealer.html">RootkitRevealer</a> from Sysinternals.</p>
<p><a href="http://www.rootkit.nl/projects/rootkit_hunter.html">RKHunter</a> : An Unix Rootkit Detector<br />
RKHunter is scanning tool that checks for signs of various pieces of nasty software on your system like rootkits, backdoors and local exploits. It runs many tests, including MD5 hash comparisons, default filenames used by rootkits, wrong file permissions for binaries, and suspicious strings in LKM and KLD modules.</p>
<p><a href="http://www.chkrootkit.org/">chkrootkit</a> : Locally checks for signs of a rootkit<br />
chkrootkit is a flexible, portable tool that can check for many signs of rootkit intrusion on Unix-based systems. Its features include detecting binary modification, utmp/wtmp/lastlog modifications, promiscuous interfaces, and malicious kernel modules.</p>
]]></content:encoded>
			<wfw:commentRss>http://secureslash.com/security-tools/rootkit-detectors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

