PDA

View Full Version : How to Install Metasploit on Kali Linux App on WSL?



Mike9876
2018-06-15, 00:20
Hi, I have Kali Linux App from the App Store on Windows Subsystem for Linux and Windows 10 Host. I also have Kali Linux 2 on VMware but that's not the problem. I'm trying to install Metasploit on the Kali App. I've entered:

sudo su

apt-get -y install build-essential zlib1g zlib1g-dev libxml2 libxml2-dev libxslt-dev locate libreadline6-dev libcurl4-openssl-dev git-core libssl-dev libyaml-dev openssl autoconf libtool ncurses-dev bison curl wget postgresql postgresql-contrib libpq-dev libapr1 libaprutil1 libsvn1 libpcap-dev

apt-get install git-core postgresql curl ruby1.9.3 nmap gem
gem install wirble sqlite3 bundler

cd /opt
git clone https://github.com/rapid7/metasploit-framework.git

cd metasploit-framework
bundle install

./msfconsole

Everything worked fine and Metasploit starts up with no problems. Now I'm trying to setup the database. I enter:

su postgres
createuser msf -P -S -R -D
createdb -O msf msf
exit

I get the error:

createuser: could not connect to database postgres: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

I entered pg_lsclusters and got:

Ver Cluster Port Status Owner Data directory Log file
10 main 5432 down postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log

Does anyone kno what these errors mean so I can creat a user and setup the database? I read a lot online but nothing worked. I'm attaching some screenshots. Please reply. Thanks

3058

3059

bigbiz
2018-06-15, 05:21
Hi, I have Kali Linux App from the App Store on Windows Subsystem for Linux and Windows 10 Host. I also have Kali Linux 2 on VMware but that's not the problem. I'm trying to install Metasploit on the Kali App. I've entered:

sudo su

apt-get -y install build-essential zlib1g zlib1g-dev libxml2 libxml2-dev libxslt-dev locate libreadline6-dev libcurl4-openssl-dev git-core libssl-dev libyaml-dev openssl autoconf libtool ncurses-dev bison curl wget postgresql postgresql-contrib libpq-dev libapr1 libaprutil1 libsvn1 libpcap-dev

apt-get install git-core postgresql curl ruby1.9.3 nmap gem
gem install wirble sqlite3 bundler

cd /opt
git clone https://github.com/rapid7/metasploit-framework.git

cd metasploit-framework
bundle install

./msfconsole

Everything worked fine and Metasploit starts up with no problems. Now I'm trying to setup the database. I enter:

su postgres
createuser msf -P -S -R -D
createdb -O msf msf
exit

I get the error:

createuser: could not connect to database postgres: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

I entered pg_lsclusters and got:

Ver Cluster Port Status Owner Data directory Log file
10 main 5432 down postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log

Does anyone kno what these errors mean so I can creat a user and setup the database? I read a lot online but nothing worked. I'm attaching some screenshots. Please reply. Thanks

3058

3059

Metesploit for windows would be a more logical install.

Mike9876
2018-06-15, 05:40
Hi, thanks for your reply. Yeah I have Metasploit Community on Windows. I just wanted to add it to the Kali App. I guess I could give up. If anyone knows what the above errors are you can reply. Thanks again

Mike9876
2018-06-15, 06:37
I installed MSF framework on windows from their website. Looks good. Thanks for the help.

bigbiz
2018-06-17, 12:11
I installed MSF framework on windows from their website. Looks good. Thanks for the help.

No problem