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

shellstraction initial push #1

Merged
merged 1 commit into from
Apr 14, 2022
Merged
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
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