2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, libpcap, sqlite, makeWrapper }:
|
2013-04-26 13:06:20 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-05-07 18:01:36 +00:00
|
|
|
version = "1.4";
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "reaver-wps";
|
|
|
|
confdir = "/var/db/${pname}-${version}"; # the sqlite database is at "${confdir}/reaver/reaver.db"
|
2013-04-26 13:06:20 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-05-07 18:01:36 +00:00
|
|
|
url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/reaver-wps/reaver-${version}.tar.gz";
|
2013-04-26 13:06:20 +00:00
|
|
|
sha256 = "0bdjai4p8xbsw8zdkkk43rgsif79x0nyx4djpyv0mzh59850blxd";
|
|
|
|
};
|
|
|
|
|
2017-05-07 18:01:36 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2013-04-26 13:06:20 +00:00
|
|
|
buildInputs = [ libpcap sqlite ];
|
|
|
|
|
2022-06-05 19:15:29 +00:00
|
|
|
# Workaround build failure on -fno-common toolchains:
|
|
|
|
# ld: crypto/dh_groups.o:src/crypto/../globule.h:141: multiple definition of
|
|
|
|
# `globule'; /build/ccrzO6vA.o:src/globule.h:141: first defined here
|
2023-02-19 19:23:32 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-fcommon";
|
2017-11-02 12:54:20 +00:00
|
|
|
|
|
|
|
setSourceRoot = ''
|
|
|
|
sourceRoot=$(echo */src)
|
|
|
|
'';
|
2017-05-07 18:01:36 +00:00
|
|
|
|
2018-07-25 21:44:21 +00:00
|
|
|
configureFlags = [ "--sysconfdir=${confdir}" ];
|
2017-05-07 18:01:36 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{bin,etc}
|
|
|
|
cp reaver.db $out/etc/
|
|
|
|
cp reaver wash $out/bin/
|
2013-04-26 13:06:20 +00:00
|
|
|
|
2017-05-07 18:01:36 +00:00
|
|
|
wrapProgram $out/bin/reaver --run "[ -s ${confdir}/reaver/reaver.db ] || install -D $out/etc/reaver.db ${confdir}/reaver/reaver.db"
|
|
|
|
wrapProgram $out/bin/wash --run "[ -s ${confdir}/reaver/reaver.db ] || install -D $out/etc/reaver.db ${confdir}/reaver/reaver.db"
|
2013-04-26 13:06:20 +00:00
|
|
|
'';
|
|
|
|
|
2022-02-12 14:23:43 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
patches = [ ./parallel-build.patch ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2013-04-26 13:06:20 +00:00
|
|
|
description = "Brute force attack against Wifi Protected Setup";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://code.google.com/archive/p/reaver-wps/";
|
2017-05-07 18:01:36 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
2022-06-22 22:49:35 +00:00
|
|
|
maintainers = with maintainers; [ nico202 ];
|
2013-04-26 13:06:20 +00:00
|
|
|
};
|
|
|
|
}
|