-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
NOTE: Since discussions were disabled, raising an issue to discuss about this.
Instead of the current setup which uses glibc_run.sh (which compiles glibc from scratch and then compiles the binary and then links to it), what if we just use a dockerfile that provides the needed glibc version?
Like so:
# for glibc 2.39
FROM docker.io/library/ubuntu:24.04
RUN apt-mark hold libc6 && apt update && apt install -y gdb wget curl xz-utils binutils gcc
RUN curl -qsL 'https://install.pwndbg.re' | sh -s -- -t pwndbg-gdb
RUN mkdir -p /how2heap
WORKDIR /how2heap
COPY compile-all.sh .
COPY *.c .
RUN sh compile-all.sh
# disables ASLR
ENTRYPOINT ["setarch", "-R", "/usr/bin/bash"]compile-all.sh
#!/usr/bin/env sh
set -eu
CFILES=$(ls *.c)
for cfile in $CFILES
do
# set -x
# put each C file into it's own dir.
dirname=$(echo $cfile | sed s/.c\$//)
mkdir "$dirname"
mv $cfile "$dirname/"
cmd="gcc -no-pie -g $dirname/$cfile -o $dirname/$dirname"
echo $cmd
$cmd
doneThis scripts creates a neat setup like so:
This allows for a pre-made environment similar to ret2system's web ui, but in the terminal with pwndbg.
Metadata
Metadata
Assignees
Labels
No labels