From c82a648d33691fee5c2f067c5ce2eb33adc62a42 Mon Sep 17 00:00:00 2001 From: Markus Ankenbrand Date: Sun, 1 Apr 2018 16:39:33 +0200 Subject: bettercap: 1.6.2 -> 2.4.0 bettercap 2 is a complete reimplementation using go instead of ruby See: https://www.evilsocket.net/2018/02/27/All-hail-bettercap-2-0-one-tool-to-rule-them-all/ --- pkgs/tools/security/bettercap/Gemfile | 2 - pkgs/tools/security/bettercap/Gemfile.lock | 42 ------ pkgs/tools/security/bettercap/default.nix | 23 ++- pkgs/tools/security/bettercap/deps.nix | 228 +++++++++++++++++++++++++++++ pkgs/tools/security/bettercap/gemset.nix | 121 --------------- 5 files changed, 243 insertions(+), 173 deletions(-) delete mode 100644 pkgs/tools/security/bettercap/Gemfile delete mode 100644 pkgs/tools/security/bettercap/Gemfile.lock create mode 100644 pkgs/tools/security/bettercap/deps.nix delete mode 100644 pkgs/tools/security/bettercap/gemset.nix (limited to 'pkgs/tools/security/bettercap') diff --git a/pkgs/tools/security/bettercap/Gemfile b/pkgs/tools/security/bettercap/Gemfile deleted file mode 100644 index 8fb2a1c300a7..000000000000 --- a/pkgs/tools/security/bettercap/Gemfile +++ /dev/null @@ -1,2 +0,0 @@ -source 'https://rubygems.org' -gem 'bettercap' diff --git a/pkgs/tools/security/bettercap/Gemfile.lock b/pkgs/tools/security/bettercap/Gemfile.lock deleted file mode 100644 index 9260d1fd5ab6..000000000000 --- a/pkgs/tools/security/bettercap/Gemfile.lock +++ /dev/null @@ -1,42 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - bettercap (1.6.2) - colorize (~> 0.8.0) - em-proxy (~> 0.1, >= 0.1.8) - net-dns (~> 0.8, >= 0.8.0) - network_interface (~> 0.0, >= 0.0.1) - packetfu (~> 1.1, >= 1.1.10) - pcaprub (~> 0.12, >= 0.12.0, <= 1.1.11) - rubydns (~> 1.0, >= 1.0.3) - celluloid (0.16.0) - timers (~> 4.0.0) - celluloid-io (0.16.2) - celluloid (>= 0.16.0) - nio4r (>= 1.1.0) - colorize (0.8.1) - em-proxy (0.1.9) - eventmachine - eventmachine (1.2.5) - hitimes (1.2.6) - net-dns (0.8.0) - network_interface (0.0.2) - nio4r (2.2.0) - packetfu (1.1.13) - pcaprub - pcaprub (0.12.4) - rubydns (1.0.3) - celluloid (= 0.16.0) - celluloid-io (= 0.16.2) - timers (~> 4.0.1) - timers (4.0.4) - hitimes - -PLATFORMS - ruby - -DEPENDENCIES - bettercap - -BUNDLED WITH - 1.14.6 diff --git a/pkgs/tools/security/bettercap/default.nix b/pkgs/tools/security/bettercap/default.nix index 46832e83ac96..a85ce7df9216 100644 --- a/pkgs/tools/security/bettercap/default.nix +++ b/pkgs/tools/security/bettercap/default.nix @@ -1,16 +1,23 @@ -{ lib, bundlerEnv, ruby, libpcap}: +{ stdenv, buildGoPackage, fetchFromGitHub, pkgconfig, libpcap, libnfnetlink, libnetfilter_queue }: -bundlerEnv rec { +buildGoPackage rec { name = "bettercap-${version}"; + version = "2.4"; - version = (import gemset).bettercap.version; - inherit ruby; - gemdir = ./.; - gemset = ./gemset.nix; + goPackagePath = "github.com/bettercap/bettercap"; - buildInputs = [ libpcap ruby ]; + src = fetchFromGitHub { + owner = "bettercap"; + repo = "bettercap"; + rev = "v${version}"; + sha256 = "1k1ank8z9sr3vxm86dfcrn1y3qa3gfwyb2z0fvkvi38gc88pfljb"; + }; + + buildInputs = [libpcap libnfnetlink libnetfilter_queue pkgconfig]; + + goDeps = ./deps.nix; - meta = with lib; { + meta = with stdenv.lib; { description = "A man in the middle tool"; longDescription = '' BetterCAP is a powerful, flexible and portable tool created to perform various types of MITM attacks against a network, manipulate HTTP, HTTPS and TCP traffic in realtime, sniff for credentials and much more. diff --git a/pkgs/tools/security/bettercap/deps.nix b/pkgs/tools/security/bettercap/deps.nix new file mode 100644 index 000000000000..6a03e88000c2 --- /dev/null +++ b/pkgs/tools/security/bettercap/deps.nix @@ -0,0 +1,228 @@ +# file generated from Gopkg.lock using dep2nix (https://github.com/nixcloud/dep2nix) +[ + { + goPackagePath = "github.com/adrianmo/go-nmea"; + fetch = { + type = "git"; + url = "https://github.com/adrianmo/go-nmea"; + rev = "22095aa1b48050243d3eb9a001ca80eb91a0c6fa"; + sha256 = "0hgjfmnff794j537kbrjcsxzr9xyggm09rw3wp2xrzahh9pxdlm5"; + }; + } + { + goPackagePath = "github.com/bettercap/gatt"; + fetch = { + type = "git"; + url = "https://github.com/bettercap/gatt"; + rev = "6475b946a0bff32e906c25d861f2b1c6d2056baa"; + sha256 = "0f2n35yz6fcbmswy1wyv2z72d3iia7xxapjkvwkbj2zqfxxwn26s"; + }; + } + { + goPackagePath = "github.com/bettercap/readline"; + fetch = { + type = "git"; + url = "https://github.com/bettercap/readline"; + rev = "9cec905dd29109b64e6752507fba73474c2efd46"; + sha256 = "1lsnyckg2l78hz4la8dhwvjsyff706khw10nxds5afzl4mrih3vn"; + }; + } + { + goPackagePath = "github.com/chifflier/nfqueue-go"; + fetch = { + type = "git"; + url = "https://github.com/chifflier/nfqueue-go"; + rev = "61ca646babef3bd4dea1deb610bfb0005c0a1298"; + sha256 = "1i1q2xl86f3s9x3j2ffxprwqhcrkh4w23hh4ib7jksxvaq36v33l"; + }; + } + { + goPackagePath = "github.com/dustin/go-humanize"; + fetch = { + type = "git"; + url = "https://github.com/dustin/go-humanize"; + rev = "bb3d318650d48840a39aa21a027c6630e198e626"; + sha256 = "1lqd8ix3cb164j5iazjby2jpa6bdsflhy0h9mi4yldvvcvrc194c"; + }; + } + { + goPackagePath = "github.com/elazarl/goproxy"; + fetch = { + type = "git"; + url = "https://github.com/elazarl/goproxy"; + rev = "a96fa3a318260eab29abaf32f7128c9eb07fb073"; + sha256 = "0grm4n28mkj2w4c42ghl797svxykv1z3hsdi1ihnrvq6pr08xky4"; + }; + } + { + goPackagePath = "github.com/google/go-github"; + fetch = { + type = "git"; + url = "https://github.com/google/go-github"; + rev = "437797734d06eec5394734a84cb5b59c82a66ee6"; + sha256 = "09ajj73rwsxc03dmm39g8b0qaz88h6gnraw2xn8h7z57qqv6ikcx"; + }; + } + { + goPackagePath = "github.com/google/go-querystring"; + fetch = { + type = "git"; + url = "https://github.com/google/go-querystring"; + rev = "53e6ce116135b80d037921a7fdd5138cf32d7a8a"; + sha256 = "0lkbm067nhmxk66pyjx59d77dbjjzwyi43gdvzyx2f8m1942rq7f"; + }; + } + { + goPackagePath = "github.com/google/gopacket"; + fetch = { + type = "git"; + url = "https://github.com/google/gopacket"; + rev = "1d3841317373a001d49e2abcc5be4e442211d454"; + sha256 = "1jffnrvrma3rm5zxmig52145y9bxc3b4ys4jr1nwmq43jk15s3kp"; + }; + } + { + goPackagePath = "github.com/gorilla/context"; + fetch = { + type = "git"; + url = "https://github.com/gorilla/context"; + rev = "08b5f424b9271eedf6f9f0ce86cb9396ed337a42"; + sha256 = "03p4hn87vcmfih0p9w663qbx9lpsf7i7j3lc7yl7n84la3yz63m4"; + }; + } + { + goPackagePath = "github.com/gorilla/mux"; + fetch = { + type = "git"; + url = "https://github.com/gorilla/mux"; + rev = "4dbd923b0c9e99ff63ad54b0e9705ff92d3cdb06"; + sha256 = "02d5c3vh81v2j6g6fnca87ksxjx0xrgp7x7iivfw5x92q1l5h254"; + }; + } + { + goPackagePath = "github.com/gorilla/websocket"; + fetch = { + type = "git"; + url = "https://github.com/gorilla/websocket"; + rev = "eb925808374e5ca90c83401a40d711dc08c0c0f6"; + sha256 = "0swncxnl97pmsl78q1p4npx9jghnrzj7alkxab89jy9cza5w165x"; + }; + } + { + goPackagePath = "github.com/inconshreveable/go-vhost"; + fetch = { + type = "git"; + url = "https://github.com/inconshreveable/go-vhost"; + rev = "06d84117953b22058c096b49a429ebd4f3d3d97b"; + sha256 = "0wliilsybm7xf5h685a23rsm8bnlhkr332pkdkhf32q16sr1a9rk"; + }; + } + { + goPackagePath = "github.com/jpillora/go-tld"; + fetch = { + type = "git"; + url = "https://github.com/jpillora/go-tld"; + rev = "a31ae10e978ab5f352c5dad2cfbd60546dcea75f"; + sha256 = "1gfxnbr1xsnlja2qpqxis8ynnk1lrz9c65aah7vc2c44g8vyy78x"; + }; + } + { + goPackagePath = "github.com/malfunkt/iprange"; + fetch = { + type = "git"; + url = "https://github.com/malfunkt/iprange"; + rev = "3a31f5ed42d2d8a1fc46f1be91fd693bdef2dd52"; + sha256 = "0gv5w678r74jval675xp0y1hzpf7mm5m9apa1rz9krxc9zd0ycr8"; + }; + } + { + goPackagePath = "github.com/mattn/go-colorable"; + fetch = { + type = "git"; + url = "https://github.com/mattn/go-colorable"; + rev = "efa589957cd060542a26d2dd7832fd6a6c6c3ade"; + sha256 = "0kshi4hvm0ayrsxqxy0599iv81kryhd2fn9lwjyczpj593cq069r"; + }; + } + { + goPackagePath = "github.com/mattn/go-isatty"; + fetch = { + type = "git"; + url = "https://github.com/mattn/go-isatty"; + rev = "6ca4dbf54d38eea1a992b3c722a76a5d1c4cb25c"; + sha256 = "0zs92j2cqaw9j8qx1sdxpv3ap0rgbs0vrvi72m40mg8aa36gd39w"; + }; + } + { + goPackagePath = "github.com/mdlayher/dhcp6"; + fetch = { + type = "git"; + url = "https://github.com/mdlayher/dhcp6"; + rev = "e26af0688e455a82b14ebdbecf43f87ead3c4624"; + sha256 = "0fvw8zz2yhla03jfb79bby9vg4rbmaj39v00ypb8yl4fb696zfip"; + }; + } + { + goPackagePath = "github.com/mgutz/ansi"; + fetch = { + type = "git"; + url = "https://github.com/mgutz/ansi"; + rev = "9520e82c474b0a04dd04f8a40959027271bab992"; + sha256 = "00bz22314j26736w1f0q4jy9d9dfaml17vn890n5zqy3cmvmww1j"; + }; + } + { + goPackagePath = "github.com/mgutz/logxi"; + fetch = { + type = "git"; + url = "https://github.com/mgutz/logxi"; + rev = "aebf8a7d67ab4625e0fd4a665766fef9a709161b"; + sha256 = "1f8sqibkzz9wfplvvblz9s0xvvmhkd2af8ghcsmjw8818gcrzsqx"; + }; + } + { + goPackagePath = "github.com/pkg/errors"; + fetch = { + type = "git"; + url = "https://github.com/pkg/errors"; + rev = "816c9085562cd7ee03e7f8188a1cfd942858cded"; + sha256 = "1ws5crb7c70wdicavl6qr4g03nn6m92zd6wwp9n2ygz5c8rmxh8k"; + }; + } + { + goPackagePath = "github.com/robertkrimen/otto"; + fetch = { + type = "git"; + url = "https://github.com/robertkrimen/otto"; + rev = "6c383dd335ef8dcccef05e651ce1eccfe4d0f011"; + sha256 = "1n6h7c8gi6wv4nklqd7ygzx2afvh7ddxbml9w9x0jxwcfb3bdy17"; + }; + } + { + goPackagePath = "github.com/tarm/serial"; + fetch = { + type = "git"; + url = "https://github.com/tarm/serial"; + rev = "eaafced92e9619f03c72527efeab21e326f3bc36"; + sha256 = "09pii3q72bygv40v9xsh3nzj821iwqwa0b14wvkagid8mfnl3a7k"; + }; + } + { + goPackagePath = "golang.org/x/sys"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sys"; + rev = "378d26f46672a356c46195c28f61bdb4c0a781dd"; + sha256 = "1d02saysx8lh2wv8s915k4shiqicg4j1fh6sxmcxy6bvywax2q9c"; + }; + } + { + goPackagePath = "gopkg.in/sourcemap.v1"; + fetch = { + type = "git"; + url = "https://github.com/go-sourcemap/sourcemap"; + rev = "b019cc30c1eaa584753491b0d8f8c1534bf1eb44"; + sha256 = "03k44fdrnknba05f7cd58lq4rzk7jdpiqksmc0wxrdzwschrbgw8"; + }; + } +] \ No newline at end of file diff --git a/pkgs/tools/security/bettercap/gemset.nix b/pkgs/tools/security/bettercap/gemset.nix deleted file mode 100644 index bd5c33ba22c6..000000000000 --- a/pkgs/tools/security/bettercap/gemset.nix +++ /dev/null @@ -1,121 +0,0 @@ -{ - bettercap = { - dependencies = ["colorize" "em-proxy" "net-dns" "network_interface" "packetfu" "pcaprub" "rubydns"]; - source = { - remotes = ["https://rubygems.org"]; - sha256 = "1mns96yfyfnksk720p8k83qkwwsid4sicwgrzxaa9gbc53aalll0"; - type = "gem"; - }; - version = "1.6.2"; - }; - celluloid = { - dependencies = ["timers"]; - source = { - remotes = ["https://rubygems.org"]; - sha256 = "044xk0y7i1xjafzv7blzj5r56s7zr8nzb619arkrl390mf19jxv3"; - type = "gem"; - }; - version = "0.16.0"; - }; - celluloid-io = { - dependencies = ["celluloid" "nio4r"]; - source = { - remotes = ["https://rubygems.org"]; - sha256 = "1l1x0p6daa5vskywrvaxdlanwib3k5pps16axwyy4p8d49pn9rnx"; - type = "gem"; - }; - version = "0.16.2"; - }; - colorize = { - source = { - remotes = ["https://rubygems.org"]; - sha256 = "133rqj85n400qk6g3dhf2bmfws34mak1wqihvh3bgy9jhajw580b"; - type = "gem"; - }; - version = "0.8.1"; - }; - em-proxy = { - dependencies = ["eventmachine"]; - source = { - remotes = ["https://rubygems.org"]; - sha256 = "1yzkg6jkmcg859b5mf13igpf8q2bjhsmqjsva05948fi733w5n2j"; - type = "gem"; - }; - version = "0.1.9"; - }; - eventmachine = { - source = { - remotes = ["https://rubygems.org"]; - sha256 = "075hdw0fgzldgss3xaqm2dk545736khcvv1fmzbf1sgdlkyh1v8z"; - type = "gem"; - }; - version = "1.2.5"; - }; - hitimes = { - source = { - remotes = ["https://rubygems.org"]; - sha256 = "06222h9236jw9jgmdlpi0q7psac1shvxqxqx905qkvabmxdxlfar"; - type = "gem"; - }; - version = "1.2.6"; - }; - net-dns = { - source = { - remotes = ["https://rubygems.org"]; - sha256 = "12nal6vhdyg0pbcqpsxqr59h7mbgdhcqp3v0xnzvy167n40gabf9"; - type = "gem"; - }; - version = "0.8.0"; - }; - network_interface = { - source = { - remotes = ["https://rubygems.org"]; - sha256 = "1xh4knfq77ii4pjzsd2z1p3nd6nrcdjhb2vi5gw36jqj43ffw0zp"; - type = "gem"; - }; - version = "0.0.2"; - }; - nio4r = { - source = { - remotes = ["https://rubygems.org"]; - sha256 = "0jjrj7vs29w6dfgsxq08226jfbi2j0x62lf4p9zmvyp19dj4z00a"; - type = "gem"; - }; - version = "2.2.0"; - }; - packetfu = { - dependencies = ["pcaprub"]; - source = { - remotes = ["https://rubygems.org"]; - sha256 = "16ppq9wfxq4x2hss61l5brs3s6fmi8gb50mnp1nnnzb1asq4g8ll"; - type = "gem"; - }; - version = "1.1.13"; - }; - pcaprub = { - source = { - remotes = ["https://rubygems.org"]; - sha256 = "0pl4lqy7308185pfv0197n8b4v20fhd0zb3wlpz284rk8ssclkvz"; - type = "gem"; - }; - version = "0.12.4"; - }; - rubydns = { - dependencies = ["celluloid" "celluloid-io" "timers"]; - source = { - remotes = ["https://rubygems.org"]; - sha256 = "1cvj8li8shz7zn1rc5hdrkqmvr9j187g4y28mvkfvmv1j9hdln62"; - type = "gem"; - }; - version = "1.0.3"; - }; - timers = { - dependencies = ["hitimes"]; - source = { - remotes = ["https://rubygems.org"]; - sha256 = "1jx4wb0x182gmbcs90vz0wzfyp8afi1mpl9w5ippfncyk4kffvrz"; - type = "gem"; - }; - version = "4.0.4"; - }; -} \ No newline at end of file -- cgit v1.2.3