Hack Linux system Password

Source: Internet
Author: User

Personal Practice:

Rebooting the system
2. In countdown time, tap any key
3. Press the letter E to edit
4. Select the line beginning with kernel, edit the letter E again, then tap the space to enter the number 1, then hit enter. Enter single-user mode to crack the password. This mode bypasses password authentication
5. Press the letter key B to boot into the system
6. Direct passwd Change the root user's password
7. Enter init 5 or init 3 to enter the system, or reboot reboot the system

Remaining System Reference files:
When the System Selection screen appears, press the "E" key on the Red Hat Linux option.

Then there will be three options, press "E" key on "kernel/boot/vmlinuz-2.4.18-14 ro root=label=/" to edit,

Add "single" to "Ro" or "root" and return by return.

Press "B" key to start, enter the character interface, when "sh-2.05b#" appears, it means that the single-user mode has been entered.

Now, enter "passwd root" to reset the root password.

After the setup is complete, reboot restarts, and the password you just set can be used to enter the Linux system.

One. Lilo

1. When the Lilo appears: Type Linux single when prompted

Screen Display Lilo:linux single

2. Enter to enter the Linux command line directly

3. #vi/etc/shadow

Delete the first line, that is, Root: The previous and Next:

The first row will resemble

Root:: .....

Save

4. #reboot重启, the root password is empty

Two. Grub

1. When the Grub screen appears, use the up and down keys to select the one you normally start Linux (do not select Dos yo), and then press the E key

2. Use the up and down keys again to select the one you normally start Linux (similar to kernel/boot/vmlinuz-2.4.18-14 ro root=label=/), then press the E key

3. Modify the command line you see now, add single, the result is as follows:

Kernel/boot/vmlinuz-2.4.18-14 single RO root=label=/

4. Enter return, then press B to start, you can go directly to the Linux command line

5. #vi/etc/shadow

Delete the first line, that is, Root: The previous and Next:

The first row will resemble

Root:: .....

Save

6. #reboot重启, the root password is empty

=========================
For Redhat Linux:

Use the up and down keys to place the cursor on the Linux system and press "E"

In the kernel line, press "E", enter "Space single", and then enter

Press "B", start, the system will automatically enter the single user mode,

Use the passwd root command to enter a new password as prompted

After changing the password, enter the reboot command to restart the system.



Three, 1, restart the system. When the system boots to grub or lilo (now generally grub) boot menu, find the System current boot item (you can expand the hidden menu by arrow key);
2. Position the cursor on this option by pressing the letter "E" key to enter the editing state of the boot;

3, this option has three lines of statements, please use the cursor to select the second line, that is, "Kernel" the beginning of the line;

4, in this line and then press the letter "E" key to enter the editing state of this line;

5, add a space at the end of the line, write the number 1, similar to this:

kernel/boot/vmlinuz-2.6.9-11.19 ro root=label=/1

6, after the modification, press the "enter" key back to the original interface;

7. Press the letter "B" key to start booting.

Four, 1). Grub
1. When the Grub screen appears, use the up and down keys to select the one you normally start Linux (do not select Dos yo), and then press the E key
2. Use the up and down keys again to select the one you normally start Linux (similar to kernel/boot/vmlinuz-2.4.18-14 ro root=label=/), then press the E key
3. Modify the command line you see now, add single, the result is as follows:
Kernel/boot/vmlinuz-2.4.18-14 single RO root=label=/
4. Enter return, then press B to start, you can go directly to the Linux command line
5. #vi/etc/shadow
Delete the first line, that is, Root: The previous and Next:
The first row will resemble
Root:: .....
Save
6. #reboot重启, the root password is empty

2). In the system into a single user state, directly with passwd root to change
Use the installation CD to boot the system, the Linux rescue State, the original/partition hook up, as follows:
Cd/mnt
mkdir HD
Mount-t Auto/dev/hdax (partition number where the original/partition is located) HD
CD HD
Chroot./
passwd Root
That'll do it.

But this method also illustrates the Linux single-user mode security vulnerability, if someone deliberately modify the root password, it is dangerous. Therefore, we also want to prohibit single-user login

In single-user mode, you can solve the problem of the root password forgetting of the Linux Superuser, which may be used by an ulterior friend to crack the root user's password and modify it so that it is not safe. Oh, then we have to prohibit single-user login, see the following methods:

If you are using a single user securely, you first need to configure the password for grub, just modify/boot/grub/grub.conf or/etc/grub.conf (/etc/grub.conf is a symbolic link to/boot/grub/grub.conf).


For example: vi/boot/grub/grub.conf into profile editing. In the next line of Splashimage This parameter can be added password= password, save and restart the computer, once again log on to the Grub menu page, you will find that Now you can not directly use the e command to edit the start tag, you must first use the P command, enter the correct password before you can edit the boot tag, but we set the plaintext password is not very safe.



(a) Linux system password cracking

1. Press E to enter edit mode on the GRUB Options menu
2. Edit Kernel line/init 1 (or/single)
3. Press B to restart
4. After entering, execute the following command
[Email protected] #passwd root (set root password)
Enter new UNIX password: Enter the password
[Email protected] #init 6

(ii) Debian Linux system password cracking

1. In the Grub Options menu ' Debian gnu/linux,... (recovery mode) ', press E to enter edit mode
2. Edit kernel the last RO single to RW single init=/bin/bash, press B to perform the restart
3. After entering, execute the following command
[Email protected] (none) #mount-A
[Email protected] (none) #passwd root
[Email protected] (none) #reboot

(iii) FREEBSD system password cracking

1. Booting into the boot menu
2. Select each item (press 4) to enter single user mode
3. Enter a list of commands after entering
[Email protected] #mount-A
[Email protected] #fsck-y
[Email protected] #passwd (change password command)
[Email protected] #root (username to crack the password)
Enter New UNIX Password:
[Email protected] #init 6 (restart)

(iv) Solaris system password cracking

1. Select the Solaris FAILASFE entry in the Grub Options menu
2. Is the system prompt does wish to has it mounted read-write on/a? [Y,n,?] Select Y
3. Enter single-user mode
4. Enter the following command
#passwd
#New passwd: Enter a new password
#Re-enter New passwd: Enter the password in the second
#init 6 (restart)

(v) NETBSD system password hack

1. Power on: When the prompt sign appears and start the countdown for five seconds, type the following command:
> boot-s (enter single-user mode command)
2. In the following hint symbol
Enter pathname of shell or RETURN for SH:
Press Enter.
3. Type the following command:
# mount-a
# fsck-y
4. Use passwd to change the root password.
5. Use the Exit command to enter multi-person mode.

Password cracking Encyclopedia of Linux operating system
(a) Linux system password cracking
1. Press E to enter edit mode on the GRUB Options menu
2. Edit Kernel line/init 1 (or/single)
3. Press B to restart
4. After entering, execute the following command
[Email protected] #passwd root (set root password)
Enter new UNIX password: Enter the password
[Email protected] #init 6
(ii) Debian Linux system password cracking
1. In the Grub Options menu ' Debian gnu/linux,... (recovery mode) ', press E to enter edit mode
2. Edit kernel the last RO single to RW single init=/bin/bash, press B to perform the restart
3. After entering, execute the following command
[Email protected] (none) #mount-A
[Email protected] (none) #passwd root
[Email protected] (none) #reboot
(iii) FREEBSD system password cracking
1. Booting into the boot menu
2. Select each item (press 4) to enter single user mode
3. Enter a list of commands after entering
[Email protected] #mount-A
[Email protected] #fsck-y
[Email protected] #passwd (change password command)
[Email protected] #root (username to crack the password)
Enter New UNIX Password:
[Email protected] #init 6 (restart)
(iv) Solaris system password cracking
1. Select the Solaris FAILASFE entry in the Grub Options menu
2. Is the system prompt does wish to has it mounted read-write on/a? [Y,n,?] Select Y
3. Enter single-user mode
4. Enter the following command
#passwd
#New passwd: Enter a new password
#Re-enter New passwd: Enter the password in the second
#init 6 (restart)
(v) NETBSD system password hack
1. Power on: When the prompt sign appears and start the countdown for five seconds, type the following command:
> boot-s (enter single-user mode command)
2. In the following hint symbol
Enter pathname of shell or RETURN for SH:
Press Enter.
3. Type the following command:
# mount-a
# fsck-y
4. Use passwd to change the root password.
5. Use the Exit command to enter multi-person mode.

After the last step, type "exit" to enter, the computer will automatically reboot, here to crack the root user's password.


If someone else gets the plaintext password, they can still modify the Grub boot tag to modify the root password.


So you'll use MD5 to encrypt it. Enter the Grub-md5-crypt carriage return in the terminal, then the system will ask to enter the same password two times, then the system will output the MD5 code. Everyone just need to copy the generated MD5 ciphertext, and then in accordance with password--MD5 MD5 ciphertext This format set global or menu password, save exit, restart the computer.

In this way, you can start the Linux single-user mode, a bit like the security mode of Windows, just start the most basic system, network services, system services, etc. do not start. Once the single-user mode is booted, there will be a # prompt indicating that you have superuser privileges, and then execute the command after #:

/usr/bin/passwd

System should be prompted to enter a password, this password is not echoed, to ensure that the input is correct, enter the system will be asked to enter again, input requirements consistent, and then you will see the password to modify the prompt for success. Retype the command init 3 type the system's character interface mode (the system will re-change the runlevel), see login: Prompt, and try again if you can log in with root and the password you just modified.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.