feat: app system challenges

Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@dextradata.com>
This commit is contained in:
Tuan-Dat Tran
2026-03-23 09:19:03 +01:00
parent de45645553
commit 5cd3b5a531
14 changed files with 715 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
CHALLENGE=ch14
USER=app-systeme-$(CHALLENGE)
USER_CRACKED=$(USER)-cracked
CC=gcc
CFLAGS=-m32 -no-pie
LDFLAGS=-z noexecstack
SRC=$(CHALLENGE).c
OBJ=$(SRC:.c=.o)
BIN=$(CHALLENGE)
.DEFAULT_GOAL := challenge
.PHONY : clean all
$(BIN): $(OBJ)
@echo "Compiling..."
$(CC) -o $@ $(SRC) $(LDFLAGS) $(CFLAGS)
challenge: $(BIN)
@echo "Applying permissions..."
rm -f $(OBJ)
chown $(USER_CRACKED):$(USER) $(BIN) .passwd Makefile $(SRC)
chmod 400 .passwd
chmod 440 $(SRC) Makefile
chmod 550 $(BIN)
chmod u+s $(BIN)