projects/guix·blob java-team · refs

246 lines · 9.2 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2020 Jakub Kądziołka <[email protected]>
3;;; Copyright © 2020, 2021 Tobias Geerinckx-Rice <[email protected]>
4;;; Copyright © 2021 c4droid <[email protected]>
5;;; Copyright © 2021 Raghav Gururajan <[email protected]>
6;;; Copyright © 2025 Nicolas Graves <[email protected]>
7;;; Copyright © 2025 Sharlatan Hellseher <[email protected]>
8;;; Copyright © 2025 Artyom V. Poptsov <[email protected]>
9;;; Copyright © 2026 Cayetano Santos <[email protected]>
10;;;
11;;; This file is part of GNU Guix.
12;;;
13;;; GNU Guix is free software; you can redistribute it and/or modify it
14;;; under the terms of the GNU General Public License as published by
15;;; the Free Software Foundation; either version 3 of the License, or (at
16;;; your option) any later version.
17;;;
18;;; GNU Guix is distributed in the hope that it will be useful, but
19;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;;; GNU General Public License for more details.
22;;;
23;;; You should have received a copy of the GNU General Public License
24;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26(define-module (gnu packages cybersecurity)
27 #:use-module (guix download)
28 #:use-module (guix gexp)
29 #:use-module (guix git-download)
30 #:use-module (guix packages)
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (guix build-system cmake)
33 #:use-module (guix build-system pyproject)
34 #:use-module (gnu packages build-tools)
35 #:use-module (gnu packages databases)
36 #:use-module (gnu packages check)
37 #:use-module (gnu packages cpp)
38 #:use-module (gnu packages engineering)
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages python)
41 #:use-module (gnu packages python-build)
42 #:use-module (gnu packages python-compression)
43 #:use-module (gnu packages python-crypto)
44 #:use-module (gnu packages python-web)
45 #:use-module (gnu packages python-xyz)
46 #:use-module (gnu packages serialization)
47 #:use-module (gnu packages time)
48 #:use-module (gnu packages emulators))
49
50(define-public blacksmith
51 (package
52 (name "blacksmith")
53 (version "0.0.3")
54 (source (origin
55 (method git-fetch)
56 (uri (git-reference
57 (url "https://github.com/comsec-group/blacksmith")
58 (commit version)))
59 (file-name (git-file-name name version))
60 (sha256
61 (base32
62 "1fm8n36b6cxd2lwr9idfqs49if6mnpyklqrgjs4kh652vxkh364r"))
63 (modules '((guix build utils)))
64 (snippet `(begin
65 (delete-file-recursively "external")
66 (substitute* "CMakeLists.txt"
67 (("add_subdirectory\\(external\\)") "")
68 (("[ \t]*FetchContent_MakeAvailable\\(asmjit\\)")
69 (string-append
70 "find_package(asmjit)\n"
71 "find_package(nlohmann_json)")))))))
72 (build-system cmake-build-system)
73 (arguments
74 `(#:tests? #f ;no test-suite
75 #:imported-modules
76 ((guix build copy-build-system)
77 ,@%cmake-build-system-modules)
78 #:modules
79 (((guix build copy-build-system) #:prefix copy:)
80 (guix build cmake-build-system)
81 (guix build utils))
82 #:phases
83 (modify-phases %standard-phases
84 (add-after 'unpack 'fix-build
85 (lambda _
86 (substitute* "CMakeLists.txt"
87 ;; Use default C++ standard instead.
88 (("cxx_std_17") "")
89 ;; This project tries to link argagg library, which doesn't
90 ;; exist, as argagg project is a single header file.
91 (("argagg") ""))))
92 (replace 'install
93 (lambda args
94 (apply (assoc-ref copy:%standard-phases 'install)
95 #:install-plan
96 '(("." "bin" #:include ("blacksmith"))
97 ("." "lib" #:include-regexp ("\\.a$")))
98 args))))))
99 (native-inputs
100 (list pkg-config))
101 (inputs
102 (list argagg asmjit nlohmann-json))
103 (home-page "https://comsec.ethz.ch/research/dram/blacksmith")
104 (synopsis "Rowhammer fuzzer with non-uniform and frequency-based patterns")
105 (description
106 "Blacksmith is an implementation of Rowhammer fuzzer that crafts novel
107non-uniform Rowhammer access patterns based on the concepts of frequency,
108phase, and amplitude. It is able to bypass recent @acronym{TRR, Target Row
109Refresh}in-DRAM mitigations effectively and as such can trigger bit flips.")
110 (license license:expat)))
111
112(define-public gallia
113 (package
114 (name "gallia")
115 (version "2.1.1")
116 (source
117 (origin
118 (method git-fetch)
119 (uri (git-reference
120 (url "https://github.com/Fraunhofer-AISEC/gallia")
121 (commit (string-append "v" version))))
122 (file-name (git-file-name name version))
123 (sha256
124 (base32 "04xzh5fi18wrkjs7sqwlv344jf54njvnly042rhxq3x5jrvpvkdw"))))
125 (build-system pyproject-build-system)
126 (arguments
127 (list
128 ;; NOTE: Test steps are sourced from GitHub Actions attached to the
129 ;; project. This is a minimal test suite, more precise tests require
130 ;; setting up local service with Bats (Bash Automated Testing System)
131 ;; <https://bats-core.readthedocs.io/en/stable/>. bs
132 #:test-flags #~(list "tests/pytest")))
133 (native-inputs
134 (list python-pytest
135 python-pytest-asyncio
136 python-uv-build))
137 (inputs
138 (list python-aiosqlite
139 python-argcomplete
140 python-boltons
141 python-platformdirs
142 python-pydantic
143 python-tabulate
144 python-wcwidth
145 python-zstandard))
146 (home-page "https://github.com/Fraunhofer-AISEC/gallia")
147 (synopsis "Extendable Pentesting Framework")
148 (description
149 "Gallia is an extendable pentesting framework with the focus on the
150automotive domain. The scope of the toolchain is conducting penetration tests
151from a single ECU up to whole cars.")
152 (license license:apsl2)))
153
154(define-public ropgadget
155 (package
156 (name "ropgadget")
157 (version "7.7")
158 (source
159 (origin
160 (method git-fetch)
161 (uri (git-reference
162 (url "https://github.com/JonathanSalwan/ROPgadget/")
163 (commit (string-append "v" version))))
164 (file-name (git-file-name name version))
165 (sha256
166 (base32 "0g87qz8hfiajl1v5z5rxama4531hi9gabzbgkhrbavjj7v3xgavw"))))
167 (build-system pyproject-build-system)
168 (arguments
169 (list
170 ;; TODO PyPI lack test data, Git provides a collection of binaries for
171 ;; the tests.
172 #:tests? #f
173 #:phases
174 #~(modify-phases %standard-phases
175 (replace 'check
176 (lambda* (#:key tests? #:allow-other-keys)
177 (when tests?
178 (with-directory-excursion "test-suite-binaries"
179 (invoke "./test.sh"))))))))
180 (native-inputs
181 (list python-setuptools))
182 (propagated-inputs
183 (list python-capstone))
184 (home-page "https://shell-storm.org/project/ROPgadget/")
185 (synopsis "Semiautomatic return oriented programming")
186 (description
187 "This tool lets you search for @acronym{ROP, Return Oriented Programming}
188gadgets in binaries. Some facilities are included for automatically generating
189chains of gadgets to execute system calls.")
190 (license license:bsd-3)))
191
192(define-public pwntools
193 (package
194 (name "pwntools")
195 (version "4.15.0")
196 (source
197 (origin
198 (method git-fetch)
199 (uri (git-reference
200 (url "https://github.com/Gallopsled/pwntools")
201 (commit version)))
202 (file-name (git-file-name name version))
203 (sha256
204 (base32 "0phi7gks9w9rim9rzs8cgwznc3xximdpxyj5vrafivziill51qnl"))))
205 (build-system pyproject-build-system)
206 (arguments
207 (list
208 #:tests? #f ;XXX: needs a specific version of unicorn
209 #:phases
210 '(modify-phases %standard-phases
211 (add-after 'unpack 'relax-dependencies
212 (lambda _
213 (substitute* "pyproject.toml"
214 (("^ *\"pip.*\",.*")
215 "")))))))
216 (propagated-inputs
217 (list capstone
218 python-colored-traceback
219 python-dateutil
220 python-intervaltree
221 python-mako
222 python-packaging
223 python-paramiko
224 python-psutil
225 python-pyelftools
226 python-pygments
227 python-pyserial
228 python-pysocks
229 python-requests
230 ropgadget
231 python-rpyc
232 python-six
233 python-sortedcontainers
234 python-unix-ar
235 python-zstandard
236 unicorn))
237 (native-inputs
238 (list python-setuptools python-toml))
239 (home-page "https://github.com/Gallopsled/pwntools")
240 (synopsis
241 "Capture-the-flag (CTF) framework and exploit development library")
242 (description
243 "Pwntools is a capture-the-flag (CTF) framework and exploit development library.
244Written in Python, it is designed for rapid prototyping and development, and
245intended to make exploit writing as simple as possible.")
246 (license license:expat)))