Skip to content

Commit

Permalink
kernelCTF: server: update to latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
koczkatamas committed Feb 27, 2025
1 parent ed0af81 commit f457844
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
22 changes: 19 additions & 3 deletions kernelctf/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def main():
print()

# long random generated secret, not bruteforcable
root = hashlib.sha1(action.encode('utf-8')).hexdigest() == server_secrets.root_mode_hash
root = '--root' in sys.argv or hashlib.sha1(action.encode('utf-8')).hexdigest() == server_secrets.root_mode_hash

if action == 'back':
break
Expand Down Expand Up @@ -182,8 +182,24 @@ def main():

flagPrefix = 'invalid:'
if release['status'] == 'future':
flagPrefix = 'future:'
if not are_you_sure('[!] Warning: this target is not released yet and not eligible! Use only for pre-testing.'):
print('[!] Warning: this target is not released yet and not eligible! Use only for pre-testing.')
answer = input('Do you want to run anyway (y/n) or wait until the slot opening (w) ')
if answer == 'y':
flagPrefix = 'future:'
elif answer == 'w':
prev_notification = 0
while True:
time_left = int((release['release-date'] - datetime.now(timezone.utc)).total_seconds())
if time_left <= 0:
flagPrefix = ''
break

if prev_notification != time_left:
print(f'Only {time_left} seconds left...')
prev_notification = time_left

time.sleep(0.05) # check 20 times per second, start as soon as possible
else:
continue
elif release['status'] == 'deprecated' and "io_uring" in capabilities and now >= datetime(2025, 1, 23, 12, 00, 00, tzinfo=timezone.utc):
# you can target deprecated releases during the io_uring promotion
Expand Down
2 changes: 1 addition & 1 deletion kernelctf/server/service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
echo running!

cd /home/poprdi
socat ssl-l:1337,reuseaddr,fork,cert=server_cert_and_key.pem,verify=0,openssl-min-proto-version=tls1.3 exec:"nsjail/nsjail --chroot / --user 99999 --group 99999 --disable_clone_newnet --rlimit_cpu 1800 -T /tmp/ -- /usr/bin/timeout 1800 /home/poprdi/server.py"
socat -dd ssl-l:1337,reuseaddr,fork,cert=server_cert_and_key.pem,verify=0,openssl-min-proto-version=tls1.3 exec:"nsjail/nsjail --chroot / --user 99999 --group 99999 --disable_clone_newnet --disable_rlimits -T /tmp/ -- /usr/bin/timeout 1800 /home/poprdi/server.py"

0 comments on commit f457844

Please sign in to comment.