<?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>Saiweb &#187; interpreter</title>
	<atom:link href="http://www.saiweb.co.uk/tag/interpreter/feed" rel="self" type="application/rss+xml" />
	<link>http://www.saiweb.co.uk</link>
	<description>Ramblings of a Sys admin</description>
	<lastBuildDate>Mon, 06 Feb 2012 14:57:49 +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>/bin/sh: bad interpreter</title>
		<link>http://www.saiweb.co.uk/uncategorized/bin-sh-bad-interpreter</link>
		<comments>http://www.saiweb.co.uk/uncategorized/bin-sh-bad-interpreter#comments</comments>
		<pubDate>Mon, 01 Feb 2010 11:41:58 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bad]]></category>
		<category><![CDATA[interpreter]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/?p=816</guid>
		<description><![CDATA[For security newer distros of RHEL and their derivatives an mounting /tmp with the noexec option. Now if you have ever had to clean up a compromised web app you can see why this makes a lot of sense, and if not here&#8217;s a quick example. Yours/Clients web app becomes compromised, running kernel has a [...]]]></description>
			<content:encoded><![CDATA[<p>For security newer distros of RHEL and their derivatives an mounting /tmp with the noexec option.</p>
<p>Now if you have ever had to clean up a compromised web app you can see why this makes a lot of sense, and if not here&#8217;s a quick example.</p>
<p>Yours/Clients web app becomes compromised, running kernel has a buffer overflow that can lead to privilege escalation, attack writes out their code and compiles in /tmp, then runs said app from /tmp creating a pseudo root level shell, aka you&#8217;ve just been root kitted.</p>
<p>However there are legitimate reasons for using /tmp to compile, well I say legitimate, what I in fact mean is things like pecl, which you use to install extensions like APC require this &#8230;</p>
<p>workaround:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">TMPDIR</span>=<span style="color: #ff0000;">'/a/paTh/your/user/can/write/to'</span></div></td></tr></tbody></table></div>
<p>Failing that:</p>
<p><strong>service httpd stop</strong></p>
<p><strong>DO NOT ALLOW ANY WEBAPP ACCESS WHILE NOEXEC IS IN USE!</strong></p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">mount</span> -o,remount,rw,<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<br />
pecl <span style="color: #c20cb9; font-weight: bold;">install</span> apc<br />
<span style="color: #c20cb9; font-weight: bold;">mount</span> -o,remount,rw,noexec <span style="color: #000000; font-weight: bold;">/</span>tmp</div></td></tr></tbody></table></div>
<p><strong>DO NOT REMOVE THE NOEXEC OPTION IN /ETC/FSTAB PERMANENTLY YOU WILL REGRET DOING SO</strong><span style="float: left;" ><a class="twitter-share-button"  data-via="Saiweb" data-count="horizontal" data-related="Saiweb:David Busby" data-lang="en" data-url="http://www.saiweb.co.uk/uncategorized/bin-sh-bad-interpreter" data-text="/bin/sh: bad interpreter" href="http://twitter.com/share?via=Saiweb&#038;count=horizontal&#038;related=Saiweb%3ADavid%20Busby&#038;lang=en&#038;url=http%3A%2F%2Fwww.saiweb.co.uk%2Funcategorized%2Fbin-sh-bad-interpreter&#038;text=%2Fbin%2Fsh%3A%20bad%20interpreter" >Tweet</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/uncategorized/bin-sh-bad-interpreter/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc
Database Caching 3/15 queries in 0.114 seconds using apc
Object Caching 496/524 objects using apc
Content Delivery Network via Rackspace Cloud Files: cdn.saiweb.co.uk

Served from: www.saiweb.co.uk @ 2012-02-08 16:04:15 -->
