controllers

package
v0.0.0-...-2dbdbee Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 37 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Success = "success"
	Fail    = "fail"
)
View Source
const (
	SuperAdmin = "superadmin"
	Admin      = "admin"
	Guest      = "guest"
)
View Source
const (
	HoneyPot               string = "honeypot"
	IPLocation             string = "iplocation"
	IPLocationB            string = "iplocationB"
	IPLocationC            string = "iplocationC"
	Service                string = "service"
	Xray                   string = "xray"
	XrayConfig             string = "config.xray"
	XrayPlugin             string = "plugin.xray"
	XrayModule             string = "module.xray"
	BlackDomain            string = "black_domain"
	BlackIP                string = "black_ip"
	TaskWorkspace          string = "task_workspace"
	FOFAFilterKeyword      string = "fofa_filter_keyword"
	FOFAFilterKeywordLocal string = "fofa_filter_keyword_local"
)

Variables

View Source
var (
	// OnlineUserMutex 在线用户Mutex
	OnlineUserMutex sync.Mutex
	// OnlineUser 在线用户信息
	OnlineUser = make(map[string]*OnlineUserInfo)
)

Functions

func FormatDateTime

func FormatDateTime(dt time.Time) string

FormatDateTime 日期统一格式化

func FormatSubDateTime

func FormatSubDateTime(dt time.Time) string

FormatSubDateTime 统一格式化当前时间间隔

func GenerateToken

func GenerateToken(data TokenData) (tokenString string, err error)

GenerateToken 生成新的Token

func GetTokenValueFromHeader

func GetTokenValueFromHeader(tokenString string) string

GetTokenValueFromHeader 从header中提取token值

func ProcessPasswordHash

func ProcessPasswordHash(password string) string

ProcessPasswordHash 根据明文密码生成带salt的hash密码

func SetTokenValueToHeader

func SetTokenValueToHeader(tokenString string) string

SetTokenValueToHeader 生成header中的token值

func UpdatePassword

func UpdatePassword(userName, oldPassword, newPassword string) bool

UpdatePassword 更新密码

func ValidLoginUser

func ValidLoginUser(username, password string) (bool, db.User)

ValidLoginUser 校验用户名和密码

Types

type AccessLogController

type AccessLogController struct {
	BaseController
}

func (*AccessLogController) AccessLogFilesAction

func (c *AccessLogController) AccessLogFilesAction()

AccessLogFilesAction 获取日志文件列表

func (*AccessLogController) IndexAction

func (c *AccessLogController) IndexAction()

IndexAction 显示列表页

func (*AccessLogController) ListAction

func (c *AccessLogController) ListAction()

ListAction 列表的数据

type BaseController

type BaseController struct {
	web.Controller
	IsServerAPI bool //server工作模式是否是api方式
}

func (*BaseController) CheckMultiAccessRequest

func (c *BaseController) CheckMultiAccessRequest(roleList []RequestRole, forceRedirect bool) (isPermit bool)

CheckMultiAccessRequest 检查用户当前登录是否满足请求的角色要求

func (*BaseController) CheckOneAccessRequest

func (c *BaseController) CheckOneAccessRequest(role RequestRole, forceRedirect bool) (isPermit bool)

CheckOneAccessRequest 检查用户当前登录是否满足请求的角色要求

func (*BaseController) DeleteOnlineUser

func (c *BaseController) DeleteOnlineUser()

DeleteOnlineUser 用户注销或过期,清除在线用户

func (*BaseController) FailedStatus

func (c *BaseController) FailedStatus(msg string)

FailedStatus 返回fail结果的JSON格式消息

func (*BaseController) GetCurrentUser

func (c *BaseController) GetCurrentUser() (userName string)

GetCurrentUser 获取保存在session或jwt中的username

func (*BaseController) GetCurrentWorkspace

func (c *BaseController) GetCurrentWorkspace() (workspaceId int)

GetCurrentWorkspace 获取保存在session或jwt中的workspaceId

func (*BaseController) GetCurrentWorkspaceGUID

func (c *BaseController) GetCurrentWorkspaceGUID() (workspaceGUID string)

GetCurrentWorkspaceGUID 根据获取保存在session或jwt中的workspaceId,获取GUID

func (*BaseController) GetGlobalSessionData

func (c *BaseController) GetGlobalSessionData() GlobalSessionData

func (*BaseController) GetJWTTokenValue

func (c *BaseController) GetJWTTokenValue() string

GetJWTTokenValue 从header中获取验证的token

func (*BaseController) MakeStatusResponse

func (c *BaseController) MakeStatusResponse(isSuccess bool)

MakeStatusResponse 生成默认的状态返回JSON

func (*BaseController) Prepare

func (c *BaseController) Prepare()

func (*BaseController) SucceededStatus

func (c *BaseController) SucceededStatus(msg string)

SucceededStatus 返回success结果的JSON格式消息

func (*BaseController) UpdateOnlineUser

func (c *BaseController) UpdateOnlineUser()

UpdateOnlineUser 更新在线用户IP和时间

type ConfigController

type ConfigController struct {
	BaseController
}

func (*ConfigController) ChangePasswordAction

func (c *ConfigController) ChangePasswordAction()

ChangePasswordAction 修改密码

func (*ConfigController) CustomAction

func (c *ConfigController) CustomAction()

func (*ConfigController) IndexServerAction

func (c *ConfigController) IndexServerAction()

func (*ConfigController) IndexWorkerAction

func (c *ConfigController) IndexWorkerAction()

func (*ConfigController) LoadCustomConfigAction

func (c *ConfigController) LoadCustomConfigAction()

LoadCustomConfigAction 加载一个自定义文件

func (*ConfigController) LoadDefaultConfigAction

func (c *ConfigController) LoadDefaultConfigAction()

LoadDefaultConfigAction 获取默认的worker扫描使用的配置参数

func (*ConfigController) LoadServerConfigAction

func (c *ConfigController) LoadServerConfigAction()

LoadServerConfigAction 获取Server的管理的参数

func (*ConfigController) LoadWorkerConfigAction

func (c *ConfigController) LoadWorkerConfigAction()

LoadWorkerConfigAction 获取worker的参数

func (*ConfigController) SaveAPITokenAction

func (c *ConfigController) SaveAPITokenAction()

SaveAPITokenAction 保存API的Token

func (*ConfigController) SaveCustomConfigAction

func (c *ConfigController) SaveCustomConfigAction()

SaveCustomConfigAction 保存一个自定义文件

func (*ConfigController) SaveCustomTaskWorkspaceConfigAction

func (c *ConfigController) SaveCustomTaskWorkspaceConfigAction()

SaveCustomTaskWorkspaceConfigAction 保存自定义任务的GUID,然后server重新加载

func (*ConfigController) SaveDomainscanAction

func (c *ConfigController) SaveDomainscanAction()

SaveDomainscanAction 保存默认域名任务的设置

func (*ConfigController) SaveFingerprintAction

func (c *ConfigController) SaveFingerprintAction()

SaveFingerprintAction 保存默认指纹设置

func (*ConfigController) SavePortscanAction

func (c *ConfigController) SavePortscanAction()

SavePortscanAction 保存默认端口扫描设置

func (*ConfigController) SaveTaskNotifyAction

func (c *ConfigController) SaveTaskNotifyAction()

SaveTaskNotifyAction 保存任务通知的Token设置

func (*ConfigController) SaveTaskSliceNumberAction

func (c *ConfigController) SaveTaskSliceNumberAction()

SaveTaskSliceNumberAction 保存任务切分设置

func (*ConfigController) SaveWikiFeishuAction

func (c *ConfigController) SaveWikiFeishuAction()

SaveWikiFeishuAction 保存知识库的设置

func (*ConfigController) SaveWorkerProxyAction

func (c *ConfigController) SaveWorkerProxyAction()

SaveWorkerProxyAction 保存worker代理设置

func (*ConfigController) TestOnlineAPIKeyAction

func (c *ConfigController) TestOnlineAPIKeyAction()

TestOnlineAPIKeyAction 在线测试API的key是否可用

func (*ConfigController) TestTaskNotifyAction

func (c *ConfigController) TestTaskNotifyAction()

TestTaskNotifyAction 测试任务通知

func (*ConfigController) UploadPocAction

func (c *ConfigController) UploadPocAction()

UploadPocAction xraypoc的上传

type DashboardController

type DashboardController struct {
	BaseController
}

func (*DashboardController) GetStartedTaskInfoAction

func (c *DashboardController) GetStartedTaskInfoAction()

GetStartedTaskInfoAction 获取正在执行的任务数据

func (*DashboardController) GetStatisticDataAction

func (c *DashboardController) GetStatisticDataAction()

GetStatisticDataAction 获取统计信息

func (*DashboardController) GetTaskInfoAction

func (c *DashboardController) GetTaskInfoAction()

GetTaskInfoAction 获取任务数据

func (*DashboardController) IndexAction

func (c *DashboardController) IndexAction()

IndexAction dashboard首页

func (*DashboardController) OnlineUserListAction

func (c *DashboardController) OnlineUserListAction()

OnlineUserListAction 获取在线用户数据,用于Dashboard表表显示

type DashboardStatisticData

type DashboardStatisticData struct {
	IP            int `json:"ip_count"`
	Domain        int `json:"domain_count"`
	Vulnerability int `json:"vulnerability_count"`
	ActiveTask    int `json:"task_active"`
	Worker        int `json:"worker_count"`
}

type DataTableResponseData

type DataTableResponseData struct {
	Draw            int           `json:"draw"`
	RecordsTotal    int           `json:"recordsTotal"`
	RecordsFiltered int           `json:"recordsFiltered"`
	Data            []interface{} `json:"data"`
}

DataTableResponseData DataTable列表的返回数据

type DatableRequestParam

type DatableRequestParam struct {
	Draw   int `form:"draw"`
	Start  int `form:"start"`
	Length int `form:"length"`
}

DatableRequestParam DataTable列表的请求数据的公共部份

type DefaultConfig

type DefaultConfig struct {
	//portscan
	CmdBin string `json:"cmdbin" form:"cmdbin"`
	Port   string `json:"port" form:"port"`
	Rate   int    `json:"rate" form:"rate"`
	Tech   string `json:"tech" form:"tech"`
	IsPing bool   `json:"ping" form:"ping"`
	//task
	IpSliceNumber   int    `json:"ipslicenumber" form:"ipslicenumber"`
	PortSliceNumber int    `json:"portslicenumber" form:"portslicenumber"`
	Version         string `json:"version" form:"version"`
	TaskWorkspace   string `json:"taskworkspace" form:"taskworkspace"`
	//fingerprint
	IsHttpx          bool `json:"httpx" form:"httpx"`
	IsScreenshot     bool `json:"screenshot" form:"screenshot"`
	IsFingerprintHub bool `json:"fingerprinthub" form:"fingerprinthub"`
	IsIconHash       bool `json:"iconhash" form:"iconhash"`
	IsFingerprintx   bool `json:"fingerprintx" form:"fingerprintx"`
	// onlineapi
	IsFofa           bool   `json:"fofa" form:"fofa"`
	IsQuake          bool   `json:"quake" form:"quake"`
	IsHunter         bool   `json:"hunter" form:"hunter"`
	ServerChanToken  string `json:"serverchan" form:"serverchan"`
	DingTalkToken    string `json:"dingtalk" form:"dingtalk"`
	FeishuToken      string `json:"feishu" form:"feishu"`
	FofaToken        string `json:"fofatoken" form:"fofatoken"`
	HunterToken      string `json:"huntertoken" form:"huntertoken"`
	QuakeToken       string `json:"quaketoken" form:"quaketoken"`
	ChinazToken      string `json:"chinaztoken" form:"chinaztoken"`
	SearchPageSize   int    `json:"pagesize" form:"pagesize"`
	SearchLimitCount int    `json:"limitcount" form:"limitcount"`
	// domainscan
	Wordlist           string `json:"wordlist" form:"wordlist"`
	IsSubDomainFinder  bool   `json:"subfinder" form:"subfinder"`
	IsSubDomainBrute   bool   `json:"subdomainbrute" form:"subdomainbrute"`
	IsSubDomainCrawler bool   `json:"subdomaincrawler" form:"subdomaincrawler"`
	IsIgnoreCDN        bool   `json:"ignorecdn" form:"ignorecdn"`
	IsIgnoreOutofChina bool   `json:"ignoreoutofchina" form:"ignoreoutofchina"`
	IsPortscan         bool   `json:"portscan" form:"portscan"`
	IsWhois            bool   `json:"whois" form:"whois"`
	IsICP              bool   `json:"icp" form:"icp"`
	// proxy
	ProxyList string `json:"proxyList" form:"proxyList"`
	// wiki:feishu
	FeishuAppId        string `json:"feishuappid" form:"feishuappid"`
	FeishuAppSecret    string `json:"feishusecret" form:"feishuappsecret"`
	FeishuRefreshToken string `json:"feishurefreshtoken" form:"feishurefreshtoken"`
}

type DocumentInfo

type DocumentInfo struct {
	Id             int    `json:"id"`
	Index          int    `json:"index"`
	Title          string `json:"title"`
	SpaceId        string `json:"space_id"`
	NodeToken      string `json:"node_token"`
	Comment        string `json:"comment"`
	PinIndex       int    `json:"pin_index"`
	ExportPathFile string `json:"export"`
	CreateTime     string `json:"create_time"`
	UpdateTime     string `json:"update_time"`
}

type DomainAttrFullInfo

type DomainAttrFullInfo struct {
	IP            map[string]struct{}
	TitleSet      map[string]int
	BannerSet     map[string]int
	FingerSet     map[string]struct{}
	StatusCodeSet map[string]struct{}
	DomainAttr    []DomainAttrInfo
	IconImageSet  map[string]string
	TlsData       map[string]struct{}
	SourceSet     map[string]struct{}
	DomainCDN     string
	DomainCNAME   string
}

DomainAttrFullInfo domain属性数据的聚合

type DomainAttrInfo

type DomainAttrInfo struct {
	Id         int    `json:"id"`
	DomainId   int    `json:"domainId"`
	Port       int    `json:"port"`
	Tag        string `json:"tag"`
	Content    string `json:"content"`
	CreateTime string `json:"create_datetime"`
	UpdateTime string `json:"update_datetime"`
}

DomainAttrInfo domain属性

type DomainController

type DomainController struct {
	BaseController
}

func (*DomainController) BlockDomainAction

func (c *DomainController) BlockDomainAction()

BlockDomainAction 一键拉黑域名

func (*DomainController) DeleteDomainAction

func (c *DomainController) DeleteDomainAction()

DeleteDomainAction 删除一个记录

func (*DomainController) DeleteDomainAttrAction

func (c *DomainController) DeleteDomainAttrAction()

DeleteDomainAttrAction 删除一个域名的属性

func (*DomainController) DeleteDomainOnlineAPIAttrAction

func (c *DomainController) DeleteDomainOnlineAPIAttrAction()

DeleteDomainOnlineAPIAttrAction 删除fofa等属性

func (*DomainController) ExportDomainResultAction

func (c *DomainController) ExportDomainResultAction()

ExportDomainResultAction 导出Domain资产

func (*DomainController) ExportMemoAction

func (c *DomainController) ExportMemoAction()

ExportMemoAction 导出备忘录信息

func (*DomainController) GetMemoAction

func (c *DomainController) GetMemoAction()

GetMemoAction 获取指定IP的备忘录信息

func (*DomainController) IndexAction

func (c *DomainController) IndexAction()

IndexAction index

func (*DomainController) InfoAction

func (c *DomainController) InfoAction()

InfoAction 一个域名的详细数据

func (*DomainController) InfoHttpAction

func (c *DomainController) InfoHttpAction()

InfoHttpAction 获取指定的http信息

func (*DomainController) ListAction

func (c *DomainController) ListAction()

ListAction Datable列表数据

func (*DomainController) MarkColorTagAction

func (c *DomainController) MarkColorTagAction()

MarkColorTagAction 颜色标记

func (*DomainController) PinTopAction

func (c *DomainController) PinTopAction()

PinTopAction 置顶/取消在列表中的置顶显示

func (*DomainController) StatisticsAction

func (c *DomainController) StatisticsAction()

StatisticsAction 域名的统计信息

func (*DomainController) UpdateMemoAction

func (c *DomainController) UpdateMemoAction()

UpdateMemoAction 更新指定IP的备忘录信息

type DomainExportInfo

type DomainExportInfo struct {
	Domain      string
	IP          []string
	Port        []string
	StatusCode  []string
	Title       []string
	Finger      []string
	Banner      []string
	TlsData     []string
	Source      []string
	IsIPCDN     bool
	DomainCDN   string
	DomainCNAME string
}

DomainExportInfo domain输出的详细数据聚合

type DomainInfo

type DomainInfo struct {
	Id            int
	Domain        string
	Organization  string
	IP            []string
	Port          []int
	PortAttr      []PortAttrInfo
	Finger        []string
	StatusCode    []string
	Title         map[string]int
	Banner        map[string]int
	TitleString   string
	BannerString  string
	ColorTag      string
	Memo          string
	Vulnerability []VulnerabilityInfo
	CreateTime    string
	UpdateTime    string
	Screenshot    []ScreenshotFileInfo
	DomainAttr    []DomainAttrInfo
	DisableFofa   bool
	IconHashes    []IconHashWithFofa
	TlsData       []string
	DomainCDN     string
	DomainCNAME   string
	Workspace     string
	WorkspaceGUID string
	PinIndex      string
	Source        []string
	WikiDocs      []DocumentInfo
}

DomainInfo domain详细数据聚合

type DomainListData

type DomainListData struct {
	Id             int            `json:"id"`
	Index          int            `json:"index"`
	FldDomain      string         `json:"fld_domain"`
	Domain         string         `json:"domain"`
	IP             []string       `json:"ip"`
	Port           []int          `json:"port"`
	StatusCode     []string       `json:"statuscode"`
	Title          map[string]int `json:"title"`
	Banner         map[string]int `json:"banner"`
	ColorTag       string         `json:"color_tag"`
	MemoContent    string         `json:"memo_content"`
	Vulnerability  string         `json:"vulnerability"`
	HoneyPot       string         `json:"honeypot"`
	ScreenshotFile []string       `json:"screenshot"`
	DomainCDN      string         `json:"domaincdn"`
	DomainCNAME    string         `json:"domaincname"`
	IsIPCDN        bool           `json:"ipcdn"`
	IconImage      []string       `json:"iconimage"`
	WorkspaceId    int            `json:"workspace"`
	WorkspaceGUID  string         `json:"workspace_guid"`
	PinIndex       int            `json:"pinindex"`
	WikiDocs       string         `json:"wiki_docs"`
}

DomainListData datable显示的每一行数据

type DomainStatisticInfo

type DomainStatisticInfo struct {
	Domain    map[string][]string
	DomainIP  map[string]string
	Subdomain map[string]int
	IP        map[string]int
	IPSubnet  map[string]int
}

DomainStatisticInfo domain统计信息

type GlobalSessionData

type GlobalSessionData struct {
	IpAddressIp     string `json:"ip_address_ip"`
	IpAddressDomain string `json:"ip_address_domain"`
	DomainAddress   string `json:"domain_address"`
	Port            string `json:"port"`
	OrgId           string `json:"session_org_id"`
}

GlobalSessionData 用于保存查询过程中的一些参数

type IPController

type IPController struct {
	BaseController
}

func (*IPController) BlackIPAction

func (c *IPController) BlackIPAction()

BlackIPAction 一键拉黑一个IP

func (*IPController) DeleteIPAction

func (c *IPController) DeleteIPAction()

DeleteIPAction 删除一个IP记录

func (*IPController) DeletePortAttrAction

func (c *IPController) DeletePortAttrAction()

DeletePortAttrAction 删除一个Port属性值

func (*IPController) ExportIPResultAction

func (c *IPController) ExportIPResultAction()

ExportIPResultAction 导出IP资产

func (*IPController) ExportMemoAction

func (c *IPController) ExportMemoAction()

ExportMemoAction 导出IP备忘录信息

func (*IPController) GetIPListData

func (c *IPController) GetIPListData(req ipRequestParam) (resp DataTableResponseData)

GetIPListData 获取IP列表显示的数据

func (*IPController) GetMemoAction

func (c *IPController) GetMemoAction()

GetMemoAction 获取指定IP的备忘录信息

func (*IPController) ImportPortscanResultAction

func (c *IPController) ImportPortscanResultAction()

ImportPortscanResultAction 导入portscan扫描结果

func (*IPController) IndexAction

func (c *IPController) IndexAction()

IndexAction GET请求显示页面

func (*IPController) InfoAction

func (c *IPController) InfoAction()

InfoAction 一个IP的详细情况

func (*IPController) InfoHttpAction

func (c *IPController) InfoHttpAction()

InfoHttpAction 获取指定的http信息

func (*IPController) ListAction

func (c *IPController) ListAction()

ListAction IP列表

func (*IPController) MarkColorTagAction

func (c *IPController) MarkColorTagAction()

MarkColorTagAction 颜色标记

func (*IPController) PinTopAction

func (c *IPController) PinTopAction()

PinTopAction 置顶/取消在列表中的置顶显示

func (*IPController) StatisticsAction

func (c *IPController) StatisticsAction()

StatisticsAction IP的统计信息

func (*IPController) UpdateMemoAction

func (c *IPController) UpdateMemoAction()

UpdateMemoAction 更新指定IP的备忘录信息

type IPExportInfo

type IPExportInfo struct {
	IP         string
	Port       int
	Location   string
	StatusCode string
	TitleSet   map[string]struct{}
	BannerSet  map[string]struct{}
	FingerSet  map[string]struct{}
	TlsDataSet map[string]struct{}
	HttpxSet   map[string]struct{}
	SourceSet  map[string]struct{}
}

IPExportInfo 用于导出IP数据的信息

type IPInfo

type IPInfo struct {
	Id            int
	IP            string
	IPFormatted   string
	Organization  string
	Status        string
	Location      string
	Port          []int
	Title         map[string]int
	Banner        map[string]int
	TitleString   string
	BannerString  string
	PortAttr      []PortAttrInfo
	Domain        []string
	ColorTag      string
	Memo          string
	Vulnerability []VulnerabilityInfo
	CreateTime    string
	UpdateTime    string
	Screenshot    []ScreenshotFileInfo
	DisableFofa   bool
	IconHashes    []IconHashWithFofa
	TlsData       []string
	Workspace     string
	WorkspaceGUID string
	PinIndex      string
	WikiDocs      []DocumentInfo
}

IPInfo IP的详细数据的集合

type IPListData

type IPListData struct {
	Id             int            `json:"id"`
	Index          int            `json:"index"`
	IP             string         `json:"ip"`
	IPFormatted    string         `json:"ipf"`
	Location       string         `json:"location"`
	Port           []string       `json:"port"`
	Title          map[string]int `json:"title"`
	Banner         map[string]int `json:"banner"`
	ColorTag       string         `json:"color_tag"`
	MemoContent    string         `json:"memo_content"`
	Vulnerability  string         `json:"vulnerability"`
	HoneyPot       string         `json:"honeypot"`
	ScreenshotFile []string       `json:"screenshot"`
	CloudName      string         `json:"cloudname"`
	IsCDN          bool           `json:"cdn"`
	IconImage      []string       `json:"iconimage"`
	WorkspaceId    int            `json:"workspace"`
	WorkspaceGUID  string         `json:"workspace_guid"`
	PinIndex       int            `json:"pinindex"`
	WikiDocs       string         `json:"wiki_docs"`
}

IPListData 列表中每一行显示的IP数据

type IPStatisticInfo

type IPStatisticInfo struct {
	IP       map[string]int
	IPSubnet map[string]int
	Port     map[string]int
	Location map[string]int
}

IPStatisticInfo IP统计信息

type IconHashWithFofa

type IconHashWithFofa struct {
	IconHash  string
	IconImage string
	FofaUrl   string
}

type KeySearchController

type KeySearchController struct {
	BaseController
}

func (*KeySearchController) AddSaveAction

func (c *KeySearchController) AddSaveAction()

AddSaveAction 保存新增的记录

func (*KeySearchController) DeleteKeyWordAction

func (c *KeySearchController) DeleteKeyWordAction()

DeleteKeyWordAction 删除一个记录

func (*KeySearchController) GetAction

func (c *KeySearchController) GetAction()

GetAction 一个记录的详细情况

func (*KeySearchController) IndexAction

func (c *KeySearchController) IndexAction()

func (*KeySearchController) IndexBlackAction

func (c *KeySearchController) IndexBlackAction()

func (*KeySearchController) ListAction

func (c *KeySearchController) ListAction()

ListAction IP列表

func (*KeySearchController) UpdateAction

func (c *KeySearchController) UpdateAction()

UpdateAction 更新记录

type KeyWordInfo

type KeyWordInfo struct {
	Id             int    `json:"id"`
	OrgId          int    `json:"org_id"`
	KeyWord        string `json:"key_word"`
	IsFofa         bool   `json:"fofa"`
	IsHunter       bool   `json:"hunter"`
	IsQuake        bool   `json:"quake"`
	SearchTime     string `json:"search_time"`
	ExcludeWords   string `json:"exclude_words"`
	CheckMod       string `json:"check_mod"`
	IsDelete       bool   `json:"is_delete"`
	Count          int    `json:"count"`
	CreateDatetime string `json:"create_datetime"`
	UpdateDatetime string `json:"update_datetime"`
}

type KeyWordList

type KeyWordList struct {
	Id             int    `json:"id"`
	Index          int    `json:"index"`
	OrgId          string `json:"org_id"`
	KeyWord        string `json:"key_word"`
	Engine         string `json:"engine"`
	SearchTime     string `json:"search_time"`
	ExcludeWords   string `json:"exclude_words"`
	CheckMod       string `json:"check_mod"`
	IsDelete       bool   `json:"is_delete"`
	Count          int    `json:"count"`
	CreateDatetime string `json:"create_datetime"`
	UpdateDatetime string `json:"update_datetime"`
	WorkspaceId    int    `json:"workspace"`
}

type LoginController

type LoginController struct {
	BaseController
}

func (*LoginController) IndexAction

func (c *LoginController) IndexAction()

IndexAction 登录首页

func (*LoginController) LoginAction

func (c *LoginController) LoginAction()

LoginAction 登录验证

func (*LoginController) LogoutAction

func (c *LoginController) LogoutAction()

LogoutAction 退出登录

type MyCustomClaims

type MyCustomClaims struct {
	TokenData
	jwt.RegisteredClaims
}

type OnlineUserInfo

type OnlineUserInfo struct {
	IP           string
	LoginTime    time.Time
	UpdateTime   time.Time
	UpdateNumber int64
}

OnlineUserInfo 在线用户

type OnlineUserInfoData

type OnlineUserInfoData struct {
	Index        int    `json:"index"`
	IP           string `json:"ip"`
	LoginTime    string `json:"login_time"`
	UpdateTime   string `json:"update_time"`
	UpdateNumber int64  `json:"update_number"`
}

type OrganizationController

type OrganizationController struct {
	BaseController
}

func (*OrganizationController) AddIndexAction

func (c *OrganizationController) AddIndexAction()

AddIndexAction 新增页面显示

func (*OrganizationController) AddSaveAction

func (c *OrganizationController) AddSaveAction()

AddSaveAction 保存新增的记录

func (*OrganizationController) DeleteAction

func (c *OrganizationController) DeleteAction()

DeleteAction 删除一条记录

func (*OrganizationController) GetAction

func (c *OrganizationController) GetAction()

GetAction 根据ID获取一个记录

func (*OrganizationController) GetAllAction

func (c *OrganizationController) GetAllAction()

GetAllAction 获取所有的记录

func (*OrganizationController) IndexAction

func (c *OrganizationController) IndexAction()

IndexAction 显示列表页面

func (*OrganizationController) ListAction

func (c *OrganizationController) ListAction()

ListAction 获取列表显示的数据

func (*OrganizationController) UpdateAction

func (c *OrganizationController) UpdateAction()

UpdateAction 更新一个记录

type OrganizationData

type OrganizationData struct {
	Id             int    `json:"id" form:"id"`
	Index          int    `json:"index" form:"-"`
	OrgName        string `json:"org_name" form:"org_name"`
	Status         string `json:"status" form:"status"`
	SortOrder      int    `json:"sort_order" form:"sort_order"`
	CreateDatetime string `json:"create_time" form:"-"`
	UpdateDatetime string `json:"update_time" form:"-"`
	WorkspaceId    int    `json:"workspace"`
}

type OrganizationSelectData

type OrganizationSelectData struct {
	Id      int    `json:"id"`
	OrgName string `json:"name"`
}

type PortAttrInfo

type PortAttrInfo struct {
	Id                 int
	PortId             int
	IP                 string
	IPFormatted        string
	Port               string
	Tag                string
	Content            string
	Source             string
	FofaLink           string
	CreateTime         string
	UpdateTime         string
	TableBackgroundSet bool
}

PortAttrInfo 每一个端口的详细数据

type PortInfo

type PortInfo struct {
	PortNumbers      []int
	PortStatus       map[int]string
	TitleSet         map[string]int
	BannerSet        map[string]int
	PortAttr         []PortAttrInfo
	IconHashImageSet map[string]string
	TlsDataSet       map[string]struct{}
}

PortInfo 端口详细数据的集合

type RequestRole

type RequestRole string

type RuntimeLogController

type RuntimeLogController struct {
	BaseController
}

func (*RuntimeLogController) BatchDeleteAction

func (c *RuntimeLogController) BatchDeleteAction()

BatchDeleteAction 批量清除记录

func (*RuntimeLogController) DeleteAction

func (c *RuntimeLogController) DeleteAction()

DeleteAction 删除一个记录

func (*RuntimeLogController) IndexAction

func (c *RuntimeLogController) IndexAction()

func (*RuntimeLogController) InfoAction

func (c *RuntimeLogController) InfoAction()

InfoAction 显示一个详情

func (*RuntimeLogController) ListAction

func (c *RuntimeLogController) ListAction()

ListAction 列表的数据

type RuntimeLogData

type RuntimeLogData struct {
	Id         int    `json:"id"`
	Index      int    `json:"index"`
	Source     string `json:"source"`
	File       string `json:"file"`
	Func       string `json:"func"`
	Level      string `json:"level"`
	Message    string `json:"message"`
	CreateTime string `json:"create_datetime"`
	UpdateTime string `json:"update_datetime"`
}

type RuntimeLogInfo

type RuntimeLogInfo struct {
	Id         int
	Source     string
	File       string
	Func       string
	Level      string
	Message    string
	CreateTime string
	UpdateTime string
}

type ScreenshotFileInfo

type ScreenshotFileInfo struct {
	ScreenShotFile          string
	ScreenShotThumbnailFile string
	Tooltip                 string
}

ScreenshotFileInfo screenshot文件

type StartedTaskInfo

type StartedTaskInfo struct {
	TaskName     string `json:"task_name"`
	TaskArgs     string `json:"task_args"`
	TaskStarting string `json:"task_starting"`
}

type StatusResponseData

type StatusResponseData struct {
	Status string `json:"status"`
	Msg    string `json:"msg"`
}

StatusResponseData JSON的状态响应

type TaskController

type TaskController struct {
	BaseController
}

func (*TaskController) DeleteAction

func (c *TaskController) DeleteAction()

DeleteAction 删除一个记录

func (*TaskController) DeleteBatchAction

func (c *TaskController) DeleteBatchAction()

DeleteBatchAction 批量删除任务

func (*TaskController) DeleteCronAction

func (c *TaskController) DeleteCronAction()

DeleteCronAction 删除一个记录

func (*TaskController) DeleteMainAction

func (c *TaskController) DeleteMainAction()

DeleteMainAction 删除一个记录

func (*TaskController) DisableCronTaskAction

func (c *TaskController) DisableCronTaskAction()

DisableCronTaskAction 禁用一个任务

func (*TaskController) EnableCronTaskAction

func (c *TaskController) EnableCronTaskAction()

EnableCronTaskAction 启用一个任务

func (*TaskController) IndexAction

func (c *TaskController) IndexAction()

func (*TaskController) IndexCronAction

func (c *TaskController) IndexCronAction()

func (*TaskController) InfoAction

func (c *TaskController) InfoAction()

InfoAction 显示一个任务的详情

func (*TaskController) InfoCronAction

func (c *TaskController) InfoCronAction()

InfoCronAction 显示一个任务的详情

func (*TaskController) InfoMainAction

func (c *TaskController) InfoMainAction()

InfoMainAction 显示一个Main任务的详情

func (*TaskController) ListAction

func (c *TaskController) ListAction()

ListAction 任务列表的数据

func (*TaskController) ListCronAction

func (c *TaskController) ListCronAction()

ListCronAction 定时任务列表的数据

func (*TaskController) RunCronTaskAction

func (c *TaskController) RunCronTaskAction()

RunCronTaskAction 立即执行一个任务

func (*TaskController) StartBatchScanTaskAction

func (c *TaskController) StartBatchScanTaskAction()

StartBatchScanTaskAction 探测+扫描任务

func (*TaskController) StartDomainScanTaskAction

func (c *TaskController) StartDomainScanTaskAction()

StartDomainScanTaskAction 域名任务

func (*TaskController) StartPocScanTaskAction

func (c *TaskController) StartPocScanTaskAction()

StartPocScanTaskAction pocscan任务

func (*TaskController) StartPortScanTaskAction

func (c *TaskController) StartPortScanTaskAction()

StartPortScanTaskAction 端口扫描任务

func (*TaskController) StartXScanTaskAction

func (c *TaskController) StartXScanTaskAction()

StartXScanTaskAction 新建Xscan任务

func (*TaskController) StopAction

func (c *TaskController) StopAction()

StopAction 取消一个未开始执行的任务

type TaskCronInfo

type TaskCronInfo struct {
	Id          int
	TaskId      string
	TaskName    string
	Status      string
	KwArgs      string
	CronRule    string
	LastRunTime string
	CreateTime  string
	UpdateTime  string
	RunCount    int
	Comment     string
	Workspace   string
}

type TaskCronListData

type TaskCronListData struct {
	Id          int    `json:"id"`
	Index       int    `json:"index"`
	TaskId      string `json:"task_id""`
	TaskName    string `json:"task_name"`
	Status      string `json:"status"`
	KwArgs      string `json:"kwargs"`
	CronRule    string `json:"cron_rule"`
	CreateTime  string `json:"create_time"`
	LastRunTime string `json:"lastrun_time"`
	NextRunTime string `json:"nextrun_time"`
	RunCount    int    `json:"run_count"`
	Comment     string `json:"comment"`
}

type TaskInfo

type TaskInfo struct {
	Id            int
	TaskId        string
	Worker        string
	TaskName      string
	State         string
	Result        string
	KwArgs        string
	ReceivedTime  string
	StartedTime   string
	SucceededTime string
	FailedTime    string
	RetriedTime   string
	RevokedTime   string
	Runtime       string
	CreateTime    string
	UpdateTime    string
	ResultFile    string
	RunTaskInfo   []TaskListData
	Workspace     string
}

type TaskInfoData

type TaskInfoData struct {
	TaskInfo string `json:"task_info"`
}

type TaskListData

type TaskListData struct {
	Id           int    `json:"id"`
	Index        string `json:"index"`
	TaskId       string `json:"task_id"`
	Worker       string `json:"worker"`
	TaskName     string `json:"task_name"`
	State        string `json:"state"`
	Result       string `json:"result"`
	KwArgs       string `json:"kwargs"`
	ReceivedTime string `json:"received"`
	StartedTime  string `json:"started"`
	CreateTime   string `json:"created"`
	UpdateTime   string `json:"updated"`
	Runtime      string `json:"runtime"`
	ResultFile   string `json:"resultfile"`
	TaskType     string `json:"tasktype"`
}

type TokenData

type TokenData struct {
	User      string `json:"user"`
	UserRole  string `json:"userRole"`
	Workspace int    `json:"workspace"`
}

func ValidToken

func ValidToken(tokenString string) (data *TokenData)

ValidToken 验证token

type UserController

type UserController struct {
	BaseController
}

func (*UserController) AddIndexAction

func (c *UserController) AddIndexAction()

AddIndexAction 新增页面显示

func (*UserController) AddSaveAction

func (c *UserController) AddSaveAction()

AddSaveAction 保存新增的记录

func (*UserController) DeleteAction

func (c *UserController) DeleteAction()

DeleteAction 删除一条记录

func (*UserController) GetAction

func (c *UserController) GetAction()

GetAction 根据ID获取一个记录

func (*UserController) IndexAction

func (c *UserController) IndexAction()

IndexAction 显示列表页面

func (*UserController) ListAction

func (c *UserController) ListAction()

ListAction 获取列表显示的数据

func (*UserController) ListUserWorkspaceAction

func (c *UserController) ListUserWorkspaceAction()

ListUserWorkspaceAction 获取用户相关的工作空间权限设置情况

func (*UserController) ResetPasswordAction

func (c *UserController) ResetPasswordAction()

ResetPasswordAction 重置指定用户的密码

func (*UserController) UpdateAction

func (c *UserController) UpdateAction()

UpdateAction 更新一个记录

func (*UserController) UpdateUserWorkspaceAction

func (c *UserController) UpdateUserWorkspaceAction()

UpdateUserWorkspaceAction 更新用户的工作空间访问权限

type UserData

type UserData struct {
	Id              int    `json:"id" form:"id"`
	Index           int    `json:"index" form:"-"`
	UserName        string `json:"user_name" form:"user_name"`
	UserPassword    string `json:"user_password" form:"user_password"`
	UserDescription string `json:"user_description" form:"user_description"`
	UserRole        string `json:"user_role" form:"user_role"`
	State           string `json:"state" form:"state"`
	SortOrder       int    `json:"sort_order" form:"sort_order"`
	CreateDatetime  string `json:"create_time" form:"-"`
	UpdateDatetime  string `json:"update_time" form:"-"`
}

type VulController

type VulController struct {
	BaseController
}

func (*VulController) DeleteAction

func (c *VulController) DeleteAction()

DeleteAction 删除一个记录

func (*VulController) IndexAction

func (c *VulController) IndexAction()

func (*VulController) InfoAction

func (c *VulController) InfoAction()

InfoAction 显示一个漏洞的详情

func (*VulController) ListAction

func (c *VulController) ListAction()

ListAction 漏洞列表的数据

func (*VulController) LoadNucleiPocFileAction

func (c *VulController) LoadNucleiPocFileAction()

LoadNucleiPocFileAction 获取Nuclei的pocfile列表

func (*VulController) LoadXrayPocFileAction

func (c *VulController) LoadXrayPocFileAction()

LoadXrayPocFileAction 获取xray的pocfile列表

type VulnerabilityData

type VulnerabilityData struct {
	Id          int    `json:"id"`
	Index       int    `json:"index"`
	Target      string `json:"target"`
	Url         string `json:"url"`
	PocFile     string `json:"poc_file"`
	Source      string `json:"source"`
	CreateTime  string `json:"create_datetime"`
	UpdateTime  string `json:"update_datetime"`
	WorkspaceId int    `json:"workspace"`
}

type VulnerabilityInfo

type VulnerabilityInfo struct {
	Id         int
	Target     string
	Url        string
	PocFile    string
	Source     string
	Extra      string
	CreateTime string
	UpdateTime string
	Workspace  string
}

type WikiController

type WikiController struct {
	BaseController
}

func (*WikiController) AddIndexAction

func (c *WikiController) AddIndexAction()

AddIndexAction 新建一个文档页面

func (*WikiController) AddSaveAction

func (c *WikiController) AddSaveAction()

AddSaveAction 新建一个文档

func (*WikiController) ExportDocument

func (c *WikiController) ExportDocument()

ExportDocument 导出一个文档

func (*WikiController) FeishuAuthorizationCodeCallbackAction

func (c *WikiController) FeishuAuthorizationCodeCallbackAction()

FeishuAuthorizationCodeCallbackAction 飞书授权回调

func (*WikiController) GetAction

func (c *WikiController) GetAction()

GetAction 根据token从数据库获取一个文档

func (*WikiController) IndexAction

func (c *WikiController) IndexAction()

IndexAction 列表页面

func (*WikiController) ListAction

func (c *WikiController) ListAction()

ListAction 列表的数据

func (*WikiController) RefreshTokenAction

func (c *WikiController) RefreshTokenAction()

RefreshTokenAction 刷新用户访问Token

func (*WikiController) SyncFeishuSpacesAction

func (c *WikiController) SyncFeishuSpacesAction()

SyncFeishuSpacesAction 同步飞书知识库

func (*WikiController) UpdateAction

func (c *WikiController) UpdateAction()

UpdateAction 更新一个数据库中的文档

type WorkerController

type WorkerController struct {
	BaseController
}

func (*WorkerController) EditWorkerAction

func (c *WorkerController) EditWorkerAction()

EditWorkerAction 更改worker

func (*WorkerController) IndexAction

func (c *WorkerController) IndexAction()

func (*WorkerController) ListAction

func (c *WorkerController) ListAction()

ListAction 列表的数据

func (*WorkerController) ManualReloadWorkerAction

func (c *WorkerController) ManualReloadWorkerAction()

ManualReloadWorkerAction 重启worker

func (*WorkerController) UpdateWorkerAction

func (c *WorkerController) UpdateWorkerAction()

UpdateWorkerAction 更新worker的启动参数

type WorkerStatusData

type WorkerStatusData struct {
	Index                    int    `json:"index"`
	WorkName                 string `json:"worker_name"`
	WorkerTopic              string `json:"worker_topic"`
	CreateTime               string `json:"create_time"`
	UpdateTime               string `json:"update_time"`
	TaskExecutedNumber       int    `json:"task_number"`
	TaskStartedNumber        int    `json:"started_number"`
	CPULoad                  string `json:"cpu_load"`
	MemUsage                 string `json:"mem_used"`
	EnableManualReloadFlag   bool   `json:"enable_manual_reload_flag"`
	EnableManualFileSyncFlag bool   `json:"enable_manual_file_sync_flag"`
	HeartColor               string `json:"heart_color"`
	IsDaemonProcess          bool   `json:"daemon_process"`
}

type WorkspaceController

type WorkspaceController struct {
	BaseController
}

func (*WorkspaceController) AddIndexAction

func (c *WorkspaceController) AddIndexAction()

AddIndexAction 新增页面显示

func (*WorkspaceController) AddSaveAction

func (c *WorkspaceController) AddSaveAction()

AddSaveAction 保存新增的记录

func (*WorkspaceController) ChangeWorkspaceSelectAction

func (c *WorkspaceController) ChangeWorkspaceSelectAction()

ChangeWorkspaceSelectAction 切换到指定的workspace、更新JWTData或session

func (*WorkspaceController) DeleteAction

func (c *WorkspaceController) DeleteAction()

DeleteAction 删除一条记录

func (*WorkspaceController) GetAction

func (c *WorkspaceController) GetAction()

GetAction 根据ID获取一个记录

func (*WorkspaceController) IndexAction

func (c *WorkspaceController) IndexAction()

IndexAction 显示列表页面

func (*WorkspaceController) ListAction

func (c *WorkspaceController) ListAction()

ListAction 获取列表显示的数据

func (*WorkspaceController) UpdateAction

func (c *WorkspaceController) UpdateAction()

UpdateAction 更新一个记录

func (*WorkspaceController) UserWorkspaceAction

func (c *WorkspaceController) UserWorkspaceAction()

UserWorkspaceAction 获取用户的workspace, 用于用户进行用户工作的切换

type WorkspaceData

type WorkspaceData struct {
	Id                   int    `json:"id" form:"id"`
	Index                int    `json:"index" form:"-"`
	WorkspaceName        string `json:"workspace_name" form:"workspace_name"`
	WorkspaceGUID        string `json:"workspace_guid" form:"workspace_guid"`
	WorkspaceDescription string `json:"workspace_description" form:"workspace_description"`
	State                string `json:"state" form:"state"`
	SortOrder            int    `json:"sort_order" form:"sort_order"`
	WikiSpaceId          string `json:"wiki_space_id" form:"wiki_space_id"`
	CreateDatetime       string `json:"create_time" form:"-"`
	UpdateDatetime       string `json:"update_time" form:"-"`
}

type WorkspaceInfo

type WorkspaceInfo struct {
	WorkspaceInfoList []WorkspaceInfoData
	CurrentWorkspace  string
}

type WorkspaceInfoData

type WorkspaceInfoData struct {
	WorkspaceId   string `json:"workspaceId"`
	WorkspaceName string `json:"workspaceName"`
	WikiSpaceId   string `json:"wikiSpaceId"`
	Enable        bool   `json:"enable"`
}

Jump to

Keyboard shortcuts

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