Linux password ultimate crack battle

  
        

I want to write linux related articles for a long time. As a pseudo-technical origin of operation and maintenance, I think linux is the future trend, so the first step of linux password security is very important. To illustrate, the platform Red Hat Linux (2.4.20-8).

Crack the login password

GRUB: On the boot loader menu, type [e] to enter edit mode. You will be faced with a list of boot projects. Look for a line that resembles the following output: kernel /vmlinuz-2.4.18-0.4 ro root=/dev/hda2 Press the arrow keys until the line is highlighted, then press [e]. You can now tell GRUB to boot single-user Linux mode by adding a single at the end of the text. Press [Enter] to make the edits take effect. You will be taken to edit the mode screen, from here, pressing GRUB will boot the single-user Linux mode. After the end of the load, you will face a shell prompt similar to the following: sh-2.05# Now you can change the root command, type: bash# passwd root You will be asked to retype the password to verify. At the end, the password will be changed, you can type reboot at the prompt to reboot; then, log in as the root user as usual. LIL When the system boots to the LILO boot screen, press TAB to enter the text mode for the graphical boot mode, then enter linux single at LILO to enter the password-free console. After entering the password, use the passwd command to change the root password. can.

Method 2: grub->linux->Select one---E---> Enter at the prompt (/linux s init 1)--Enter--b- -> After rebooting, enter (vi /etc/passwd and remove the user's password transfer bit (x) from the prompt, forcibly save)----restart!

This is the most common and quickest way

Prevent others from changing passwords in single-user mode.

Since you want to guide single-user mode, you need to edit it in grub. Therefore, we only need to encrypt grub, and you can prevent it from being modified by others.

The method is as follows:

1, grub has a configuration file, in the /etc folder. The name is “grub.conf”, find this file, edit with vi.

2, we look at the contents of the file: (comment is free)

default=0

timeout=10

splashimage=(hd0 ,0)/grub/splash.xpm.gz

title Red Hat Linux (2.4.20-8)

root (hd0,0)

kernel /vmlinuz- 2.4.20-8 ro root=LABEL=/

initrd /initrd-2.4.20-8.img

The specific meaning you can check the relevant documentation of grub, here we want to add password.

There are two places where you can add a password.

3, the first is "under the timeout = 1 /rdquo; below, here plus "password=123456" (123456 is their own password). Save, exit, restart. We can see that it is no longer possible to modify it on the grub interface by “e”. If you want to modify it, you must press “ld”;p” to enter the password and modify it.

4, the second is under the "initrd /initrd-2.4.20-8.img" rdquo; Add "ldword;password=123456”" (123456 is your own password). Save, exit, restart. We can see that there is another password before linux is started (over the grub interface). It is worth noting that this password can be prevented from entering in single-user mode. In other words, even if we start single-user mode by editing grub, we still have to enter this password.

How to crack the grub password and get the user right

To get the grub password, we have to find a way to read the grub.conf file. But there is no grub password, no root password. . . So we can't boot through grub.

The method is as follows:

1. First, you need to modify the startup mode of this virtual machine. We need to boot from the CD. The virtual machine defaults to the hard disk as the first boot mode.

When the virtual machine is just started (the big "vmware" interface), press "ld2;" to enter bios.

2. Select the boot column. Select “CD-ROM Drive” one, press “+”“CD-ROM Drive” to the top. In this way, the system will start the default boot mode by default.

3, after the first installation disk image of linux is bound to the CD-ROM drive, save and restart. The system will directly enter the linux installation interface. At the prompt, type “linux rescue” Enter, the system will start the Linux rescue mode.

4, there will be several options on the way, follow the prompts to choose. Finally, I will see a description, presumably that the rescue system has mounted the original system file (the one on the hard disk) to the folder "/mnt/sysimage".

5, after starting, we can look for the grub.conf file. Here we should pay attention to the structure of the folder: we are now in the root directory of the rescue system. And we are looking for the original system “ /etc /grub.conf & rdquo;, so the complete path is: "/mnt /sysimage /etc /grub.conf & rdquo;. Edit this file with vi, we can see and modify the file. This cracks the grub password.

Prevent others from booting into linux rescue mode.

We can see that bios must be modified to boot into rescue mode. Then we can encrypt the bios to prevent others from modifying the bios, so that it cannot be booted from the CD.

The method is as follows:

This is relatively simple. After entering bios, select the “Security” item. Enter on “Set Supervisor Password”. Set the password on it. such. We need a password when we restart the system and enter bios again.

How to crack the bios password

What methods do we often use when clearing the host bios password? Pull the jumper, pick up the battery, and let the bios be restored to factory settings. So, is there a similar approach on virtual machines?

Here's how:

Find the folder where the virtual machine is located. There should be a file with the suffix "“.nvram". Delete this file. Start the system. We can see that. The bios was reset.

Copyright © Windows knowledge All Rights Reserved