blob: ef2b5c3101c7d11a3656ca13822429ba9b0d80ee (
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
{ lib
, stdenv
, fetchurl
, fetchFromGitHub
, jdk11
, gradle_6
, metasploit
, makeWrapper
, makeDesktopItem
, copyDesktopItems
, writeDarwinBundle
}:
let
pname = "armitage";
version = "unstable-2022-12-05";
gradle = gradle_6;
src = fetchFromGitHub {
owner = "r00t0v3rr1d3";
repo = "armitage";
rev = "991244e9a0c0fc9302e48c4e708347c315f78b13";
hash = "sha256-0ik20wzE0cf6cC/HY6RwMHqkvqPFpZmOUyZyb5H3SHg=";
};
patches = [
(fetchurl {
name = "Remove-mentions-of-old-metasploit-versions.patch";
url = "https://gitlab.com/kalilinux/packages/armitage/-/raw/042beb7494a10227761ecb3ddabf4019bbb78681/debian/patches/Remove-mentions-of-old-metasploit-versions.patch";
hash = "sha256-VUey/e8kcBWqAxYTfIXoyTAoDR/UKZKqBJAKmdabArY=";
})
(fetchurl {
name = "Update-postgresql-version-to-support-scram-sha-256.patch";
url = "https://gitlab.com/kalilinux/packages/armitage/-/raw/042beb7494a10227761ecb3ddabf4019bbb78681/debian/patches/Update-postgresql-version-to-support-scram-sha-256.patch";
hash = "sha256-ZPvcRoUCrq32g0Mw8+EhNl8DlI+jMYUlFyPW1VScgzc=";
})
(fetchurl {
name = "fix-launch-script.patch";
url = "https://gitlab.com/kalilinux/packages/armitage/-/raw/042beb7494a10227761ecb3ddabf4019bbb78681/debian/patches/fix-launch-script.patch";
hash = "sha256-I6T7iwShQLn+ZHuKa117VOlItXjY4/51RDbjvNJEW/4=";
})
(fetchurl {
name = "fix-meterpreter.patch";
url = "https://gitlab.com/kalilinux/packages/armitage/-/raw/042beb7494a10227761ecb3ddabf4019bbb78681/debian/patches/fix-meterpreter.patch";
hash = "sha256-p4fs5xFdC2apW0U8x8u9S4p5gq3Eiv+0E4CGccQZYKY=";
})
];
in
stdenv.mkDerivation (finalAttrs: {
inherit pname version src patches;
desktopItems = [
(makeDesktopItem {
name = "armitage";
desktopName = "Armitage";
exec = "armitage";
icon = "armitage";
comment = finalAttrs.meta.description;
categories = [ "Network" "Security" ];
startupNotify = false;
})
];
nativeBuildInputs = [
jdk11
gradle
makeWrapper
copyDesktopItems
] ++ lib.optionals stdenv.isDarwin [
writeDarwinBundle
];
mitmCache = gradle.fetchDeps {
inherit pname;
data = ./deps.json;
};
__darwinAllowLocalNetworking = true;
installPhase = ''
runHook preInstall
JAR="$out/share/armitage/armitage.jar"
install -Dm444 build/armitage.jar $JAR
install -Dm755 dist/unix/armitage $out/bin/armitage
substituteInPlace $out/bin/armitage \
--replace "armitage.jar" "$JAR"
wrapProgram $out/bin/armitage \
--prefix PATH : "${lib.makeBinPath [ jdk11 metasploit ]}"
install -Dm755 dist/unix/teamserver $out/bin/teamserver
substituteInPlace $out/bin/teamserver \
--replace "armitage.jar" "$JAR"
wrapProgram $out/bin/teamserver \
--prefix PATH : "${lib.makeBinPath [ jdk11 metasploit ]}"
install -Dm444 dist/unix/armitage-logo.png $out/share/pixmaps/armitage.png
${lib.optionalString stdenv.isDarwin ''
mkdir -p "$out/Applications/Armitage.app/Contents/MacOS"
mkdir -p "$out/Applications/Armitage.app/Contents/Resources"
cp dist/mac/Armitage.app/Contents/Resources/macIcon.icns $out/Applications/Armitage.app/Contents/Resources
write-darwin-bundle $out Armitage armitage macIcon
''}
runHook postInstall
'';
meta = with lib; {
description = "Graphical cyber attack management tool for Metasploit";
homepage = "https://github.com/r00t0v3rr1d3/armitage";
license = licenses.bsd3;
maintainers = with maintainers; [ emilytrau ];
platforms = platforms.unix;
mainProgram = "armitage";
};
})
|