Posted on

Complete Metasploit System Hacking Tutorial

Hello everyone and welcome to this Metasploit system hacking tutorial! Let’s start with familiarizing ourselves with the Metasploit framework. The Metasploit framework is a penetration testing tool and it comes pre-installed in Kali Linux. It is mostly used for the exploitation of systems. You can also use it for scanning. In Metasploit you will utilize modules, payloads, nops and many other pre-made programs. Before we begin using them, let’s define and make them understandable. After that we will execute our first exploit. For a limited time, you can enroll in the complete course on Udemy for only $9.99!

As I said, the Metasploit framework is a tool for developing and executing code against a remote, target machine. In Metasploit you have access to the MSF payload creator which makes this process relatively simple. You can access Metasploit with the following Linux command:


There is also a program called Armitage which enables you to interface with the Metasploit framework using a GUI.

The two most important terms we will be using throughout this section are exploit and payload. An exploit is a vulnerability in a computer system. For example, if we detect that a target is running a vulnerable piece of software, we can take advantage of it and exploit it. A zero day exploit is a vulnerable system that hasn’t been previously discovered. That is why it’s referred to as a zero day, it hasn’t been fixed yet. There are different types of zero day attacks. Some can be far more dangerous than others.

One of the most infamous zero day vulnerabilities was EternalBlue. EternalBlue was discovered in 2017 and allowed anyone to access a Windows 7 machine, without the user executing anything. So you could connect to the same network and exploit the Windows 7 machine if it was running a 445 open port. We will target the EternalBlue vulnerability later on in this tutorial. Now it is highly unlikely that we will discover any zero day vulnerabilities. We will be exploiting targets with already known exploits with our reverse shells.

That brings us to payloads, which is what reverse shell is. Once we exploit the vulnerable software we will deliver a payload. A payload is a piece of software that enables you to connect to a target machine and then perform some action or extract information. Now we will cover the different payloads in great detail in the upcoming tutorials, but for now, let us start up the Metasploit framework and take a look at the environment.

Now before we use the msfconsole command to start Metasploit, let’s execute the following command in our Linux terminal:

service postgresql start

This will make Metasploit run faster since it is using the database. Now you do not need to do this if you don’t want to, but it will help Metasploit run faster.

Let’s open up Metasploit framework. In order to do that you just need to execute the following Linux command:


Since this is a virtual machine, this might take a few seconds to open depending on your PC speed. The first thing you will notice is this banner right here. Take notice of all of the tools available to us in Metasploit. Currently at this time, March 2019, we have 1854 available exploits, 1049 auxiliary modules, 325 post-exploitation modules, 546 payloads, 44 encoders, 10 nops, 2 evasion. We will cover what all of these are in the next lecture, but for now let us cover how we can navigate through this framework.

So the first logical thing that we should do is type “help”. The help command will give us the available commands that we can run. We will be using the “use” command quite a bit throughout this tutorial. In Metasploit, you typically type “use” followed by the exploit that you want to use. Since we are beginners and do not know the names of the modules or exploits, we can also use the search command in order to find out them.

If you just type here “search”, and let’s say we want to find Windows exploits. So type the following in your Linux terminal:

search windows

This command will give us all of the available Windows exploits available in the Metasploit. As I said previously, there’s over 1800 exploits in the Metasploit framework. We will cover only a few of them. If we were to cover all of the available exploits this course would be hundreds of hours long.

We will not be running any exploits, for now, since we don’t have a vulnerable target. I just wanted to show you some of the commands that you will use in order to select your exploits. We will begin exploiting targets in the next lectures right after we cover the basic structure of the Metasploit framework itself. I will explain what nops, encoders, payloads, exploits, post exploitation tools are in the next video.

Before we finish, you might have noticed that I can type “ifconfig” in the terminal once we have entered a Metasploit session. You can run system commands from this command tool. You can run all of the commands that you can run from a simple terminal in the Metasploit framework command line. So you can also run nmap or netstat, and you can also run any other system command through this tool as well.

So that would be about it for this tutorial. Now you might have further questions about Metaploit, don’t worry, we will cover this framework in great detail moving forward. I just wanted to show you the simple environment of the Metasploit framework itself, and some of the more important commands that we will be using. I will explain the modules that we have in the Metasploit framework in the following lecture. Bye!

You can get The Complete Ethical Hacking Course Bundle to get access to this and 7 other courses! Our Forever Course Bundle gets you every course I produce, for life!