Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion implants/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ members = [
"lib/eldritch/stdlib/eldritch-libtime",
"lib/eldritch/eldritch",
"lib/eldritch/eldritch-wasm",
"lib/portals/portal-stream",
"lib/portals/portal-stream", "lib/config",
]
exclude = [
"lib/eldritch/stdlib/tests", # Excluded to prevent fake_bindings from polluting workspace builds
Expand All @@ -35,6 +35,7 @@ resolver = "2"
transport = { path = "./lib/transport" }
host_unique = { path = "./lib/host_unique" }
pb = { path = "./lib/pb" }
config = { path = "./lib/config" }
netstat = { path = "./lib/netstat" }

# Eldritch V2
Expand Down
1 change: 1 addition & 0 deletions implants/imix/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ install = []
tokio-console = ["dep:console-subscriber", "tokio/tracing"]

[dependencies]
config = { workspace = true, features = ["imix"] }
tokio = { workspace = true, features = [
"rt-multi-thread",
"macros",
Expand Down
2 changes: 1 addition & 1 deletion implants/imix/src/agent.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use anyhow::{Context as AnyhowContext, Result};
use config::Config;
use eldritch::agent::agent::Agent;
use eldritch_agent::Context;
use pb::c2::host::Platform;
Expand All @@ -8,7 +9,6 @@ use pb::c2::{
ReportTaskOutputMessage, ShellTaskContext, ShellTaskOutput, TaskContext, TaskOutput,
report_output_request,
};
use pb::config::Config;
use std::collections::{BTreeMap, BTreeSet};
use std::sync::{Arc, Mutex};
use std::time::Duration;
Expand Down
4 changes: 3 additions & 1 deletion implants/imix/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mod win_service;
#[cfg(all(debug_assertions, feature = "tokio-console"))]
use console_subscriber;

pub use pb::config::Config;
pub use config::Config;
pub use transport::{ActiveTransport, Transport};

mod agent;
Expand All @@ -33,6 +33,8 @@ mod version;

#[tokio::main]
async fn main() -> Result<()> {
pb::xchacha::init_server_pubkey(config::SERVER_PUBKEY);

#[cfg(all(debug_assertions, feature = "tokio-console"))]
{
console_subscriber::init();
Expand Down
2 changes: 1 addition & 1 deletion implants/imix/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::time::{Duration, Instant};
use crate::agent::ImixAgent;
use crate::task::TaskRegistry;
use crate::version::VERSION;
use pb::config::Config;
use config::Config;
use transport::{ActiveTransport, Transport};

pub static SHUTDOWN: AtomicBool = AtomicBool::new(false);
Expand Down
2 changes: 1 addition & 1 deletion implants/imix/src/shell/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ impl<T: Transport + Send + Sync + 'static> ShellManager<T> {
mod tests {
use super::*;
use crate::task::TaskRegistry;
use config::Config;
use pb::c2::{ReportOutputResponse, ShellTask};
use pb::config::Config;
use transport::MockTransport;

#[tokio::test]
Expand Down
2 changes: 1 addition & 1 deletion implants/imix/src/tests/agent_output_aggregation.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::agent::ImixAgent;
use crate::task::TaskRegistry;
use config::Config;
use pb::c2::{
ReportOutputRequest, ReportShellTaskOutputMessage, ReportTaskOutputMessage, ShellTaskContext,
ShellTaskOutput, TaskContext, TaskOutput, report_output_request,
};
use pb::config::Config;
use std::sync::{Arc, Mutex};
use transport::MockTransport;

Expand Down
2 changes: 1 addition & 1 deletion implants/imix/src/tests/agent_tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::super::agent::ImixAgent;
use super::super::task::TaskRegistry;
use config::Config;
use eldritch::agent::agent::Agent;
use pb::config::Config;
use std::sync::Arc;
use transport::MockTransport;

Expand Down
2 changes: 1 addition & 1 deletion implants/imix/src/tests/agent_trait_tests.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use super::super::agent::ImixAgent;
use super::super::task::TaskRegistry;
use config::Config;
use eldritch::agent::agent::Agent;
use pb::c2::host::Platform;
use pb::c2::{self, Host, report_file_request, report_output_request};
use pb::config::Config;
use std::sync::Arc;
use transport::MockTransport;

Expand Down
2 changes: 1 addition & 1 deletion implants/imix/src/tests/callback_interval_test.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::super::agent::ImixAgent;
use super::super::task::TaskRegistry;
use config::Config;
use eldritch::agent::agent::Agent;
use pb::config::Config;
use std::sync::Arc;
use transport::MockTransport;

Expand Down
2 changes: 1 addition & 1 deletion implants/imix/src/tests/report_large_file_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::agent::ImixAgent;
use crate::task::TaskRegistry;
use config::Config;
use eldritch::report::std::file_impl;
use eldritch_agent::{Agent, Context};
use pb::c2::{
Expand All @@ -9,7 +10,6 @@ use pb::c2::{
ReportOutputResponse, ReportProcessListRequest, ReportProcessListResponse, ReverseShellRequest,
ReverseShellResponse, TaskContext, Transport as C2Transport,
};
use pb::config::Config;
use std::sync::mpsc::{Receiver, Sender};
use std::sync::{Arc, Mutex};
use transport::Transport;
Expand Down
27 changes: 27 additions & 0 deletions implants/lib/config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "config"
version = "0.1.0"
edition = "2024"

[features]
default = []
imix = []

[dependencies]
pb = { workspace = true }
anyhow = { workspace = true }
host_unique = { workspace = true }
log = { workspace = true }
netdev = { workspace = true }
prost = { workspace = true }
url = { workspace = true }
uuid = { workspace = true, features = ["v4", "fast-rng"] }
whoami = { workspace = true }
const-decoder = { workspace = true }

[build-dependencies]
reqwest = { workspace = true, features = ["blocking", "json", "rustls-tls", "http2"] }
serde_json = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_yaml = { workspace = true }
urlencoding = { workspace = true }
Loading
Loading