Skip to content

A tool that can inject any js into the V8 VM

License

Notifications You must be signed in to change notification settings

xqr2222/v8_killer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


V8 Killer

A tool that can inject any js into the V8 VM
Explore the docs »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

This project began with an initial idea: injecting scripts into Electron applications. There are traditionally two main approaches for accomplishing this.

  • Modifying resource files, such as .js or .asar files. However, this approach is highly invasive and cannot pass integrity checks in some software.
  • Opening a debugging port (--inspect or --inspect-brk) and injecting scripts using a debugger. However, some software may inspect this parameter or outright block it.

This project takes a different approach by hooking into the compilation functions of the V8 engine, directly modifying the source code passed to the V8 compiler. This allows scripts to be injected into the V8 engine without altering any local files or opening any debugging ports. Through testing, it has been confirmed that this method can be used with any software/framework built on the V8 engine, including but not limited to Node.js, Electron, and Deno.

Currently, this project has been tested exclusively on Linux and Windows. In theory, with minor modifications, it should be possible to run it on macOS. However, this is not currently part of our development roadmap.

This project is divided into two parts: core and launcher. The core constitutes the central component and represents the actual injected payload. The launcher is responsible for loading the payload, which is the core, into the target program.

On Linux, loading the payload can be accomplished simply using LD_PRELOAD. However, on Windows, this might require additional work, and this is where the purpose of the launcher comes into play.

So far, we support the following targets:

Target Supported Note
Node.js Yes
Electron Yes
CEF Untested
Deno No Deno remove exports from V8. In future versions, we will introduce pattern matching to address this issue.

(back to top)

Built With

  • Rust
  • V8

(back to top)

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

Building

  1. Clone the repo
    git clone https://github.com/ShellWen/v8_killer.git
  2. Run
    cargo build
    to get a debug build, or
    cargo build --release
    to get a release build.

(back to top)

Usage

In short, you need pass environment variable V8_KILLER_CONFIG_FILE_PATH to the launcher, and the launcher will load the config file and inject the payload into the target program.
Here we use Node.js as an example.

V8_KILLER_CONFIG_FILE_PATH=path_to_config.toml v8_killer_launcher /use/bin/node path_to_target.js

Example config files can be found in the examples/configs/ directory.
Currently, v8 killer only supports toml format config files.

For more examples, please refer to the Wiki

(back to top)

Roadmap

WIP

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

ShellWen - @realShellWen - [email protected]

Project Link: https://github.com/ShellWen/v8_killer

(back to top)

Acknowledgments

(back to top)

About

A tool that can inject any js into the V8 VM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%