yakit

package
v1.3.5-alpha0806 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: AGPL-3.0 Imports: 56 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTPFLOW_TAG        = "HTTPFLOW_TAG"
	HTTPFLOW_STATUSCODE = "HTTPFLOW_STATUSCODE"
)
View Source
const (
	HYBRIDSCAN_EXECUTING = "executing"
	HYBRIDSCAN_PAUSED    = "paused"
	HYBRIDSCAN_DONE      = "done"
	HYBRIDSCAN_ERROR     = "error"
)
View Source
const (
	BARE_REQUEST_GROUP  = "FLOW_ID_TO_BARE_REQUEST"
	BARE_RESPONSE_GROUP = "FLOW_ID_TO_BARE_RESPONSE"
)
View Source
const (
	INIT_DATABASE_RECORD_NAME = "[default]"
	FolderID                  = 0
	ChildFolderID             = 0
	TypeProject               = "project"
	TypeFile                  = "file"
	TEMPORARY_PROJECT_NAME    = "[temporary]"
	MIGRATE_DATABASE_KEY      = "__migrate_database__"
)
View Source
const MaxSize = 2 << 20 // 2MB

Variables

View Source
var DBSaveAsyncChannel = make(chan DbExecFunc, 1000)
View Source
var GetProjectById = model.GetProjectById

Project.ToGRPCModel use GetProjectById, so move GetProjectById to schema package

View Source
var GlobalPluginScanFilter = new(PluginScanFilter)
View Source
var ReportExports = map[string]interface{}{
	"New": NewReport,
}
View Source
var (
	RiskTypes = make([]string, 0)
)
View Source
var YakitDuplexConnectionServer = &DuplexConnectionServer{
	Handlers:           make(map[string]DuplexConnectionHandler),
	serverHandlerMutex: sync.Mutex{},
}

Functions

func BatchExtractedData added in v1.2.2

func BatchExtractedData(db *gorm.DB, ctx context.Context) chan *schema.ExtractedData

func BatchScreenRecorder added in v1.2.2

func BatchScreenRecorder(db *gorm.DB, ctx context.Context) chan *schema.ScreenRecorder

func BatchWebsocketFlows added in v1.2.2

func BatchWebsocketFlows(db *gorm.DB, ctx context.Context) chan *schema.WebsocketFlow

func BroadcastData added in v1.3.2

func BroadcastData(typeString string, data any)

func BuildHTTPFlowQuery added in v1.2.9

func BuildHTTPFlowQuery(db *gorm.DB, params *ypb.QueryHTTPFlowRequest) *gorm.DB

BuildHTTPFlowQuery 构建带有过滤条件的查询

func CallPostInitDatabase

func CallPostInitDatabase() error

func CheckDNSLogByToken

func CheckDNSLogByToken(token string, runtimeId string, timeout ...float64) ([]*tpb.DNSLogEvent, error)

func CheckExistGroup added in v1.3.0

func CheckExistGroup(db *gorm.DB, group string) (bool, error)

func CheckHTTPLogByToken added in v1.3.3

func CheckHTTPLogByToken(token string, runtimeId string, timeout ...float64) ([]*tpb.HTTPRequestTriggerNotification, error)

func CheckICMPTriggerByLength

func CheckICMPTriggerByLength(i int, runtimeID string) (*tpb.ICMPTriggerNotification, error)

func CheckRandomTriggerByToken

func CheckRandomTriggerByToken(t string, runtimeID string) (*tpb.RandomPortTriggerEvent, error)

func CheckServerReachable

func CheckServerReachable(ctx context.Context, target string, httpCheck bool) (*tpb.CheckServerReachableResponse, error)

func ClearCodecFlow added in v1.3.3

func ClearCodecFlow(db *gorm.DB) error

func ConfigureNetWork added in v1.3.2

func ConfigureNetWork(c *ypb.GlobalNetworkConfig)

ConfigureNetWork configure network: update memory and database

func CopyPayloads added in v1.2.9

func CopyPayloads(db *gorm.DB, payloads []*schema.Payload, group, folder string) error

func CountHTTPFlowByRuntimeID

func CountHTTPFlowByRuntimeID(db *gorm.DB, runtimeId string) int

func CountRiskByRuntimeId added in v1.3.1

func CountRiskByRuntimeId(db *gorm.DB, runtimeId string) (int, error)

func CountWebFuzzerResponses

func CountWebFuzzerResponses(db *gorm.DB, id int) (int, error)

func CountYakScriptByWhere added in v1.3.1

func CountYakScriptByWhere(db *gorm.DB, isGroup bool, req *ypb.QueryYakScriptGroupRequest) (total int64, err error)

func CreateHTTPFlow added in v1.3.2

func CreateHTTPFlow(opts ...CreateHTTPFlowOptions) (*schema.HTTPFlow, error)

func CreateHTTPFlowFromHTTPWithBodySaved

func CreateHTTPFlowFromHTTPWithBodySaved(isHttps bool, req *http.Request, rsp *http.Response, source string, url string, remoteAddr string, opts ...CreateHTTPFlowOptions) (*schema.HTTPFlow, error)

func CreateHTTPFlowFromHTTPWithBodySavedFromRaw

func CreateHTTPFlowFromHTTPWithBodySavedFromRaw(isHttps bool, reqRaw []byte, rspRaw []byte, source string, url string, remoteAddr string, opts ...CreateHTTPFlowOptions) (*schema.HTTPFlow, error)

func CreateHTTPFlowFromHTTPWithNoRspSaved added in v1.2.4

func CreateHTTPFlowFromHTTPWithNoRspSaved(isHttps bool, req *http.Request, source string, url string, remoteAddr string, opts ...CreateHTTPFlowOptions) (*schema.HTTPFlow, error)

func CreateOrUpdateAliveHost added in v1.2.7

func CreateOrUpdateAliveHost(db *gorm.DB, hash string, i interface{}) error

func CreateOrUpdateCodecFlow added in v1.3.3

func CreateOrUpdateCodecFlow(db *gorm.DB, flow *schema.CodecFlow) error

func CreateOrUpdateDomain

func CreateOrUpdateDomain(db *gorm.DB, hash string, i interface{}) error

func CreateOrUpdateExecHistory

func CreateOrUpdateExecHistory(db *gorm.DB, hash string, i interface{}) error

func CreateOrUpdateExecResult

func CreateOrUpdateExecResult(db *gorm.DB, hash string, i interface{}) error

func CreateOrUpdateExtractedData

func CreateOrUpdateExtractedData(db *gorm.DB, mainId int64, i interface{}) error

func CreateOrUpdateExtractedDataEx

func CreateOrUpdateExtractedDataEx(mainId int64, i interface{}) error

func CreateOrUpdateHTTPFlow

func CreateOrUpdateHTTPFlow(db *gorm.DB, hash string, i *schema.HTTPFlow) (fErr error)

func CreateOrUpdateHTTPFlowExg

func CreateOrUpdateHTTPFlowExg(hash string, i *schema.HTTPFlow) error

func CreateOrUpdateHost

func CreateOrUpdateHost(db *gorm.DB, ip string, i interface{}) error

func CreateOrUpdateMarkdownDoc

func CreateOrUpdateMarkdownDoc(db *gorm.DB, sid int64, name string, i interface{}) error

func CreateOrUpdateMenuItem

func CreateOrUpdateMenuItem(db *gorm.DB, hash string, i interface{}) error

func CreateOrUpdateNavigation added in v1.2.3

func CreateOrUpdateNavigation(db *gorm.DB, hash string, i interface{}) error

func CreateOrUpdatePayload

func CreateOrUpdatePayload(db *gorm.DB, content, group, folder string, hitCount int64, isFile bool) error

func CreateOrUpdatePluginGroup added in v1.3.1

func CreateOrUpdatePluginGroup(db *gorm.DB, hash string, i interface{}) error

func CreateOrUpdatePort

func CreateOrUpdatePort(db *gorm.DB, hash string, i interface{}) error

func CreateOrUpdateProgress added in v1.3.3

func CreateOrUpdateProgress(db *gorm.DB, runtimeId string, i interface{}) error

func CreateOrUpdateProject

func CreateOrUpdateProject(db *gorm.DB, name string, folderID, childFolderID int64, Type string, i interface{}) error

func CreateOrUpdateReportRecord

func CreateOrUpdateReportRecord(db *gorm.DB, hash string, i interface{}) error

func CreateOrUpdateRisk

func CreateOrUpdateRisk(db *gorm.DB, hash string, i interface{}) error

func CreateOrUpdateScreenRecorder

func CreateOrUpdateScreenRecorder(db *gorm.DB, hash string, i interface{}) error

func CreateOrUpdateWebFuzzerLabel added in v1.2.3

func CreateOrUpdateWebFuzzerLabel(db *gorm.DB, hash string, i interface{}) error

func CreateOrUpdateWebShell added in v1.3.0

func CreateOrUpdateWebShell(db *gorm.DB, hash string, i interface{}) (*schema.WebShell, error)

func CreateOrUpdateWebsocketFlow

func CreateOrUpdateWebsocketFlow(db *gorm.DB, hash string, i interface{}) error

func CreateOrUpdateWebsocketFlowEx

func CreateOrUpdateWebsocketFlowEx(db *gorm.DB, hash string, i interface{}, finishHandler ...func(error)) error

func CreateOrUpdateYakScript

func CreateOrUpdateYakScript(db *gorm.DB, id int64, i interface{}) error

func CreateOrUpdateYakScriptByName

func CreateOrUpdateYakScriptByName(db *gorm.DB, scriptName string, i interface{}) error

func CreateOrUpdateYakScriptByOnlineId

func CreateOrUpdateYakScriptByOnlineId(db *gorm.DB, onlineId int64, i interface{}) error

func CreateRisk

func CreateRisk(u string, opts ...RiskParamsOpt) *schema.Risk

func CreateTemporaryYakScript added in v1.2.2

func CreateTemporaryYakScript(t string, code string, suffix ...string) (string, error)

func CreateTemporaryYakScriptEx

func CreateTemporaryYakScriptEx(t string, code string, suffix ...string) (name string, clear func(), err error)

func DelKey

func DelKey(db *gorm.DB, key interface{})

func DeleteCodecFlow added in v1.3.3

func DeleteCodecFlow(db *gorm.DB, flowName string) error

func DeleteDomainByID

func DeleteDomainByID(db *gorm.DB, ids ...int64) error

func DeleteExecHistoryAll

func DeleteExecHistoryAll(db *gorm.DB) error

func DeleteExecHistoryByID

func DeleteExecHistoryByID(db *gorm.DB, id int64) error

func DeleteExecResult

func DeleteExecResult(db *gorm.DB) error

func DeleteExecResultByID

func DeleteExecResultByID(db *gorm.DB, id int64) error

func DeleteExecResultByYakScriptName

func DeleteExecResultByYakScriptName(db *gorm.DB, name string) error

func DeleteExtractedDataByID

func DeleteExtractedDataByID(db *gorm.DB, id int64) error

func DeleteExtractedDataByTraceId

func DeleteExtractedDataByTraceId(db *gorm.DB, flowHash string) error

func DeleteExtractedDataByTraceIds

func DeleteExtractedDataByTraceIds(db *gorm.DB, httpFlowHash []string) error

func DeleteHTTPFlow

func DeleteHTTPFlow(db *gorm.DB, req *ypb.DeleteHTTPFlowRequest) error

func DeleteHTTPFlowByID

func DeleteHTTPFlowByID(db *gorm.DB, id int64) error

func DeleteHostByID

func DeleteHostByID(db *gorm.DB, id int64) error

func DeleteMarkdownDocByID

func DeleteMarkdownDocByID(db *gorm.DB, id int64) error

func DeleteMenuItem

func DeleteMenuItem(db *gorm.DB, group string, name string, mode string) error

func DeleteMenuItemAll

func DeleteMenuItemAll(db *gorm.DB) error

func DeleteMenuItemByID

func DeleteMenuItemByID(db *gorm.DB, id int64) error

func DeleteNavigationByWhere added in v1.2.3

func DeleteNavigationByWhere(db *gorm.DB, req *ypb.GetAllNavigationRequest) error

func DeletePayloadByFolder added in v1.2.9

func DeletePayloadByFolder(db *gorm.DB, folder string) error

func DeletePayloadByGroup

func DeletePayloadByGroup(db *gorm.DB, group string) error

func DeletePayloadByID

func DeletePayloadByID(db *gorm.DB, id int64) error

func DeletePayloadByIDs added in v1.2.9

func DeletePayloadByIDs(db *gorm.DB, ids []int64) error

func DeletePluginGroup added in v1.3.1

func DeletePluginGroup(db *gorm.DB, group string) error

func DeletePluginGroupByHash added in v1.3.1

func DeletePluginGroupByHash(db *gorm.DB, hash string) error

func DeletePluginGroupByScriptName added in v1.3.1

func DeletePluginGroupByScriptName(db *gorm.DB, scriptName []string) error

func DeletePluginGroupsWithNonEmptyTemporaryId added in v1.3.2

func DeletePluginGroupsWithNonEmptyTemporaryId(db *gorm.DB) error

func DeletePortByID

func DeletePortByID(db *gorm.DB, id int64) error

func DeletePortsByID

func DeletePortsByID(db *gorm.DB, id int64) error

func DeleteProgress added in v1.3.3

func DeleteProgress(db *gorm.DB, filter *ypb.UnfinishedTaskFilter) ([]*schema.Progress, error)

func DeleteProgressByRuntimeId added in v1.3.3

func DeleteProgressByRuntimeId(db *gorm.DB, runtimeId string) (*schema.Progress, error)

func DeleteProjectById

func DeleteProjectById(db *gorm.DB, id int64) error

func DeleteProjectByProjectName

func DeleteProjectByProjectName(db *gorm.DB, name string) error

func DeleteProjectByUid

func DeleteProjectByUid(db *gorm.DB, id string) error

func DeleteProjectKeyBareRequestAndResponse added in v1.2.9

func DeleteProjectKeyBareRequestAndResponse(db *gorm.DB) error

func DeleteReportRecordByHash

func DeleteReportRecordByHash(db *gorm.DB, id string) error

func DeleteReportRecordByID

func DeleteReportRecordByID(db *gorm.DB, id int64) error

func DeleteReportRecordByIDs

func DeleteReportRecordByIDs(db *gorm.DB, ids ...int64) error

func DeleteRisk

func DeleteRisk(db *gorm.DB, request *ypb.QueryRisksRequest) error

func DeleteRiskByID

func DeleteRiskByID(db *gorm.DB, ids ...int64) error

func DeleteRiskByTarget added in v1.2.3

func DeleteRiskByTarget(db *gorm.DB, target string)

func DeleteScreenRecorder added in v1.2.2

func DeleteScreenRecorder(db *gorm.DB, id int64) error

func DeleteScreenRecorderByID

func DeleteScreenRecorderByID(db *gorm.DB, id int64) error

func DeleteWebFuzzerLabel added in v1.2.3

func DeleteWebFuzzerLabel(db *gorm.DB, hash string) error

func DeleteWebFuzzerResponseByTaskID

func DeleteWebFuzzerResponseByTaskID(db *gorm.DB, id int64) error

func DeleteWebFuzzerTask

func DeleteWebFuzzerTask(db *gorm.DB, id int64) error

func DeleteWebFuzzerTaskAll

func DeleteWebFuzzerTaskAll(db *gorm.DB) error

func DeleteWebFuzzerTaskByWebFuzzerIndex added in v1.2.7

func DeleteWebFuzzerTaskByWebFuzzerIndex(db *gorm.DB, index string) error

func DeleteWebShellByID added in v1.3.0

func DeleteWebShellByID(db *gorm.DB, ids ...int64) error

func DeleteWebsocketFlowAll

func DeleteWebsocketFlowAll(db *gorm.DB) error

func DeleteWebsocketFlowByID

func DeleteWebsocketFlowByID(db *gorm.DB, id int64) error

func DeleteWebsocketFlowByWebsocketHash

func DeleteWebsocketFlowByWebsocketHash(db *gorm.DB, hash string) error

func DeleteWebsocketFlowsByHTTPFlowHash

func DeleteWebsocketFlowsByHTTPFlowHash(db *gorm.DB, hash string) error

func DeleteWebsocketFlowsByHTTPFlowHashList

func DeleteWebsocketFlowsByHTTPFlowHashList(db *gorm.DB, hash []string) error

func DeleteYakScript added in v1.3.1

func DeleteYakScript(db *gorm.DB, params *ypb.DeleteLocalPluginsByWhereRequest) *gorm.DB

func DeleteYakScriptAll

func DeleteYakScriptAll(db *gorm.DB) error

func DeleteYakScriptByID

func DeleteYakScriptByID(db *gorm.DB, id int64) error

func DeleteYakScriptByName

func DeleteYakScriptByName(db *gorm.DB, s string) error

func DeleteYakScriptByNameOrUUID

func DeleteYakScriptByNameOrUUID(db *gorm.DB, name, uuid string) error

func DeleteYakScriptByOnlineId

func DeleteYakScriptByOnlineId(db *gorm.DB, onlineId int64) error

func DeleteYakScriptByUserID

func DeleteYakScriptByUserID(db *gorm.DB, s int64, onlineBaseUrl string) error

func DeleteYakScriptByWhere

func DeleteYakScriptByWhere(db *gorm.DB) error

func DropExtractedDataTable

func DropExtractedDataTable(db *gorm.DB)

func DropWebsocketFlowTable

func DropWebsocketFlowTable(db *gorm.DB)

func ExportHTTPFlow added in v1.3.0

func ExportHTTPFlow(db *gorm.DB, params *ypb.ExportHTTPFlowsRequest) (paging *bizhelper.Paginator, ret []*schema.HTTPFlow, err error)

func ExportYakScript

func ExportYakScript(db *gorm.DB, fileName string) error

func ExtractTokenFromUrl

func ExtractTokenFromUrl(tokenUrl string) string

func ExtractedDataFromHTTPFlow added in v1.2.7

func ExtractedDataFromHTTPFlow(flowHash string, ruleName string, matchResult *MatchResult, data string, regexpStr ...string) *schema.ExtractedData

func FilterByQueryRisks

func FilterByQueryRisks(db *gorm.DB, params *ypb.QueryRisksRequest) (_ *gorm.DB, _ error)

func FilterDomain

func FilterDomain(db *gorm.DB, params *ypb.QueryDomainsRequest) *gorm.DB

func FilterHTTPFlow

func FilterHTTPFlow(db *gorm.DB, params *ypb.QueryHTTPFlowRequest) *gorm.DB

func FilterHTTPFlowByDomain added in v1.2.9

func FilterHTTPFlowByDomain(db *gorm.DB, domain string) *gorm.DB

func FilterHTTPFlowByRuntimeID added in v1.3.0

func FilterHTTPFlowByRuntimeID(db *gorm.DB, runtimeID string) *gorm.DB

func FilterHTTPFlowBySchema added in v1.2.9

func FilterHTTPFlowBySchema(db *gorm.DB, schema string) *gorm.DB

func FilterHTTPFlowPathPrefix added in v1.2.9

func FilterHTTPFlowPathPrefix(db *gorm.DB, pathPrefix string) *gorm.DB

func FilterHybridScan added in v1.3.3

func FilterHybridScan(db *gorm.DB, filter *ypb.HybridScanTaskFilter) *gorm.DB

func FilterNaslScript added in v1.2.2

func FilterNaslScript(db *gorm.DB, params *ypb.QueryYakScriptRequest) *gorm.DB

FilterNaslScript 过滤nasl脚本,支持关键词搜索,family过滤,排除和指定脚本名

func FilterPort

func FilterPort(db *gorm.DB, params *ypb.QueryPortsRequest) *gorm.DB

func FilterProgress added in v1.3.3

func FilterProgress(db *gorm.DB, filter *ypb.UnfinishedTaskFilter) *gorm.DB

func FilterReportRecord

func FilterReportRecord(db *gorm.DB, params *ypb.QueryReportsRequest) *gorm.DB

func FilterRootScriptsWithDbModelType added in v1.2.2

func FilterRootScriptsWithDbModelType(scripts []*schema.NaslScript) []*schema.NaslScript

func FilterYakScript

func FilterYakScript(db *gorm.DB, params *ypb.QueryYakScriptRequest) *gorm.DB

func FixRiskType

func FixRiskType(db *gorm.DB)

func FuzzerResponseToHTTPFlow

func FuzzerResponseToHTTPFlow(db *gorm.DB, rsp *ypb.FuzzerResponse) (*schema.HTTPFlow, error)

func Get

func Get(key interface{}) string

func GetAllCodecFlow added in v1.3.3

func GetAllCodecFlow(db *gorm.DB) ([]*schema.CodecFlow, error)

func GetAllMenuItem

func GetAllMenuItem(db *gorm.DB) []*schema.MenuItem

func GetAllNavigation added in v1.2.3

func GetAllNavigation(db *gorm.DB, req *ypb.GetAllNavigationRequest) []*schema.NavigationBar

func GetCodecFlowByName added in v1.3.3

func GetCodecFlowByName(db *gorm.DB, flowName string) (*schema.CodecFlow, error)

func GetCurrentProject

func GetCurrentProject(db *gorm.DB) (*schema.Project, error)

func GetDefaultNetworkConfig added in v1.3.2

func GetDefaultNetworkConfig() *ypb.GlobalNetworkConfig

func GetDefaultProject

func GetDefaultProject(db *gorm.DB) (*schema.Project, error)

func GetDefaultScriptFileNameByType

func GetDefaultScriptFileNameByType(t string) (string, error)

func GetDomain

func GetDomain(db *gorm.DB, id int64) (*schema.Domain, error)

func GetExecHistory

func GetExecHistory(db *gorm.DB, id int64) (*schema.ExecHistory, error)

func GetExecResult

func GetExecResult(db *gorm.DB, id int64) (*schema.ExecResult, error)

func GetExtractedData

func GetExtractedData(db *gorm.DB, id int64) (*schema.ExtractedData, error)

func GetGroup added in v1.3.1

func GetGroup(db *gorm.DB, scriptNames []string) (req []*schema.PluginGroup, err error)

func GetHTTPFlow

func GetHTTPFlow(db *gorm.DB, id int64) (*schema.HTTPFlow, error)

func GetHTTPFlowByHash

func GetHTTPFlowByHash(db *gorm.DB, hash string) (*schema.HTTPFlow, error)

func GetHTTPFlowByIDOrHash added in v1.3.1

func GetHTTPFlowByIDOrHash(db *gorm.DB, id int64, hash string) (*schema.HTTPFlow, error)

func GetHost

func GetHost(db *gorm.DB, id int64) (*schema.Host, error)

func GetHostByIP

func GetHostByIP(db *gorm.DB, ip string) (*schema.Host, error)

func GetHybridScanByTaskId added in v1.2.9

func GetHybridScanByTaskId(db *gorm.DB, taskId string) (*schema.HybridScanTask, error)

func GetKey

func GetKey(db *gorm.DB, key interface{}) string

func GetKeyFromProjectOrProfile

func GetKeyFromProjectOrProfile(key interface{}) string

func GetKeyModel

func GetKeyModel(db *gorm.DB, key interface{}) (*schema.GeneralStorage, error)

func GetMarkdownDoc

func GetMarkdownDoc(db *gorm.DB, id int64) (*schema.MarkdownDoc, error)

func GetMarkdownDocByName

func GetMarkdownDocByName(db *gorm.DB, sid int64, name string) (*schema.MarkdownDoc, error)

func GetMenuItem

func GetMenuItem(db *gorm.DB, group string, name string) (*schema.MenuItem, error)

func GetMenuItemById

func GetMenuItemById(db *gorm.DB, id int64) (*schema.MenuItem, error)

func GetNetworkConfig added in v1.3.2

func GetNetworkConfig() *ypb.GlobalNetworkConfig

func GetNucleiYakScriptByName

func GetNucleiYakScriptByName(db *gorm.DB, scriptName string) (*schema.YakScript, error)

GetNucleiYakScriptByName

func GetOneScreenRecorder added in v1.2.2

func GetOneScreenRecorder(db *gorm.DB, req *ypb.GetOneScreenRecorderRequest) (*schema.ScreenRecorder, error)

func GetPayloadById added in v1.2.9

func GetPayloadById(db *gorm.DB, id int64) (*schema.Payload, error)

func GetPayloadCountInGroup added in v1.2.9

func GetPayloadCountInGroup(db *gorm.DB, group string) int64

func GetPayloadFirst added in v1.3.0

func GetPayloadFirst(db *gorm.DB, group string) (*schema.Payload, error)

func GetPayloadGroupFileName added in v1.2.9

func GetPayloadGroupFileName(db *gorm.DB, group string) (string, error)

func GetPayloadsByFolder added in v1.2.9

func GetPayloadsByFolder(db *gorm.DB, folder string) ([]*schema.Payload, error)

func GetPayloadsByGroup added in v1.2.9

func GetPayloadsByGroup(db *gorm.DB, group string) ([]*schema.Payload, error)

func GetPluginByGroup added in v1.3.1

func GetPluginByGroup(db *gorm.DB, group string) (req []*schema.PluginGroup, err error)

func GetPort

func GetPort(db *gorm.DB, id int64) (*schema.Port, error)

func GetProcessEnvKey

func GetProcessEnvKey(db *gorm.DB) []*schema.GeneralStorage

func GetProgressByRuntimeId added in v1.3.3

func GetProgressByRuntimeId(db *gorm.DB, runtimeId string) (*schema.Progress, error)

func GetProject

func GetProject(db *gorm.DB, params *ypb.IsProjectNameValidRequest) (*schema.Project, error)

func GetProjectByID

func GetProjectByID(db *gorm.DB, id int64) (*schema.Project, error)

func GetProjectByName

func GetProjectByName(db *gorm.DB, name string) (*schema.Project, error)

func GetProjectByWhere

func GetProjectByWhere(db *gorm.DB, name string, folderID, childFolderID int64, Type string, id int64) (*schema.Project, error)

func GetProjectDetail

func GetProjectDetail(db *gorm.DB, id int64) (*schema.BackProject, error)

func GetProjectKey added in v1.2.2

func GetProjectKey(db *gorm.DB, key interface{}) string

func GetProjectKeyByWhere added in v1.2.7

func GetProjectKeyByWhere(db *gorm.DB, key []string) ([]*schema.ProjectGeneralStorage, error)

func GetProjectKeyModel added in v1.2.2

func GetProjectKeyModel(db *gorm.DB, key interface{}) (*schema.ProjectGeneralStorage, error)

func GetProjectKeyWithError added in v1.2.6

func GetProjectKeyWithError(db *gorm.DB, key interface{}) (string, error)

func GetReportRecord

func GetReportRecord(db *gorm.DB, id int64) (*schema.ReportRecord, error)

func GetReportRecordByHash

func GetReportRecordByHash(db *gorm.DB, id string) (*schema.ReportRecord, error)

func GetRisk

func GetRisk(db *gorm.DB, id int64) (*schema.Risk, error)

func GetRiskByHash

func GetRiskByHash(db *gorm.DB, hash string) (*schema.Risk, error)

func GetRiskByIDOrHash

func GetRiskByIDOrHash(db *gorm.DB, id int64, hash string) (*schema.Risk, error)

func GetRisksByRuntimeId added in v1.3.1

func GetRisksByRuntimeId(db *gorm.DB, runtimeId string) ([]*schema.Risk, error)

func GetScreenRecorder

func GetScreenRecorder(db *gorm.DB, id int64) (*schema.ScreenRecorder, error)

func GetTemporaryProject added in v1.3.0

func GetTemporaryProject(db *gorm.DB) (*schema.Project, error)

func GetWebFuzzerRetryRootID added in v1.2.8

func GetWebFuzzerRetryRootID(db *gorm.DB, id uint) (uint, error)

func GetWebFuzzerTaskById

func GetWebFuzzerTaskById(db *gorm.DB, id int) (*schema.WebFuzzerTask, error)

func GetWebFuzzerTasksIDByRetryRootID added in v1.2.8

func GetWebFuzzerTasksIDByRetryRootID(db *gorm.DB, root_id uint) ([]uint, error)

func GetWebShell added in v1.3.0

func GetWebShell(db *gorm.DB, id int64) (*ypb.WebShell, error)

func GetWebsocketFlow

func GetWebsocketFlow(db *gorm.DB, id int64) (*schema.WebsocketFlow, error)

func GetYakScript

func GetYakScript(db *gorm.DB, id int64) (*schema.YakScript, error)

func GetYakScriptByName

func GetYakScriptByName(db *gorm.DB, name string) (*schema.YakScript, error)

func GetYakScriptByOnlineID

func GetYakScriptByOnlineID(db *gorm.DB, onlineId int64) (*schema.YakScript, error)

func GetYakScriptByUUID

func GetYakScriptByUUID(db *gorm.DB, uuid string) (*schema.YakScript, error)

func GetYakScriptByWhere

func GetYakScriptByWhere(db *gorm.DB, name string, id int64) (*schema.YakScript, error)

func GetYakScriptIdOrName

func GetYakScriptIdOrName(db *gorm.DB, id int64, name string) (*schema.YakScript, error)

func GetYakScriptList

func GetYakScriptList(db *gorm.DB, id int64, ids []int64) ([]*schema.YakScript, error)

func HTTPFlowToOnline added in v1.3.3

func HTTPFlowToOnline(db *gorm.DB, hash []string) error

func HaveReverseRisk

func HaveReverseRisk(token string) bool

func IgnoreYakScriptByID

func IgnoreYakScriptByID(db *gorm.DB, id int64, ignored bool) error

func ImportResource

func ImportResource(db *gorm.DB, fileName string) error

func InitKey

func InitKey(db *gorm.DB, key interface{}, verbose interface{}, env bool) error

func InitialDatabase added in v1.2.3

func InitialDatabase()

func InitializingProjectDatabase

func InitializingProjectDatabase() error

func InsertHTTPFlow added in v1.2.3

func InsertHTTPFlow(db *gorm.DB, i *schema.HTTPFlow) (fErr error)

func InsertHTTPFlowEx

func InsertHTTPFlowEx(i *schema.HTTPFlow, finishHandler ...func()) error

func IsExitScreenRecorder added in v1.2.2

func IsExitScreenRecorder(db *gorm.DB, id int64, order string) (*schema.ScreenRecorder, error)

func IsRiskExecResult added in v1.3.2

func IsRiskExecResult(i any) (*schema.Risk, bool)

func LoadGlobalNetworkConfig added in v1.3.2

func LoadGlobalNetworkConfig()

LoadGlobalNetworkConfig load config from yakit config in db

func LoadPackage

func LoadPackage(typeStr string, basePath string) (*schema.YakScript, *schema.MarkdownDoc, error)

func LoadYakitFromLocalDir

func LoadYakitFromLocalDir(f string) error

func LoadYakitResources

func LoadYakitResources(dirName string) ([]*schema.YakScript, []*schema.MarkdownDoc, error)

func LoadYakitThirdpartySourceScripts

func LoadYakitThirdpartySourceScripts(
	ctx context.Context, ghUrl string,
	proxy ...string,
) error

func MigrateLegacyDatabase

func MigrateLegacyDatabase() error

func MovePayloads added in v1.2.9

func MovePayloads(db *gorm.DB, payloads []*schema.Payload, group, folder string) error

func NewAliveHost added in v1.2.7

func NewAliveHost(u string, opts ...AliveHostParamsOpt) (*schema.AliveHost, error)

func NewDNSLogDomain

func NewDNSLogDomain() (domain string, token string, _ error)

func NewDNSLogDomainWithContext

func NewDNSLogDomainWithContext(ctx context.Context) (domain string, token string, _ error)

func NewEmptyNaslScript

func NewEmptyNaslScript() *schema.NaslScript

func NewHTTPLog added in v1.3.3

func NewHTTPLog(i ...any) (domain string, token string, _ error)

func NewHost

func NewHost(ip string) (*schema.Host, error)

func NewLocalReverseProtoUrl

func NewLocalReverseProtoUrl(proto string) func(opts ...RiskParamsOpt) string

func NewMenuItemByBatchExecuteConfig

func NewMenuItemByBatchExecuteConfig(raw interface{}) (*schema.MenuItem, error)

func NewNaslScript

func NewNaslScript(name, content string) *schema.NaslScript

func NewPayload added in v1.2.9

func NewPayload(group string, content string) *schema.Payload

/ payload

func NewPublicReverseProtoUrl

func NewPublicReverseProtoUrl(proto string) func(opts ...RiskParamsOpt) string

func NewRandomPortTrigger

func NewRandomPortTrigger(opt ...RiskParamsOpt) (token string, addr string, _ error)

func NewReport

func NewReport() *schema.Report

func NewRisk

func NewRisk(u string, opts ...RiskParamsOpt) (*schema.Risk, error)

func NewRiskReadRequest

func NewRiskReadRequest(db *gorm.DB, Ids []int64) error

func NewTemporaryYakScript added in v1.3.2

func NewTemporaryYakScript(t string, code string, suffix ...string) (*schema.YakScript, error)

func NewUnverifiedRisk

func NewUnverifiedRisk(u string, token string, opts ...RiskParamsOpt) (*schema.Risk, error)

func PayloadGroups

func PayloadGroups(db *gorm.DB, search ...string) []string

func QueryAllMenuItemByWhere

func QueryAllMenuItemByWhere(db *gorm.DB, req *ypb.QueryAllMenuItemRequest) []*schema.MenuItem

func QueryDomain

func QueryDomain(db *gorm.DB, params *ypb.QueryDomainsRequest) (*bizhelper.Paginator, []*schema.Domain, error)

func QueryExecHistory

func QueryExecHistory(db *gorm.DB, params *ypb.ExecHistoryRequest) (*bizhelper.Paginator, []*schema.ExecHistory, error)

func QueryExportYakScript added in v1.3.0

func QueryExportYakScript(db *gorm.DB, params *ypb.ExportLocalYakScriptRequest) *gorm.DB

func QueryFirst50WebFuzzerTask

func QueryFirst50WebFuzzerTask(db *gorm.DB) []*ypb.HistoryHTTPFuzzerTask

Deprecated

func QueryHTTPFlow

func QueryHTTPFlow(db *gorm.DB, params *ypb.QueryHTTPFlowRequest) (paging *bizhelper.Paginator, httpflows []*schema.HTTPFlow, err error)

func QueryHost

func QueryHost(db *gorm.DB, params *ypb.QueryHostsRequest) (*bizhelper.Paginator, []*schema.Host, error)

func QueryHybridScan added in v1.2.9

func QueryHybridScan(db *gorm.DB, query *ypb.QueryHybridScanTaskRequest) (*bizhelper.Paginator, []*schema.HybridScanTask, error)

func QueryNaslScriptByName added in v1.2.2

func QueryNaslScriptByName(db *gorm.DB, name string) (*schema.NaslScript, error)

func QueryNaslScriptByOID added in v1.2.2

func QueryNaslScriptByOID(db *gorm.DB, oid string) (*schema.NaslScript, error)

func QueryNaslScriptByYakScriptRequest added in v1.2.2

func QueryNaslScriptByYakScriptRequest(db *gorm.DB, params *ypb.QueryYakScriptRequest) (*bizhelper.Paginator, []*schema.NaslScript, error)

func QueryNewRisk

func QueryNewRisk(db *gorm.DB, req *ypb.QueryNewRiskRequest, newRisk bool, isRead bool) (*bizhelper.Paginator, []*schema.Risk, error)

func QueryPayload

func QueryPayload(db *gorm.DB, folder, group, keyword string, paging *Paging) (*bizhelper.Paginator, []*schema.Payload, error)

func QueryPayloadWithCallBack added in v1.3.0

func QueryPayloadWithCallBack(db *gorm.DB, p *schema.Payload, notExistCallback, existCallback func(*gorm.DB, *schema.Payload) error) error

func QueryPayloadWithoutPaging added in v1.3.0

func QueryPayloadWithoutPaging(db *gorm.DB, folder, group, keyword string) ([]*schema.Payload, error)

func QueryPorts

func QueryPorts(db *gorm.DB, params *ypb.QueryPortsRequest) (*bizhelper.Paginator, []*schema.Port, error)

func QueryProgress added in v1.3.3

func QueryProgress(db *gorm.DB, paging *ypb.Paging, filter *ypb.UnfinishedTaskFilter) (*bizhelper.Paginator, []*schema.Progress, error)

func QueryProject

func QueryProject(db *gorm.DB, params *ypb.GetProjectsRequest) (*bizhelper.Paginator, []*schema.Project, error)

func QueryProjectTotal

func QueryProjectTotal(db *gorm.DB, req *ypb.GetProjectsRequest) (*bizhelper.Paginator, error)

func QueryReportRecord

func QueryReportRecord(db *gorm.DB, params *ypb.QueryReportsRequest) (*bizhelper.Paginator, []*schema.ReportRecord, error)

func QueryRiskCount

func QueryRiskCount(db *gorm.DB, isRead string) (int64, error)

func QueryRisks

func QueryRisks(db *gorm.DB, params *ypb.QueryRisksRequest) (*bizhelper.Paginator, []*schema.Risk, error)

func QueryRootNaslScriptByYakScriptRequest added in v1.2.2

func QueryRootNaslScriptByYakScriptRequest(db *gorm.DB, params *ypb.QueryYakScriptRequest) (*bizhelper.Paginator, []*schema.NaslScript, error)

func QueryTrafficPacket added in v1.2.8

func QueryTrafficPacket(db *gorm.DB, request *ypb.QueryTrafficPacketRequest) (*bizhelper.Paginator, []*schema.TrafficPacket, error)

func QueryTrafficSession added in v1.2.8

func QueryTrafficSession(db *gorm.DB, request *ypb.QueryTrafficSessionRequest) (*bizhelper.Paginator, []*schema.TrafficSession, error)

func QueryTrafficSessionByUUID added in v1.3.0

func QueryTrafficSessionByUUID(db *gorm.DB, uuid string) (*schema.TrafficSession, error)

func QueryTrafficTCPReassembled added in v1.2.8

func QueryTrafficTCPReassembled(db *gorm.DB, request *ypb.QueryTrafficTCPReassembledRequest) (*bizhelper.Paginator, []*schema.TrafficTCPReassembledFrame, error)

func QueryWebFuzzerLabel added in v1.2.3

func QueryWebFuzzerLabel(db *gorm.DB) ([]*schema.WebFuzzerLabel, error)

func QueryWebFuzzerLabelCount added in v1.2.3

func QueryWebFuzzerLabelCount(db *gorm.DB) int64

func QueryWebShells added in v1.3.0

func QueryWebShells(db *gorm.DB, params *ypb.QueryWebShellsRequest) (*bizhelper.Paginator, []*schema.WebShell, error)

func QueryWebsocketFlowByWebsocketHash

func QueryWebsocketFlowByWebsocketHash(db *gorm.DB, hash string, page int, limit int) (*bizhelper.Paginator, []*schema.WebsocketFlow, error)

func QueryWebsocketFlowsByHTTPFlowHash

func QueryWebsocketFlowsByHTTPFlowHash(db *gorm.DB, req *ypb.DeleteHTTPFlowRequest) *gorm.DB

func QueryYakScript

func QueryYakScript(db *gorm.DB, params *ypb.QueryYakScriptRequest) (*bizhelper.Paginator, []*schema.YakScript, error)

func QueryYakScriptByIsCore added in v1.2.4

func QueryYakScriptByIsCore(db *gorm.DB, isCore bool) []*schema.YakScript

func QueryYakScriptByNames

func QueryYakScriptByNames(db *gorm.DB, names ...string) []*schema.YakScript

func QuickSearchHTTPFlowCount added in v1.2.3

func QuickSearchHTTPFlowCount(token string) int

func QuickSearchMITMHTTPFlowCount added in v1.2.3

func QuickSearchMITMHTTPFlowCount(token string) int

func ReadPayloadFileLineWithCallBack added in v1.3.0

func ReadPayloadFileLineWithCallBack(fileName string, handler func(string, int64) error) error

func ReadQuotedLinesWithCallBack added in v1.3.0

func ReadQuotedLinesWithCallBack(data string, handler func(string) error) error

func RefreshProcessEnv

func RefreshProcessEnv(db *gorm.DB)

RefreshProcessEnv 在数据库初始化的时候执行这个,可以快速更新本进程的环境变量

func RegisterBeforeRiskSave added in v1.2.6

func RegisterBeforeRiskSave(f func(*schema.Risk))

func RegisterLowHTTPSaveCallback added in v1.3.3

func RegisterLowHTTPSaveCallback()

func RegisterMockedCheckedDNSLogDomain

func RegisterMockedCheckedDNSLogDomain(token string, mock func(token string, runtimeId string, timeout ...float64) ([]*tpb.DNSLogEvent, error))

func RegisterMockedNewDNSLogDomain

func RegisterMockedNewDNSLogDomain(h func() (string, string, error))

func RegisterPostInitDatabaseFunction

func RegisterPostInitDatabaseFunction(f func() error)

func RegisterServerPushCallback added in v1.3.2

func RegisterServerPushCallback(id string, stream ypb.Yak_DuplexConnectionServer)

func RemoveTemporaryYakScriptAll added in v1.3.2

func RemoveTemporaryYakScriptAll(db *gorm.DB, suffix string)

func RenamePayloadFolder added in v1.2.9

func RenamePayloadFolder(db *gorm.DB, folder, newFolder string) error

func RenamePayloadGroup added in v1.2.9

func RenamePayloadGroup(db *gorm.DB, oldGroup, newGroup string) error

func RiskTypeToVerbose

func RiskTypeToVerbose(i string) string

func SaveDomain

func SaveDomain(db *gorm.DB, domain string, ip string) error

func SaveExecResult

func SaveExecResult(db *gorm.DB, yakScriptName string, r *ypb.ExecResult) error

func SaveFromHTTP

func SaveFromHTTP(db *gorm.DB, isHttps bool, req *http.Request, rsp *http.Response, source string, url string, remoteAddr string) (*schema.HTTPFlow, error)

func SaveFromHTTPFromRaw

func SaveFromHTTPFromRaw(db *gorm.DB, isHttps bool, req []byte, rsp []byte, source string, url string, remoteAddr string) (*schema.HTTPFlow, error)

func SaveFromHTTPWithBodySaved

func SaveFromHTTPWithBodySaved(db *gorm.DB, isHttps bool, req *http.Request, rsp *http.Response, source string, url string, remoteAddr string) (*schema.HTTPFlow, error)

func SaveFromServerWebsocketFlow

func SaveFromServerWebsocketFlow(db *gorm.DB, owner string, index int, data []byte) error

func SaveHybridScanTask added in v1.2.9

func SaveHybridScanTask(db *gorm.DB, task *schema.HybridScanTask) error

func SavePayloadByFilename

func SavePayloadByFilename(db *gorm.DB, group string, fileName string) error

save payload from file

func SavePayloadGroup

func SavePayloadGroup(db *gorm.DB, group string, lists []string) error

save payload from data

func SavePayloadGroupByRaw added in v1.2.9

func SavePayloadGroupByRaw(db *gorm.DB, group string, data string) error

save payload from raw-data

func SaveRisk

func SaveRisk(r *schema.Risk) error

func SaveToServerWebsocketFlow

func SaveToServerWebsocketFlow(db *gorm.DB, owner string, index int, data []byte) error

func SaveTrafficPacket added in v1.2.8

func SaveTrafficPacket(db *gorm.DB, packet *schema.TrafficPacket) error

func SaveTrafficSession added in v1.2.8

func SaveTrafficSession(db *gorm.DB, session *schema.TrafficSession) error

func SaveWebFuzzerResponse

func SaveWebFuzzerResponse(db *gorm.DB, taskId int, hiddenIndex string, rsp *ypb.FuzzerResponse)

func SaveWebFuzzerResponseEx

func SaveWebFuzzerResponseEx(taskId int, hiddenIndex string, rsp *ypb.FuzzerResponse)

func SaveWebFuzzerTask

func SaveWebFuzzerTask(db *gorm.DB, req *ypb.FuzzerRequest, total int, ok bool, reason string) (*schema.WebFuzzerTask, error)

func SaveWebsocketFlowEx

func SaveWebsocketFlowEx(db *gorm.DB, fromServer bool, owner string, index int, data []byte, finishHandler ...func(error)) error

func SearchWebsocketFlow added in v1.3.1

func SearchWebsocketFlow(keyword string) int

func SelectHTTPFlowFromDB added in v1.3.3

func SelectHTTPFlowFromDB(queryDB *gorm.DB, params *ypb.QueryHTTPFlowRequest) (paging *bizhelper.Paginator, httpflows []*schema.HTTPFlow, err error)

func Set

func Set(key interface{}, value interface{})

func SetCurrentProject

func SetCurrentProject(db *gorm.DB, name string) error

func SetCurrentProjectById

func SetCurrentProjectById(db *gorm.DB, id int64) error

func SetGlobalPluginScanLists added in v1.3.2

func SetGlobalPluginScanLists(whitelist, blacklist []string) func()

func SetGroupInEnd added in v1.2.9

func SetGroupInEnd(db *gorm.DB, group string) error

func SetIndexToFolder added in v1.2.9

func SetIndexToFolder(db *gorm.DB, folder, group string, group_index int64) error

func SetKey

func SetKey(db *gorm.DB, key interface{}, value interface{}) error

func SetKeyProcessEnv

func SetKeyProcessEnv(db *gorm.DB, key interface{}, processEnv bool)

func SetKeyWithTTL

func SetKeyWithTTL(db *gorm.DB, key interface{}, value interface{}, seconds int) error

func SetProjectKey added in v1.2.2

func SetProjectKey(db *gorm.DB, key interface{}, value interface{}) error

func SetProjectKeyWithGroup added in v1.2.6

func SetProjectKeyWithGroup(db *gorm.DB, key interface{}, value interface{}, group string) error

func SetProjectKeyWithTTL added in v1.2.2

func SetProjectKeyWithTTL(db *gorm.DB, key interface{}, value interface{}, seconds int) error

func SignalDate

func SignalDate(id string, typeString string, data any)

func SolutionAndDescriptionByCWE added in v1.2.6

func SolutionAndDescriptionByCWE(FromYakScript, RiskTypeVerbose, TitleVerbose string) (description, solution string)

func TidyGeneralStorage

func TidyGeneralStorage(db *gorm.DB)

func TrimWhitespaceExceptSpace added in v1.2.9

func TrimWhitespaceExceptSpace(r rune) bool

trim payload content

func UnRegisterServerPushCallback added in v1.3.2

func UnRegisterServerPushCallback(id string)

func UnregisterMockedNewDNSLogDomain

func UnregisterMockedNewDNSLogDomain()

func UpdateGeneralModuleFromByYakScriptName

func UpdateGeneralModuleFromByYakScriptName(db *gorm.DB, scriptName string, i bool) error

func UpdateHTTPFlowTags added in v1.2.3

func UpdateHTTPFlowTags(db *gorm.DB, i *schema.HTTPFlow) error

direct save

func UpdateHTTPFlowTagsEx

func UpdateHTTPFlowTagsEx(i *schema.HTTPFlow) error

choose db save mode by const

func UpdatePayload

func UpdatePayload(db *gorm.DB, id int, payload *schema.Payload) error

func UpdatePayloadColumns added in v1.3.0

func UpdatePayloadColumns(db *gorm.DB, id int, m map[string]any) error

func UpdatePayloadGroup added in v1.2.9

func UpdatePayloadGroup(db *gorm.DB, group, folder string, group_index int64) error

func UpdateProject

func UpdateProject(db *gorm.DB, id int64, i schema.Project) error

func UpdateProjectDatabasePath added in v1.3.1

func UpdateProjectDatabasePath(db *gorm.DB, id int64, databasePath string) error

func UpdateRiskTags

func UpdateRiskTags(db *gorm.DB, i *schema.Risk) error

func UpdateWebShellById added in v1.3.0

func UpdateWebShellById(db *gorm.DB, id int64, i interface{}) (*schema.WebShell, error)

func UpdateWebShellStateById added in v1.3.0

func UpdateWebShellStateById(db *gorm.DB, id int64, state bool) (*schema.WebShell, error)

func UpdateYakitStore

func UpdateYakitStore(db *gorm.DB, baseUrl string) error

func UploadRiskToOnline

func UploadRiskToOnline(db *gorm.DB, hash []string) error

func YakScriptLocalTotal added in v1.3.0

func YakScriptLocalTotal(dir []string) int

func YakScriptLocalType added in v1.3.0

func YakScriptLocalType(dirName string) string

func YakitNewCheckDNSLogByToken

func YakitNewCheckDNSLogByToken(runtimeID string) func(token string, timeout ...float64) ([]*tpb.DNSLogEvent, error)

func YakitNewCheckHTTPLogByToken

func YakitNewCheckHTTPLogByToken(runtimeID string) func(token string, timeout ...float64) ([]*tpb.HTTPRequestTriggerNotification, error)

func YakitNewCheckICMPTriggerByLength

func YakitNewCheckICMPTriggerByLength(runtimeID string) func(i int) (*tpb.ICMPTriggerNotification, error)

func YakitNewCheckRandomTriggerByToken

func YakitNewCheckRandomTriggerByToken(runtimeID string) func(t string) (*tpb.RandomPortTriggerEvent, error)

func YieldAliveHostRuntimeId added in v1.2.7

func YieldAliveHostRuntimeId(db *gorm.DB, ctx context.Context, runtimeId string) chan *schema.AliveHost

func YieldDomains

func YieldDomains(db *gorm.DB, ctx context.Context) chan *schema.Domain

func YieldGeneralStorages

func YieldGeneralStorages(db *gorm.DB, ctx context.Context) chan *schema.GeneralStorage

func YieldHTTPFlows

func YieldHTTPFlows(db *gorm.DB, ctx context.Context) chan *schema.HTTPFlow

func YieldHTTPUrl

func YieldHTTPUrl(db *gorm.DB, ctx context.Context) chan *HTTPFlowUrl

func YieldHosts

func YieldHosts(db *gorm.DB, ctx context.Context) chan *schema.Host

func YieldPayloads

func YieldPayloads(db *gorm.DB, ctx context.Context) chan *schema.Payload

func YieldPorts

func YieldPorts(db *gorm.DB, ctx context.Context) chan *schema.Port

func YieldProject

func YieldProject(db *gorm.DB, ctx context.Context) chan *schema.Project

func YieldRisks

func YieldRisks(db *gorm.DB, ctx context.Context) chan *schema.Risk

func YieldRisksByCreateAt

func YieldRisksByCreateAt(db *gorm.DB, ctx context.Context, timestamp int64) chan *schema.Risk

func YieldRisksByRuntimeId

func YieldRisksByRuntimeId(db *gorm.DB, ctx context.Context, runtimeId string) chan *schema.Risk

func YieldRisksByTarget

func YieldRisksByTarget(db *gorm.DB, ctx context.Context, target string) chan *schema.Risk

func YieldSimplePorts

func YieldSimplePorts(db *gorm.DB, ctx context.Context) chan *SimplePort

func YieldWebFuzzerResponseByTaskIDs added in v1.2.8

func YieldWebFuzzerResponseByTaskIDs(db *gorm.DB, ctx context.Context, taskIDs []uint, oks ...bool) chan *schema.WebFuzzerResponse

func YieldWebFuzzerResponses

func YieldWebFuzzerResponses(db *gorm.DB, ctx context.Context, id int) chan *schema.WebFuzzerResponse

func YieldYakScripts

func YieldYakScripts(db *gorm.DB, ctx context.Context) chan *schema.YakScript

YieldYakScripts no use spec, checking

calling

Types

type AliveHostParamsOpt added in v1.2.7

type AliveHostParamsOpt func(r *schema.AliveHost)

type CreateHTTPFlowConfig added in v1.3.2

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

type CreateHTTPFlowOptions added in v1.3.2

type CreateHTTPFlowOptions func(c *CreateHTTPFlowConfig)

func CreateHTTPFlowWithFixResponseRaw added in v1.3.2

func CreateHTTPFlowWithFixResponseRaw(fixRspRaw []byte) CreateHTTPFlowOptions

如果传入了fixRspRaw,则不会再修复

func CreateHTTPFlowWithHTTPS added in v1.3.2

func CreateHTTPFlowWithHTTPS(isHttps bool) CreateHTTPFlowOptions

func CreateHTTPFlowWithRemoteAddr added in v1.3.2

func CreateHTTPFlowWithRemoteAddr(remoteAddr string) CreateHTTPFlowOptions

func CreateHTTPFlowWithRequestIns added in v1.3.2

func CreateHTTPFlowWithRequestIns(reqIns *http.Request) CreateHTTPFlowOptions

如果传入了RequestIns,则优先使用这个作为NewFuzzRequest的参数

func CreateHTTPFlowWithRequestRaw added in v1.3.2

func CreateHTTPFlowWithRequestRaw(reqRaw []byte) CreateHTTPFlowOptions

func CreateHTTPFlowWithResponseRaw added in v1.3.2

func CreateHTTPFlowWithResponseRaw(rspRaw []byte) CreateHTTPFlowOptions

func CreateHTTPFlowWithRuntimeID

func CreateHTTPFlowWithRuntimeID(runtimeId string) CreateHTTPFlowOptions

func CreateHTTPFlowWithSource added in v1.3.2

func CreateHTTPFlowWithSource(source string) CreateHTTPFlowOptions

func CreateHTTPFlowWithTags

func CreateHTTPFlowWithTags(tags string) CreateHTTPFlowOptions

func CreateHTTPFlowWithURL added in v1.3.2

func CreateHTTPFlowWithURL(url string) CreateHTTPFlowOptions

type DbExecFunc

type DbExecFunc func(db *gorm.DB) error

type DuplexConnectionHandler

type DuplexConnectionHandler func(context.Context, *ypb.DuplexConnectionRequest) error

type DuplexConnectionServer

type DuplexConnectionServer struct {
	Handlers map[string]DuplexConnectionHandler
	// contains filtered or unexported fields
}

func (*DuplexConnectionServer) RegisterHandler

func (s *DuplexConnectionServer) RegisterHandler(handlerName string, handler DuplexConnectionHandler)

func (*DuplexConnectionServer) Server

func (*DuplexConnectionServer) UnRegisterHandler

func (s *DuplexConnectionServer) UnRegisterHandler(handlerName string)

type EnterpriseDetails

type EnterpriseDetails struct {
	gorm.Model

	// 社会信用识别码
	SocialCreditCode string `json:"social_credit_code" gorm:"unique_index"`
	TaxCode          string `json:"tax_code"` // 纳税人识别码
	OrgCode          string `json:"org_code"` // 企业机构代码
	BizCode          string `json:"biz_code"` // 工商注册码

	ControllerSocialCreditCode string `json:"controller_social_credit_code"`
	ControllerHoldingPercent   string `json:"controller_holding_percent"`

	//
	SearchKeyword string `json:"keyword"`
	DomainKeyword string `json:"domain_keyword"`

	ExtraJSON string `json:"extra_json"`
}

type HTTPFlowUrl

type HTTPFlowUrl struct {
	Url string `json:"url"`
}

type MatchInfo added in v1.3.3

type MatchInfo struct {
	Raw    []byte
	Offset int
}

type MatchResult added in v1.3.3

type MatchResult struct {
	*regexp2.Match
	IsMatchRequest bool
	MatchInfo      *MatchInfo
}

type ModuleType

type ModuleType struct {
	Name      string `json:"name"`
	VerboseCN string `json:"verbose_cn"`
	VerboseEn string `json:"verbose_en"`
	External  bool   `json:"external"`
	Dir       string `json:"dir"`
}

type PacketInfo added in v1.3.3

type PacketInfo struct {
	IsRequest     bool
	GzipHeader    string
	ChunkedHeader string
	Method        string
	RequestURI    string
	Proto         string
	Headers       [][2]string
	Cookies       []*http.Cookie
	HeaderRaw     string
	BodyRaw       []byte
	Raw           []byte
}

type Paging added in v1.2.9

type Paging struct {
	OrderBy string
	Order   string
	Page    int
	Limit   int
}

func NewPaging added in v1.2.9

func NewPaging() *Paging

type PluginScanFilter added in v1.3.2

type PluginScanFilter struct {
	ExcludePluginScanURIs []string
	IncludePluginScanURIs []string
}

type PortsTypeGroup added in v1.2.2

type PortsTypeGroup struct {
	Nginx                   int32
	Apache                  int32
	IIS                     int32
	Litespeed               int32
	Tomcat                  int32
	ApacheTrafficServer     int32
	OracleHTTPServer        int32
	Openresty               int32
	Jetty                   int32
	Caddy                   int32
	Gunicorn                int32
	Cowboy                  int32
	Lighttpd                int32
	Resin                   int32
	Zeus                    int32
	Cherrypy                int32
	Tengine                 int32
	Glassfish               int32
	PhusionPassenger        int32
	Tornadoserver           int32
	Hiawatha                int32
	OracleApplicationServer int32
	AbyssWebServer          int32
	Boa                     int32
	Xitami                  int32
	Simplehttp              int32
	Cherokee                int32
	MonkeyHTTPServer        int32
	NodeJS                  int32
	Websphere               int32
	Zope                    int32
	Mongoose                int32
	Macos                   int32
	Kestrel                 int32
	Aolserver               int32
	Dnsmasq                 int32
	Ruby                    int32
	Webrick                 int32
	WeblogicServer          int32
	Jboss                   int32
	SqlServer               int32
	Mysql                   int32
	Mongodb                 int32
	Redis                   int32
	Elasticsearch           int32
	Postgresql              int32
	DB2                     int32
	Hbase                   int32
	Memcached               int32
	Splunkd                 int32
}

func PortsServiceTypeGroup added in v1.2.2

func PortsServiceTypeGroup() ([]*PortsTypeGroup, error)

type RiskParamsOpt

type RiskParamsOpt func(r *schema.Risk)

func WithRiskParam_CVE

func WithRiskParam_CVE(s string) RiskParamsOpt

func WithRiskParam_Description

func WithRiskParam_Description(i string) RiskParamsOpt

func WithRiskParam_Details

func WithRiskParam_Details(i interface{}) RiskParamsOpt

func WithRiskParam_FromScript

func WithRiskParam_FromScript(i string) RiskParamsOpt

func WithRiskParam_Ignore added in v1.2.6

func WithRiskParam_Ignore(i bool) RiskParamsOpt

func WithRiskParam_Parameter

func WithRiskParam_Parameter(i string) RiskParamsOpt

func WithRiskParam_Payload

func WithRiskParam_Payload(i string) RiskParamsOpt

func WithRiskParam_Potential

func WithRiskParam_Potential(i bool) RiskParamsOpt

func WithRiskParam_Request

func WithRiskParam_Request(i interface{}) RiskParamsOpt

func WithRiskParam_Response

func WithRiskParam_Response(i interface{}) RiskParamsOpt

func WithRiskParam_RiskType

func WithRiskParam_RiskType(i string) RiskParamsOpt

func WithRiskParam_RiskVerbose

func WithRiskParam_RiskVerbose(i string) RiskParamsOpt

func WithRiskParam_RuntimeId

func WithRiskParam_RuntimeId(i string) RiskParamsOpt

func WithRiskParam_Severity

func WithRiskParam_Severity(i string) RiskParamsOpt

func WithRiskParam_Solution

func WithRiskParam_Solution(i string) RiskParamsOpt

func WithRiskParam_Title

func WithRiskParam_Title(i string) RiskParamsOpt

func WithRiskParam_TitleVerbose

func WithRiskParam_TitleVerbose(i string) RiskParamsOpt

func WithRiskParam_Token

func WithRiskParam_Token(i string) RiskParamsOpt

func WithRiskParam_YakScriptUUID

func WithRiskParam_YakScriptUUID(i string) RiskParamsOpt

func WithRiskParam_YakitPluginName

func WithRiskParam_YakitPluginName(i string) RiskParamsOpt

type SimplePort

type SimplePort struct {
	Host string
	Port int
}

type StoreMeta

type StoreMeta struct {
	Types []ModuleType `json:"types"`
}

type TagAndStatusCode

type TagAndStatusCode struct {
	Value string
	Count int
}

func HTTPFlowTags

func HTTPFlowTags(refreshRequest bool) ([]*TagAndStatusCode, error)

type TagAndTypeValue

type TagAndTypeValue struct {
	Value        string
	Count        int
	TemporaryId  string
	IsPocBuiltIn bool
}

func GroupCount added in v1.3.1

func GroupCount(db *gorm.DB) (req []*TagAndTypeValue, err error)

func QueryGroupCount added in v1.3.3

func QueryGroupCount(db *gorm.DB, excludeType []string) (req []*TagAndTypeValue, err error)

func YakScriptTags

func YakScriptTags(db *gorm.DB, where string, havingWhere string) (req []*TagAndTypeValue, err error)

func YakScriptType

func YakScriptType(db *gorm.DB) (req []*TagAndTypeValue, err error)

type TrafficStorageManager added in v1.2.8

type TrafficStorageManager struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewTrafficStorageManager added in v1.2.8

func NewTrafficStorageManager(db *gorm.DB) *TrafficStorageManager

func (*TrafficStorageManager) CloseTCPFlow added in v1.2.8

func (m *TrafficStorageManager) CloseTCPFlow(flow *pcaputil.TrafficFlow, force bool) error

func (*TrafficStorageManager) CreateHTTPFlow added in v1.2.8

func (m *TrafficStorageManager) CreateHTTPFlow(flow *pcaputil.TrafficFlow, req *http.Request, rsp *http.Response) error

func (*TrafficStorageManager) CreateTCPReassembledFlow added in v1.2.8

func (m *TrafficStorageManager) CreateTCPReassembledFlow(flow *pcaputil.TrafficFlow) error

func (*TrafficStorageManager) FetchSession added in v1.2.8

func (m *TrafficStorageManager) FetchSession(hash string, packet gopacket.Packet, tpacket *schema.TrafficPacket, typeStr string, noCreate bool) (*schema.TrafficSession, error)

func (*TrafficStorageManager) SaveRawPacket added in v1.2.8

func (m *TrafficStorageManager) SaveRawPacket(packet gopacket.Packet) error

func (*TrafficStorageManager) SaveTCPReassembledFrame added in v1.2.8

func (m *TrafficStorageManager) SaveTCPReassembledFrame(flow *pcaputil.TrafficFlow, frame *pcaputil.TrafficFrame) error

type WebsiteNextPart added in v1.2.9

type WebsiteNextPart struct {
	Schema       string
	NextPart     string
	HaveChildren bool
	Count        int
	IsQuery      bool
	RawQueryKey  string
	RawNextPart  string
	IsFile       bool
}

func GetHTTPFlowDomainsByDomainSuffix added in v1.2.9

func GetHTTPFlowDomainsByDomainSuffix(db *gorm.DB, domainSuffix string) []*WebsiteNextPart

func GetHTTPFlowNextPartPathByPathPrefix added in v1.2.9

func GetHTTPFlowNextPartPathByPathPrefix(db *gorm.DB, originPathPrefix string) []*WebsiteNextPart

type WebsiteTree added in v1.2.9

type WebsiteTree struct {
	Path         string
	NextParts    []*WebsiteNextPart
	HaveChildren bool
}

type YakModuleMeta

type YakModuleMeta struct {
	ModuleName           string           `json:"name" yaml:"name"`
	Tags                 []string         `json:"tags" yaml:"tags"`
	Help                 string           `json:"help" yaml:"help"`
	Author               string           `json:"author" yaml:"author"`
	ModuleFile           string           `json:"module_file" yaml:"module_file"`
	Params               []YakModuleParam `json:"params" yaml:"params"`
	Document             string           `json:"document" yaml:"document"`
	GeneralModuleVerbose string           `json:"general_module_verbose" yaml:"general_module_verbose"`
	GeneralModuleKey     string           `json:"general_module_key" yaml:"general_module_key"`
	IsGeneralModule      bool             `json:"is_general_module" yaml:"is_general_module"`
	EnablePluginSelector bool             `json:"enable_plugin_selector" yaml:"enable_plugin_selector"`
	PluginSelectorTypes  string           `json:"plugin_selector_types" yaml:"plugin_selector_types"`
}

type YakModuleParam

type YakModuleParam struct {
	Name         string `json:"name" yaml:"name"`
	Verbose      string `json:"verbose" yaml:"verbose"`
	Description  string `json:"description" yaml:"description"`
	Type         string `json:"type" yaml:"type"`
	DefaultValue string `json:"default_value" yaml:"default_value"`
	Required     bool   `json:"required" yaml:"required"`
	Group        string `json:"group" yaml:"group"`
	ExtraSetting string `json:"extra_setting" yaml:"extra_setting"`
}

Jump to

Keyboard shortcuts

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