Merge pull request #184803 from emilytrau/apache-users

apache-users: init at 2.1

authored by

Emily Trau and committed by
GitHub
f023d489 02e95b50

+67
+24
pkgs/by-name/ap/apache-users/optional-args.patch
··· 1 + --- a/apache2.1.pl 2 + +++ b/apache2.1.pl 3 + @@ -63,10 +63,10 @@ getopt ("h: l: p: e: s: t:" ,\%opts); 4 + use LWP; 5 + 6 + 7 + -if (!(exists $opts{h})||!(exists $opts{p})||!(exists $opts{l})||!(exists $opts{e})){ &usage;} 8 + +if (!(exists $opts{h})){ &usage;} 9 + 10 + sub usage{ 11 + -print "\nUSAGE: apache.pl [-h 1.2.3.4] [-l names] [-p 80] [-s (SSL Support 1=true 0=false)] [-e 403 (http code)] [-t threads]\n\n "; 12 + +print "\nUSAGE: apache-users -h 1.2.3.4 [-l names] [-p 80] [-s (SSL Support 1=true 0=false)] [-e 403 (http code)] [-t threads]\n\n "; 13 + exit 1; 14 + }; 15 + 16 + @@ -75,7 +75,7 @@ if (exists $opts{h}){ 17 + } 18 + if (exists $opts{l}){ 19 + $list=$opts{l}; 20 + -}else {$list="names";} 21 + +}else {$list="@out@/share/apache-users/names";} 22 + if (exists $opts{p}){ 23 + $port=$opts{p}; 24 + }else{$port=80;}
+43
pkgs/by-name/ap/apache-users/package.nix
··· 1 + { lib 2 + , stdenv 3 + , fetchurl 4 + , perl 5 + }: 6 + 7 + stdenv.mkDerivation (finalAttrs: { 8 + pname = "apache-users"; 9 + version = "2.1"; 10 + 11 + src = fetchurl { 12 + url = "https://labs.portcullis.co.uk/download/apache_users-${finalAttrs.version}.tar.gz"; 13 + hash = "sha256-rylW4F8Si6KKYxaxEJlVFnbLqfqS6ytMPfHpc8MgriA="; 14 + }; 15 + 16 + # Allow optional arguments where defaults are provided 17 + patches = [ ./optional-args.patch ]; 18 + 19 + postPatch = '' 20 + substituteAllInPlace apache${finalAttrs.version}.pl 21 + ''; 22 + 23 + buildInputs = [ 24 + (perl.withPackages (p: [ p.ParallelForkManager p.LWP ])) 25 + ]; 26 + 27 + installPhase = '' 28 + runHook preInstall 29 + 30 + install -D apache${finalAttrs.version}.pl $out/bin/apache-users 31 + install -Dm444 names $out/share/apache-users/names 32 + 33 + runHook postInstall 34 + ''; 35 + 36 + meta = with lib; { 37 + description = "Username Enumeration through Apache UserDir"; 38 + homepage = "https://labs.portcullis.co.uk/downloads/"; 39 + license = licenses.gpl2Plus; 40 + maintainers = with maintainers; [ emilytrau ]; 41 + mainProgram = "apache-users"; 42 + }; 43 + })