<?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>mochahochabeachside.com &#187; Linux</title>
	<atom:link href="http://mochahochabeachside.com/topics/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://mochahochabeachside.com</link>
	<description></description>
	<lastBuildDate>Tue, 10 May 2011 04:31:12 +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>Pure-ftpd does not work with centos vps ispconfig The Perfect Server</title>
		<link>http://mochahochabeachside.com/2010/05/pure-ftpd-does-not-work-with-centos-vps-ispconfig-the-perfect-server/</link>
		<comments>http://mochahochabeachside.com/2010/05/pure-ftpd-does-not-work-with-centos-vps-ispconfig-the-perfect-server/#comments</comments>
		<pubDate>Mon, 10 May 2010 14:02:18 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[FAQs  Help  and Tutorials]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[ISPConfig]]></category>
		<category><![CDATA[Perfect Server]]></category>

		<guid isPermaLink="false">http://mochahochabeachside.com/?p=125</guid>
		<description><![CDATA[So you're following the tutorial at The Perfect Server - CentOS 5.4 x86_64 [ISPConfig 3] and when you get to installing Pure-FTPD you get FAILED on start, and see May 10 08:09:58 pimp pure-ftpd: (?@?) [ERROR] Unable to switch capabilities : Operation not permitted in the logs.  Well, the answer is at hand.  Rather than [...]]]></description>
			<content:encoded><![CDATA[<p>So you're following the tutorial at <a href="http://www.howtoforge.com/perfect-server-centos-5.4-x86_64-ispconfig-3">The  Perfect Server - CentOS 5.4 x86_64 [ISPConfig 3]</a> and when you get to installing Pure-FTPD you get FAILED on start, and see</p>
<p style="padding-left: 30px;">May 10 08:09:58 pimp <a class="zem_slink" title="Pure-FTPd" rel="homepage" href="http://www.pureftpd.org/">pure-ftpd</a>: (?@?) [ERROR] Unable to switch capabilities : Operation not permitted</p>
<p>in the logs.  Well, the answer is at hand.  Rather than looking through countless google entries to find the answer buried on page three or four, just go <a href="http://blog.newart-design.net/2009/09/install-pure-ftp-on-centos-5-3-vps-with-ispconfig-3/">here</a>, where the folks at newart-design.net have put together the answer. Make sure to yum install first, that way you can chkserv on and use /etc/init.d to control.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=360dcf80-7be8-436a-8ea3-16619d082e88" alt="" /><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://mochahochabeachside.com/2010/05/pure-ftpd-does-not-work-with-centos-vps-ispconfig-the-perfect-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>tee-hee</title>
		<link>http://mochahochabeachside.com/2009/11/tee-hee/</link>
		<comments>http://mochahochabeachside.com/2009/11/tee-hee/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 12:26:07 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Humor]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[exim]]></category>

		<guid isPermaLink="false">http://mochahochabeachside.com/?p=65</guid>
		<description><![CDATA[root@fyre [~]# telnet localhost 25 Trying 127.0.0.1... Connected to localhost (127.0.0.1). Escape character is '^]'. 220-fyre.fyrenetworks.com ESMTP Exim 4.69 #1 Wed, 18 Nov 2009 06:07:29 -0600 220-*yawn* huh? Wha? What is it? 220-Oh, it's you. I suppose you want me to send mail. 220-Well fine. But just so you know, I don't send spam. 220-(That [...]]]></description>
			<content:encoded><![CDATA[<p style="padding-left: 30px;">root@fyre [~]# telnet localhost 25<br />
Trying 127.0.0.1...<br />
Connected to localhost (127.0.0.1).<br />
Escape character is '^]'.<br />
220-fyre.fyrenetworks.com ESMTP <a class="zem_slink" title="Exim" rel="wikipedia" href="http://en.wikipedia.org/wiki/Exim">Exim</a> 4.69 #1 Wed, 18 Nov 2009 06:07:29 -0600<br />
220-*yawn* huh? Wha? What is it?<br />
220-Oh, it's you. I suppose you want me to send mail.<br />
220-Well fine. But just so you know, I don't send spam.<br />
220-(That means you are not authorized to send unsolicited<br />
220-and/or bulk e-mail through this system, you dimwit.)<br />
220 Now do your thing and let me get back to sleep, huh?<br />
HELO localhost<br />
250 fyre.fyrenetworks.com Hello localhost [127.0.0.1]</p>
<p>This is what happens when I'm under the influence of pain medication, wake up before anyone else in the house, can't get back to sleep, have too much chocolate, don't feel 100%, and am slightly bored...</p>
<p>Now, I just need to figure out if it's possible to include a callout at that point in exim.conf to a perl script that will randomize the connect messages.</p>
<p><span id="more-65"></span>Amazon Ideas:</p>
<p><a href="http://www.amazon.com/Exim-Transfer-Agent-Philip-Hazel/dp/0596000987%3FSubscriptionId%3DAKIAJFA77BWTEH6XDTZQ%26tag%3Dmocbeasid-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0596000987"><img src="http://ecx.images-amazon.com/images/I/512RUtOpSML._SL75_.jpg" alt="" /></a><a href="http://www.amazon.com/Exim-Transfer-Agent-Philip-Hazel/dp/0596000987%3FSubscriptionId%3DAKIAJFA77BWTEH6XDTZQ%26tag%3Dmocbeasid-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0596000987">Exim: The Mail Transfer Agent</a></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=a950b760-fce7-44a8-93f5-c647a9cb20f8" alt="" /><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://mochahochabeachside.com/2009/11/tee-hee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Default Mail Clean Script</title>
		<link>http://mochahochabeachside.com/2009/03/default-mail-clean-script/</link>
		<comments>http://mochahochabeachside.com/2009/03/default-mail-clean-script/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 08:22:17 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[CPanel]]></category>
		<category><![CDATA[FAQs  Help  and Tutorials]]></category>

		<guid isPermaLink="false">http://mochahochabeachside.com/?p=29</guid>
		<description><![CDATA[Here's a quick little script to clean the default mail accounts of mail on cPanel servers.  Note that this only helps if you have already disabled the catchalls. #!/bin/bash ############################################### # CLEAN MAIL # # v0.1 # # # # Cleans the mail from default accounts based # # on cPanel usernames. Create a file [...]]]></description>
			<content:encoded><![CDATA[<p>Here's a quick little script to clean the default mail accounts of mail on cPanel servers.  Note that this only helps if you have already disabled the catchalls.</p>
<p><code>#!/bin/bash<br />
###############################################<br />
#                CLEAN MAIL                   #<br />
#                   v0.1                      #<br />
#                                             #<br />
# Cleans the mail from default accounts based #<br />
# on cPanel usernames. Create a file in /root #<br />
# called 'doit'.  Add one cPanel username per #<br />
# line.  That should do nicely. Oh, this will #<br />
# take a while, so run the sucker in screen,  #<br />
# mkay, Batman?                               #<br />
###############################################</code></p>
<p><code># Some dedis have LS_OPTIONS include -a...<br />
# that would be bad for this script.<br />
# so, we reset it.<br />
LS_OPTIONS='-A'</code></p>
<p><code># start the loop...<br />
for i in `cat /root/doit`<br />
do<br />
        # Delete from the new folder.<br />
        cd /home/$i/mail/new<br />
        # can't rm if there's too many, and by using<br />
        # an ls and awk, we avoid another loop.<br />
        ls -l | awk '{print "rm -fv "$9}'|bash<br />
        # Delete from the cur folder.<br />
        cd /home/$i/mail/cur<br />
        # Comment repetition carefully avoided, here <img src='http://mochahochabeachside.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
        ls -l | awk '{print "rm -fv "$9}'|bash<br />
done<br />
# NINJAMOJO!</code></p>
<p>It's simple. Get a list of cPanel usernames, one per line, create a file in /root called 'doit', and slap the usernames in there.  Then, 'bash cleanmail'.</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif" alt="" /><span class="zem-script more-related"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://mochahochabeachside.com/2009/03/default-mail-clean-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing malicious code with perl and sed&#8230;</title>
		<link>http://mochahochabeachside.com/2009/02/removing-malicious-code-with-perl-and-sed/</link>
		<comments>http://mochahochabeachside.com/2009/02/removing-malicious-code-with-perl-and-sed/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 10:38:06 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[One-liners]]></category>
		<category><![CDATA[Code injection]]></category>
		<category><![CDATA[FAQs  Help  and Tutorials]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://mochahochabeachside.com/?p=18</guid>
		<description><![CDATA[Today, I had an instance where a customer's site had been attacked with a code injection affected all of his .php files. In this case, it was an old vBulletin install that had several known exploits on milw0rm (proof you should update often) that caused it. Fortunately, the code was injected as a single line, [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I had an instance where a customer's site had been attacked with a <a class="zem_slink" title="Code injection" rel="wikipedia" href="http://en.wikipedia.org/wiki/Code_injection">code injection</a> affected all of his .php files. In this case, it was an old <a class="zem_slink" title="VBulletin" rel="homepage" href="http://www.vbulletin.com/">vBulletin</a> install that had several known exploits on milw0rm (proof you should update often) that caused it.</p>
<p>Fortunately, the code was injected as a single line, and was the same in every file, and had the added benefit of being on the top line of the file.  So, I could use abit of perl to remove it, and then a bit of <a class="zem_slink" title="Sed" rel="wikipedia" href="http://en.wikipedia.org/wiki/Sed">sed</a> magic to remove the blank line left by <a class="zem_slink" title="Perl" rel="wikipedia" href="http://en.wikipedia.org/wiki/Perl">Perl</a> (because for some reason, it didn't want to remove the newline).</p>
<p><span id="more-18"></span>The perl code was relatively straightforward. Using -pi -e, we were able to edit in place each file (with much escapism to avoid regex traps, when in doubt escape anything consider special to regex):</p>
<p><code>for i in `find -iname "*.php"`;do perl -pi -e s/"\&lt;\?php \/\*\*\/eval\(base64_decode\('SomeObfuscatedCodeHereThatIWontDisplayForObviousReasons'\)\); \?\&gt;"//g $i;done</code></p>
<p>Once all of the files were edite, and the code removed, we used a quick sed one-liner to remove the line at the beginning of the file, as a lot of php scripts (vBulletin, included) will b0rk if there's anything before the opening &lt;?</p>
<p><code>for i in `find -iname "*.php"`;do sed '1d' $i &gt; $i.fixed &amp;&amp; mv -f $i.fixed $i;done</code></p>
<p>With those two snippets, I removed the code from around a hundred php files in less than two minutes (the sed work took a bit to process on some files).  Only one file had an issue, and that was the config.php that apparently was not infected.  All-in-all, the ticket resolution took less than 8 minutes, including testing and writing out the reply.  Edit 100 files, remove a bunch of code, test, reply to user in 8 minutes? Not too bad.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=2eaccb86-4d13-4414-9158-ffe7fc68544a" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://mochahochabeachside.com/2009/02/removing-malicious-code-with-perl-and-sed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

