Introduction
Today, I decided I was going to write my first Blue Team Report for the blog. We'll be looking at a BTLO Lab called "Follina", before we begin I cannot tell you how important it is to run these malware samples inside a Virtual Machine that is isolate and not connected to the open internet. I loaded up a Kali machine for this Lab and copied the sample over for analysis. In this post I will be creating a walkthrough of the enviroment and my conclusion on the analysis. Thank you for reading this, let us begin.
Follina Report - RCE Vulnerability
Scenario
On a Friday evening when you were in a mood to celebrate your weekend, your team was alerted with a new RCE vulnerability actively being exploited in the wild. You have been tasked with analyzing and researching the sample to collect information for the weekend team.
Walkthrough
The lab's first question asked me to find the SHA1 hash value of the "Sample.doc". My intial reaction was to load a tool that could extract the value, in a split second I thought "I can just look at the properties." So I did. When loading the properties of sample.doc I was able to look at the checksums. Which revealed a few different things.
- SHA1: 06727ffda60359236a8029e0b3e8a0fd11c23313
- SHA256: 4a24048f81afbe9fb62e7a6a49adbd1faf41f266b5f9feecdceb567aec096784
- MD5: 52945af1def85b171870b31fa4782e52
- CRC32: b8852801
Question 1) What is the SHA1 hash value of the sample? (Format: SHA1Hash)
Answer: SHA1- 06727ffda60359236a8029e0b3e8a0fd11c23313
For the second question of the lab we will be heading over to VirusTotal where we can analyze the file for any malicous script(you can find that report here).
Question 2 asks us: According to VirusTotal, what is the full filetype of the provided sample? (Format: X X X X)
We'll head over to the details portion of the scan to grab the filetype of the malware sample we were given(details here). Here we can find that the filetype is Office Open XML Document. Once we find the filetype we can head back over to the Follina Lab and submit our answer.
Question 3 asks us: Extract the URL that is used within the sample and submit it (Format: https://x.domain.tld/path/to/something)
For this section of the lab we'll load up our terminal and use "bulk_extractor" using the command 'bulk_extractor -o /home/kali/Desktop/sample sample.doc'. Once it spits out the output into the directory we will be able to see everything that was compiled into the word document.
Once bulk_extractor pulled the data we were able to see files labeled: url.txt, tcp.txt, domains.txt. Most of these text files were empty. Let's focus on the "url.txt" file for a minute. The file has over 90 lines, we're not going to go through each one individually. So here is what we are going to do. We'll use a built-in command line tool called "grep".
Using cat:
6947-ZIP-577 http://schemas.microsoft.com/office/word/2018/wordml cid" xmlns:w16="http://schemas.microsoft.com/office/word/2018/wordml" xmlns:w16se="h
6947-ZIP-644 http://schemas.microsoft.com/office/word/2015/wordml/symex l" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" mc:Ignorable="
7304-ZIP-75 http://schemas.openxmlformats.org/drawingml/2006/main :theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office T
7304-ZIP-6605 http://schemas.microsoft.com/office/thememl/2012/main ly xmlns:thm15="http://schemas.microsoft.com/office/thememl/2012/main" name="Office T
8884-ZIP-79 http://schemas.openxmlformats.org/package/2006/relationships ionships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"> 8884-ZIP-171 http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings" Target="webSet
8884-ZIP-308 http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" Target="settin
8884-ZIP-439 http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles
8884-ZIP-568 http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject ="rId996" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject" Target="https:
9252-ZIP-79 http://schemas.openxmlformats.org/package/2006/relationships ionships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"> 9252-ZIP-171 http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docPro
8884-ZIP-655 https://www.xmlformats.com/office/word/2022/wordprocessingDrawing/RDF842l.html Object" Target="https://www.xmlformats.com/office/word/2022/wordprocessingDrawing/RDF842l.html!" TargetMode="E
9252-ZIP-317 http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docPro
8884-ZIP-789 http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme Id="rId5" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/
8884-ZIP-921 http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable" Target="fontTa
9252-ZIP-462 http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/d
4022-ZIP-77 http://schemas.openxmlformats.org/markup-compatibility/2006 tyles xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:r="http:
4022-ZIP-147 http://schemas.openxmlformats.org/officeDocument/2006/relationships /2006" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:w="http:
4022-ZIP-225 http://schemas.openxmlformats.org/wordprocessingml/2006/main ships" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="htt
4022-ZIP-298 http://schemas.microsoft.com/office/word/2010/wordml ain" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="htt
4022-ZIP-363 http://schemas.microsoft.com/office/word/2012/wordml dml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cex="
4022-ZIP-431 http://schemas.microsoft.com/office/word/2018/wordml/cex " xmlns:w16cex="http://schemas.microsoft.com/office/word/2018/wordml/cex" xmlns:w16cid="
4022-ZIP-503 http://schemas.microsoft.com/office/word/2016/wordml/cid " xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16="htt
4022-ZIP-572 http://schemas.microsoft.com/office/word/2018/wordml cid" xmlns:w16="http://schemas.microsoft.com/office/word/2018/wordml" xmlns:w16se="h
4022-ZIP-639 http://schemas.microsoft.com/office/word/2015/wordml/symex l" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" mc:Ignorable="
This is a snippet from line 75-99. Using cat we can see every single line of the url.txt file. Once we move onto "grep" we can start to single out lines.
Using grep: grep "https" url.txt
8884-ZIP-568 http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject ="rId996" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject" Target="https:
8884-ZIP-655 https://www.xmlformats.com/office/word/2022/wordprocessingDrawing/RDF842l.html Object" Target="https://www.xmlformats.com/office/word/2022/wordprocessingDrawing/RDF842l.html!" TargetMode="E
We get these two urls. Did you notice every single url before and after these two were all "http"? Weird, huh? "8884-ZIP-655" looks to be a rogue HTML file. Let's go back to VirusTotal and make sure by completing a url scan(scan check here). After completing that scan we can see the malware. I submitted it to the lab, passed the check and contiued on.
Question 4) What is the name of the XML file that is storing the extracted URL?
It's actually pretty hilarious that I didn't find the payload inside an xml filetype. I found it in the url.txt. So for this we have to dig deeper bulk_extractor pulled a folder called "zip". When we cd into the folder we also get a 000 directory. That directory has the xml files inside of it. So what do we do? We use grep or find. I did this the hard way and manually went through every .xml file in the directory. I ended up finding our malicious string in the 8884-ZIP-0_word__rels_document.xml.rels.
Target="https://www.xmlformats.com/office/word/2022/wordprocessingDrawing/RDF842l.html!" TargetMode="External"/>