Skip to content

Commit f729dd3

Browse files
committed
ynetd: add hardened ctf-centric fork
1 parent a8494b7 commit f729dd3

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

pkgs/by-name/yn/ynetd/hardened.nix

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
lib,
3+
stdenv,
4+
fetchurl,
5+
}:
6+
stdenv.mkDerivation (finalAttrs: {
7+
pname = "ctf-ynetd";
8+
version = "2024.12.31";
9+
10+
src = fetchurl {
11+
url = "https://hxp.io/assets/data/code/ctf-ynetd-2024.12.31.tar.xz";
12+
hash = "sha256-hUEZZEulmaV3KfKOqE1wl7y4SRUn2/HoOjVDabk5+YA=";
13+
};
14+
15+
installPhase = ''
16+
runHook preInstall
17+
install -Dm755 ynetd $out/bin/ynetd
18+
runHook postInstall
19+
'';
20+
21+
meta = {
22+
description = "Fork of ynetd hardened for CTFs with isolation using PID namespaces, minimal overhead proof-of-work checking, and strict resource limits via cgroups";
23+
homepage = "https://hxp.io/code/";
24+
license = lib.licenses.mit;
25+
platforms = lib.platforms.linux;
26+
maintainers = [ lib.maintainers.haylin ];
27+
mainProgram = "ynetd";
28+
};
29+
})

pkgs/by-name/yn/ynetd/package.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
lib,
33
stdenv,
44
fetchurl,
5+
callPackage,
56
}:
67
stdenv.mkDerivation (finalAttrs: {
78
pname = "ynetd";
@@ -22,6 +23,10 @@ stdenv.mkDerivation (finalAttrs: {
2223
runHook postInstall
2324
'';
2425

26+
# ctf-ynetd releases are based on the last stable ynetd version
27+
# these should be kept in sync when possible
28+
passthru.hardened = callPackage ./hardened.nix { };
29+
2530
meta = {
2631
description = "Small server for binding programs to TCP ports";
2732
homepage = "https://yx7.cc/code/";

0 commit comments

Comments
 (0)