ctf-resources/htb/hacktheboo2024/crypto/[Very Easy] sugar free candies/Makefile

32 lines
813 B
Makefile
Raw Normal View History

2024-10-23 11:10:43 +02:00
default:
ifdef name
@cd challenge; \
python3 source.py; \
mkdir crypto_$(name); \
cp source.py output.txt ./crypto_$(name); \
cp output.txt ../htb/; \
mv ./crypto_$(name) ../release/;
@cd release; \
zip -9 -r ./crypto_$(name).zip ./crypto_$(name); \
unzip -l ./crypto_$(name).zip;
@echo [+] Challenge was built successfully.
else
@echo [-] Please define the challenge name. For example, \"make name=cool_chall_name\"
endif
flag:
@echo [+] Flag : $$(cd challenge; python3 -c 'print(open("flag.txt").read())')
solver:
@echo [+] PoC : $$(cd htb ; sage -python3 solver.py)
@find . -name "*.sage.py" -type f -delete
test: clean default flag solver
clean:
@rm -rf release/*
@rm -rf htb/output.txt
@find . -name "*.sage.py" -type f -delete
@echo [+] Challenge release deleted successfully.