SYMBOLCOMMON_NAMEaka. SYNONYMS
win.lokipws (Back to overview)

Loki Password Stealer (PWS)

aka: Loki, LokiPWS, LokiBot

Actor(s): SWEED, The Gorgon Group, Cobalt

URLhaus        

"Loki Bot is a commodity malware sold on underground sites which is designed to steal private data from infected machines, and then submit that info to a command and control host via HTTP POST. This private data includes stored passwords, login credential information from Web browsers, and a variety of cryptocurrency wallets." - PhishMe

Loki-Bot employs function hashing to obfuscate the libraries utilized. While not all functions are hashed, a vast majority of them are.

Loki-Bot accepts a single argument/switch of ‘-u’ that simply delays execution (sleeps) for 10 seconds. This is used when Loki-Bot is upgrading itself.

The Mutex generated is the result of MD5 hashing the Machine GUID and trimming to 24-characters. For example: “B7E1C2CC98066B250DDB2123“.

Loki-Bot creates a hidden folder within the %APPDATA% directory whose name is supplied by the 8th thru 13th characters of the Mutex. For example: “%APPDATA%\ C98066\”.

There can be four files within the hidden %APPDATA% directory at any given time: “.exe,” “.lck,” “.hdb” and “.kdb.” They will be named after characters 13 thru 18 of the Mutex. For example: “6B250D.” Below is the explanation of their purpose:

FILE EXTENSION FILE DESCRIPTION
.exe A copy of the malware that will execute every time the user account is logged into
.lck A lock file created when either decrypting Windows Credentials or Keylogging to prevent resource conflicts
.hdb A database of hashes for data that has already been exfiltrated to the C2 server
.kdb A database of keylogger data that has yet to be sent to the C2 server

If the user is privileged, Loki-Bot sets up persistence within the registry under HKEY_LOCAL_MACHINE. If not, it sets up persistence under HKEY_CURRENT_USER.

The first packet transmitted by Loki-Bot contains application data.

The second packet transmitted by Loki-Bot contains decrypted Windows credentials.

The third packet transmitted by Loki-Bot is the malware requesting C2 commands from the C2 server. By default, Loki-Bot will send this request out every 10 minutes after the initial packet it sent.

Communications to the C2 server from the compromised host contain information about the user and system including the username, hostname, domain, screen resolution, privilege level, system architecture, and Operating System.

The first WORD of the HTTP Payload represents the Loki-Bot version.

The second WORD of the HTTP Payload is the Payload Type. Below is the table of identified payload types:

BYTE PAYLOAD TYPE
0x26 Stolen Cryptocurrency Wallet
0x27 Stolen Application Data
0x28 Get C2 Commands from C2 Server
0x29 Stolen File
0x2A POS (Point of Sale?)
0x2B Keylogger Data
0x2C Screenshot

The 11th byte of the HTTP Payload begins the Binary ID. This might be useful in tracking campaigns or specific threat actors. This value value is typically “ckav.ru”. If you come across a Binary ID that is different from this, take note!

Loki-Bot encrypts both the URL and the registry key used for persistence using Triple DES encryption.

The Content-Key HTTP Header value is the result of hashing the HTTP Header values that precede it. This is likely used as a protection against researchers who wish to poke and prod at Loki-Bot’s C2 infrastructure.

Loki-Bot can accept the following instructions from the C2 Server:

BYTE INSTRUCTION DESCRIPTION
0x00 Download EXE & Execute
0x01 Download DLL & Load #1
0x02 Download DLL & Load #2
0x08 Delete HDB File
0x09 Start Keylogger
0x0A Mine & Steal Data
0x0E Exit Loki-Bot
0x0F Upgrade Loki-Bot
0x10 Change C2 Polling Frequency
0x11 Delete Executables & Exit

Suricata Signatures
RULE SID RULE NAME
2024311 ET TROJAN Loki Bot Cryptocurrency Wallet Exfiltration Detected
2024312 ET TROJAN Loki Bot Application/Credential Data Exfiltration Detected M1
2024313 ET TROJAN Loki Bot Request for C2 Commands Detected M1
2024314 ET TROJAN Loki Bot File Exfiltration Detected
2024315 ET TROJAN Loki Bot Keylogger Data Exfiltration Detected M1
2024316 ET TROJAN Loki Bot Screenshot Exfiltration Detected
2024317 ET TROJAN Loki Bot Application/Credential Data Exfiltration Detected M2
2024318 ET TROJAN Loki Bot Request for C2 Commands Detected M2
2024319 ET TROJAN Loki Bot Keylogger Data Exfiltration Detected M2

References
2020-03-20BitdefenderLiviu Arsene
@online{arsene:20200320:5:46813c6, author = {Liviu Arsene}, title = {{5 Times More Coronavirus-themed Malware Reports during March}}, date = {2020-03-20}, organization = {Bitdefender}, url = {https://labs.bitdefender.com/2020/03/5-times-more-coronavirus-themed-malware-reports-during-march/?utm_campaign=twitter&utm_medium=twitter&utm_source=twitter}, language = {English}, urldate = {2020-03-26} } 5 Times More Coronavirus-themed Malware Reports during March
ostap GuLoader HawkEye Keylogger Koadic Loki Password Stealer (PWS) Nanocore RAT Remcos
2020-02-14Virus BulletinAditya K. Sood
@online{sood:20200214:lokibot:c4e5d9d, author = {Aditya K. Sood}, title = {{LokiBot: dissecting the C&C panel deployments}}, date = {2020-02-14}, organization = {Virus Bulletin}, url = {https://www.virusbulletin.com/virusbulletin/2020/02/lokibot-dissecting-cc-panel-deployments/}, language = {English}, urldate = {2020-02-25} } LokiBot: dissecting the C&C panel deployments
Loki Password Stealer (PWS)
2019-12-28Paul Burbage
@online{burbage:20191228:tale:2e5f361, author = {Paul Burbage}, title = {{The Tale of the Pija-Droid Firefinch}}, date = {2019-12-28}, url = {https://medium.com/@paul.k.burbage/the-tale-of-the-pija-droid-firefinch-4d304fde5ca2}, language = {English}, urldate = {2020-02-14} } The Tale of the Pija-Droid Firefinch
Loki Password Stealer (PWS)
2019-10-28Marco Ramilli's BlogMarco Ramilli
@online{ramilli:20191028:sweed:bce7adf, author = {Marco Ramilli}, title = {{SWEED Targeting Precision Engineering Companies in Italy}}, date = {2019-10-28}, organization = {Marco Ramilli's Blog}, url = {https://marcoramilli.com/2019/10/28/sweed-targeting-precision-engineering-companies-in-italy/}, language = {English}, urldate = {2019-12-17} } SWEED Targeting Precision Engineering Companies in Italy
Loki Password Stealer (PWS)
2019-08-10Check PointOmer Gull
@online{gull:20190810:select:56061b1, author = {Omer Gull}, title = {{SELECT code_execution FROM * USING SQLite;}}, date = {2019-08-10}, organization = {Check Point}, url = {https://research.checkpoint.com/2019/select-code_execution-from-using-sqlite/}, language = {English}, urldate = {2020-02-09} } SELECT code_execution FROM * USING SQLite;
Azorult Loki Password Stealer (PWS) Pony
2019-07-15Cisco TalosEdmund Brumaghin
@online{brumaghin:20190715:sweed:9725699, author = {Edmund Brumaghin}, title = {{SWEED: Exposing years of Agent Tesla campaigns}}, date = {2019-07-15}, organization = {Cisco Talos}, url = {https://blog.talosintelligence.com/2019/07/sweed-agent-tesla.html}, language = {English}, urldate = {2020-01-08} } SWEED: Exposing years of Agent Tesla campaigns
Agent Tesla Formbook Loki Password Stealer (PWS) SWEED
2018-12-04Brad Duncan
@online{duncan:20181204:malspam:8e2d810, author = {Brad Duncan}, title = {{Malspam pushing Lokibot malware}}, date = {2018-12-04}, url = {https://isc.sans.edu/diary/24372}, language = {English}, urldate = {2019-10-29} } Malspam pushing Lokibot malware
Loki Password Stealer (PWS)
2018-08-29Kaspersky LabsTatyana Shcherbakova
@online{shcherbakova:20180829:loki:c239728, author = {Tatyana Shcherbakova}, title = {{Loki Bot: On a hunt for corporate passwords}}, date = {2018-08-29}, organization = {Kaspersky Labs}, url = {https://securelist.com/loki-bot-stealing-corporate-passwords/87595/}, language = {English}, urldate = {2019-12-20} } Loki Bot: On a hunt for corporate passwords
Loki Password Stealer (PWS)
2018-08-02Palo Alto Networks Unit 42Robert Falcone, David Fuertes, Josh Grunzweig, Kyle Wilhoit
@online{falcone:20180802:gorgon:06112b1, author = {Robert Falcone and David Fuertes and Josh Grunzweig and Kyle Wilhoit}, title = {{The Gorgon Group: Slithering Between Nation State and Cybercrime}}, date = {2018-08-02}, organization = {Palo Alto Networks Unit 42}, url = {https://researchcenter.paloaltonetworks.com/2018/08/unit42-gorgon-group-slithering-nation-state-cybercrime/}, language = {English}, urldate = {2019-12-20} } The Gorgon Group: Slithering Between Nation State and Cybercrime
Loki Password Stealer (PWS) Nanocore RAT NjRAT Quasar RAT Remcos Revenge RAT
2018-07-06Github (d00rt)d00rt
@techreport{d00rt:20180706:lokibot:6508667, author = {d00rt}, title = {{LokiBot Infostealer Jihacked Version}}, date = {2018-07-06}, institution = {Github (d00rt)}, url = {https://github.com/d00rt/hijacked_lokibot_version/blob/master/doc/LokiBot_hijacked_2018.pdf}, language = {English}, urldate = {2020-01-10} } LokiBot Infostealer Jihacked Version
Loki Password Stealer (PWS)
2017-12-19LastlineAndy Norton
@online{norton:20171219:novel:2a852a7, author = {Andy Norton}, title = {{Novel Excel Spreadsheet Attack Launches Password Stealing Malware Loki Bot}}, date = {2017-12-19}, organization = {Lastline}, url = {https://www.lastline.com/blog/password-stealing-malware-loki-bot/}, language = {English}, urldate = {2020-01-13} } Novel Excel Spreadsheet Attack Launches Password Stealing Malware Loki Bot
Loki Password Stealer (PWS)
2017-06-22SANS Institute Information Security Reading RoomRob Pantazopoulos
@online{pantazopoulos:20170622:lokibot:cb24973, author = {Rob Pantazopoulos}, title = {{Loki-Bot: InformationStealer, Keylogger, &More!}}, date = {2017-06-22}, organization = {SANS Institute Information Security Reading Room}, url = {https://www.sans.org/reading-room/whitepapers/malicious/loki-bot-information-stealer-keylogger-more-37850}, language = {English}, urldate = {2019-07-11} } Loki-Bot: InformationStealer, Keylogger, &More!
Loki Password Stealer (PWS)
2017-05-17FortinetXiaopeng Zhang, Hua Liu
@online{zhang:20170517:new:15004ed, author = {Xiaopeng Zhang and Hua Liu}, title = {{New Loki Variant Being Spread via PDF File}}, date = {2017-05-17}, organization = {Fortinet}, url = {https://blog.fortinet.com/2017/05/17/new-loki-variant-being-spread-via-pdf-file}, language = {English}, urldate = {2020-01-05} } New Loki Variant Being Spread via PDF File
Loki Password Stealer (PWS)
2017-05-07R3MRUMR3MRUM
@online{r3mrum:20170507:lokibot:5a6975d, author = {R3MRUM}, title = {{Loki-Bot: Come out, come out, wherever you are!}}, date = {2017-05-07}, organization = {R3MRUM}, url = {https://r3mrum.wordpress.com/2017/05/07/loki-bot-atrifacts/}, language = {English}, urldate = {2020-01-12} } Loki-Bot: Come out, come out, wherever you are!
Loki Password Stealer (PWS)
2017-05-05Github (R3MRUM)R3MRUM
@online{r3mrum:20170505:lokiparse:c8a2916, author = {R3MRUM}, title = {{loki-parse}}, date = {2017-05-05}, organization = {Github (R3MRUM)}, url = {https://github.com/R3MRUM/loki-parse}, language = {English}, urldate = {2019-11-29} } loki-parse
Loki Password Stealer (PWS)
2017-03-23CofenseCofense
@online{cofense:20170323:tales:cbdee9a, author = {Cofense}, title = {{Tales from the Trenches: Loki Bot Malware}}, date = {2017-03-23}, organization = {Cofense}, url = {https://phishme.com/loki-bot-malware/}, language = {English}, urldate = {2019-12-02} } Tales from the Trenches: Loki Bot Malware
Loki Password Stealer (PWS)
2017-02-16CysinfoWinston M
@online{m:20170216:nefarious:a0ed57b, author = {Winston M}, title = {{Nefarious Macro Malware drops “Loki Bot” to steal sensitive information across GCC countries!}}, date = {2017-02-16}, organization = {Cysinfo}, url = {https://cysinfo.com/nefarious-macro-malware-drops-loki-bot-across-gcc-countries/}, language = {English}, urldate = {2019-10-23} } Nefarious Macro Malware drops “Loki Bot” to steal sensitive information across GCC countries!
Loki Password Stealer (PWS)
Yara Rules
[TLP:WHITE] win_lokipws_auto (20190204 | autogenerated rule brought to you by yara-signator)
rule win_lokipws_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2019-11-26"
        version = "1"
        description = "autogenerated rule brought to you by yara-signator"
        tool = "yara-signator 0.1a"
        malpedia_reference = "https://malpedia.caad.fkie.fraunhofer.de/details/win.lokipws"
        malpedia_version = "20190204"
        malpedia_license = "CC BY-NC-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 / approach will be published in the near future 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 = { 0f8482030000 57 57 68bc8ab1ce 57 893d???????? 893d???????? }
            // n = 7, score = 100
            //   0f8482030000         | je                  0x388
            //   57                   | push                edi
            //   57                   | push                edi
            //   68bc8ab1ce           | push                0xceb18abc
            //   57                   | push                edi
            //   893d????????         |                     
            //   893d????????         |                     

        $sequence_1 = { 59 33db 43 68b85a4100 57 e8???????? 59 }
            // n = 7, score = 100
            //   59                   | pop                 ecx
            //   33db                 | xor                 ebx, ebx
            //   43                   | inc                 ebx
            //   68b85a4100           | push                0x415ab8
            //   57                   | push                edi
            //   e8????????           |                     
            //   59                   | pop                 ecx

        $sequence_2 = { e8???????? 83c40c 56 e8???????? 59 e9???????? 53 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   83c40c               | add                 esp, 0xc
            //   56                   | push                esi
            //   e8????????           |                     
            //   59                   | pop                 ecx
            //   e9????????           |                     
            //   53                   | push                ebx

        $sequence_3 = { 894508 3b4714 72a2 5b 5f 5e }
            // n = 6, score = 100
            //   894508               | mov                 dword ptr [ebp + 8], eax
            //   3b4714               | cmp                 eax, dword ptr [edi + 0x14]
            //   72a2                 | jb                  0xffffffa4
            //   5b                   | pop                 ebx
            //   5f                   | pop                 edi
            //   5e                   | pop                 esi

        $sequence_4 = { 56 e8???????? 03c0 8945fc 8d7802 57 e8???????? }
            // n = 7, score = 100
            //   56                   | push                esi
            //   e8????????           |                     
            //   03c0                 | add                 eax, eax
            //   8945fc               | mov                 dword ptr [ebp - 4], eax
            //   8d7802               | lea                 edi, [eax + 2]
            //   57                   | push                edi
            //   e8????????           |                     

        $sequence_5 = { 58 668945a4 6a72 58 668975a0 33f6 668945a6 }
            // n = 7, score = 100
            //   58                   | pop                 eax
            //   668945a4             | mov                 word ptr [ebp - 0x5c], ax
            //   6a72                 | push                0x72
            //   58                   | pop                 eax
            //   668975a0             | mov                 word ptr [ebp - 0x60], si
            //   33f6                 | xor                 esi, esi
            //   668945a6             | mov                 word ptr [ebp - 0x5a], ax

        $sequence_6 = { ff35???????? e8???????? 56 e8???????? 83c41c ff75f8 }
            // n = 6, score = 100
            //   ff35????????         |                     
            //   e8????????           |                     
            //   56                   | push                esi
            //   e8????????           |                     
            //   83c41c               | add                 esp, 0x1c
            //   ff75f8               | push                dword ptr [ebp - 8]

        $sequence_7 = { ff7508 ffd0 5d c3 55 8bec 8b550c }
            // n = 7, score = 100
            //   ff7508               | push                dword ptr [ebp + 8]
            //   ffd0                 | call                eax
            //   5d                   | pop                 ebp
            //   c3                   | ret                 
            //   55                   | push                ebp
            //   8bec                 | mov                 ebp, esp
            //   8b550c               | mov                 edx, dword ptr [ebp + 0xc]

        $sequence_8 = { 53 56 ffd0 8b35???????? bbbc8ab1ce 57 57 }
            // n = 7, score = 100
            //   53                   | push                ebx
            //   56                   | push                esi
            //   ffd0                 | call                eax
            //   8b35????????         |                     
            //   bbbc8ab1ce           | mov                 ebx, 0xceb18abc
            //   57                   | push                edi
            //   57                   | push                edi

        $sequence_9 = { e8???????? 8d4dfc 51 56 ffd0 }
            // n = 5, score = 100
            //   e8????????           |                     
            //   8d4dfc               | lea                 ecx, [ebp - 4]
            //   51                   | push                ecx
            //   56                   | push                esi
            //   ffd0                 | call                eax

    condition:
        7 of them
}
Download all Yara Rules