Skip to main content

An easy to use proxy for A/D CTFs

Project description

LaProxy

Introduction

An easy to use proxy for A/D CTFs
You can read the documentation at rikyiso01.github.io/LaProxy

Code Samples

TCP

from laproxy import TCPProxy, TCPHandler


class Handler(TCPHandler):
    def process(self, packet: bytes, inbound: bool, /) -> bytes | None:
        if b"ciao" in packet and not inbound:
            return None
        return packet


if __name__ == "__main__":
    TCPProxy("0.0.0.0", 1234, "127.0.0.1", 5005, Handler).run()

HTTP

from laproxy import TCPProxy, HTTPHandler, HTTPRequest, HTTPResponse


class Handler(HTTPHandler):
    def request(self, request: HTTPRequest, /) -> HTTPRequest | None:
        return request

    def response(self, response: HTTPResponse, /) -> HTTPResponse | None:
        if b"flag" in response.body:
            return None
        return response

if __name__ == "__main__":
    TCPProxy("0.0.0.0", 1234, "127.0.0.1", 5005, Handler).run()

You can find more examples in the samples folder

Installation

Install locally with:

python3 -m pip install laproxy

Or use it in a docker compose:

version: "3.9"
services:
    proxy:
        image: ghcr.io/rikyiso01/laproxy:latest
        ports:
            - "1234:1234"
        volumes:
            - ./proxy.py:/app/proxy.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

laproxy-1.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

laproxy-1.1.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file laproxy-1.1.0.tar.gz.

File metadata

  • Download URL: laproxy-1.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.2 Linux/5.15.0-1041-azure

File hashes

Hashes for laproxy-1.1.0.tar.gz
Algorithm Hash digest
SHA256 2ff9580862b528e775ca8245f51118756a1683d52c742a0cd0ed2ba807260884
MD5 dc3b29ea621e3a58c8612ae8858e42f1
BLAKE2b-256 a71012be60e2ce3e9e332cff3f73cd8c743c30e65488f5b024d234dbf126f389

See more details on using hashes here.

File details

Details for the file laproxy-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: laproxy-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.2 Linux/5.15.0-1041-azure

File hashes

Hashes for laproxy-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b158d2f11b3678db94201380b470bb0bfd6d68867fb7bc8eb1c008a4334147ba
MD5 5eedc811b6a74d9c44b819a14e2cb651
BLAKE2b-256 6e9e256829bab98e5e7067c0f232829645c9e067d72985727db8d69acadf8bf8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page