feat: add vagrantfile support

This commit is contained in:
Andrew Rioux 2025-10-20 08:26:33 -04:00
parent d31a09e331
commit cf53d7e1c9
Signed by: andrew.rioux
GPG Key ID: 9B8BAC47C17ABB94
4 changed files with 52 additions and 73 deletions

1
.gitignore vendored
View File

@ -4,6 +4,7 @@ examples/bind-shell/key-generator/privkey
core core
**/core **/core
.direnv .direnv
.vagrant
result result
sparse-public sparse-public
rust9x.7z rust9x.7z

17
Vagrantfile vendored Normal file
View File

@ -0,0 +1,17 @@
$script = <<-SCRIPT
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo 'source "$HOME/.cargo/env"' > ~/.bashrc
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "generic/freebsd14"
config.vm.network "private_network", ip: "192.168.56.198"
config.vm.provision "shell", inline: $script
config.vm.provider "virtualbox" do |vb|
vb.memory = 8192
vb.cpus = 8
end
end

101
flake.lock generated
View File

@ -1,17 +1,12 @@
{ {
"nodes": { "nodes": {
"crane": { "crane": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": { "locked": {
"lastModified": 1705974079, "lastModified": 1745022865,
"narHash": "sha256-HyC3C2esW57j6bG0MKwX4kQi25ltslRnr6z2uvpadJo=", "narHash": "sha256-tXL4qUlyYZEGOHUKUWjmmcvJjjLQ+4U38lPWSc8Cgdo=",
"owner": "ipetkov", "owner": "ipetkov",
"repo": "crane", "repo": "crane",
"rev": "0b4e511fe6e346381e31d355e03de52aa43e8cb2", "rev": "25ca4c50039d91ad88cc0b8feacb9ad7f748dedf",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -28,11 +23,11 @@
"rust-analyzer-src": "rust-analyzer-src" "rust-analyzer-src": "rust-analyzer-src"
}, },
"locked": { "locked": {
"lastModified": 1705991032, "lastModified": 1745303921,
"narHash": "sha256-C+ePPXLMOxkJfJMqihUC1XbNr9Xy2F6BpWrmGDsgzXk=", "narHash": "sha256-zYucemS2QvJUR5GKJ/u3eZAoe82AKhcxMtNVZDERXsw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "fenix", "repo": "fenix",
"rev": "2189a3d994aaee6f83d3fc92deb13c458dd03dbd", "rev": "14850d5984f3696a2972f85f19085e5fb46daa95",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -46,29 +41,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1705309234, "lastModified": 1731533236,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -80,23 +57,23 @@
"freebsd": { "freebsd": {
"flake": false, "flake": false,
"locked": { "locked": {
"narHash": "sha256-rKgZfcUDZpwF8Pi7Ybh+fSIRsVZshOgX5Qe2owMxKLQ=", "narHash": "sha256-rYxLsLiFk+mAU/kRPqObzLu9azwvmr7Px2KYad6BBqQ=",
"type": "file", "type": "file",
"url": "https://download.freebsd.org/releases/ISO-IMAGES/14.1/FreeBSD-14.1-RELEASE-amd64-dvd1.iso" "url": "https://download.freebsd.org/releases/ISO-IMAGES/14.3/FreeBSD-14.3-RELEASE-amd64-dvd1.iso"
}, },
"original": { "original": {
"type": "file", "type": "file",
"url": "https://download.freebsd.org/releases/ISO-IMAGES/14.1/FreeBSD-14.1-RELEASE-amd64-dvd1.iso" "url": "https://download.freebsd.org/releases/ISO-IMAGES/14.3/FreeBSD-14.3-RELEASE-amd64-dvd1.iso"
} }
}, },
"libnl": { "libnl": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1704704641, "lastModified": 1743402142,
"narHash": "sha256-5U9Pfd738Hyjtew9ZeDGKGbpRspym47T8egje1ZVUO4=", "narHash": "sha256-7dcVdysPi7Mns9xnpyI4RtLyW7axY3MmbpjnXiyuTNo=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "8693347fe9c47d08ce5899602ab4f208c1249619", "rev": "f278e5921498fc635bd9534a3f24979bb1b2849d",
"revCount": 2024, "revCount": 2139,
"type": "git", "type": "git",
"url": "https://github.com/thom311/libnl" "url": "https://github.com/thom311/libnl"
}, },
@ -108,11 +85,11 @@
"libpcap-src": { "libpcap-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705891920, "lastModified": 1744819402,
"narHash": "sha256-4FehaAo6eWDqDVij/uY+BmVGhNMS7AfFZRyw2jk4inI=", "narHash": "sha256-E2e6Z3SFsZKxE3Ey35O9GwlenK7/EHh+hnY1OVucvnU=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "fb92b4dd10ed1f73a536e512fd0b0e33b76329a6", "rev": "2fc3834ef4050ad2354a4d2472bab8b63a629761",
"revCount": 5944, "revCount": 6617,
"type": "git", "type": "git",
"url": "https://github.com/the-tcpdump-group/libpcap" "url": "https://github.com/the-tcpdump-group/libpcap"
}, },
@ -123,16 +100,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1705916986, "lastModified": 1744440957,
"narHash": "sha256-iBpfltu6QvN4xMpen6jGGEb6jOqmmVQKUrXdOJ32u8w=", "narHash": "sha256-FHlSkNqFmPxPJvy+6fNLaNeWnF1lZSgqVCl/eWaJRc4=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d7f206b723e42edb09d9d753020a84b3061a79d8", "rev": "26d499fc9f1d567283d5d56fcf367edd815dba1d",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-23.11", "ref": "nixos-24.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -153,11 +130,11 @@
"rust-analyzer-src": { "rust-analyzer-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705864945, "lastModified": 1745247864,
"narHash": "sha256-ZATChFWHToTZQFLlzrzDUX8fjEbMHHBIyPaZU1JGmjI=", "narHash": "sha256-QA1Ba8Flz5K+0GbG03HwiX9t46mh/jjKgwavbuKtwMg=",
"owner": "rust-lang", "owner": "rust-lang",
"repo": "rust-analyzer", "repo": "rust-analyzer",
"rev": "d410d4a2baf9e99b37b03dd42f06238b14374bf7", "rev": "31dbec70c68e97060916d4754c687a3e93c2440f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -169,17 +146,16 @@
}, },
"rust-overlay": { "rust-overlay": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1706062676, "lastModified": 1745289264,
"narHash": "sha256-aIgYdyQyKRHZ8gSmke3DE09D5ypK4tP+XYqrKPAd/3M=", "narHash": "sha256-7nt+UJ7qaIUe2J7BdnEEph9n2eKEwxUwKS/QIr091uA=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "81eb4bdb219d97d749f152eb4de6a081b088b08d", "rev": "3b7171858c20d5293360042936058fb0c4cb93a9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -203,25 +179,10 @@
"type": "github" "type": "github"
} }
}, },
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"winpcap": { "winpcap": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1277475016, "lastModified": 1277475020,
"narHash": "sha256-lea+6c9obTpxWosi2xRXUxV4+whsCTWMJ7wxZNASRz8=", "narHash": "sha256-lea+6c9obTpxWosi2xRXUxV4+whsCTWMJ7wxZNASRz8=",
"type": "tarball", "type": "tarball",
"url": "https://www.winpcap.org/install/bin/WpdPack_4_1_2.zip" "url": "https://www.winpcap.org/install/bin/WpdPack_4_1_2.zip"

View File

@ -2,7 +2,7 @@
description = "Sparse C2 framework"; description = "Sparse C2 framework";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
rust-overlay = { rust-overlay = {
url = "github:oxalica/rust-overlay"; url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -32,7 +32,7 @@
freebsd = { freebsd = {
url = url =
"https://download.freebsd.org/releases/ISO-IMAGES/14.1/FreeBSD-14.1-RELEASE-amd64-dvd1.iso"; "https://download.freebsd.org/releases/ISO-IMAGES/14.3/FreeBSD-14.3-RELEASE-amd64-dvd1.iso";
flake = false; flake = false;
}; };
}; };
@ -177,7 +177,7 @@
devShells.default = craneLib.devShell { devShells.default = craneLib.devShell {
name = "sparse"; name = "sparse";
buildInputs = windowsBuildTools ++ [ rust-analyzer packer ]; buildInputs = windowsBuildTools ++ [ rust-analyzer vagrant ];
SPARSE_BUILD_WINPCAP = "${winpcap}/Lib"; SPARSE_BUILD_WINPCAP = "${winpcap}/Lib";
SPARSE_BUILD_LIBPCAP = "${libpcap-src}"; SPARSE_BUILD_LIBPCAP = "${libpcap-src}";