mysql

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteRules

func DeleteRules(c *gin.Context)

DeleteRules Delete mysql rule from user submit

func ListRules

func ListRules(c *gin.Context)

ListRules lists all mysql rules those satisfy the filter

func Records added in v0.2.1

func Records(c *gin.Context)

func UpsertRules

func UpsertRules(c *gin.Context)

UpsertRules create or update mysql rule from user submit

Types

type Config

type Config struct {
	Enable        bool
	Addr          string
	VersionString string `yaml:"version_string"`
}

type Record

type Record struct {
	record.BaseRecord
	Username      string           `gorm:"index" form:"username" json:"username" notice:"username"`
	ClientName    string           `gorm:"index" form:"client_name" json:"client_name" notice:"client_name"`
	Schema        string           `gorm:"index" form:"schema" json:"schema" notice:"schema"`
	ClientOS      string           `gorm:"index" form:"client_os" json:"client_os" notice:"client_os"`
	LoadLocalData bool             `gorm:"index" form:"load_local_data" json:"load_local_data" notice:"load_local_data"`
	Files         []file.MySQLFile `gorm:"foreignKey:RecordID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" form:"-" json:"files" notice:"-" `
	Rule          Rule             `gorm:"foreignKey:RuleName;references:Name;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" form:"-" json:"-" notice:"-"`
}

func (Record) Notice

func (r Record) Notice()

func (Record) TableName

func (Record) TableName() string

type Rule

type Rule struct {
	rule.BaseRule     `yaml:",inline"`
	Files             string            `form:"files" json:"files"`
	ExploitJdbcClient bool              `gorm:"exploit_jdbc_client" form:"exploit_jdbc_client" json:"exploit_jdbc_client" yaml:"exploit_jdbc_client"`
	Payloads          database.MapField `json:"payloads" form:"payloads"`
}

func (*Rule) CreateOrUpdate

func (r *Rule) CreateOrUpdate() (err error)

CreateOrUpdate creates or updates the mysql rule in database and ruleSet

func (*Rule) Delete

func (r *Rule) Delete() (err error)

Delete deletes the mysql rule in database and ruleSet

func (Rule) TableName

func (Rule) TableName() string

type Server

type Server struct {
	Config

	Handler vmysql.Handler
	// contains filtered or unexported fields
}

func GetServer

func GetServer() *Server

func (*Server) ComQuery

func (s *Server) ComQuery(c *vmysql.Conn, query string, callback func(*sqltypes.Result) error) error

ComQuery is part of the mysql.Handler interface.

func (*Server) ConnectionClosed

func (s *Server) ConnectionClosed(c *vmysql.Conn)

ConnectionClosed is part of the mysql.Handler interface.

func (*Server) NewConnection

func (s *Server) NewConnection(c *vmysql.Conn)

NewConnection is part of the mysql.Handler interface.

func (*Server) Restart

func (s *Server) Restart()

func (*Server) Run

func (s *Server) Run()

func (*Server) Stop

func (s *Server) Stop()

func (*Server) UpdateRules

func (s *Server) UpdateRules() error

func (*Server) WarningCount

func (s *Server) WarningCount(c *vmysql.Conn) uint16

WarningCount is part of the mysql.Handler interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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