server

package
v0.0.0-...-aa8d9c8 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RansomDeadline = time.Duration(types.Config.C2.RansomDeadlineHours) * time.Hour
	RansomAmount   = types.Config.C2.RansomAmountSOL // 1 SOL ~$200

	// Used for the payment callback endpoint as extra security to prevent people from finding the endpoint
	PaymentCallbackSnowflake string
	RansomPaidEndpoint       string
	RSAPrivateKey            []byte
)

Functions

func IsLocalhost

func IsLocalhost(r *http.Request) bool

func NewResponseWriter

func NewResponseWriter() mockResponseWriter

func ParseJSON

func ParseJSON(r *http.Request, v interface{}) error

func SendJSON

func SendJSON(w http.ResponseWriter, v interface{})

func SendWebhook

func SendWebhook(uri string, v interface{})

Types

type Client

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

func NewClient

func NewClient(ctx context.Context) *Client

func (*Client) Close

func (c *Client) Close(ctx context.Context)

func (*Client) GetEncryptionKey

func (c *Client) GetEncryptionKey(w http.ResponseWriter, r *http.Request)

func (*Client) InitalizeRansom

func (c *Client) InitalizeRansom(w http.ResponseWriter, r *http.Request)

func (*Client) Listen

func (c *Client) Listen()

func (*Client) PaidCallback

func (c *Client) PaidCallback(w http.ResponseWriter, r *http.Request)

type GetKeyBody

type GetKeyBody struct {
	UUID   string   `json:"uuid"`
	Hashes []string `json:"hashes"` // In case the UUID is lost
}

type GetKeyResponse

type GetKeyResponse struct {
	Success       bool   `json:"success"`
	EncryptionKey string `json:"encryption_key"` // not encrypted
}

type InitRansomBody

type InitRansomBody struct {
	Hashes       []string       `json:"hashes"`
	EncryptedKey string         `json:"encrypted_key"` // PEM RSA Key
	DeviceInfo   map[string]any `json:"device_info"`
}

type InitRansomResponse

type InitRansomResponse struct {
	Success                bool    `json:"success"`
	UUID                   string  `json:"uuid"`
	TimeBeforeDeactivation int64   `json:"time_before_deactivation"`
	Address                string  `json:"address"`
	Amount                 float64 `json:"amount"`
	QRCode                 string  `json:"qrcode"`
	PaymentID              string  `json:"payment_id"`
}

Jump to

Keyboard shortcuts

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