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 chardet
53 distutils # src/wfuzz/plugin_api/base.py
54 pycurl
55 six
56 setuptools
57 pyparsing
58 ]
59 ++ lib.optionals stdenv.hostPlatform.isWindows [ colorama ]
60 ++ lib.optionals (pythonAtLeast "3.13") [ legacy-cgi ];
61
62 nativeCheckInputs = [
63 netaddr
64 pytestCheckHook
65 ];
66
67 preCheck = ''
68 export HOME=$(mktemp -d)
69 '';
70
71 disabledTestPaths = [
72 # The tests are requiring a local web server
73 "tests/test_acceptance.py"
74 "tests/acceptance/test_saved_filter.py"
75 # depends on imp module removed from Python 3.12
76 "tests/test_moduleman.py"
77 ];
78
79 pythonImportsCheck = [ "wfuzz" ];
80
81 postInstall = ''
82 mkdir -p $out/share/wordlists/wfuzz
83 cp -R -T "wordlist" "$out/share/wordlists/wfuzz"
84 '';
85
86 meta = with lib; {
87 changelog = "https://github.com/xmendez/wfuzz/releases/tag/v${version}";
88 description = "Web content fuzzer to facilitate web applications assessments";
89 longDescription = ''
90 Wfuzz provides a framework to automate web applications security assessments
91 and could help you to secure your web applications by finding and exploiting
92 web application vulnerabilities.
93 '';
94 homepage = "https://wfuzz.readthedocs.io";
95 license = with licenses; [ gpl2Only ];
96 maintainers = with maintainers; [ pamplemousse ];
97 };
98}