diff --git a/.templates/script.py b/.templates/script.py index 3cbc101..9dba03c 100755 --- a/.templates/script.py +++ b/.templates/script.py @@ -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('[+] ') try: @@ -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: