2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, libpcap, sqlite, makeWrapper }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = "1.4";
|
|
|
|
pname = "reaver-wps";
|
|
|
|
confdir = "/var/db/${pname}-${version}"; # the sqlite database is at "${confdir}/reaver/reaver.db"
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/reaver-wps/reaver-${version}.tar.gz";
|
|
|
|
sha256 = "0bdjai4p8xbsw8zdkkk43rgsif79x0nyx4djpyv0mzh59850blxd";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ libpcap sqlite ];
|
|
|
|
|
2022-06-16 17:23:12 +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-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-fcommon";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
setSourceRoot = ''
|
|
|
|
sourceRoot=$(echo */src)
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [ "--sysconfdir=${confdir}" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{bin,etc}
|
|
|
|
cp reaver.db $out/etc/
|
|
|
|
cp reaver wash $out/bin/
|
|
|
|
|
|
|
|
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"
|
|
|
|
'';
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
patches = [ ./parallel-build.patch ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Brute force attack against Wifi Protected Setup";
|
|
|
|
homepage = "https://code.google.com/archive/p/reaver-wps/";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = with maintainers; [ nico202 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|