Hack #2. Bypass the BIOS Password

Recover from a CMOS memory-affecting virus or work around a boot-time password by making BIOS forget all it once knew.

A PC goes through a process when it is first turned on: the Power-On Self-Test, or P.O.S.T. Some system boards provide security measures [Hack#1] that demand a password before beginning the P.O.S.T. process or allowing you into the BIOS setup program.

The original IBM-PC (1981) did not provide any security measures or a BIOS setup program; all it had was a P.O.S.T. If you needed to configure a PC, you did it with switches and jumpers. A program to set up the system BIOS and configuration did not come along until the IBM-PC/AT (1984), and it had to be run from a special boot-up diskette. The idea of providing a user interface and access to the system configuration settings within the BIOS did not come along until about 1986. Today no PC system is made without this valuable built-in setup feature. Eventually, the security feature of password-protecting access to the system came along.

If, after turning on your PC, you are prompted for a password instead of greeted with a fancy logo screen or the technical gibberish that suggests the system is getting ready to let you use it, then a security feature has been turned on that we call a " pre-boot password." Without the right password to get past this point, the system is basically dead in the water—game over, do not pass go and collect $200—unless or until you reset the BIOS setting. But how do you do that without getting past the password to the setup program?

Tip

This hack is also very effective for putting the system board back into "factory stupid" mode where it knows nothing about your system components and forgets all of your parameter tweaks. This is very useful if you've performed a hack that renders the system unbootable or unstable.

The goal is to get the system to forget that it needs a password and forget what the password was. The password data is stored with the rest of the system configuration data in a small amount of memory that is kept alive using a small battery or internal power cell. To clear out the data, you need to remove the power from this memory element. This means the system will also lose any system configuration that was saved. You'll need to later reconfigure the system parameters so you can boot your operating system.

Warning

For this and many subsequent hacks, you will be working with electrical components inside your PC. We want you to get through the entire book and enjoy your computer for a long time without risk of electrical shock or component damage. When the cover is off your PC and you are removing or adding components—be they add-in cards, RAM chips, CPUs, or fans—especially when you are handling the screws to hold things in place, ALWAYS turn the PC's power OFF and unplug the power cord from the back of the PC.

Disconnecting the power cord removes the risk of exposure to high voltages and accidentally turning the power to the system board on. Disconnecting the power cord also allows the PC chassis to become ungrounded, which reduces the potential difference between any static charge in your body and the chassis so static shocks are less likely.

It is also recommended that you use an anti-static wrist strap connected to the PC's chassis for further protection of delicate electronic components.

To perform this hack you will need:

  • A #1 or #2 Phillips-head screwdriver, or (less likely) a T-15 TORX driver or a 1/4" hex nutdriver, to open the case

  • Needle-nosed pliers if you are working with jumpers

  • A small flashlight or headlamp

With tools at hand, perform the following steps:

  1. Turn the PC off (this means a total shutdown, not merely standby or hibernate mode) and disconnect the AC power cord.

  2. Remove the cover from your system (this step may require tools, undoing a thumbscrew, or flipping a latch or two).

  3. Refer to the user manual for the motherboard to find out how to "reset CMOS" memory. You may also find a label for specific jumper or switch settings marked on the system board.

  4. Change the switch setting or jumper position to a specific position or remove the jumper entirely as prescribed in the manual to clear or reset the CMOS memory.

  5. Wait 20-30 seconds for the memory to clear out from lack of power.

  6. After 20-30 seconds put the switch or jumper the way it was before for normal use.

  7. Reconnect the power cord and start up the system to see if the settings have changed to defaults.

  8. Shut the PC down, disconnect the power cord, replace the cover, reconnect the power, and power up the PC.

  9. Enter the BIOS setup program to configure the system as needed. This may include setting the date and time, selecting disk drive parameters, and selecting which devices the system uses to boot up with first.

If your system does not have a "reset CMOS" jumper or switch , the only option is to locate and remove the coin-style battery cell (or on some very old PCs, the battery pack), as shown in Figure 1-2, that provides the power to the CMOS memory.

System board with coin-style battery used to retain CMOS memory

Figure 1-2. System board with coin-style battery used to retain CMOS memory

Follow Steps 1 and 2 above, locate the battery, and remove it. Leave the battery out of the system for 20-30 seconds, replace it, and start up the system. The CMOS memory in some systems may retain settings longer than others. If the CMOS memory does not clear and you're still stuck, you may need to leave the battery out for several hours before reinstalling it.Once the system is able to perform P.O.S.T. and to start booting up the system, you will need to get into the Setup program for the BIOS and make a few basic adjustments, such as:

  • Setting the date and time

  • Selecting auto-detect or manually setting specific parameters for IDE hard drives

  • Setting the boot-device order—diskette drive, hard drive, CD-ROM, etc.

If you expect to perform more hacks with jumpers, switches, cables, chips, or disk drives, you'll probably find it convenient to leave the cover off your PC, but beware: we do not want to cause more trouble than we're trying to solve. You could be exposing yourself to dangerous voltages (inside the power supply) or exposing the internal wires and connections to disk drives and plug-in cards to your tools, screws, and other wires that could come in contact with them. At this stage, spilling your favorite beverage or dropping your tools anywhere inside the PC chassis is not advised.

Tip

You may find one of many possible " backdoor" passwords for your BIOS that allow you access to the system setup program and bypass boot passwords at either of two web sites: http://www.labmice.techtarget.com/articles/BIOS_hacks.html or http://www.pwcrack.com/bios.shtml.

Get PC Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.