r57shell 1.24 is one of the foundational Russian webshells, widely distributed across underground forums since the mid-2000s. This variant carries Cyrillic comments, evilc0ders attribution, and modification credits to #!physx^.
Capabilities
Full control panel with file management, command execution, database access, server enumeration, and network tools. The codebase has been forked and rebadged countless times, making it a common ancestor for dozens of derivative shells still deployed today.
Pre-Auth Local File Inclusion
The very first line of executable code contains an unvalidated include that accepts a user-controlled GET parameter with no sanitization. Any unauthenticated visitor can use this to read arbitrary files on the host or, if allow_url_include is enabled, achieve remote code execution. This vulnerability fires before any authentication check — the shell is exploitable the instant it is deployed, regardless of whether auth is enabled.
Authentication (or Lack Thereof)
Authentication ships disabled by default ($auth=0). Even when enabled, the credentials are hardcoded in cleartext in the source header — r57 / r57 — readable by anyone with file access on the host. The authentication mechanism is a gate against casual discovery, not a security boundary.
W0rm Supply-Chain Backdoor
Redistributed copies carry a W0rm injection near the end of the file. The backdoor provides unauthenticated remote code execution, mail-based exfiltration, and arbitrary file upload. Combined with the pre-auth LFI on line 1, r57 presents two independent unauthenticated attack surfaces — one from the original codebase, one from the supply chain.
Vulnerabilities
| # | Class | Impact | Status |
|---|---|---|---|
| 1 | W0rm prepend — unauthenticated RCE + exfil at global scope | Pre-auth RCE | Live-proven |
| 2 | Unvalidated include via GET parameter — LFI/RFI on line 1 | Pre-auth file read / RCE | Confirmed |
| 3 | Hardcoded cleartext credentials r57:r57 in source header | Credential exposure | Confirmed |
| 4 | Auth disabled by default ($auth=0) | No access control | Confirmed |
| 5 | PHP 5.6 only — set_magic_quotes_runtime fatal on PHP 7+ | Accidental neutralization | Confirmed |
Detection Surface
File-system indicators
| Indicator | Type | Detail |
|---|---|---|
| SHA256 | Hash | d7faf51af1dc899f75714d5dd3e07a79e45f2d4770c98ec44e1e9814eae356be |
| Expected size | ~112 KB | Source variant (r57shell 1.24) |
$hexdtime | Variable | r57-family specific variable |
$name=, $pass= with MD5 hashes | Auth | Credential pair in source header |
ec371748dc2da624b35a4f8f685dd122 | MD5 hash | Default credential hash (r57shell v1.24) |
curl_init("file://".$_POST['test1_file']) | Code pattern | Local file inclusion via cURL |
$auth=0 | Variable | Authentication disabled by default |
| Cyrillic comments | String | Russian-language UI labels — identifies Russian-scene origin |
@eval($eval);} | Code pattern | End-of-function eval pattern (r57-specific) |
| Null-byte LFI (Mohajer22) | Code pattern | curl_init("file:///".$m."\x00/../../") |
| Obfuscated variant | Code pattern | $hf3b3800="\142\x61\x73\x65\66\64\137\x64\x65\143\x6f\x64\x65" (hex-encoded “base64_decode”) |
| Multiple forks | File names | r57_kartal.php, r57_iFX.php, r57_Mohajer22.php, r57_original.php |
| Runtime | PHP 5.6 only | set_magic_quotes_runtime removed in PHP 7 |
HTTP access-log indicators
| Log pattern | What it means |
|---|---|
POST test1_file= | Local file inclusion via curl_init("file://") |
$auth=0 | Authentication disabled by default |
$name= / $pass= | MD5 hashed credentials in source header |
POST cmd= | Command execution |
| Cyrillic text in response body | Russian-language UI comments and labels |
Response: r57shell in title | Shell self-identifies in HTML title |
YARA rule
rule webshell_r57 {
meta:
description = "r57 webshell v1.24 (Russian scene, physx variant)"
author = "OHIIHO Threat Research"
reference = "https://research.ohiiho.com/arsenal/r57/"
status = "validated"
strings:
$title = "r57shell" ascii nocase
$curl_lfi = "curl_init(\"file://\"" ascii
$test1_file = "$_POST['test1_file']" ascii
$name_var = "$name=" ascii
$pass_var = "$pass=" ascii
$md5_auth1 = "ec371748dc2da624b35a4f8f685dd122" ascii
$hexdtime = "$hexdtime" ascii
$cfe_exec = "@shell_exec($cfe)" ascii
$auth0 = "$auth=0" ascii
condition:
filesize < 200KB
and (
($title and ($name_var or $pass_var or $auth0))
or ($curl_lfi and $test1_file)
or ($hexdtime and $cfe_exec)
or $md5_auth1
)
}
W0rm-infected variants are also caught by the generic W0rm supply-chain rule — see the W0rm supply-chain detection applicable to all infected tools.
MITRE ATT&CK
| Technique | Context |
|---|---|
| T1505.003 | Web Shell |
| T1041 | Exfiltration Over C2 Channel (W0rm mail exfil) |
| T1059.004 | Command and Scripting Interpreter: Unix Shell |
Weakness classes (CWE)
The pre-auth file inclusion is a software weakness, not an adversary behaviour — it is classified by CWE rather than forced into an ATT&CK technique.
| CWE | Weakness |
|---|---|
| CWE-98 | PHP Remote File Inclusion — pre-auth include on line 1 |
| CWE-22 | Path Traversal — unvalidated user-controlled file path |
| CWE-798 | Use of Hardcoded Credentials — cleartext creds in source header |
OHIIHO Threat Research.
