Blog
/
Network
/
January 17, 2024

Detecting Trusted Network Relationship Abuse

Discover how Darktrace DETECT and the SOC team responded to a network compromise via a trusted partner relationship with this case study.
Inside the SOC
Darktrace cyber analysts are world-class experts in threat intelligence, threat hunting and incident response, and provide 24/7 SOC support to thousands of Darktrace customers around the globe. Inside the SOC is exclusively authored by these experts, providing analysis of cyber incidents and threat trends, based on real-world experience in the field.
Written by
Adam Potter
Senior Cyber Analyst
Written by
Taylor Breland
Analyst Team Lead, San Francisco
Default blog imageDefault blog imageDefault blog imageDefault blog imageDefault blog imageDefault blog image
17
Jan 2024

Trusted relationships between organizations and third parties have become an increasingly popular target for cyber threat actors to gain access to sensitive networks. These relationships are typically granted by organizations to external or adjacent entities and allow for the access of internal resources for business purposes.1 Trusted network relations can exist between constituent elements of an overarching corporation, IT-service providers and their customers, and even implicitly between IT product vendors and their customers.

Several high-profile compromises have occurred due to the leveraging of privileged network access by such third parties. One prominent example is the 2016 DNC network attack, in which the trust between the Democratic Congressional Campaign Committee (DCCC) and the Democratic National Committee (DNC) was exploited. Supply chain attacks, which also leverage the implicit trust between IT vendors and customers, are also on the rise with some estimates projecting that by 2025, almost half of all organizations will be impact by supply chain compromises.2 These trends may also be attributed to the prevalence of remote work as well as the growth in IT-managed service providers.3

Given the nature of such network relationships and threat techniques, signatures-based detection is heavily disadvantaged in the identification and mitigation of such trust abuses; network administrators cannot as easily use firewalls to block IPs that need access to networks. However, Darktrace DETECT™, and its Self-Learning AI, has proven successful in the identification and mitigation of these compromises. In September 2023, Darktrace observed an incident involving the abuse of such a trusted relationship on the network of a healthcare provider.

Attack Overview

In early September 2023, a Darktrace customer contacted the Darktrace Security Operations Center (SOC) through the Ask the Expert™ (ATE) service requesting assistance with suspicious activity detected on their network. Darktrace had alerted the customer’s security team to an unknown device that had appeared on their network and proceeded to perform a series of unexpected activities, including reconnaissance, lateral movement, and attempted data exfiltration.

Unfortunately for this customer, Darktrace RESPOND™ was not enabled in autonomous response mode at the time of this compromise, meaning any preventative actions suggested by RESPOND had to be applied manually by the customer’s security team after the fact.  Nevertheless, Darktrace’s prompt identification of the suspicious activity and the SOC’s investigation helped to disrupt the intrusion in its early stages, preventing it from developing into a more disruptive compromise.

Initial Access

Darktrace initially observed a new device that appeared within the customers internal network with a Network Address Translated (NAT) IP address that suggested remote access from a former partner organization’s network. Further investigation carried out by the customer revealed that poor credential policies within the partner’s organization had likely been exploited by attackers to gain access to a virtual desktop interface (VDI) machine.

Using the VDI appliance of a trusted associate, the threat actor was then able to gain access to the customer’s environment by utilizing NAT remote access infrastructure. Devices within the customer’s network had previously been utilized for remote access from the partner network when such activity was permitted and expected. Since then, access to this network was thought to have been removed for all parties. However, it became apparent that the remote access functionality remained operational. While the customer also had firewalls within the environment, a misconfiguration at the time of the attack allowed inbound port access to the remote environment resulting in the suspicious device joining the network on August 29, 2023.

Internal Reconnaissance

Shortly after the device joined the network, Darktrace observed it carrying out a string of internal reconnaissance activity. This activity was initiated with internal ICMP address connectivity, followed by internal TCP connection attempts to a range of ports associated with critical services like SMB, RDP, HTTP, RPC, and SSL. The device was also detected attempting to utilize privileged credentials, which were later identified as relating to a generic multi-purpose administrative account. The threat actor proceeded to conduct further internal reconnaissance, including reverse DNS sweeps, while also attempting to use six additional user credentials.

In addition to the widespread internal connectivity, Darktrace observed persistent connection attempts focused on the RDP and SMB protocols. Darktrace also detected additional SMB enumeration during this phase of the attacker’s reconnaissance. This reconnaissance activity largely attempted to access a wide variety of SMB shares, previously unseen by the host to identify available share types and information available for aggregation. As such, the breach host conducted a large spike in SMB writes to the server service (srvsvc) endpoint on a range of internal hosts using the credential: extramedwb. SMB writes to this endpoint traditionally indicate binding attempts.

Beginning on August 31, Darktrace identified a new host associated with the aforementioned NAT IP address. This new host appeared to have taken over as the primary host conducting the reconnaissance and lateral movement on the network taking advantage of the VDI infrastructure. Like the previous host, this one was observed sustaining reconnaissance activity on August 31, featuring elevated SMB enumeration, SMB access failures, RDP connection attempts, and reverse DNS sweeps.  The attackers utilized several credentials to execute their reconnaissance, including generic and possibly default administrative credentials, including “auditor” and “administrator”.

Figure 1: Advanced Search query highlighting anomalous activity from the second observed remote access host over the course of one week surrounding the time of the breach.

Following these initial detections by Darktrace DETECT, Darktrace’s Cyber AI Analyst™ launched an autonomous investigation into the scanning and privileged internal connectivity and linked these seemingly separate events together into one wider internal reconnaissance incident.

Figure 2: Timeline of an AI Analyst investigation carried out between August 29 and August 31, 2023, during which it detected an increased volume of scanning and unusual privileged internal connectivity.

Lateral Movement

Following the reconnaissance activity performed by the new host observed exploiting the remote access infrastructure, Darktrace detected an increase in attempts to move laterally within the customer’s network, particularly via RPC commands and SMB file writes.

Specifically, the threat actor was observed attempting RPC binds to several destination devices, which can be used in the calling of commands and/or the creation of services on destination devices. This activity was highlighted in repeated failed attempts to bind to the ntsvcs named pipe on several destination devices within the network. However, given the large number of connection attempts, Darktrace did also detect a number of successful RPC connections.

Darktrace also detected a spike in uncommon service control (SVCCTL) ExecMethod, Create, and Start service operations from the breach device.

Figure 3: Model breach details noting the affected device performing unsuccessful RPC binds to endpoints not supported on the destination device.

Additional lateral movement activity was performed using the SMB/NTLM protocols. The affected device also conducted a series of anonymous NTLM logins, whereby NTLM authentication attempts occurred without a named client principal, to a range of internal hosts. Such activity is highly indicative of malicious or unauthorized activity on the network. The host also employed the outdated SMB version 1 (SMBv1) protocol during this phase of the kill chain. The use of SMBv1 often represents a compliance issue for most networks due to the high number of exploitable vulnerabilities associated with this version of the protocol.

Lastly, Darktrace identified the internal transfer of uncommon executables, such as ‘TRMtZSqo.exe’, via SMB write. The breach device was observed writing this file to the hidden administrative share (ADMIN$) on a destination server. Darktrace recognized that this activity was highly unusual for the device and may have represented the threat actor transferring a malicious payload to the destination server for further persistence, data aggregation, and/or command and control (C2) operations. Further SMB writes of executable files, and the subsequent delete of these binaries, were observed from the device at this time. For example, the additional executable ‘JAqfhBEB.exe’ was seen being deleted by the breach device. This deletion, paired with the spike in SVCCTL Create and Start operations occurring, suggests the transfer, execution, and removal of persistence and data harvesting binaries within the network.

Figure 4: AI Analyst details highlighting the SMB file writes of the unusual executable from the remote access device during the compromise.

Conclusion

Ultimately, Darktrace was able to successfully identify and alert for suspicious activity being performed by a threat actor who had gained unauthorized access to the customer’s network by abusing one of their trusted relationships.

The identification of scanning, RPC commands and SMB sessions directly assisted the customer in their response to contain and mitigate this intrusion. The investigation carried out by the Darktrace SOC enabled the customer to promptly triage and remediate the attack, mitigating the potential damage and preventing the compromise from escalating further. Had Darktrace RESPOND been enabled in autonomous response mode at the time of the attack, it would have been able to take swift action to inhibit the scanning, share enumerations and file write activity, thereby thwarting the attacker’s network reconnaissance and lateral movement attempts.

By exploiting trusted relationships between organizations, threat actors are often able to bypass traditional signatured-based security methods that have previously been reconfigured to allow and trust connections from and to specific endpoints. Rather than relying on the configurations of specific rules and permitted IP addresses, ports, and devices, Darktrace DETECT’s anomaly-based approach to threat detection meant it was able to identify suspicious network activity at the earliest stage, irrespective of the offending device and whether the domain or relationship was trusted.

Credit to Adam Potter, Cyber Security Analyst, Taylor Breland, Analyst Team Lead, San Francisco.

Darktrace DETECT Model Breach Coverage:

  • Device / ICMP Address Scan
  • Device / Network Scan
  • Device / Suspicious SMB Scanning Activity
  • Device / RDP Scan
  • Device / Possible SMB/NTLM Reconnaissance
  • Device / Reverse DNS Sweep
  • Anomalous Connection / SMB Enumeration
  • Device / Large Number of Model Breaches
  • Anomalous Connection / Suspicious Activity On High Risk Device
  • Unusual Activity / Possible RPC Recon Activity
  • Device / Anonymous NTLM Logins
  • Anomalous Connection / Unusual SMB Version 1 Connectivity
  • Device / Repeated Unknown RPC Service Bind Errors
  • Anomalous Connection / New or Uncommon Service Control
  • Compliance / SMB Drive Write
  • Anomalous File / Internal / Unusual Internal EXE File Transfer
  • Device / Multiple Lateral Movement Model Breaches

AI Analyst Incidents:

  • Scanning of Multiple Devices
  • Extensive Unusual RDPConnections
  • SMB Write of Suspicious File
  • Suspicious DCE-RPC Activity

MITRE ATT&CK Mapping

  • Tactic: Initial Access
  • Technique: T1199 - Trusted Relationship
  • Tactic: Discovery
  • Technique:
  • T1018 - Remote System Discovery
  • T1046 - Network Service Discovery
  • T1135 - Network Share Discovery
  • T1083 - File and Directory Discovery
  • Tactic: Lateral Movement
  • Technique:
  • T1570 - Lateral Tool Transfer
  • T1021 - Remote Services
  • T1021.002 - SMB/Windows Admin Shares
  • T1021.003 - Distributed Component Object Model
  • T1550 - Use Alternate Authentication Material

References

1https://attack.mitre.org/techniques/T1199/

2https://www.cloudflare.com/learning/insights-supply-chain-attacks/

3https://newsroom.cisco.com/c/r/newsroom/en/us/a/y2023/m09/companies-reliance-on-it-managed-services-increases-in-2023-sector-valued-at-us-472-billion-globally.html#:~:text=IT%20channel%20partners%20selling%20managed,US%24419%20billion%20in%202022.

Inside the SOC
Darktrace cyber analysts are world-class experts in threat intelligence, threat hunting and incident response, and provide 24/7 SOC support to thousands of Darktrace customers around the globe. Inside the SOC is exclusively authored by these experts, providing analysis of cyber incidents and threat trends, based on real-world experience in the field.
Written by
Adam Potter
Senior Cyber Analyst
Written by
Taylor Breland
Analyst Team Lead, San Francisco

More in this series

No items found.

Blog

/

/

April 24, 2025

The Importance of NDR in Resilient XDR

picture of hands typing on laptop Default blog imageDefault blog image

As threat actors become more adept at targeting and disabling EDR agents, relying solely on endpoint detection leaves critical blind spots.

Network detection and response (NDR) offers the visibility and resilience needed to catch what EDR can’t especially in environments with unmanaged devices or advanced threats that evade local controls.

This blog explores how threat actors can disable or bypass EDR-based XDR solutions and demonstrates how Darktrace’s approach to NDR closes the resulting security gaps with Self-Learning AI that enables autonomous, real-time detection and response.

Threat actors see local security agents as targets

Recent research by security firms has highlighted ‘EDR killers’: tools that deliberately target EDR agents to disable or damage them. These include the known malicious tool EDRKillShifter, the open source EDRSilencer, EDRSandblast and variants of Terminator, and even the legitimate business application HRSword.

The attack surface of any endpoint agent is inevitably large, whether the software is challenged directly, by contesting its local visibility and access mechanisms, or by targeting the Operating System it relies upon. Additionally, threat actors can readily access and analyze EDR tools, and due to their uniformity across environments an exploit proven in a lab setting will likely succeed elsewhere.

Sophos have performed deep research into the EDRShiftKiller tool, which ESET have separately shown became accessible to multiple threat actor groups. Cisco Talos have reported via TheRegister observing significant success rates when an EDR kill was attempted by ransomware actors.

With the local EDR agent silently disabled or evaded, how will the threat be discovered?

What are the limitations of relying solely on EDR?

Cyber attackers will inevitably break through boundary defences, through innovation or trickery or exploiting zero-days. Preventive measures can reduce but not completely stop this. The attackers will always then want to expand beyond their initial access point to achieve persistence and discover and reach high value targets within the business. This is the primary domain of network activity monitoring and NDR, which includes responsibility for securing the many devices that cannot run endpoint agents.

In the insights from a CISA Red Team assessment of a US CNI organization, the Red Team was able to maintain access over the course of months and achieve their target outcomes. The top lesson learned in the report was:

“The assessed organization had insufficient technical controls to prevent and detect malicious activity. The organization relied too heavily on host-based endpoint detection and response (EDR) solutions and did not implement sufficient network layer protections.”

This proves that partial, isolated viewpoints are not sufficient to track and analyze what is fundamentally a connected problem – and without the added visibility and detection capabilities of NDR, any downstream SIEM or MDR services also still have nothing to work with.

Why is network detection & response (NDR) critical?

An effective NDR finds threats that disable or can’t be seen by local security agents and generally operates out-of-band, acquiring data from infrastructure such as traffic mirroring from physical or virtual switches. This means that the security system is extremely inaccessible to a threat actor at any stage.

An advanced NDR such as Darktrace / NETWORK is fully capable of detecting even high-end novel and unknown threats.

Detecting exploitation of Ivanti CS/PS with Darktrace / NETWORK

On January 9th 2025, two new vulnerabilities were disclosed in Ivanti Connect Secure and Policy Secure appliances that were under malicious exploitation. Perimeter devices, like Ivanti VPNs, are designed to keep threat actors out of a network, so it's quite serious when these devices are vulnerable.

An NDR solution is critical because it provides network-wide visibility for detecting lateral movement and threats that an EDR might miss, such as identifying command and control sessions (C2) and data exfiltration, even when hidden within encrypted traffic and which an EDR alone may not detect.

Darktrace initially detected suspicious activity connected with the exploitation of CVE-2025-0282 on December 29, 2024 – 11 days before the public disclosure of the vulnerability, this early detection highlights the benefits of an anomaly-based network detection method.

Throughout the campaign and based on the network telemetry available to Darktrace, a wide range of malicious activities were identified, including the malicious use of administrative credentials, the download of suspicious files, and network scanning in the cases investigated.

Darktrace / NETWORK’s autonomous response capabilities played a critical role in containment by autonomously blocking suspicious connections and enforcing normal behavior patterns. At the same time, Darktrace Cyber AI Analyst™ automatically investigated and correlated the anomalous activity into cohesive incidents, revealing the full scope of the compromise.

This case highlights the importance of real-time, AI-driven network monitoring to detect and disrupt stealthy post-exploitation techniques targeting unmanaged or unprotected systems.

Unlocking adaptive protection for evolving cyber risks

Darktrace / NETWORK uses unique AI engines that learn what is normal behavior for an organization’s entire network, continuously analyzing, mapping and modeling every connection to create a full picture of your devices, identities, connections, and potential attack paths.

With its ability to uncover previously unknown threats as well as detect known threats using signatures and threat intelligence, Darktrace is an essential layer of the security stack. Darktrace has helped secure customers against attacks including 2024 threat actor campaigns against Fortinet’s FortiManager , Palo Alto firewall devices, and more.  

Stay tuned for part II of this series which dives deeper into the differences between NDR types.

Credit to Nathaniel Jones VP, Security & AI Strategy, FCISO & Ashanka Iddya, Senior Director of Product Marketing for their contribution to this blog.

Continue reading
About the author
Nathaniel Jones
VP, Security & AI Strategy, Field CISO

Blog

/

/

April 22, 2025

Obfuscation Overdrive: Next-Gen Cryptojacking with Layers

man looking at multiple computer screensDefault blog imageDefault blog image

Out of all the services honeypotted by Darktrace, Docker is the most commonly attacked, with new strains of malware emerging daily. This blog will analyze a novel malware campaign with a unique obfuscation technique and a new cryptojacking technique.

What is obfuscation?

Obfuscation is a common technique employed by threat actors to prevent signature-based detection of their code, and to make analysis more difficult. This novel campaign uses an interesting technique of obfuscating its payload.

Docker image analysis

The attack begins with a request to launch a container from Docker Hub, specifically the kazutod/tene:ten image. Using Docker Hub’s layer viewer, an analyst can quickly identify what the container is designed to do. In this case, the container is designed to run the ten.py script which is built into itself.

 Docker Hub Image Layers, referencing the script ten.py.
Figure 1: Docker Hub Image Layers, referencing the script ten.py.

To gain more information on the Python file, Docker’s built in tooling can be used to download the image (docker pull kazutod/tene:ten) and then save it into a format that is easier to work with (docker image save kazutod/tene:ten -o tene.tar). It can then be extracted as a regular tar file for further investigation.

Extraction of the resulting tar file.
Figure 2: Extraction of the resulting tar file.

The Docker image uses the OCI format, which is a little different to a regular file system. Instead of having a static folder of files, the image consists of layers. Indeed, when running the file command over the sha256 directory, each layer is shown as a tar file, along with a JSON metadata file.

Output of the file command over the sha256 directory.
Figure 3: Output of the file command over the sha256 directory.

As the detailed layers are not necessary for analysis, a single command can be used to extract all of them into a single directory, recreating what the container file system would look like:

find blobs/sha256 -type f -exec sh -c 'file "{}" | grep -q "tar archive" && tar -xf "{}" -C root_dir' \;

Result of running the command above.
Figure 4: Result of running the command above.

The find command can then be used to quickly locate where the ten.py script is.

find root_dir -name ten.py

root_dir/app/ten.py

Details of the above ten.py script.
Figure 5: Details of the above ten.py script.

This may look complicated at first glance, however after breaking it down, it is fairly simple. The script defines a lambda function (effectively a variable that contains executable code) and runs zlib decompress on the output of base64 decode, which is run on the reversed input. The script then runs the lambda function with an input of the base64 string, and then passes it to exec, which runs the decoded string as Python code.

To help illustrate this, the code can be cleaned up to this simplified function:

def decode(input):
   reversed = input[::-1]

   decoded = base64.decode(reversed)
   decompressed = zlib.decompress(decoded)
   return decompressed

decoded_string = decode(the_big_text_blob)
exec(decoded_string) # run the decoded string

This can then be set up as a recipe in Cyberchef, an online tool for data manipulation, to decode it.

Use of Cyberchef to decode the ten.py script.
Figure 6: Use of Cyberchef to decode the ten.py script.

The decoded payload calls the decode function again and puts the output into exec. Copy and pasting the new payload into the input shows that it does this another time. Instead of copy-pasting the output into the input all day, a quick script can be used to decode this.

The script below uses the decode function from earlier in order to decode the base64 data and then uses some simple string manipulation to get to the next payload. The script will run this over and over until something interesting happens.

# Decode the initial base64

decoded = decode(initial)
# Remove the first 11 characters and last 3

# so we just have the next base64 string

clamped = decoded[11:-3]

for i in range(1, 100):
   # Decode the new payload

   decoded = decode(clamped)
   # Print it with the current step so we

   # can see what’s going on

   print(f"Step {i}")

   print(decoded)
   # Fetch the next base64 string from the

   # output, so the next loop iteration will

   # decode it

   clamped = decoded[11:-3]

Result of the 63rd iteration of this script.
Figure 7: Result of the 63rd iteration of this script.

After 63 iterations, the script returns actual code, accompanied by an error from the decode function as a stopping condition was never defined. It not clear what the attacker’s motive to perform so many layers of obfuscation was, as one round of obfuscation versus several likely would not make any meaningful difference to bypassing signature analysis. It’s possible this is an attempt to stop analysts or other hackers from reverse engineering the code. However,  it took a matter of minutes to thwart their efforts.

Cryptojacking 2.0?

Cleaned up version of the de-obfuscated code.
Figure 8: Cleaned up version of the de-obfuscated code.

The cleaned up code indicates that the malware attempts to set up a connection to teneo[.]pro, which appears to belong to a Web3 startup company.

Teneo appears to be a legitimate company, with Crunchbase reporting that they have raised USD 3 million as part of their seed round [1]. Their service allows users to join a decentralized network, to “make sure their data benefits you” [2]. Practically, their node functions as a distributed social media scraper. In exchange for doing so, users are rewarded with “Teneo Points”, which are a private crypto token.

The malware script simply connects to the websocket and sends keep-alive pings in order to gain more points from Teneo and does not do any actual scraping. Based on the website, most of the rewards are gated behind the number of heartbeats performed, which is likely why this works [2].

Checking out the attacker’s dockerhub profile, this sort of attack seems to be their modus operandi. The most recent container runs an instance of the nexus network client, which is a project to perform distributed zero-knowledge compute tasks in exchange for cryptocurrency.

Typically, traditional cryptojacking attacks rely on using XMRig to directly mine cryptocurrency, however as XMRig is highly detected, attackers are shifting to alternative methods of generating crypto. Whether this is more profitable remains to be seen. There is not currently an easy way to determine the earnings of the attackers due to the more “closed” nature of the private tokens. Translating a user ID to a wallet address does not appear to be possible, and there is limited public information about the tokens themselves. For example, the Teneo token is listed as “preview only” on CoinGecko, with no price information available.

Conclusion

This blog explores an example of Python obfuscation and how to unravel it. Obfuscation remains a ubiquitous technique employed by the majority of malware to aid in detection/defense evasion and being able to de-obfuscate code is an important skill for analysts to possess.

We have also seen this new avenue of cryptominers being deployed, demonstrating that attackers’ techniques are still evolving - even tried and tested fields. The illegitimate use of legitimate tools to obtain rewards is an increasingly common vector. For example,  as has been previously documented, 9hits has been used maliciously to earn rewards for the attack in a similar fashion.

Docker remains a highly targeted service, and system administrators need to take steps to ensure it is secure. In general, Docker should never be exposed to the wider internet unless absolutely necessary, and if it is necessary both authentication and firewalling should be employed to ensure only authorized users are able to access the service. Attacks happen every minute, and even leaving the service open for a short period of time may result in a serious compromise.

References

1. https://www.crunchbase.com/funding_round/teneo-protocol-seed--a8ff2ad4

2. https://teneo.pro/

Continue reading
About the author
Nate Bill
Threat Researcher
Your data. Our AI.
Elevate your network security with Darktrace AI