SYMBOLCOMMON_NAMEaka. SYNONYMS
win.royalcli (Back to overview)

RoyalCli

Actor(s): Mirage


RoyalCli is a backdoor which appears to be an evolution of BS2005 and uses familiar encryption and encoding routines. The name RoyalCli was chosen by us due to a debugging path left in the binary. RoyalCli and BS2005 both communicate with the attacker's command and control (C2) through Internet Explorer (IE) by using the COM interface IWebBrowser2.

References
2020SecureworksSecureWorks
@online{secureworks:2020:bronze:134ec2b, author = {SecureWorks}, title = {{BRONZE PALACE}}, date = {2020}, organization = {Secureworks}, url = {https://www.secureworks.com/research/threat-profiles/bronze-palace}, language = {English}, urldate = {2020-05-23} } BRONZE PALACE
BS2005 Enfal Mirage RoyalCli Royal DNS APT15
2018-03-16Github (nccgroup)NCC Group PLC
@online{plc:20180316:royal:7ff57f8, author = {NCC Group PLC}, title = {{Royal APT - APT15 Repository}}, date = {2018-03-16}, organization = {Github (nccgroup)}, url = {https://github.com/nccgroup/Royal_APT}, language = {English}, urldate = {2020-01-09} } Royal APT - APT15 Repository
BS2005 MS Exchange Tool RoyalCli Royal DNS APT15
2018-03-10NCC GroupRob Smallridge
@online{smallridge:20180310:apt15:e5e7ef0, author = {Rob Smallridge}, title = {{APT15 is alive and strong: An analysis of RoyalCli and RoyalDNS}}, date = {2018-03-10}, organization = {NCC Group}, url = {https://research.nccgroup.com/2018/03/10/apt15-is-alive-and-strong-an-analysis-of-royalcli-and-royaldns/}, language = {English}, urldate = {2021-04-29} } APT15 is alive and strong: An analysis of RoyalCli and RoyalDNS
BS2005 MS Exchange Tool RoyalCli Royal DNS APT15
Yara Rules
[TLP:WHITE] win_royalcli_auto (20230125 | Detects win.royalcli.)
rule win_royalcli_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2023-01-25"
        version = "1"
        description = "Detects win.royalcli."
        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.royalcli"
        malpedia_rule_date = "20230124"
        malpedia_hash = "2ee0eebba83dce3d019a90519f2f972c0fcf9686"
        malpedia_version = "20230125"
        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 = { 8995d0feffff 8985d4feffff e9???????? 33f6 33c0 8985ccfeffff }
            // n = 6, score = 100
            //   8995d0feffff         | mov                 dword ptr [ebp - 0x130], edx
            //   8985d4feffff         | mov                 dword ptr [ebp - 0x12c], eax
            //   e9????????           |                     
            //   33f6                 | xor                 esi, esi
            //   33c0                 | xor                 eax, eax
            //   8985ccfeffff         | mov                 dword ptr [ebp - 0x134], eax

        $sequence_1 = { ffd6 8d85d4f6ffff 50 ffd6 8d8df4f6ffff }
            // n = 5, score = 100
            //   ffd6                 | call                esi
            //   8d85d4f6ffff         | lea                 eax, [ebp - 0x92c]
            //   50                   | push                eax
            //   ffd6                 | call                esi
            //   8d8df4f6ffff         | lea                 ecx, [ebp - 0x90c]

        $sequence_2 = { 881431 41 48 7414 }
            // n = 4, score = 100
            //   881431               | mov                 byte ptr [ecx + esi], dl
            //   41                   | inc                 ecx
            //   48                   | dec                 eax
            //   7414                 | je                  0x16

        $sequence_3 = { 66894df8 ff15???????? 8bf0 83feff 0f84f9000000 85f6 }
            // n = 6, score = 100
            //   66894df8             | mov                 word ptr [ebp - 8], cx
            //   ff15????????         |                     
            //   8bf0                 | mov                 esi, eax
            //   83feff               | cmp                 esi, -1
            //   0f84f9000000         | je                  0xff
            //   85f6                 | test                esi, esi

        $sequence_4 = { 6a03 6a00 6a02 6800000080 8d95e0feffff 52 ffd3 }
            // n = 7, score = 100
            //   6a03                 | push                3
            //   6a00                 | push                0
            //   6a02                 | push                2
            //   6800000080           | push                0x80000000
            //   8d95e0feffff         | lea                 edx, [ebp - 0x120]
            //   52                   | push                edx
            //   ffd3                 | call                ebx

        $sequence_5 = { 8bd8 56 899dccfeffff e8???????? 83c414 81fb00000100 0f8f9b000000 }
            // n = 7, score = 100
            //   8bd8                 | mov                 ebx, eax
            //   56                   | push                esi
            //   899dccfeffff         | mov                 dword ptr [ebp - 0x134], ebx
            //   e8????????           |                     
            //   83c414               | add                 esp, 0x14
            //   81fb00000100         | cmp                 ebx, 0x10000
            //   0f8f9b000000         | jg                  0xa1

        $sequence_6 = { 39b5b8feffff 752b 8b8b00010000 89b48b08010000 }
            // n = 4, score = 100
            //   39b5b8feffff         | cmp                 dword ptr [ebp - 0x148], esi
            //   752b                 | jne                 0x2d
            //   8b8b00010000         | mov                 ecx, dword ptr [ebx + 0x100]
            //   89b48b08010000       | mov                 dword ptr [ebx + ecx*4 + 0x108], esi

        $sequence_7 = { 33c9 33f6 3908 0f8ea4000000 }
            // n = 4, score = 100
            //   33c9                 | xor                 ecx, ecx
            //   33f6                 | xor                 esi, esi
            //   3908                 | cmp                 dword ptr [eax], ecx
            //   0f8ea4000000         | jle                 0xaa

        $sequence_8 = { 83c40c 8d85e0feffff 50 8d4de8 51 }
            // n = 5, score = 100
            //   83c40c               | add                 esp, 0xc
            //   8d85e0feffff         | lea                 eax, [ebp - 0x120]
            //   50                   | push                eax
            //   8d4de8               | lea                 ecx, [ebp - 0x18]
            //   51                   | push                ecx

        $sequence_9 = { 72dd 8b4508 8908 33c0 33d2 8bf9 85c9 }
            // n = 7, score = 100
            //   72dd                 | jb                  0xffffffdf
            //   8b4508               | mov                 eax, dword ptr [ebp + 8]
            //   8908                 | mov                 dword ptr [eax], ecx
            //   33c0                 | xor                 eax, eax
            //   33d2                 | xor                 edx, edx
            //   8bf9                 | mov                 edi, ecx
            //   85c9                 | test                ecx, ecx

    condition:
        7 of them and filesize < 204800
}
[TLP:WHITE] win_royalcli_w0   (20180312 | Detects malware from APT 15 report by NCC Group)
import "pe"

rule win_royalcli_w0 {
    meta:
        description = "Detects malware from APT 15 report by NCC Group"
        author = "Florian Roth"
        reference = "https://goo.gl/HZ5XMN"
        date = "2018-03-10"
        hash = "6df9b712ff56009810c4000a0ad47e41b7a6183b69416251e060b5c80cd05785"
        malpedia_reference = "https://malpedia.caad.fkie.fraunhofer.de/details/win.royalcli"
        malpedia_version = "20180312"
        malpedia_license = "CC BY-NC-SA 4.0"
        malpedia_sharing = "TLP:WHITE"
    strings:
        $s1 = "\\Release\\RoyalCli.pdb" ascii
        $s2 = "%snewcmd.exe" fullword ascii
        $s3 = "Run cmd error %d" fullword ascii
        $s4 = "%s~clitemp%08x.ini" fullword ascii
        $s5 = "run file failed" fullword ascii
        $s6 = "Cmd timeout %d" fullword ascii
        $s7 = "2 %s  %d 0 %d" fullword ascii
    condition:
        2 of them
}
Download all Yara Rules