Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion babys-first-rop-32/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ RUN chmod +x challenge
WORKDIR /challenge

EXPOSE 31337
CMD ["/usr/sbin/xinetd", "-d", "-dontfork", "-f", "challenge.conf"]
CMD ["/bin/bash", "run_xinetd.sh"]
16 changes: 16 additions & 0 deletions babys-first-rop-32/contents/run_xinetd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
# Adapted from: https://rimuhosting.com/knowledgebase/linux/misc/trapping-ctrl-c-in-bash

cd /challenge

# trap ctrl-c and call ctrl_c()
trap ctrl_c INT

function ctrl_c() {
kill -9 $APP_PID
}

/usr/sbin/xinetd -dontfork -f challenge.conf & export APP_PID=$!
echo "Running succesfully, go forth and hack!"
wait $APP_PID

2 changes: 1 addition & 1 deletion ropasaurusrex/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ RUN chmod +x challenge
WORKDIR /challenge

EXPOSE 31337
CMD ["/usr/sbin/xinetd", "-d", "-dontfork", "-f", "challenge.conf"]
CMD ["/bin/bash", "run_xinetd.sh"]