SYMBOLCOMMON_NAMEaka. SYNONYMS
win.foalshell (Back to overview)

FoalShell

Actor(s): YoroTrooper

VTCollection    

According to BI.ZONE, FoalShell is a simple reverse shell used by Cavalry Werewolf, written in Go, C++, and C#. FoalShell allows attackers to execute arbitrary commands in the cmd.exe command line interpreter on a compromised host.

References
2025-10-02 ⋅ Medium BI.ZONE ⋅ BI.ZONE
Cavalry Werewolf raids Russia’s public sector with trusted relationship attacks
FoalShell StallionRAT YoroTrooper
Yara Rules
[TLP:WHITE] win_foalshell_auto (20260917 | Detects win.foalshell.)
rule win_foalshell_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.foalshell."
        info = "autogenerated rule brought to you by yara-signator"
        tool = "yara-signator v0.6.0"
        signator_config = "callsandjumps;datarefs;binvalue"
        malpedia_reference = "https://malpedia.caad.fkie.fraunhofer.de/details/win.foalshell"
        malpedia_rule_date = "20260916"
        malpedia_hash = "53a643781c18e08f4a50949af60172d837a0b6f6"
        malpedia_version = "20260917"
        malpedia_license = "CC BY-SA 4.0"
        malpedia_sharing = "TLP:WHITE"

    /* DISCLAIMER
     * The strings used in this rule have been automatically selected from the
     * disassembly of memory dumps and unpacked files, using YARA-Signator.
     * The code and documentation is published here:
     * https://github.com/fxb-cocacoding/yara-signator
     * As Malpedia is used as data source, please note that for a given
     * number of families, only single samples are documented.
     * This likely impacts the degree of generalization these rules will offer.
     * Take the described generation method also into consideration when you
     * apply the rules in your use cases and assign them confidence levels.
     */


    strings:
        $sequence_0 = { 488d156de00000 33c9 ff15???????? 488b4c2448 }
            // n = 4, score = 100
            //   488d156de00000       | cmp                 dword ptr [ecx], eax
            //   33c9                 | dec                 eax
            //   ff15????????         |                     
            //   488b4c2448           | mov                 eax, dword ptr [esp + 0x10]

        $sequence_1 = { 488d153a9b0000 e8???????? 85c0 7430 448bc3 }
            // n = 5, score = 100
            //   488d153a9b0000       | jne                 0xb4a
            //   e8????????           |                     
            //   85c0                 | dec                 eax
            //   7430                 | lea                 ecx, [0x18d53]
            //   448bc3               | jmp                 0xb55

        $sequence_2 = { 488d1506aa0000 488d0ddfa90000 e8???????? 488d1503aa0000 488d0df4a90000 }
            // n = 5, score = 100
            //   488d1506aa0000       | lea                 ecx, [eax + 8]
            //   488d0ddfa90000       | dec                 eax
            //   e8????????           |                     
            //   488d1503aa0000       | lea                 edx, [0x1928e]
            //   488d0df4a90000       | jmp                 0xb1f

        $sequence_3 = { 7350 488bca 4c8d0565230100 83e13f 488bc2 48c1f806 }
            // n = 6, score = 100
            //   7350                 | dec                 eax
            //   488bca               | mov                 dword ptr [esp + 0x10], edx
            //   4c8d0565230100       | dec                 eax
            //   83e13f               | mov                 dword ptr [esp + 8], ecx
            //   488bc2               | push                edi
            //   48c1f806             | dec                 eax

        $sequence_4 = { 4c8bfe 49c1ff06 488d0d251a0100 83e03f 4c8d24c0 4a8b04f9 42f644e03801 }
            // n = 7, score = 100
            //   4c8bfe               | dec                 edx
            //   49c1ff06             | lea                 ebx, [edi*8 + 0x1f480]
            //   488d0d251a0100       | je                  0x22a
            //   83e03f               | dec                 esp
            //   4c8d24c0             | lea                 ebp, [0xffff5310]
            //   4a8b04f9             | mov                 edi, dword ptr [esi]
            //   42f644e03801         | dec                 ecx

        $sequence_5 = { 488d4c2420 e8???????? 90 4883c460 5f }
            // n = 5, score = 100
            //   488d4c2420           | mov                 ecx, edi
            //   e8????????           |                     
            //   90                   | dec                 esp
            //   4883c460             | lea                 eax, [0xffff286a]
            //   5f                   | dec                 edx

        $sequence_6 = { e9???????? 4c8d05d0170100 498bcd 498bc5 }
            // n = 4, score = 100
            //   e9????????           |                     
            //   4c8d05d0170100       | and                 ecx, 0xfffffffc
            //   498bcd               | dec                 ecx
            //   498bc5               | sub                 eax, ecx

        $sequence_7 = { e8???????? 488b442430 488d0dc7f90000 488908 488b442430 }
            // n = 5, score = 100
            //   e8????????           |                     
            //   488b442430           | dec                 eax
            //   488d0dc7f90000       | lea                 eax, [0x1dc03]
            //   488908               | dec                 eax
            //   488b442430           | mov                 dword ptr [esp + 0x48], eax

        $sequence_8 = { 7519 48c744242000000000 4533c9 4533c0 33d2 33c9 }
            // n = 6, score = 100
            //   7519                 | lea                 eax, [0x117ca]
            //   48c744242000000000     | dec    eax
            //   4533c9               | cmp                 ebx, eax
            //   4533c0               | jne                 0x1c5
            //   33d2                 | dec                 ecx
            //   33c9                 | mov                 ebp, dword ptr [ebp + edi*8 + 0x15ae0]

        $sequence_9 = { 488bcb e8???????? 837b1000 75dd 488d0573340100 483bd8 74d1 }
            // n = 7, score = 100
            //   488bcb               | lea                 esp, [0x15262]
            //   e8????????           |                     
            //   837b1000             | inc                 esp
            //   75dd                 | mov                 esi, ebx
            //   488d0573340100       | dec                 ecx
            //   483bd8               | mov                 eax, esp
            //   74d1                 | lea                 ebp, [ebx + 1]

    condition:
        7 of them and filesize < 520192
}
Download all Yara Rules