<?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>webstersprodigy.net &#187; virtualbox</title>
	<atom:link href="http://webstersprodigy.net/tag/virtualbox/feed/" rel="self" type="application/rss+xml" />
	<link>http://webstersprodigy.net</link>
	<description>Me trying to learn how to use a computer</description>
	<lastBuildDate>Sat, 04 Feb 2012 01:17:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Auto Restore Virtualbox</title>
		<link>http://webstersprodigy.net/2009/03/auto-restore-virtualbox/</link>
		<comments>http://webstersprodigy.net/2009/03/auto-restore-virtualbox/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 15:55:41 +0000</pubDate>
		<dc:creator>webstersprodigy</dc:creator>
				<category><![CDATA[GrayHat]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[windoze]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://webstersprodigy.net/?p=446</guid>
		<description><![CDATA[For the security class I'm teaching we recently had a box to pwn. Problem is, they would sometimes get the address wrong and crash the virtual system. I probably would have just distributed the vdi, but not all of them have machines robust enough to run a vm, so I had to set something up.]]></description>
			<content:encoded><![CDATA[<p>For the security class I&#8217;m teaching we recently had a box to pwn. Problem is, they would sometimes get the address wrong and crash the virtual system. I probably would have just distributed the vdi, but not all of them have machines robust enough to run a vm, so I had to set something up.<br />
First off, I gave the virtual vulnerable box a public IP by bridging.</p>
<p>/etc/network/interfaces</p>
<blockquote>
<pre>auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
    address 134.50.1.2
    netmask 255.255.0.0
    gateway 134.50.1.254
    bridge_ports eth0 vbox0 vbox1

# The loopback network interface
auto lo
iface lo inet loopback</pre>
</blockquote>
<p>/etc/vbox/interfaces</p>
<blockquote>
<pre>vbox0 lundeen br0
vbox1 lundeen br0</pre>
</blockquote>
<p>Awesome, now firewall rules work. In the vulnbox, I give myself an ip address. On the host, I set up very strict firewall rules using iptables.</p>
<p>Another big issue is auto-restore. Since the class often gets an address wrong, the vulnbox often crashes.</p>
<p>The following will shut the box down, revert to a snapshot, and turn it back on.</p>
<blockquote>
<pre>/usr/bin/VBoxManage controlvm vulnxp poweroff;
sleep 5;
/usr/bin/VBoxManage snapshot vulnxp discardcurrent -state
sleep 10;
/usr/bin/VBoxManage startvm vulnxp</pre>
</blockquote>
<p>Anyway, I put this in crontab to do every 20 minutes.</p>
<blockquote><p>0,20,40 * * * * /path/to/virtualscript</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://webstersprodigy.net/2009/03/auto-restore-virtualbox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Networking to and from Virtualbox</title>
		<link>http://webstersprodigy.net/2008/05/networking-to-and-from-virtualbox/</link>
		<comments>http://webstersprodigy.net/2008/05/networking-to-and-from-virtualbox/#comments</comments>
		<pubDate>Mon, 12 May 2008 02:31:28 +0000</pubDate>
		<dc:creator>webstersprodigy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://webstersprodigy.net/?p=321</guid>
		<description><![CDATA["This is how I got host networking for VirtualBox and have it setup to use bridging on FedoraCore 6 host. This allows for two way traffic between the host and the guest. You will need bridge-utils and uml-utilities.  The first step is to configure the host with a bridge and a tap device. With this only the bridge will get an IP address and not the ethX nor the tapX device."
]]></description>
			<content:encoded><![CDATA[<p>This is how you can network your Virtualbox server.</p>
<p>I found this at http://www.linuxweblog.com/virtualbox-host-networking.</p>
<p>&#8220;&#8221;"</p>
<p>This is how I got host networking for VirtualBox and have it setup to use bridging on FedoraCore 6 host. This allows for two way traffic between the host and the guest. You will need bridge-utils and uml-utilities.</p>
<p>The first step is to configure the host with a bridge and a tap device. With this only the bridge will get an IP address and not the ethX nor the tapX device.</p>
<p>I am using dhcp to assign the IP addresses so the basic commands on the host are as below and can be put in the rc.local file for it to come up on boot:</p>
<div class="codeblock"><code># VirtualBox Bridging</code></p>
<p># load the tun module<br />
modprobe tun</p>
<p># Create a tap device with permission for the user running vbox<br />
tunctl -t tap0 -u {user}<br />
chmod 666 /dev/net/tun</p>
<p># Bring up ethX and tapX in promiscuous mode<br />
ifconfig eth0 0.0.0.0 promisc<br />
ifconfig tap0 0.0.0.0 promisc</p>
<p># Create a new bridge and add the interfaces to the bridge.<br />
brctl addbr br0<br />
brctl addif br0 eth0<br />
brctl addif br0 tap0</p>
<p># Give the bridge a dhcp address.<br />
dhclient br0</p></div>
<p>You should now be able to use host networking in VirtualBox, just change &#8220;attached to&#8221; to &#8220;host interface&#8221; and add the interface name of &#8220;tap0&#8243; in your networking settings for the guest.</p>
<h3>Notes:</h3>
<p>If you&#8217;re using a firewall on your host, make sure to turn it off when testing network setup.<br />
I have had success with using <a href="http://www.linuxweblog.com/apf-firewall">APF as firewall</a> which seems compatible with bridging.</p>
<h3>References:</h3>
<ol>
<li><a href="http://www.virtualbox.org/">VirtualBox</a></li>
<li><a href="http://linux-net.osdl.org/index.php/Bridge">Bridge</a></li>
<li><a href="http://user-mode-linux.sourceforge.net/dl-tools-sf.html">uml-utilities</a></li>
<li><a href="http://www.citi.umich.edu/projects/asci/uml/2.6.6uml.html">2.6.6 UML setup<br />
</a></li>
</ol>
<p>&#8220;&#8221;"</p>
<p>Though this is very self-explanatory&#8230; and I hate to repost it here &#8230; I thought it was cool enough it deserved a post.</p>
<p>My script is nearly identical, I just don&#8217;t use dhcp.</p>
<blockquote>
<pre>#!/bin/sh

# VirtualBox Bridging

# load the tun module
modprobe tun

# Create a tap device with permission for the user running vbox
tunctl -t tap0 -u lundeen
chmod 666 /dev/net/tun

# Bring up ethX and tapX in promiscuous mode
ifconfig eth0 0.0.0.0 promisc
ifconfig tap0 0.0.0.0 promisc

# Create a new bridge and add the interfaces to the bridge.
brctl addbr br0
brctl addif br0 eth0
brctl addif br0 tap0

# Give the bridge a dhcp address.
ifconfig br0 192.168.1.22
route add default gw 192.168.1.1 dev br0</pre>
</blockquote>
<p>It works like a charm though.  To add more, just add more tun devices.  I am using this to test samba, test SPA, and I&#8217;m sure I&#8217;ll use it for more things &#8211; it&#8217;s an incredibly useful trick.</p>
<p>Also, hands down I prefer Virtualbox to VMware.  I highly recommend anyone to give it a try.   The integration is better (well, I like vmware player&#8217;s integration, not vmware server, but vmware player is fairly useless), the networking is more flexable in Virtualbox, I find it more intuitive, you get unlimited snapshots, and I&#8217;m sure there&#8217;s more.  Hey, it&#8217;s open source.</p>
]]></content:encoded>
			<wfw:commentRss>http://webstersprodigy.net/2008/05/networking-to-and-from-virtualbox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

