1{ lib, stdenv
2, buildGoModule
3, fetchFromGitHub
4, pkg-config
5, libpcap
6, libnfnetlink
7, libnetfilter_queue
8, libusb1
9}:
10
11buildGoModule rec {
12 pname = "bettercap";
13 version = "2.32.0";
14
15 src = fetchFromGitHub {
16 owner = pname;
17 repo = pname;
18 rev = "v${version}";
19 sha256 = "sha256-OND8WPqU/95rKykqMAPWmDsJ+AjsjGjrncZ2/m3mpt0=";
20 };
21
22 vendorHash = "sha256-QKv8F9QLRi+1Bqj9KywJsTErjs7o6gFM4tJLA8y52MY=";
23
24 doCheck = false;
25
26 nativeBuildInputs = [ pkg-config ];
27 buildInputs = [ libpcap libusb1 ]
28 ++ lib.optionals stdenv.isLinux [ libnfnetlink libnetfilter_queue ];
29
30 meta = with lib; {
31 description = "A man in the middle tool";
32 longDescription = ''
33 BetterCAP is a powerful, flexible and portable tool created to perform various
34 types of MITM attacks against a network, manipulate HTTP, HTTPS and TCP traffic
35 in realtime, sniff for credentials and much more.
36 '';
37 homepage = "https://www.bettercap.org/";
38 license = with licenses; [ gpl3Only ];
39 maintainers = with maintainers; [ y0no ];
40 mainProgram = "bettercap";
41 };
42}