Skip to content

Commit

Permalink
Check for expired lab links
Browse files Browse the repository at this point in the history
  • Loading branch information
frank-leitner committed Dec 18, 2022
1 parent 93eedd5 commit 85006a5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .templates/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
proxies = {'http': 'http://127.0.0.1:8080', 'https': 'http://127.0.0.1:8080'}


def check_expired_lab(client, host):
return client.get(host).status_code == 504


def main():
print('[+] <LAB_NAME>')
try:
Expand All @@ -23,6 +27,10 @@ def main():
client.verify = False
client.proxies = proxies

if check_expired_lab(client, host):
print(f'[-] Lab is expired, please provide new link')
sys.exit(-2)

# I had some times issues getting the proper result, so wait briefly before checking
time.sleep(2)
if 'Congratulations, you solved the lab!' not in client.get(f'{host}').text:
Expand Down

0 comments on commit 85006a5

Please sign in to comment.