Friday, 22 July 2011

Cracking a Wi-Fi network

I had always heard that cracking a Wi-Fi network was really easy, but I never tried to do it. Yesterday I decided to give it a go. Could someone get in my network easily?

Remember that using somebody else's Wi-Fi is probably illegal, so you should probably do this only with your own Wi-Fi networks or with the owners' permission.

I am a complete newbie to this sort of thing, so I started with the easy part: cracking a WEP Wi-Fi. I guess nobody should be using WEP anymore, since according to Wikipedia "The Wi-Fi Alliance defined these [WPA and WPA2] in response to serious weaknesses researchers had found in the previous system, WEP (Wired Equivalent Privacy). " But WEP is still everywhere... Right now my laptop detects 5 Wi-Fi spots, and the only one that uses WPA is my own!




Next step was to do some research, since "wifi crack" gives you about 31,000,000 results in Google... A key aspect of this is to have a network adapter capable of "packet injection". There are many cheaps models available, but it turned out that my modest netbook comes with a "Intel Corporation WiFi Link 5100" adapter, which is able to do it. In order to make it work with my standard Linux distribution, I should probably need to update the firware and/or patch the kernel. But safer and easier was to just grap a copy of BackTrack Linux (version 5), make a LiveUSB out of it and reboot the netbook. With it, the Link 5100 was apparently ready for packet injection....

Then, after a failed attempt I stumbled upon this guide, which made the process very easy. I was not sure that my network adapter was 100% up to the task, so I decided to go for a field test. I just walked around the town in search of a good WEP Wi-Fi. After a few attempts in which I got the "Association successful" message but then the Data collection was very slow, I hit a busy WEP Wi-Fi network which made the whole process a breeze, and in 10-15 minutes I had the key (hidden below):


Aircrack-ng 1.1 r1899


[00:00:00] Tested 676 keys (got 68393 IVs)

KB depth byte(vote)
0 0/ 1 5A(99328) 1B(78336) 54(78080) EB(77568) 66(76032)
1 11/ 1 B5(75264) 2C(75008) 35(75008) 8F(75008) C2(75008)
2 2/ 7 8A(80128) 26(79104) 0C(77824) 4B(77056) BF(76800)
3 14/ 3 04(75264) 00(74752) 6E(74752) 60(74240) 15(73984)
4 0/ 5 1C(94720) 74(80384) 77(79872) 18(78592) 8B(78336)

KEY FOUND! [ XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX ] (ASCII: XXXXXXXXXXXXX )
Decrypted correctly: 100%



The person in the guide mentioned above says that she could not get to the stage where enough data was collected for aircrack-ng to succeed, and it looks like that is quite common in networks with very low wi-fi traffic. Out of the 10 or so networks that I tried, only in this one I was getting data at a very high rate. In other ones perhaps I should wait hours in order to get to the recommended 10k data mark.

So, I'm happy that my Wi-Fi network (and all the ones at work) are not WEP-protected, since getting into them seems a piece of cake. Next turn, my own WPA network (which I hope it will be much more difficult).

Friday, 8 July 2011

Changing mail reader again. This time: Gnus

After a year reading my mail with Thunderbird, I have decided to try Gnus. I was already using it (though not often) for newsgroups, but now I wanted to do it for regular e-mail. In the past I have played with Gnus a bit, but never spent the necessary time to learn and configure it properly. This time I took a couple of "slow" days and decided to make the effort to dump Thunderbird and go for Gnus.

Some things that I didn't like in Thunderbird during this last year:
  • Synchronizing between different computers was not straightforward. Mails were in the IMAP server, so that was not a problem, but I wasn't sure how I could easily synchronize news (from newsgroups), filters, etc. in different computers
  • For some reason, Thunderbird would mark some messages as read, even when I didn't say so (quite dangerous, as once I read a message, I normally don't go back to it).
  • The IMAP connection to my server was very slow after having thousands of messages, so I ended up archiving messages by year. This was a bit annoying, since from my home computer then I could not access those messages.
  • Probably related to the archives, when searching for messages, sometimes a relevant message would show up in the search results, but when I tried to open the message, then nothing would show up. I would have to remember the date of the message and go and find it manually. Not very convenient.
  •  Many times Thunderbird complained of server timeouts. As a result, messages that I thought were deleted, actually remained in the server and other oddities...
So I decided to give another chance to Gnus. Can it do everything I need? Was the effort to replace Thunderbird worthwhile?

My current mail setting now involves two accounts (work and private), which are backed up in a third account (which I never touch, this is just a repository of ALL the mail I get). At my workstation I run fetchmail to download locally (and delete from the mail accounts) all the e-mails I get in both accounts (the setting for this only involves creating a .fetchmailrc file where I specify the servers, accounts, etc.). (sendmail also needs to be running in the machine).

The Gnus manual (the PDF version) has 435 pages, so configuring it to your taste is going to take a while, but it is (like Emacs), incredibly flexible and powerful. For me the main features that I was looking for were:
  • Reliability (I hate when software starts doing "things" on its own).
  • Possibility of having exactly the same environment and configuration, no matter where in the whole Internet I was located.
  • Good filing and searching of messages.
So after a while, reading the manual and asking in the relevant newsgroup, I have more or less everything I need (though this being Emacs, I'll probably never stop modifying the configuration):
  1. mail is sorted into different groups, and those in the "MailingList" groups are deleted automatically in one week (unless I say otherwise), and other Mail is never deleted (unless I say otherwise); 
  2. the search engine works really fast and well (actually much better than the Thunderbird search engine); 
  3. this works inside Emacs, which I run in text mode (emacs -nw), inside GNU screen (well, actually Byobu), so wherever I am, I only need to connect through ssh to my workstation, and I have full control and exactly the same configuration everywhere.

And this is how it looks right now. The "Folder" view:



The messages view in one of the groups:



I have only used it for a couple of days, so I'm not sure how it will score against Thunderbird in a year from now, but so far I didn't have any problems, and it looks a better approach for my needs. I will report back in a year!

Thursday, 16 June 2011

Calligrams with Inkscape

Today I was looking for a quick way to create a calligram. I tried to do it with the GIMP, but it was not that easy, so I looked for another alternative, and I found Inkscape. I had never used it before, but it looks very powerful for vector graphics. As for the calligram, it is very easy to make both things that I was looking for, as illustrated below: make text to follow a path (which can be obtained from a picture, as the example below) or to flow inside a given shape (the guitar svg file can be found here).



Friday, 10 June 2011

Goodbye Palm...

I've been an owner (and a heavy user) of a Palm device for many years (around 15 years...) but lately I was not using it anymore, so I decided to get rid of it, but I needed to backup some of its data. Basically this came down to backing up:

  1. The contacts, which I did by using the J-Pilot software for linux. The contacts were easily exported to a CSV file. I tried to import into BBDB following these instructions, but the program was outdated, so at the end I had to do it "manually" (through regular-expressions inside Emacs).
  2. Birthday data store in the HappyDays application. I didn't find an easy way to export the data compiled by HappyDays, but in the end decided that it was not that important, since the birthday data is actually collected from the contact data, which I already exported.
  3. The most important data after the contacts was the data stored in SplashID. I believe that more recent versions of the Palm software come with a version to export directly in the device into a CSV file, but my version is very old (2.03), and didn't have this feature. The trick was to install the Palm Desktop software (Version 4.1.4) in a Window XP virtual (VirtualBox) machine, and then install the 2.59 old version of the SplahsID Windows software. But I couldn't get the Windows virtual machine to recognize my USB-connected device. It turned out that I had to upgrade the VirtualBox that comes with Ubuntu 10.04 and install the 4.0.8 version, and add myself to the virtualbox group. I got it to work by following these instructions (although I din't add myself to the usb group, only to the virtualbox one). Once that was in place, I easily synchronized my SplashID data in the Palm to the Windows software, and then exported the data in CSV format, which was then imported into an encrypted org-mode file to handle with Emacs (which is much more convenient to me now).

Monday, 6 June 2011

When the lack of any probability theory knowledge can bring a big unfairness

Recently I enrolled my son for the local music school. As there are always more candidates than places, somebody apparently decided that it would be a good and fair system to do the following:
  1. Sort out all the candidates alphabetically.
  2. Randomly select one of the letters and then choose n candidates (where n is the number of available places), starting with the first candidate whose surname starts with the chosen letter, and just go down the list in 1. (continuing from the beginning if the end of the list is reached) until all available places are taken.
To see how bad a system this is, I just got a list of 106 people that were applying to another local school (I just didn't have the original list with me) and assumed that 25 places are available. The probabilities of getting a place are so unfair, that I'm going to contact the local school to see if they want to change the system for coming years. Two of the extremes:
  1. One person has only a 3.85% probability of being chosen (the last one whose surname starts with S, since there are 14 people whose surname starts with R, and 12 people whose surname starts with S, so the only chance for her is that the randomly chosen letter is S).
  2. Another person has a 42.31% probability of being chosen (the first one with the letter C, since surnames starting with letters from S to B are a very small proportion of the total, and he would be chosen if any of those letters are randomly chosen. The number of surnames for each of these letters is: S: 12; T: 4; U: 1; V: 4; W: 1; X: 0; Y: 0; Z: 0; A: 1; B: 1).
Below I include a chart which, assuming 25 places, gives the probability (as a percentage) of being chosen for all the 106 people included in my test sample.



Wednesday, 1 June 2011

TestDisk saved my day

Today I discovered a little gem: TestDisk. My USB pendrive had lost the partition table with some important documents that my guitar teacher gave me yesterday (perhaps because he removed the drive without safely unmounting it first), and this program recovered the partition in a matter of minutes (before I even had the time to read its documentation).

Certainly a tool to have handy...

Thursday, 19 May 2011

Performance anxiety...

Oh well, nothing new about this... Any musician forum is full of posts about performance anxiety, and I have to say that I'm one of those suffering from it. Yesterday we had an audition for other teachers and guitar students at the Conservatoire.

Performance anxiety recipe

Ingredients:
  1. A naturally shy person.
  2. A difficult piece, above the level in which he/she feels confident.
  3. No (or very few) prior public performances.
  4. Discerning public (teachers and students of the same instrument, who will easily recognize when you are doing something wrong).
  5. (Optional) Arrange the performance program so that the previous player is a very competent one that plays effortlessly and with clearly no performance anxiety.
Result: 
  • A blotched performance

Yes, that is more or less what happened to me yesterday (playing Villa-Lobos Etude 1, perhaps a bit better overall than my recorded version, which was a bit slow and not very musical). The performance was not horrible: I didn't blank out, I didn't have to restart the piece or any bars, and the piece sounded more or less OK, but with some clear mistakes, and without a great sound (specially for barre chords, my weakest point even in the comfort of my studio), and most importantly for me, without really enjoying the experience.

The plan to improve this: get out and play in front of people as much as possible (though this will be difficult due to timetable constraints), and try to read about it and possible ways to improve. Recommended books about this:

Inner Game of Music
Performing in the Zone



Will report back....