Hackers Use AI-Generated Scripts to Hijack Linux Sudo Commands and Steal Passwords

Blog WriterCybersecurity News - Original News Source is cybersecuritynews.com


A campaign against government organizations and state-linked infrastructure used AI-assisted scripts to steal credentials, maintain access to Linux servers and seek sensitive data, according to new research.

The attackers altered users’ shell startup files to intercept the sudo command, then copied entered passwords to a file while passing them to the real command.

This let a user’s request appear to work normally as the password was stolen. Unit 42’s investigation says the activity also involved web shells, custom malware, mailbox searches and attempts to erase evidence.

The operation shows how familiar Linux tools can be turned against their users. Rather than exploiting a flaw in sudo itself, the attackers planted a malicious alias in .bashrc, a file that runs commands when a user starts a Bash shell.

The distinction matters: applying a software patch alone would not remove this kind of tampering. Administrators may find this earlier Linux sudo vulnerability useful context, but Unit 42 described credential interception through a changed shell configuration, not that vulnerability.

Researchers from Unit 42 identified the activity and track the group of related operations as CL-UNK-1211. They observed activity from October 2025 to April 2026 targeting government entities and state-affiliated infrastructure.

Unit 42 uses “UNK” for clusters whose links to either state-backed activity or cybercrime have not been determined, so the findings do not identify a known government or criminal group as responsible.

Several scripts contained conversational comments and step-by-step reasoning notes that researchers said were consistent with AI-generated code or an automated AI agent.

The evidence points to AI helping create or adapt parts of the toolkit; it does not establish that AI independently planned or carried out the campaign.

Snippets of code containing comments, indicating the use of AI (Source - Unit42)
Snippets of code containing comments, indicating the use of AI (Source – Unit42)

Unit 42 also noted Base64-encoded commands and scripts that moved between PHP, JavaScript, Bash and Python. These clues may help defenders spot suspicious code, but they are not proof of AI use on their own.

Hackers Use AI-Generated Scripts

The attackers replaced a user’s .bashrc with a modified copy containing an alias for sudo. When the user ran the command, the alias displayed a prompt resembling the normal password request, captured the password and wrote it to an attacker-controlled log file.

It then passed the password to the legitimate sudo command, making the interception less obvious. The attackers named the file Solarwinds.StatusLog.txt, apparently to make it look like a routine system artifact. Unit 42 said it found no evidence that SolarWinds systems or infrastructure were compromised.

The credential theft did not stop at the shell. Attackers also inserted code into a PHP login page to collect administrator usernames and passwords, and searched configuration files and command histories for email, SMTP and database credentials.

The campaign’s use of web shells and hidden access has parallels with other Linux credential-stealing malware, though that article describes a separate threat and should not be confused with CL-UNK-1211.

Malware, persistence and data theft

Unit 42 found a custom Go-based remote access Trojan it named SysGoRAT. The malware can run on Linux and Windows, communicate with a command-and-control server over WebSocket and support remote commands, shell access, file handling and persistence.

Attackers used names such as sys-control-client, pip2.7 and ea_install to disguise the binary. Its default C2 address was 104.194.158[.]65:443, though the report says operators could change it at launch.

The attackers also deployed web shells and changed PHP configuration so a malicious file would load before other PHP scripts. They searched government mailboxes for messages related to social media accounts, attempted to package mailbox contents and sought database data.

Unit 42 reported that one mailbox-archiving script contained a syntax error and would fail as written. The finding is a reminder that observed malicious code does not always work as intended.

To hide their presence, operators tried to stop endpoint security processes, delete logs and shell history, remove temporary scripts after use and change file timestamps.

Interactive web shell activity, as shown in Cortex XDR (Source - Unit42)
Interactive web shell activity, as shown in Cortex XDR (Source – Unit42)

They also planted red-team-like markers, including RedTeamOps2025 and pentest123, to make activity appear authorized. Unit 42 said endpoint protections detected and stopped attempts to terminate Cortex XDR processes; that result concerns the observed systems and does not mean every attempted activity was blocked.

The campaign fits a broader pattern of attackers using AI to speed up script development, as seen in other AI-generated malware research.

For defenders, the practical response is to review unexpected changes to .bashrc, PHP settings and login pages; check for unfamiliar aliases or credential log files; monitor unusual outbound connections and shell activity; and preserve logs and system evidence during an investigation.

The indicators below are from Unit 42’s report and should be checked against local telemetry before being treated as evidence of compromise.

Indicators of compromise (IoCs):-

Type Indicator Description
SHA-256 2bf7992e6260c1a98c709fa98ec766fb9f27692f338b30b43ac821b824fd849e CVE-2025-55182 scanner
SHA-256 27d799ceadb570bfca890d4c2572314afe57eecf14083d30409da15afdfc4704 CVE-2025-55182 scanner
SHA-256 d73186cea6cf2cf3d48c09139a9d15521365aab675787b4e7a6f81767331c9fd CVE-2025-55182 scanner
SHA-256 9e45830171eb607cf2c0fc80f5cc9cc3db39bb937032136990383a595f6f151e CVE-2025-55182 scanner
SHA-256 c527b94e3d21824a674face4cd9d862e536b60ccbf54573839e3360f99188343 Custom shell backdoor
SHA-256 d94f75a70b5cabaf786ac57177ed841732e62bdcc9a29e06e5b41d9be567bcfa GSocket reverse shell
SHA-256 44e83f84a5d5219e2f7c3cf1e4f02489cae81361227f46946abe4b8d8245b879 CVE-2021-4034 PwnKit binary
SHA-256 1505a3a727f8899b2ad343519f7bf9c438b8b802f8d6b854f5db3b52f857c76a PHP web shell
SHA-256 76c58fad4f70cf277a15a499b9a2151ac60e7a6b5c7a9ab684843dcc19f0d0a5 PHP web shell
SHA-256 b1e82c6b0caea177e8bb71ad826867f509c65f0a43a651b50253e7c726566eac PHP web shell
IP address 45.88.188[.]140, 198.23.185[.]234, 138.68.244[.]146, 185.21.136[.]6, 72.61.89[.]179, 104.194.158[.]65, 109.224.53[.]140, 162.243.175[.]162, 154.93.37[.]228, 141.164.58[.]87, 88.80.150[.]232, 88.119.167[.]57, 173.212.247[.]23, 104.248.131[.]53, 147.182.224[.]216, 93.93.112[.]57, 192.210.183[.]17 Reported campaign infrastructure
Domain magento[.]ink, solidmonpe[.]com, wibu-bau-bawang[.]online, beraskencur[.]site Reported domains

Note: IP addresses and domains are intentionally defanged (e.g., [.]) to prevent accidental resolution or hyperlinking. Re-fang only within controlled threat intelligence platforms such as MISP, VirusTotal, or your SIEM.

Update defenses against new malware as soon as it appears. Integrate TI Feeds with data from 16K SOCs.

The post Hackers Use AI-Generated Scripts to Hijack Linux Sudo Commands and Steal Passwords appeared first on Cyber Security News.