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 (20230407 | Detects win.royalcli.)
rule win_royalcli_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2023-03-28"
        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 = "20230328"
        malpedia_hash = "9d2d75cef573c1c2d861f5197df8f563b05a305d"
        malpedia_version = "20230407"
        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 = { 305de6 0fb65c05e7 305de7 83f810 }
            // n = 4, score = 100
            //   305de6               | xor                 byte ptr [ebp - 0x1a], bl
            //   0fb65c05e7           | movzx               ebx, byte ptr [ebp + eax - 0x19]
            //   305de7               | xor                 byte ptr [ebp - 0x19], bl
            //   83f810               | cmp                 eax, 0x10

        $sequence_1 = { 8a4f01 47 84c9 75f8 8bf2 e9???????? }
            // n = 6, score = 100
            //   8a4f01               | mov                 cl, byte ptr [edi + 1]
            //   47                   | inc                 edi
            //   84c9                 | test                cl, cl
            //   75f8                 | jne                 0xfffffffa
            //   8bf2                 | mov                 esi, edx
            //   e9????????           |                     

        $sequence_2 = { 33f6 ff15???????? e9???????? 3d00000100 0f8f2bffffff 0f8430010000 2d01010000 }
            // n = 7, score = 100
            //   33f6                 | xor                 esi, esi
            //   ff15????????         |                     
            //   e9????????           |                     
            //   3d00000100           | cmp                 eax, 0x10000
            //   0f8f2bffffff         | jg                  0xffffff31
            //   0f8430010000         | je                  0x136
            //   2d01010000           | sub                 eax, 0x101

        $sequence_3 = { 8d959cfeffff 52 50 8b8194000000 }
            // n = 4, score = 100
            //   8d959cfeffff         | lea                 edx, [ebp - 0x164]
            //   52                   | push                edx
            //   50                   | push                eax
            //   8b8194000000         | mov                 eax, dword ptr [ecx + 0x94]

        $sequence_4 = { c70000000000 ff15???????? e9???????? 8d95ccfeffff 52 68???????? 8d45d4 }
            // n = 7, score = 100
            //   c70000000000         | mov                 dword ptr [eax], 0
            //   ff15????????         |                     
            //   e9????????           |                     
            //   8d95ccfeffff         | lea                 edx, [ebp - 0x134]
            //   52                   | push                edx
            //   68????????           |                     
            //   8d45d4               | lea                 eax, [ebp - 0x2c]

        $sequence_5 = { a1???????? 33c4 89842448010000 53 56 57 8d4c2430 }
            // n = 7, score = 100
            //   a1????????           |                     
            //   33c4                 | xor                 eax, esp
            //   89842448010000       | mov                 dword ptr [esp + 0x148], eax
            //   53                   | push                ebx
            //   56                   | push                esi
            //   57                   | push                edi
            //   8d4c2430             | lea                 ecx, [esp + 0x30]

        $sequence_6 = { 57 56 e8???????? c1f805 56 8d3c85c04b4100 }
            // n = 6, score = 100
            //   57                   | push                edi
            //   56                   | push                esi
            //   e8????????           |                     
            //   c1f805               | sar                 eax, 5
            //   56                   | push                esi
            //   8d3c85c04b4100       | lea                 edi, [eax*4 + 0x414bc0]

        $sequence_7 = { 8bf7 83e61f c1e606 033485c04b4100 c745e401000000 }
            // n = 5, score = 100
            //   8bf7                 | mov                 esi, edi
            //   83e61f               | and                 esi, 0x1f
            //   c1e606               | shl                 esi, 6
            //   033485c04b4100       | add                 esi, dword ptr [eax*4 + 0x414bc0]
            //   c745e401000000       | mov                 dword ptr [ebp - 0x1c], 1

        $sequence_8 = { 33c0 8985ccfeffff 8985d4feffff 8985d0feffff e9???????? 8b95b4feffff 52 }
            // n = 7, score = 100
            //   33c0                 | xor                 eax, eax
            //   8985ccfeffff         | mov                 dword ptr [ebp - 0x134], eax
            //   8985d4feffff         | mov                 dword ptr [ebp - 0x12c], eax
            //   8985d0feffff         | mov                 dword ptr [ebp - 0x130], eax
            //   e9????????           |                     
            //   8b95b4feffff         | mov                 edx, dword ptr [ebp - 0x14c]
            //   52                   | push                edx

        $sequence_9 = { 51 6a14 8d55e8 52 }
            // n = 4, score = 100
            //   51                   | push                ecx
            //   6a14                 | push                0x14
            //   8d55e8               | lea                 edx, [ebp - 0x18]
            //   52                   | push                edx

    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