Bài Thực Hành Metasploit Framework Lesson 9 : Exploiting the Grub Menu to Gain the Root Password


Section 0. Background Information
  1. Metasploitable 
  2. Pre-Requisite Lab
    • Metasploitable  : Lesson 1: Downloading and Configuring

     

  3. Ubuntu 8.04 Physical Exploit.
    • This lab illustrates how easy it is to compromise the root password (1) if you have physical access to the machine, and (2) don’t know the root password.
    • A counter-measure to this exploit, is to set the power-on password.
  4. 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.
  5. Legal Disclaimer – Chỉ dùng cho mục đích học tập

Section 1. Start Up the Metasploitable VM
  1. Start Up VMWare Player
    • Instructions:
      1. Click the Start Button
      2. Type Vmplayer in the search box
      3. Click on Vmplayer
  2. Open a Virtual Machine
    • Instructions:
      1. Click on Open a Virtual Machine
  3. Open the Metasploitable VM
    • Instructions:
      1. Navigate to where the Metasploitable VM is located
      2. Click on on the Metasploitable VM
      3. Click on the Open Button
  4. Edit the Metasploitable VM
    • Instructions:
      1. Select Metasploitable2-Linux VM
      2. Click Edit virtual machine settings
  5. Edit the Metasploitable VM
    • Instructions:
      1. Click on “Network Adapter NAT”
      2. Select the radio button “Bridged: Connected directly to the physical network”
      3. Click on the OK button
    • Warning:
      • By changing from NAT to Bridged opens the VM and network up to potential attacks.
      • To maintain a safe network, you could (1) skip this section and only use the host-only network, (2) unplug your router from the internet, (3) use an ACL to not allow traffic into your network, etc.
  6. Play the Metasploitable VM
    • Instructions:
      1. Click on the Metasploitable VM
      2. Click on Play virtual machine

Section 2. Boot to Grub Menu
  1. VMWare Menu
    • Instructions
      1. Once you see the below vmware screen, (1) Left Click in the screen
  2. Access the Grub Menu
    • Instructions
      1. Press the <Esc> key

Section 3. Edit Grub Menu
  1. Select Recovery Kernel
    • Instructions
      1. Highlight: Ubuntu 8.04, kernel 2.6.24-16-server (recovery mode)
      2. Press “e” to edit
  2. Select the kernel
    • Instructions
      1. Highlight: kernel /vmlinuz-2.6.24-16-server
      2. Press “e” to edit
  3. Edit kernel setting (Part 1)
    • Instructions
      1. Delete everything until you reach the “r” in “ro”.
  4. Edit kernel setting (Part 2)
    • Instructions
      1. Add the string rw init=/bin/bash
      2. Press <Enter>
  5. Boot From Kernel
    • Instructions
      1. Press “b” to boot.

Section 4. Reset Root Password
  1. Admire your work
    • Note(FYI)
      1. You are now root
      2. Continue to next step.
  2. Reset Root Password
    • Instructions
      1. passwd root
      2. Enter new UNIX password:
      3. Retype new UNIX password:

Section 5. Test Root Password
  1. Reboot Machine
    • Instructions
      1. /sbin/reboot -f
  2. Test Root Password
    • Instructions
      1. metasploitable login: root
      2. Password:
Section 6. Proof of Lab
  1. Proof of Lab
    • Instructions:
      1. grep “ROOT LOGIN” /var/log/auth.log | tail -1
      2. ls -l /etc/shadow
      3. date
      4. echo “Your Name”
        • Put in your actual name in place of “Your Name”
        • e.g., echo “John Gray”
    • Proof of Lab Instructions
      1. Press the <Ctrl> and <Alt> key at the same time.
      2. Press the <PrtScn> key.
      3. Paste into a word document
      4. Upload to website Www.AnToanThongTin.Edu.Vn

Comments

  • adidas ultra boost
    Trả lời

    I intended to send you one very little word to be able to thank you once again over the wonderful tricks you have provided on this website. It has been certainly unbelievably generous with people like you giving unhampered exactly what a lot of people would’ve sold for an electronic book in making some cash for their own end, and in particular seeing that you might have done it if you ever considered necessary. Those good tips also acted to become easy way to realize that the rest have similar eagerness really like mine to learn great deal more around this problem. I’m sure there are lots of more pleasurable situations up front for many who looked at your blog.
    adidas ultra boost [url=http://cbi.as/8ifv2]adidas ultra boost[/url]

  • yeezy boost
    Trả lời

    I wanted to post you a very small remark to be able to thank you again over the gorgeous things you’ve contributed in this article. This is particularly generous of people like you to present without restraint exactly what many individuals would have offered for sale for an ebook to make some cash on their own, especially seeing that you could have done it in the event you desired. These secrets in addition served like a fantastic way to fully grasp many people have the same dreams similar to my personal own to find out a good deal more in regard to this issue. Certainly there are several more pleasant periods up front for individuals that view your blog.
    yeezy boost

  • Adidas NMD x Kaws Black White
    Trả lời

    Spot on with this write-up, I truly suppose this website wants far more consideration. I抣l in all probability be once more to read rather more, thanks for that info.

  • links of london outlet store
    Trả lời

    I happen to be writing to let you understand what a fine experience my cousin’s girl found browsing yuor web blog. She came to find several pieces, including what it’s like to possess a wonderful coaching mood to make a number of people without problems comprehend specific grueling topics. You actually did more than readers’ expected results. Thanks for coming up with those warm and friendly, trusted, explanatory and as well as easy thoughts on your topic to Kate.
    links of london outlet store

  • nike x off white
    Trả lời

    I wish to express some appreciation to the writer for rescuing me from this particular instance. Because of surfing around throughout the online world and getting concepts which are not productive, I was thinking my life was over. Existing without the presence of solutions to the issues you’ve sorted out by way of your main posting is a serious case, as well as those which might have negatively damaged my career if I had not discovered your blog. Your good ability and kindness in dealing with all areas was precious. I’m not sure what I would’ve done if I hadn’t encountered such a thing like this. It’s possible to at this time look ahead to my future. Thank you so much for the skilled and effective guide. I won’t be reluctant to recommend your blog post to anybody who will need counselling on this subject.
    nike x off white

  • adidas ultra boost
    Trả lời

    Thanks a lot for giving everyone an extremely nice possiblity to read from this web site. It is often very useful and stuffed with a good time for me and my office co-workers to search your website particularly three times in one week to read through the newest things you will have. And definitely, I am also always happy with the splendid hints you serve. Certain 2 facts in this article are clearly the most efficient we’ve had.
    adidas ultra boost