Skip to content
Open
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
2 changes: 2 additions & 0 deletions implants/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ network-interface = "1.0.1"
nix = "0.26.1"
notify = "6.1.1"
object = "0.31.1"
openssl = "0.10.55"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sir openssl is banned.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just got rid of OpenSSL and shaved 7MB, we're using rusttls for TLS now.

os_info = "3.10.0"
pnet = "0.34.0"
portable-pty = "0.8.1"
predicates = { version = "2.1", default-features = false }
Expand Down
3 changes: 2 additions & 1 deletion implants/imix/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ anyhow = { workspace = true }
clap = { workspace = true }
netdev = { workspace = true }
log = { workspace = true }
os_info = { workspace = true }
pretty_env_logger = { workspace = true }
tokio = { workspace = true, features = ["full"] }
uuid = { workspace = true, features = ["v4", "fast-rng"] }
whoami = { workspace = true }
pretty_env_logger = { workspace = true }


[target.'cfg(target_os = "windows")'.dependencies]
Expand Down
20 changes: 20 additions & 0 deletions implants/imix/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::version::VERSION;
use os_info::{self, Version};
use pb::c2::host::Platform;
use uuid::Uuid;

Expand Down Expand Up @@ -79,6 +80,7 @@ impl Default for Config {
name: whoami::fallible::hostname().unwrap_or(String::from("")),
identifier: host_unique::get_id_with_selectors(selectors).to_string(),
platform: get_host_platform() as i32,
version: get_system_version(),
primary_ip: get_primary_ip(),
};

Expand Down Expand Up @@ -223,3 +225,21 @@ fn get_primary_ip() -> String {
}
}
}

fn get_system_version() -> String {
let info = os_info::get();
let version = match info.version() {
Version::Unknown => "Unknown".to_string(),
Version::Semantic(a, b, c) => format!("{}.{}.{}", a, b, c),
Version::Rolling(Some(val)) => val.to_string(),
Version::Rolling(None) => "Unknown".to_string(),
Version::Custom(val) => val.to_string(),
};
match get_host_platform() {
Platform::Linux => format!("{} {}", info.os_type(), version),
Platform::Macos => version,
Platform::Bsd => format!("{} {}", info.os_type(), version),
Platform::Windows => version,
Platform::Unspecified => format!("{} {}", info.os_type(), version),
}
}
2 changes: 2 additions & 0 deletions implants/lib/pb/src/generated/c2.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tavern/internal/c2/api_claim_tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func (srv *Server) ClaimTasks(ctx context.Context, req *c2pb.ClaimTasksRequest)
SetIdentifier(req.Beacon.Host.Identifier).
SetName(req.Beacon.Host.Name).
SetPlatform(req.Beacon.Host.Platform).
SetVersion(req.Beacon.Host.Version).
SetPrimaryIP(req.Beacon.Host.PrimaryIp).
SetExternalIP(clientIP).
SetLastSeenAt(now).
Expand Down
3 changes: 3 additions & 0 deletions tavern/internal/c2/api_claim_tasks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func TestClaimTasks(t *testing.T) {
Identifier: "test-host",
Name: "host-for-test",
Platform: c2pb.Host_PLATFORM_LINUX,
Version: "40.0.0",
PrimaryIp: "127.0.0.1",
},
Interval: uint64(60),
Expand All @@ -79,6 +80,7 @@ func TestClaimTasks(t *testing.T) {
Identifier: "test-host",
Name: "host-for-test",
Platform: c2pb.Host_PLATFORM_LINUX,
Version: "40.0.0",
PrimaryIp: "127.0.0.1",
},
Interval: uint64(100),
Expand All @@ -104,6 +106,7 @@ func TestClaimTasks(t *testing.T) {
Identifier: "test-host",
Name: "host-for-test",
Platform: c2pb.Host_PLATFORM_LINUX,
Version: "40.0.0",
PrimaryIp: "127.0.0.1",
},
Interval: uint64(100),
Expand Down
Loading
Loading