<?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>JW Network Consulting &#187; incident response</title>
	<atom:link href="http://www.jwnetworkconsulting.com/tag/incident-response/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jwnetworkconsulting.com</link>
	<description>Watching the network so you don't have to.</description>
	<lastBuildDate>Sun, 30 Oct 2011 22:06:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Looking for Malicious PHP Files</title>
		<link>http://www.jwnetworkconsulting.com/security/looking-for-malicious-php-files</link>
		<comments>http://www.jwnetworkconsulting.com/security/looking-for-malicious-php-files#comments</comments>
		<pubDate>Sun, 30 Oct 2011 22:03:15 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[incident response]]></category>
		<category><![CDATA[malicious php]]></category>
		<category><![CDATA[obscured malicious code]]></category>

		<guid isPermaLink="false">http://www.jwnetworkconsulting.com/?p=458</guid>
		<description><![CDATA[I&#8217;ve been digging through some PHP files that are trying very hard to hide what they are doing. Basically, the PHP code is base64 encoded and then compressed. The blob of random text is then stuffed into a PHP file which calls to decode it and execute it on the web server. While it obscures [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been digging through some PHP files that are trying very hard to hide what they are doing.  Basically, the PHP code is base64 encoded and then compressed.  The blob of random text is then stuffed into a PHP file which calls </p>
<pre class="qoate-code">
"eval(gzinflate(base64_decode("BLOB OF TEXT")));
</pre>
<p>to decode it and execute it on the web server.  While it obscures what the code is doing (briefly), it fairly screams that something is not right with this file.</p>
<p>First to find any PHP files which use this on your server use:</p>
<pre class="qoate-code">
egrep -r "eval\(gzinflate\(base64_de" . --include=*.php
</pre>
<p>That will find the offending files.  To see what they did, I copied everything inside the &#8220;eval()&#8221; statement.  Then I dumped into a text file on my laptop in something that looked like this.</p>
<pre class="qoate-code">
&lt;?php
$X = gzinflate(base64_decode("BLOB OF TEXT"));

print $x;
?&gt;
</pre>
<p>Instead of displaying it in a browser, I called it from the command line.</p>
<pre class="qoate-code">
&gt; php foobar.txt
</pre>
<p>The code gets base64 decoded, decompressed and displayed in my console window.  Because I removed &#8220;eval()&#8221; from the code I could see what the attacker was doing without worrying about executing bad code on my system.  Or viewing it in my browser.</p>
<p><!-- start wp-tags-to-technorati 1.02 --></p>
<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/incident+response' rel='tag' target='_self'>incident response</a>, <a class='technorati-link' href='http://technorati.com/tag/malicious+php' rel='tag' target='_self'>malicious php</a>, <a class='technorati-link' href='http://technorati.com/tag/obscured+malicious+code' rel='tag' target='_self'>obscured malicious code</a></p>
<p><!-- end wp-tags-to-technorati --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jwnetworkconsulting.com/security/looking-for-malicious-php-files/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preparing for Incident Response</title>
		<link>http://www.jwnetworkconsulting.com/security/preparing-for-incident-response</link>
		<comments>http://www.jwnetworkconsulting.com/security/preparing-for-incident-response#comments</comments>
		<pubDate>Thu, 01 Jul 2010 06:04:25 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[computer incident]]></category>
		<category><![CDATA[incident response]]></category>
		<category><![CDATA[preparation]]></category>
		<category><![CDATA[security incident]]></category>

		<guid isPermaLink="false">http://www.jwnetworkconsulting.com/?p=367</guid>
		<description><![CDATA[Having a solid incident response capability isn&#8217;t an accident.  It&#8217;s the result of focused preparation, training and culture.  Incidents come at unexpected times, frequently with little warning, and can have a severe impact on an organization.  It&#8217;s during these times that inadequate planning, documentation and missing tools become painfully apparent.  That high level incident response [...]]]></description>
			<content:encoded><![CDATA[<p>Having a solid incident response capability isn&#8217;t an accident.  It&#8217;s the result of focused preparation, training and culture.  Incidents come at unexpected times, frequently with little warning, and can have a severe impact on an organization.  It&#8217;s during these times that inadequate planning, documentation and missing tools become painfully apparent.  That high level incident response plan that made the auditor happy suddenly doesn&#8217;t seem to be very useful.  Perhaps we think that the plan will give us the overall guidance and we&#8217;ll be able to figure it out as we go from there.  Think this will work?  Think again.  Let&#8217;s look at one possibility outside of information security.</p>
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<p><strong>What if a Fire Department Wasn&#8217;t Prepared?</strong><br />
The dispatch alarm goes off in the middle of the night, waking up the firefighters on duty.  They go scrambling down the stairs to their truck and equipment.  Two of them start running around trying to find their turnouts.</p>
<p>&#8220;Hey Sam, where are my boots?!?&#8221;</p>
<p>Another has his gear, but he&#8217;s looking around the cab of the fire engine for the keys.  The last member of the crew is hurriedly going through the equipment on the engine, attempting to make sure they have everything needed for the current call.</p>
<p>&#8220;Was that a house fire or a traffic accident?  Where did we put the first aid kit last time?&#8221;</p>
<p>After a lot of fumbling around, everyone thinks they have the proper gear and the engine rolls out of the station with the lights and sirens wailing.  One problem though, the gas tank is nearly empty.  After partially filling up, they are back on the road heading to the call.</p>
<p>On arrival they start pulling out tangled hoses, hook the fire hydrant up to the engine and disaster strikes again&#8230;</p>
<p>&#8220;Does anyone know where the wrench for the fire hydrant is?&#8221;</p>
<p>…silence…</p>
</div>
</div>
<p>Thankfully, scenes like this are not played out in our fire departments.  The men and women who become firefighters are trained, professional and prepared.  Their turnouts are always ready that they can grab them, climb into the engine and race to save someone&#8217;s life.  They don&#8217;t have to rummage around the fire engine checking for equipment, because when they got back from the last call they made sure they were ready for the next call.  And they did so in a way that the next call can be a fire, an accident or the proverbial cat stuck in the tree.</p>
<p>Fire fighters are the consummate &#8220;incident responders&#8221;.  They are able to drop what they are doing or wake up from a dead sleep, grab their gear and start saving lives.  Their preparation is such that they are ready to respond to a variety of issues.  </p>
<p>As computer incident responders, there are some things that we can learn from these professionals.  First, they are selected carefully and trained in the proper tools and techniques.  Next, they assemble the equipment and store it on a mobile “jump kit” known as a fire engine.  Last, after they use their fire engine, they restock it and prepare it for the next emergency.  So let’s look at the nearest equivalents in computer incident response.</p>
<p><strong>Selection of Incident Handlers</strong></p>
<p>Incident handlers need to be selected with serious consideration.  When an incident occurs the incident response team is called in to deal with the situation.  The business is willing to make this call because the incident handlers are the experts in this stuff.  They trust them.  The team is made up of people with solid technical backgrounds, they know what needs to be done, how it needs to be done and can guide everyone else through the process.</p>
<p>An incident is stressful on everyone around it.  People may fear for their jobs or careers.  They aren’t sure what to do or how to even begin.  It may be pure panic.  Incident response team members need to be able to handle their own stress and the stress of those around them.  They need to be calm and help calm down everyone else around them.  They must make good decisions under pressure.  Communication is a key skill that will be relied on heavily.  They will need a good understanding of the business and what’s important to it.  Plus they must know the procedures to handle evidence gathered in response properly so that the business is protected or has legal recourse.  Last, they must to have the technical knowledge and analytic capabilities to get the business out of the incident and back into regular operations.</p>
<p>This kind of expertise becomes a reality because people have made a deliberate choice to pursue and gain these skills.  They are not individuals who can be picked at random.  Choose carefully and deliberately.  Then support them in fulfilling the mission they’ve been assigned.</p>
<p><strong>Equipment Preparation</strong></p>
<p>Incident response requires some equipment on hand and ready to go.  It’s not a kit filled with terribly unusual or expensive items.  It involves deciding what needs to be in the kit and putting it together into something frequently referred to as the “Jump Kit”.  It’s an organized bag with all the basics needed to respond to a variety of incidents.  As you assemble it an iron clad rule must be followed.</p>
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent" style="text-align: center;"><strong>NO BORROWING FROM THE JUMP KIT!  NO EXCEPTIONS!</strong></div>
</div>
<p>With that rule out of the way, what should be in a jump kit?  NIST has created <a title="SP 800-61 Computer Security Incident Handling Guide" href="http://csrc.nist.gov/publications/nistpubs/800-61-rev1/SP800-61rev1.pdf" target="_blank">Special Publication 800-61 &#8211; Computer Security Incident Handling Guide</a> to help government agencies prepare for their incident response capabilities.  It contains a number of recommendations for a jump kit.  SANS also has assembled a similar list of information, which is distributed to students of <a title="Security 504: Hacker Techniques, Exploits &amp; Incident Handling" href="http://www.sans.org/mentor/details.php?nid=22153">Security 504, Hacker Techniques, Exploits and Incident Handling</a>.  Both are excellent sources of information.</p>
<p>The list below is a combination of ingredients from both sources.  I have some of these items but not all yet.  I&#8217;m still working on building my kit.</p>
<ul>
<li>Contact information for team members and others within and outside the organization (primary and backup contacts).  If you’re depending on the online address list, but that server is compromised you may be in trouble.</li>
<li>Pagers or cell phones.  Don’t forget spare batteries and chargers</li>
<li>Laptop with lots of RAM, a large hard drive and pre-loaded with forensics applications</li>
<li>Virtual machine software such as Xen, VMware, or Virtual PC so you can run multiple operating systems</li>
<li>Live CDs of various types.  Some options are Helix, CAIN or DEFT for forensics.  Backtrack is another possiblity, though it is focused on penetration testing</li>
<li>DVDs or CDs with trusted, statically linked versions of programs to be used to gather evidence from systems</li>
<li>Packet sniffers and protocol analyzers to capture and analyze network traffic</li>
<li>Encryption software.  If the network is not trustworthy, you need encryption to keep your communication confidential</li>
<li>Blank media, such as floppy disks, CD-Rs, and DVD-Rs</li>
<li>USB thumb drives.  8 and 16 GB drives aren&#8217;t too expensive</li>
<li>A network hub or a tap.  A tap would be better, but they cost more</li>
<li>Write blocking device(s) to use when imaging hard drives or other media</li>
<li>A large external hard drive.  Maybe more than one.</li>
<li>Tools such as screwdrivers, flashlight, tweezers, telescoping magnet or hands.  I tend to bring a Gerber utility knife with me where ever I go.  Watch out when flying some where though.  Be prepared to check your kit if you carry a pocket knife or screwdrivers</li>
<li>USB to serial port adapter</li>
<li>Network cables.  Straight and crossover.  I carry a crossover adapter</li>
<li>Hard drive jumpers</li>
<li>Cisco rollover cable and a serial cable</li>
<li>Female to female RJ45 connector</li>
<li>Hard-bound notebooks with numbered pages</li>
<li>Digital camera and audio recorder</li>
<li>Chain of custody and other incident forms</li>
<li>Evidence storage bags and tags, and evidence tape.  Amazon.com has these items</li>
<li>Desiccants for protecting against moisture in the bags</li>
<li>Port lists, including commonly used ports and Trojan horse ports</li>
<li>Cryptographic hashes of critical files to speed the analysis, verification, and eradication of incidents</li>
<li>Media, including OS boot disks and CD-ROMs, OS media, and application media</li>
<li>Security patches from OS and application vendors</li>
</ul>
<p>Edit &#8212; 7/21/2010<br />
One quick note to add to this list.  Consider what items are practical to have a couple of.  In my case the power switch on my write blocker failed when I was imaging a number of systems.  The vendor, Digital Intelligence, responded in short order to replace my write blocker and was awesome.  But in the mean time I was stuck.  The lesson of redundancy was re-taught to me at that point.  If duplicate equipment is not possible consider what your backup plan is if something dies on you.</p>
<p>&#8211; Continuing the original post&#8230;</p>
<p>If you are doing incident response internally&#8230;</p>
<ul>
<li>Documentation for operating systems, applications, protocols, and intrusion detection and anti-virus systems</li>
<li>Network diagrams and lists of critical assets, such as Web, email, and database servers</li>
<li>Baselines of expected network, system and application activity</li>
<li>Backup images of OS, applications, and data stored on secondary media</li>
</ul>
<p>You may decide that this list isn&#8217;t complete.  It&#8217;s not.  It&#8217;s just a starting place.  There may be that one time when you really needed something and didn&#8217;t have it.  So now you always make sure to have it with you.  After each incident, review how things went and ask the team if there was some piece of equipment that wasn&#8217;t there.  Adjust, improve, and then restock.</p>
<p><strong>Jump Kit Restocking</strong></p>
<p>After the incident is over several items from the kit may have been used and need to be replaced.  Compare your inventory of what the bag should have to what is left in it.  Note any missing or nearly depleted items.  The team may have noted some items that they wish that they had had or that needed to be purchased during the incident.  If appropriate, add them to the list of jump bag items and purchase it for next time.  Make sure that everything is stored properly, so that it can be used without needing to untangle it from something else first.  Once the bag is ready, put it in its normal place and have it ready for next time.  Your team is now ready to respond to the next incident with confidence that when they grab the bag that it is ready to go.</p>
<p><strong>How Are We Doing Now?</strong><br />
The team has been selected, vetted and trained.  Everyone knows where the jump kit is and that it has the gear necessary.  When the phones start ringing and an incident is declared, the team starts gathering their gear and congregating as planned.  Instead of scrambling for equipment and wondering what to do next, the team is ready, confident and it shows.  The incident has a much better chance of being resolved quicker, more completely and according to accepted practices.<br />
<!-- start wp-tags-to-technorati 1.02 --></p>
<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/computer+incident' rel='tag' target='_self'>computer incident</a>, <a class='technorati-link' href='http://technorati.com/tag/incident+response' rel='tag' target='_self'>incident response</a>, <a class='technorati-link' href='http://technorati.com/tag/preparation' rel='tag' target='_self'>preparation</a>, <a class='technorati-link' href='http://technorati.com/tag/security+incident' rel='tag' target='_self'>security incident</a></p>
<p><!-- end wp-tags-to-technorati --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jwnetworkconsulting.com/security/preparing-for-incident-response/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learning from BP&#8217;s Response to the Gulf Disaster</title>
		<link>http://www.jwnetworkconsulting.com/security/learning-from-bps-response-to-the-gulf-disaster</link>
		<comments>http://www.jwnetworkconsulting.com/security/learning-from-bps-response-to-the-gulf-disaster#comments</comments>
		<pubDate>Mon, 31 May 2010 06:26:10 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[incident response]]></category>
		<category><![CDATA[lessons learned]]></category>
		<category><![CDATA[planning for disaster]]></category>

		<guid isPermaLink="false">http://www.jwnetworkconsulting.com/?p=343</guid>
		<description><![CDATA[One of the most disheartening things about the Gulf of Mexico disaster is to watch BP, the government and other involved parties appear to make up their response as they go along.  Aren&#8217;t oil companies required to plan for failures and how to recover from them?  As it turns out yes, they are.  Tonight I [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most disheartening things about the Gulf of Mexico disaster is to watch BP, the government and other involved parties appear to make up their response as they go along.  Aren&#8217;t oil companies required to plan for failures and how to recover from them?  As it turns out yes, they are.  Tonight I found the official &#8220;Regional Oil Spill Response Plan &#8211; Gulf of Mexico&#8221; that BP filed with the US government.  Some sections I read completely, but at a minimum I looked at every single page of it.  (All 583 of them.)  If you want to read through it you can <a href="http://publicintelligence.net/bp-gulf-of-mexico-regional-oil-spill-response-plan/">download it here.</a> In fact, you probably ought to grab your Incident Response Plan and compare it to BP&#8217;s response plan.  Here&#8217;s some of my thoughts on their plan and what lessons may be for those of us in InfoSec to learn from.</p>
<p>The first thing I saw that this document was definitely written to meet regulatory requirements.  It has lots of flow charts, organizational charts, and contact information.  It details the contracts maintained with ships to perform oil skimming and position containment booms.  Planes to drop dispersants?  Check.  Detailed info about the dispersants themselves?  Yup, got that.  Do they have procedures to use when deciding how to perform surface burns?  Of course!  There is information on how to assist animal life of all kinds, including some that have probably never been in the Gulf of Mexico.  It even has a section on the &#8220;Worst Case Discharge&#8221;.  And on it goes.  So why are we still spilling 500,000 &#8211; 700,000 gallons (12,000 &#8211; 19,000 barrels) of oil per day in spite of this lovely plan?</p>
<p>The most glaring omission is that the plan has not a single mention of how to stop an active oil spill.  Not a peep about it, whether its on land or on the ocean floor.  There isn&#8217;t even a reference to other documents on how a blowout would be halted.  It does mention practice exercises and ongoing training, but even that appears to be focused on mopping up oil on beaches and the ocean surface.  I suspect that this plays into why containment chambers, top kills, junk shots and other ideas are getting thrown around.  <strong>Question one.  Does your incident response plan include or at least reference other docs on how to stop the bleeding?</strong></p>
<p>Next issue.  The &#8220;Worst Case Discharge&#8221; appendix contains an estimate of 250,000 barrels leaking per day using an official formula required by the US government.  It has a containment and clean up strategy using oil skimmers and dispersants.  Last it has a detailed inventory of ships and planes that will be used in the attempt.  The problem that I see with this is that it has little relation to reality.  Fine, its the worst possible amount of oil that can be discharged and fortunately, the current spill is not that big.  But what happens if the entire drilling rig blows up?  What do you do when the blowout preventer fails?  How will you handle it when hurricane season hits?  What if the failure is a mile underwater?  What happens if multiple wells blow out?  No mention of it.  <strong>Question two.  Does your incident response plan take into account business requirements?  Like end of the month billing and an incident?  Is your worst case scenario a dry formula or does it mean something to the business?</strong></p>
<p>Last issue.  The BP response plan looks like it was written to keep auditors happy.  It looks like it has some really important information that I&#8217;d bet has been used during this process.  Contact numbers for service providers and contracts with critical damage control resources is important.  But I think this thing was written to meet a checklist.  It met the legal requirements currently in force and passed muster.  A document designed to keep an auditor happy is trouble in the making.  Instead how about writing one that tries to meet the need of the potential crisis?  It will probably have what the auditor wants and if there are a couple of hoops to add, so be it.  But write the thing to deal with the leak of 500,000 gallons of oil coming out of the ground.  Or is it credit cards leaking?  <strong>Compliance is great…  as long as it comes after the main issue is addressed.</strong><br />
<!-- start wp-tags-to-technorati 1.02 --></p>
<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/incident+response' rel='tag' target='_self'>incident response</a>, <a class='technorati-link' href='http://technorati.com/tag/lessons+learned' rel='tag' target='_self'>lessons learned</a>, <a class='technorati-link' href='http://technorati.com/tag/planning+for+disaster' rel='tag' target='_self'>planning for disaster</a></p>
<p><!-- end wp-tags-to-technorati --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jwnetworkconsulting.com/security/learning-from-bps-response-to-the-gulf-disaster/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

