nixpkgs/pkgs/tools/networking/nikto/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
1.8 KiB
Nix
Raw Normal View History

2021-01-30 11:46:36 +00:00
{ lib
, stdenv
, fetchFromGitHub
, perlPackages
, makeWrapper
, installShellFiles
}:
2023-12-03 22:23:39 +00:00
let
version = "2.5.0";
in
2021-01-30 11:46:36 +00:00
stdenv.mkDerivation rec {
pname = "nikto";
2023-12-03 22:23:39 +00:00
inherit version;
2021-01-30 11:46:36 +00:00
src = fetchFromGitHub {
owner = "sullo";
repo = "nikto";
2023-12-03 22:23:39 +00:00
rev = version;
sha256 = "sha256-lWiDbWc2BWAUgyaIm0tvZytja02WogYRoc7na4sHiNM=";
2021-01-30 11:46:36 +00:00
};
# Nikto searches its configuration file based on its current path
# This fixes the current path regex for the wrapped executable.
2023-12-03 22:23:39 +00:00
patches = [ ./nix-wrapper-fix.patch ];
2021-01-30 11:46:36 +00:00
postPatch = ''
# EXECDIR needs to be changed to the path where we copy the programs stuff
# Forcing SSLeay is needed for SSL support (the auto mode doesn't seem to work otherwise)
substituteInPlace program/nikto.conf.default \
--replace "# EXECDIR=/opt/nikto" "EXECDIR=$out/share" \
--replace "LW_SSL_ENGINE=auto" "LW_SSL_ENGINE=SSLeay"
'';
nativeBuildInputs = [ makeWrapper installShellFiles ];
buildInputs = [
perlPackages.perl
2023-12-03 22:23:39 +00:00
perlPackages.NetSSLeay
2021-01-30 11:46:36 +00:00
];
installPhase = ''
runHook preInstall
install -d "$out/share"
cp -a program/* "$out/share"
install -Dm 755 "program/nikto.pl" "$out/bin/nikto"
install -Dm 644 program/nikto.conf.default "$out/etc/nikto.conf"
installManPage documentation/nikto.1
install -Dm 644 README.md "$out/share/doc/${pname}/README"
runHook postInstall
'';
postInstall = ''
wrapProgram $out/bin/nikto \
--prefix PERL5LIB : $PERL5LIB
'';
meta = with lib; {
description = "Web server scanner";
mainProgram = "nikto";
2021-01-30 11:46:36 +00:00
license = licenses.gpl2Plus;
homepage = "https://cirt.net/Nikto2";
2023-12-03 22:23:39 +00:00
changelog = "https://github.com/sullo/nikto/releases/tag/${version}";
2021-01-30 11:46:36 +00:00
maintainers = with maintainers; [ shamilton ];
platforms = platforms.unix;
};
}