Skip to content

Instantly share code, notes, and snippets.

@Pamplemousse
Last active August 28, 2023 03:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pamplemousse/c03abcd412c62201b8bd97e846437acf to your computer and use it in GitHub Desktop.
Save Pamplemousse/c03abcd412c62201b8bd97e846437acf to your computer and use it in GitHub Desktop.
with import <nixpkgs> { };
let
arm-binutils = pkgsCross.arm-embedded.buildPackages.binutils;
binutils_commands = "as ld objcopy readelf";
python3WithCoolPackages = python3.withPackages(ps: with ps; [
flask
ipdb
ipython
lxml
manpages
pycrypto
pwntools-pwndbg
requests
sqlmap
ROPGadget
z3
]);
pwntools-pwndbg = python3Packages.pwntools.override({ debugger = pkgs.pwndbg; });
in stdenv.mkDerivation rec {
name = "ctf-tools";
buildInputs = [
arm-binutils
binutils
gdb
capstone
checksec
jq
gobuster
one_gadget
nmap
p7zip # HTB archives can't be unpacked by `unzip`...
patchelf
python3WithCoolPackages
wget
];
installCheckPhase = false;
shellHook = ''
# `pwntools` is `which`ing for Debian looking commands...
for COMMAND in ${binutils_commands}; do
makeWrapper "$(which "arm-none-eabi-$COMMAND")" "arm-linux-gnu-$COMMAND"
done
PATH="$(pwd):$PATH"
'';
exitHook = ''
for COMMAND in ${binutils_commands}; do
rm "arm-linux-gnu-$COMMAND"
done
'';
}
@SuperKenVery
Copy link

SuperKenVery commented Aug 28, 2023

Thanks for your great work! But I found two little problems:

  1. manpages has been renamed to man-pages
  2. makeWrapper is needed as a buildInput

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment