<?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>Security &#8211; Phocean.net</title>
	<atom:link href="/category/security/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>BeEF Docker</title>
		<link>/2017/02/24/beef-docker.html</link>
		<pubDate>Fri, 24 Feb 2017 21:17:51 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Pentesting]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[BeEF]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Dockerfile]]></category>
		<category><![CDATA[Metasploit]]></category>
		<category><![CDATA[pentest]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://phocean.net/?p=2154</guid>
		<guid isPermaLink="false">http://phocean.net/?p=2154</guid>
		<description><![CDATA[Just a quick update to tell about a new Docker based on the phocean/msf image. https://hub.docker.com/r/phocean/beef/ https://github.com/phocean/dockerfile-beef It provides an image for the BeEF framework for XSS browser exploitation (http://beefproject.com/). Enjoy it!]]></description>
				<content:encoded><![CDATA[<p>Just a quick update to tell about a new Docker based on the phocean/msf image.</p>
<p><a href="https://hub.docker.com/r/phocean/beef/">https://hub.docker.com/r/phocean/beef/</a></p>
<p><a href="https://github.com/phocean/dockerfile-beef">https://github.com/phocean/dockerfile-beef</a></p>
<p>It provides an image for the BeEF framework for XSS browser exploitation (<a href="http://beefproject.com/">http://beefproject.com/</a>).</p>
<p>Enjoy it!</p>
]]></content:encoded>
			</item>
		<item>
		<title>Reducing the friction™ with social medias thanks to Netvibes</title>
		<link>/2016/11/27/reducing-the-friction-with-social-media-thanks-to-netvibes.html</link>
		<pubDate>Sun, 27 Nov 2016 12:31:20 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Defense]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[technology watch]]></category>

		<guid isPermaLink="false">http://phocean.net/?p=2134</guid>
		<guid isPermaLink="false">http://phocean.net/?p=2134</guid>
		<description><![CDATA[I have been a big fan of the &#8220;Reducing the friction&#8221; series of article published by Scott Lowe a while back. These articles consist in tips to automate or improve the smoothness of repeated professional tasks. If you haven&#8217;t, I recommend you to read them. Some are specific to the Mac OS X environments, but...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2016/11/27/reducing-the-friction-with-social-media-thanks-to-netvibes.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>I have been a big fan of the &#8220;<a href="http://blog.scottlowe.org/archives/">Reducing the friction</a>&#8221; series of article published by <a href="https://twitter.com/scott_lowe">Scott Lowe</a> a while back.</p>
<p>These articles consist in tips to automate or improve the smoothness of repeated professional tasks. If you haven&#8217;t, I recommend you to read them.</p>
<p>Some are specific to the Mac OS X environments, but most of time it is easy to find alternative stuff for Linux. By the way, I am thinking of sharing my own tips for Linux some day.</p>
<h2>The issues with technology watch</h2>
<p>Today, I will start with an article on how I tackled the issues I have with technology watching : too much information, too many sources, too much noise, too much time wasted&#8230; Hmm, yes, that&#8217;s a lot of issues!</p>
<p>Before, below are the sources that I used to visit plenty of times a day:</p>
<ul>
<li>RSS/Atom feeds, from <a href="http://www.feedly.com/">Feedly</a> with a few hundreds of sources.</li>
<li>Twitter</li>
<li>Reddit (most often /r/netsec, but also others)</li>
<li>Hacker News</li>
</ul>
<p>So my typical checks consisted in visiting these places subsequently, several times a day. With all the hassle of using different interfaces and the distractions that you can find there, it used to be very time costly and not really efficient.</p>
<p>Typically, I would save interesting topics there (&#8220;<em>like&#8221;</em> in Twitter, &#8220;<em>save</em>&#8221; for Feedly&#8230;) for a later check. Sometimes I would also use <a href="https://getpocket.com/">Pocket</a> to read them offline, or a simple PDF export.</p>
<p>As I already said, such a process with many tools is far from ideal and from the <em>Reduce the friction</em><img src="https://s.w.org/images/core/emoji/11/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" /> theory.</p>
<h2>Reducing the friction with Netvibes</h2>
<p><a href="https://www.netvibes.com">Netvibes</a> is a Web platform allowing to gather many kinds of contents within dashboards. It is in fact possible to use it as a news aggregator like Feedly, but it has much more capabilities.</p>
<p>First, it can handle sources from various technologies or social media actors (at least, major ones are supported):</p>
<ul>
<li>RSS/Atom</li>
<li>Twitter</li>
<li>Reddit</li>
<li>Facebook</li>
</ul>
<p>After adding some sources (they call them <em>applications</em>), you can get a classic feed view like below:</p>
<div id="attachment_2138" style="width: 590px" class="wp-caption aligncenter"><img class="size-medium wp-image-2138" src="http://phocean.net/wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-07-48-580x106.png" alt="Feed view on Netvibes" width="580" height="106" srcset="/wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-07-48-580x106.png 580w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-07-48-768x141.png 768w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-07-48-940x173.png 940w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-07-48-624x115.png 624w" sizes="(max-width: 580px) 100vw, 580px" /><p class="wp-caption-text">Feed view on Netvibes</p></div>
<div id="attachment_2138" style="width: 590px" class="wp-caption aligncenter"><img class="size-medium wp-image-2138" src="http://phocean.net/wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-07-48-580x106.png" alt="Feed view on Netvibes" width="580" height="106" srcset="/wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-07-48-580x106.png 580w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-07-48-768x141.png 768w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-07-48-940x173.png 940w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-07-48-624x115.png 624w" sizes="(max-width: 580px) 100vw, 580px" /><p class="wp-caption-text">Feed view on Netvibes</p></div>
<p>Nice! We now have a lot of stuff in one place and you can easily distinct what you have read or not (which is not easy to achieve in Twitter, for instance).</p>
<p>Then, similar to what <a href="https://ifttt.com">IFTT</a> offers, you can create automated actions easily.</p>
<p>Here are some of the supported triggers:</p>
<div id="attachment_2137" style="width: 590px" class="wp-caption aligncenter"><img class="size-medium wp-image-2137" src="http://phocean.net/wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-10-57-59-580x256.png" alt="Services supported by Netvibes" width="580" height="256" srcset="/wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-10-57-59-580x256.png 580w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-10-57-59-768x340.png 768w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-10-57-59-940x416.png 940w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-10-57-59-624x276.png 624w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-10-57-59.png 1192w" sizes="(max-width: 580px) 100vw, 580px" /><p class="wp-caption-text">Services supported by Netvibes</p></div>
<div id="attachment_2137" style="width: 590px" class="wp-caption aligncenter"><img class="size-medium wp-image-2137" src="http://phocean.net/wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-10-57-59-580x256.png" alt="Services supported by Netvibes" width="580" height="256" srcset="/wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-10-57-59-580x256.png 580w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-10-57-59-768x340.png 768w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-10-57-59-940x416.png 940w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-10-57-59-624x276.png 624w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-10-57-59.png 1192w" sizes="(max-width: 580px) 100vw, 580px" /><p class="wp-caption-text">Services supported by Netvibes</p></div>
<p>Based on a trigger like <em>marking</em> an article from within Netvibes, I can decide to send that article to Pocket or by e-mail for offline reading:</p>
<div id="attachment_2139" style="width: 590px" class="wp-caption aligncenter"><img class="size-medium wp-image-2139" src="http://phocean.net/wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-08-11-580x263.png" alt="Netvibes action" width="580" height="263" srcset="/wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-08-11-580x263.png 580w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-08-11-768x348.png 768w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-08-11-940x427.png 940w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-08-11-624x283.png 624w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-08-11.png 1503w" sizes="(max-width: 580px) 100vw, 580px" /><p class="wp-caption-text">Netvibes action</p></div>
<div id="attachment_2139" style="width: 590px" class="wp-caption aligncenter"><img class="size-medium wp-image-2139" src="http://phocean.net/wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-08-11-580x263.png" alt="Netvibes action" width="580" height="263" srcset="/wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-08-11-580x263.png 580w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-08-11-768x348.png 768w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-08-11-940x427.png 940w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-08-11-624x283.png 624w, /wp-content/uploads/2016/11/Capture-décran-de-2016-11-27-09-08-11.png 1503w" sizes="(max-width: 580px) 100vw, 580px" /><p class="wp-caption-text">Netvibes action</p></div>
<p>I have also another action: when a new post appears on a subreddit, I also send it to Pocket.</p>
<p>The possibilities, while not yet infinite, are huge.</p>
<p>You can do a lot with the free version, but for 2€ a month, you get content indexing to quickly find back some items in your feeds. I took this option, as it is useful but also as it is a way to support this project.</p>
<p>There is a premium offer, by far more expensive, but it is not really aimed to individual (analytics and collaborative features). See <a href="https://www.netvibes.com/fr/products">this page</a> for more information.</p>
<h2>Conclusion</h2>
<p>I have tried, I believe, all possible alternatives. Including integrating Feedly with IFFT, which is nice but does not solve the issue of reading many sources.</p>
<p>Netvibes is so far very interesting and powerful. It is not perfect, however.</p>
<p>Sometimes the interface is a little clumsy or cumbersome. I also miss a mobile application (for Android), even though the mobile HTML 5 interface is not that bad (http://mobile.netvibes.com).</p>
<p>Finally, I could not find a way to republish a dashboard feed as RSS, so that I could use a mobile reader. Let&#8217;s hope that this powerful tool will continue to improve, and for that I hope it gains in popularity.</p>
]]></content:encoded>
			</item>
		<item>
		<title>Metasploit framework docker image now published on Docker Hub</title>
		<link>/2016/06/28/metasploit-framework-docker-image-now-published-on-docker-hub.html</link>
		<pubDate>Tue, 28 Jun 2016 20:56:32 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Pentesting]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Dockerfile]]></category>
		<category><![CDATA[Metasploit]]></category>

		<guid isPermaLink="false">http://phocean.net/?p=2117</guid>
		<guid isPermaLink="false">http://phocean.net/?p=2117</guid>
		<description><![CDATA[I pushed the image on Docker Hub, so that deploying it is now as easy as: docker pull phocean/msf It is an automatic build based on the Github repository. It means that the image is built by Docker, not by me. For this task, they simply have a read access to the Dockerfile on Github....<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2016/06/28/metasploit-framework-docker-image-now-published-on-docker-hub.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>I pushed the image on <a href="https://hub.docker.com/r/phocean/msf/">Docker Hub</a>, so that deploying it is now as easy as:</p>
<pre>docker pull phocean/msf</pre>
<p>It is an automatic build based on the <a href="https://github.com/phocean/dockerfile-debian-metasploit">Github repository</a>.</p>
<p>It means that the image is built by Docker, not by me. For this task, they simply have a read access to the Dockerfile on Github.</p>
<p>Thus, you may place in this image the same level of trust than the one you have in Docker (I cannot interfere in the process and mess with the image).</p>
<p>I say it because I am myself reluctant of installing third-party images. While I prefer to rebuild everything from Dockerfiles, I am fine with automatically built images if I am in a hurry and for non sensitive data.</p>
]]></content:encoded>
			</item>
		<item>
		<title>Msf docker image now in REMnux!</title>
		<link>/2016/05/12/msf-docker-image-now-in-remnux.html</link>
		<pubDate>Thu, 12 May 2016 17:50:14 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Pentesting]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Metasploit]]></category>
		<category><![CDATA[REMnux]]></category>

		<guid isPermaLink="false">http://phocean.net/?p=2108</guid>
		<guid isPermaLink="false">http://phocean.net/?p=2108</guid>
		<description><![CDATA[Just a quick note to say that I am very happy about this Metasploit docker image being useful to some people, according to the feedback I got. And Lenny was kind enough to integrate it into his Linux distro, REMnux, well known among reversing people. He also came up with very good suggestions and helped...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2016/05/12/msf-docker-image-now-in-remnux.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>Just a quick note to say that I am very happy about this <a href="https://github.com/phocean/dockerfile-debian-metasploit">Metasploit docker image</a> being useful to some people, according to the feedback I got.</p>
<p>And <a href="https://twitter.com/lennyzeltser">Lenny</a> was kind enough to integrate it into his Linux distro, <a href="https://remnux.org/">REMnux</a>, well known among reversing people. He also came up with very good suggestions and helped me to bring some improvements, so many thanks to him.</p>
<p>Don&#8217;t miss reading his blog article on how to use the image in REMnux : <a href="https://zeltser.com/metasploit-framework-docker-container/"><em>&#8220;Run Metasploit Framework as a Docker Container Without Installation Pains&#8221;</em></a>.<br />
Stay tuned ;-)</p>
]]></content:encoded>
			</item>
		<item>
		<title>Lessons learned with Docker, Nodejs apps and volumes</title>
		<link>/2016/05/06/the-quest-for-a-secure-nodejs-app-docker-container.html</link>
		<pubDate>Fri, 06 May 2016 17:05:01 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Defense]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Dockerfile]]></category>
		<category><![CDATA[Etherpad]]></category>
		<category><![CDATA[Nodejs]]></category>

		<guid isPermaLink="false">http://phocean.net/?p=2099</guid>
		<guid isPermaLink="false">http://phocean.net/?p=2099</guid>
		<description><![CDATA[Context I have kept playing with Docker recently, just for fun and to learn. It is very powerful, but still young. It quickly shows some limit when it comes to security or persistence. There are some workarounds, yet more or less complex, more or less hacky. Indeed, I had some issues with Etherpad, which is...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2016/05/06/the-quest-for-a-secure-nodejs-app-docker-container.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<h2>Context</h2>
<p>I have kept playing with Docker recently, just for fun and to learn.</p>
<p>It is very powerful, but still young. It quickly shows some limit when it comes to security or persistence. There are some workarounds, yet more or less complex, more or less hacky.</p>
<p>Indeed, I had some issues with Etherpad, which is a Nodejs application, and its integration into Docker.</p>
<p>Initially, I made something quite simple, so my Dockerfile ended like that:</p>
<pre>USER etherpad
CMD ["node","/opt/etherpad-lite/node_modules/ep_etherpad-lite/node/server.js"]</pre>
<p>Thus, I simply start the app with a low privileges user.</p>
<p>It worked, but I had two issues:</p>
<ol>
<li>Docker was not able to stop it nicely. Instead, it timed out after 10 sec and finally killed the app and the container altogether.</li>
<li>No persistence of any kind, of course.</li>
</ol>
<p>I decided to tackle these two issues to understand what was going on behind.</p>
<h2>The PID 1 issue</h2>
<p>I could not understand immediately the first issue: why was Docker unable to terminate the container properly?</p>
<p>After wandering a few hours on wrong paths (trying to get through with Nodejs nodemon or supervisor), I finally found some good articles, explaining that Docker misses an init system to catch signals, wich causes some issues with applications started with a PID = 1, which cannot be killed, or with Bash (the shell doesn&#8217;t handle transmitted signals.</p>
<p>I am not going to repeat poorly what has already been explained very well, so I encourage you to read this two excellent posts:</p>
<ul>
<li><a href="https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/">The PID 1 zombie reaping problem</a></li>
<li><a href="https://medium.com/@gchudnov/trapping-signals-in-docker-containers-7a57fdda7d86#.wqy8msjbk">Trapping signals in Docker containers</a></li>
</ul>
<p>You will also find a lot of bug reports in the Docker github about this issue, and a lot of hacky or overkilling solutions.</p>
<p>In my opinion, the most elegant solution among them is to use a launcher program, very simple and dedicated to catch and handle signal.</p>
<p>I chose to use <a href="https://github.com/yelp/dumb-init">Dumb-init</a>, as it is well packaged (there are plenty of options) and seems to be well maintained.</p>
<p>So, after installing Dump-init in the Dockerfile, the CMD line should now look like this:</p>
<pre>USER etherpad
CMD ["dumb-init","node","/opt/etherpad-lite/node_modules/ep_etherpad-lite/node/server.js"]</pre>
<p>And indeed, as expected, <em>docker stop</em> now works flawlessly.</p>
<h2>Volume permissions</h2>
<p>This is where I had the toughest issue, although it is supposed to be straightforward with volumes.</p>
<p>Volumes enable to share files or folders between host and containers, or between containers solely. There are plenty of possibilities, nicely illustrated on this blog:</p>
<ul>
<li><a href="https://kvaes.wordpress.com/2016/02/11/docker-storage-patterns-for-persistence/">Docker: storage patterns for persistence</a></li>
</ul>
<p>And it works very well&#8230;. as long as you application runs as root.</p>
<p>In my case, for instance, Etherpad runs with a low privileged user, which is highly recommended. At startup, it creates a sqlite database, etherpad.db,  in its ./var folder.</p>
<p>Mounting a volume, of any kind, over the ./var folder, would result in a folder with root only permissions. Subsequently, of course, the launch of Etherpad from the CMD command would fail miserably.</p>
<p>Simple solutions like <em>chown</em> in the Dockerfile don&#8217;t work, because they apply <em>before</em> the mount. The <em>mount</em> occurs at runtime and works like a standard Linux <em>mount:</em> it is created by the docker daemon, with <em>root</em> permissions, over possibly existing data.</p>
<p>My solution was to completely change the way Etherpad is started. I now use an external script which is started at runtime:</p>
<ol>
<li>First, it applies the appropriate permissions to the mounted volume with <em>chown,</em></li>
<li>Then, it starts Etherpad with a low privileged user thanks to a <em>su</em> hack.</li>
</ol>
<p>So now the Dockerfile ends with:</p>
<pre>VOLUME /opt/etherpad-lite/var
ADD run-docker.sh ./bin/
CMD ["./bin/run-docker.sh"]</pre>
<p>And here is the script:</p>
<pre>#!/bin/bash

chown -R etherpad:etherpad /opt/etherpad-lite/var
su etherpad -s /bin/bash -c  "dumb-init node /opt/etherpad-lite/node_modules/ep_etherpad-lite/no
de/server.js"</pre>
<p>I use a data volume for persistency, so the run command looks like this:</p>
<pre>docker run -d --name etherpad -p 80:9001 -v etherpad:/opt/etherpad-lite/var -t debian-etherpad</pre>
<p>Far from being ideal, but it works. I really hope some features are coming to bring more options in this area, especially in the Dockerfile.</p>
<h2>Some final thoughts</h2>
<p>Globally, we can still hope a lot of improvements in security, because when I look at many Dockerfiles around, I see two behaviors:</p>
<ul>
<li>A lot of people don&#8217;t care and everything is happily running as root, from unauthenticated third-party images or binaries&#8230;</li>
<li>Some people do care but end up with dirty hacks, because there is no other way to do so.</li>
</ul>
<p>It is scary and so far from the Linux philosophy. Let&#8217;s wait for the enhancements to come.</p>
<p>You can find the complete <em>updated</em> Dockerfile on <a href="https://github.com/phocean/dockerfile-debian-etherpad/blob/master/Dockerfile">this github page</a>.</p>
<p>While we are on this topic, have a look to <a href="http://blog.labianchin.me/2016/02/15/docker-tips-and-tricks">this nice post with some nice tips and tricks</a> for Docker.</p>
]]></content:encoded>
			</item>
		<item>
		<title>Small improvements to the Metasploit-framework Dockerfile</title>
		<link>/2016/05/03/small-improvements-to-the-metasploit-framework-dockerfile.html</link>
		<pubDate>Tue, 03 May 2016 20:36:38 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Pentesting]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Dockerfile]]></category>
		<category><![CDATA[Metasploit]]></category>

		<guid isPermaLink="false">http://phocean.net/?p=2094</guid>
		<guid isPermaLink="false">http://phocean.net/?p=2094</guid>
		<description><![CDATA[I made a few improvements (at least, I think they are) to the metasploit-frameword Dockerfile : A volume from the container /root/.msf4 to $HOME/.msf4, so that you can benefit from your customized prompt, scripts and modules anytime and have persistence on them. In other words, just manage them on your host and they will be...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2016/05/03/small-improvements-to-the-metasploit-framework-dockerfile.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>I made a few improvements (at least, I think they are) to the <a href="/2016/04/27/metasploit-dockerfile.html">metasploit-frameword Dockerfile</a> :</p>
<ul>
<li>A <a href="https://docs.docker.com/engine/userguide/containers/dockervolumes/">volume</a> from the container <em>/root/.msf4</em> to <em>$HOME/.msf4</em>, so that you can benefit from your customized prompt, scripts and modules anytime and have persistence on them. In other words, just manage them on your host and they will be readily available to the <em>msf</em> container.</li>
<li>A volume from the container <em>/tmp/data</em> to the host <em>/tmp/msf</em>, so that you can get access to dump files and stuff like that.</li>
<li><em><a href="https://tmux.github.io/">Tmux</a></em> window manager tool, so that you can easily navigate between <em>msfconsole,</em> bash and other sessions.</li>
<li><em><a href="https://nmap.org/">nmap</a></em> network scanner, just because sometimes it may be useful (along with its <em>ncat</em>).</li>
<li><a href="http://www.nasm.us/"><em>nasm,</em></a> to support your custom encoders.</li>
</ul>
<p>It is all up-to-date in <a href="https://github.com/phocean/dockerfile-debian-metasploit">its github repo</a>. I will keep adjusting it, if I feel something is missing.</p>
<p>I hope I did it the right way, let me know what you think!</p>
]]></content:encoded>
			</item>
		<item>
		<title>Metasploit Dockerfile</title>
		<link>/2016/04/27/metasploit-dockerfile.html</link>
		<comments>/2016/04/27/metasploit-dockerfile.html#comments</comments>
		<pubDate>Wed, 27 Apr 2016 18:26:10 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Pentesting]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Dockerfile]]></category>
		<category><![CDATA[Metasploit]]></category>
		<category><![CDATA[pentest]]></category>

		<guid isPermaLink="false">http://phocean.net/?p=2088</guid>
		<guid isPermaLink="false">http://phocean.net/?p=2088</guid>
		<description><![CDATA[Hey, Managing updates and dependencies of a Metasploit installation have definitely been too much trouble and repetitive. Instead of keeping reproducing boring installation steps every x months, I decided to build a Dockerfile for once. I chose Debian for its good compromise between features, stability and lightness. I am aware of the Kali Dockerfile, that...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2016/04/27/metasploit-dockerfile.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>Hey,</p>
<p>Managing updates and dependencies of a Metasploit installation have definitely been too much trouble and repetitive.</p>
<p>Instead of keeping reproducing boring installation steps every <em>x</em> months, I decided to build a <em>Dockerfile</em> for once.</p>
<p>I chose Debian for its good compromise between features, stability and lightness. I am aware of the Kali Dockerfile, that I could have used as a base. But:</p>
<ul>
<li> It is a definitely over-killing image (more than 1 GB) and, at this cost, it does not come with a fully-featured Metasploit (no database connection, for instance).</li>
<li>I like keeping minimal and controlled stuff. In other words, I like doing things on my own.</li>
</ul>
<p>So, this Debian-based Metasploit container comes with:</p>
<ul>
<li>all dependencies installed,</li>
<li>automatic updates at startup,</li>
<li>a connection with the local Postgres database,</li>
<li>an improved prompt with timestamping and sessions/jobs status.</li>
</ul>
<p>You can find it on <a href="https://github.com/phocean/dockerfile-debian-metasploit">my github</a>.</p>
<p>If you have any trouble or suggestion on how to improve it, please let me know. Enjoy it and go ahead if you want to fork it!</p>
<p><img class="aligncenter size-medium wp-image-2092" src="http://phocean.net/wp-content/uploads/2016/04/msf-580x320.png" alt="Docker running msf" width="580" height="320" srcset="/wp-content/uploads/2016/04/msf-580x320.png 580w, /wp-content/uploads/2016/04/msf-624x344.png 624w, /wp-content/uploads/2016/04/msf.png 715w" sizes="(max-width: 580px) 100vw, 580px" /></p>
<p><img class="aligncenter size-medium wp-image-2092" src="http://phocean.net/wp-content/uploads/2016/04/msf-580x320.png" alt="Docker running msf" width="580" height="320" srcset="/wp-content/uploads/2016/04/msf-580x320.png 580w, /wp-content/uploads/2016/04/msf-624x344.png 624w, /wp-content/uploads/2016/04/msf.png 715w" sizes="(max-width: 580px) 100vw, 580px" /></p>
]]></content:encoded>
			<wfw:commentRss>/2016/04/27/metasploit-dockerfile.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A few (convenient) dockerfiles</title>
		<link>/2016/04/10/a-few-convenient-dockerfiles.html</link>
		<pubDate>Sun, 10 Apr 2016 17:22:40 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Pentesting]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Etherpad]]></category>
		<category><![CDATA[Phishing Frenzy]]></category>
		<category><![CDATA[Tor]]></category>

		<guid isPermaLink="false">http://phocean.net/?p=2084</guid>
		<guid isPermaLink="false">http://phocean.net/?p=2084</guid>
		<description><![CDATA[I just put on my github a few dockerfiles for virtual machines that I frequently use to get some quick work done or to temporary share some data. Here they are: Debian-based Etherpad Debian-based Phishing Frenzy Debian-based Tor Browser I used to use VirtualBox guests, but maintaining them was a hassle (updates, snapshots, disk defragmation...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2016/04/10/a-few-convenient-dockerfiles.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>I just put on my github a few dockerfiles for virtual machines that I frequently use to get some quick work done or to temporary share some data.</p>
<p>Here they are:</p>
<ul>
<li style="font-family: 'Open Sans,Helvetica,Arial,sans-serif'; color: #444444;"><a href="https://github.com/phocean/dockerfile-debian-etherpad">Debian-based Etherpad</a></li>
<li style="font-family: 'Open Sans,Helvetica,Arial,sans-serif'; color: #444444;"><a href="https://github.com/phocean/dockerfile-debian-phishingfrenzy">Debian-based Phishing Frenzy</a></li>
<li style="font-family: 'Open Sans,Helvetica,Arial,sans-serif'; color: #444444;"><a href="https://github.com/phocean/dockerfile-debian-torbrowser">Debian-based Tor Browser</a></li>
</ul>
<p>I used to use VirtualBox guests, but maintaining them was a hassle (updates, snapshots, disk defragmation and shrinking, etc.).</p>
<p>It makes perfect sense to use Docker just for that, and on top of that it consumes much fewer resources. Starting with the disk usage : all these containers along with their image stands below 1 GB!</p>
<p>The fact that I am using Btrfs as the underlying storage driver is not for nothing: compression is extremely efficient on images!</p>
<p>Note that my Dockerfiles have nothing special, you can actually find others on the Internet (and I was inspired by some).</p>
<p>There are a few differences, however:</p>
<ul>
<li style="font-family: 'Open Sans,Helvetica,Arial,sans-serif'; color: #444444;">I care much about security, so at least I try to make Web services not running as root, even if it is inside a container (the root user is still the same as on the host, so let&#8217;s make a compromise as unlikely as possible).</li>
<li style="font-family: 'Open Sans,Helvetica,Arial,sans-serif'; color: #444444;">I like simple things, so I tried to keep everything straightforward and simplified some stuff.</li>
<li style="font-family: 'Open Sans,Helvetica,Arial,sans-serif'; color: #444444;">I don&#8217;t like to waste disk space. So when I some Dockerfiles based on Ubuntu, Debian Wheezy, Debian Jessie, Fedora, etc., I try to unify all of them under Debian &#8220;stable&#8221; (so as of today, Jessie). Why bother with useless images? I chose a versatile and common server distribution and I am trying to stick with it.</li>
</ul>
<p>While I was playing, I had two things bothering me:</p>
<ul>
<li style="font-family: 'Open Sans,Helvetica,Arial,sans-serif'; color: #444444;"><a href="https://github.com/docker/docker/issues/3804">No quota support</a>: for a Samba sharing guest that I have, I would have liked to implement quotas from within the container. There is no support for that at the moment, and the global limitation by container is not nice (and once you choose a big size, you can&#8217;t go backward for existing containers&#8230;). I have a dedicated partition for Docker, so, while not perfect, it is okay for now.</li>
<li style="font-family: 'Open Sans,Helvetica,Arial,sans-serif'; color: #444444;">The devicemapper storage driver totally sucks at this time: <a href="https://github.com/docker/docker/issues/3182">free space is never reclaimed after you delete images or containers</a>! So the more you use Docker, the more your partition gets full.</li>
</ul>
]]></content:encoded>
			</item>
		<item>
		<title>Quick tip: harden your ARP table the easy way (Linux)</title>
		<link>/2015/08/14/quick-tip-harden-your-arp-table-the-easy-way-linux.html</link>
		<comments>/2015/08/14/quick-tip-harden-your-arp-table-the-easy-way-linux.html#comments</comments>
		<pubDate>Fri, 14 Aug 2015 20:52:05 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Defense]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[arp]]></category>
		<category><![CDATA[arp spoofing]]></category>
		<category><![CDATA[mac address]]></category>
		<category><![CDATA[NetworkManager]]></category>

		<guid isPermaLink="false">http://phocean.net/?p=2041</guid>
		<guid isPermaLink="false">http://phocean.net/?p=2041</guid>
		<description><![CDATA[ARP spoofing is a good old attack on LAN and still a devastating one, leading to trafic interception (MiTM). You may want to make sure that nobody is tricking on you at office, at a security conference, at you local coffee shop, etc. Yet, most networks do not have port security and ARP inspect on...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2015/08/14/quick-tip-harden-your-arp-table-the-easy-way-linux.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>ARP spoofing is a good old attack on LAN and still a devastating one, leading to trafic interception (MiTM). You may want to make sure that nobody is tricking on you at office, at a security conference, at you local coffee shop, etc.</p>
<p>Yet, most networks do not have port security and ARP inspect on their switches to mitigate such attacks. So you have to count on yourself.</p>
<p>Most people know how to protect a client , e.g. by maintaining a static mapping of MAC / IP addresses on the operating systems. But almost no one does it, because it would be a pain to manage&#8230;</p>
<p>But, really ? No, here is what I do to get a reasonable protection.</p>
<p>I do a few compromises at first:</p>
<ol>
<li><span style="text-decoration: underline;">I am not looking to protect ALL my traffic</span> toward  other peers on the LAN, but at least outbound communications with the gateway and, optionally, with a few critical servers.</li>
<li><span style="text-decoration: underline;">An attacker may still poison the gateway</span> and eavesdrop on responses directed to my machine, and get some interesting stuff anyway.</li>
<li>So, <span style="text-decoration: underline;">this is not a protection on its own</span>. You have to think defense-in-depth : encryption on all your services (TLS), VPN, etc. Especially, depending on where you are, do not rely on the DNS / DHCP servers.</li>
</ol>
<p>With that said, what follows is a hardening move that you can do on most of Linux distributions, with little pain.</p>
<p>Get the MAC address of the gateway, either by finding it out physically (tag) or by checking it at a safe moment (when ARP spoofing is supposedly not happening).</p>
<p>Fill in a flat file, like /etc/ethers, with mappings like :</p>
<pre> 00:11:22:33:44:55  1.2.3.4</pre>
<p>Now, NetworkManager will do all the magic.</p>
<p>Create a script like :</p>
<pre> % cat /etc/NetworkManager/dispatcher.d/40-arp 
 #!/bin/bash
 arp -f /etc/ethers
</pre>
<p>All scripts in the above folder will be executed every time an interface gets up, as long as you give it executable rights :</p>
<pre>% chmod +x /etc/NetworkManager/dispatcher.d/40-arp</pre>
<p>Now, either execute it directly or unplug / plug back in your interface. You should have a permanent static MAC address now, effectively bypassing the ARP protocol and its weaknesses :</p>
<pre>% arp -a -n
? (172.16.100.254) at 00:15:17:9d:d6:d1 [ether] PERM on eth0</pre>
<p>Voilà! Should you not use NetworkManager for some reason, you can do something equivalent with <em>ifup</em> scripts in respect with the syntax of you current Linux distribution.</p>
<p>But, let me stress it out once more, to be sure you don&#8217;t get me wrong :</p>
<p><strong><span style="color: #ff0000;">Despite an enhancement, this is no a sufficient protection and you may still get pwned ! Authentication and encryption MUST also come into the play, so use only TLS enabled services, HTTPS sites and, ideally, a good IPSEC / SSH / TLS tunnel to carry ALL of your traffic !</span></strong></p>
]]></content:encoded>
			<wfw:commentRss>/2015/08/14/quick-tip-harden-your-arp-table-the-easy-way-linux.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<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>
	</channel>
</rss>
