2024-05-15 15:35:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
nmap,
|
|
|
|
perl,
|
|
|
|
python3,
|
|
|
|
rustPlatform,
|
|
|
|
Security,
|
|
|
|
}:
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "rustscan";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "2.2.3";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RustScan";
|
|
|
|
repo = "RustScan";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-GOoyq2GgVGNUxxy0KQeRvkISb3FJqwWK5XpmoBAw/tk=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
cargoHash = "sha256-K9NFm++jBsrn7U+rZkTOWhrUuL4CA0NR7SlSyhSIwSc=";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2022-09-22 12:36:57 +00:00
|
|
|
substituteInPlace src/scripts/mod.rs \
|
2024-05-15 15:35:15 +00:00
|
|
|
--replace-fail 'call_format = "nmap' 'call_format = "${nmap}/bin/nmap'
|
2022-09-22 12:36:57 +00:00
|
|
|
patchShebangs fixtures/.rustscan_scripts/*
|
2020-09-25 04:45:31 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
buildInputs = lib.optional stdenv.isDarwin Security;
|
2020-10-27 00:29:36 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
perl
|
|
|
|
python3
|
|
|
|
];
|
2022-09-22 12:36:57 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
checkFlags = [
|
2024-05-15 15:35:15 +00:00
|
|
|
# These tests require network access
|
2020-10-19 23:25:03 +00:00
|
|
|
"--skip=parse_correct_host_addresses"
|
|
|
|
"--skip=parse_hosts_file_and_incorrect_hosts"
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-09-25 04:45:31 +00:00
|
|
|
description = "Faster Nmap Scanning with Rust";
|
|
|
|
homepage = "https://github.com/RustScan/RustScan";
|
2024-05-15 15:35:15 +00:00
|
|
|
changelog = "https://github.com/RustScan/RustScan/releases/tag/${version}";
|
2020-09-25 04:45:31 +00:00
|
|
|
license = licenses.gpl3Only;
|
2022-09-22 12:36:57 +00:00
|
|
|
maintainers = with maintainers; [ figsoda ];
|
2024-05-15 15:35:15 +00:00
|
|
|
mainProgram = "rustscan";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
}
|