Developing A Contained and User Emulated Malware Assessment Platform
Developing A Contained and User Emulated Malware Assessment Platform
∗ Security
and Network Engineering,
University of Amsterdam,
Email: {fpotter,shodzelmans}@os3.nl
† Deloitte,
Email: {vvanmieghem,hhambartsumyan}@deloitte.nl
F
Abstract—Penetration testers and red teams develop malware to sim- are not on-premise and therefore the uploader of the file
ulate real digital threats to organizations. In order to test which virus isn’t in control over where the uploaded file goes or who
scanners detect their malware before using it, they would like to test sees the data [2]. This can be a problem if the uploaded file
their malware, without risking sample submission to the AV vendors. contains private data.
Furthermore, they want to test their malware as if it was executed by
a user in a realistic way and within a controlled environment. In this
research, we investigate the kind of traffic that AV software generates, According to Debrie et al. [2] the Incident Response
how sample submission can be blocked and how the user behavior can and Malware Analysis (IRMA) platform provides an on-
be emulated. premise, open-source and automated malware analysis ser-
The traffic analysis showed various kinds of traffic, however sample
vice. IRMA allows the uploaded file to be contained within
submission wasn’t one of them. Since we didn’t observe any sample
submission, we can only speculate on the best approach to block this
the network of the organization, and therefore to stay in
traffic. Based on what we did observe, we recommend a whitelisting ap- control. However, one cannot be certain that the AV software
proach. When applying user emulation and direct scanning we observed doesn’t do sample submission. For example, Kaspersky
that the static analysis resulted in a higher detection rate. However, accidentally ended up with confidential NSA files [3]. These
the false positive rate was also higher. The dynamic analysis with user confidential files were part of a zipped folder, that also
emulation on the other hand has a lower detection rate, but doesn’t have had malicious binaries, and therefore was submitted to
any false positives. Another interesting observation was that in some Kaspersky.
cases a difference in on- or offline scanning can occur.
We conclude that triggering sample submission isn’t trivial, but sus-
pect that whitelisting would be the best approach to prevent it. We also Debrie et al. [2] state that IRMA can detect if a file is
showed that dynamic analysis can be automated using user emulation malware but doesn’t detect what the malware would do
and adds value besides static analysis. if the user executes it. Furthermore, IRMA allows the user
to be in control over the file, but doesn’t prevent the AV
Index Terms—Antivirus, traffic inspection, user emulation, malware software to learn the signature of the malicious content [2].
testing, red teaming
Testing which AV software detects the malware is useful for
red teams and penetration testers, because their malware
doesn’t harm the organization, but shows how vulnerabil-
1 I NTRODUCTION ities can be exploited by malicious parties in order to do
Nowadays malware is the main source of IT security threats harm to the organization. It is also usually the first step
[1]. Michalopoulus et al. [1] state that antivirus (AV) soft- in a simulated attack by a red team, and thus critical for
ware provides protection against malware, and therefore is the rest of the attack path. For these reasons, red teams
an important defense factor. In order to allow users and and penetration testers want to test whether their malware
organizations to check suspicious content, several online will be detected, without the AV software uploading a
malware analysis platforms (e.g. VirusTotal, Metascan, Ca- sample to the vendor. When sample submission occurs, AV
mal, Malwr and AVCaesar) have been developed [2]. These vendors will learn about the malware and add it to their
malware analysis platforms provide the option to upload database, ensuring that the malware gets detected. When
a file and scan it by multiple AV vendors. This gives the the malware created by the red team gets detected by the AV
advantage of being able to have a majority vote, whether the software, it becomes useless for them and severely disrupts
file is malicious or not. However, these malware platforms the simulated attack.
3 R ESEARCH QUESTION
With IRMA providing an on-premise solution for malware
analysis, we want to examine the traffic generated by AV
software to prevent malware sample submission and create
a test environment for red teams and penetration testers.
Furthermore, we want to emulate browsing user behavior
to allow on-access scanning of malware. Therefore, we
conducted the following research question:
4.1 Test environment AV traffic According to the National Cyber Security Centre (NCSC)
[15] a tool such as mitmproxy could prevent applications,
The test environment of the AV traffic generation is shown e.g. AV software, from connection with the server. This
in figure 2. The test environment will consist of a Virtual happens when a client only trusts a specific certificate from
Machine (VM) running the latest 64 bit Windows 10 as a server (i.e. certificate pinning). However, when a client is
the client and will contain the AV software. Another VM under full control, it is possible to bypass certificate pinning
running Ubuntu 18.04 (latest Long Term Support) with [13].
mitmproxy [13] will be used to intercept the traffic. For each According to Evans et al. [16] certificate pinning has
AV vendor a separate Windows VM will be created, and been developed to avoid MITM attacks. Certificate pinning
only one VM is run at a time to ensure traffic belongs to a is done by storing a copy of the certificate or the fingerprint
certain AV product. Furthermore, the Windows VM has one of the certificate in the client application. Whenever the
internal network adapter that is connected to the Ubuntu client initiates the SSL handshake with certificate pinning,
VM. The Ubuntu VM also has a second external network it performs two steps. The first step is checking whether the
adapter to provide network access through Network Ad- server certificate is issued by a trusted Certificate Authority
dress Translation (NAT). (CA). The second step is added by certificate pinning, and
verifies if the certificate of the server or a certificate higher in
the chain (i.e. one of the issuer’s certificates) matches with
the certificate or the fingerprint of the certificate stored in
the client application. If both steps were successful, the SSL
session is established. However, if the checking of the server
Fig. 2. Man-In-The-Middle Proxy test environment certificate or the pinning process fails, the session will not
be established.
Oppliger et al. [14] state that ’most e-commerce appli- Certificate pinning brings the risk of service unavailabil-
cations are using Secure Socket Layer (SSL) or Transport ity (i.e. when the pinning process fails). The Fraunhofer
Layer Security (TLS) to protect the communication channel Institute for Communication, Information Processing and
6 D ISCUSSION
During our research we were unable to observe sample sub-
mission. A possible explanation can be found on the website
of Symantec [23]. They state on their website: ’If a client gets
a detection, the client queries Symantec to see if a sample is
needed (that is, no formal definition created for this item
Fig. 7. Process Monitor manual yet). If a sample is not needed because a formal definition
is already created, the client will not submit the sample’.
Unfortunately, as the examined AV programs are all closed
source, it is hard to know what exactly triggers a sample
upload. Testing unknown malware is not a guarantee, as
our research showed.
Another possible explanation for not observing sample
submission, could be due to the test environment being
virtualized. The malware or AV software may work differ-
ently when in a virtualized environment in comparison to a
physical environment with dedicated hardware. However,
Fig. 8. Process Monitor user emulation the samples provided by Deloitte will run regardless of
which environment they are on.
Also, our packet captures were quite contaminated by
many calls which were made by Windows and when we
TABLE 1
Das Malwerk malware samples
TABLE 2
Deloitte malware samples
TABLE 3
Static and Dynamic analysis of the AV vendors
Number Malware samples harmful Symantec S Symantec D Trend Micro S Trend Micro D McAfee S McAfee D
1 1c9877e3-414b-11e8-9653 TP v x v x x x
2 1e84ff45-414b-11e8-b837 TP v v v v v x
3 1f7b55c7-414b-11e8-b18b TP v v v v v v
4 20db5785-414b-11e8-b3a7 TP v v v v x x
5 21f5d45c-414b-11e8-bfe9 TP v v v v x x
6 230a6f87-414b-11e8-a52a TP v v v x x x
7 266a11f5-414b-11e8-9ac8 TP v v v v x x
8 2473c2ca-414b-11e8-8f4a TP v v v v x x
9 2830f25c-414b-11e8-8ff2 TP v v v v x x
10 25786c51-414b-11e8-a472 TP v v v v x x
11 Artemis TP v v v v v x
12 Win32.AgentTesla TP v v v v v v
13 Win32.Unknown SpectreMeltdown TP v x v x v x
14 Win32.Unnamed SpecMelt TP v x x x v x
15 Win32.Vobfus TP v v v v v x
16 Win32.WannaPeace TP v v v v v x
17 Win32.Zurgop TP v v x v v x
18 Win32Dircrypt.Trojan.Ransom.ABZ TP v v v v v v
19 Win64.Trojan.GreenBug TP v x v v x x
20 binary search.exe FP x x x x x x
21 blaster.exe FP v x v x v x
22 bubble sort.exe FP x x x x x x
23 cairuh.exe FP v x x x x x
24 epo.exe FP x x x x x x
25 huffman.exe FP x x x x x x
26 hunatcha.exe FP x x x x x x
27 matrix multiple.exe FP x x x x x x
28 netsky1.exe FP v x v x x x
29 netsky2.exe FP v x v x x x
30 netsky3.exe FP x x x x x x
31 netsky4.exe FP x x x x x x
32 newstar.exe FP x x x x x x
33 newstar-infect.exe FP v x x x x x
34 tinyRISC-binary search.exe FP x x x x x x
35 eicar.com FP v x v x v x
36 eicar.com.txt FP v x v x v x
37 eicar com.zip FP v x v x v x
38 eicar com2.zip FP v x v x v x
C.2 Symmantec
C.3 Trendmicro
C.4 Kaspersky
C.5 Common
app = pywinauto.Application(backend=’uia’).connect(path=’explorer’)
app.Program manager.desktop.Microsoft edge.click input(double=True)
time.sleep(1)
edge app = pywinauto.Application(backend=’uia’).connect(title re=’.* Microsoft Edge’)
p.FAILSAFE = True
p.PAUSE = 1
class iexplorer(object):
def open iexplorer(self):
webbrowser.open(’http://192.168.3.1:8000’)
time.sleep(1)
smartscreen = p.locateOnScreen(r’C:/Users/RP1/Pictures/smartscreen.png’)
if smartscreen:
coordinates=[]
for x in smartscreen:
coordinates.append(x)
p.moveTo(coordinates[0], coordinates[1], duration=0.5)
p.click(clicks=1, button=’left’)
browser = iexplorer()
browser.open iexplorer()
browser.select sample sample(150,225)
browser.download malware()
browser.open folder()
browser.run file()