I installed a fresh Ubuntu desktop guest on VirtualBox 4.3.14. Trying to install VBox additions I was getting an error message:

The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.

 

Apparently all I had to do is reinstall the headers using the following two commands:

 

sudo apt-get remove dkms build-essential linux-headers-*
sudo apt-get install dkms build-essential linux-headers-$(uname -r)

Trying to reinstall Linux Additions for VirtualBox works like a charm!

I wanted to add a new device to my wireless network, but I had forgotten the wireless key. My network uses WEP encryption. So, I used aircrack to recover the key. Basically what I had to do was:

    • use airodump to save a large number of  transmissions between the wireless router and a device that is already connected to the network.
    •  use aircrack to analyse the file produced by airodump and find the password

In particular, I managed to recover the key in the following simple steps:

  1. Download BackTrack Linux Distribution and burn it on a DVD.
  2. Boot my laptop using the live DVD
  3. On command prompt type:
    ifconfig to see the available network interfaces in Linux. Doing this I was able to find my laptop’s wireless interface.
  4. Type: airodump-ng -write afile.cap wlan0 , where afile.txt is the file that airodump will save all communication and wlan0 is the wireless network interface of my laptop as discovered in step 3. Let it run and collect packets for quite some time. It may a few hours (in my case it took 6 hours) for this step to collect enough packets. The time it will require depends on the traffic of the network. The more traffic the better. Once enough packets have been collected press Ctr+c to kill the process.
  5. Type: ivstools -convert afile.cap afile.ivs to convert the captured packets to ivs format compatible with aircrack
  6. Use aircrack-ng afile.ivs. Aircrack will pop up a menu to ask you which network you want to crack. Select the SSID of your network and if enough packets have been collected in step 3, you will have the key of your wireless network in no time!

I have a Windows XP installation on a VMWare hard disk. Today I tried to boot it, but… OOPS (no.. I don’t mean Object Oriented Programming and Systems… I mean..crap!). It seems I forgot the password of the installation. So a little adventure started…

1. After a bit of research I found out that there is ophcrack. I downloaded the live CD as an ISO image and set VMWare to load that CD.

2. When VMWare starts and before windows starts booting I clicked on the VMWare screen and pressed ESC. This gives me the menu to select the device I want to use to boot.

3. I chose to boot from the CD.

4. The ophcrack live CD starts loading, but when it finishes I get a:  “No partition containing hashes found” error.

5. The problem seems to be that the Windows installation is on a SCSI virtual disk that is not recognised by this distribution of linux. Tried “fdisk -l” on a terminal from within the ophcrack live CD and it didn’t return any results.  To be able to crack the password I need to have access to the “WIndows/System32/config/ folder of my virtual hard disk. So…

6.  I created a second virtual hard disk in the same VMWare virtual machine. I downloaded an ISO image of Ubuntu

7. Installed Ubuntu on the newly created hard disk.

8. Boot using Ubuntu. Ubuntu was able to access the virtual hard disk of the windows installation. I copied the folder “WIndows/System32/config/” on my local Windows 7 installation.

9. Downloaded ophcrack for Windows and installed it on my Windows 7. Also downloaded the XP Free Small Table.

10. Launched ophcrack and clicked on “Tables”->Install and selected the folder where I had downloaded the XP Free Small Table file (if it is a zip file you need to unzip it).

11. Select Load->Encypted SAM and select the “config” folder I had copied from the VMWare installation (through Ubuntu).

12. Got my password in 45 seconds!!

I use a virtualbox virtual machine to run Ubuntu from within Windows (yes, I know I am a masochist). Anyway, every time I resume the virtual machine Ubuntu loses connection with the internet and I have to reset the interface. In windows from the command prompt you have to do an ipconfig /release and an ipconfig /renew. Similarly in Ubuntu all I had to do was the following:

1. sudo ifconfig to get a list of all the network interfaces. There you can see the name of the networking interface that you need to reset. In my case I wanted to reset interface “eth3”. So I did:
2.sudo dhclient -r eth3 to ipconfig /release
3.sudo dhclient eht3 to ipconfig /renew

That’s it! Got a new IP and I can access the internet!

It is time for spring cleaning my hard disk at home. I am sorting/deleting files that I no longer use. I will post here files that I do not need now, but might need in the future.

So… I found a small linux shell script  that individually compiles every java file in a directory and all its subdirectories. The code is:

#!/bin/bash

for d in `ls`
do
javac $d/*.java > $d/compile.txt

done

The text file can be found here:  batchcompile