Hackers Backdoor pam_unix.so and OpenSSH Binaries to Bypass Authentication and Steal Credentials

Imagine an attacker living inside a highly secure, isolated network for nearly a decade. Sygnia’s incident response team recently uncovered exactly that during a prolonged investigation dubbed “Operation Highland.”

The China-nexus threat actor known as Velvet Ant has maintained an undetected presence inside a critical infrastructure environment since at least 2016.

Velvet Ant is a sophisticated group previously caught exploiting legacy Windows infrastructure, F5 appliances, and Cisco zero-day vulnerabilities. What makes this recent breach exceptional is that the target network had no direct internet connectivity.

To bypass this air gap, Velvet Ant abandoned standard persistence methods and completely hijacked the network’s authentication layer by backdooring Linux PAM and OpenSSH binaries.

Backdoored Linux Binaries Steal Credentials

The target environment was deliberately segregated, meaning the hackers had to construct a multi-stage access chain just to reach it.

They began by establishing a foothold on internet-facing servers using a modified version of GS-Netcat. Disguised as a legitimate system utility named auditdb, this tool functioned as a highly stealthy, encrypted reverse shell.

To facilitate lateral movement, the attackers also deployed a custom SOCKS5 proxy. They carefully renamed their malicious processes to mimic normal system operations.

Moving deeper, Velvet Ant exploited internet-facing Nginx servers to act as an execution bridge. They manipulated the server configurations to forward specific incoming HTTP requests to a backend FastCGI process.

This clever routing allowed them to execute commands on a custom binary that established an SSH connection straight into the segregated critical infrastructure.

Through simple HTTP requests, the attackers created a secure tunnel to extract confidential data without ever needing a direct internet connection to the protected network segment.

Snippet from IDA showing the usage of GS-Netcat (Source: sygnia)
Snippet from IDA showing the usage of GS-Netcat (Source: sygnia)

Once inside the core network, Velvet Ant secured their long-term access by subverting the entire authentication stack.

They replaced the legitimate pam_unix.so module across multiple hosts with maliciously compiled versions. Investigators discovered nine distinct variants of this module, indicating a highly structured, per-target build pipeline.

These backdoored modules were patched to accept a hardcoded password, allowing the hackers to bypass normal verification entirely.

Simultaneously, the modules quietly harvested the usernames and passwords of legitimate administrators, storing them in hidden files, Sygnia said.

snippet from a SOCKS5 proxy script displaying the custom port, custom process name, and its execution as daemon (Source: sygnia)
snippet from a SOCKS5 proxy script displaying the custom port, custom process name, and its execution as daemon (Source: sygnia)

The group also deployed customized OpenSSH suites, injecting malicious capabilities directly into the ssh, sshd, and scp binaries.

These altered tools served as aggressive credential-dumpers and session keyloggers. Every single command typed by an administrator was captured and saved in encrypted log files.

Demonstrating extreme operational discipline, the hackers built a custom -d flag into their tools to temporarily turn off logging, ensuring their own lateral movement left no forensic evidence behind.

Additionally, the compromised SCP binary was engineered to automatically disable SELinux when executed as root, stripping away critical mandatory access controls.

Follow us on Google News , LinkedIn and X to Get More Instant Updates. Set Cyberpress as a Preferred Source in Google.

Varshini
Varshini
Varshini is a Cyber Security expert in Threat Analysis, Vulnerability Assessment, and Research. Passionate about staying ahead of emerging Threats and Technologies..

Trending News

Related Stories