tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
nikto: init at 2.2.0
SCOTT-HAMILTON
5 years ago
cfd0e90f
1d8c7f54
+92
3 changed files
expand all
collapse all
unified
split
pkgs
tools
networking
nikto
NIKTODIR-nix-wrapper-fix.patch
default.nix
top-level
all-packages.nix
+26
pkgs/tools/networking/nikto/NIKTODIR-nix-wrapper-fix.patch
···
1
1
+
diff --color -ur a/program/nikto.pl b/program/nikto.pl
2
2
+
--- a/program/nikto.pl 2021-01-30 12:05:54.915072538 +0100
3
3
+
+++ b/program/nikto.pl 2021-01-30 12:36:42.877729231 +0100
4
4
+
@@ -223,7 +223,8 @@
5
5
+
# Guess Nikto current directory
6
6
+
my $NIKTODIR = abs_path($0);
7
7
+
chomp($NIKTODIR);
8
8
+
- $NIKTODIR =~ s#[\\/]nikto.pl$##;
9
9
+
+ $NIKTODIR =~ s#[\\/]bin[\\/]\.nikto-wrapped$##;
10
10
+
+
11
11
+
12
12
+
# Guess user's home directory -- to support Windows
13
13
+
foreach my $var (split(/ /, "HOME USERPROFILE")) {
14
14
+
@@ -231,10 +232,10 @@
15
15
+
}
16
16
+
17
17
+
# Read the conf files in order (previous values are over-written with each, if multiple found)
18
18
+
- push(@CF,"$NIKTODIR/nikto.conf.default");
19
19
+
+ push(@CF,"$NIKTODIR/etc/nikto.conf.default");
20
20
+
push(@CF,"/etc/nikto.conf");
21
21
+
push(@CF,"$home/nikto.conf");
22
22
+
- push(@CF,"$NIKTODIR/nikto.conf");
23
23
+
+ push(@CF,"$NIKTODIR/etc/nikto.conf");
24
24
+
push(@CF,"nikto.conf");
25
25
+
push(@CF,"$VARIABLES{'configfile'}");
26
26
+
+64
pkgs/tools/networking/nikto/default.nix
···
1
1
+
{ lib
2
2
+
, stdenv
3
3
+
, fetchFromGitHub
4
4
+
, perlPackages
5
5
+
, makeWrapper
6
6
+
, installShellFiles
7
7
+
}:
8
8
+
9
9
+
stdenv.mkDerivation rec {
10
10
+
pname = "nikto";
11
11
+
version = "2.2.0";
12
12
+
13
13
+
src = fetchFromGitHub {
14
14
+
owner = "sullo";
15
15
+
repo = "nikto";
16
16
+
rev = "c83d0461edd75c02677dea53da2896644f35ecab";
17
17
+
sha256 = "0vwq2zdxir67cn78ls11qf1smd54nppy266v7ajm5rqdc47q7fy2";
18
18
+
};
19
19
+
20
20
+
# Nikto searches its configuration file based on its current path
21
21
+
# This fixes the current path regex for the wrapped executable.
22
22
+
patches = [ ./NIKTODIR-nix-wrapper-fix.patch ];
23
23
+
24
24
+
postPatch = ''
25
25
+
# EXECDIR needs to be changed to the path where we copy the programs stuff
26
26
+
# Forcing SSLeay is needed for SSL support (the auto mode doesn't seem to work otherwise)
27
27
+
substituteInPlace program/nikto.conf.default \
28
28
+
--replace "# EXECDIR=/opt/nikto" "EXECDIR=$out/share" \
29
29
+
--replace "LW_SSL_ENGINE=auto" "LW_SSL_ENGINE=SSLeay"
30
30
+
'';
31
31
+
32
32
+
nativeBuildInputs = [ makeWrapper installShellFiles ];
33
33
+
34
34
+
propagatedBuildInputs = [ perlPackages.NetSSLeay ];
35
35
+
36
36
+
buildInputs = [
37
37
+
perlPackages.perl
38
38
+
];
39
39
+
40
40
+
installPhase = ''
41
41
+
runHook preInstall
42
42
+
install -d "$out/share"
43
43
+
cp -a program/* "$out/share"
44
44
+
install -Dm 755 "program/nikto.pl" "$out/bin/nikto"
45
45
+
install -Dm 644 program/nikto.conf.default "$out/etc/nikto.conf"
46
46
+
installManPage documentation/nikto.1
47
47
+
install -Dm 644 program/docs/nikto_manual.html "$out/share/doc/${pname}/manual.html"
48
48
+
install -Dm 644 README.md "$out/share/doc/${pname}/README"
49
49
+
runHook postInstall
50
50
+
'';
51
51
+
52
52
+
postInstall = ''
53
53
+
wrapProgram $out/bin/nikto \
54
54
+
--prefix PERL5LIB : $PERL5LIB
55
55
+
'';
56
56
+
57
57
+
meta = with lib; {
58
58
+
description = "Web server scanner";
59
59
+
license = licenses.gpl2Plus;
60
60
+
homepage = "https://cirt.net/Nikto2";
61
61
+
maintainers = with maintainers; [ shamilton ];
62
62
+
platforms = platforms.unix;
63
63
+
};
64
64
+
}
+2
pkgs/top-level/all-packages.nix
···
15834
15834
15835
15835
nika-fonts = callPackage ../data/fonts/nika-fonts { };
15836
15836
15837
15837
+
nikto = callPackage ../tools/networking/nikto { };
15838
15838
+
15837
15839
nlohmann_json = callPackage ../development/libraries/nlohmann_json { };
15838
15840
15839
15841
nntp-proxy = callPackage ../applications/networking/nntp-proxy { };