Chuyển đến nội dung chính

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

Bài đăng phổ biến từ blog này

Hack the Gibson VM (CTF Challenge)

It’s a boot2root challenge and it does not get over with getting root access. You have to find flag also. So let’s start. First of all download lab from https://download.vulnhub.com/gibson/gibson.ova Now open kali terminal and like always start with first step i.e. netdiscover netdiscover it shows all the hosts those are up in our network and from here we get our target ip. Target IP: 192.168.1.6 As our target is all set we are going to scan it with nmap which will show all the open ports. In this case open ports are only two i.e. 22 and 80. nmap –p- -A 192.168.1.6 As from the above result we have got 80 port open so we will open target ip in browser. It shows an accessible directory. Let’s try opening it as we cannot see anything important here. Oh no such luck with this also. It’s written the result will be found by brute force but there is no place where we can apply brute force. As we do not have any other option so let’s just go to view page source to see if we could get a...

Metasploitable 2 vulnerability assessment

A vulnerability assessment is a crucial part in every penetration test and is the process of identifying and assessing vulnerabilities on a target system. In this part of the tutorial we will be assessing the vulnerabilities available on the network side of the Metasploitable 2 virtual machine. We will be assessing the web applications on the Metasploitable 2 machine in a later tutorial. In the previous Metasploit enumeration and fingerprinting tutorial we’ve learned that the Metasploitable 2 machine contains a lot of vulnerabilities. We have collected valuable information about the target system which we will be using to find known vulnerabilities both on- and offline. Exploitation of these vulnerabilities will be demonstrated in the next exploitation tutorial. In this tutorial we will be looking at a few different ways to perform vulnerability analysis. We will be manually searching for exploits, use scanning tools like Nmap with scripts and we will be...

CEH v9 (CEHVIETNAM.COM) - Hacking Metasploitable Lab

CEH v9 : Hacking Metasploitable VM In this guide, I will demonstrate how to root a Metasploitable 2 virtual machine. Metasploitable is an intentionally vulnerable Ubuntu machine. I’ll explore just a few of the many ways Metasploitable can be attacked, from vulnerabilities in common services to little known exploits and web vulnerabilities. I’ve set up Kali Linux and Metasploitable VMs in VirtualBox on the same network (bridged mode). Kali – 192.168.56.101 Metasploitable – 192.168.56.102 - Hãy thay IP của bạn cho thích hợp Contents   1 Footprinting 1.1 Ping 1.2 Traceroute 2 Scanning 2.1 Port Scanning 2.2 OS Fingerprinting 2.2.1 nmap 2.2.2 xprobe2 3 Enumeration 3.1 FTP (TCP 21) Enumeration 3.2 Telnet (TCP 53) Enumeration 3.3 SMTP (TCP 25) Enumeration 3.4 VNC (TCP 5900) Enumeration 3.5 X11 (TCP 6000) Enumeration 3.6 RLogin (TCP 513) Enumeration 3.7 IRC (TCP 6667) Enumeration 4 Exploitation 4.1 FTP Exploit 4.2 VNC Password Cracking 4.3 IRC E...