Skip to main content

EnoChecker PyPI version Build Status Lines of code

This is the checker lib that shall be used by all checkers in ENOWARS3 and ENOWARS4.

For a simple checker, subclass enochecker.BaseChecker.

from enochecker import BaseChecker, BrokenServiceException, run

class AwesomeChecker(BaseChecker):

    def putflag(self):  # type: () -> None
        # TODO: Put flag to service
        self.debug("flag is {}".format(self.flag))
        self.http_post("/putflaghere", params={"flag": self.flag})
        # ...

    def getflag(self):  # type: () -> None
        # tTODO: Get the flag.
        if not self.http_get("/getflag") == self.flag:
            raise BrokenServiceException("Ooops, wrong Flag")

    def putnoise(self):
        # put some noise
        with self.connect() as telnet:
            telnet.write(self.noise)

    def getnoise(self):
        with self.connect() as telnet:
            telnet.write("gimmeflag\n")
            telnet.read_expect(self.noise)

    def havoc(self):
        self.http("FUNFUN").text == "FUNFUN"


if __name__ == "__main__":
    run(AwesomeChecker)

A full example, including helpful comments, can be found in examplechecker.py.

The full documentation (still in progress) is available on enowars.github.io/enochecker.

(There is some not yet ported information in the old docs/usage.md.)

Installation

The latest stable version of the library is available on pip: pip install enochecker

To access the development version, the library can be installed using pip/git, like: pip install git+https://github.com/enowars/enochecker

Launch Checker

The goal is to have checkers launched via gunicorn or uSWGI and the Engine talking to it via http. For testing, however, you can use the commandline instead:

usage: check.py run [-h] [-a ADDRESS] [-n TEAM_NAME] [-r ROUND] [-f FLAG]
                    [-t MAX_TIME] [-i CALL_IDX] [-p [PORT]]
                    {putflag,getflag,putnoise,getnoise,havoc,listen}

positional arguments:
  {putflag,getflag,putnoise,getnoise,havoc,listen}
                        The Method, one of ['putflag', 'getflag', 'putnoise',
                        'getnoise', 'havoc'] or "listen" to start checker
                        service

optional arguments:
  -h, --help            show this help message and exit
  -a ADDRESS, --address ADDRESS
                        The ip or address of the remote team to check
  -n TEAM_NAME, --team_name TEAM_NAME
                        The teamname of the team to check
  -r ROUND, --round ROUND
                        The round we are in right now
  -f FLAG, --flag FLAG  The Flag, a Fake flag or a Unique ID, depending on the
                        mode
  -t MAX_TIME, --max_time MAX_TIME
                        The maximum amount of time the script has to execute
                        in seconds
  -i CALL_IDX, --call_idx CALL_IDX
                        Unique numerical index per round. Each id only occurs
                        once and is tighly packed, starting with 0. In a
                        service supporting multiple flags, this would be used
                        to decide which flag to place.
  -p [PORT], --port [PORT]
                        The port the checker should attack

Why use it at all?

Many nice features for CTF Checker writing, obviously. Also, under-the-hood changes on the Engine can be made without any problems.

For further instructions on how to write a checker with this Framework look at docs/usage.md.

Now, code away :).

Metadata

Release files for enochecker 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for enochecker 0.5.0
File Size Uploaded
enochecker-0.5.0.tar.gz 29.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for enochecker 0.5.0
File Interpreter ABI Platform
enochecker-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 61.0 kB

Release files / enochecker-0.5.0.tar.gz

Download URL enochecker-0.5.0.tar.gz
Size 29.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9d9692b6059e2eee792e8cc7f6bd1db1b37f24158ef29754954248adb5652695
BLAKE2b-256 checksum
How to use checksums
90e937888e98da9fff3dc67f5ca3fdef9e601e826ef94a9b7a98f2a7eb0c7859
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

Release files / enochecker-0.5.0-py3-none-any.whl

Download URL enochecker-0.5.0-py3-none-any.whl
Size 31.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4cbb6a2c8159ba33721d739d9bb69f1f8e6c17ecf22d833eae2f9644b665b083
BLAKE2b-256 checksum
How to use checksums
726785ac25dcb518f720be22c58e143df520ed0a1f1b9fa0fa0d80d2dc800b6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.6

2 release files

0.0.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page