{"id":6919,"date":"2017-03-09T11:10:22","date_gmt":"2017-03-09T19:10:22","guid":{"rendered":"http:\/\/www.palada.net\/index.php\/2017\/03\/09\/news-710\/"},"modified":"2017-03-09T11:10:22","modified_gmt":"2017-03-09T19:10:22","slug":"news-710","status":"publish","type":"post","link":"http:\/\/www.palada.net\/index.php\/2017\/03\/09\/news-710\/","title":{"rendered":"Torify and analyze traffic for your VM"},"content":{"rendered":"<p><strong>Credit to Author: J\u00e9r\u00f4me Boursier| Date: Thu, 09 Mar 2017 18:00:58 +0000<\/strong><\/p>\n<p>Virtual machines are a great tool to run untrusted piece of software and analyzing the network activity. Most of the time, the default networking configuration uses a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Bridging_%28networking%29\" target=\"_blank\">bridge<\/a> to allow VMs to communicate. One caveat about this approach is that both the VM and the host will access the same network (like a personal trusted LAN for instance\u2026), something definitely not desirable.<\/p>\n<p>Multiple solutions exist to isolate the untrusted VMs from the host LAN. A few years ago <a href=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2012\/04\/anonymizing-traffic-for-your-vm\/\" target=\"_blank\">we spoke about JanusVM<\/a> which is no longer maintained and not so easy to set up. A more recent solution uses <a href=\"https:\/\/www.virtualbox.org\/\" target=\"_blank\">VirtualBox<\/a>, <a href=\"https:\/\/torproject.org\" target=\"_blank\">Tor<\/a>, and <a href=\"https:\/\/www.whonix.org\" target=\"_blank\">Whonix<\/a> alongside <a href=\"https:\/\/www.wireshark.org\/\" target=\"_blank\">Wireshark<\/a> and is pretty quick to set up without bothering with DHCP or other network protocols.<\/p>\n<p><strong>Whonix<\/strong> is an\u00a0 OS designed to run as a set of VMs with pre-installed and configured applications. <a href=\"https:\/\/www.whonix.org\/wiki\/Features\" target=\"_blank\">Among other features, it uses Tor<\/a> for all network connection thanks to <strong>Whonix-Gateway<\/strong>, a VM dedicated to be used as a gateway between Whonix VMs to the Tor network.<\/p>\n<p>However, please note that UDP traffic won\u2019t work <a href=\"https:\/\/www.torproject.org\/docs\/faq.html.en#TransportIPnotTCP\" target=\"_blank\">due to Tor limitations<\/a>. DNS queries will use Tor <em>DnsPort<\/em> on the Whonix Gateway to avoid leaks.<\/p>\n<ol>\n<li><a href=\"https:\/\/www.whonix.org\/wiki\/VirtualBox\" target=\"_blank\">Download <strong>Whonix-Gateway<\/strong><\/a> (look for <em>Download Whonix-Gateway<\/em> link),<\/li>\n<li>Download the associated signature, and the SHA512 file (also provided with its signature),<\/li>\n<li><a href=\"https:\/\/www.whonix.org\/wiki\/VirtualBox\/Verify_the_virtual_machine_images_using_the_command_line\" target=\"_blank\"><strong>Check them both<\/strong><\/a>,<\/li>\n<li>On VirtualBox, simply import the <em>.ova<\/em> downloaded above with <em>File<\/em> &gt; <em>Import Appliance<\/em>,<\/li>\n<li>Leave the default settings untouched, read and agree the agreement,<\/li>\n<li>Start <em>Whonix-Gateway<\/em> VM and follow the initial instructions,<\/li>\n<li>You may want to activate the auto-update when prompted,<\/li>\n<li>For the VMs you want to redirect the traffic, go to <em>Settings<\/em>, <em>Network<\/em> and select <em>Internal Network<\/em>. Set <em>Whonix<\/em> as name.<\/li>\n<\/ol>\n<p>Once <em>Whonix-Gateway<\/em> has been configured, you get the following network configuration:<\/p>\n<pre><code>auto eth1  iface eth1 inet static  address 10.152.152.10  netmask 255.255.192.0  <\/code><\/pre>\n<p>Thus, you can assign your VMs in the range <em>10.152.152.10 \/18<\/em>. For instance, the following static IP configuration is used for a first VM:<\/p>\n<pre><code>IP: 10.152.152.11  Mask: 255.255.192.0  Gateway: 10.152.152.10  Primary DNS server: 10.152.152.10  <\/code><\/pre>\n<p>All the traffic will now be isolated from your host LAN, and will only use Tor (including DNS queries). In order for this setup to work, whenever you want to connect one of your VM, the Whonix-Gateway has to be up.<\/p>\n<div id=\"attachment_16687\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/03\/check.torproject.org_whonix.png\" data-rel=\"lightbox-0\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-16687 size-large\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/03\/check.torproject.org_whonix-600x294.png\" alt=\"check.torproject.org status page\" width=\"600\" height=\"294\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/03\/check.torproject.org_whonix-600x294.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/03\/check.torproject.org_whonix-300x147.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">check.torproject.org status page<\/p>\n<\/div>\n<p>A visit on <a href=\"https:\/\/check.torproject.org\" target=\"_blank\">check.torproject.org<\/a> from inside a VM using <em>Whonix-Gateway<\/em> should confir that the setups is working as expected.<\/p>\n<p>Please keep in mind that <strong>this setup should not be trusted to provide serious anonymity guarantees<\/strong>.<\/p>\n<p>Once the VMs are setup, simply install <em>Wireshark<\/em> or <em>tshark<\/em>. Configure them to listen on eth1&#8230; and profit!<\/p>\n<div id=\"attachment_16686\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/03\/wireshark.png\" data-rel=\"lightbox-1\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-16686 size-large\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/03\/wireshark-600x307.png\" alt=\"Wireshark listening on eth1 on the Whonix Gateway.\" width=\"600\" height=\"307\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/03\/wireshark-600x307.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/03\/wireshark-300x153.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Wireshark listening on eth1 on the Whonix Gateway.<\/p>\n<\/div>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\/101\/how-tos\/2017\/03\/torify-analyze-traffic-vm\/\">Torify and analyze traffic for your VM<\/a> appeared first on <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\">Malwarebytes Labs<\/a>.<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/101\/how-tos\/2017\/03\/torify-analyze-traffic-vm\/\" target=\"bwo\" >https:\/\/blog.malwarebytes.com\/feed\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><strong>Credit to Author: J\u00e9r\u00f4me Boursier| Date: Thu, 09 Mar 2017 18:00:58 +0000<\/strong><\/p>\n<table cellpadding='10'>\n<tr>\n<td valign='top' align='center'><a href='https:\/\/blog.malwarebytes.com\/101\/how-tos\/2017\/03\/torify-analyze-traffic-vm\/' title='Torify and analyze traffic for your VM'><img src='https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/03\/photodune-2058636-network-xl.jpg' border='0'  width='300px'  \/><\/a><\/td>\n<\/tr>\n<tr>\n<td valign='top' align='left'>Several solutions to isolate and analyze a VM network traffic for malware analysis purpose exist. Whonix, Tor and Virtual makes this process painless and efficient.<\/p>\n<p>Categories: <\/p>\n<ul class=\"post-categories\">\n<li><a href=\"https:\/\/blog.malwarebytes.com\/category\/101\/how-tos\/\" rel=\"category tag\">How-tos<\/a><\/li>\n<li><a href=\"https:\/\/blog.malwarebytes.com\/category\/threat-analysis\/\" rel=\"category tag\">Threat analysis<\/a><\/li>\n<\/ul>\n<p>Tags: <a href=\"https:\/\/blog.malwarebytes.com\/tag\/network\/\" rel=\"tag\">network<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/protection\/\" rel=\"tag\">protection<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/security\/\" rel=\"tag\">security<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/virtual-machines\/\" rel=\"tag\">Virtual Machines<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/vm\/\" rel=\"tag\">VM<\/a><\/p>\n<table width='100%'>\n<tr>\n<td align=right>\n<p><b>(<a href='https:\/\/blog.malwarebytes.com\/101\/how-tos\/2017\/03\/torify-analyze-traffic-vm\/' title='Torify and analyze traffic for your VM'>Read more&#8230;<\/a>)<\/b><\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/td>\n<\/tr>\n<\/table>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\/101\/how-tos\/2017\/03\/torify-analyze-traffic-vm\/\">Torify and analyze traffic for your VM<\/a> appeared first on <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\">Malwarebytes Labs<\/a>.<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[10488,10378],"tags":[11171,10384,10432,714,10494,11586,11587],"class_list":["post-6919","post","type-post","status-publish","format-standard","hentry","category-malwarebytes","category-security","tag-how-tos","tag-network","tag-protection","tag-security","tag-threat-analysis","tag-virtual-machines","tag-vm"],"_links":{"self":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/6919","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/comments?post=6919"}],"version-history":[{"count":0,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/6919\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/media?parent=6919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/categories?post=6919"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/tags?post=6919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}