AI-built malware maps corporate networks during intrusion

Cybersecurity investigators have uncovered an AI-generated PowerShell script used during a live attack to map a company’s Active Directory environment, offering fresh evidence that criminals are deploying “vibe-coded” malware inside compromised networks.

The script was recovered from an intrusion that began on June 3 after the attacker gained remote desktop access to a Windows Server connected to the victim’s domain. The available evidence indicated that the intruder entered through a virtual private network using credentials that had already been compromised.

Within minutes of establishing an interactive Remote Desktop Protocol session, the attacker placed the PowerShell file in the C:ProgramData directory, a location frequently used to stage malicious tools. The script, named Untitled1. ps1, was then executed to identify the organisation’s domain controller and collect information about its users, computers, groups and network relationships.

ADVERTISEMENT

The tool carried the conspicuous title “100% Working AD Information Gathering Script – FULLY FIXED”, one of several features that led investigators to conclude it had been created through iterative prompts to a large language model. The wording suggested that errors may have been fed back to an AI assistant until it produced a functioning version.

Other clues included an unedited placeholder server name, repetitive error-handling blocks and an elaborate five-stage process for locating the domain controller. The script attempted discovery through DNS queries, the nltest command, the Active Directory PowerShell module, environmental variables and a hardcoded fallback.

Such redundancy would be unusual for an experienced malware developer, who would normally choose one or two dependable techniques. It is more consistent with an AI model responding to instructions to ensure that the script continued working if one method failed.

Once the domain controller was found, the program gathered Active Directory users, computers, organisational units, groups, subnets and trust relationships. It also extracted lists of accounts containing email addresses and produced simplified user inventories that could help an attacker select targets for privilege escalation, impersonation or data theft.

The information was saved into multiple comma-separated files inside a timestamped directory. The program generated an HTML report showing whether each collection task had succeeded and compressed the entire folder into a ZIP archive, leaving the material ready for removal from the network.

ADVERTISEMENT

Its focus on presentation was another indicator of machine-generated development. The script used numerous coloured console messages and created a polished report that was not essential to the intrusion. Such visual additions are commonly included by generative AI assistants seeking to make their output appear helpful and complete.

About half an hour after running the reconnaissance script, the attacker deployed s5cmd, a legitimate high-speed command-line utility used for Amazon S3 operations. The software has also been abused in intrusions to transfer large amounts of stolen information rapidly.

The intruder later installed SharpShares, an established network-enumeration program that searches for accessible file shares. Administrative shares were deliberately excluded, allowing the attacker to concentrate on repositories containing files available to ordinary users.

The sequence followed a familiar smash-and-grab pattern rather than introducing a fundamentally new attack method. Compromised credentials provided initial access, Active Directory reconnaissance identified valuable accounts and systems, and legitimate or publicly available utilities supported data discovery and possible exfiltration.

The important change was the attacker’s ability to produce a customised reconnaissance tool without relying entirely on widely recognised frameworks such as BloodHound, PowerSploit or Cobalt Strike. Security products can often identify those packages through file hashes, static strings and established signatures. A one-off AI-generated script may never appear in precisely the same form again.

Generative AI is therefore making malware development faster and more accessible while increasing the volume of unique code defenders must examine. Less capable operators can request scripts in natural language, test the output and ask the model to repair errors without mastering every command or programming concept involved.

Evidence of the trend has surfaced across other campaigns. Security teams have identified AI-style comments, heavily structured sections and unnecessary boilerplate inside malicious PowerShell components. Large distribution operations have also used dozens of code variants and hundreds of deceptive software archives to spread cryptocurrency miners and information-stealing programs.

The June intrusion nevertheless showed the limitations of AI-assisted malware. The PowerShell script was noisy, over-engineered and left substantial operational traces. Its interactions with Active Directory, creation of multiple files and execution through PowerShell logging generated activity that could be detected through behavioural monitoring.



Notice an issue?

Arabian Post strives to deliver the most accurate and reliable information to its readers. If you believe you have identified an error or inconsistency in this article, please don't hesitate to contact our editorial team at editor[at]thearabianpost[dot]com. We are committed to promptly addressing any concerns and ensuring the highest level of journalistic integrity.


ADVERTISEMENT
Social Media Auto Publish Powered By : XYZScripts.com