<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://dev1galaxy.org/extern.php?action=feed&amp;tid=1547&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / Install Metasploit-Framework From Git on Devuan]]></title>
		<link>http://dev1galaxy.org/viewtopic.php?id=1547</link>
		<description><![CDATA[The most recent posts in Install Metasploit-Framework From Git on Devuan.]]></description>
		<lastBuildDate>Tue, 15 Aug 2017 14:37:38 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Install Metasploit-Framework From Git on Devuan]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=4493#p4493</link>
			<description><![CDATA[<p>I am creating this thread also for me to consult in future in case i need .</p><p><strong>Before Installing</strong><br />You should be a root user .</p><p>If during instalation you get this error : update-rc.d: not found</p><p>You should edit .bashrc on your home folder and add PATH so this file can be located .<br />for this use nano :</p><div class="codebox"><pre><code>nano ~/.bashrc</code></pre></div><p>and write this line at the end of the file</p><div class="quotebox"><blockquote><div><p>export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin</p></div></blockquote></div><p>Note : This could happen on a fresh devuan install<br /><strong>STEP 1</strong><br />Install ruby 2.4.2</p><p>- <strong>Dependencies for Rudy &amp; Metaploit-Framework</strong></p><div class="codebox"><pre><code>sudo apt-get install git-core curl zlib1g-dev build-essential libpq5 libpq-dev libssl-dev libreadline-dev libreadline5 libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libpcap-dev git-core autoconf postgresql pgadmin3 curl zlib1g-dev libyaml-dev curl libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev git </code></pre></div><p>Install Rubyenv</p><p>- </p><div class="codebox"><pre><code>git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo &#039;export PATH=&quot;$HOME/.rbenv/bin:$PATH&quot;&#039; &gt;&gt; ~/.bashrc
echo &#039;eval &quot;$(rbenv init -)&quot;&#039; &gt;&gt; ~/.bashrc

git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo &#039;export PATH=&quot;$HOME/.rbenv/plugins/ruby-build/bin:$PATH&quot;&#039; &gt;&gt; ~/.bashrc
source ~/.bashrc</code></pre></div><p>- Close your terminals and open one terminal again so bashrc can be reloaded with the new config</p><p>UPDATE : Updated ruby version to latest metasploit requirements from 2.4.2 to 2.5.3</p><div class="codebox"><pre><code>rbenv install -v 2.5.3
rbenv global 2.5.3
echo &quot;gem: --no-document&quot; &gt; ~/.gemrc
gem install bundler
gem install rails
rbenv rehash</code></pre></div><p><strong>STEP 2 - Clone metasploit from git and configure it</strong><br />(This example will install metasploit on /opt directory , but you can choose any directory you want)</p><div class="codebox"><pre><code>mkdir /opt
cd /opt
git clone https://github.com/rapid7/metasploit-framework.git
cd metasploit-framework
bundle install
service postgresql start</code></pre></div><p>Configure metasploit Databases on Postgresql , so it could be faster the search inside metasploit framework</p><div class="codebox"><pre><code>cat &lt;&lt;EOF&gt; $HOME/pg-utf8.sql

update pg_database set datallowconn = TRUE where datname = &#039;template0&#039;;

\c template0

update pg_database set datistemplate = FALSE where datname = &#039;template1&#039;;
 
drop database template1;
 
create database template1 with template = template0 encoding = &#039;UTF8&#039;;
 
update pg_database set datistemplate = TRUE where datname = &#039;template1&#039;;
 
\c template1
 
update pg_database set datallowconn = FALSE where datname = &#039;template0&#039;;
 
\q
 
EOF</code></pre></div><div class="codebox"><pre><code>sudo -u postgres psql -f $HOME/pg-utf8.sql
sudo -u postgres createuser msfdev -dRS
sudo -u postgres psql
&quot;ALTER USER msfdev with ENCRYPTED PASSWORD &#039;msf&#039;;&quot;</code></pre></div><p>Press Enter <br />Press CTRL+D</p><p>- Create metasploit databases in Postgresql</p><div class="codebox"><pre><code>sudo -u postgres createdb --owner msfdev msf_dev_db
sudo -u postgres createdb --owner msfdev msf_test_db
./msfconsole</code></pre></div><p>Metasploit will start and will create its directory on your Home folder .<br />write &quot;exit&quot; inside metasploit framework to quit .</p><p>- Set database configuration on metasploit home folder to access its database in postgresql</p><div class="codebox"><pre class="vscroll"><code>cat &lt;&lt;EOF&gt; $HOME/.msf4/database.yml
 
# Development Database
 
  development: pgsql
 
  adapter: postgresql
 
  database: msf_dev_db
 
  username: msfdev
 
  password: msf
 
  host: localhost
 
  port: 5432
 
  pool: 5
 
  timeout: 5

# Production database -- same as dev
 
production: &amp;production
 
  &lt;&lt;: *pgsql

# Test database -- not the same, since it gets dropped all the time

 test:
 
  &lt;&lt;: *pgsql
 
  database: msf_test_db
 
EOF</code></pre></div><p>Press CTRL+D to Exit</p><div class="codebox"><pre><code>service postgresql start
 
sudo -sE su postgres
 
psql
 
update pg_database set datallowconn = TRUE where datname = &#039;template0&#039;;
 
\c template0
 
update pg_database set datistemplate = FALSE where datname = &#039;template1&#039;;
 
drop database template1;
 
create database template1 with template = template0 encoding = &#039;UTF8&#039;;
 
update pg_database set datistemplate = TRUE where datname = &#039;template1&#039;;
 
\c template1
 
update pg_database set datallowconn = FALSE where datname = &#039;template0&#039;;
 
\q</code></pre></div><p>Press CTRL+D to exit</p><p>- Setting up Metasploit database Password on postgresql</p><div class="codebox"><pre><code>sudo -u postgres psql
\password msfdev</code></pre></div><p>Write &quot;msf&quot; and press ENTER key , <br />Then confirm again by writing &quot;msf&quot; and pressing ENTER key again .</p><p>Press CTRL+D to exit .</p><div class="codebox"><pre><code>service postgresql restart</code></pre></div><p><strong>- STEP 3</strong></p><p>Create symlinks to metasploit executables on your sbin folder (so you can run metasploit anywhere)</p><div class="codebox"><pre><code>ln -s /opt/metasploit-framework/msfconsole /usr/local/sbin/msfconsole
ln -s /opt/metasploit-framework/msfupdate /usr/local/sbin/msfupdate
ln -s /opt/metasploit-framework/msfvenom /usr/local/sbin/msfvenom</code></pre></div><p>Everything is installed , now you can run metasploit by writing in your terminal &quot;msfconsole&quot; .<br />You can update your metasploit by writing in terminal &quot;msfupdate&quot;</p>]]></description>
			<author><![CDATA[dummy@example.com (pedropt)]]></author>
			<pubDate>Tue, 15 Aug 2017 14:37:38 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=4493#p4493</guid>
		</item>
	</channel>
</rss>
