Physical Attacks on Passwords
Hacking combines many elements and can scale a great deal. From human hacking and software hacking, to physical attacks and then some. There are many ways in which passwords can be abused, and obtained. This module will aim to highlight this. For the sake of education, we've put our own systems on the line in order to perform such attacks. Many of these attacks may not be feasible due to time constraints however if the system is stolen, or “misplaced” the attacker has just gained literally all the time in the world – or universe depending on how you look at it. The glass thing, uh what ever!
Hardware Keyloggers
Hardware keyloggers are very hard to detect. The reason for this is not many people inspect the backs of their computers; and for the most part no anti-virus software, or anti-spyware applications can detect these hardware devices – yet.
Hardware keyloggers come into place during a few interactions. Many times social engineering will get you into the environment – and once inside you'd need to place these devices about. Once the devices are placed / planted you'd need to return. So, posing as a pest control person, or other much needed worker (clean up – janitorial) you can come back into the environment to obtain the precious data you've just sniffed.
The most common types of hardware keyloggers are as follows (viewed with the help of google:)

From left to right, we have a mini-din (ps2 style), key logger disguised as a keyboard, and finally a USB to USB key logging device. If you notice any of these devices (minus the device in the middle) you should suspect foul play.
Linux LiveCD & Hard Disk Removal
If you have access to the system, and or can remove the hard disk, or even boot the machine to a Linux LiveCD, perform the following steps:
Notice that this attack may take some time to accomplish. So, be sure you can a lot at least 30-45 minutes to get this job process completed. Make sure you have a jump drive, pen drive, or access to the internet to save the files to. Otherwise, you are in for a wild ride!
When you boot the system, from the liveCD or removed the hard disk and have successfully mounted it into your computer, perform the following Figure 1.0 demonstrates this:
If you were able to steal a laptop, or a hard disk note that you wouldn't have to perform the password cracking process – unless you really needed to get a feel for the passwords you'd be up against. In such a case it would still be wise to crack the passwords and also browse what the system has to offer you! The old saying is: “A watched pot doesn't boil” and the same said for computers: “A watched Windows doesn't boot!”

Figure 1.0 Demonstrating an fdisk on a windows Drive.
Once we've identified the windows partition (shown here with the HPFS/NTFS) signature, we now need to create a folder in /media/ called windows. We can do this by entering the following command: mkdir /media/windows/ once this has been completed, figure 1.1 will demonstrate what is to be done next:

Figure 1.1 Demonstrating a folder creation in linux.
Now that we've seen the hard disk labeled as /dev/sdb1 and mount it to /media/windows in order for us to accomplish this, we enter the following within the shell:

Figure 1.2 Demonstrating a mount from sdb1 to /media/windows and change directory.
Now that we've obtained access to the “WINDOWS” directory, cd need to shell into the system32 folder, and then into config. Figure 1.3 displays such:

Figure 1.3 Clearly displaying the SAM files, and the config directory contents.
With this you can then load the SAM file into L0pht crack, or john to get the job of cracking done.
Ophcrack LiveCD
In our current environment, we've setup a liveCD which can and will provide us with what we need to launch the physical attack against. Our first stop was to download a version of the cracking application on liveCD. We've obtained our image from here: http://www.paulspoerry.com/2007/01/09/ophcrack-live-cd-crack-windows-passwords-in-minutes/ also, notice that each version of windows has it's own specific download candidate. Download the version you need for windows XP or windows Vista/7. Using one against the other which it is not designated for will cause some unintended results.
Because the cracking and attack should be straight forward, we are only walking you through the attack vector with windows xp professional. Outside this, you should be comfortable in mounting and launching the attack on other systems as well with no problems; and when we say systems we do mean microsoft.
Before we begin detailing the attack, let us go through the steps needed to get the attack going. First and foremost we've gone into windows and setup 3 accounts note that you can do this in any method in which you deem as necessary. The accounts we've created are: hackbox, finance and finally, user1 figure 1.0 demonstrates the users listing:

Figure 1.0 Demonstrating the 3 accounts and guest account (disabled)
Once this was set into motion, we've then set some options to give the computer a nice “business” feel with the login screen. At which point, we are also demonstrating the “hey we cannot get into the computer” aspect of this module. Once we've done that just for the aesthetics, we've proceeded to shut the computer down. Figure 1.1 demonstrates this:

Figure 1.1 demonstrating a shutdown request.
Here, in figure 1.2 you will see that we've added that “business” like feel, and where we'd most likely be stuck if we did not know the password; however, this will all change!

Figure 1.2 Demonstrating the login window for “hackbox”
Once we have a target box in mind, we will then attempt to setup our attack liveCD, in such a case, we need to locate where we've downloaded our tools to. In this case we've downloaded them to /home/username/Downloads. Figure 1.3 demonstrates the location of the download, and the following steps needed (notice we are using ubuntu 9.10 for this exercise):

Figure 1.3 demonstrating the location of the ISO needed to create the liveCD.
Now that we have located our ISO we need to then, right-click the iso, and choose BURN. Figure 1.4 demonstrates how to perform this action.:

Figure 1.4 Selecting the burn option.
Now that we've instructed the box to burn the image, we should see a screen as follows; notw depending upon your hardware requirements you will need to select the appropriate profiles to perform the burn.

Figure 1.5 Burn Screen.
In order to launch this attack properly, you will need access to get the computer to boot from a CDROM drive, or if you would like to fiddle around, a USB jump drive. Once this has been accomplished, you will launch the following results. NOTICE: in this case we've loaded this machine to automatically boot from bootable CDROM media.
When you first boot the linux liveCD you will see the following screens, figure 1.6, 1.7, and 1.8 will demonstrate the first few screens you will see:

Figure 1.6 Detailing that “Ophcrack Graphical mode – Automatic” is selected.

Figure 1.7 detailing linux loading in a liveCD fashion. Do not be alarmed!
And, finally our environment loads. When this completes we should see the following screen:

Figure 1.8 OphCrack doing it's thing
If you are of the unfortunate and your liveCD continues to crash you may want to try to crack the password in text based mode. This mode will accommodate the cracking in a sub section here. If you have troubles, please skip forward to that section.
Ophcrack in Textual Mode
Because we have been quite unlucky, or the memory resources did not accommodate what we were looking to accomplish, it is quite possible that the textual based form will help us bypass such an issue. If not, we have other methods to get around this; we've come this far, and if this fails – why not add an administrators account? Well, before we start getting all fancy, lets finish what is currently at hand.
Due to the fact that many of the start up procedures have been detailed in the previous module, if you need help, or are having trouble please see the previous modules chapter. Here, we've selected the graphical version, however you can also select and opt-in for the low-memory portion. Figure 1.0 demonstrates the options selected (notice we've placed emphasis on the last two options):

Figure 1.0 highlighting low RAM and text mode options!
Once the linux liveCD boots, you will be asked for your language, select the appropriate language. Figure 1.1 displays this:

Figure 1.1 detailing language selection.
Next, you will need to select your key mappings, in this case we are selecting USA, lay out. Figure 1.2 details the key mappings dialog:

Figure 1.2 key mappings (USA)
In these modes, your passwords (and their NTLM hashes) will be dumped to the /tmp/ folder. When Ophcrack cracks the passwords, it will perform the in the same methods as the windows and linux counterparts will displaying the passwords.
LinNT SAM Reset
In this example here, we will have a much more elaborate method to gaining access into the machine utilizing a bootable OS from a floppy disk. However, you must understand that if your machine does not boot from or have a floppy, you must use a USB key, or CDROM in order to boot up to the minimal Linux kernel. In this example, we will be resetting the password in the SAM file. This will effectively grant us access to the target machine.
In order to accomplish this task, you will need to download LinNT. Once You've downloaded the LINNT bootable floppy, unzip the archive and perform the following steps:
•Insert a blank floppy disk •Double-click the Rawrite.exe •When prompted for source file enter: ›bd980211.bin ›{commit enter key} ›When prompted for drive letter enter: A: ›When Prompted for disk write {commit enter key} •Insert floppy and Reboot.
|
Figure 1.0 guide to setting up LinNT
When the disk has been created, and the information written to the Floppy, we will perform the following steps in figure 1.1:
•Probe for SCAI drivers? {commit enter} •When asked for hard disk: {commit enter} Disk should read /var/hda1 •When prompted for registry directory: {commit enter} NT Systems: winnt/system32/config XP Systems: windows/system32/config •When prompted for hive: {commit enter} •When asked to mod password / registry choose: 1 (option one) •On list of users: {commit enter for administrator} ›Enter * [asterisk] for administrator password. ›Change password: Y {commit enter} ›Change administrators password again?: ! {commit enter} ›What would you like to do next?: q {commit enter} ›Write hive files?: y {commit enter} ›Are you sure you really want to write hives?: y {commit enter} •Reboot the computer
|
Figure 1.1 resetting Administrator password.
Removing BIOS Passwords
Before the corporations began to change the way in which the passwords were stored in the system (BIOS) the password reset was quite simple to achieve. Here we have a module dedicated to such bypassing:
BIOS Passwords are sometimes implemented in corporate environments where upper management did not want it's workers to mess with settings of the machine. Many times, it's also utilized in schools to deter students from utilizing bootable OS's or using command prompt to circumvent security mechanisms. In any case, we will assume you've obtained unattended access to a machine. Of course, you have a screw driver (and in some cases a lock snipper / bolt cutter [some machines have locks on their cases]). Once you've gained entry into the machine in a physical sense you will need to locate the battery on the motherboard. The motherboard battery is similar as in the following depiction:

Figure 1.0 Showing BIOS battery.
ALL motherboards will utilize this type of battery device in order to store information such as, configurations, passwords, date and time. As words of caution: Some machines may have advanced settings applied to them. Removing the BIOS battery for 10 seconds WILL erase all the information on the board (date, time, configuration and password). USE WITH EXTREME CAUTION! However, once this battery is removed and placed back into the system (after a 10 second grace period) the password on the BIOS will then be removed (depending on the BIOS setup).
Shoulder Surfing
Very sneaky in it's own, however combine this attack with a user who has a great memory and knows how to keep a conversation going at all and any cost – you can have a users password rather quickly. Shoulder surfing is the art of talking to a person while standing behind them and watching them authenticate to a system.
Normally this is achieved by viewing the user name first, and then watching the keyboard whilst they apply the password to the login field in order to gain access. Once this is done, it can be applied later on after the user has logged out.