feat: fixed server comp, added ELF inject

I gave up and just put it in a Docker image, it's not as important as
the beacons being statically compiled
This commit is contained in:
Andrew Rioux
2025-02-04 16:41:20 -05:00
parent 00331ec550
commit 90c8b97141
53 changed files with 1477 additions and 94 deletions
+20 -7
View File
@@ -15,6 +15,10 @@
flake = false;
};
libcap-src = {
url = "git+https://git.kernel.org/pub/scm/libs/libcap/libcap.git";
flake = false;
};
libpcap-src = {
url = "git+https://github.com/the-tcpdump-group/libpcap";
flake = false;
@@ -38,7 +42,7 @@
};
outputs = { self, nixpkgs, flake-utils, crane, rust-overlay, advisory-db
, libpcap-src, libnl-src, winpcap-libs, winpcap-installer
, libcap-src, libpcap-src, libnl-src, winpcap-libs, winpcap-installer
, freebsd-libs-packed }:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
@@ -48,12 +52,12 @@
};
system-libs = import ./system-libs.nix {
inherit pkgs libnl-src libpcap-src winpcap-installer
inherit pkgs libnl-src libcap-src libpcap-src winpcap-installer
freebsd-libs-packed;
};
inherit (system-libs)
freebsd-toolchain winpcap-drivers freebsd-libs libnl libpcap-linux-gnu
libpcap-linux-musl libpcap-freebsd;
freebsd-toolchain winpcap-drivers freebsd-libs libnl libcap
libpcap-linux-gnu libpcap-linux-musl libpcap-freebsd;
buildTools = with pkgs; rec {
base = [
@@ -71,7 +75,7 @@
binaryen
sqlx-cli
];
linux = buildTools.base ++ [ glibc musl ];
linux = buildTools.base ++ [ glibc ];
freebsd = buildTools.base
++ [ pkgsCross.x86_64-freebsd.buildPackages.clang ];
windows = buildTools.base ++ [
@@ -120,6 +124,7 @@
SPARSE_BUILD_LIBPCAP_LINUX_MUSL = libpcap-linux-musl;
SPARSE_BUILD_LIBPCAP_FREEBSD = libpcap-freebsd;
SPARSE_BUILD_LIBNL = libnl;
SPARSE_BUILD_LIBCAP = libcap;
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
@@ -179,8 +184,16 @@
'';
});
linux = craneLib.devShell (buildEnvironment // {
name = "sparse-linux";
packages = buildTools.linux ++ devShellTools
++ [ setup-zig-freebsd setup-dev-environment ]
++ (with pkgs; [ musl ]);
});
windows = craneLib.devShell (buildEnvironment // {
name = "sparse-default";
name = "sparse-windows";
packages = buildTools.windows ++ devShellTools
++ [ setup-zig-freebsd setup-dev-environment ];
@@ -190,7 +203,7 @@
});
freebsd = craneLib.devShell (buildEnvironment // {
name = "sparse-default";
name = "sparse-freebsd";
packages = buildTools.freebsd ++ devShellTools
++ [ setup-zig-freebsd setup-dev-environment ];