Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Easy Metasploit Install on Windows Subsystem for Linux
Steps to install Metasploit on Windows 10 using the Windows Subsystem for Linux
1.) Enable Developer Mode
C:\> reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
2.) Enable Windows Subsystem for Linux
C:\> DISM /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux
3.) Reboot
4.) Type "bash" at cmd line to get into Windows Subsystem for Linux and create a new password for your user.
5.) Install Metasploit
test@Desktop:/mnt/c$ curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && chmod 755 msfinstall && ./msfinstall
@Hackingzone

This comment has been minimized.

Copy link

@Hackingzone Hackingzone commented Mar 26, 2018

premission denied after giving sudo command

@bugemarvin

This comment has been minimized.

Copy link

@bugemarvin bugemarvin commented May 16, 2018

this is after installation of bash terminal,you must install curl in your windows subsystems for Linux before installing metasploit;

test@Desktop:/mnt/users/newuser$ apt-get install curl(this is to install curl first)
test@Desktop:/mnt/users/newuser$curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && chmod 755 msfinstall && ./msfinstall(this is for installing metasploit)

@AwaisAfzal1

This comment has been minimized.

Copy link

@AwaisAfzal1 AwaisAfzal1 commented Apr 7, 2019

what about this command
sudo apt-get install metasploit-framework

@aviation002

This comment has been minimized.

Copy link

@aviation002 aviation002 commented Apr 24, 2019

sudo apt-get install metasploit-framework Did the job

@JonnyBanana

This comment has been minimized.

Copy link

@JonnyBanana JonnyBanana commented Nov 19, 2019

to me on one of the many machines it gave me problems with the classic sudo apt-get install metasploit-framework (I don't know why, since on other machines it worked very well, as always), anyway with this script the installation was successful, thanks

@johnmelodyme

This comment has been minimized.

Copy link

@johnmelodyme johnmelodyme commented Mar 26, 2020

I got this :---

[-] * WARNING: No database support: No database YAML file
[-] ***
Traceback (most recent call last):ork console...-
        25: from /opt/metasploit-framework/bin/../embedded/framework/msfconsole:17:in `<main>'
        24: from /opt/metasploit-framework/embedded/framework/lib/metasploit/framework/command/base.rb:82:in `start'
        23: from /opt/metasploit-framework/embedded/framework/lib/metasploit/framework/command/console.rb:48:in `start'
        22: from /opt/metasploit-framework/embedded/framework/lib/metasploit/framework/command/console.rb:62:in `driver'
        21: from /opt/metasploit-framework/embedded/framework/lib/metasploit/framework/command/console.rb:62:in `new'
        20: from /opt/metasploit-framework/embedded/framework/lib/msf/ui/console/driver.rb:161:in `initialize'
        19: from /opt/metasploit-framework/embedded/framework/lib/msf/base/simple/framework/module_paths.rb:49:in `init_module_paths'
        18: from /opt/metasploit-framework/embedded/framework/lib/msf/base/simple/framework/module_paths.rb:49:in `each'
        17: from /opt/metasploit-framework/embedded/framework/lib/msf/base/simple/framework/module_paths.rb:50:in `block in init_module_paths'
        16: from /opt/metasploit-framework/embedded/framework/lib/msf/core/module_manager/module_paths.rb:40:in `add_module_path'
        15: from /opt/metasploit-framework/embedded/framework/lib/msf/core/module_manager/module_paths.rb:40:in `each'
        14: from /opt/metasploit-framework/embedded/framework/lib/msf/core/module_manager/module_paths.rb:41:in `block in add_module_path'
        13: from /opt/metasploit-framework/embedded/framework/lib/msf/core/module_manager/loading.rb:133:in `load_modules'
        12: from /opt/metasploit-framework/embedded/framework/lib/msf/core/module_manager/loading.rb:133:in `each'
        11: from /opt/metasploit-framework/embedded/framework/lib/msf/core/module_manager/loading.rb:135:in `block in load_modules'
        10: from /opt/metasploit-framework/embedded/framework/lib/msf/core/modules/loader/base.rb:256:in `load_modules'
         9: from /opt/metasploit-framework/embedded/framework/lib/msf/core/modules/loader/base.rb:256:in `each'
         8: from /opt/metasploit-framework/embedded/framework/lib/msf/core/modules/loader/base.rb:259:in `block in load_modules'
         7: from /opt/metasploit-framework/embedded/framework/lib/msf/core/payload_set.rb:109:in `recalculate'
         6: from /opt/metasploit-framework/embedded/framework/lib/msf/core/payload_set.rb:109:in `each_pair'
         5: from /opt/metasploit-framework/embedded/framework/lib/msf/core/payload_set.rb:122:in `block in recalculate'
         4: from /opt/metasploit-framework/embedded/framework/lib/msf/core/payload_set.rb:122:in `each_pair'
         3: from /opt/metasploit-framework/embedded/framework/lib/msf/core/payload_set.rb:186:in `block (2 levels) in recalculate'
         2: from /opt/metasploit-framework/embedded/framework/lib/msf/core/payload.rb:212:in `size'
         1: from /opt/metasploit-framework/embedded/framework/lib/msf/core/payload/android.rb:38:in `generate'
/opt/metasploit-framework/embedded/framework/lib/msf/core/payload/android.rb:117:in `generate_jar': android/apk/classes.dex not found (RuntimeError)
@Orlas0ne

This comment has been minimized.

Copy link

@Orlas0ne Orlas0ne commented Jun 23, 2020

I got this error
`orlas0ne@0rlasOne:/mnt/c/Users/Orlando$ sudo apt-get install metasploit-framework
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
metasploit-framework : Depends: oracle-instantclient-basic (>= 19.6.0.0.0) but it is not installable
E: Unable to correct problems, you have held broken packages.`

@risteFront

This comment has been minimized.

Copy link

@risteFront risteFront commented Jun 25, 2020

Try first sudo apt-get update , it works for me :)

@risteFront

This comment has been minimized.

Copy link

@risteFront risteFront commented Jun 25, 2020

I got this error
`orlas0ne@0rlasOne:/mnt/c/Users/Orlando$ sudo apt-get install metasploit-framework
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
metasploit-framework : Depends: oracle-instantclient-basic (>= 19.6.0.0.0) but it is not installable
E: Unable to correct problems, you have held broken packages.`

Try first sudo apt-get update , it works for me :)

@Orlas0ne

This comment has been minimized.

Copy link

@Orlas0ne Orlas0ne commented Jun 26, 2020

i try it but throw me this error

orlas0ne@0rlasOne:/mnt/c/Users/Orlando$ sudo apt-get update
Get:2 http://downloads.metasploit.com/data/releases/metasploit-framework/apt lucid InRelease [3,956 B]
Hit:1 http://kali.download/kali kali-rolling InRelease
Err:2 http://downloads.metasploit.com/data/releases/metasploit-framework/apt lucid InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY CDFB5FA52007B954
Reading package lists... Done
W: GPG error: http://downloads.metasploit.com/data/releases/metasploit-framework/apt lucid InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY CDFB5FA52007B954
E: The repository 'http://downloads.metasploit.com/data/releases/metasploit-framework/apt lucid InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

@Orlas0ne

This comment has been minimized.

Copy link

@Orlas0ne Orlas0ne commented Jun 26, 2020

forget about it, i solved

@Yunagiri

This comment has been minimized.

Copy link

@Yunagiri Yunagiri commented Jun 30, 2020

forget about it, i solved

Please tell how did you fix it so others having the same problem can fix it too ...............

@risteFront

This comment has been minimized.

Copy link

@risteFront risteFront commented Jun 30, 2020

forget about it, i solved

Please tell how did you fix it so others having the same problem can fix it too ...............

You can install manually this frameworks if you are on Windows from official page metasploit-framework in .exe fromat, and add to your dependency

@josh-boat365

This comment has been minimized.

Copy link

@josh-boat365 josh-boat365 commented Jul 5, 2020

upon all the information above, i am still getting errors nothing is working

@siddhartha7055

This comment has been minimized.

Copy link

@siddhartha7055 siddhartha7055 commented Aug 26, 2020

I'm also getting same error?

@galatgovardhan

This comment has been minimized.

Copy link

@galatgovardhan galatgovardhan commented Sep 15, 2020

error

@galatgovardhan

This comment has been minimized.

Copy link

@galatgovardhan galatgovardhan commented Sep 15, 2020

error
need help

@harezzerah

This comment has been minimized.

Copy link

@harezzerah harezzerah commented Sep 21, 2020

try to install wsl ubuntu first, it will runnning msfconsole smooth

@risteFront

This comment has been minimized.

Copy link

@risteFront risteFront commented Sep 22, 2020

error
need help
First need to enable Linux sub system in control panel in windows visit YouTube video for that.

@ijuststarteddontjudge

This comment has been minimized.

Copy link

@ijuststarteddontjudge ijuststarteddontjudge commented Jan 10, 2021

sudo apt-get install metasploit-framework Did the job
it worked but said dkpg file or something wasnt working and now it just cant find the metasploit-frameworks at all

@messenger-1012

This comment has been minimized.

Copy link

@messenger-1012 messenger-1012 commented Jan 21, 2021

what about this command
sudo apt-get install metasploit-framework

thanks

@killshot13

This comment has been minimized.

Copy link

@killshot13 killshot13 commented Feb 27, 2021

If you go root, you can circumvent the sudo glitches.

WARNING: ROOT IS DANGEROUS IF YOU DON'T KNOW HOW POWERFUL IT IS.
(All disclaimers flapping in the breeze, including Your Mileage Might Vary.)

First set a root password with sudo passwd root,
You will be asked to enter sudo's password and then create and confirm a new password for root.

From now on to login as root, you can just su -.

And finally, to address the metasploit install issues, you will realize you no longer need sudo.

Just run this command and watch the magic unfold!

apt-get install metasploit-framework postgresql

😎

@AristodamusAdairs

This comment has been minimized.

Copy link

@AristodamusAdairs AristodamusAdairs commented May 7, 2021

Try first sudo apt-get update , it works for me :)

All of you please consider this before using apt-get install metasploit-framework
This will definitely work?

@AristodamusAdairs

This comment has been minimized.

Copy link

@AristodamusAdairs AristodamusAdairs commented May 7, 2021

Oh yep. It will

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment