<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>/dev/random</title>
	
	<link>http://blog.rootshell.be</link>
	<description>Can't sleep, hackers will eat me!</description>
	<lastBuildDate>Fri, 24 May 2013 17:36:03 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/dev/rand" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="dev/rand" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>SOURCE Dublin Wrap-Up Day #2</title>
		<link>http://blog.rootshell.be/2013/05/24/source-dublin-wrap-up-day-2/</link>
		<comments>http://blog.rootshell.be/2013/05/24/source-dublin-wrap-up-day-2/#comments</comments>
		<pubDate>Fri, 24 May 2013 17:30:37 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Event]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Dublin]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://blog.rootshell.be/?p=21626</guid>
		<description><![CDATA[I&#8217;m writing this wrap-up from the Dublin airport, waiting my flight back to Belgium. This new edition of SOURCE is already over. What did we learn today? This second day started with Vincenzo Lozzo&#8216;s keynote. Lorenzo gave first, some facts. From an economic point of view, Internet will generate nice business in the coming years (2012: $60B, in 2016: $86B &#8211; according to Gartner). Another <span class="ellipsis">&#8230;</span> <span class="more-link-wrap"><a href="http://blog.rootshell.be/2013/05/24/source-dublin-wrap-up-day-2/" class="more-link"><span>Read More &#8594;</span></a></span>]]></description>
				<content:encoded><![CDATA[<p><img class="alignleft  wp-image-9380" style="border: 0px;" title="IMG_3229.jpg" alt="SOURCE Kit" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3229.jpg" width="210" height="280" border="0" /></p>
<p style="text-align: justify;">I&#8217;m writing this wrap-up from the Dublin airport, waiting my flight back to Belgium. This new edition of SOURCE is already over. What did we learn today?</p>
<p style="text-align: justify;"><span id="more-21626"></span></p>
<p style="text-align: justify;">This second day started with <a href="http://www.twitter.com/_snagg">Vincenzo Lozzo</a>&#8216;s keynote. Lorenzo gave first, some facts. From an economic point of view, Internet will generate nice business in the coming years (2012: $60B, in 2016: $86B &#8211; according to Gartner). Another one, KPMG announced a raise of 40% increase in data-loss incidents. But a good news: entrepreneurs are looking to invest where there is a business like infosec. Also, US government said that cyberwar is like a regular war and army forces can be used. Scary to read some quotes like this one:</p>
<blockquote>
<p style="text-align: justify;"><em>Report for NATO justifies killing of hackers in a cyberwar.</em></p>
</blockquote>
<p style="text-align: justify;">In the security world, some people are not ready to share information with vendors when they found vulnerabilities. Infosec security is fundamentally trying to solve tech problems thought non-technical actions. They are different groups of attackers: Organized crime, they are also trying to get as much money as possible. If the ROI is not good enough, they will choose another target. Hacktivists are a different group with less sophisticated attacks. The scariest group is nation-states. Huge budgets, attacks can be very sophisticated depending on the target. A nice quote from Lorenzo:</p>
<blockquote>
<p style="text-align: justify;"><em>Can you even kick them out if they ever get in?</em></p>
</blockquote>
<p style="text-align: justify;">Then he also explained a game strategy based on the <a href="http://www.rsa.com/rsalabs/presentations/Flipit.pdf">FlipIt</a>  game to try to guess the attacker behaviour. But some group of attackers can&#8217;t be analysed with this technique. Banks are an example: it&#8217;s more a fair game. They know they will be attacked from time to time. The insecurity of complexity: At conferences, you learn new ways to attack. You try to implement new controls to block them. But it&#8217;s not sure that they can be implemented. The market of <a href="http://en.wikipedia.org/wiki/The_Market_for_Lemons">lemons</a> compared to infosec is not new. Are we checking security from a wrong angle? Bugs don&#8217;t attack companies, people with exploits do. Lorenzo make a comparison between &#8220;<em>bug bounty</em>&#8221; programs and <a href="http://en.wikipedia.org/wiki/BlueHat">blue hat</a> prize. Fixing a bug will not really improve the overall security. He gave a good example with Acrobat Reader: there is a difference between bug fixing and mitigation. Since they implemented a sandbox, there are less 0-days released.</p>
<p style="text-align: justify;"><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3231.jpg" alt="Lorenzo" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3231.jpg" width="300" height="225" border="0" /></p>
<blockquote><p><em>Fixing bugs is like draining the sea with a spoon. It makes you look heroic but doesn&#8217;t achieve anything</em></p></blockquote>
<p style="text-align: justify;">Things that Vincenzo would like to see in the future:</p>
<ul style="text-align: justify;">
<li>Better ways to simulate attackers (vs classic pen tests)</li>
<li>Faster and more agile countermeasure creation &amp; deployment</li>
<li>Better data gathering about attackers</li>
<li>Stronger economical research on attack dynamics</li>
</ul>
<div style="text-align: justify;">At the opposite, let&#8217;s avoid:</div>
<div style="text-align: justify;">
<ul>
<li>Cyber witch hunts</li>
<li>Military solutions to technical issues</li>
<li>VC-backed snakeoil companies</li>
</ul>
</div>
<p style="text-align: justify;"><a href="http://www.twitter.com/thuxnder">Patrick Schulz</a> and <a href="http://www.twitter.com/pleed">Felix Matenaar</a> were the first regular speakers with their talk about Android: &#8220;<em>Android application reverse engineering and defences</em>&#8220;. They started with a motivating example. First step, the static information gathering: This can be achieved by decompiling the application, examining the Type System (classes) and APIs. It&#8217;s quite easy with Android. Then, the dynamic analysis is performed with sandboxes and debuggers like <a href="https://code.google.com/p/android-apktool/">APKTool</a>. What are the Interesting stuffs to look for? Data validation, license checks and client checks are good examples. Then you can add extra code and redistribute the application. So, from a developer perspective, how to avoid this? How to protect your applications and how to address those problems?</p>
<p style="text-align: justify;"><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3232.jpg" alt="Patrick &amp; Felix" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3232.jpg" width="225" height="300" border="0" /></p>
<p style="text-align: justify;">To prevent static analysis, use code obfuscation, dynamic code loading. You can also make code harder to read. Some tools are referred <a href="http://resources.infosecinstitute.com/android-malware-analysis">here</a>. Application modification (or temper proofing) is another risk. Run time integrity checks. React to the fact that your application has been modified or repacked. Hide interesting code and make it harder for malware authors to repack it. A technique presented by the speakers was &#8220;<em>Manifest Cheating</em>&#8220;. Inject a &#8220;name&#8221; attribute in the application tag with ID 0 and value &#8220;detect.class&#8221;. It will be skipped by packet but will make APKtool to crash when analysing the file later. If you really implement the detect.class, it will be executed and you&#8217;ll know that your application was repacked. Runtime integrity checks can be implemented like checking the application signature. Dynamic analysis or anti-runtime analysis: Use techniques like debugger detection and prevention.</p>
<p style="text-align: justify;">Then the floor was open to improvised lightning talks and discussions. First, Dildog presented some tests he make yesterday night with URLs and Unicode characters that make Google Drive creating non-deletable files on the filesystem. Funny! Then, some tools were presented again by Patrick and Fellow. Finally, I quickly introduced my <a href="https://github.com/xme/pastemon">tool</a> to monitor pastebin.com.</p>
<p style="text-align: justify;">After a lunch and some good conversations enjoying the sunny weather over Dublin, the last half-day restarted with <a href="http://www.twitter.com/rockdon">Peter Morgan</a> and <a href="http://www.twitter.com/day6reak">John Villamil</a>. They presented &#8220;<em>Monkeyherd: Stay fuzzy my friends</em>&#8220;. This is a fuzzing tool developed by <a href="http://www.accuvant.com/capability/accuvant-labs">Accuvant Labs</a> and is definitively an offensive tool. People usually know simple fuzzing tools but it can quickly become more complex to implement. Question from the speakers: Why aren&#8217;t more companies doing fuzzing? Some are doing well (like Google, Microsoft, Mozilla) but it requires motivation to deal with discovered bugs, company resources and experience to execute this process.</p>
<p style="text-align: justify;"><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3233.jpg" alt="Peter &amp; John" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3233.jpg" width="300" height="225" border="0" /></p>
<p style="text-align: justify;">They explained deeply how to implement distributed fuzzing. Monkeyhard is deployed in the Amazon EC2 cloud and based on tools like SSH, Git, Ruby/Python and Redis. It can also perform GUI automation, dynamic binary instrumentation and uses a C&amp;C to keep track of discovered vulnerabilities. It looks to be a very powerful tool.</p>
<p style="text-align: justify;">Ben Williams was the following guest with a talk about hacking appliances. This was a talk that he already performed in Amsterdam for <a href="http://blog.rootshell.be/2012/03/15/blackhat-europe-2012-day-2-wrap-up/">BlackHat 2012</a>. Then he presented an update of his research this year again at BlackHat. As I missed it due to an agenda conflict, it was a good opportunity to refresh my mind. What&#8217;s new? Nothing much! Security vendors still fail to properly protect their appliances. They are usually considered as &#8220;safe&#8221; and deployed in DMZ but some, providing basic network services, can be connected to internal networks. They also receive lot of prices as &#8220;product of the year&#8221;, scarry!</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3234.jpg" alt="Ben Williams" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3234.jpg" width="300" height="225" border="0" /></p>
<p style="text-align: justify;">Who were Ben&#8217;s victims:</p>
<ul style="text-align: justify;">
<li>Sophos Email Appliance (v3.7.4.0): Admin webgui attack with a 500 passwords list. Done! (No protection against bruteforce or account lockout). OS command injection and reflective attack.</li>
<li>Citrix Remote Access Gateway: authentication bypass &amp; port forwarding via SSH</li>
<li>Symantec Email Gateway: owned by receiving a mail and spawn a root shell.</li>
<li>TrendMicro Email Gateway.</li>
</ul>
<div style="text-align: justify;">All those example were completed using classic penetrating testing techniques! Most appliances are not hardened. Based on Linux or FreeBSD, the following components are often installed: compiler, tcpdump, debugger, perl, python, etc. Ben&#8217;s conclusions are: don&#8217;t close your eyes when buying a security appliance. Ask the vendor what kind of hardening is performed and include them in your pentest scopes. Like the previous editions, a nice talk with funny screenshot and (horror) stories. Good job Ben!</div>
<div style="text-align: justify;"></div>
<p style="text-align: justify;">Last but not least, Nick Hiliard presented &#8220;<em>The DDoS that didn&#8217;t almost break the Internet</em>&#8220;. Everybody remembers the massive DDoS attack against <a href="http://blog.cloudflare.com/the-ddos-that-almost-broke-the-internet">SpamHaus</a> a few months ago. Nick came back on this story and gave interesting details about how it happened. Everything started on March 18th with a DDoS against the website and blacklist servers operated by SpamHaus. They asked the help of CloudFlare to mitigate the attacks.</p>
<p style="text-align: justify;"><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3235.jpg" alt="Nick Hiliard" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3235.jpg" width="300" height="225" border="0" /></p>
<p style="text-align: justify;">Nick explained how the attack was performed: It was based on <a href="http://www.us-cert.gov/ncas/alerts/TA13-088A">DNS amplification</a>: a DNSSEC query for &#8220;ANY ripe.net&#8221; is 54 bytes but DNSSEC replies to this query with 3181 bytes (58x amplification!). 27 millions of open DNS servers are available in the Internet (source: <a href="http://openresolver.org">openresolver.org</a>). The attackers were a mix of compromised end-users, compromised WordPress/Joomly instances and VPS servers.  Most important, what are the lessons learned:</p>
<ul style="text-align: justify;">
<li>Unicast flood control is critical on IXPs</li>
<li>Use OOB networks to manage your critical devices!</li>
<li>IXP peeing IP&#8217;s should probably not be routed on the Internet</li>
<li>Reality rarely gets in the way of a good headline</li>
<li>Bad guys are careful not to get caught</li>
</ul>
<p style="text-align: justify;">Finally, keep in mind: botnets are large and use <a href="http://tools.ietf.org/html/bcp38">BCP38</a> and DNS ACLs</p>
<p style="text-align: justify;">The presentation about &#8220;SQL Post-exploitation&#8221; was cancelled, the speaker was not able to join the conference. The SOURCE conference is now over! Thanks to Stacy &amp; Christien for the organisation and to accept me as a speaker. If we met during the conference and have questions about my talk or tools, feel free to contact me! See you next year, again in Dublin?</p>
<img src="http://feeds.feedburner.com/~r/dev/rand/~4/NoGe7bkxtYs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.rootshell.be/2013/05/24/source-dublin-wrap-up-day-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SOURCE Dublin Wrap-Up Day #1</title>
		<link>http://blog.rootshell.be/2013/05/24/source-dublin-wrap-up-day-1/</link>
		<comments>http://blog.rootshell.be/2013/05/24/source-dublin-wrap-up-day-1/#comments</comments>
		<pubDate>Fri, 24 May 2013 07:20:18 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Event]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Dublin]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://blog.rootshell.be/?p=21601</guid>
		<description><![CDATA[I flew on Wednesday evening to Dublin, Ireland to attend the SOURCE conference (previously, it was organised in Barcelona). The conference was held in the Trinity College, in the centre of the city. This is a really nice place where we slept in student bedrooms (a &#8220;kot&#8221; like we say in Belgium), this reminded my good old years as a student. Nice atmosphere! The first <span class="ellipsis">&#8230;</span> <span class="more-link-wrap"><a href="http://blog.rootshell.be/2013/05/24/source-dublin-wrap-up-day-1/" class="more-link"><span>Read More &#8594;</span></a></span>]]></description>
				<content:encoded><![CDATA[<p><img class="alignleft  wp-image-9380" style="border: 0px;" title="SOURCE Barcelona.jpg" alt="IMG 3217" src="http://blog.rootshell.be/wp-content/uploads/2013/05/SOURCE-Barcelona.jpg" width="158" height="210" border="0" /></p>
<div style="text-align: justify;">I flew on Wednesday evening to <a href="http://en.wikipedia.org/wiki/Dublin">Dublin</a>, Ireland to attend the SOURCE conference (previously, it was organised in Barcelona). The conference was held in the <a href="http://www.tcd.ie">Trinity College</a>, in the centre of the city. This is a really nice place where we slept in student bedrooms (a &#8220;<em>kot</em>&#8221; like we say in Belgium), this reminded my good old years as a student. Nice atmosphere!</div>
<div style="text-align: justify;"></div>
<div style="text-align: justify;"></div>
<div style="text-align: justify;"><span id="more-21601"></span></div>
<div style="text-align: justify;">The first day, as usual, started with a keynote. <a href="http://www.twitter.com/halvarflake">Halvar Flake</a>, from Google, made an interesting comparison between our history and the Internet. He also compared the Navies with Internet defenders. Today, Internet is a must-have. The cheapest way to transfer stuff is via the Internet. It&#8217;s like a new continent and it must be protected. We need &#8220;<em>Navies</em>&#8220;. Back to the 1500&#8242;s, Spain was a very powerful country. Spanish sailors discovered the new world. Can we compare them to hackers?</div>
<div>
<p style="text-align: justify;">During the pre-2000 years, hackers were mostly explorers (non goal/profit oriented). There was a low trade volume, but  it changed with the first boom of the dot-com companies.. The Internet was a nearly complete legal vacuum. The &#8220;<em>law of the strongest</em>&#8221; was applicable. In 2001, teens controlled huge DDoS networks. It was the time of 0-days &#8220;<em>Internet-ending</em>&#8221; and a significant percentage of Internet was pwned by amateurs.  This pre-2000 Internet is similar to 1500&#8242;s in Spain. Durng the 1600&#8242;s: there was wars between multiple countries:  Spain VS France VS Britain VS Holland and small-scale pirates switched into large-scale organisations. In 2001-2013: Internet faced rapid economic &amp; societal changes trough the adoption of network. It was the rise of privateering: Governments realised the importance of Internet. The hackers community split into interesting fragments: Surveillance / monitoring. What are the different types of actors?</p>
<ul>
<li>Navy: full-government employment</li>
<li>Privateers: hackers working as private org</li>
<li>Mercenaries: hackers working to protect new trade routes</li>
</ul>
<div><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3218.jpg" alt="Halvar Flake" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3218.jpg" width="225" height="300" border="0" /></div>
<p style="text-align: justify;">What about the future according to Halvar? Any document opened can lead to an open door for an attacker. That&#8217;s why sandboxing will be more and more used. But what&#8217;s next? He predicts a transitive trust is the silent killer (example: stealing signing keys from well-known vendors). Another question: Why exploit if I can update? Interesting keynote, I liked the comparison with the previous centuries.</p>
<p style="text-align: justify;">After the keynote, regular presentation started, the first one was performed by <a href="http://www.twitter.com/selenakye">Allison Miller</a> from Electronic Arts. Her topic was &#8220;<em>Games We Play: Payoffs &amp; Chaos Monkeys</em>&#8221; or a game theory. Games are a big business today, there are millions of players on the Interent. Previously, games were distributed via resellers but today, the business model changed and companies developing games also sell them directly to the end-users and sell extra stuff. This means that have to implement fraud detection control like any financial companies. Electronic Arts implemented such a system. The main goal is to estimate the type of controls we need to deploy. That&#8217;s the job of Allison. Game theory can apply to real-life games like rock-paper-scissors or simply choosing left or right. It&#8217;s a branch of applied mathematics and it provides a framework to study decisions made by players. It is used in economy, military, negotiation, business etc. Allison reviewed some mechanics (payoff matrix, decision trees, etc) and explained how to implement them based on formulas.</p>
<p style="text-align: justify;"><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3219.jpg" alt="Let's play some game" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3219.jpg" width="300" height="225" border="0" /></p>
<p style="text-align: justify;">To implement this, we have to:</p>
<ul>
<li style="text-align: justify;">Identify players</li>
<li style="text-align: justify;">Clarify the rules</li>
<li style="text-align: justify;">Define a strategy (show me your moves)</li>
<li style="text-align: justify;">Describe Payoffs</li>
<li style="text-align: justify;">Single move or repeated game</li>
</ul>
<p style="text-align: justify;">After her slides about theory, Allison switched to the real world. What&#8217;s important: the rationality of actors and payoffs value. She gave a first example with the 2/3 game. For rock-paper-scissors, the best strategy to maximise chances to win is randomisation. Same for a penalty kick but if the kicker is better on left and the goal know that, it changes the strategy. Attackers and defenders can be compared to them. Finally, Allison explained that the game theory is used by risk management. Risk management is decision management. The talk was interesting but without real implementation example. I discussed with Allison during the speakers dinner and she gave me more details.</p>
<p style="text-align: justify;">After a coffee break, the next talk was presented by myself. It was the same talk as the one of <a href="http://blog.rootshell.be/2012/11/04/hashdays-wrap-up-day-2/">Hashdays</a> last year. It went smoothly and I had interesting conversations with attendees during the day.</p>
<p style="text-align: justify;">Then followed <a href="http://www.twitter.com/securityninja">David Rook</a> with the talks he performed in <a href="http://www.securitybsides.org.uk/">BSidesLondon</a> last month. I missed it the first time so I was happy to be present today. David works for Realex and is busy with application security. He explained how he developed a strong security policy based on a strict SDLC (&#8220;<em>Software Development Life Cycle</em>&#8220;). It&#8217;s not easy to change the habits of developers. It took times and a lot of efforts. David explained this like a story with very nice slides.</p>
<p style="text-align: justify;"><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3220.jpg" alt="David Rook" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3220.jpg" width="300" height="225" border="0" /></p>
<p style="text-align: justify;">The very first step was to review the legacy code: &#8220;<em>SDLC? What SDLC?!</em>&#8221; A first SDLC can be very simple (Use the &#8220;<em>KISS</em>&#8221; principle &#8211; Keep It Simple and Stupid): It was a Visio drawing with 4 squares. Then came, the first automation phase: security testing using BurpSuite. Then, threat modelling was implemented (based on the Microsoft approach but modified to best suit the needs). Then hired an external auditor to improve the SDLC: From 30 pages of improvements in 2008, they reached 2 pages in 2011! It&#8217;s important to share the knowledge: Talk to conferences, write blogs. They also switched from one big development department to small teams more focused on products. Each team does everything with strong focus on their applications. Then came the automation phase 2. The goal was to make security review easy and repeatable. The software Agnitio replaced old Word documents and Excel sheets. Can two companies use the same processes and SDLC? According to David, yes! With a strong SDLS, resource planning becomes more easy and  teams can grow. It&#8217;s also more easy to estimate and get the resources (read: better budget control). Based on his experience, David reported the three main categories of errors in code:</p>
<ul>
<li style="text-align: justify;">Input validation</li>
<li>Output encoding,</li>
<li>Error handling</li>
</ul>
<p style="text-align: justify;">What&#8217;s the focus today? Mobile applications! Don&#8217;t forget them and implement the same controls. Very good presentation, this is a must-read for all developers or project managers.</p>
<p style="text-align: justify;">After the lunch, <a href="http://www.twitter.com/brianhonan">Brian Honan</a> spoke about &#8220;<em>Learning from history</em>&#8220;. The talks started with an introduction to his baby: the <a href="http://www.iriss.ie/iriss/">Irish CERT</a>. It started in 2004 when there was no real structure in place. In 2008, IRISS was born but still without a strong structure (based on volunteers, no dedicated infrastructure, etc). Then Brian make a comparison of security defences with a classic Irish defense model: layers, perimeter defence, small ingress, egress doors. I like the following comparison:</p>
<blockquote>
<p style="text-align: justify;">&#8220;Security is like an egg: It will resist to press it on top and bottom but will break if you press it on the sides!&#8221;</p>
</blockquote>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3222.jpg" alt="Brian Honan" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3222.jpg" width="225" height="300" border="0" /></p>
<p>IRISS participated to the Verizon DBIR and Brian mentioned interesting statistics from this report:</p>
<ul>
<li>69% of data breaches were detected by 3rd parties</li>
<li>62% months or more</li>
<li>78% not complicated</li>
<li>74% due to phishing</li>
</ul>
<p>Still today, most attacks use a classic scenario: phishing &gt; rogue website &gt; malicious code &gt; pwned.</p>
<p>The organised crime is growing and DDoS, extrusion are common. What are the root causes?</p>
<ul>
<li>Poor passwords</li>
<li>Patches</li>
<li>Vulnerabilities in web platforms</li>
<li>Out-of-date AV signatures</li>
<li>Lack of monitoring</li>
</ul>
<p>How to improve the situation?</p>
<ul>
<li>Learn and understand your business! Read the business plan.</li>
<li>Don&#8217;t forget the basics.</li>
<li>Strong passwords (use two factors authentication?)</li>
<li>Monitor your logs</li>
<li>Harden systems</li>
<li>Use security tools</li>
<li>Segment your information</li>
<li>Analyse network patterns</li>
<li>Train staff &amp; partners</li>
<li>Use open source data (pastebin, google alerts, shield, Arakis (?)</li>
<li>Set traps (but properly!)</li>
<li>Share with peers (veriscommunity.net/doku.php)</li>
</ul>
<p>Another Brian&#8217;s quote:</p>
<blockquote><p>&#8220;Data breach is like toothpaste! Once it&#8217;s out, it&#8217;s difficult to get it back in!&#8221;</p></blockquote>
<p>Great talk, great speaker, what else?</p>
<p style="text-align: justify;">The next talk was presented by <a href="http://www.twitter.com/flyingpenguin">Davi Ottenheimer</a> about &#8220;<em>Big data security: Emerging threats and how to predict them</em>&#8220;. Big data? Everything has been said about bid data! Davi explained that big data can be compared to a wave. You can&#8217;t look at only a piece of it. Open your scope wider and wider.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3223.jpg" alt="Davi Ottenheimer" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3223.jpg" width="300" height="225" border="0" /></p>
<p style="text-align: justify;">After some example about big-data, he mentioned interesting example where the amount of data that we could grab from somebody could be re-used to improve online services or authentication. The first example was about the music online service Pandora&#8217;s box. Today, songs are selected based on the gender, the tones, sales, etc. But more interaction could be added to select right songs with the help of the weather and more precisely who you are and what you do. Example? Chose appropriate songs while jogging. The same could apply to authentication. Today we tend to implement 2-factors authentication. Why not switch to a n-factors authentication? Using factors coming from multiple personal devices like mp3 players, watches, etc). Davi called this &#8220;<em>the modern spice of life</em>&#8220;.</p>
<p style="text-align: justify;">Then, <a href="http://www.twitter.com/simonroses">Simon Roses Fermeling</a> presented his talk &#8220;<em>Dude, where&#8217;s my laptop?</em>&#8220;. I already saw this presentation during BlackHat Europe. He changed some slides but my wrap-up is already online <a href="http://blog.rootshell.be/2013/03/15/blackhat-europe-2013-wrap-up-day-2/">here</a>. A great research! Just keep in mind: do NOT trust anti-theft applications!</p>
<p><img style="text-align: justify; display: block; margin-left: auto; margin-right: auto;" title="IMG_3224.jpg" alt="Simon Roses" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3224.jpg" width="300" height="225" border="0" /></p>
<p style="text-align: justify;">To close the first day, <a href="http://www.twitter.com/dildog">Christien Rioux</a> working for Veracode but also the organiser of SOURCE, spoke about static binary analysis. This is normally a talk of two hours. It was compressed to 40 mins and was quite… intensive! <img src='http://blog.rootshell.be/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  They are two ways to perform binary analysis:</p>
<ul>
<li style="text-align: justify;">Static (by reversing the code and understanding it)</li>
<li>Dynamic (by executing the code &#8211; in a sandbox as example)</li>
</ul>
<div style="text-align: justify;">Christien explained deeply how does static binary analysis works. For sure, it&#8217;s not easy!  The key element is the &#8220;<em>IR</em>&#8221; or &#8220;<em>Intermediate Representation</em>&#8220;. It can be defined as a data structure that is transformable and represent language and architectural elements to build software. In this IR, we can find all the classic elements of a program: functions, variables, etc. After lot of theory, a video with a demo of the Veracode tool was displayed showing how a binary can be reversed and code being regenerated. Impressive (even if I did not followed all the steps)</div>
<div style="text-align: justify;"></div>
<div style="text-align: justify;">After the talks, some fun. We had the speakers dinners then the party with free beers and interesting conversations. Stay tuned for the second day wrap-up soon!</div>
<div style="text-align: justify;"></div>
<div></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
<img src="http://feeds.feedburner.com/~r/dev/rand/~4/Yz4MHfimGRY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.rootshell.be/2013/05/24/source-dublin-wrap-up-day-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>NoSuchCon #1 Wrap-Up</title>
		<link>http://blog.rootshell.be/2013/05/17/nosuchcon-1-wrap-up/</link>
		<comments>http://blog.rootshell.be/2013/05/17/nosuchcon-1-wrap-up/#comments</comments>
		<pubDate>Fri, 17 May 2013 20:42:55 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Event]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Paris]]></category>

		<guid isPermaLink="false">http://blog.rootshell.be/?p=21542</guid>
		<description><![CDATA[There are so many security conferences around the world… Some people already debated about this: Is it better to restrict the annual agenda to well-known events or let people start their own? IMHO, we need initiatives like this. It&#8217;s good to have a broad agenda with local conferences where local people can attend without spending huge amounts of money for travels and lodging (If you <span class="ellipsis">&#8230;</span> <span class="more-link-wrap"><a href="http://blog.rootshell.be/2013/05/17/nosuchcon-1-wrap-up/" class="more-link"><span>Read More &#8594;</span></a></span>]]></description>
				<content:encoded><![CDATA[<p><img class="alignleft  wp-image-9380" style="border: 0px;" title="IMG_3199.jpg" alt="NoSuchCon Kit" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3199.jpg" width="210" height="158" border="0" /></p>
<p style="text-align: justify;">There are so many security conferences around the world… Some people already debated about this: Is it better to restrict the annual agenda to well-known events or let people start their own? IMHO, we need initiatives like this. It&#8217;s good to have a broad agenda with local conferences where local people can attend without spending huge amounts of money for travels and lodging (If you can go to conferences, let&#8217;s bring the conferences to you!) So, let&#8217;s welcome the newly born conference called &#8220;<em>NoSuchCon</em>&#8220;. The <a href="http://nosuchcon.org">first</a> edition was just organized in Paris across the last three days. Unfortunately, I was only able to attend the last day… If only I could expand my holidays like a filesystem! <img src='http://blog.rootshell.be/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  I joined Paris early the morning to attend the first keynote. Here is a quick review of the day.</p>
<p style="text-align: justify;"><span id="more-21542"></span></p>
<p style="text-align: justify;">Today&#8217;s keynote was presented by <a href="https://twitter.com/DmitriCyber">Dmitri Alperovitch</a> (from Crowdstrike). His presentation had only… one slide, displayed at the end of his keynote! The first message broadcasted by Dmitri was &#8220;<em>We are doing wrong!</em>&#8220;. Is it really a breaking news? No, major vendors, browsers, mobile phones, all of them are working to improve their security. We also have Next-Generation firewalls, powerful forensic tools and medias are talking about &#8220;<em>cyber-*</em>&#8221; (replace the star with your favourite term) and are trying to do some awareness. So what?</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3186.jpg" alt="Dmitri Alperovitch" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3186.jpg" width="300" height="225" border="0" /></p>
<p style="text-align: justify;">This is a paradox! Even with all those changes, we are still unable to block our adversaries. Our desire to have a &#8220;<em>one-size-fits-all</em>&#8221; security solution is bad. We have very specific issues to address. One category of actors are hacktivists. Another one is espionage. Classic defences approach do not work with those actors. Offensive is more lucrative and cheaper. If you increase your defences, offensive guys will grow too. This is a never-ending story. A good example are DDoS. Increasing your pipe to the Internet (bandwidth) and server farms will not solve the problem. Attackers will use bigger bots! Also, how to defend against national agencies which have huge budgets? Know your enemy, this will allow you to break the asymmetry between attack &amp; defense.  Find the pin-point and push on it. Attackers usually focus on a target and don&#8217;t have a look at its competitor. An idea proposed by Dmitri: can a &#8220;<em>bounty hunter</em>&#8221; program law  help to catch attackers? Dmitri brought a big suitcase full of t-shirts and distributed them after his keynote. That&#8217;s for the show but it&#8217;s always funny to get goodies!</p>
<p style="text-align: justify;">The first half-day was dedicated to presentations about the Windows kernel. A first one was performed by <a href="https://twitter.com/lilhoser">Aaron LeMasters</a> about &#8220;<em>Crashdmp-ster diving the Windows 8 crash dump stack</em>&#8220;. The Microsoft crash dump mechanism is an interesting component of the operating system. Aaron performed some researches about this feature. His project is hosted on <a href="http://crashd.mp/">crashd.md</a>.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3190.jpg" alt="Aaron LeMasters" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3190.jpg" width="225" height="300" border="0" /></p>
<p style="text-align: justify;">The crash dump mechanism is a layer driver providing an I/O path to a mass storage device. It is used in two situations: when a bug check occurs (hey, it&#8217;s Windows! <img src='http://blog.rootshell.be/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ) or to hibernate the system (<a href="http://windows-dll.com/en-us/what/crashdmp-sys/">crashdmp.sys</a>). Aaron describe how it works. Note that the mechanism is different between Windows XP &#8211; 7 and Windows 8. With  the last version of the Microsoft OS, the crash dump subsystem can be tricked into reading and writing everywhere. That&#8217;s what Aaron explained during his talk. Based on his research, he also wrote a CTF <a href="http://crashd.mp/?p=54">challenge</a> for SOURCE Boston and explained in details how it worked. The source code will be released soon, check out his website.</p>
<p style="text-align: justify;">Then, a second talk immediately followed: &#8220;<em>Exploiting hard core pool corruption in Microsoft Windows kernel</em>&#8221; by <a href="https://twitter.com/NTarakanov">Nikita Tarakanov</a>. Today, many applications implement sandboxes (ex: browsers). To evade sandboxes, a good idea is to abuse… the low level… the kernel.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3191.jpg" alt="Nikita Tarakanov" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3191.jpg" width="300" height="225" border="0" /></p>
<p style="text-align: justify;">Once broken, you have access to everything. Previous vulnerabilities found in Windows kernels are memory corruption. Today, known techniques do no work anymore with Windows 8. First, Nikita reviewed how kernel pool is working and what were the &#8220;<em>old</em>&#8221; attacks. The next part covered a new attack which works on all versions of Windows: DKOHM (&#8220;<em>Direct Kernel Object Header Manipulation</em>&#8220;).</p>
<p style="text-align: justify;">After a lunch break in a small Parisian restaurant, eating and talking about security, the second set of talks started again. The first one was &#8220;<em>XML &#8211; Out-of-band exploitation</em>&#8221; by <a href="https://twitter.com/a66at">Yunusov Timur </a>and Alexey Osipov. First part was about<a href="http://www.w3resource.com/xml/parameter-entities.php"> parameter entities</a> (&#8220;<em>PE</em>&#8220;). Speakers reviewed then and how they work.  How work out-of-band attacks? The attacker send XML to the server which parses it and requests data from the malicious host.</p>
<p style="text-align: justify;"><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3193.jpg" alt="Yunusov &amp; Alexey" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3193.jpg" width="225" height="300" border="0" /></p>
<p style="text-align: justify;">They also performed demos of exfiltrating data from via an XML file: <span style="text-align: justify;">Using DNS requests made during XML document XSLT transformation to extract information via a bunch of A queries to forged names. An other</span> demo was to grab /etc/passwd from a website just be trying to validate an XML file. Sweet!</p>
<p style="text-align: justify;">The next talk was again about kernels but this time on MacOS X! Pedro Vilaca presented &#8220;<em>Revisiting Mac OS X kernel root kits</em>&#8220;. Rootkits are kernel extensions. Pedro reviewed interesting ideas to make them more powerful. The Mac OS landscape has less researchers and lack of public developments about rootkits. But it does not mean that more are working in the wild. Great job performed by Pedro but difficult to maintain due to the operating system being closed source.</p>
<p style="text-align: justify;">After a coffee break, the last run of talks started. Luigi Auriemma &amp; Donato Ferrante presented &#8220;<em>Exploiting game engines for fun &amp; profit</em>&#8220;.</p>
<p style="text-align: justify;"><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3196.jpg" alt="Exploiting Game Engines" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3196.jpg" width="225" height="300" border="0" /></p>
<p style="text-align: justify;">Why target games? Because the attack surface is huge! Did you know that some engines are sold with special licenses to military organisations? Almost all kind of people are playing once back at home. Even C-level people can be gamers during their free time. This can be a nice way of exploiting their company. The same engine can be shared across multiple games (and stuff added like Lego-blocks). The same vulnerability can be re-used! Gain of time and $$$. Game engines can be attacked on four topics:</p>
<ul>
<li>Fragmented packets: Games are based on UDP protocol but they try to implement a TCP-over-UDP. When fragmentation occurs, the engine must rebuild the original packet. This process is performed in memory. What about trying to place the payload of a packet in another memory area?</li>
<li>Compression: Not algorithms but index numbers.Flipping bits can be interesting</li>
<li>Game Protocols:</li>
<li>Customization (extensions also called &#8220;mods&#8221; and command line)</li>
</ul>
<p style="text-align: justify;">After the theori, the speakers performed some live demos. Check out <a href="http://revuln.com">revuln.com</a> for their white paper released today!</p>
<p style="text-align: justify;">For the next talk, the planning changed. The scheduled speaker was not able to come to France due to a visa issue. Weird! A last minute (but excellent!) speaker replaced him: <a href="http://www.cs.dartmouth.edu/~sergey/">Sergey Bratus</a> presented &#8220;<em>Any input is a program</em>&#8220;. I was lost, his topic was too complex! I don&#8217;t know how many people were able to fillow him in the audience.</p>
<p style="text-align: justify;"><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3197.jpg" alt="Sergey Bratus" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3197.jpg" width="225" height="300" border="0" /></p>
<p style="text-align: justify;">The last talk was &#8220;<em>Killing rats with incident response process</em>&#8221; by Robinson Delaugerre and Adrien Chevalier. The result of their research is a new framework called Arsenic which will be released soon. The goal is to perform incident response in a easy way. They started the talk with some facts about incident handling and how complex it can be.</p>
<p style="text-align: justify;"><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3198.jpg" alt="Arsenic Framework" src="http://blog.rootshell.be/wp-content/uploads/2013/05/IMG_3198.jpg" width="300" height="225" border="0" /></p>
<p>This process is based on three pillars:</p>
<ul>
<li>Network analysis</li>
<li>Host forensics</li>
<li>Reverse engineering</li>
</ul>
<p>Arsenic is a their framework, written in Ruby, which brings those pillars together. They also performed live demos to detect a well-known RAT (<a href="http://www.poisonivy-rat.com/">Poison Ivy</a>). It seems to be an interesting tool.</p>
<p style="text-align: justify;">And that&#8217;s already done. That was a quick but interesting visit to this new event. Again, NoSuchCon, welcome in the world of security conferences! Organizers made it a success with 250 attendees (number received from a member of the organisation). I liked particularly:</p>
<ul>
<li style="text-align: justify;">The idea of a &#8220;<em>one-cay</em>&#8221; pass for people who were not able to block three consecutive days.</li>
<li style="text-align: justify;"><a href="http://www.nosuchcon.org/talks/">Slides</a> were available a few minutes before the talk (useful for people sitting far from the beamer)</li>
<li style="text-align: justify;">The conference <a href="http://travisgoodspeed.blogspot.be/2012/07/emulating-usb-devices-with-python.html">Facedancer</a> badge (made by Travis Goodspeed)</li>
<li style="text-align: justify;">Live streaming</li>
</ul>
<img src="http://feeds.feedburner.com/~r/dev/rand/~4/huMu3V9uHRs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.rootshell.be/2013/05/17/nosuchcon-1-wrap-up/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Improving File Integrity Monitoring with OSSEC</title>
		<link>http://blog.rootshell.be/2013/05/13/improving-file-integrity-monitoring-with-ossec/</link>
		<comments>http://blog.rootshell.be/2013/05/13/improving-file-integrity-monitoring-with-ossec/#comments</comments>
		<pubDate>Mon, 13 May 2013 15:00:05 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[OSSEC]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[FIM]]></category>
		<category><![CDATA[patch]]></category>

		<guid isPermaLink="false">http://blog.rootshell.be/?p=21440</guid>
		<description><![CDATA[FIM or &#8220;File Integrity Monitoring&#8221; can be defined as the process of validating the integrity of operating system and applications files with a verification method using a hashing algorythm like MD5 or SHA1 and then comparing the current file state with a baseline. A hash will allow the detection of files content modification but other information can be checked too: owner, permissions, modification time. Implemeting file integrity monitoring is <span class="ellipsis">&#8230;</span> <span class="more-link-wrap"><a href="http://blog.rootshell.be/2013/05/13/improving-file-integrity-monitoring-with-ossec/" class="more-link"><span>Read More &#8594;</span></a></span>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;"><img class="alignleft size-full wp-image-21444" alt="File Integrity Error" src="http://blog.rootshell.be/wp-content/uploads/2013/05/file-integrity-violated.jpg" width="179" height="126" />FIM or &#8220;<em>File Integrity Monitoring</em>&#8221; can be defined as the process of validating the integrity of operating system and applications files with a verification method using a hashing algorythm like MD5 or SHA1 and then comparing the current file state with a baseline. A hash will allow the detection of files content modification but other information can be checked too: owner, permissions, modification time. Implemeting file integrity monitoring is a very good way to detect compromized servers. Not only operating system files can be monitored (/etc on UNIX, registry on Windows, share libraries, etc) but also applications (monitoring your index.php or index.html can reveal a defaced website).</p>
<p style="text-align: justify;">During its implementation, a file integrity monitoring project may face two common issues:</p>
<ul>
<li style="text-align: justify;"><span style="line-height: 13px;">The baseline used to be compared with the current file status must of course be trusted. To achieve this, it must be stored on a safe place where attacker cannot detect it and cannot alter it!</span></li>
<li style="text-align: justify;">The process must be fine tuned to react only on important changes otherwise they are two risks: The real suspicious changes will be hidden in the massive flow of false-positives. People in charge of the control could miss interesting changes.</li>
</ul>
<p style="text-align: justify;">There are plenty of tools which implement FIM, commercial as well as free. My choice went to <a title="Link to the OSSEC website" href="http://www.ossec.net">OSSEC</a> for a while. My regular followers know that I already posted lot of articles about it. I also contributed to the project with a patch to add <a title="Link to the blog article" href="http://blog.rootshell.be/2012/06/05/attackers-geolocation-in-ossec/">Geolocatization</a> to alerts. This time, I wrote another patch to improve the file integraty monitoring feature of OSSEC.</p>
<p style="text-align: justify;"><span id="more-21440"></span>FIM has been part of the OSSEC <a title="Link to the OSSEC features page" href="http://www.ossec.net/?page_id=165">features</a> for a while and is handled by the syscheckd daemon running on all agents. How does OSSEC address the common issues reported above? To keep the baseline integrity, the databases of files (or registry for Windows agents) are stored on the manager itself. This manager is normally a well-protected server where all the OSSEC intelligence is stored. About false-positives, OSSEC implement several ways to prevent them. <span style="line-height: 13px;">Some files can be ignored with an &lt;ignore&gt; XML tag in ossec.conf:</span></p>
<pre>&lt;syscheck&gt;
    &lt;ignore&gt;/etc/mnttab&lt;/ignore&gt;
&lt;/syscheck&gt;</pre>
<p style="text-align: justify;"><span style="line-height: 13px;">This is easy to exclude files but it&#8217;s a pain to manage! Some files can be excluded using specific OSSEC rules:</span></p>
<pre>&lt;rule id="100000" level="0" &gt;
    &lt;if_group&gt;syscheck&lt;/if_group&gt;
    &lt;description&gt;Ignored file changes&lt;/description&gt;
    &lt;match&gt;/etc/mnttb|/etc/hosts|/etc/resolv.conf&lt;/match&gt;
    &lt;hostname&gt;srv1&lt;/hostname&gt;
&lt;/rule&gt;</pre>
<p style="text-align: justify;">This rule will disable notification if any change is detected on srv1 in /etc/mnttab, /etc/hosts or /etc/resolv.conf. Note that another control exists: B<span style="line-height: 13px;">y default when a file has changed three times, new changes will be automatically ignored. Handy but&#8230; it could be improved!</span></p>
<p style="text-align: justify;">When I&#8217;m deploying security tools and control, my goal is to reduce the &#8220;noise&#8221; as much as possible. A side effect of file integrity monitoring is the number of false positive alerts generated when patching your systems. Keeping the latest patch level is important but hundreds of files can be replaced only by one new package! That&#8217;s why I wrote the following patch for OSSEC (more precisely for the analysisd daemon which is responsible of the decoding and alerting of events generated by agents).</p>
<p style="text-align: justify;">I added a SQLite3 DB which contains a list of MD5 hashes to ignore when reported by agents. When a file change is reported, its <strong>NEW</strong> MD5 hash is looked up in the DB. If found, the change is ignored. Why an external SQL database to store the hashes? To be easily populated by external tools as seen in the following schema:</p>
<p style="text-align: justify;"><img class="aligncenter size-medium wp-image-21468" alt="OSSEC-FIM-MD5" src="http://blog.rootshell.be/wp-content/uploads/2013/05/OSSEC-FIM-MD5-300x225.png" width="300" height="225" /></p>
<p style="text-align: justify;">To active this feature, apply the patch, create a SQLite3 database:</p>
<pre>CREATE TABLE files (
    md5sum VARCHAR(32),
    file VARCHAR(256),
    time DATETIME
);
CREATE UNIQUE INDEX files_idx ON files(md5sum);</pre>
<p style="text-align: justify;">Then, just define the MD5 database in the main ossec.conf file on your OSSEC server:</p>
<pre style="text-align: justify;">&lt;global&gt;
    &lt;md5db&gt;/etc/md5.db&lt;/md5db&gt;
&lt;/global&gt;</pre>
<p style="text-align: justify;">This database must contains all the MD5 hashes that you want to ignore. On Ubuntu, it&#8217;s easy to find all hashes of installed files in /var/lib/dpkg/info/*.md5sums. I wrote a simple Python script to read those files and populate the SQL database.</p>
<pre>#!/usr/bin/python</pre>
<pre>import fnmatch
import os
import sqlite3
import signal
import sys
def signal_handler(signal, frame):
    print "Interrupted!"
    if (conn):
        conn.commit()
        conn.close()
    sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
conn = sqlite3.connect('/opt/ossec/etc/md5db.db')
for file in os.listdir('/var/lib/dpkg/info'):
    if fnmatch.fnmatch(file, '*.md5sums'):
        c = conn.cursor()
        f = open('/var/lib/dpkg/info/' + file, 'r')
        l = f.readline()
        while l:
            array = l.split()
        try:
            c.execute('INSERT INTO files VALUES("' + array[0] + '","' + \
                      array[1] + '",date("now"))')
        except sqlite3.Error, e:
        print "%s: %s" % (array[0], e.args[0])
        l = f.readline()
        conn.commit()
        f.close()
conn.close()</pre>
<p style="text-align: justify;">After every new patch installation on my Ubuntu, the database is updated with new MD5&#8242;s. As the FIM process is executed every 6 hours (default setting) by OSSEC, you have time to update the database and reduce the false positives alerts.</p>
<p style="text-align: justify;">The patch is available <a title="Link to the OSSEC patch" href="http://blog.rootshell.be/wp-content/uploads/2013/05/ossec-hids-2.7.md5-patch.diff">here</a>.</p>
<img src="http://feeds.feedburner.com/~r/dev/rand/~4/7vItUl5CdJo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.rootshell.be/2013/05/13/improving-file-integrity-monitoring-with-ossec/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>The Race For Resources</title>
		<link>http://blog.rootshell.be/2013/05/08/the-race-for-resources/</link>
		<comments>http://blog.rootshell.be/2013/05/08/the-race-for-resources/#comments</comments>
		<pubDate>Wed, 08 May 2013 21:35:11 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Resources]]></category>

		<guid isPermaLink="false">http://blog.rootshell.be/?p=21410</guid>
		<description><![CDATA[Today, disk space is not an issue for most of us. I remember when my father came back at home with my first hard drive (80MB!) for my Amiga in the Nineties. My reaction was &#8220;Wow, we will never fill it!&#8220;. Today, if I make a sum of all my storage at home, I&#8217;m above 10TB! And I&#8217;m sure that I will have to add <span class="ellipsis">&#8230;</span> <span class="more-link-wrap"><a href="http://blog.rootshell.be/2013/05/08/the-race-for-resources/" class="more-link"><span>Read More &#8594;</span></a></span>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;"><img class="alignleft  wp-image-21411" alt="Storage" src="http://blog.rootshell.be/wp-content/uploads/2013/05/storage.jpg" width="180" height="180" />Today, disk space is not an issue for most of us. I remember when my father came back at home with my first hard drive (80MB!) for my Amiga in the Nineties. My reaction was &#8220;<em>Wow, we will never fill it!</em>&#8220;. Today, if I make a sum of all my storage at home, I&#8217;m above 10TB! And I&#8217;m sure that I will have to add more capacity in the coming months. No, this blog post is not related to &#8220;<em>big data</em>&#8221; but more a reflection about how developers write applications today. Again, when I was learning programming languages, professors always remembered to the students to keep our eyes on our resources: memory, CPU cycles, I/O and storage. One of the golden rule was: &#8220;<em>If you allocated memory, don&#8217;t forget to free it! malloc() means free()</em>&#8220;. Yeah, at this time, there was no <a title="Link to Wikipedia" href="http://en.wikipedia.org/wiki/Garbage_collection_(computer_science)">garbage collector</a>. I&#8217;m a little bit nostalgic tonight! <img src='http://blog.rootshell.be/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> . Today, computer resources are not a problem anymore. Their prices continue to decrease and the reflex of most developers is just to add resources (&#8220;<em>Your application is slow? Add 2 cores and 2 gig of memory</em>&#8220;).</p>
<p style="text-align: justify;">I&#8217;ll show you a good example of the explosion of resource requirements. Today I was performing some cleanup on my corporate laptop. Being a consultant, it runs plenty of tools such as management consoles provided by $VENDORS. Working for multiple customers running different versions of this product (a well-known firewall brand), I&#8217;ve different versions of the tools installed. Of course, I need to keep multiple versions because you need to use the right one to access the firewall running the corresponding version. Just have a look at this screenshot:</p>
<div id="attachment_21414" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.rootshell.be/wp-content/uploads/2013/05/checkpoint-software-size.png"><img class="size-medium wp-image-21414" alt="Console Tools Size" src="http://blog.rootshell.be/wp-content/uploads/2013/05/checkpoint-software-size-300x217.png" width="300" height="217" /></a><p class="wp-caption-text">(Click to enlarge)</p></div>
<p>I wonder what will ask the next version of the console as disk storage&#8230;</p>
<img src="http://feeds.feedburner.com/~r/dev/rand/~4/nLKtzTJNKrU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.rootshell.be/2013/05/08/the-race-for-resources/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mine is Bigger Than Yours!</title>
		<link>http://blog.rootshell.be/2013/05/06/mine-is-bigger-than-yours/</link>
		<comments>http://blog.rootshell.be/2013/05/06/mine-is-bigger-than-yours/#comments</comments>
		<pubDate>Mon, 06 May 2013 20:08:05 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Vendors]]></category>

		<guid isPermaLink="false">http://blog.rootshell.be/?p=21370</guid>
		<description><![CDATA[Everybody already faced the same situation: Children like to compare with each others! Put kids in the same room and let them play. Comparisons will start soon: &#8220;My dad has a bigger car than yours&#8220;, &#8220;My plane flies better than yours&#8220;, &#8220;I can run faster than you&#8220;, etc. Sometimes, I&#8217;m feeling exactly the same during conversations about infosec products and I&#8217;m pissed of this. My <span class="ellipsis">&#8230;</span> <span class="more-link-wrap"><a href="http://blog.rootshell.be/2013/05/06/mine-is-bigger-than-yours/" class="more-link"><span>Read More &#8594;</span></a></span>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;"><img class="alignleft  wp-image-21377" alt="Mine Is Bigger Than Yours" src="http://blog.rootshell.be/wp-content/uploads/2013/05/mine-s-bigger-than-yours.jpg" width="227" height="227" />Everybody already faced the same situation: Children like to compare with each others! Put kids in the same room and let them play. Comparisons will start soon: &#8220;<em>My dad has a bigger car than yours</em>&#8220;, &#8220;<em>My plane flies better than yours</em>&#8220;, &#8220;<em>I can run faster than you</em>&#8220;, etc. Sometimes, I&#8217;m feeling exactly the same during conversations about infosec products and I&#8217;m pissed of this. My opinion is that infosec people also tend to be proud of their security solutions and compare them to others. Like in a kindergarten&#8230;</p>
<p style="text-align: justify;">It&#8217;s a fact, humans don&#8217;t like to assume their errors. It&#8217;s not easy to concede a bad choice and say that your security solution does not fullfill its job. But why pretend to have the top-notch-killer-device on the other side?  Remember, years ago, the flame war between Linux and Windows users? (Honestly, I took part of this game when I was young)</p>
<p style="text-align: justify;">Sometimes, colleagues or customers ask me what&#8217;s the best choice between &#8220;<em>x</em>&#8221; or &#8220;<em>y</em>&#8220;. It&#8217;s always difficult for me to answer such questions in a cold start situation. First of all because most of the time, I don&#8217;t have enough background to compare them. Of course, the market is full of studies and analyses like the well-known Gartner <a title="Link to Wikipedia" href="http://en.wikipedia.org/wiki/Magic_Quadrant">magic-quadrant</a>. Those can help you to make a first selection. Some vendors ask research firms to make a comparison of their product with direct competitors. If they &#8220;<em>asked</em>&#8220;, it means they also &#8220;<em>paid</em>&#8221; for these researches. In a customer &#8211; supplier relation, the customer must be happy. May we be certain that the results of the study are fully independent? I&#8217;m in doubt&#8230;</p>
<p style="text-align: justify;">Personally, the best solution is the one which will solve YOUR issue and match YOUR requirements in terms of:</p>
<ul style="text-align: justify;">
<li><span style="line-height: 13px;">Budget</span></li>
<li>Features</li>
<li>Integration in your environment</li>
<li>Management &amp; Support</li>
</ul>
<p style="text-align: justify;">Keep in mind that your information security is a big market place where all vendors would like their share of the cake&#8230; Select two or three solutions, ask for live demos, setup a PoC (&#8220;<em>Proof of Concept</em>&#8220;). This could cost time and money but you will have all keys in your hand to make the right decision. Don&#8217;t buy a brand, buy a solution!</p>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/dev/rand/~4/LR5hSGdSeOQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.rootshell.be/2013/05/06/mine-is-bigger-than-yours/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>BSidesLondon 2013 Wrap-Up</title>
		<link>http://blog.rootshell.be/2013/04/24/bsideslondon-2013-wrap-up/</link>
		<comments>http://blog.rootshell.be/2013/04/24/bsideslondon-2013-wrap-up/#comments</comments>
		<pubDate>Wed, 24 Apr 2013 21:40:17 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Event]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[BSides]]></category>
		<category><![CDATA[London]]></category>

		<guid isPermaLink="false">http://blog.rootshell.be/?p=21298</guid>
		<description><![CDATA[This was already the third edition of BSidesLondon today! Time flies! Being busy yesterday, I just reached London in the morning and arrived just in time for the administrative tasks (registration, pick-up a t-shirt, goodies), grabbing some coffee and shaking some hands. BSidesLondon is definitively growing in size and quality: A huge number of attendees, two tracks, a rookie track, a job fair, workshops and <span class="ellipsis">&#8230;</span> <span class="more-link-wrap"><a href="http://blog.rootshell.be/2013/04/24/bsideslondon-2013-wrap-up/" class="more-link"><span>Read More &#8594;</span></a></span>]]></description>
				<content:encoded><![CDATA[<p><img class="alignleft  wp-image-9380" style="float: left;" title="IMG_3108.jpg" alt="BSidesLondon Venue" src="http://blog.rootshell.be/wp-content/uploads/2013/04/IMG_3108.jpg" width="200" height="150" border="0" /></p>
<p style="text-align: justify;">This was already the third edition of <a title="Link to the website" href="http://www.securitybsides.org.uk/">BSidesLondon</a> today! Time flies! Being busy yesterday, I just reached London in the morning and arrived just in time for the administrative tasks (registration, pick-up a t-shirt, goodies), grabbing some coffee and shaking some hands. BSidesLondon is definitively growing in size and quality: A huge number of attendees, two tracks, a <a title="Link to the website" href="http://blog.rootshell.be/2012/10/15/fresh-blood-wanted-for-bsideslondon/">rookie</a> track, a job fair, workshops and lightning talks. Even the sun was present over London, no fog at all! Two tracks means you have to make choices! Here is the brief overview of my schedule.</p>
<p style="text-align: justify;"><span id="more-21298"></span></p>
<p style="text-align: justify;">The first presentation I attended was &#8220;<em>Pentesting like a Grandmaster</em>&#8221; by <a href="http://twitter.com/7a_">Abraham Aranguren</a>. The talk was split in two parts. FIrst, Abraham started with an interesting comparison: &#8220;<em>Pentesting == a chess game</em>&#8220;. This can be resumed with the picture below:</p>
<p style="text-align: justify;"><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3104.jpg" alt="Abraham on stage" src="http://blog.rootshell.be/wp-content/uploads/2013/04/IMG_3104.jpg" width="300" height="225" border="0" /></p>
<p style="text-align: justify;">How far can you go with &#8220;<em>your</em>&#8221; intelligence? The success is always possible. They are many examples of great people who made awesome stuff with a normal IQ. Intelligence does not warranty success. One fact: it&#8217;s important to start early; this is an advantage. The talent is something natural and skills must be developed by hours and hours (days or months) of training. The comparison continues with the chess game. As reported by many chess champions: &#8220;<em>You can only be good at chess if you love the game</em>&#8220;.  It&#8217;s exactly the same in information technology (generally speaking &#8211; not only security). Some quotes are so true:  &#8221;<em>No pain, no gain</em>&#8221; (Arnold Schwarzeneger), &#8220;<em>Pain is temporary</em>&#8221; (Mohamed Ali). The next question could be how to stay motivated. Like in high level sports, your must remain healthy (in your body as well as in your mind). Another interesting quote I liked:</p>
<blockquote>
<p style="text-align: justify;">&#8220;<em>Smart people learn from their mistakes. But the real sharp ones learn from the mistakes of other people</em>&#8221; (Brandon Mull)</p>
</blockquote>
<p style="text-align: justify;">Abraham reviewed good tips to stay healthy and keep your attention.  In the second part of the talk, he explained why the game preparation is a key (again in chess and pen testing). Before the game: scope better, do better. Know the enemy but know yourself (strengths &amp; weaknesses). Finally, some examples were reviewed of how a good preparation helps to pwn your target easily.. But keep in mind: When media report an exploit &#8220;<em>in seconds</em>&#8220;, it took usually days or weeks to prepare it. The examples were demonstrated using Abraham&#8217;s project: <a title="Link to the website" href="https://www.owasp.org/index.php/OWASP_OWTF">OWTF</a>. I liked the comparison between the two worlds which initially have nothing in common. Great talk to start the day.</p>
<p style="text-align: justify;">For the second talk, my choice was to follow <a href="http://twitter.com/j4vv4D">Javvad Malik</a> about his own story &#8220;<em>How to build a personal security brand that will stop the hackers, save the world and get you the girl</em>&#8220;. What a program! The room was crowded with people sitting on the ground! This is always a good sign. Javaad is a showman, have a look at his <a title="Link to the website" href="http://www.youtube.com/user/InfosecCynic">Youtube</a> channel about information security, a must see. His talk was a reflexion about people who are &#8220;<em>bankable</em>&#8221; in information security. Starting with a fact: why everybody found Mother Theresa a personality? It&#8217;s the same in information security. Javvad showed a nice graph of knowledge vs fame. Then he defined three levels: echo chamber, industry, public and put famous people on it:</p>
<div class="wp-caption aligncenter" style="width: 310px"><img style="display: block; border: 0px;" title="IMG_3106.jpg" alt="Javvad on stage" src="http://blog.rootshell.be/wp-content/uploads/2013/04/IMG_3106.jpg" width="300" height="225" border="0" /><p class="wp-caption-text">(Note: the hidden face is Gregory Evans <img src='http://blog.rootshell.be/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /></p></div>
<p style="text-align: justify;">The key is the message you have to pass and how to deliver it. Today,  we have access to the same tools and services as professionals a few years ago to promote ourself. How to find the right idea to promote ourself? Via podcasts, blogs, mentors &amp; continuous feedback.  Often security people act like the actors doing the promotion of Hollywood movies: they visit many places, are facing the same questions and constantly repeat the same sentences. Same message is broadcasted again &amp; again. But what makes a good infosec guy? Javaad showed two pictures of Fish &amp; Chips. Prepared with the same food but presented differently.  The same may apply with blogs: a blog post could be a very good research but badly presented. Also, the message we have to deliver is often bad news: &#8220;<em>you got owned</em>&#8220;, &#8220;<em>you lost data</em>&#8220;, etc. Then the procrastination and comfort zone are part of the game. Being a &#8220;<em>public</em>&#8221; man forces you to remain visible. Question to the audience: Who has a blog and did not updated it for a long time&#8221;. I personally know this feeling. We make this on our free time but have wife, kids. Another tip: &#8220;<em>Do not feed the troll</em>&#8220;. There is a difference between trolling and criticism. Javaad&#8217;s receipt was:</p>
<ul>
<li style="text-align: justify;">He discovered himself</li>
<li>He created his own rules</li>
<li>He believed</li>
</ul>
<p>Excellent non-technical presentation but with true content and lot of fun.</p>
<p style="text-align: justify;">The third talk was presented by my friend <a href="http://twitter.com/chrisjohnriley">Chris John Riley</a>: &#8220;<em>Defense by Numb3r5</em>&#8221; or &#8220;<em>Making problems for script k1d13s and scanner monkeys</em>&#8220;. Chris started with a description of the use of HTTP return codes. You know the 2xx, 3xx, etc. Some are common, others less like 206 which means &#8220;<em>partial content</em>&#8220;. Most of them are defined in the RFC <a title="Link to the website" href="http://www.ietf.org/rfc/rfc2616.txt">2616</a> and divided on five classes of response:</p>
<ul>
<li style="text-align: justify;">1xx (info)</li>
<li>2xx (success)</li>
<li>3xx (redirection)</li>
<li>4xx (client error)</li>
<li>5xx (server error)</li>
</ul>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3110.jpg" alt="Chris on stage" src="http://blog.rootshell.be/wp-content/uploads/2013/04/IMG_3110.jpg" width="300" height="225" border="0" /></p>
<p style="text-align: justify;">Personally, I like the 402 &#8211; &#8220;<em>payment required</em>&#8220;. Chri&#8217;s question is why talk about numbers? For security reason of course. What can we do with them? Unpredicatability is at your advantage in your defense layer. Increase attacker costs, delay operations. There was already some ideas about this topic but not very deeply analysed. So, how to use this? Browsers have to be flexible. This leads to interpretation! But wait, there are RFC for that? They&#8217;re more than a guideline. What can possibly go wrong? Chris made some testing using a MitM proxy written in Python. Goal of this proxy: If the response code is not 200, respond with a 200 <img src='http://blog.rootshell.be/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . A exampe of script is available on his blog:</p>
<p style="text-align: justify;"><a title="Link to the website" href="http://catch22insecurity.com/POC/respcode.php?code=200">http://catch22insecurity.com/POC/respcode.php?code=200</a></p>
<p style="text-align: justify;">Chrome, Firefox and Internet Explorer were tested against all codes with HTML, Iframe &amp; JavaScript pages. What a surprise: They interpret differently. Codes are often associated with headers. Ex: 302 &amp; Location:. If headers are missing, what&#8217;s happening?  What can we do with this:</p>
<ul style="text-align: justify;">
<li>Browser fingerprinting (UA can be spoofed but behaviour no)</li>
<li>Proxy detection</li>
</ul>
<p style="text-align: justify;">Let&#8217;s put all the stuff together. Simply fuck with things and defeate attackers (slowing down, case false positives/negatives etc). By changing the answers to HTTP requests performed by crawlers and scanners, Chris demonstrated the different kinds of results with, depending on the cases, many false positives or false negatives. Finally, he had the idea to write an HTTP <a title="Link to the website" href="http://en.wikipedia.org/wiki/Tarpit_(networking)">Tarpit</a>: attacks detected by a WAF are send to a bad list to the server which rewrites all the responses to those IP&#8217;s. Even more funny, Metasploit performs attacks also based on HTTP response code (&gt;800 occurrences found in the code). Chris&#8217;s concluion: &#8220;<em>No match, no shell</em>&#8220;. Script kiddies go away! The MitM proxy code is available <a title="Link to the website" href="https://github.com/ChrisJohnRiley/random_code">here</a>.</p>
<p style="text-align: justify;">After a sunny lunch break outside and some Club-Mate, my schedule continued with <a href="http://twitter.com/stephenbonner">Stephen Bonner</a> and his &#8220;<em>Make cyber-love not cyber-war</em>&#8221; talk. Based on slides with pictures only, Stephen reviewed the current situation of cyber-war and explained why he does not like this expressions. Very good speaker, good interactivity with the audience but I was not attracted by the topic.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3114.jpg" alt="Stephen on stage" src="http://blog.rootshell.be/wp-content/uploads/2013/04/IMG_3114.jpg" width="300" height="225" border="0" /></p>
<p style="text-align: justify;">Then followed &#8220;<em>Pentest automation &#8211; Helping you to get to the pub on time</em>&#8221; with <a href="http://twitter.com/raesene">Rory McCure</a>. The goal of this talk was to review different ways to optimise your time during pentesting activities to go back early to home … or to the pub! Rory started with a general question: Why automate?</p>
<ul>
<li style="text-align: justify;">To save time!</li>
<li>Repetition is boring and we are all lazy people</li>
<li>For accuracy: how to not miss interesting stuff?</li>
<li>To encode your knowledge! If you script it, you won&#8217;t forget what you learned</li>
</ul>
<p style="text-align: justify;">It&#8217;s a fact, if you&#8217;re a pentester, you must be able to write some code. The next question which will arise is: In which language(s)? Rory&#8217;s recommendation is to pick up one and stick to it. How to choose? The language should be</p>
<ul>
<li style="text-align: justify;">Dynamic</li>
<li>Provide an Interactive shell</li>
<li>Focus on development speed</li>
<li>And have a good 3rd party library support (to easily add extra features to your scripts).</li>
</ul>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3116.jpg" alt="Rory on stage" src="http://blog.rootshell.be/wp-content/uploads/2013/04/IMG_3116.jpg" width="300" height="225" border="0" /></p>
<p style="text-align: justify;">Another tip: use source code control (subversion, git, etc), it will save you time and headaches. To better learn, find real examples you need to solve. Then Rory reviewed some nice scenarios where scripts can be helpful. His examples were written in Ruby:</p>
<ul>
<li style="text-align: justify;">Expanding a subnet in an IP addresses list. Easy but so convenient</li>
<li>Writing a template using the &#8216;<a title="Link to the website" href="http://mechanize.rubyforge.org/">mechanize</a>&#8216; Ruby library to automate a dual-steps authentication process.</li>
<li>Parsing the output of tools like nmap.</li>
</ul>
<p style="text-align: justify;">Scripts can also be used to automate very boring tasks: reporting! Major security tools can be extended using plugins or extensions (whatever you name them). Think about Metasploit or Burpsuite. Contribute and add your own code to automate your tasks. A final remark to the presentation: If infosec guys complain about the bad quality of code delivered by customers, they are also writing bad code to automate their tasks. Try to write secure code yourself! The examples reviewed by Rory are available on his <a href="https://github.com/raesene/">github</a> account.</p>
<p style="text-align: justify;">The last talk was the one of Alex Polychronopoulos about &#8220;<em>Going Stealth: Staying off your AV  radar</em>&#8220;. Again an interesting topic for pentesters who have to fight often with anti-virus programs and try to evade their detection mechanisms. Today&#8217;s AV features are:</p>
<ul>
<li>Detection</li>
<li>Identification</li>
<li>Disinfection</li>
<li>Some of them implement more funky stuff like built-in IDS, browser add-on, etc ($VENDORS have always plenty of ideas)</li>
</ul>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3118.jpg" alt="Alex on stage" src="http://blog.rootshell.be/wp-content/uploads/2013/04/IMG_3118.jpg" width="300" height="225" border="0" /></p>
<p style="text-align: justify;">Anti-virus evasion sometimes can be quite easy (some files are simply not scanned like *.tmp or *.ocx files) and less than 5% of new threats are detected. Alex reviewed the different type of analysis. Static analysis is not efficient today. Detection based on signatures are out of business for new threats. The code can be easily obfuscated (via &#8220;<em>packers</em>&#8220;). Today, dynamic analysis is better (it executes the malicious code and observes its behaviour) but the main weakness of emulators is… the emulation! The malware can slow down execution (using multiple sleep() calls), use uncommon CPU instruction sets or simply detect the emulator (and not perform any malicious activity). How to evade? First tip: See big! Most anti-virus have a file size limit for performance reasons. Second,  what about destroying the AV itself? After all it&#8217;s also a software like any other with bugs.  Research is always helpful to find new evasion techniques. What about packers? Their goal is to produce a new executable from… an executable and make it more difficult to be detected by AV. Problem: they do not like self modifying code! Better packers encrypt the code. The key can be randomised for each payload (polymorphism). If you don&#8217;t like encryption, use your math classes and implement other algebra transformations to build a better packer. Don&#8217;t forget to hide your strings! (can also be used a signatures). Don&#8217;t forget that any packer, best of all, will always become a signature at a time. What about metamorphism? Examples: Use random registers, substitute instructions, randomly add track code. Put all this techniques together to write your best packer. Interesting stuff but lacking of real examples. Some packed files passed through antivirus would be funny (with a low detection rate of course).</p>
<p style="text-align: justify;">In parallel to the regular tracks, the rookie track given the stage to new coming speakers. There was some interesting topics like:</p>
<ul>
<li>Blinking hell &#8211; Data extraction through keyboard lock states</li>
<li>External assessments</li>
<li>ICMP &#8211; The proxy your admin hates to block</li>
</ul>
<p>I hope that slides will be released soon! Kudos to the BsidesLondon team for the great event!</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3113.jpg" alt="Main room" src="http://blog.rootshell.be/wp-content/uploads/2013/04/IMG_3113.jpg" width="300" height="225" border="0" /></p>
<p style="text-align: justify;">After some beers at the after party, I went out for a dinner with friends to discuss about security arround Italian food. Tomorrow, let&#8217;s dive into the $VENDORS jungle at InfoSecurity Europe before travelling back to Belgium!</p>
<img src="http://feeds.feedburner.com/~r/dev/rand/~4/CeaPTgVT6TA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.rootshell.be/2013/04/24/bsideslondon-2013-wrap-up/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Belgian Edition of The Hacknowledge Contest</title>
		<link>http://blog.rootshell.be/2013/04/22/belgian-edition-of-the-hacknowledge-contest/</link>
		<comments>http://blog.rootshell.be/2013/04/22/belgian-edition-of-the-hacknowledge-contest/#comments</comments>
		<pubDate>Mon, 22 Apr 2013 13:11:11 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Belgium]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[People / Places]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Challenges]]></category>
		<category><![CDATA[Charleoi]]></category>

		<guid isPermaLink="false">http://blog.rootshell.be/?p=21268</guid>
		<description><![CDATA[The last weekend, an ethical hacking event was organised in Belgium. The Hacknowledge Contest joined Charleroi and was hosted at the CPEHN. This event was previously organised only in France thanks to the initiative of the ACISSI. Last year, they decided to open their challenges to other countries. The current list of participating countries is: Côte d&#8217;Ivoire, Maroc, Benelux, Espagne and France. The organisers are <span class="ellipsis">&#8230;</span> <span class="more-link-wrap"><a href="http://blog.rootshell.be/2013/04/22/belgian-edition-of-the-hacknowledge-contest/" class="more-link"><span>Read More &#8594;</span></a></span>]]></description>
				<content:encoded><![CDATA[<p><img class="alignleft  wp-image-9380" style="float: left;" title="IMG_3090.jpg" alt="Hacknowlege Contest" src="http://blog.rootshell.be/wp-content/uploads/2013/04/IMG_3090.jpg" width="200" height="150" border="0" /></p>
<p style="text-align: justify;"><span style="font-size: 14px; line-height: 21px;">The last weekend, an ethical hacking event was organised in Belgium. The <a href="http://www.hacknowledge-contest.org/">Hacknowledge Contest</a> joined Charleroi and was hosted at the <a href="http://cpehn.be/">CPEHN</a>. This event was previously organised only in France thanks to the initiative of the <a href="http://www.acissi.net/">ACISSI</a>. Last year, they decided to open their challenges to other countries. The current list of participating countries is: Côte d&#8217;Ivoire, Maroc, Benelux, Espagne and France. The organisers are already looking to extend their list with other countries. If you are interested, maybe contact them.</span></p>
<p style="font-size: 14px; text-align: justify;">Initally, I registered a small team with a colleague and finally we were five ethical hackers/friends to participate as &#8220;<em>UID(0)</em>&#8220;. So, we joined Charleroi Saturday afternoon to attend a bunch of small talks around information security. Small event and a relaxed atmosphere. The covered topics were:</p>
<div style="text-align: justify;">
<ul>
<li><span style="font-size: 14px; line-height: 14px;"><a title="Link to the website" href="http://www.zataz.com">Zataz.com</a>, the well-known French website and the process in place to notify organizations of data breaches and/or security issues.</span></li>
<li><span style="font-size: 14px; line-height: 14px;">The security of our payment cards starting from old models based on a magstripe up to the state-of-the-art (but not from a security point of view) NFC chipsets.</span></li>
<li><span style="font-size: 14px; line-height: 14px;">A nice presentation about social-engineering with lot of funny examples (my preferred presentation by <a title="Link to Twitter" href="http://twitter;com/cowreth">Seb Baudru</a>, see the picture below)</span></li>
<li><span style="font-size: 14px; line-height: 14px;">IPv6 &amp; security</span></li>
<li><span style="font-size: 14px; line-height: 14px;">An overview of the security landscape in Belgium (latest major security incidents and who contact in case of issues &#8211; <a title="Link to the website" href="http://www.cert.be">CERT.be</a>, <a title="Link to the website" href="http://www.polfed-fedpol.be/org/org_dgj_FCCU_RCCU_fr.php">FCCU</a>, etc)</span></li>
</ul>
</div>
<div>
<div><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3086.jpg" alt="Social Engineering Talk" src="http://blog.rootshell.be/wp-content/uploads/2013/04/IMG_3086.jpg" width="300" height="225" border="0" /></div>
</div>
<div style="font-size: 14px;"></div>
<p style="font-size: 14px; text-align: justify;">After a break and the registration of all teams, the challenges started for a period of 12 hours (Saturday 10PM to Sunday 10AM). No CTF, no blue team nor read team but a list of challenges to solve similar to the SANS <a title="Link to the website" href="http://www.sans.org/netwars">Netwars</a>. Each challenge solved gives you points. Seventy challenges  were  categories were split in the categories like:</p>
<ul>
<li><span style="font-size: 14px; line-height: 21px;">Web technologies</span></li>
<li><span style="font-size: 14px; line-height: 21px;">Crypto</span></li>
<li><span style="font-size: 14px; line-height: 21px;">Network</span></li>
<li><span style="font-size: 14px; line-height: 21px;">Forensics</span></li>
<li><span style="font-size: 14px; line-height: 21px;">Hardware (lockpicking, Teensy, barcodes, &#8230;)</span></li>
</ul>
<p style="font-size: 14px;"><img style="display: block; margin-left: auto; margin-right: auto;" title="IMG_3089.jpg" alt="Our Team" src="http://blog.rootshell.be/wp-content/uploads/2013/04/IMG_3089.jpg" width="300" height="225" border="0" /></p>
<p style="font-size: 14px; text-align: justify;">It was very friendly with good times, music. We finished at the third position but very close to the second team&#8230; Only the first two teams won, too bad! The final contest will be organised in France and the winning team will receive a very nice price: a trip all-inclusive to Las Vegas to attend the DefCON security conference!</p>
<p style="font-size: 14px; text-align: justify;">I don&#8217;t often participate to events like this one. I liked the limited number of teams (5) and the friendly atmosphere between the team. Not too small, not too big, well organized. The event was also covered by some Belgian <a title="Link to the RTBF website" href="http://www.rtbf.be/video/detail_un-concours-de-hacking-a-charleroi?id=1817036">media</a>.</p>
<img src="http://feeds.feedburner.com/~r/dev/rand/~4/BfiayNRCgZo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.rootshell.be/2013/04/22/belgian-edition-of-the-hacknowledge-contest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing SET 5.0.3 &amp; Metasploit 4.6.0</title>
		<link>http://blog.rootshell.be/2013/04/19/fixing-set-5-0-3-metasploit-4-6-0/</link>
		<comments>http://blog.rootshell.be/2013/04/19/fixing-set-5-0-3-metasploit-4-6-0/#comments</comments>
		<pubDate>Fri, 19 Apr 2013 15:44:21 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Pentesting]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Social Engineering]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Metasploit]]></category>
		<category><![CDATA[Pentest]]></category>
		<category><![CDATA[SET]]></category>

		<guid isPermaLink="false">http://blog.rootshell.be/?p=21230</guid>
		<description><![CDATA[A quick post to share with you my feedback about an issue I faced after a SET (&#8220;Social Engineering Toolkit&#8220;) upgrade to the latest version (5.0.3). SET is a wonderful tool that you must master.  I&#8217;m using SET on a EC2 instance because it does not interfere with my other IP addresses and I can enable all ports without any issue (nothing else is running <span class="ellipsis">&#8230;</span> <span class="more-link-wrap"><a href="http://blog.rootshell.be/2013/04/19/fixing-set-5-0-3-metasploit-4-6-0/" class="more-link"><span>Read More &#8594;</span></a></span>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;"><img class="alignleft  wp-image-21231" alt="Social Engineering" src="http://blog.rootshell.be/wp-content/uploads/2013/04/social_engineering.jpg" width="199" height="149" />A quick post to share with you my feedback about an issue I faced after a <a title="Link to the website" href="https://www.trustedsec.com/downloads/social-engineer-toolkit/">SET</a> (&#8220;<em>Social Engineering Toolkit</em>&#8220;) upgrade to the latest version (5.0.3). SET is a wonderful tool that you must master.  I&#8217;m using SET on a EC2 instance because it does not interfere with my other IP addresses and I can enable all ports without any issue (nothing else is running on this instance). Note that Amazon has a specific policy to make pentesting from their infrastructure, have a look <a title="Link to the Amazon website" href="https://aws.amazon.com/security/penetration-testing/">here</a>).</p>
<p style="text-align: justify;"><span id="more-21230"></span></p>
<p style="text-align: justify;">My current environment is:</p>
<ul>
<li><span style="line-height: 16px;">Ubuntu 12.04-LST (fully patched)</span></li>
<li>SET 5.0.2 (installed from the <a title="Link to github.com" href="https://github.com/trustedsec/social-engineer-toolkit/">git</a> repository)</li>
<li>Metasploit 4.6</li>
</ul>
<p style="text-align: justify;">After the SET upgrade, I faced the following error when launching Metasploit from SET (full error dumped to allow the Google crawler to do its job)</p>
<pre>set:phishing&gt; Setup a listener [yes|no]:yes
/opt/metasploit/apps/pro/msf3/lib/fastlib.rb:374:in `fastlib_original_require': no such file to load -- active_support/concern (LoadError)
 from /opt/metasploit/apps/pro/msf3/lib/fastlib.rb:374:in `require'
 from /opt/metasploit/apps/pro/msf3/lib/msf/core/module_manager/cache.rb:4
 from /opt/metasploit/apps/pro/msf3/lib/fastlib.rb:374:in `fastlib_original_require'
 from /opt/metasploit/apps/pro/msf3/lib/fastlib.rb:374:in `require'
 from /opt/metasploit/apps/pro/msf3/lib/msf/core/module_manager.rb:27
 from /opt/metasploit/apps/pro/msf3/lib/fastlib.rb:374:in `fastlib_original_require'
 from /opt/metasploit/apps/pro/msf3/lib/fastlib.rb:374:in `require'
 from /opt/metasploit/apps/pro/msf3/lib/msf/core/framework.rb:66
 from /opt/metasploit/apps/pro/msf3/lib/fastlib.rb:374:in `fastlib_original_require'
 from /opt/metasploit/apps/pro/msf3/lib/fastlib.rb:374:in `require'
 from /opt/metasploit/apps/pro/msf3/lib/msf/core.rb:34 
 from /opt/metasploit/apps/pro/msf3/lib/fastlib.rb:374:in `fastlib_original_require'
 from /opt/metasploit/apps/pro/msf3/lib/fastlib.rb:374:in `require'
 from /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/driver.rb:2
 from /opt/metasploit/apps/pro/msf3/lib/fastlib.rb:374:in `fastlib_original_require'
 from /opt/metasploit/apps/pro/msf3/lib/fastlib.rb:374:in `require'
 from /opt/metasploit/apps/pro/msf3/lib/msf/ui/console.rb:11
 from /opt/metasploit/apps/pro/msf3/lib/fastlib.rb:374:in `fastlib_original_require'
 from /opt/metasploit/apps/pro/msf3/lib/fastlib.rb:374:in `require'
 from /opt/metasploit/apps/pro/msf3/lib/msf/ui.rb:11
 from /opt/metasploit/apps/pro/msf3/lib/fastlib.rb:374:in `fastlib_original_require'
 from /opt/metasploit/apps/pro/msf3/lib/fastlib.rb:374:in `require'
 from /opt/metasploit/apps/pro/msf3//msfconsole:136</pre>
<p style="text-align: justify;">Metasploit was running fine when started manually from the command line. Google found a thread on a forum about the same kind of problem. The suggestion was to setup the right environment for Metasploit using the setenv.sh script. Note: Be sure to execute the script using &#8216;<em>source</em>&#8216; otherwise a new shell will be spawned and closed immediately without changing your environment:</p>
<p># source /opt/metasploit/scripts/setenv.sh<br />
# se-toolkit</p>
<p>Same issue, I tried to load &#8216;active_support/concern&#8217; manually, it worked:</p>
<pre># ruby
require('active_support/concern')
^D
#</pre>
<p>Finally, I upgraded the installed Ruby gems with the following command:</p>
<pre># gem update `gem list | cut -d ' ' -f 1`</pre>
<p style="text-align: justify;">And the problem was solved! Don&#8217;t ask me why, I did not dive into the code and I&#8217;m not a Ruby guru it worked for me. If you are facing the same problem, think about upgrading your Gems. Just sharing&#8230;</p>
<p style="text-align: justify;">Here is my list of installed Gems:</p>
<pre># gem list

*** LOCAL GEMS ***

actionmailer (3.2.13, 3.2.11)
actionpack (3.2.13, 3.2.11)
activemodel (3.2.13, 3.2.11)
activerecord (3.2.13, 3.2.11)
activeresource (3.2.13, 3.2.11)
activesupport (3.2.13, 3.2.11)
acts_as_list (0.2.0, 0.1.5)
arel (4.0.0, 3.0.2)
authlogic (3.3.0, 3.1.0)
bigdecimal (1.1.0)
bson (1.8.5, 1.6.4)
bson_ext (1.6.1)
builder (3.2.0, 3.0.4)
bundler (1.3.5, 1.1.2)
carrierwave (0.8.0, 0.7.0)
chunky_png (1.2.8, 1.2.6)
coderay (1.0.9, 1.0.8)
compass (0.12.2)
daemons (1.1.9, 1.1.8)
erubis (2.7.0)
eventmachine (0.12.10)
formtastic (2.2.1, 2.1.1)
fssm (0.2.10, 0.2.9)
hike (1.2.2, 1.2.1)
i18n (0.6.4, 0.6.1)
ice_cube (0.10.0, 0.9.1)
io-console (0.3)
journey (1.0.4)
jquery-rails (2.2.1, 2.1.3)
json (1.7.7, 1.6.6, 1.6.5, 1.5.4)
kaminari (0.14.1, 0.14.0)
libv8 (3.16.14.1, 3.11.8.17 x86_64-linux, 3.3.10.4 x86_64-linux)
liquid (2.5.0, 2.3.0)
mail (2.5.3, 2.4.4)
method_source (0.8.1)
mime-types (1.22)
minitest (4.7.2, 2.5.1)
msgpack (0.4.6 ruby)
multi_json (1.7.2, 1.5.0)
nokogiri (1.5.2 ruby)
pg (0.13.2 ruby)
polyglot (0.3.3)
pry (0.9.12, 0.9.10)
rack (1.4.5, 1.4.1 ruby)
rack-cache (1.2)
rack-ssl (1.3.3, 1.3.2)
rack-test (0.6.2)
rails (3.2.13, 3.2.11)
railties (3.2.13, 3.2.11)
rake (10.0.4, 10.0.3, 0.9.2.2)
rdoc (4.0.1, 3.12, 3.9.4)
ref (1.0.4)
robots (0.10.1)
sass (3.2.7, 3.2.1)
slop (3.4.4, 3.3.3)
sprockets (2.9.2, 2.2.2)
state_machine (1.2.0, 1.1.2)
therubyracer (0.9.10)
thin (1.3.1)
thor (0.18.1, 0.16.0)
tilt (1.3.7, 1.3.3)
treetop (1.4.12)
tzinfo (0.3.37, 0.3.35)</pre>
<img src="http://feeds.feedburner.com/~r/dev/rand/~4/6j4xMUFLArI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.rootshell.be/2013/04/19/fixing-set-5-0-3-metasploit-4-6-0/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Win Your Tickets for “Hack In Paris” and “La Nuit Du Hack”</title>
		<link>http://blog.rootshell.be/2013/04/17/win-your-tickets-for-hack-in-paris-and-la-nuit-du-hack/</link>
		<comments>http://blog.rootshell.be/2013/04/17/win-your-tickets-for-hack-in-paris-and-la-nuit-du-hack/#comments</comments>
		<pubDate>Wed, 17 Apr 2013 11:17:48 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Event]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[France]]></category>
		<category><![CDATA[Paris]]></category>

		<guid isPermaLink="false">http://blog.rootshell.be/?p=21179</guid>
		<description><![CDATA[The contest is closed. All tickets have been assigned. Dear readers, I&#8217;ve some gifts for you! I&#8217;m very proud (and surprised!) to have been nominated to the European Security Bloggers Awards in two categories: &#8220;Best Personal Security Blog&#8221; and &#8220;Best Security EU Twitter&#8220;. To thank you for these nominiations (and first of all for reading/following me), I&#8217;ve some tickets to distribute for two nice security events <span class="ellipsis">&#8230;</span> <span class="more-link-wrap"><a href="http://blog.rootshell.be/2013/04/17/win-your-tickets-for-hack-in-paris-and-la-nuit-du-hack/" class="more-link"><span>Read More &#8594;</span></a></span>]]></description>
				<content:encoded><![CDATA[<p style="text-align: center;"><span style="color: #ff0000;"><font size="+2">The contest is closed. All tickets have been assigned.</font></span></p>
<p style="text-align: justify;"><a href="http://blog.rootshell.be/wp-content/uploads/2013/04/skull13.png"><img class="alignleft size-full wp-image-21180" alt="Skull 2013" src="http://blog.rootshell.be/wp-content/uploads/2013/04/skull13.png" width="474" height="50" /></a>Dear readers, I&#8217;ve some gifts for you! I&#8217;m very proud (and surprised!) to have been nominated to the <a title="Link to the contest" href="https://www.surveymonkey.com/s/EUSecurityBloggerAwards">European Security Bloggers Awards</a> in two categories: &#8220;<em>Best Personal Security Blog</em>&#8221; and &#8220;<em>Best Security EU Twitter</em>&#8220;. To thank you for these nominiations (and first of all for reading/following me), I&#8217;ve some tickets to distribute for two nice security events in Paris (DisneyLand Convention Center).</p>
<p style="text-align: justify;">The first one is <a title="Link to the website" href="https://www.hackinparis.com/">Hack In Paris</a> which will be held from 17th to 21st of June. Then, <a title="Link to the website" href="https://nuitduhack.com/">La Nuit du Hack</a> will follow during the weekend. Both are very good events with renowned international speakers. To give you an idea, have a look at my 2012 wrap-ups (<a title="Link to the article" href="http://blog.rootshell.be/2012/06/21/hack-in-paris-2012-wrap-up-day-1/">day 1</a> and <a title="Link to the article" href="http://blog.rootshell.be/2012/06/22/hack-in-paris-2012-wrap-up-day-2/">day 2</a>). A first version of <a title="Link to the website" href="https://www.hackinparis.com/talk">schedule</a> has already been published. The organizers provided me 2 x 10 tickets for both conferences. It won&#8217;t be fair to simply distribute them to the first comers so here is a small contest! Answer the following question: (tip: the answer is on my blog)</p>
<blockquote>
<p style="text-align: justify;">&#8220;After the last edition of BlackHat Europe in Barcelona, I waited my flight back to home with a good friend of mine. Who is it?&#8221;</p>
</blockquote>
<p style="text-align: justify;">Send your answer by email only to xavier[at]rootshell[dot]be. The following information must be provided in the mail:</p>
<ul>
<li>Subject: Contest HIP/NDH 2013</li>
<li>My friend&#8217;s nick, Twitter or full name</li>
<li>Your ticket preference (HIP, NDH or both)</li>
</ul>
<p style="text-align: justify;">Good luck! Some rules:</p>
<ul>
<li>Be sure to attend the conference (in Paris, June 2013) and not waste tickets</li>
<li>Travel &amp; hotel costs are not covered and must be paid by the winners</li>
<li>HIP tickets are not valid for trainings (only talks)</li>
</ul>
<p style="text-align: justify;">This year, I won&#8217;t be able to attend the conference during the week. But I will join Paris for the weekend, see you there!</p>
<p style="text-align: justify;">PS: Don&#8217;t forget to <a title="Link to the website" href="https://www.surveymonkey.com/s/EUSecurityBloggerAwards">vote</a>!</p>
<img src="http://feeds.feedburner.com/~r/dev/rand/~4/exJHEdCyX5g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.rootshell.be/2013/04/17/win-your-tickets-for-hack-in-paris-and-la-nuit-du-hack/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
