Skip to content

Commit

Permalink
🔀 Merge pull request #25 from ShellWen/feat/22-enhance-documentation-…
Browse files Browse the repository at this point in the history
…quality

enhance documentation quality
  • Loading branch information
ShellWen authored Nov 29, 2023
2 parents acb252c + 4a81a8d commit f288284
Show file tree
Hide file tree
Showing 13 changed files with 379 additions and 147 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/documentations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy docs to Pages

on:
push:
branches: ["master"]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
cache: 'pip'
- name: Run pip install
run: pip install -r requirements.txt
working-directory: './docs'
- name: Build docs
run: mkdocs build
working-directory: './docs'
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: './docs/site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
126 changes: 4 additions & 122 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<p align="center">
A tool that can inject any js into the V8 VM
<br />
<a href="https://github.com/ShellWen/v8_killer/wiki"><strong>Explore the docs »</strong></a>
<a href="https://shellwen.github.io/v8-killer/"><strong>Explore the docs »</strong></a>
<br />
<br />
<a href="https://github.com/ShellWen/v8_killer/issues">Report Bug</a>
Expand All @@ -44,34 +44,10 @@
</p>
</div>

<!-- DOCUMENTATIONS -->
## Documentations


<!-- TABLE OF CONTENTS -->
<details>
<summary>Table of Contents</summary>
<ol>
<li>
<a href="#about-the-project">About The Project</a>
<ul>
<li><a href="#built-with">Built With</a></li>
</ul>
</li>
<li>
<a href="#getting-started">Getting Started</a>
<ul>
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#installation">Installation</a></li>
</ul>
</li>
<li><a href="#usage">Usage</a></li>
<li><a href="#roadmap">Roadmap</a></li>
<li><a href="#contributing">Contributing</a></li>
<li><a href="#license">License</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#acknowledgments">Acknowledgments</a></li>
</ol>
</details>

Documentations are available under [GitHub Pages](https://shellwen.github.io/v8-killer/).


<!-- ABOUT THE PROJECT -->
Expand Down Expand Up @@ -102,94 +78,11 @@ Pattern matching is on the way. [#12](https://github.com/ShellWen/v8_killer/issu

<p align="right">(<a href="#readme-top">back to top</a>)</p>



### Built With

* [![Rust][rust-badge]][rust-url]
* [![V8][v8-badge]][v8-url]

<p align="right">(<a href="#readme-top">back to top</a>)</p>



<!-- GETTING STARTED -->
## 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.
* rust
> Please follow Rust's official installation instructions: [https://www.rust-lang.org/tools/install](https://www.rust-lang.org/tools/install)
### Building

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

<p align="right">(<a href="#readme-top">back to top</a>)</p>



<!-- USAGE EXAMPLES -->
## 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.
```sh
V8_KILLER_CONFIG_FILE_PATH=path_to_config.toml v8_killer_launcher /usr/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](https://github.com/ShellWen/v8_killer/wiki)_

<p align="right">(<a href="#readme-top">back to top</a>)</p>



<!-- ROADMAP -->
## Roadmap

WIP

See the [open issues](https://github.com/ShellWen/v8_killer/issues) for a full list of proposed features (and known issues).

<p align="right">(<a href="#readme-top">back to top</a>)</p>



<!-- CONTRIBUTING -->
## 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
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- LICENSE -->
## License

Expand All @@ -208,17 +101,6 @@ Project Link: [https://github.com/ShellWen/v8_killer](https://github.com/ShellWe

<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- ACKNOWLEDGMENTS -->
## Acknowledgments
* [ShellWen](https://github.com/ShellWen)
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
[contributors-shield]: https://img.shields.io/github/contributors/ShellWen/v8_killer.svg?style=for-the-badge
Expand Down
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.venv/
/site/
3 changes: 3 additions & 0 deletions docs/docs/development.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
We have not English version of this page yet.
Please refer to [Chinese version](/zh/development/) for now.
We welcome translation contributions. Please submit a Pull Request directly.
2 changes: 2 additions & 0 deletions docs/docs/development.zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## 构建
TODO
3 changes: 3 additions & 0 deletions docs/docs/getting-started.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
We have not English version of this page yet.
Please refer to [Chinese version](/zh/getting-started/) for now.
We welcome translation contributions. Please submit a Pull Request directly.
48 changes: 48 additions & 0 deletions docs/docs/getting-started.zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
本文假设你已经对相关的基础知识有所了解。

## 结构
V8 Killer 分为 `core` 核心部分,与 `launcher` 启动器部分。
前者为运行在目标进程中的部分,会在模块加载的时候 inline hook V8 引擎的编译相关函数,后者负责启动程序并将 `core` 加载进目标程序。

## 获取二进制文件

[//]: # (目前,我们提供预构建版本,发布在 [GitHub Releases][github-releases-url]{target=\_blank} 中)

目前,我们不提供预构建版本,但你可以在 [GitHub Actions][github-actions-build-url]{target=\_blank} 中找到持续构建的二进制文件。
如需自行构建,请参考 [开发](/zh/development)

## 编写配置文件

配置文件是一个 [TOML][toml-url]{target=\_blank} 文件,其中包括了函数定位器与注入规则。
我们目前暂时还未提供 TOML 文件的 JSON Schema,请参考 [/examples/configs][config-examples-url]{target=\_blank} 中给出的示例文件编写。

## 使用启动器启动

启动器会根据环境变量查找配置文件,你需要设置 `V8_KILLER_CONFIG_FILE_PATH` 环境变量,并将它的值指向配置文件的**绝对路径**

### Linux / macOS
这是一段示例脚本,已在 Arch Linux 下测试通过:
```bash
#!/usr/bin/env bash
export V8_KILLER_CONFIG_FILE_PATH=/path/to/config/file/config.toml
v8_killer_launcher "/usr/bin/node" "/path/to/js/main.js"
```

### Windows
你可以通过 `PowerShell` 脚本,或 `cmd` 批处理启动 `launcher`
```powershell
# PowerShell
$env:V8_KILLER_CONFIG_FILE_PATH = "C:\path\to\config\file\config.toml"
Start-Process -FilePath "C:\path\to\executable\node.exe" -ArgumentList "C:\path\to\js\main.js" -NoNewWindow
```
```batch
:: cmd
set V8_KILLER_CONFIG_FILE_PATH=C:\path\to\config\file\config.toml
start "C:\path\to\executable\node.exe" "C:\path\to\js\main.js"
```
请注意,在 Windows 中,允许配置全局环境变量,但我们不需要这么做,我们只需要在脚本中设置临时环境变量即可。

[toml-url]: https://toml.io/
[github-releases-url]: https://github.com/ShellWen/v8_killer/releases
[github-actions-build-url]: https://github.com/ShellWen/v8_killer/actions/workflows/build.yaml
[config-examples-url]: https://github.com/ShellWen/v8_killer/tree/master/examples/configs
6 changes: 6 additions & 0 deletions docs/docs/index.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# V8 Killer

We have not English version of this page yet.
Please refer to [Chinese version](/zh/) for now.
We welcome translation contributions. Please submit a Pull Request directly.

98 changes: 98 additions & 0 deletions docs/docs/index.zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# V8 Killer
**强大**且可高度**自定义****通用** V8 虚拟机注入器。

[![Contributors][contributors-shield]][contributors-url]{target=\_blank}
[![Forks][forks-shield]][forks-url]{target=\_blank}
[![Stargazers][stars-shield]][stars-url]{target=\_blank}
[![Issues][issues-shield]][issues-url]{target=\_blank}
[![MIT License][license-shield]][license-url]{target=\_blank}
[![LinkedIn][linkedin-shield]][linkedin-url]{target=\_blank}

## V8 Killer 是什么

该项目 ([V8 Killer][project-url]{target=\_blank}) 是由 [ShellWen][shellwen-github-url]{target=\_blank} 开发的 [V8 引擎][v8-url]{target=\_blank}
通用脚本注入方案,目前我们主要致力于解决 [Electron][electron-url]{target=\_blank} 程序的注入问题。

## Electron 注入方案比较

目前常见的 Electron 注入方案有以下几种:

| | 开启调试端口 | 替换资源文件 | V8 Killer |
|-------------|------------------------------------|--------------------------|-------------------------------------------|
| 原理 | 通过特殊的命令行参数或运行时发送信号开启 Devtools 调试端口 | 替换存储在硬盘上的脚本文件 / asar 资源包 | 在程序运行后注入动态链接库 inline hook,修改 V8 引擎编译脚本的逻辑 |
| 可通过完整性检查 || ❌ 修改文件会导致文件摘要值改变 ||
| 无安全性问题 | ❌ 调试端口无法添加保护,任何程序均可注入 || ✅ 注入内容由配置文件指定,不对外暴露攻击面 |
| 更新版本后无需重新适配 ||| ⭕ 一般仅 Windows 平台需要 |
| 允许修改任意脚本 || ✅ 支持对原脚本替换 | ✅ 支持对原脚本替换或**修改** |

目前 V8 Killer 是唯一一个通用且不会破坏 Electron 程序完整性的注入方案。

V8 Killer 的缺点主要集中在以下几点:

- Windows 平台下的 Electron 构建,默认会移除部分符号导出信息,所以需要自行逆向后填写相关函数的 EVA;
- 部分 Electron 程序可能会检查内存中加载的动态链接库列表,这会使得 V8 Killer 在目标程序中被发现。

## 开始使用
请转到 [开始使用](/zh/getting-started)

## 贡献

如果你发现了代码中存在的缺陷 / Bugs,欢迎你通过 [GitHub Issues][issues-url]{target=\_blank} 提交给我们,或是直接通过
[GitHub Pull Requests][pull-requests-url]{target=\_blank} 将解决方案提交给我们。
如果现有的代码无法满足你的需求,或是你有什么新的创意,你也可以通过 [GitHub Issues][issues-url]{target=\_blank} 告诉我们,但
需要说明的是,项目维护者的精力有限,我们可能无法总是让你满意。
文档翻译可能存在滞后性,也可能因疏忽而发生错误,如果遇到这种情况,烦请通过 [GitHub Issues][issues-url]{target=\_blank} 提交给我们。
如果你对 Rust 有所了解,同时希望参与该项目的开发之中,请转到 [开发](/zh/development)

## 社区

如果你在使用 V8 Killer 的时候碰到问题,请前往我们的讨论页 [GitHub Discussions][discussions-url]{target=\_blank}。

**请注意:GitHub Issues 仅用于提交代码缺陷 / Bugs,请不要把使用中的问题发到 Issues,这会分散开发人员的精力。**

## 使用须知 & 免责声明

该项目仅供学习交流使用,禁止用于非法用途,否则后果自负。
该项目不包含任何明示或暗示的用于任何目的的担保,本项目及其贡献者不对任何人使用本项目产生的任何直接或间接损失负责。
该项目的使用者必须在遵守开源许可证的同时,仔细阅读并遵守本声明。

## 技术栈

该项目使用了一些来自社区的开源代码,我们对这些贡献者表示由衷的感谢:

- [frida-rust](https://github.com/frida/frida-rust){target=\_blank}
- [lazy_static.rs](https://github.com/rust-lang-nursery/lazy-static.rs){target=\_blank}
- [rust-ctor](https://github.com/mmastrac/rust-ctor){target=\_blank}
- [toml-rs](https://github.com/toml-rs/toml){target=\_blank}
- [serde-rs](https://github.com/serde-rs/serde){target=\_blank}

没有他们的贡献,该项目便无法顺利完成。再次感谢他们对开源界的贡献。

## 许可协议

该项目遵循 MIT 许可协议。具体请见项目根目录下的 [LICENSE 文件][license-url]{target=\_blank}。

[shellwen-github-url]: https://github.com/ShellWen
[project-url]: https://github.com/ShellWen/v8_killer
[contributors-shield]: https://img.shields.io/github/contributors/ShellWen/v8_killer.svg?style=for-the-badge
[contributors-url]: https://github.com/ShellWen/v8_killer/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/ShellWen/v8_killer.svg?style=for-the-badge
[forks-url]: https://github.com/ShellWen/v8_killer/network/members
[stars-shield]: https://img.shields.io/github/stars/ShellWen/v8_killer.svg?style=for-the-badge
[stars-url]: https://github.com/ShellWen/v8_killer/stargazers
[issues-shield]: https://img.shields.io/github/issues/ShellWen/v8_killer.svg?style=for-the-badge
[issues-url]: https://github.com/ShellWen/v8_killer/issues
[pull-requests-url]: https://github.com/ShellWen/v8_killer/pulls
[license-shield]: https://img.shields.io/github/license/ShellWen/v8_killer.svg?style=for-the-badge
[license-url]: https://github.com/ShellWen/v8_killer/blob/master/LICENSE
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/ShellWen

[rust-badge]: https://img.shields.io/badge/Rust-000000?style=for-the-badge&logo=rust&logoColor=white
[rust-url]: https://www.rust-lang.org/
[v8-badge]: https://img.shields.io/badge/V8-4B8BF5?style=for-the-badge&logo=v8&logoColor=white
[v8-url]: https://v8.dev/

[electron-url]: https://github.com/electron/electron

[discussions-url]: https://github.com/ShellWen/v8_killer/discussions
Loading

0 comments on commit f288284

Please sign in to comment.