Skip to content

Commit a0d62e8

Browse files
committed
Added the advanced exercises, sections 9 and 10
1 parent 607472a commit a0d62e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1545
-2
lines changed

cleanup.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/bash
22

3-
find . -name 'peda*.txt' | xargs -n 1 rm
4-
find . -name '.gdb_history' | xargs -n 1 rm
3+
find . -name 'peda*.txt' | xargs -t -n 1 rm
4+
find . -name '.gdb_history' | xargs -t -n 1 rm
5+
find . -name 'core' | xargs -t -n 1 rm
6+

lessons/10_bypass_got/Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
all: 1_records 2_event1
2+
3+
1_records:
4+
gcc -m32 -fno-stack-protector -znoexecstack -o ./build/1_records ./src/1_records.c
5+
6+
7+
2_event1:
8+
gcc -m32 -znoexecstack -o ./build/2_event1 ./src/2_event1.c
9+
cp ./build/2_event1 ./services/event1/event1
10+
11+

lessons/10_bypass_got/build/1_records

7.29 KB
Binary file not shown.

lessons/10_bypass_got/build/2_event1

7.79 KB
Binary file not shown.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM ubuntu:latest
2+
ENV user=event1
3+
RUN dpkg --add-architecture i386
4+
RUN sed -i -e 's/archive\.ubuntu\.com/mirror\.0x\.sg/g' /etc/apt/sources.list
5+
RUN apt-get update
6+
RUN apt-get install -y xinetd libc6:i386 libncurses5:i386 libstdc++6:i386
7+
RUN useradd -m $user
8+
RUN echo "$user hard nproc 20" >> /etc/security/limits.conf
9+
COPY ./event1 /home/$user/event1
10+
COPY ./event1service /etc/xinetd.d/event1service
11+
COPY ./flag /home/$user/flag
12+
RUN chown -R root:$user /home/$user
13+
RUN chmod -R 750 /home/$user
14+
RUN chown root:$user /home/$user/flag
15+
RUN chmod 440 /home/$user/flag
16+
EXPOSE 31337
17+
CMD ["/usr/sbin/xinetd", "-d"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
docker build -t event1 .
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
docker run -dt -p 1902:31337 event1
7.79 KB
Binary file not shown.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
service event1service
2+
{
3+
disable = no
4+
socket_type = stream
5+
protocol = tcp
6+
wait = no
7+
user = event1
8+
bind = 0.0.0.0
9+
server = /home/event1/event1
10+
type = UNLISTED
11+
port = 31337
12+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
flag{g0t_m1lk?}

0 commit comments

Comments
 (0)