Carbon Black query that can be use to detect if any MSHTML RCE happened (probably need to be refined more):
((process_cmdline:control.exe AND ((process_cmdline:*.inf AND process_cmdline:AppData) OR (process_cmdline:*.cpl AND process_cmdline:../)) AND -process_cmdline:*\icedrive\*) OR ((hash:6EEDF45CB91F6762DE4E35E36BCB03E5AD60CE9AC5A08CAEB7EDA035CD74762B OR hash:938545f7bbe40738908a95da8cdeabb2a11ce2ca36b0f6a74deda9378d380a52) OR (parent_hash:6EEDF45CB91F6762DE4E35E36BCB03E5AD60CE9AC5A08CAEB7EDA035CD74762B OR parent_hash:938545f7bbe40738908a95da8cdeabb2a11ce2ca36b0f6a74deda9378d380a52) OR (filemod_hash:6EEDF45CB91F6762DE4E35E36BCB03E5AD60CE9AC5A08CAEB7EDA035CD74762B OR filemod_hash:938545f7bbe40738908a95da8cdeabb2a11ce2ca36b0f6a74deda9378d380a52)))
Search if any assets making connections towards IOCs (known IOCs as of 9 Sept):
netconn_domain:joxinu.com OR netconn_domain:pawevi.com OR netconn_domain:macuwuf.com
According to the article, it was known as “Compilation of Many Breaches” (COMB). This data was leaked on a popular hacking forum. It contains billions of user credentials from past leaks from Netflix, LinkedIn, Exploit.in, Bitcoin and more. This leak contains email and password pairs.
Inside the data dump, it was structured something like this:
So I’m wondered… What if we extract either email or password only from all those files? We can maybe create a password list from that. Or we can analyze the password trend. See what’s the top password being used & stuff.
So… We’re not going thru all hundreds of files which total up 100GB+ to extract the password manually… That’s crazy ma man!
To make it easier, I’ve created a Python script to extract the password from all dump file recursively. The code as below:
from timeit import default_timer as timer
from datetime import timedelta
inputfile = "/Desktop/test/data" #change this to your dump files locations
outputfile = open("extracted_password.txt", "w")
start = timer()
for path, dirs, files in os.walk(inputfile):
for filename in files:
fullpath = os.path.join(path, filename)
with open(fullpath, "r") as f:
for line in f:
email, password, *rest = line.split(":")
outputfile.write("%s" % password)
end = timer()
print("Time Taken: ", end='')
Save the code above & run the script:
$ python password_extractor.py
It may takes some times depending on your hardware resources and dump file size. You should see output something like this after the script completed execution:
When completed, you should see a new file named “extracted_password.txt” being created. Inside it contains all the password from all dump file; consolidated into 1 single big ass file.
Now we can start analyzing the password pattern. We can use this command below to see what’s the top 10 password:
$ time sort extracted_password.txt | uniq -c | sort -bgr | head -10
F:\Tools> .\vmss2core-sb-8456865.exe -W 'F:\INC\<REDACTED>\<REDACTED>.vmss'
vmss2core version 8456865 Copyright (C) 1998-2017 VMware, Inc. All rights reserved.
region: start=0 end=c0000000.
region: start=100000000 end=240000000.
Cannot translate linear address 0.
... 10 MBs written.
... 20 MBs written.
... 8180 MBs written.
... 8190 MBs written.
Finished writing core.
After it finished, it will create a file named memory.vmem.
There you have it. So you can start doing your memory analysis using volatility if you want.
For example, here we’ll be using volatility in order to find out the profile for which .vmem is created.
$ python vol.py -f memory.dmp imageinfo
Volatility Foundation Volatility Framework 2.6.1
INFO : volatility.debug : Determining profile based on KDBG search...
Suggested Profile(s) : Win7SP1x64, Win7SP0x64, Win2008R2SP0x64, Win2008R2SP1x64_24000, Win2008R2SP1x64_23418, Win2008R2SP1x64, Win7SP1x64_24000, Win7SP1x64_23418
AS Layer1 : WindowsAMD64PagedMemory (Kernel AS)
AS Layer2 : VirtualBoxCoreDumpElf64 (Unnamed AS)
AS Layer3 : FileAddressSpace (/home/memory.dmp)
PAE type : No PAE
DTB : 0x187000L
KDBG : 0xf800028530a0L
Number of Processors : 1
Image Type (Service Pack) : 1
KPCR for CPU 0 : 0xfffff80002854d00L
KUSER_SHARED_DATA : 0xfffff78000000000L
Image date and time : 2019-12-23 17:42:50 UTC+0000
Image local date and time : 2019-12-23 11:42:50 -0600
We have captured a file being transferred over the network, can you take a look and see if you can find anything useful?
Hint: External tools like CyberChef can help decode the data.
Download & extract the file. You’ll see named “nm01.pcapng“
Open the pcap file using Wireshark. Usually, I sort frame with large “Length” number and view the content.
On Frame 4 – right click – click “Follow” – click “TCP stream”
hmm.. this “SecurePa55word8!” seems interesting. I tried to submit it as flag, but it says wrong..
So, I viewed another large frame, on Frame 26. I saw there’s string “7z“. I thought, it could be a 7z file. I took the hex number; “37 7a” & search on Google. Based on this site – https://www.filesignatures.net/index.php?page=search&search=377ABCAF271C&mode=SIG, it is confirm that this is indeed a 7z file.
So, on the same frame 26, right click and follow TCP stream. It will show you the stream/content of it. At bottom of the stream, on options “Show and save data as“, change it to “Raw”.
Click “Save as…” and save it as name you like – in this example, I’ll name it as “7out“.
When I open the file, there’s folder named “FLAG” and inside it contain file named “Flag.txt”. It’s password protected when we tried to view it.
So, maybe we can use the string/password that we discover earlier:
It works! The flag is “capturing_clouds_and_keys” .
Recently, we have an incident where suspicious traffic was observed related to external C2. Initial finding found that this IP 188.8.131.52 (184.108.40.206/21) resolved to atakai[-]technologies[.]host; according to pDNS in Virustotal .
The result, we have 2048 addresses; IP address range between 220.127.116.11-18.104.22.168.
Next, we using online tool named Reverse IP & DNS API from WhoisXML API. Function of this tools is to reveals all domains that share an IP address. Example as below:
To use this tools, we need to buy credit to leverage its API. As for free account, you only have 100 credit to be use on Domain Research Suite tools. But on this case, we need around 2050 credit. Based on their website, 1000 DRS credits = $19.00. So.. yeah..
After you have enough credit, you can use the script as below:
for i in $(cat ip.txt); do
content="$(curl -s "$url$i")"
echo "$content" >> output.txt
Remember to put your API key into the script. It will basically produce result into “output.txt“.
After that, import you result into Excel. Then, we sort and select possible domains from the output based on domain naming convention; e.g. atakai, amatai, amamai:
Now we have possible suspected IPs & domains. To further digging, we’ll leverage Shodan.io to see what are the open port available for those IPs.
Now we know 7/11 (no pun intended) IPs been observed by Shodan having port 50050 opened. This indicate that this set of IPs possibly used part of Cobalt Strike infra.
Next step is we can search for date registration for each domain from Whois data. But I’m too lazy to continue this. Also I’ve encountered where several Whois provider giving different info regarding of domain registration date. So yeah, maybe I’ll update next time when I’m free 😉