Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
BlockchainC2 — 一个用于探索以太坊区块链是否以及如何被用作 C2 的 POC C2 服务器和代理 | Kitploit
工具/GitHubGitHub/xpn/blockchainc2
漏洞利用渗透测试命令与控制红队Payload 开发
GitHubxpn/blockchainc2

BlockchainC2

一个用于探索以太坊区块链是否以及如何被用作 C2 的 POC C2 服务器和代理

查看仓库
79227年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

BlockchainC2

BlockchainC2 是一个小型 POC 服务器/代理,用于评估攻击者如何利用区块链(特别是以太坊的智能合约功能)进行 C2 通信。

有关此应用程序的详细信息可在此处找到。

智能合约

此 POC 中使用的智能合约非常简单:

root@kitploit:~
pragma solidity ^0.5.0;

contract EventC2 {

    address owner;

    event _ServerData(bool f, bool enc, int seq, string agentID, string data);
    event _ClientData(bool f, bool enc, int seq, string agentID, string data);

    constructor() public {
        owner = msg.sender;
    }
    
    function AddClientData(string memory agentID, string memory d, int id, bool f, bool enc) public {
        emit _ClientData(f, enc, id, agentID, d);
    }

    function AddServerData(string memory agentID, string memory d, int id, bool f, bool enc) public {
        emit _ServerData(f, enc, id, agentID, d);
    }
}

这段 Solidity 代码的核心是以事件(event)的形式在服务器与多个客户端之间传递数据。

构建

BlockchainC2 被设计为在 MacOS/Linux 上运行,但代理可以编译为在 MacOS、Windows 或 Linux 上执行。

使用 brew 在 MacOS 上构建:

root@kitploit:~
# Install solidity and ethereum
brew tap ethereum/ethereum
brew install ethereum
brew install solidity

# Build
make all

在 Ubuntu 上构建:

root@kitploit:~
# Install solidity and ethereum
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc ethereum

# Build  
make all

为 Windows 交叉编译代理:

root@kitploit:~
CGO_ENABLED=1 CC="x86_64-w64-mingw32-gcc" GOOS=windows go build blockchainc2/cmd/bc2agent

运行

你需要设置一个可供服务器组件使用的账户。最简单的方法是使用 geth:

root@kitploit:~
geth account new --keystore /tmp/mykeystore/
cat /tmp/mykeystore/*

你可以通过 https://faucet.ropsten.be/ 向 Ropsten 测试网上的钱包添加以太币。

将密钥库添加到你的 config.json 中,例如:

root@kitploit:~
{
	"Key": "{\"address\":\"ADDRESS\",\"crypto\":{\"cipher\":\"aes-128-ctr\",\"ciphertext\":\"CT\",\"cipherparams\":{\"iv\":\"IV\"},\"kdf\":\"scrypt\",\"kdfparams\":{\"dklen\":32,\"n\":262144,\"p\":1,\"r\":8,\"salt\":\"06470fcc2121994e014f85e5ab9cdb3714c76b873a1f1186c3e623e87abc4a7a\"},\"mac\":\"SALT\"},\"id\":\"ID\",\"version\":3}",
	"Endpoint": "wss://ropsten.infura.io/_ws",
	"ContractAddress": "TODO_VIA_SETUP",
	"GasPrice": 0
}

使用 bc2server 部署合约:

root@kitploit:~
./bin/bc2server -config ./config.json -pass Passw0rd -setup

合约部署完成后,将合约地址添加到你的 config.json 中,并使用以下命令启动服务器:

root@kitploit:~
./bin/bc2server -config ./config.json -pass Passw0rd

在服务器运行的情况下,可以使用以下命令连接代理:

root@kitploit:~
./bin/bc2agent -config ./agent_config.json -pass Passw0rd

建议为代理使用全新的账户,以避免因待处理交易而产生错误。

下载工具