injecter

package module
v0.0.0-...-571cb01 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2019 License: MIT Imports: 10 Imported by: 0

README

udf-injecter

MySQL UDF(user defined function) privilege escalation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFunc

func CreateFunc(handle Handle, f *Func, path string) error

CreateFunc path: soname path

func DropFunc

func DropFunc(handle Handle, name string) error

DropFunc

func DumpFile

func DumpFile(handle Handle, data []byte, path string) error

DumpFile

func GetMachine

func GetMachine(handle Handle) (string, error)

GetMachine

func GetMaxAllowedPacket

func GetMaxAllowedPacket(handle Handle) (int, error)

GetMaxAllowedPacket 1073741824

func GetOS

func GetOS(handle Handle) (string, error)

GetOS

func GetPluginDir

func GetPluginDir(handle Handle) (string, error)

GetPluginDir return plugin path

func GetVersion

func GetVersion(handle Handle) (string, error)

GetVersion "8.0.15"

func Inject

func Inject(handle Handle, udf map[string]*UDF, funcs []*Func) error

Inject udf: windows_386:*UDF windows_amd64:*UDF linux_386:*UDF linux_amd64:*UDF

func IsDynamic

func IsDynamic(handle Handle) bool

IsDynamic

func ParseVersion

func ParseVersion(version string) (ver int, err error)

ParseVersion "8.0.15" = 08|00 -> 0800(int)

func RandomStr

func RandomStr(size int) string

func SetMaxAllowedPacket

func SetMaxAllowedPacket(handle Handle, value int) error

SetMaxAllowedPacket

Types

type Func

type Func struct {
	Name   string
	Return string // return type
}

type Handle

type Handle interface {
	// Query
	// mysql> show variables like '%version_%';
	// +-------------------------+------------------------------+
	// | Variable_name           | Value                        |
	// +-------------------------+------------------------------+
	// | slave_type_conversions  |                              |
	// | version_comment         | MySQL Community Server - GPL |
	// | version_compile_machine | x86_64                       |
	// | version_compile_os      | Win64                        |
	// | version_compile_zlib    | 1.2.11                       |
	// +-------------------------+------------------------------+
	// result, _ := Query("show variables like '%version_%'")
	// result[2]["Variable_name"] = "x86_64"
	// Query result length must > 0
	Query(query string) ([]map[string]string, error)
	Exec(query string) error
	Close()
}

func Connect

func Connect(address, username, password string) (Handle, error)

func ConnectPHPMyAdmin

func ConnectPHPMyAdmin(address, username, password string) (Handle, error)

func ConnectSQLI

func ConnectSQLI(address string) (Handle, error)

func ConnectWithDSN

func ConnectWithDSN(dsn string) (Handle, error)

type UDF

type UDF struct {
	Name string
	Data []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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