Thursday, May 10, 2012

How to contribute?

I got an email asking how to contribute to Aircrack-ng. He was telling me that he did not find any information about it.

He was right, there was nothing written yet; it's kinda implicit but let's address that.

So, first of all, make sure to work on the latest subversion revision and make your modifications in it. Don't remove the subversion control directory (.svn) and files.

About the code, it MUST be GPL or GPLv2 and allow OpenSSL exception (see the license exception in every single source code file).
You can add comment to your diff file at the top, before the line beginning with +++. It is displayed by trac (and you can easily read them) but the advantage is that it is ignored by patch when applying the patch. Make it clear in that section that your patch is GPL or GPLv2 and allow OpenSSL exception.

Another thing about the code: make sure that your code is easy to read and well commented. I'm talking about smart comments and documenting code that is not obvious. I found a post about it and he uses Javascript but it applies to every other language.
Ah yeah, don't address several issues with a single patch. One patch = one issue.

Once you're done, you have to create a difference (or a patch, that's the same thing). Thanks to subversion, it is very easy to do: just issue 'svn diff > PATCH_FILE.diff' and you're done.
Important note: If your changes added files, make sure to do a 'svn add' for each of them. If you don't do it, the added files won't be included in the patch.

Once you're done all that, you can create a new ticket on our trac, fill all the fields (if you are not sure how to fill some of them, don't worry, I'll do it) and attach the patch. If you have any issue doing so, feel free to shoot me an email with all the details, I'll post it.
If you have several patches and they need to be applied in a specific order (affecting the same file), add a number in front of the name of the patch so that I know how to apply them or explain the order of the patches in the ticket.

That's it :)

If you have other questions, post them in the comments, and I'll update this post to address them.

Sunday, April 1, 2012

WPA Flaw let us crack the PMK in a few minutes - April Fools'

Today we are very proud to announce the we found a flaw that let us crack WPA in just a few minutes no matter what the passphrase length is. Obviously, we don't get the passphrase but the PMK (which is 'derived' from the ESSID and the passphrase), the master key which is more than enough to decrypt a capture file; Airdecap-ng allows to decrypt a pcap file with either the passphrase or the PMK (using -k).

I'm sorry, I wish I had more time to write a longer post to give more technical details but right now I'm very busy writing the paper. It will be published here probably tomorrow.

And in case you wonder, it will be integrated into Aircrack-ng ;)

If you really want to read the paper, there you go.

Thursday, March 8, 2012

Compat-wireless

We have at least 2 or 3 times a day on IRC the questions about compiling drivers (and more in the forum) and we always say that you have to patch them like explained in the wiki.

As said thousand of times (I just want to avoid having to say it again in the future), you should ALWAYS take the latest compat-wireless version NO MATTER what your kernel version is.

Compat-wireless version is related to the kernel version in a way that it has the features a kernel version has. So, there is no point in taking the same version as your kernel because all you will do is having the  features (and not fix anything) that you already had in your kernel (minus the patches from your distro if any were applied).

Compat-wireless with dates (instead of version) is the most up to date and it comes from git. So if you are not a developer (who wants to debug/work with them), then you should not use these.

You can get much more details (and downloads) on Linux Wireless website.

To summarize (or if you don't want to read anything else in this post): ALWAYS take the latest version of compat-wireless (don't take the one with dates).

Sunday, February 19, 2012

WPA cracking tips and tricks

WPA cracking is at the same time easy and hard to crack. It is quite easy because all you need is getting the handshake (with WEP, you need a lot of data frames). It is hard because getting the handshake can be tricky and also because cracking can take a lot of time (due to passphrase length, 8 to 63 characters).

Important notes:
  • Never forget to read the documentation in the wiki
  • Don't hack AP you don't own or if you don't have the permission to do it.


There are several things to consider when getting the handshake:
  • You need to be somehow close to both the AP and the client. If you only have the client, you should use airbase-ng to get the client to connect to you.
  • If RXQ is below 70 then there is a good chance you'll get a partial handshake which will be unusable.
  • You MUST be on the same channel as the AP (in airodump-ng, you will see RXQ column when on a fixed channel)
  • It is not necessary to keep deauthenticating the client, once or twice should be more than enough. And let the client reconnect in order to get the handshake. Each aireplay-ng tells you it sent deauthentication, it sent 128 or 256 deauth frames.
 If you still don't get the handshake after reading the wiki and those tips, then you might want to have a look at WPA Packet Capture Explained tutorial in the wiki to help understand what's going on.

Tip: It is always a good idea to clean up the capture to include one beacon the handshake before cracking it or submitting it to an online cracking service. The reason is that YOU select the handshake to crack and don't let the tool on those services to select the handshake (that might be the wrong one).

It might sound funny but it is true, there is 0% chances to crack it if the passphrase is not in the dictionary (and 100% when it is in the dictionary). So what you want to do is profiling your victim when cracking the handshake to include words/phrases related to it. You can also find a few tools on backtrack such as John The Ripper that will help you mangle the dictionary and "add" new words.
If you need to generate phrases such as number, check out 'crunch'.
Note that aircrack-ng doesn't mangle the wordlist and doesn't do any permutation, it just tries each passphrase against the handshake. And in case you want to be able to 'pause' the cracking, use John The Ripper to output to stdout and pipe the results to aircrack-ng (using -w -).
GPU cracking makes cracking much faster. One of the best solution for that is oclHashcat-plus (and it is much faster than pyrit).

Now that you've cracked the handshake, you might want to verify it. People have been trying to connect to the AP but it is the wrong way of checking since there are a lot of variables involved (such as distance, mac filtering, bad drivers, etc) that will prevent you to connect even if the passphrase is valid.
So what you have to do is using airdecap-ng.
With WPA, since what you get with the handshake is a session key for a specific device, you can only decrypt the traffic after the handshake for that device. Don't be fooled by airdecap-ng giving 0 frames decrypted when there are a few data frames encrypted with WPA, there might not be any traffic from that device after the handshake. Hence why it is very important to be able to understand a capture file.

Saturday, February 11, 2012

Aircrack-ng on phones (Android, iPhone and others)

I've often seen questions like "How can I get Aircrack-ng on my iPhone/Android/Symbian/[ADD YOUR OS]?". Let me clarify the status for phones.

In order to have Aircrack-ng running on the phone, there are several requirements:

  1. Being able to cross compile (because the CPU on your phone has a different architecture than the one on your computer). So if you cannot find a cross compiler for that specific platform, forget it.
  2. A wireless card. Most phones have one these days, so that's easy.
  3. If your phone is Linux based, you will also need to be able to be 'root' to run the commands.
  4. The driver must allow monitor mode. That's usually where almost all phones fail because only a few have that. Sometimes the card doesn't have a stable monitor mode. The reason behind it is that it must be low power (and cheap to manufacture) so the chipset (and its firmware) is very limited.

To give you a quick answer, only one phone meets all the requirements with its internal card: the Nokia N900 (it needs the 'power' kernel available in the extra-devel repositories). While doing monitor mode/injection, the battery last about 4h.

  • iOS devices: Forget it because it is never going to happen, Apple is consumer oriented and doesn't really care about the computer security industry. Plus,  iOS is too closed source and AFAIK the chipset is not capable of proper monitor mode. You could argue that it is available via Cydia. It's true but you don't have any monitor mode capabilities, so it doesn't worth it (also don't bother sending me Cydia bug reports, I don't read them).
  • Android: Forget it with the internal card. However, it will be possible with an external USB card. Dragorn, the author of Kismet Wireless is working on it.
  • Other OS: Forget it (for the same reasons as Apple).

Saturday, January 28, 2012

Best card (or best laptop/netbook) for Aircrack-ng

After a long time and no updates on the blog, I'm back. I hope to keep it active like before.

One of the question I see asked very often is "what card should I use for Aircrack-ng?" or "what laptop should I use?".

As far as card goes, I can tell you that even though the wiki looks outdated (it isn't updated because the information is still accurate), the Alfa AWUS036H (Realtek 8187) is still a very good card. Another very good one is the Rockland N3 (Ralink chipset).
If you would like to capture and inject on 802.11n networks, you can use a card compatible with carl9170 (I use a Netgear WNDA3100 v1).
Correct me if I'm wrong but I haven't been successful with new Ralink cards even though they support 802.11n, something is missing in the driver to be able to have that capability in monitor mode.
There might be other compatible chipsets for 802.11n (maybe recent Intel cards) but I haven't tested them so I can't confirm.

So, now about laptops and netbooks. One of the best chipset for internal cards is still Atheros.
You can try getting a laptop with Atheros cards but it is not easy to find since vendors don't often advertise what card they use and in most cases it is because they use a Broadcom (which are far from being the best cards). When they do, it is usually an Intel.
So what I recommend about laptops and netbooks: Get one that you like and you're comfortable with, don't worry about the wireless card that comes with it and use one of the cards mentioned above.
If you really want an internal card, you can replace the internal card with an Ubiquiti but keep in mind that some laptops have a BIOS lock that prevents using another card than the (overpriced) one they sell. HP/Compaq is known to do it. I've heard Dell does it on some laptops too. I don't know for others.

Another thing I've often seen is people who wants to get cards from local stores. In my experience, local store 1. don't have a lot of choices 2. don't know what chipset their cards have and 3. don't really care about it. That's why I always shop online for wireless cards. There is a good chance you can find a compatible card on Amazon or eBay.

I'll cover phones and Access points in another post.

Friday, September 24, 2010

Monthly news - September 2010

Aircrack-ng now has support to export WPA handshake information to Elcomsoft Wireless Security Auditor v3 project file since svn r1781 with '-E' thanks to beini's author.

As said in previous monthly news, migration mode attack (WPA Migration Mode: WEP is back to haunt you...) has been added to aireplay-ng and a few improvement were added to aircrack-ng. More details in r1769 commit.


Forum:

Other:
  • A few tools for generating passphrases lists.
  • Live CD
    • WEAKERTHAN2, another pentetration testing linux live cd was released a few weeks ago.
    • Beini, a small Live CD base on TinyCore Linux, is one year old (chinese).
  • Scripts