Loki  by boku7

C2 framework for script-jacking vulnerable Electron apps

created 4 months ago
1,149 stars

Top 34.3% on sourcepulse

GitHubView on GitHub
Project Summary

Loki is a Node.js-based command and control (C2) framework designed for red team operations, specifically targeting vulnerable Electron applications. It enables script-jacking to backdoor or hollow out signed Electron apps without invalidating their code-signing signatures, offering an evasion technique against security software and application controls.

How It Works

Loki leverages script-jacking by modifying JavaScript files within Electron applications at runtime to inject arbitrary Node.js code. This approach allows for persistent backdooring and execution within the context of a trusted, signed application. The framework operates without a traditional teamserver, with both the GUI client and agents communicating directly with a data store, such as Azure Storage Blob, protected by SAS tokens.

Quick Start & Requirements

  • Installation: Clone the repository, install Node.js, and run npm install --save-dev javascript-obfuscator.
  • Prerequisites: Node.js, Azure Storage Blob account and SAS token.
  • Setup: Requires creating an Azure Storage Blob account and generating a SAS token. The obfuscateAgent.js script is used to create the payload.
  • Resources: Blog Post, Video by John Hammond, Video by Simon Exley & Clinton Elves

Highlighted Details

  • Utilizes Azure Storage Blob as a C2 channel with AES encrypted messages and proxy-aware agents.
  • Supports teamserver-less architecture and hidden execution via Chromium renderer child processes.
  • Commands are written in native Node.js, with exceptions for scexec and assembly requiring keytar.node and assembly.node.
  • Includes a method to keep the original Electron application running alongside the Loki agent, demonstrated with Cursor.

Maintenance & Community

  • Maintainers: Bobby Cooke (Creator), Dylan Tran (Creator).
  • Contributors: Ellis Springe, Shawn Jones, Simon Exley, Clinton Elves, John Hammond.
  • Community: Links to Discord/Slack are not explicitly provided in the README.

Licensing & Compatibility

  • License: Business Source License 1.1 (BSL 1.1). Non-commercial use is permitted. Commercial use requires explicit author permission. Converts to Apache 2.0 on April 3, 2030.
  • Compatibility: Designed for red team operations; commercial use is restricted without permission.

Limitations & Caveats

The effectiveness of backdooring relies on identifying vulnerable Electron applications, as newer versions may implement integrity checks. The README notes that older versions are more likely to be vulnerable. Some applications like 1Password, Signal, Slack, and Notion are listed as not vulnerable.

Health Check
Last commit

1 month ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
1
Star History
230 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Jeremy Howard Jeremy Howard(Cofounder of fast.ai), and
1 more.

code-interpreter by e2b-dev

0.4%
2k
SDK for running AI-generated code in secure cloud sandboxes
created 1 year ago
updated 2 weeks ago
Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Elie Bursztein Elie Bursztein(Cybersecurity Lead at Google DeepMind), and
6 more.

E2B by e2b-dev

0.7%
9k
Open-source cloud runtime for AI apps and agents
created 2 years ago
updated 22 hours ago
Feedback? Help us improve.