pwnlib.flag — CTF Flag Management

pwnlib.flag.submit_flag(flag, exploit='unnamed-exploit', target='unknown-target', server='flag-submission-server', port='31337', proto='tcp', team='unknown-team')[source]

Submits a flag to the game server

  • flag (str) – The flag to submit.
  • exploit (str) – Exploit identifier, optional
  • target (str) – Target identifier, optional
  • server (str) – Flag server host name, optional
  • port (int) – Flag server port, optional
  • proto (str) –

Optional arguments are inferred from the environment, or omitted if none is set.

Returns:A string indicating the status of the key submission, or an error code.


>>> l = listen()
>>> _ = submit_flag('flag', server='localhost', port=l.lport)
>>> c = l.wait_for_connection()
>>> c.recvall().split()
['flag', 'unnamed-exploit', 'unknown-target', 'unknown-team']