summary refs log tree commit diff
path: root/pkgs/by-name
diff options
context:
space:
mode:
authorEmily Trau <13267947+emilytrau@users.noreply.github.com>2023-11-17 22:39:49 +1100
committerGitHub <noreply@github.com>2023-11-17 22:39:49 +1100
commitf023d489972442fc96200e25448dceff7e0ee798 (patch)
tree6d9e33bb59bb8ce2ab906fe08251380083717cf6 /pkgs/by-name
parent02e95b5060f14abfc3d62a71b988a4b4295b90e1 (diff)
parent9f8b5add5f31977230080704e873ab547a316b27 (diff)
downloadnixpkgs-f023d489972442fc96200e25448dceff7e0ee798.tar
nixpkgs-f023d489972442fc96200e25448dceff7e0ee798.tar.gz
nixpkgs-f023d489972442fc96200e25448dceff7e0ee798.tar.bz2
nixpkgs-f023d489972442fc96200e25448dceff7e0ee798.tar.lz
nixpkgs-f023d489972442fc96200e25448dceff7e0ee798.tar.xz
nixpkgs-f023d489972442fc96200e25448dceff7e0ee798.tar.zst
nixpkgs-f023d489972442fc96200e25448dceff7e0ee798.zip
Merge pull request #184803 from emilytrau/apache-users
apache-users: init at 2.1
Diffstat (limited to 'pkgs/by-name')
-rw-r--r--pkgs/by-name/ap/apache-users/optional-args.patch24
-rw-r--r--pkgs/by-name/ap/apache-users/package.nix43
2 files changed, 67 insertions, 0 deletions
diff --git a/pkgs/by-name/ap/apache-users/optional-args.patch b/pkgs/by-name/ap/apache-users/optional-args.patch
new file mode 100644
index 00000000000..7b921a21ce0
--- /dev/null
+++ b/pkgs/by-name/ap/apache-users/optional-args.patch
@@ -0,0 +1,24 @@
+--- a/apache2.1.pl
++++ b/apache2.1.pl
+@@ -63,10 +63,10 @@ getopt ("h: l: p: e: s: t:" ,\%opts);
+ use LWP;
+ 
+ 
+-if (!(exists $opts{h})||!(exists $opts{p})||!(exists $opts{l})||!(exists $opts{e})){ &usage;}
++if (!(exists $opts{h})){ &usage;}
+ 
+ sub usage{
+-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 ";
++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 ";
+ exit 1;	
+ };
+ 
+@@ -75,7 +75,7 @@ if (exists $opts{h}){
+ }
+ if (exists $opts{l}){ 
+     $list=$opts{l};
+-}else {$list="names";}
++}else {$list="@out@/share/apache-users/names";}
+ if (exists $opts{p}){ 
+      $port=$opts{p};
+ }else{$port=80;}
diff --git a/pkgs/by-name/ap/apache-users/package.nix b/pkgs/by-name/ap/apache-users/package.nix
new file mode 100644
index 00000000000..8780a13a3f8
--- /dev/null
+++ b/pkgs/by-name/ap/apache-users/package.nix
@@ -0,0 +1,43 @@
+{ lib
+, stdenv
+, fetchurl
+, perl
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "apache-users";
+  version = "2.1";
+
+  src = fetchurl {
+    url = "https://labs.portcullis.co.uk/download/apache_users-${finalAttrs.version}.tar.gz";
+    hash = "sha256-rylW4F8Si6KKYxaxEJlVFnbLqfqS6ytMPfHpc8MgriA=";
+  };
+
+  # Allow optional arguments where defaults are provided
+  patches = [ ./optional-args.patch ];
+
+  postPatch = ''
+    substituteAllInPlace apache${finalAttrs.version}.pl
+  '';
+
+  buildInputs = [
+    (perl.withPackages (p: [ p.ParallelForkManager p.LWP ]))
+  ];
+
+  installPhase = ''
+    runHook preInstall
+
+    install -D apache${finalAttrs.version}.pl $out/bin/apache-users
+    install -Dm444 names $out/share/apache-users/names
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Username Enumeration through Apache UserDir";
+    homepage = "https://labs.portcullis.co.uk/downloads/";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ emilytrau ];
+    mainProgram = "apache-users";
+  };
+})