ComputerSecurityStudent (CSS) [Login] [Join Now]




|UNIX >> BackTrack >> BackTrack 5 R1 >> Current Page |Views: 65131

(BackTrack: Lesson 2)

{ BackTrack Reset Root Password }


Section 0. Background Information
  1. Overview
    • This labs shows you a quick and easy way reset the root password on a VMware BackTrack5R1 instance using a live CD.
    • It's embarrassing enough to forget, lose, or simply not know the root password to your machine.  It's even more embarrassing to forget, lose, or mistake the root password to your penetration testing machine. :)

  2. Prerequisite
  3. Lab Notes
    • In this lab we will do the following:
      1. Use a BackTrack Live CD/iso to mount up disk partition that contains /etc/shadow
      2. We will clear out the root password
      3. We will reset 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.
    • © 2012 No content replication of any kind is allowed without express written permission.

  5. YouTube Video
Section 1: Startup the BackTrack Virtual Machine
 
  1. Start Up BackTrack.
    • Instructions:
      1. Start Up your VMware Player
      2. Play virtual machine

     

  2. Use the WRONG password to Login to BackTrack
    • Instructions:
      1. Login: root
      2. Password: Type in the wrong password on purpose!!!

 

Section 2: Edit Virtual Machine Settings
  1. Make sure your CD/DVD Drive is connected.
    • Instructions:
      1. Virtual Machine --> Removable Devices --> Connect

     

  2. Make sure your CD/DVD Drive is connected.
    • Instructions:
      1. Virtual Machine --> Virtual Machine Settings...

     

  3. Set Machine to Boot From CD/DVD
    • Instructions:
      1. Select CD/DVD (IDE)
      2. Device status: Click the Checkbox "Connect at power on"
      3. Select the "Use ISO image file" radio button.
      4. Browse to the location of your BT5R1-GNOME.iso or other Live CD.
      5. Select OK.

     

  4. Reset BackTrack
    • Instructions:
      1. Virtual Machine --> Power --> Reset

     

  5. Booting from the ISO (Step 1)
    • Instructions:
      1. At the same time, Click the right mouse key and the press the ESC button, when the screen starts to change to the VMware screen below.
    • Note(FYI):
      • This might take you a few times so be patient!!!

     

  6. Booting from the ISO (Step 2)
    • Instructions:
      1. Arrow Down to "CD-ROM Drive"
      2. Press Enter

     

  7. Boot
    • Instructions:
      1. Press Enter

     

  8. Boot BackTrack Live CD
    • Instructions:
      1. Select "BackTrack Text - Default Boot Text Mode"
      2. Press Enter

     

  9. BackTrack5 Command Line
    • Note:
      • This is the screen you will see to begin the reset process.

 

Section 3: Mounting the Boot Disk
  1. Discover the Boot Disk
    • Instruction:
      1. fdisk -l
    • Note(FYI):
      • This server was built with all the directories under the same partition.
      • Typically, productions servers will have a partition per file system.  In our case, this server was built with all the directory and filesystems under one partition.
      • In the next step, we will mount up the /dev/sda1 partition.

     

  2. Mount the Boot Partition
    • Instruction:
      1. mount /dev/sda1 /mnt
      2. df -k
    • Note(FYI):
      • Since, all filesystems and directories are located under /dev/sda1 we will be able to access any file.

     

  3. Navigate to the etc directory
    • Instruction:
      1. cd /mnt/etc
      2. ls -l | grep shadow
      3. md5sum /mnt/etc/shadow > /mnt/var/tmp/before.txt
        • This is part of the proof of lab.
    • Note(FYI):
      • By mounting /dev/sda1 to the /mnt directory, we now have access to the shadow file.

     

  4. Edit the shadow file
    • Instruction:
      1. vi shadow

     

  5. Edit the shadow file
    • Instruction:
      1. Right arrow over to the immediate next right position of the first colon.
      2. Press the "x" to delete all the characters, until you get to the second colon.  Note, do not delete the colons.

     

  6. Saving the shadow file
    • Instruction:
      1. Press the "Esc" key
      2. Press <Shift> and the ":" key.
      3. Type wq!
      4. Press enter
    • Note(FYI):
      • Congratulations, You effectively cleared out the root password.

     

  7. Post Lab Verification
    • Instruction:
      1. md5sum /mnt/etc/shadow > /mnt/var/tmp/after.txt
      2. ls -l /mnt/var/tmp/*.txt
      3. cat /mnt/var/tmp/*.txt
    • Note(FYI):
      • The above command are not required to reset/clear the root password.
      • This is only part of our pre-proof of lab instructions.

 

Section 4: Reboot BackTrack
  1. Reboot the server
    • Instruction:
      1. shutdown -r now
      2. Press <Enter> when you see the line that says "Please remove the disc and close ..."

     

  2. Login as root
    • Instruction:
      1. Type "root" at the bt login: prompt.
    • Note:
      • After you press enter, you will not be prompted for the root password.

     

  3. Change Root Password
    • Instruction:
      1. passwd root
        • Set the root password to our standard classroom password.

 

Section 5: Proof of Lab
  1. Proof of Lab
    • Instruction:
      1. ls -l /var/tmp/*.txt
      2. md5sum /etc/passwd
      3. md5sum /var/tmp/*.txt
      4. date
      5. echo "Your Name"
        • Replace "Your Name" with your actual name.
        • e.g., echo "John Gray"
    • Proof of Lab Instructions
      1. Press both the <Ctrl> and <Alt> keys at the same time.
      2. Do a <PrtScn>
      3. Paste into a word document
      4. Upload to Moodle

 

Section 6: Post Lab Clean Up
  1. Change Back the Virtual Machine Settings
    • Instruction:
      1. Virtual Machine --> Virtual Machine Settings...

     

  2. Change CD/DVD Settings
    • Instruction:
      1. Select CD/DVD (IDE)
      2. Select radio button "Use physical drive:" and make sure "Auto detect" is selected.


Help ComputerSecurityStudent
pay for continued research,
resources & bandwidth