summary refs log tree commit diff
path: root/pkgs/tools/security/brutespray/default.nix
blob: be7c99f5252725598311705cae11b48e633c2407 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ stdenv, python3, fetchFromGitHub, makeWrapper, medusa }:

stdenv.mkDerivation rec {
  pname = "brutespray";
  version = "1.6.6";

  src = fetchFromGitHub {
    owner = "x90skysn3k";
    repo = pname;
    rev = "brutespray-${version}";
    sha256 = "1rj8fkq1xz4ph1pmldphlsa25mg6xl7i7dranb0qjx00jhfxjxjh";
  };

  postPatch = ''
    substituteInPlace brutespray.py \
      --replace "/usr/share/brutespray" "$out/share/brutespray"
  '';

  dontBuild = true;
  nativeBuildInputs = [ python3.pkgs.wrapPython makeWrapper ];
  buildInputs = [ python3 ];

  installPhase = ''
    install -Dm0755 brutespray.py $out/bin/brutespray
    patchShebangs $out/bin
    patchPythonScript $out/bin/brutespray
    wrapProgram $out/bin/brutespray \
      --prefix PATH : ${stdenv.lib.makeBinPath [ medusa ]}

    mkdir -p $out/share/brutespray
    cp -r wordlist/ $out/share/brutespray/wordlist
  '';

  meta = with stdenv.lib; {
    homepage = "https://github.com/x90skysn3k/brutespray";
    description = "Brute-Forcing from Nmap output - Automatically attempts default creds on found services";
    license = licenses.mit;
    maintainers = with maintainers; [ ma27 ];
  };
}