CyberDefenders / ARTICLE

TeamSpy Lab

Lab solution ahead. This writeup contains answers and investigation steps for a CyberDefenders training challenge.

بسم الله والصلاة والسلام على رسول الله
اللهم علمنا ما ينفعنا وانفعنا بما علمتنا وقنا عذاب النار

challenge link :

https://cyberdefenders.org/blueteam-ctf-challenges/teamspy/


Scenario: An employee reported that his machine started to act strangely after receiving a suspicious email with a document file. The incident response team captured a couple of memory dumps from the suspected machines for further inspection. As a soc analyst, analyze the dumps and help the IR team figure out what happened!

Resources:http://www.reconstructer.org/papers _Analyzing%20MSOffice%20malicious file%20with%20OfficeMalScanner.zip

https://github.com/volatilityfoundation/volatility/wiki/Command%20Reference


TeamSpy Malware

https://digital.nhs.uk/cyber-alerts/2017/cc-1498


File->ecorpoffice What is the PID the malicious file is running under?

normal : \
parent : vmtoolsd.exe\
child : cmd.exe

malicious : skypec2AutoUpd.exe → 1364\
It is associated with malware, specifically a version of the TeamSpy trojan, which abuses the TeamViewer remote access tool. The file’s name is designed to deceive users into believing it is a harmless, legitimate updater

ans → 1364


File->ecorpoffice What is the C2 server IP address?

I found the process skypec2AutoUpd.exe establishing a connection between two IPs, one of which is a public IP. The public IP is using port 80, so this is most likely an attacker-controlled web server the C2 is using to download its malware.

ans → 54.174.131.235


File->ecorpoffice What is the Teamviewer version abused by the malicious file?

“From the article link I shared above:\
The attack chain begins with a spam email containing a .zip attachment. If a user opens the zip archive, it executes the included .exe, which drops the TeamSpy malware onto the victim’s system as a malicious DLL.\
If the TeamSpy malware is being downloaded from the C2 server, we’ll filter by the IP we identified and determine the malware version.”

ans → 0.2.2.2


File->ecorpoffice What password did the malicious file use to enable remote access to the system?

EditBox is a Volatility plugin that extracts the text stored in Windows GUI Edit controls (i.e., textboxes) from a memory image things like Notepad contents, form fields, URLs, even some credential text left in textboxes or undo buffers.

GitHub – bridgeythegeek/editbox: EditBox is a plugin for the Volatility Framework. It extracts the…\
EditBox is a plugin for the Volatility Framework. It extracts the text from Windows Edit controls, that is, textboxes…github.com

ans → P59fS93m


File->ecorpoffice What was the sender's email address that delivered the phishing email?

“First, I need to determine the PID of outlook.exe.”

After that, we’ll dump the process so we can analyze it.\
python2 vol.py -f “/home/kali/Desktop/win7ecorpoffice2010–36b02ed3.vmem” — profile=Win7SP1x64 memdump -p2692 — dump-dir .

We’ll use regex to extract all the emails from this process.

I suspected this domain, so I’ll investigate it further.

ans → KARENMILES@T-ONLINE.DE


File->ecorpoffice What is the MD5 hash of the malicious document?

The first thing I did was use the file scan plugin and filter by .doc, .docx, and .pdf to see if I could find anything useful.

But I found them in the Downloads folder, so I don’t think they’ll lead us to anything, since the attacker used the .doc file in the phishing campaign. It’s more likely stored in the Outlook files, so I’ll look for any .ost or .pst files, extract all the attachments inside them, and analyze them.

We found PST files but no OST files, so we’ll start by dumping the first PST file.

I placed them in a folder and renamed them to file_1.pst and file_2.pst.

There’s a tool called pffexport you give it the PST or OST file and it extracts everything inside: attachments, spam, everything, and that’s the one I’ll use.

ans → c2dbf24a0dc7276a71dd0824647535c9


File->ecorpoffice What is the bitcoin wallet address that ransomware was demanded?

ans → 25UMDkGKBe484WSj5Qd8DhK6xkMUzQFydY


File->ecorpoffice What is the ID given to the system by the malicious file for remote access?

TeamViewer usually store their IDs in memory , so we can use editbox plugin extracts the text or entry stored in this app ( id in this case )

python2 vol.py -f /home/kali/Desktop/win7ecorpoffice2010–36b02ed3.vmem — profile=Win7SP1x64 editbox

ans → 528 812 561


File->ecorpoffice What is the IPv4 address the actor last connected to the system with the remote access tool?

We’ll dump the skypec2AutoUpd process we should find all the connections made through it, and then use regex to extract the IPs.

ans → 31.6.13.155


File->ecorpoffice What Public Function in the word document returns the full command string that is eventually run on the system?

olevba tool : extract the VBA macros from the document and review the code to identify any functions that execute commands.

python3 -m venv ~/oletools-env
~/oletools-env/bin/python -m pip install --upgrade pip setuptools
~/oletools-env/bin/pip install oletools

~/oletools-env/bin/olevba /home/kali/Desktop/1_bank_statement_088452.doc
# out_put

ans → UsoJar


File->ecorpwin7 What is the MD5 hash of the malicious document?

To be honest, this question is extremely confusing. First, I used the filescan plugin and extracted the PST files to inspect all attachments, and found an RTF file inside. Unfortunately it was empty, but that suggested there might be additional RTF files , especially since the filename starts with the number “1”, which implies there are more files.

I tried to check for any RTF files, dump them, and compute their hashes.

After a lot of struggle it said the answer was wrong; when I calculated the hash of the RTF file I found null bytes at the end, so I removed them and recalculated the hash.

perl -0777 -pe ‘s/\x00+$//’ file.None.0xfffffa80040b3260.dat > file.None.0xfffffa80040b3260.dat.trimmed

ans → 00e4136876bf4c1069ab9c4fe40ed56f


File->ecorpwin7 What is the common name of the malicious file that gets loaded?"

I suspected it might be a DLL or EXE, so I first filtered for DLLs and noticed a suspiciously named test.dll. I’ll dump that with dlldump, but first you should list all DLLs with dlllist so you know which specific DLL to dump.

ans → plugx


File->ecorpwin7 What password does the attacker use to stage the compressed file for exfil?

First I inspected the process tree with pstree to identify the parent of the rundll32 instance that loads test.dll, so I could dump and analyze it.\
I found svchost, so I dumped it and started searching inside for the string password. Since we’re hunting for a password for an archive, the relevant strings are encoded in UTF-16LE you’ll often find paths, function names, error messages, or commands stored inside the process.

ans → password1234


File->ecorpwin7 What is the IP address of the c2 server for the malicious file?

ans → 52.90.110.169


File->ecorpwin7 What is the email address that sent the phishing email?

ans → lloydchung@allsafecybersec.com


File->ecorpwin7 What is the name of the deb package the attacker staged to infect the E Coin Servers?

ans → linuxav.deb


سبحانك اللهم وبحمدك أشهد أن لا إله إلا أنت أستغفرك وأتوب إليك
← All journal articles
Scroll to Top
Home