From 88a7beb5209a81ea49032d09ec71fc50774e4a9e Mon Sep 17 00:00:00 2001
From: Yan <yans@yancomm.net>
Date: Tue, 28 Jan 2025 01:58:38 -0700
Subject: [PATCH] capability to check for html to avoid shenanigans

---
 pwnshop/templates/base/selenium.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pwnshop/templates/base/selenium.py b/pwnshop/templates/base/selenium.py
index 04b9af8..3c293f6 100755
--- a/pwnshop/templates/base/selenium.py
+++ b/pwnshop/templates/base/selenium.py
@@ -66,6 +66,11 @@
 
 {% if challenge.print_page %}
 print("Retrieved the following HTML:")
+{% if challenge.ensure_html %}
+if "<html" not in browser.page_source.lower():
+    print("Doesn't look like we retrieved an HTML page...")
+    sys.exit(1)
+{% endif %}
 print(browser.page_source)
 {% endif %}