summaryrefslogtreecommitdiff
path: root/fast/submitter.py
blob: dcaffe756248842b6e461c343452758a290de260 (plain)
1
2
3
4
5
6
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