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-09-19 14:19:46 +00:00
|
|
|
version = "2.3.0";
|
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}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-6heC/bHo4IqKNvPjch7AiyWTCZDCv4MZHC7DTEX3U5c=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
cargoHash = "sha256-Fr+m4BeYvUOoSkewwdUgpmdNchweeLK7v/tKLEzFOBs=";
|
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
|
|
|
'';
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = lib.optional stdenv.hostPlatform.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"
|
2024-09-19 14:19:46 +00:00
|
|
|
"--skip=resolver_args_google_dns"
|
|
|
|
"--skip=resolver_default_cloudflare"
|
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
|
|
|
};
|
|
|
|
}
|