-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
60 lines (52 loc) · 1.9 KB
/
Copy pathflake.nix
File metadata and controls
60 lines (52 loc) · 1.9 KB
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
{
description = "Environment for reverse engineering";
nixConfig = {
extra-substituters = [ "https://pwndbg.cachix.org" ];
extra-trusted-public-keys = [ "pwndbg.cachix.org-1:HhtIpP7j73SnuzLgobqqa8LVTng5Qi36sQtNt79cD3k=" ];
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
pwndbg.url = "github:pwndbg/pwndbg";
};
outputs =
inputs@{ flake-parts, pwndbg, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem =
{ pkgs, system, ... }:
{
devShells.default = pkgs.mkShell {
packages = [
pkgs.gdb
# Unified Python env: pwntools (exploit dev), capstone (disassembly),
# pyelftools (ELF parsing), ropgadget (gadget search for iter 2).
(pkgs.python3.withPackages (ps: with ps; [
pwntools
capstone
pyelftools
ropgadget
textual
]))
pwndbg.packages.${system}.pwndbg
];
# Disable all Nix CC wrapper hardening flags
hardeningDisable = [ "all" ];
# Explicitly disable all security features for vulnerable binaries.
# hardeningDisable only stops Nix from *adding* flags; these counter
# GCC/ld built-in defaults so `checksec` shows everything disabled.
shellHook = ''
export NIX_CFLAGS_COMPILE="''${NIX_CFLAGS_COMPILE:-} -fno-stack-protector -fcf-protection=none -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -fno-pie"
export NIX_LDFLAGS="''${NIX_LDFLAGS:-} --no-pie -z execstack -z norelro"
export LANG=C.utf8
export LC_ALL=C.utf8
'';
};
};
};
}