Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
added shellstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
AlwaysGuilty authored and aJuvan committed Apr 14, 2022
1 parent 4982ca7 commit 95e0161
Show file tree
Hide file tree
Showing 8 changed files with 522 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.DS_Store
.vscode
.ctf
.gdb_history
17 changes: 17 additions & 0 deletions challs/shellstraction/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu:18.04

EXPOSE 1337

RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get -y update && \
apt-get -y install socat coreutils

COPY chall/flag.txt /
COPY chall/app /

RUN chmod 555 /app && \
chmod 444 /flag.txt

CMD socat -T 30 \
TCP-LISTEN:1337,nodelay,reuseaddr,fork \
EXEC:"stdbuf -i0 -o0 -e0 /app"
16 changes: 16 additions & 0 deletions challs/shellstraction/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Shellstraction

This is a simple interctive shell written by Red_Epicness and improved and worked upon by AlwaysGuilty.

There are 2 intended vulnerabilities built in.\
If we take a look in the `touch` command, there is a local variable `signed char offset`. By overflowing it, we can control the `guard` global variable. That allows us to execute code inside `eton` function. This is where a simple double free can be performed.

## Compiling From Source

`gcc -fstack-protector -o chall/app chall/app.c`

## Solution

Solution in [sol.py](sol.py)

Flag: `dctf{D035_4nyb0dy_l1st3n_T0_Ur14h_He4p_1093875hv914387v}`
Binary file added challs/shellstraction/chall/app
Binary file not shown.
Loading

0 comments on commit 95e0161

Please sign in to comment.