Inside Encryptodera

Before Reading

This writeup doesn't contain detailed explanation of everything and assumes you're already familiar with KQL. My assumption is that you completed Balloons Over Iowaarrow-up-right module, also answer queries are very self-explanatory. If you are looking for beginner friendly detailed writeup look into the post by Shinigami42arrow-up-right: KC7: Reflections on “Encryptodera” and Using It to Create a Professional Portfolioarrow-up-right

Challenge: Inside Encryptoderaarrow-up-right

0: KQL 101

Skipped

1: Offensive Odor

Question 1: What is Barry's role at the company?

Employees
| where name == 'Barry Shmelly'
| project role

Question 2: What is Barry's email address?

Employees
| where name == 'Barry Shmelly'
| project email_addr

Question 3: What was the subject of the interesting email (the one on January 16th) that Barry sent?

Question 4: What was the role of the employees that received Barry's email?

Question 5: What was the role of the recipient of that email?

Question 6: What's Barry's IP address? (Paste the full IP address )

Question 7: What was the complete URL that Barry was browsing on his computer regarding Cybersecurity Insiders on the afternoon of December 26th?(Paste the full url)

Question 8: What website did he visit first on January 15th? (Paste the full URL)

Question 9: Could you provide the full URL for the website Barry searched for USB Flash Drives?

Question 10: What "secret" document on business transactions did Barry download?

Question 11: What document (docx) did Barry download about salaries?

Question 12: What document (zip) did Barry download to get this?

Question 13: Do you know the password he used to zip the files?

Question 14: What is the name of the drive on which Barry stored the final files?

circle-info

Get events after 7z.exe was ran to see activity after.

Question 15: Type gotheem to take credit

Title, lol

2: Crypto Conquest

Question 1: What is the filename of this note?

From the image: YOU_GOT_CRYTOED_SO_GIMME_CRYPTO.txt

Question 2: What kind of attack is this?

Ransomwarearrow-up-right is a type of malware attack in which the attacker locks and encrypts the victim’s data, important files and then demands a payment to unlock and decrypt the data.

Question 3: On how many machines was this .txt file seen?

Question 4: What time was the ransom note first seen?

Question 5: What is the hostname of the system where the ransom note was first seen?

Question 6: How many files were encrypted on this machine?

First manually enumerate for anomalies in filenames and then narrow down:

Question 7: What is the extension that was used on the encrypted files?

We learned it from previous answer, Question 6.

Question 8: What command was run that references the ransomware extension?

Question 9: When did files_go_byebye.exe appear on this machine?

Question 10: How many commands were run on UL8R-MACHINE during this timeframe?

Query given:

Answer:

Question 11: What domain does the encoded PowerShell reference?

Question 12: What command is run right before the base64-encoded PowerShell?

Narrow down search with process_hash of malicious pwsh command and rows_neararrow-up-right for ease of finding nearby rows.

Question 13: How many devices ran the gpupdate /force command?

gpupdatearrow-up-right: Updates Group Policy settings.

Question 14: How many machines at Encryptodera ran "systeminfo"?

Question 15: What was the timestamp for the first time the command was run?

Question 16: How many days elapsed between when the attackers ran discovery commands and when the ransomware attack started?

First we need timestamps of when first enumeration and first exploitation happened, we can get them easily because we already encountered the commands to permform said actions.

datetime_diffarrow-up-right function can be used to calculate the delta between timestamps. toscalararrow-up-right function is used to convert dynamicarrow-up-right type to scalar AKA single value. printarrow-up-right operator can be used to show the output.

Question 17: What is the hostname of the device where the attackers first ran systeminfo?

Modify query from Question 15.

Question 18: What was the full commandline used by the threat actor when running nltest /dclist?

Given hostname: 41QI-LAPTOP

The nltest /dclist:<DomainName> command is a Windows command-line utility used to display a list of domain controllers in the specified domain. This command is particularly useful for troubleshooting and obtaining information about the domain controllers available in a given Active Directory domain.

  • nltestarrow-up-right: This is the main command-line utility for managing and troubleshooting aspects of Windows domains.

  • /dclist: This parameter is used to specify that the command should retrieve a list of domain controllers.

  • <DomainName>: Replace this with the actual name of the domain for which you want to obtain the list of domain controllers.

Question 19: What is the full name of the .xlsx.exe file on 41QI-LAPTOP?

Question 20: What file shows up a few seconds after the .xlsx.exe file? Enter the filename

circle-info

2024-02-01T08:50:22Z datetime from Question 19's answer.

Question 21: How many devices does screenconnect_client.exe appear on?

Question 22: Check the Email logs to see if the .xlsx.exe file was sent in a link. What email address was used to send this file?

Question 23: How many unusual emails were sent by Barry?

  1. We need to investigate emails after 2024-02-01 from Barry.

  2. As discussed from previous questions attackers hide extension by using double extension. For Windows we are looking for exe.

  3. Filter for only double extensions. e.g.: '*.docx.exe'

Question 24: Type got it once you've made a note of these recipients.

Title, lol

Question 25: What IP was used to sign in to Barry's account on February 1st?

Question 26: How many other accounts did that IP log into?

circle-exclamation

Question 27: How many IPs logged in to all 8 devices where the attacker ran systeminfo?

I hate how long this question took me to finally realize what it was asking...

Question 28: What is the role of the employee who this IP address belongs to?

Given IP: 10.10.0.138

Question 29: How many successful logins were made from this IP?

Question 30: What is the hostname of the server the attackers logged into?

Question 31: Pay Respects

f

3: F in the chat

Question 1: What username was used to log into the DOMAIN_CONTROLLER_SERVER?

Question 2: What laptop did the lihenry_domain_admin account sign into? (Enter the hostname)

Question 3: What is the MITRE ATT&CK ID for Mimikatz?

Mimikatzarrow-up-right is a credential dumper capable of obtaining plaintext Windows account logins and passwords, along with many other features that make it useful for testing the security of networks.

Question 4: Did the threat actor run mimikatz on this device? If so, enter the command line the attacker ran. If not, enter no

Question 5: Who does this device belong to? (Enter the employee's name)

Question 6: Was Valerie Orozco targeted in the phishing emails sent from Barry Shmelly?

Question 7: What is the name of the file that was sent to Valerie in the phishing email?

We learned it from Question 6 query.

Question 9: How many different user accounts logged into Valerie's machine?

Question 10: How many unique hosts did this user account attempt to log into?

Question 11: Which user NOT in an IT role was improperly using the systadmi_local_admin credentials? (This is likely a sign of compromise)

We are directly given an answer query.

Question 12: When was Robin phished by Barry Shmelly's account?

4: A Network Mystery

Question 1: Which IP address received the largest amount of data on Feb 5th?

Question 2: How many bytes of data were sent to that IP on the 5th?

We got information about this question from Question 2.

Question 3: When was data first sent to this IP? (paste the full timestamp)

Question 4: On how many distinct days have we sent data to this IP?

Extract only dates using format_datetimearrow-up-right and then count unique values.

Question 5: What service is used for the port to which this data is being transferred?

List of TCP and UDP port numbersarrow-up-right

Question 6: What is the total amount of data transferred to this IP address?

Question 7: How many distinct employees have sent data to this IP address?

Question 8: Whose name is linked to that IP address? Provide the employee's name.

Question 9: What is that employee's role?

We got information about this question from Question 8.

Question 10: We see her looking for the location of the companys __ __ __ __ (4 words)

Crypto Bruh indeed 🤣

Question 11: Who was Jane having a suspicious conversation with? (email address)

Privacy101...

Inside-Encryptodera-1

Question 12: What IP address did the boss man provide to help with smuggling the data?

Inside-Encryptodera-2

Bad henchmen... lol

Question 13: What is the name of the data exfil tool Jane downloads to help with her operation?

Question 14: What is the name of the crypto theft tool Jane downloads to help with her operation?

We got information about this question from Question 13.

Question 15: To what path does Jane point her data exfiltration tool?

If you filter ProcessEvents table for known filenames you will get no results and that's odd. The rogue employee must have used them somehow and we know it jane (username: jasmith). If you remember Barry he executed encoded payload with powershell, lets look into that.

Question 16: At what tempo does she set the tool to run? (one word)

We got information about this question from Question 15.

Question 17: What password does Jane use for the tool?

From Question 15 we can observe a different encoded payload being executed.

circle-info

The powershell code is first encoded in Base64 for first level of obfuscation and then it seems to be reversed, the command assembles command and executes it.

Last updated