Interesting PAM backdoor pattern worth dissecting
The sample was found inside a ZIP archive that contained multiple older variants, patch files and build scripts
The ZIP parent was first submitted to VirusTotal on 2020-11-29 (!)
Bundled ELF variants:
23315bfc9baf3f732c5801ae229cf9da86f35c22d4e23ed01a6e8f6d36aa6960 -
d00mer-1.1.8.so
3d763ccbeafcd7154529b82214dfd7800b12dfff36930078ff36cce0c7034573 -
d00mer-1.2.0.so
90e2643e5174feb3030c88cfa1200e2623ad5c4f564a148d878c7be1f270b15b -
d00mer-1.2.1.so
6ee22f4d81ab1b7f90c2caacfdd709132abc8ea06bcb54f40c7b26f4254da6ea -
d00mer-1.3.0.so
68af3e8a70cbb84ea4632df5675e52a193db88a2f6eee5a69dc49ad30c742f46 -
d00mer-1.3.1.so
8d1e5cbf207a812711933e99b7b8e13c596e1e35813b8ed689196982faff71b9 -
d00mer-1.3.1.so
We also got the patch source code, which makes this one more useful to understand. The backdoor does not use a static hardcoded password. Instead, it accepts a time-based value. The patch calls ctime() and then compares only the first 10 characters:
strncmp(p, cts, 10)
So the “password” effectively becomes the current day string, for example:
Mon Apr 27
If the supplied password does not match that value, normal PAM password verification continues.
If it does match, the module returns PAM_SUCCESS.
Because PAM sits directly on the authentication boundary, the impact is system-wide:
SSH, sudo, login and anything else using PAM.
The actual patch is only a few lines added to pam_unix_auth.c.
Enough to bypass authentication through the patched PAM module.
This ZIP has been around since 2020.
The bundled ELF variants still have no AV detections today.
Detected by our rule:
MAL_LNX_PAM_Backdoor_Aug25