Recent research has demonstrated the capability of AI in crafting remote code execution (RCE) exploits for programmable logic controllers (PLCs). Utilizing Claude AI, researchers successfully ported an exploit to a WAGO 750-831 PLC, showcasing AI’s potential in low-level operational technology (OT) security applications.
AI’s Role in Exploit Development
The experiment focused on executing arbitrary ARM shellcode on a WAGO 750-831 without valid credentials, though it required significant human oversight, costly API usage, and ultimately resulted in a non-functional device. The targeted vulnerability, CVE-2021-31886, is a buffer overflow in the Nucleus FTP server, which arises from inadequate username length validation.
By crafting an oversized username, researchers could overwrite memory and redirect execution flow. The focus was on a WAGO 750-831 running firmware V01.04.16, building upon previous exploits for the WAGO 750-852 model. Claude AI was employed to pinpoint device-specific elements such as memory addresses and shellcode storage regions, critical for the exploit’s development.
Challenges and Breakthroughs
The closed-source nature of the PLC, lacking a debugger, posed unique challenges. Claude AI leveraged firmware analysis tools like Ghidra, Python scripts, and network utilities to dissect the firmware and engage with the controller. Initial AI attempts followed incorrect paths, necessitating human intervention to refine the approach.
The first success was a system crash, confirming the buffer overflow’s viability. However, achieving consistent RCE was complex due to the FTP command processing erasing critical buffers. By altering the command sequence from USER-QUIT to USER-CWD, Claude preserved the payload, enabling successful shellcode execution.
Implications and Recommendations
While AI expedited payload generation, including ICMP echo requests and UDP messages, the exploit required network access to FTP port 21 but bypassed authentication. The final stage of development cost $535.74 in API usage and involved extensive reverse engineering to understand shellcode overwriting issues.
Efforts to develop a command-and-control implant led to a bricked PLC due to a payload writing to flash memory, highlighting the risks of AI-driven testing on cyber-physical systems. The findings underscore AI’s potential in adapting embedded exploits, though expert oversight remains crucial.
To mitigate risks, organizations should limit FTP and remote management exposure, monitor PLCs for anomalies, and consider OT vulnerabilities as significant with AI-driven exploit development becoming more feasible.
