diff options
| author | Aleksa Vuckovic <aleksa@vuckovic.cc> | 2023-10-16 19:09:29 +0200 |
|---|---|---|
| committer | Aleksa Vuckovic <aleksa@vuckovic.cc> | 2023-10-16 23:30:53 +0200 |
| commit | ca4ad65bcb032ded36610054c59182599d39360f (patch) | |
| tree | 12ca4e281094984b59e3a2df7d2ce244b84e5f40 /fast/submitter.py | |
Initial commit
Diffstat (limited to 'fast/submitter.py')
| -rw-r--r-- | fast/submitter.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fast/submitter.py b/fast/submitter.py new file mode 100644 index 0000000..dcaffe7 --- /dev/null +++ b/fast/submitter.py @@ -0,0 +1,7 @@ +import requests + +def submit(flags): + flag_responses = requests.post('http://example.ctf/flags', json=flags).json() + accepted_flags = { item['flag']: item['response'] for item in flag_responses if item['response'].endswith('OK') } + rejected_flags = { item['flag']: item['response'] for item in flag_responses if not item['response'].endswith('OK') } + return accepted_flags, rejected_flags |
