nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 chardet,
6 colorama,
7 distutils,
8 fetchFromGitHub,
9 netaddr,
10 pycurl,
11 pyparsing,
12 pytestCheckHook,
13 setuptools,
14 six,
15 fetchpatch2,
16 legacy-cgi,
17}:
18
19buildPythonPackage rec {
20 pname = "wfuzz";
21 version = "3.1.1";
22 pyproject = true;
23
24 src = fetchFromGitHub {
25 owner = "xmendez";
26 repo = "wfuzz";
27 tag = "v${version}";
28 hash = "sha256-OYMZHo0ujRzwOcE+EKRNPxffxVbbiMHe+AqBz7q/u2A=";
29 };
30
31 patches = [
32 # replace use of imp module for Python 3.12
33 # https://github.com/xmendez/wfuzz/pull/365
34 (fetchpatch2 {
35 url = "https://github.com/xmendez/wfuzz/commit/f4c028b9ada4c36dabf3bc752f69f6ddc110920f.patch?full_index=1";
36 hash = "sha256-t7pUMcdFmwAsGUNBRdZr+Jje/yR0yzeGIgeYNEq4hFE=";
37 })
38 ];
39
40 postPatch = ''
41 substituteInPlace setup.py \
42 --replace-fail "pyparsing>=2.4*" "pyparsing>=2.4"
43 '';
44
45 build-system = [ setuptools ];
46
47 dependencies = [
48 chardet
49 distutils # src/wfuzz/plugin_api/base.py
50 legacy-cgi
51 pycurl
52 six
53 setuptools
54 pyparsing
55 ]
56 ++ lib.optionals stdenv.hostPlatform.isWindows [ colorama ];
57
58 nativeCheckInputs = [
59 netaddr
60 pytestCheckHook
61 ];
62
63 preCheck = ''
64 export HOME=$(mktemp -d)
65 '';
66
67 disabledTestPaths = [
68 # The tests are requiring a local web server
69 "tests/test_acceptance.py"
70 "tests/acceptance/test_saved_filter.py"
71 # depends on imp module removed from Python 3.12
72 "tests/test_moduleman.py"
73 ];
74
75 pythonImportsCheck = [ "wfuzz" ];
76
77 postInstall = ''
78 mkdir -p $out/share/wordlists/wfuzz
79 cp -R -T "wordlist" "$out/share/wordlists/wfuzz"
80 '';
81
82 meta = {
83 changelog = "https://github.com/xmendez/wfuzz/releases/tag/${src.tag}";
84 description = "Web content fuzzer to facilitate web applications assessments";
85 longDescription = ''
86 Wfuzz provides a framework to automate web applications security assessments
87 and could help you to secure your web applications by finding and exploiting
88 web application vulnerabilities.
89 '';
90 homepage = "https://wfuzz.readthedocs.io";
91 license = with lib.licenses; [ gpl2Only ];
92 maintainers = with lib.maintainers; [ pamplemousse ];
93 };
94}