A Cobalt Strike flaw exposed attackers’ infrastructure

Pierluigi Paganini March 03, 2019

According to security experts at Fox-IT, a recently addressed flaw in the Cobalt Strike penetration testing platform could be exploited to identify attacker servers.

Security experts at Fox-IT discovered that a recently addressed vulnerability in the Cobalt Strike penetration testing platform could be exploited to identify attacker servers.

The vulnerability was addressed in Cobalt Strike 3.13, Fox-IT experts argue the flaw was in the platform for almost 7 years, since the platform has been using NanoHTTPD in 2012.

The Cobalt Strike platform was developed for Adversary Simulations and Red Team Operations, but it has also become popular among threat actors over the past years (including APT29 and FIN7).

It is quite easy to find pirated versions of the software that were used by attackers in the wild.

The issue was related to the presence of extraneous whitespace in server responses, it was used security experts to identify Cobalt Strike servers used involved in the attacks.

Cobalt STrike extraneus whitespace

The Java-based platform is composed of two components, the implant (the beacon) and a server (the team server). The server allows to manage the Cobalt Strike beacons and serve the beacon payload, landing pages and other arbitrary files.

Experts pointed out that communication with servers can be fingerprinted via Intrusion Detection System (IDS) signatures and other techniques.

“On top of collaboration, the team server also acts as a webserver where the beacons connect to for Command & Control, but it can also be configured to serve the beacon payload, landing pages and arbitrary files.” reads the advisory published by Fox-IT

“Communication to these servers can be fingerprinted with the use of Intrusion Detection System (IDS) signatures such as Snort, but with enough customization of the beacon, and/or usage of a custom TLS certificate, this becomes troublesome.”

While analyzing the Cobalt Strike team servers, experts discovered the bug in the webserver component (which is based on NanoHTTPD, an open source webserver written in Java). The component returns unexpected whitespace in all its HTTP responses allowing the identification of publicly-exposed NanoHTTPD servers, including Cobalt Strike team server installs used by attackers.

Experts used public scan data, such as Rapid7 Labs Open Data, and the knowledge of how to fingerprint NanoHTTPD servers, to historically identify the state of team servers exposed on the Internet.

“The graphs shows a steady growth of Cobalt Strike (NanoHTTPD) webservers on port 80 and 443 which is a good indication of the increasing popularity of this framework.” continues the analysis published by the experts. “The decline since the start of 2019 is most likely due to the “extraneous space” fix, thus not showing up in the scan data when applying the fingerprint.”

Fox-IT observed 7718 unique Cobalt Strike team server or NanoHTTPD hosts between the period of 2015-01 and 2019-02, it is important to note that some of them are used for legitimate services.

“Organizations are encouraged to use the published list with Cobalt Strike team servers IP addresses to retroactively verify whether they have been targeted with this tooling by either a red team or an adversary in the recent past. The IP addresses can be checked with e.g. firewall and proxy logs, or on aggregate against SIEM data. To minimize the amount of false positives, the reader is urged to take the corresponding first and last seen dates into consideration.” the expert conclude.

“For the ‘red team readers’ of this blog looking for ways to avoid their Cobalt Strike team server being both publicly available and easy to fingerprint, see the Cobalt Strike Team Server Population Study blog for a detailed set of mitigations. Furthermore, Red Teams are encouraged to critically examine their toolsets in use or rely on their Blue Team, for potential tell-tales and determine the appropriate way to apply and mitigate such findings for both Red and Blue team purposes.” Fox-IT concludes.

[adrotate banner=”9″] [adrotate banner=”12″]

Pierluigi Paganini

(SecurityAffairs – Cobalt Strike, hacking)

[adrotate banner=”5″]

[adrotate banner=”13″]



you might also like

leave a comment