# SUNNYSTATION

In this blog I will explain how I solved the exercise called [Sunnystation](https://www.malware-traffic-analysis.net/2022/02/23/index.html). You can find it on the [Malware Traffic Analysis](https://www.malware-traffic-analysis.net/index.html) site which provides very good material to practice this kind of skills.

Each exercise presents us with a scenario where we are given information about the network, a description of the case for context, in addition to samples which in this case is a traffic capture, and the challenge is to answer a series of questions that the author provides.

For this exercise we have the task of answering the following questions:

1. What hosts/user account names are active on this network?
2. What type of malware are they infected with?

For the first question there are several methods to obtain hostnames and users. Currently most networks make use of DHCP to assign IP to the endpoints, there are protocols that provide related information such as NetBios Name Service, traffic that is not encrypted as HTTP could we see the traffic related to some authentication, etc. You can follow this [tutorial](https://www.malware-traffic-analysis.net/2013/09/21/index.html).

![NBNS Traffic.](https://4102237612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7cRwoSIbLIaz6kbFc5%2Fuploads%2F8VTn3P7lQIvxGbmeX8ix%2Fimage.png?alt=media\&token=2f2fe7d5-5367-4d00-acfa-99d195196d42)

![DHCP Requests.](https://4102237612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7cRwoSIbLIaz6kbFc5%2Fuploads%2FiIm2QrJO1LLpHSjBUOxR%2Fimage.png?alt=media\&token=1212e0e2-4a42-499d-bef6-f72af238701f)

Because we detect the existence of NBNS and that most likely they are Windows machines, we can see SMB traffic in case any computer needs to access a resource and authentication is required. With the filters applied above we have detected the active computers and we have information such as IP and Hostname which can help us to search for more specific traffic.

In this case we have used a filter to look for traffic from this 172.16.0.131 machine and involving port 445. We have detected an SMB2 packet called [Session Setup Request](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-smb2/5a3c2c28-d6b0-48ed-b917-a86b2ca4575f), which is sent by the client to request a new session to a Server.

![User Account for Host 172.16.0.131 ](https://4102237612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7cRwoSIbLIaz6kbFc5%2Fuploads%2FcZREDB6pEb9lkgJuUOQN%2Fimage.png?alt=media\&token=d1d5bc52-772d-4dbf-97d7-046e3e9e933c)

For the last two devices, applying the same filter as the previous one, we find a packet called [Tree Connect Request](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-smb2/832d2130-22e8-4afb-aafd-b30bb0901798) which is basically sent by a client to request access to a share. With the above findings we would have the answer to the first question in the table below.

![User Account for Host 172.16.0.170](https://4102237612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7cRwoSIbLIaz6kbFc5%2Fuploads%2FJFDp1XZSQVfgjJkdpJN4%2Fimage.png?alt=media\&token=e25955cd-4eaa-41a4-a036-e9880cdd3a7e)

![User Account for Host 172.16.0.149](https://4102237612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7cRwoSIbLIaz6kbFc5%2Fuploads%2F1XDyu4xiKIjVUY4p1Xtq%2Fimage.png?alt=media\&token=98b33b52-7817-4a9e-b77e-4ad1da0889c3)

```
IP:Hostname:User Account
172.16.0.131:DESKTOP-VD15107:tricia.becker
172.16.0.170:DESKTOP-W5TFTQY:everett.french
172.16.0.149:DESKTOP-KPQ9FDB:nick.montgomery
```

For the second and last question we will be investigating host by host traffic to detect suspicious activity.

Host - 172.16.0.131:DESKTOP-VD15107

When investigating HTTP traffic from this computer we detected connections to different sites but with the same pattern looking for a base 64 encoded resource in the uar3 path. When we started to review the information about them we detected that they are related to the loader called [XLoader](https://tria.ge/220228-tcsdeseeh5) formerly known as [FormBook](https://www.mcafee.com/blogs/internet-security/3-tips-to-protect-yourself-from-xloader-malware/).

![](https://4102237612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7cRwoSIbLIaz6kbFc5%2Fuploads%2FmwRF6j6yA1yIMrKFlkEZ%2Fimage.png?alt=media\&token=de177baa-e1b2-4316-8701-64151a161f11)

Host - 172.16.0.170:DESKTOP-W5TFTQY

When I started to check the HTTP traffic I detected that the traffic content was kind of obfuscated as you can see in the yellow underlined part. When I investigated the domain I found reports that associated it to a C2 of [dridex](https://twitter.com/reecdeep/status/1335923885812879360) and [emotet](https://maltiverse.com/ip/27.254.174.84). It is known that this type of malware usually use HTTPS for the initial phase so I proceeded to review the traffic. Later we found the following domain dalgahavuzu.com, which upon investigation we [found](https://urlhaus.abuse.ch/host/dalgahavuzu.com/) that it was associated with emotet and that it was used to download a DLL, which could be the first stage of the infection. In conclusion, as can be seen in the time of the packages, first the DLL was downloaded and then the obfuscated C2 traffic.

![Emotet C2 Traffic.](https://4102237612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7cRwoSIbLIaz6kbFc5%2Fuploads%2FTd41HlbYzdMJUYxg9dG3%2Fimage.png?alt=media\&token=83bda671-c1fb-4a5b-bcd7-93f16c8abe6f)

![Download DLL associated with Emotet.](https://4102237612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7cRwoSIbLIaz6kbFc5%2Fuploads%2FCsX9a2JlH6bkAQNeJSw2%2Fimage.png?alt=media\&token=896961d1-bc0b-4672-9517-9d97777870ba)

Host - 172.16.0.149:DESKTOP-KPQ9FDB

This one was a little easier to identify the infection. When reviewing the HTTP traffic I detected the download of a dll and as you can see there was first a GET and then a response with code 200 so we can conclude that it was a successful download. When investigating the domain I [found](https://tria.ge/220224-dsr5labgg7) a report that associates the domain and the downloaded dll to emotet. The traffic presents the same behavior as the previous one, a download of a dll and then the obfuscated C2 traffic.

![](https://4102237612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7cRwoSIbLIaz6kbFc5%2Fuploads%2FdI8HgK1i4dxxokvvhtAy%2Fimage.png?alt=media\&token=96cd0a38-61b3-4843-b582-580f9a1c4713)

The evidence gathered is sufficient to conclude that there is an infection and to proceed with the remediation of the equipment. The table below summarizes the host and what malware they are infected with, which would be the answer to the second question.

```
172.16.0.131 - XLoader
172.16.0.170 - Emotet
172.16.0.149 - Emotet
```

Finally I would like to thank [Brad](https://twitter.com/malware_traffic) for the effort in sharing material for the community.

I Hope you enjoy it and feel free to get in touch with me if you have any questions or suggestions.
