db

package
v0.0.0-...-6d7c776 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetSessionAsInstrumented

func SetSessionAsInstrumented(victimID string) error

Types

type Victim

type Victim struct {
	ID                  string `redis:"id"`
	IP                  string `redis:"ip"`
	UA                  string `redis:"ua"`
	FirstSeen           string `redis:"fseen"`
	LastSeen            string `redis:"lseen"`
	RequestCount        int    `redis:"reqCount"`
	CredsCount          int    `redis:"creds_count"`
	CookieJar           string `redis:"cookiejar_id"`
	SessionInstrumented bool   `redis:"session_instrumented"`

	Cookies     []VictimCookie     `redis:"-"`
	Credentials []VictimCredential `redis:"-"`
}

Victim: a browser that interacts with NewOrder KEY scheme: victim:<ID>

func GetAllVictims

func GetAllVictims() ([]Victim, error)

GetAllVictims returns all the victim IDs stored in the database

func GetVictim

func GetVictim(victimID string) (*Victim, error)

GetVictim returns a Victim from database

func (*Victim) GetCredentials

func (v *Victim) GetCredentials() error

GetCredentials returns a VictimCredential from database

func (*Victim) GetVictimCookiejar

func (v *Victim) GetVictimCookiejar() error

GetVictimCookiejar returns a slice of VictimCookie associated to a victim

func (*Victim) Store

func (v *Victim) Store() error

Store saves a Victim in the database

type VictimCookie

type VictimCookie struct {
	Name     string `redis:"name" json:"name"`
	Value    string `redis:"value" json:"value"`
	Domain   string `redis:"domain" json:"domain"`
	Expires  string `redis:"expires" json:"expirationDate"`
	Path     string `redis:"path" json:"path"`
	HTTPOnly bool   `redis:"httpOnly" json:"httpOnly"`
	Secure   bool   `redis:"secure" json:"secure"`
	SameSite string `redis:"sameSite" json:"sameSite"`
	Session  bool   `redis:"session" json:"session"` // is the cookie a session cookie?
}

VictimCookie: a victim has N cookies associated with its web session KEY scheme: victim:<ID>:cookiejar:<COOKIE_NAME>

func (*VictimCookie) Store

func (vc *VictimCookie) Store(victimID string) error

Store saves a Cookie in the database

type VictimCredential

type VictimCredential struct {
	Key   string `redis:"key"`
	Value string `redis:"val"`
	Time  string `redis:"time"`
}

VictimCredential: a victim has at least one set of credentials KEY scheme: victim:<ID>:creds:<COUNT>

func (*VictimCredential) Store

func (vc *VictimCredential) Store(victimID string) error

Store saves a VictimCredential in the database

Jump to

Keyboard shortcuts

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