← BACK TO FEED
cybersecurityActive DirectoryAI-generated malwarePowerShellcloud security

AI-Written PowerShell Scripts Are Now a Burglar's Tool of Choice

An unknown threat actor used an AI-generated PowerShell script to enumerate Active Directory environments, gaining RDP access via stolen credentials before systematically harvesting user, computer, and group data and exfiltrating it to a remote server. The script's telltale signs — such as its iteration-style title, over-engineered code, and colour-formatted output — strongly suggest it was produced through repeated prompting of a large language model. While AI is not introducing entirely new attack techniques, it is lowering the barrier to entry for cybercriminals and accelerating attack timelines, allowing less-skilled actors to deploy capable tooling faster than defenders can respond.

Researchers at Huntress have documented an intrusion where the attacker used what appears to be an AI-generated PowerShell script to map out a victim's Active Directory environment. The script, charmingly titled '100% Working AD Information Gathering Script - FULLY FIXED', has all the hallmarks of something knocked together through repeated back-and-forth with a large language model: placeholder strings, over-engineered logic featuring five separate fallback methods for locating a Domain Controller, and helpfully colour-coded console output in cyan, green, red and yellow. Nobody writing malware from scratch adds a rainbow terminal UI unless something else wrote it for them.

The attack itself followed a fairly conventional playbook. The threat actor got in via RDP using pre-compromised credentials, staged their tools under C:\ProgramData\, and ran the PowerShell script to enumerate users, computers, groups, organisational units, and trust relationships across the domain. About thirty minutes later, they deployed s5cmd for bulk file operations and SharpShares to sniff out accessible network shares. The whole lot was packed into CSV files, archived, and shipped off to a remote server, with a tidy HTML report generated to summarise the haul. That last touch, the nicely formatted Active Directory Inventory Report, was almost certainly an unsolicited bonus from whichever LLM wrote the script. The attacker apparently just rolled with it.

Huntress called the script 'highly aggressive' and 'noisy', which is a polite way of saying it would stand out like a fireworks display in any environment with halfway decent monitoring. Stealth was clearly not the priority here. Speed was.

This is the core of what AI actually changes about cybercrime. Not the techniques, which remain thoroughly unoriginal, but the pace and the accessibility. Someone without the skills to write a functional AD enumeration tool from scratch can now have one in minutes. The barrier to entry for capable, targeted intrusions has dropped considerably, and the tooling increasingly writes itself.

Sygnia published a related finding last week that pushes this point further. Their incident response team documented an AI-assisted attack against a large AWS environment that went from initial access to broad compromise in roughly 72 hours. The attacker's goal appeared to be financial: gain access, cause enough disruption to create leverage, then extort.

What made this notable was not the techniques, which again mapped entirely to well-documented adversary behaviour, but the tempo. The attacker obtained an AWS access key through a vulnerability in an internet-facing application, then immediately began chaining weaknesses across application services, IAM configurations, source-control repositories, CI/CD pipelines, runtime components, and data stores. Each new credential they obtained triggered a fresh round of enumeration, secrets harvesting, and persistence attempts including creating new IAM users and access keys.

To ratchet up pressure on the victim, they blocked access to S3 buckets, zeroed out ECS service capacity, created ACL rules to cut off network access, and wiped SQS queues. Some of the attacker's artefacts were disguised as penetration testing activity, a transparent but occasionally effective trick.

Sygnia's conclusion mirrors what Huntress observed: AI did not invent any of this. Every action taken had precedent in years of documented attack patterns. What shifted is how quickly an attacker can move through a complex environment, converting each new access into targeted action without the usual lag of manual analysis. The time between 'I have a credential' and 'I know exactly what this credential can reach and what to do next' appears to have shrunk dramatically.

Defenders are not getting faster at the same rate. That asymmetry is the actual problem.

READ NEXT
OpenAI's Hacking Incident Is the AI Safety Wake-Up Call Nobody Wanted to Believe Was ComingOpenAI's AI Agents Broke Out of Their Sandbox and Hacked Hugging FaceOpenAI's Own AI Models Broke Out of Their Sandbox and Hacked Hugging Face to Cheat a Benchmark