From f45177116b1566118dd3a9a6f3421ef7ebdcc9d8 Mon Sep 17 00:00:00 2001 From: Emily Trau Date: Tue, 2 Aug 2022 23:13:49 +1000 Subject: [PATCH] xsser: init at 1.8.4 --- pkgs/tools/security/xsser/default.nix | 64 +++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 66 insertions(+) create mode 100644 pkgs/tools/security/xsser/default.nix diff --git a/pkgs/tools/security/xsser/default.nix b/pkgs/tools/security/xsser/default.nix new file mode 100644 index 00000000000..5028b3c7721 --- /dev/null +++ b/pkgs/tools/security/xsser/default.nix @@ -0,0 +1,64 @@ +{ lib, buildPythonApplication, fetchFromGitHub, wrapGAppsHook, gobject-introspection, gtk3, pango +, pillow, pycurl, beautifulsoup4, pygeoip, pygobject3, cairocffi, selenium }: + +buildPythonApplication rec { + pname = "xsser"; + version = "1.8.4"; + + src = fetchFromGitHub { + owner = "epsylon"; + repo = pname; + rev = "478242e6d8e1ca921e0ba8fa59b50106fa2f7312"; + sha256 = "MsQu/r1C6uXawpuVTuBGhWNqCSZ9S2DIx15Lpo7L4RI="; + }; + + postPatch = '' + # Replace relative path with absolute store path + find . -type f -exec sed -i "s|core/fuzzing/user-agents.txt|$out/share/xsser/fuzzing/user-agents.txt|g" {} + + + # Replace absolute path references with store paths + substituteInPlace core/main.py --replace /usr $out + substituteInPlace gtk/xsser.desktop --replace /usr $out + substituteInPlace setup.py --replace /usr/share share + ''; + + # Temporary fix + # See https://github.com/NixOS/nixpkgs/issues/56943 + strictDeps = false; + + nativeBuildInputs = [ wrapGAppsHook gobject-introspection ]; + + buildInputs = [ + gtk3 + pango + ]; + + propagatedBuildInputs = [ + pillow + pycurl + beautifulsoup4 + pygeoip + pygobject3 + cairocffi + selenium + ]; + + # Project has no tests + doCheck = false; + + dontWrapGApps = true; + preFixup = '' + makeWrapperArgs+=("''${gappsWrapperArgs[@]}") + ''; + + postInstall = '' + install -D core/fuzzing/user-agents.txt $out/share/xsser/fuzzing/user-agents.txt + ''; + + meta = with lib; { + description = "Automatic framework to detect, exploit and report XSS vulnerabilities in web-based applications"; + homepage = "https://xsser.03c8.net/"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ emilytrau ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ab743a3ff93..17d793d33be 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -35834,6 +35834,8 @@ with pkgs; sane-backends = sane-backends.override { libpng = libpng12; }; }; + xsser = python3Packages.callPackage ../tools/security/xsser { }; + xsw = callPackage ../applications/misc/xsw { # Enable the next line to use this in terminal. # Note that it requires sixel capable terminals such as mlterm