Skip to content
Snippets Groups Projects
Commit 8d359fbb authored by Ruben Anthony Gonzalez's avatar Ruben Anthony Gonzalez
Browse files

Add manual submission logic

parent 4cc3b99e
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,21 @@ db_file_path = "flags.db"
def submission_logic(flags):
# TODO: Add actual submission logic
# hackerdom
# answ = requests.put("http://10.10.10.10/flags",
# headers={
# 'X-Team-Token': "2_d8a4fe6d49b44459b0a73bfdeee7d60d"
# },
# data=json.dumps(flags)
# )
# # TODO
# js = answ.json()[0]
# print(js["msg"])
# print(js)
# assert (js['flag'] == flag)
# if 'you already submitted this flag' in js["msg"]:
# return 2
# return int(js["status"] != True)
return [randint(0, len(MESSAGES) - 1) for _ in range(len(flags))]
......
#!/usr/bin/env python3
import sys
from submitter import submit_flags
import logging
logging.basicConfig(level=logging.INFO)
if len(sys.argv) < 2:
print("Add flags as parameters: ./manual.py [FLAG] [FLAG] ...")
sys.exit(1)
flags, ret = submit_flags(-1, 'manual_submission', sys.argv[1:])
for i, flag in enumerate(flags):
print(flag, ret[i])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment