diff --git a/web-security/auth-bypass-cookie/server b/web-security/auth-bypass-cookie/server index 9295c7f..9f4264b 100755 --- a/web-security/auth-bypass-cookie/server +++ b/web-security/auth-bypass-cookie/server @@ -21,7 +21,7 @@ class TemporaryDB: db = TemporaryDB() # https://www.sqlite.org/lang_createtable.html -db.execute("""CREATE TABLE IF NOT EXISTS users AS SELECT "admin" AS username, ? as password""", [os.urandom(8)]) +db.execute("""CREATE TABLE users AS SELECT "admin" AS username, ? as password""", [os.urandom(8)]) # https://www.sqlite.org/lang_insert.html db.execute("""INSERT INTO users SELECT "guest" as username, "password" as password""") diff --git a/web-security/level-10/server b/web-security/level-10/server index 942c062..3d52654 100755 --- a/web-security/level-10/server +++ b/web-security/level-10/server @@ -23,8 +23,8 @@ flag = open("/flag").read().strip() if os.getuid() == 0 else "pwn.college{fake_f db = TemporaryDB() # https://www.sqlite.org/lang_createtable.html -db.execute("""CREATE TABLE IF NOT EXISTS posts AS SELECT ? AS content, "admin" AS author, FALSE AS published""", [flag]) -db.execute("""CREATE TABLE IF NOT EXISTS users AS SELECT "admin" AS username, ? as password""", [flag]) +db.execute("""CREATE TABLE posts AS SELECT ? AS content, "admin" AS author, FALSE AS published""", [flag]) +db.execute("""CREATE TABLE users AS SELECT "admin" AS username, ? as password""", [flag]) # https://www.sqlite.org/lang_insert.html db.execute("""INSERT INTO users SELECT "guest" as username, "password" as password""") db.execute("""INSERT INTO users SELECT "hacker" as username, "1337" as password""") diff --git a/web-security/level-3/server b/web-security/level-3/server index ad8761b..d0fb4e7 100755 --- a/web-security/level-3/server +++ b/web-security/level-3/server @@ -24,7 +24,7 @@ class TemporaryDB: db = TemporaryDB() # https://www.sqlite.org/lang_createtable.html -db.execute("""CREATE TABLE IF NOT EXISTS users AS SELECT "admin" AS username, ? as password""", [os.urandom(8)]) +db.execute("""CREATE TABLE users AS SELECT "admin" AS username, ? as password""", [os.urandom(8)]) # https://www.sqlite.org/lang_insert.html db.execute("""INSERT INTO users SELECT "guest" as username, "password" as password""") diff --git a/web-security/level-4/server b/web-security/level-4/server index 48eebd6..7de6f36 100755 --- a/web-security/level-4/server +++ b/web-security/level-4/server @@ -21,7 +21,7 @@ class TemporaryDB: db = TemporaryDB() # https://www.sqlite.org/lang_createtable.html -db.execute("""CREATE TABLE IF NOT EXISTS users AS SELECT "admin" AS username, ? as password""", [os.urandom(8)]) +db.execute("""CREATE TABLE users AS SELECT "admin" AS username, ? as password""", [os.urandom(8)]) # https://www.sqlite.org/lang_insert.html db.execute("""INSERT INTO users SELECT "guest" as username, "password" as password""") diff --git a/web-security/level-5/server b/web-security/level-5/server index 4b2e027..36bd7eb 100755 --- a/web-security/level-5/server +++ b/web-security/level-5/server @@ -21,7 +21,7 @@ class TemporaryDB: db = TemporaryDB() # https://www.sqlite.org/lang_createtable.html -db.execute("""CREATE TABLE IF NOT EXISTS users AS SELECT "admin" AS username, ? as password""", [open("/flag").read()]) +db.execute("""CREATE TABLE users AS SELECT "admin" AS username, ? as password""", [open("/flag").read()]) # https://www.sqlite.org/lang_insert.html db.execute("""INSERT INTO users SELECT "guest" as username, "password" as password""") diff --git a/web-security/level-6/server b/web-security/level-6/server index 50405d4..fabd8c0 100755 --- a/web-security/level-6/server +++ b/web-security/level-6/server @@ -23,7 +23,7 @@ class TemporaryDB: db = TemporaryDB() # https://www.sqlite.org/lang_createtable.html user_table = f"users_{random.randrange(2**32, 2**33)}" -db.execute(f"""CREATE TABLE IF NOT EXISTS {user_table} AS SELECT "admin" AS username, ? as password""", [open("/flag").read()]) +db.execute(f"""CREATE TABLE {user_table} AS SELECT "admin" AS username, ? as password""", [open("/flag").read()]) # https://www.sqlite.org/lang_insert.html db.execute(f"""INSERT INTO {user_table} SELECT "guest" as username, "password" as password""") diff --git a/web-security/level-7/server b/web-security/level-7/server index 5efbe5d..02c3172 100755 --- a/web-security/level-7/server +++ b/web-security/level-7/server @@ -21,7 +21,7 @@ class TemporaryDB: db = TemporaryDB() # https://www.sqlite.org/lang_createtable.html -db.execute("""CREATE TABLE IF NOT EXISTS users AS SELECT "admin" AS username, ? as password""", [open("/flag").read()]) +db.execute("""CREATE TABLE users AS SELECT "admin" AS username, ? as password""", [open("/flag").read()]) # https://www.sqlite.org/lang_insert.html db.execute("""INSERT INTO users SELECT "guest" as username, "password" as password""") diff --git a/web-security/sqli-pin/server b/web-security/sqli-pin/server index 5276e4d..5bac0d8 100755 --- a/web-security/sqli-pin/server +++ b/web-security/sqli-pin/server @@ -22,7 +22,7 @@ class TemporaryDB: db = TemporaryDB() # https://www.sqlite.org/lang_createtable.html -db.execute("""CREATE TABLE IF NOT EXISTS users AS SELECT "admin" AS username, ? as pin""", [random.randrange(2**32, 2**63)]) +db.execute("""CREATE TABLE users AS SELECT "admin" AS username, ? as pin""", [random.randrange(2**32, 2**63)]) # https://www.sqlite.org/lang_insert.html db.execute("""INSERT INTO users SELECT "guest" as username, 1337 as pin""") diff --git a/web-security/xss-exfil-cookie/server b/web-security/xss-exfil-cookie/server index 0aee702..c1977ed 100755 --- a/web-security/xss-exfil-cookie/server +++ b/web-security/xss-exfil-cookie/server @@ -23,8 +23,8 @@ flag = open("/flag").read().strip() if os.geteuid() == 0 else "pwn.college{fake_ db = TemporaryDB() # https://www.sqlite.org/lang_createtable.html -db.execute("""CREATE TABLE IF NOT EXISTS posts AS SELECT ? AS content, "admin" AS author, FALSE AS published""", [flag]) -db.execute("""CREATE TABLE IF NOT EXISTS users AS SELECT "admin" AS username, ? as password""", [flag[-10:]]) +db.execute("""CREATE TABLE posts AS SELECT ? AS content, "admin" AS author, FALSE AS published""", [flag]) +db.execute("""CREATE TABLE users AS SELECT "admin" AS username, ? as password""", [flag[-10:]]) # https://www.sqlite.org/lang_insert.html db.execute("""INSERT INTO users SELECT "guest" as username, "password" as password""") db.execute("""INSERT INTO users SELECT "hacker" as username, "1337" as password""") diff --git a/web-security/xss-rf-post/server b/web-security/xss-rf-post/server index f62f8d8..90ce5f2 100755 --- a/web-security/xss-rf-post/server +++ b/web-security/xss-rf-post/server @@ -23,8 +23,8 @@ flag = open("/flag").read().strip() if os.getuid() == 0 else "pwn.college{fake_f db = TemporaryDB() # https://www.sqlite.org/lang_createtable.html -db.execute("""CREATE TABLE IF NOT EXISTS posts AS SELECT ? AS content, "admin" AS author, FALSE AS published""", [flag]) -db.execute("""CREATE TABLE IF NOT EXISTS users AS SELECT "admin" AS username, ? as password""", [flag]) +db.execute("""CREATE TABLE posts AS SELECT ? AS content, "admin" AS author, FALSE AS published""", [flag]) +db.execute("""CREATE TABLE users AS SELECT "admin" AS username, ? as password""", [flag]) # https://www.sqlite.org/lang_insert.html db.execute("""INSERT INTO users SELECT "guest" as username, "password" as password""") db.execute("""INSERT INTO users SELECT "hacker" as username, "1337" as password""") diff --git a/web-security/xss-stored-alert/server b/web-security/xss-stored-alert/server index 866e260..2f27acb 100755 --- a/web-security/xss-stored-alert/server +++ b/web-security/xss-stored-alert/server @@ -21,7 +21,7 @@ class TemporaryDB: db = TemporaryDB() # https://www.sqlite.org/lang_createtable.html -db.execute("""CREATE TABLE IF NOT EXISTS posts AS SELECT "First Post!" AS content""") +db.execute("""CREATE TABLE posts AS SELECT "First Post!" AS content""") @app.route("/", methods=["POST"]) def challenge_post(): diff --git a/web-security/xss-stored-html/server b/web-security/xss-stored-html/server index 876bb50..1cfff8c 100755 --- a/web-security/xss-stored-html/server +++ b/web-security/xss-stored-html/server @@ -21,7 +21,7 @@ class TemporaryDB: db = TemporaryDB() # https://www.sqlite.org/lang_createtable.html -db.execute("""CREATE TABLE IF NOT EXISTS posts AS SELECT "First Post!" AS content""") +db.execute("""CREATE TABLE posts AS SELECT "First Post!" AS content""") @app.route("/", methods=["POST"]) def challenge_post():