AI detects Hacker’s malicious PowerShell script

Analysts Proofpoint They believe that attackers use a Rhadamanthys PowerShell script created with the help of AI (for example, OpenAI’s ChatGPT, Google’s Gemini, or Microsoft’s CoPilot) to distribute the Rhadamanthys information stealer.

The script studied by experts was used in March of this year as part of a phishing campaign targeting dozens of organizations in Germany. According to researchers, in this email campaign, hackers posed as representatives of Metro cash-and-carry, using invoices as bait.

Malicious email

Apparently, the detected activity is associated with the hacker group TA547 (aka Scully Spider), which also acts as a broker of initial access.

Scully Spider have been active since at least 2017, and over the years they have distributed a wide variety of malware for Windows (ZLoader/Terdot, Gootkit, Ursnif, Corebot, Panda Banker and Atmos), as well as for Android (Mazar Bot and Red Alert).

But recently the group has switched to the modular information stealer Rhadamanthys, which is constantly expanding its capabilities for collecting and stealing data (from the clipboard, browser, cookies). This stealer has been distributed among cybercriminal groups since September 2022 using the malware-as-a-service (MaaS) model.

According to Proofpoint, the attackers' emails contained a ZIP archive protected with the MAR26 password, which contained a malicious .LNK file. Accessing the shortcut file triggered PowerShell to execute the remote script.

While analyzing the PowerShell script that loads Rhadamanthys, the researchers noticed that it contained many “#” characters followed by separate comments for each component, which is not often found in human-written code. Experts write that this is more typical for code created by generative AI, for example, ChatGPT, Gemini or CoPilot.

Although experts are not entirely sure that the PowerShell script was written using LLM, its contents suggest that TA547 is now using generative AI to write or rework its tools. In addition, the researchers themselves tried to create a similar script using LLM and came to the conclusion that the TA547 script could also be generated by AI.

For example, according to the researchers, developers usually write excellent code, but their comments are often unclear and contain grammatical errors.

“The PowerShell script, supposedly created by LLM, is carefully commented out with impeccable grammar. Almost every line of code is accompanied by a corresponding comment,” Proofpoint notes.