From 540037f014950775058a1be9722760441b4680f4 Mon Sep 17 00:00:00 2001 From: Hulto <7121375+hulto@users.noreply.github.com> Date: Fri, 20 Oct 2023 17:22:20 -0400 Subject: [PATCH] Statically compile docs (#312) --- .gitignore | 1 + docs/_docs/user-guide/imix.md | 33 +++++++++++++++++++ .../golem/embed_files_golem_prod/.gitkeep | 0 implants/lib/eldritch/Cargo.toml | 1 + 4 files changed, 35 insertions(+) create mode 100644 implants/golem/embed_files_golem_prod/.gitkeep diff --git a/.gitignore b/.gitignore index 102ebf495..412cae910 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ dist/** implants/imix/imix-test-config.json implants/golem/embed_files_golem_prod/* +!implants/golem/embed_files_golem_prod/.gitkeep \ No newline at end of file diff --git a/docs/_docs/user-guide/imix.md b/docs/_docs/user-guide/imix.md index d70081e86..6f3edf727 100644 --- a/docs/_docs/user-guide/imix.md +++ b/docs/_docs/user-guide/imix.md @@ -56,3 +56,36 @@ See the [Eldritch User Guide](/user-guide/eldritch) for more information. ## Task management Imix can execute up to 127 threads concurrently after that the main imix thread will block behind other threads. Every callback interval imix will query each active thread for new output and rely that back to the c2. This means even long running tasks will report their status as new data comes in. + +## Static cross compiliation + +### Linux + +```bash +rustup target add x86_64-unknown-linux-musl + +apt update +apt install musl-tools + +RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --target=x86_64-unknown-linux-musl +``` + +### MacOS +**MacOS does not support static compilation** +https://developer.apple.com/forums/thread/706419 + +**Cross compilation is more complicated than we'll support** +Check out this blog a starting point for cross compiling. +https://wapl.es/rust/2019/02/17/rust-cross-compile-linux-to-macos.html/ + + +### Windows +```bash +rustup target add x86_64-pc-windows-gnu + +apt update +sudo apt install gcc-mingw-w64 + +RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --target=x86_64-pc-windows-gnu +``` + diff --git a/implants/golem/embed_files_golem_prod/.gitkeep b/implants/golem/embed_files_golem_prod/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/implants/lib/eldritch/Cargo.toml b/implants/lib/eldritch/Cargo.toml index 0f956c5f7..18023802e 100644 --- a/implants/lib/eldritch/Cargo.toml +++ b/implants/lib/eldritch/Cargo.toml @@ -20,6 +20,7 @@ hex-literal = { workspace = true } ipnetwork = { workspace = true } md5 = { workspace = true } nix = { workspace = true } +openssl = { workspace = true, features = ["vendored"] } regex = { workspace = true } reqwest = { workspace = true , features = ["blocking", "stream"] } russh = { workspace = true }