caddy_ja3

package module
v0.0.0-...-38da6d2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

README

caddy-ja3

A caddy plugin to get JA3 fingerprints from requests as a header.

Building with xcaddy

xcaddy build \
  --with github.com/rushiiMachine/caddy-ja3

Sample Caddyfile

Note that this enforces HTTPS (TLS).
You can add a http_redirect to automatically redirect http -> https like shown below.

{
  order ja3 before respond # change this to whatever idk
  servers {
     listener_wrappers {
       http_redirect
       ja3
       tls
     }
  }
}

localhost:2020 {
  ja3
  tls internal                     # Configure your tls however you want
  respond "Your JA3: {header.ja3}" # JA3 is added to the request as a header ("ja3")
}

Disclaimer

I am not guaranteeing you 100% uptime
This should work but feel free to file an issue

Documentation

Index

Constants

View Source
const (
	CacheAppId = "ja3.cache"
)

Variables

This section is empty.

Functions

func ReadClientHello

func ReadClientHello(r io.Reader) (ch []byte, err error)

func RewindConn

func RewindConn(c net.Conn, buf []byte) (net.Conn, error)

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func (Cache) CaddyModule

func (Cache) CaddyModule() caddy.ModuleInfo

CaddyModule implements caddy.Module

func (*Cache) ClearJA3

func (c *Cache) ClearJA3(addr string)

func (*Cache) GetJA3

func (c *Cache) GetJA3(addr string) *string

func (*Cache) Provision

func (c *Cache) Provision(ctx caddy.Context) error

func (*Cache) SetClientHello

func (c *Cache) SetClientHello(addr string, ch []byte) error

func (*Cache) Start

func (c *Cache) Start() error

Start implements caddy.App

func (*Cache) Stop

func (c *Cache) Stop() error

Stop implements caddy.App

type JA3Handler

type JA3Handler struct {
	// contains filtered or unexported fields
}

func (JA3Handler) CaddyModule

func (JA3Handler) CaddyModule() caddy.ModuleInfo

func (*JA3Handler) Provision

func (h *JA3Handler) Provision(ctx caddy.Context) error

Provision implements caddy.Provisioner

func (*JA3Handler) ServeHTTP

func (h *JA3Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request, next caddyhttp.Handler) error

ServeHTTP implements caddyhttp.MiddlewareHandler

func (*JA3Handler) UnmarshalCaddyfile

func (h *JA3Handler) UnmarshalCaddyfile(_ *caddyfile.Dispenser) error

UnmarshalCaddyfile implements caddyfile.Unmarshaler

type JA3Listener

type JA3Listener struct {
	// contains filtered or unexported fields
}

func (JA3Listener) CaddyModule

func (JA3Listener) CaddyModule() caddy.ModuleInfo

CaddyModule implements caddy.Module

func (*JA3Listener) Provision

func (l *JA3Listener) Provision(ctx caddy.Context) error

func (*JA3Listener) UnmarshalCaddyfile

func (l *JA3Listener) UnmarshalCaddyfile(_ *caddyfile.Dispenser) error

UnmarshalCaddyfile implements caddyfile.Unmarshaler

func (*JA3Listener) WrapListener

func (l *JA3Listener) WrapListener(ln net.Listener) net.Listener

WrapListener implements caddy.ListenerWrapper

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL