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 Mirage
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 Mirage
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 Mirage
Yara Rules
[TLP:WHITE] win_royalcli_auto (20211008 | Detects win.royalcli.)
rule win_royalcli_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2021-10-07"
        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 = "20211007"
        malpedia_hash = "e5b790e0f888f252d49063a1251ca60ec2832535"
        malpedia_version = "20211008"
        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 = { 8d8de8feffff 8d9df0feffff e8???????? 8b9db0feffff 83c410 }
            // n = 5, score = 100
            //   8d8de8feffff         | lea                 ecx, dword ptr [ebp - 0x118]
            //   8d9df0feffff         | lea                 ebx, dword ptr [ebp - 0x110]
            //   e8????????           |                     
            //   8b9db0feffff         | mov                 ebx, dword ptr [ebp - 0x150]
            //   83c410               | add                 esp, 0x10

        $sequence_1 = { 68???????? 6a04 6a00 68???????? ffd7 8b742414 }
            // n = 6, score = 100
            //   68????????           |                     
            //   6a04                 | push                4
            //   6a00                 | push                0
            //   68????????           |                     
            //   ffd7                 | call                edi
            //   8b742414             | mov                 esi, dword ptr [esp + 0x14]

        $sequence_2 = { 6a02 6800000080 8d8df4feffff 51 ff15???????? 83f8ff 7465 }
            // n = 7, score = 100
            //   6a02                 | push                2
            //   6800000080           | push                0x80000000
            //   8d8df4feffff         | lea                 ecx, dword ptr [ebp - 0x10c]
            //   51                   | push                ecx
            //   ff15????????         |                     
            //   83f8ff               | cmp                 eax, -1
            //   7465                 | je                  0x67

        $sequence_3 = { 89bdd4feffff 89bdd0feffff 8bbdb4feffff 686c000100 6a00 57 }
            // n = 6, score = 100
            //   89bdd4feffff         | mov                 dword ptr [ebp - 0x12c], edi
            //   89bdd0feffff         | mov                 dword ptr [ebp - 0x130], edi
            //   8bbdb4feffff         | mov                 edi, dword ptr [ebp - 0x14c]
            //   686c000100           | push                0x1006c
            //   6a00                 | push                0
            //   57                   | push                edi

        $sequence_4 = { eb38 3c40 7604 2c41 eb30 3c3d 7506 }
            // n = 7, score = 100
            //   eb38                 | jmp                 0x3a
            //   3c40                 | cmp                 al, 0x40
            //   7604                 | jbe                 6
            //   2c41                 | sub                 al, 0x41
            //   eb30                 | jmp                 0x32
            //   3c3d                 | cmp                 al, 0x3d
            //   7506                 | jne                 8

        $sequence_5 = { 52 8d45d4 50 68???????? 68???????? ff15???????? 8b8db8f9ffff }
            // n = 7, score = 100
            //   52                   | push                edx
            //   8d45d4               | lea                 eax, dword ptr [ebp - 0x2c]
            //   50                   | push                eax
            //   68????????           |                     
            //   68????????           |                     
            //   ff15????????         |                     
            //   8b8db8f9ffff         | mov                 ecx, dword ptr [ebp - 0x648]

        $sequence_6 = { 80e30f 02db 41 02db eb1d }
            // n = 5, score = 100
            //   80e30f               | and                 bl, 0xf
            //   02db                 | add                 bl, bl
            //   41                   | inc                 ecx
            //   02db                 | add                 bl, bl
            //   eb1d                 | jmp                 0x1f

        $sequence_7 = { c784bb0801000000000000 8bcb e8???????? 33c0 8985d4feffff 8985ccfeffff }
            // n = 6, score = 100
            //   c784bb0801000000000000     | mov    dword ptr [ebx + edi*4 + 0x108], 0
            //   8bcb                 | mov                 ecx, ebx
            //   e8????????           |                     
            //   33c0                 | xor                 eax, eax
            //   8985d4feffff         | mov                 dword ptr [ebp - 0x12c], eax
            //   8985ccfeffff         | mov                 dword ptr [ebp - 0x134], eax

        $sequence_8 = { 83f001 eb09 85c9 7405 3521100000 42 3bd7 }
            // n = 7, score = 100
            //   83f001               | xor                 eax, 1
            //   eb09                 | jmp                 0xb
            //   85c9                 | test                ecx, ecx
            //   7405                 | je                  7
            //   3521100000           | xor                 eax, 0x1021
            //   42                   | inc                 edx
            //   3bd7                 | cmp                 edx, edi

        $sequence_9 = { 8b4dec 51 ffd6 5e b801000000 5f 8b4dfc }
            // n = 7, score = 100
            //   8b4dec               | mov                 ecx, dword ptr [ebp - 0x14]
            //   51                   | push                ecx
            //   ffd6                 | call                esi
            //   5e                   | pop                 esi
            //   b801000000           | mov                 eax, 1
            //   5f                   | pop                 edi
            //   8b4dfc               | mov                 ecx, dword ptr [ebp - 4]

    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