<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fedora &#8211; Phocean.net</title>
	<atom:link href="/tag/fedora/feed" rel="self" type="application/rss+xml" />
	<link>/</link>
	<description>Computer Security Blog</description>
	<lastBuildDate>Fri, 24 Feb 2017 21:17:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.9.10</generator>
	<item>
		<title>Installation of Metasploit on Fedora 21 / 22</title>
		<link>/2015/02/10/installation-of-metasploit-on-fedora-21.html</link>
		<comments>/2015/02/10/installation-of-metasploit-on-fedora-21.html#comments</comments>
		<pubDate>Tue, 10 Feb 2015 19:38:05 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Pentesting]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Metasploit]]></category>

		<guid isPermaLink="false">http://phocean.net/?p=2021</guid>
		<guid isPermaLink="false">http://phocean.net/?p=2021</guid>
		<description><![CDATA[Update 2015/08/04: Works on Fedora 22 too. I recently applied the exact same procedure with success. A quick update from a previous post for setting Metasploit on Fedora 21, the latest version. It is mainly a copy and paste, except for a few typo fixes and some changes on the Ruby part. The good news is that...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2015/02/10/installation-of-metasploit-on-fedora-21.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p><em><span style="color: #ff0000;"><span style="text-decoration: underline;">Update 2015/08/04</span>: Works on Fedora 22 too. I recently applied the exact same procedure with success.</span></em></p>
<p>A quick update from a previous <a href="/2014/02/23/metasploit-on-fedora-20.html">post</a> for setting Metasploit on Fedora 21, the latest version.</p>
<p>It is mainly a copy and paste, except for a few typo fixes and some changes on the Ruby part. The good news is that Metasploit was recently ported to Ruby 2.x, so we don&#8217;t need anymore the <em>rvm</em> stuff anymore, which makes the process much simpler.</p>
<h1>Preparing Postgresql</h1>
<p>Install:</p>
<pre> yum -y install postgresql-server postgresql-devel</pre>
<p>Initiate a new &#8220;cluster&#8221; and connect to the sql client through the <code>postgres</code> user:</p>
<pre># as root:
postgresql-setup initdb
systemctl start postgresql.service
su postgres
psql</pre>
<p>Inside the psql console, create the new Metasploit user and its database:</p>
<pre>create user msf;
alter user msf with encrypted password 'super password';
create database msfdb;
grant all privileges on database msfdb to msf;
\q</pre>
<p>Then, we will tell to Postgres how to accept local connections. ident necessitates an system account, trust means no password for any local account and md5 stands for a classic password authentication, which we will prefer.<br />
Back to a root terminal, add this line inside <code>/var/lib/pgsql/data/pg_hba.conf</code> and beware that the order is important:</p>
<pre># IPv4 local connections:
<span style="color: #ff0000;">host msfdb msf 127.0.0.1/32 md5</span>
host all all 127.0.0.1/32 ident</pre>
<p>Then we can restart the service and check with psql that the credentials are working:</p>
<pre>systemctl restart postgresql.service
psql -U msf msfdb -h localhost
\q</pre>
<h1>Setting Ruby</h1>
<p>Metasploit runs well with Ruby 1.9.3, so we will install this version and switch to it using <code>rbenv</code>.<br />
<code>rbenv</code> does a nice job at managing several version of ruby next to each other, installing dependancies (as OpenSSL) and setting <code>PATH</code>:</p>
<pre># as root:
yum install ruby rubygems ruby-devel rubygem-bundler</pre>
<h1>Getting and running Metasploit</h1>
<p>Install:</p>
<pre># as root in e.g. /opt
git clone https://github.com/rapid7/metasploit-framework.git msf
cd msf
yum -y install libpcap-devel sqlite-devel
./msfupdate</pre>
<p>The installation of ruby modules will take a while. Then, configure the database by creating <code>config/database.yml</code>:</p>
<pre>production:
    adapter: postgresql
    database: msfdb
    username: msf
    password: 
    host: 127.0.0.1
    port: 5432
    pool: 75
    timeout: 5</pre>
<p>Launch it and have fun :</p>
<pre># as root
./msfconsole
# check connection to the database
db_status</pre>
<p>You may want to add a <code>cron</code> entry in <code>/etc/crontab</code> to get regular updates (though it may break from time to time due to broken dependencies, so you are advised to check it sometimes):</p>
<pre># msfupdate every 2 hours
0 */2 * * * root /opt/msf/msfupdate 2&gt;&amp;1</pre>
]]></content:encoded>
			<wfw:commentRss>/2015/02/10/installation-of-metasploit-on-fedora-21.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>The joy of dependencies: Metasploit on Fedora 20</title>
		<link>/2014/02/23/metasploit-on-fedora-20.html</link>
		<comments>/2014/02/23/metasploit-on-fedora-20.html#comments</comments>
		<pubDate>Sun, 23 Feb 2014 21:56:25 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Pentesting]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Metasploit]]></category>
		<category><![CDATA[rbenv]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=1934</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=1934</guid>
		<description><![CDATA[UPDATE 02/2015 : see there for the procedure on Fedora 21 As I started to use Fedora 20 at work &#8211; by the way, a solid distro with all security features enabled, I had the bad surprise to get similar issues to those on OS X. Again, we will have to face the joy of dependencies! Fedora...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2014/02/23/metasploit-on-fedora-20.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p><em><span style="color: #ff0000;">UPDATE 02/2015 : see <a href="/2015/02/10/installation-of-metasploit-on-fedora-21.html">there</a> for the procedure on Fedora 21</span></em></p>
<p>As I started to use Fedora 20 at work &#8211; by the way, a solid distro with all <a href="http://https://fedoraproject.org/wiki/Security_Features?rd=Security/Features">security features enabled</a>, I had the bad surprise to get similar issues to <a href="/2013/05/05/installing-metasploit-on-os-x-mountain-lion.html">those on OS X</a>.<br />
Again, we will have to face the joy of dependencies! Fedora provides Ruby 2.0 by default, so firing <code>msfconsole</code> would fail with many openssl warnings, ending with:</p>
<p><span id="more-1934"></span></p>
<pre>/usr/share/ruby/openssl/cipher.rb:61:in `': superclass mismatch for class Cipher (TypeError)
from /usr/share/ruby/openssl/cipher.rb:22:in `'
from /usr/share/ruby/openssl/cipher.rb:21:in `'
from /usr/share/ruby/openssl.rb:20:in `require'
from /usr/share/ruby/openssl.rb:20:in `'
from /opt/pentest/exploit/msf/lib/msf/ui/console/driver.rb:144:in `require'
from /opt/pentest/exploit/msf/lib/msf/ui/console/driver.rb:144:in `initialize'
from ./msfconsole:148:in `new'
from ./msfconsole:148:in `'</pre>
<p>While the installation steps are globally the same than on Mac, there are some specific issues with rbenv and Postgresql.</p>
<h1>Preparing Postgresql</h1>
<p>Install:</p>
<pre> yum -y install postgresql-server postgresql-devel</pre>
<p>Initiate a new &#8220;cluster&#8221; and connect to the sql client through the <code>postgres</code> user:</p>
<pre># as root:
postgresql-setup initdb
systemctl restart postgresql.service
su postgres psql</pre>
<p>Inside the psql console, create the new Metasploit user and its database:</p>
<pre>create user msf;
alter user msf with encrypted password 'super password';
create database msfdb;
grant all privileges on database msfdb to msf;
\q</pre>
<p>Then, we will tell to Postgres how to accept local connections. ident necessitates an system account, trust means no password for any local account and md5 stands for a classic password authentication, which we will prefer.<br />
Add this line inside <code>/var/lib/pgsql/data/pg_hba.conf</code> and beware that the order is important:</p>
<pre># IPv4 local connections:
<span style="color: #ff0000;">host msfdb msf 127.0.0.1/32 md5</span>
host all all 127.0.0.1/32 ident</pre>
<p>Then we can restart the service and check with psql that the credentials are working:</p>
<pre>systemctl restart postgresql.service
psql -U msf msfdb -h localhost
\q</pre>
<h1>Setting Ruby</h1>
<p>Metasploit runs well with Ruby 1.9.3, so we will install this version and switch to it using <code>rbenv</code>.<br />
<code>rbenv</code> does a nice job at managing several version of ruby next to each other, installing dependancies (as OpenSSL) and setting <code>PATH</code>:</p>
<pre># as root:
# download and install rbenv
\curl -sSL https://get.rvm.io | bash
rvm install ruby-1.9.3 --autolibs=packages
rvm use ruby-1.9.3
# checking, should obviously return ruby 1.9.3
ruby --version</pre>
<h1>Getting and running Metasploit</h1>
<p>Install:</p>
<pre># as root in e.g. /opt
git clone https://github.com/rapid7/metasploit-framework.git msf
cd msf
yum -y install rubygem-bundler libpcap-devel
bundle install</pre>
<p>Configure the database creating <code>config/database.yml</code>:</p>
<pre>production:
    adapter: postgresql
    database: msfdb
    username: msf
    password: 
    host: 127.0.0.1
    port: 5432
    pool: 75
    timeout: 5</pre>
<p>Launch it and have fun :</p>
<pre><del>ln -s /opt/msf/msf* /usr/local/bin
sudo <span style="color: #ff0000;">-i</span> msfconsole</del>
# as root
./msfconsole
# check connection to the database
db_status</pre>
<p><del>Note that the <code>-i</code> option of <code>sudo</code> is mandatory, as it resets the environment for security purposes. That way it will get the environment of the target user, <code>root</code>, which should be just fine if you set <code>rbenv</code> with that user.</del></p>
<p><em><strong><span style="text-decoration: underline;">UPDATE 02/27/2014</span></strong>: I had some issues starting Metasploit with sudo and I actually failed to find a satisfying solution. I am now just launching it as root and in its work directory.</em></p>
<p>It is recommended to add a <code>cron</code> entry in <code>/etc/crontab</code> for regular updates:</p>
<pre># msfupdate every 2 hours
0 */2 * * * root /opt/msf/msfupdate 2&gt;&amp;1</pre>
]]></content:encoded>
			<wfw:commentRss>/2014/02/23/metasploit-on-fedora-20.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>openSUSE 11.1 and /boot on RAID 1</title>
		<link>/2009/10/21/opensuse-11-1-and-boot-on-raid-1.html</link>
		<comments>/2009/10/21/opensuse-11-1-and-boot-on-raid-1.html#comments</comments>
		<pubDate>Wed, 21 Oct 2009 18:06:27 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Grub]]></category>
		<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[RAID]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=489</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=489</guid>
		<description><![CDATA[I tried yesterday to set up a home server with two disks in a RAID 1 array. My intention was to have everything on the RAID volume, including /boot, so that if a disk crash, I still can boot on the second one. That&#8217;s the way I think it should work anyway, despite the number...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2009/10/21/opensuse-11-1-and-boot-on-raid-1.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>I tried yesterday to set up a home server with two disks in a RAID 1 array.</p>
<p>My intention was to have everything on the RAID volume, including /boot, so that if a disk crash, I still can boot on the second one.<br />
That&#8217;s the way I think it should work anyway, despite the number of tutorials or forum posts advising not to do so.</p>
<p>The openSUSE partitionner, during the installation process, warned me that having /boot on the RAID 1 array may not work with grub.<br />
And indeed, at the end of the installation, I could not be able to set grub properly :</p>
<ul>
<li>the installer seemed to be lost, writing wrong devices in the various grub config file like menu.lst and grub.conf</li>
<li>I tried to use the manual edition mode offered by the installer, but either because I missed something or there is a bug somewhere, I could never save my modifications.</li>
</ul>
<p>Conclusion : there was a no go.</p>
<p>I became curious to see how a few other distributions could handle it.</p>
<p>At first, I thought they would all fail, because I have always found the openSUSE installer to be the best out there.</p>
<p>So I took a <strong>Debian Lenny</strong> CD, which is my second favorite distribution, and looked at it. The Debian installer is straightforward, but the partionner has always lacked of flexibility. It is fine when you are doing something pretty standard, but you get quickly limited when you want to do something more complicated.<br />
There, no way to have /boot on a RAID volume, and the interface was really painful to use. Any mistake almost oblige you for sure to restart all from scratch.</p>
<p>Then, I looked at <strong>Fedora 11</strong>&#8230; without expecting much. The last time I tried it on a machine, it just froze every time it read the disk configuration.<br />
<strong>But&#8230; surprise ! All I wanted was supported out of the box</strong>. The partionner was as pleasant to use as the one of openSUSE, and setting grub on /dev/md0 was just a matter of checking a box.</p>
<p>I have been quite impressed this time and Fedora will stay on this machine for a while.</p>
<p>I haven&#8217;t tested <strong>openSUSE 11.2</strong> yet because the purpose of this machine is to be a server, so I care about stability.</p>
<p>But I will, and I wish it can support this feature also, or that it will be the case some day.</p>
]]></content:encoded>
			<wfw:commentRss>/2009/10/21/opensuse-11-1-and-boot-on-raid-1.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
