ComputerSecurityStudent (CSS) [Login] [Join Now]




|UNIX >> Kali >> Kali 1.0 >> Current Page |Views: 94306

(Kali: Lesson 2)

{ Use Kali Grub to boot into single user mode }


Section 0. Background Information
  1. Background information.
    • Lets say you lost the root password and you have no way to figure it out.  No problem.  All you simply have to do is to physically power off the Kali machine and power it back on.  During the start of the reboot, HOLD DOWN on the "shift" key.  If you are using VMware, you will need to Left click in the Black VMware window before reboot and then HOLD DOWN on the "shift" key.

  2. Prerequisite
  3. Lab Notes
    • In this lab we will do the following:
      1. We will access the Grub menu during the boot process.
      2. We will edit the Grub menu to boot into single user mode.
      3. We will change the root password.

  4. Legal Disclaimer
    • As a condition of your use of this Web site, you warrant to computersecuritystudent.com that you will not use this Web site for any purpose that is unlawful or that is prohibited by these terms, conditions, and notices.
    • In accordance with UCC § 2-316, this product is provided with "no warranties, either express or implied." The information contained is provided "as-is", with "no guarantee of merchantability."
    • In addition, this is a teaching website that does not condone malicious behavior of any kind.
    • Your are on notice, that continuing and/or using this lab outside your "own" test environment is considered malicious and is against the law.
    • © 2013 No content replication of any kind is allowed without express written permission.

Section 1: Start Kali
  1. Start VMware Player
    • Instructions
      1. For Windows 7
        • Start --> All Programs --> VMware Player
      2. For Windows XP
        • Starts --> Programs --> VMware Player

     

  2. Start the Kali VM
    • Instructions:
      1. Click on the Kali VM
      2. Click on Play virtual machine
     
Section 2: Boot to Grub 2 Menu
  1. Boot to Grub 2 Menu
    • Instructions
      1. Once you see the below vmware screen, (1) Left Click in the screen and (2) HOLD DOWN on the <Shift> key.
    • Note(FYI):
      1. Please be patient, this might take you a few attempts.

     

  2. The GNU Grub Menu
    • Note(FYI)
      1. Below is the GNU Grub menu.
      2. Continue to Next Section.

     

Section 3: Use Grub to Boot into Single User Mode
  1. Edit the Grub Menu
    • Instructions
      1. Make sure Debian GNU/Linux, with Linux 3.7-trunk-686-pae is highlighted.
      2. Press "e".

     

  2. Cursor Placement
    • Instructions
      1. Cursor down to the line that starts with "linux /boot/vmlinuz-3.7-trunk...".
      2. Cursor right until the cursor is positioned at the end of the line.  In my case, my cursor is directly after the string quiet.
      3. Continue to next step.

     

  3. Delete Some Characters
    • Instructions
      1. Use the backspace key to delete the following characters:
        • "o initrd=/install/gtk/initrd.gz quiet"
      2. Continue to next step.

     

  4. Add the string "w init=/bin/bash"
    • Instructions
      1. Type the follow string after the "r".
        • w init=/bin/bash
      2. Press <Ctrl> and "x" to boot to single mode.

     

  5. Welcome to root (Got Root?)
    • Instruction:
      1. id
    • Note(FYI):
      1. You are the root user.  Congrats!!!
      2. Continue to next section.

     

Section 4: Reset the root password
  1. Reset root's password
    • Instructions
      1. passwd root
      2. Enter new UNIX password:
      3. Retype new UNIX password:

     

  2. mkfifo and Reboot
    • Instructions
      1. mkfifo /run/initctl
      2. reboot -f
    • Note(FYI):
      1. We have to create /run/initctl FIFO, because this is a bug.  Apparently, /run/initctl was moved from /dev/initctl, and somebody forget to install the systemd package.

     

  3. The GNU Grub Menu
    • Note(FYI)
      1. Wait for 3 seconds and the Kernel will automatically load.
      2. Continue to Next Section.

     

  4. Supply Username
    • Instructions:
      1. Click Other
      2. Username: root
      3. Click the Login Button

     

  5. Supply Password
    • Instructions:
      1. Password: Provide the root password
      2. Click the Login Button

     

  6. Open a console terminal
    • Instructions:
      1. Click on the console terminal

 

Section 5: Proof of Lab
 
  1. Proof of Lab
    • Instructions:
      1. last | grep boot | head -1
        • Where "1" is a one.
      2. chage -l root
        • Where "l" is a lowercase "L".
      3. date
      4. echo "Your Name"
        • Replace the string "Your Name" with your actual name.
        • e.g., echo "John Gray"
    • Proof of Lab Instructions
      1. Do a <PrtScn>
      2. Paste into a word document
      3. Upload to Moodle

     



Help ComputerSecurityStudent
pay for continued research,
resources & bandwidth