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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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