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