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

#ClassImpactStatus
1W0rm prepend — unauthenticated RCE + exfil at global scopePre-auth RCELive-proven
2Unvalidated include via GET parameter — LFI/RFI on line 1Pre-auth file read / RCEConfirmed
3Hardcoded cleartext credentials r57:r57 in source headerCredential exposureConfirmed
4Auth disabled by default ($auth=0)No access controlConfirmed
5PHP 5.6 only — set_magic_quotes_runtime fatal on PHP 7+Accidental neutralizationConfirmed

Detection Surface

File-system indicators

IndicatorTypeDetail
SHA256Hashd7faf51af1dc899f75714d5dd3e07a79e45f2d4770c98ec44e1e9814eae356be
Expected size~112 KBSource variant (r57shell 1.24)
$hexdtimeVariabler57-family specific variable
$name=, $pass= with MD5 hashesAuthCredential pair in source header
ec371748dc2da624b35a4f8f685dd122MD5 hashDefault credential hash (r57shell v1.24)
curl_init("file://".$_POST['test1_file'])Code patternLocal file inclusion via cURL
$auth=0VariableAuthentication disabled by default
Cyrillic commentsStringRussian-language UI labels — identifies Russian-scene origin
@eval($eval);}Code patternEnd-of-function eval pattern (r57-specific)
Null-byte LFI (Mohajer22)Code patterncurl_init("file:///".$m."\x00/../../")
Obfuscated variantCode pattern$hf3b3800="\142\x61\x73\x65\66\64\137\x64\x65\143\x6f\x64\x65" (hex-encoded “base64_decode”)
Multiple forksFile namesr57_kartal.php, r57_iFX.php, r57_Mohajer22.php, r57_original.php
RuntimePHP 5.6 onlyset_magic_quotes_runtime removed in PHP 7

HTTP access-log indicators

Log patternWhat it means
POST test1_file=Local file inclusion via curl_init("file://")
$auth=0Authentication disabled by default
$name= / $pass=MD5 hashed credentials in source header
POST cmd=Command execution
Cyrillic text in response bodyRussian-language UI comments and labels
Response: r57shell in titleShell 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

TechniqueContext
T1505.003Web Shell
T1041Exfiltration Over C2 Channel (W0rm mail exfil)
T1059.004Command 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.

CWEWeakness
CWE-98PHP Remote File Inclusion — pre-auth include on line 1
CWE-22Path Traversal — unvalidated user-controlled file path
CWE-798Use of Hardcoded Credentials — cleartext creds in source header

OHIIHO Threat Research.