core

package
v0.0.0-...-815c261 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Cleaning         = "Cleaning"
	CleanAmass       = "CleanAmass"
	CleanRustScan    = "CleanRustScan"
	CleanGoBuster    = "CleanGoBuster"
	CleanMassdns     = "CleanMassdns"
	CleanSWebanalyze = "CleanSWebanalyze"
	CleanJSONDnsx    = "CleanJSONDnsx"
	CleanWebanalyze  = "CleanWebanalyze"
	CleanArjun       = "CleanArjun"
	CleanJSONHttpx   = "CleanJSONHttpx"
	CleanFFUFJson    = "CleanFFUFJson"
	GenNucleiReport  = "GenNucleiReport"
	PrintCSV         = "PrintCSV"
	BeautifyCSV      = "BeautifyCSV"
)
View Source
const (
	// noti for slack
	StartNoti   = "StartNoti"
	DoneNoti    = "DoneNoti"
	ReportNoti  = "ReportNoti"
	DiffNoti    = "DiffNoti"
	CustomNoti  = "CustomNoti"
	NotiFile    = "NotiFile"
	WebHookNoti = "WebHookNoti"
	// noti for telegram
	TeleMess       = "TeleMess"
	TeleMessWrap   = "TeleMessWrap"
	TeleMessByFile = "TeleMessByFile"
	TeleSendFile   = "TeleSendFile"
)
View Source
const (
	ExecCmd           = "ExecCmd"
	ExecCmdB          = "ExecCmdB"
	ExecCmdWithOutput = "ExecCmdWithOutput"
	ExecContain       = "ExecContain"
	Sleep             = "Sleep"
	Exit              = "Exit"
	CastToInt         = "CastToInt"
	StripSlash        = "StripSlash"
	Printf            = "Printf"
	Warnf             = "Warnf"
	Cat               = "Cat"
	SortU             = "SortU"
	SplitFile         = "SplitFile"
	Append            = "Append"
	Copy              = "Copy"
	CreateFolder      = "CreateFolder"
	DeleteFile        = "DeleteFile"
	DeleteFolder      = "DeleteFolder"
	SplitFileByPart   = "SplitFileByPart"
	FileLength        = "FileLength"
	FolderLength      = "FolderLength"
	IsFile            = "IsFile"
	EmptyDir          = "EmptyDir"
	EmptyFile         = "EmptyFile"
	ReadLines         = "ReadLines"
	Compress          = "Compress"
	Decompress        = "Decompress"
)
View Source
const (
	TotalSubdomain     = "TotalSubdomain"
	TotalDns           = "TotalDns"
	TotalScreenShot    = "TotalScreenShot"
	TotalTech          = "TotalTech"
	TotalVulnerability = "TotalVulnerability"
	TotalArchive       = "TotalArchive"
	TotalLink          = "TotalLink"
	TotalDirb          = "TotalDirb"
	CreateReport       = "CreateReport"
)
View Source
const (
	RRSync      = "RRSync"
	Clone       = "Clone"
	FClone      = "FClone"
	PushResult  = "PushResult"
	PushFolder  = "PushFolder"
	PullFolder  = "PullFolder"
	DiffCompare = "DiffCompare"
	GitDiff     = "GitDiff"
	LoopGitDiff = "LoopGitDiff"
	// for gitlab API only
	CreateRepo      = "CreateRepo"
	DeleteRepo      = "DeleteRepo"
	DeleteRepoByPid = "DeleteRepoByPid"
	ListProjects    = "ListProjects"
)
View Source
const (
	UploadToS3        = "UploadToS3"
	DownloadFromS3    = "DownloadFromS3"
	DownloadFile      = "DownloadFile"
	GenMarkdownReport = "GenMarkdownReport"
)
View Source
const (
	SetVar   = "SetVar"
	SetOSVar = "SetOSVar"
	GetOSEnv = "GetOSEnv"
)

Variables

This section is empty.

Functions

func AltResolveVariable

func AltResolveVariable(format string, data map[string]string) string

AltResolveVariable just like ResolveVariable but looking for [[.var]]

func Banner() string

Banner print ascii banner

func CheckResume

func CheckResume(module libs.Module) bool

CheckResume check resume report

func CheckUpdate

func CheckUpdate(options *libs.Options) bool

func CommandBuilder

func CommandBuilder(inputFormat libs.InputFormat) (command string)

func CompressWorkspace

func CompressWorkspace(target string, opt libs.Options)

func DefaultWorkflows

func DefaultWorkflows(options libs.Options) []string

DefaultWorkflows select module from ~/.osmedeus/core/workflow/plugins/

func DirectSelectModule

func DirectSelectModule(options libs.Options, moduleName string) string

DirectSelectModule select module from ~/osmedeus-base/workflow/default-modules

func DownloadUpdate

func DownloadUpdate(opt libs.Options) error

func ExtractBackup

func ExtractBackup(src string, opt libs.Options)

func GenerateMetaData

func GenerateMetaData(options libs.Options)

func GetCdn

func GetCdn(options *libs.Options)

GetCdn get options for client

func GetClient

func GetClient(options *libs.Options) map[string]string

GetClient get options for client

func GetCloud

func GetCloud(options *libs.Options)

func GetEnv

func GetEnv(options *libs.Options)

GetEnv get environment options

func GetGit

func GetGit(options *libs.Options)

GetGit get options for client

func GetNewLine

func GetNewLine(queueFile string) string

func GetNotification

func GetNotification(options *libs.Options)

GetNotification get storge repos

func GetPublicIP

func GetPublicIP() string

func GetServer

func GetServer(options *libs.Options)

GetServer get server options

func GetStorages

func GetStorages(options *libs.Options)

func GetUpdateURL

func GetUpdateURL(options libs.Options) string

func GitUpdate

func GitUpdate(opt libs.Options) error

func HTTPUpdate

func HTTPUpdate(opt libs.Options) error

func InitConfig

func InitConfig(options *libs.Options) error

InitConfig Init the config

func IsRootDomain

func IsRootDomain(raw string) bool

func ListAllFlowName

func ListAllFlowName(options libs.Options) (result []string)

func ListFlow

func ListFlow(options libs.Options) (result []string)

ListFlow list all available mode

func ListModuleName

func ListModuleName(options libs.Options) (result []string)

func ListModules

func ListModules(options libs.Options) (modules []string)

ListModules list all available module

func ListScripts

func ListScripts(options libs.Options) (result []string)

ListScripts list all available mode

func ListSingleWorkspace

func ListSingleWorkspace(options libs.Options, target string) (content [][]string)

func ListWorkspaces

func ListWorkspaces(options libs.Options) (content [][]string)

func LoadConfig

func LoadConfig(options *libs.Options) *viper.Viper

func LoadTokenFile

func LoadTokenFile(options *libs.Options) *viper.Viper

func MarkDownToHTML

func MarkDownToHTML(options libs.Options, target string, markdownFile string, outputFile string) error

func OldResolveData

func OldResolveData(format string, data map[string]string) string

OldResolveData resolve template from signature file

func ParseFlow

func ParseFlow(flowFile string) (libs.Flow, error)

ParseFlow parse mode file

func ParseInput

func ParseInput(raw string, options libs.Options) map[string]string

ParseInput parse input for routine

func ParseInputFormat

func ParseInputFormat(raw string, options libs.Options) map[string]string

ParseInputFormat format input

func ParseModules

func ParseModules(moduleFile string) (libs.Module, error)

ParseModules parse module file

func ParseParams

func ParseParams(rawParams []string) map[string]string

ParseParams parse more params from cli

func ParseTarget

func ParseTarget(raw string) map[string]string

ParseTarget parsing target and some variable for template

func ParsingConfig

func ParsingConfig(options *libs.Options)

func QueueWatcher

func QueueWatcher(options libs.Options)

func ResolveData

func ResolveData(format string, data map[string]string) string

ResolveData resolve template from signature file

func ResolveReports

func ResolveReports(module libs.Module, params map[string]string) libs.Module

ResolveReports resolve real path of reports

func ResolveSlice

func ResolveSlice(slice []string, data map[string]string) (resolveSlice []string)

ResolveSlice resolve template from signature file

func RunCron

func RunCron(cmd string, schedule int)

func RunTheScan

func RunTheScan(target string, options libs.Options) error

func RunUpdate

func RunUpdate(options libs.Options) error

func SelectFlow

func SelectFlow(flowName string, options libs.Options) []string

SelectFlow select flow to run

func SelectModules

func SelectModules(moduleNames []string, options libs.Options) []string

SelectModules return list of modules name

func SelectScript

func SelectScript(scriptName string, options libs.Options) string

func SetClientName

func SetClientName(options *libs.Options, clientName string)

func SetTactic

func SetTactic(options *libs.Options)

func SetupOSEnv

func SetupOSEnv(options *libs.Options)

func SetupOpt

func SetupOpt(options *libs.Options)

SetupOpt get storage repos

func Update

func Update(opt libs.Options)

func UpdateBase

func UpdateBase(opt libs.Options)

func UpdateVuln

func UpdateVuln(opt libs.Options)

Types

type Runner

type Runner struct {
	Input     string
	Workspace string

	InputType     string // domain, url, ip, cidr or domain-file, url-file, ip-file, cidr-file
	RequiredInput string // this should match with InputType
	IsInvalid     bool
	ForceParams   bool

	RoutineType  string // module or flow
	RoutineName  string // general
	RoutinePath  string
	RunnerSource string // cli or  api
	RunnerType   string // local or cloud

	Opt libs.Options

	// use for analytics
	DoneStep      int
	TotalSteps    int
	RunningTime   int
	CurrentModule string

	DoneFile        string
	RuntimeFile     string
	WorkspaceFolder string

	RoutineModules []string
	Reports        []string
	Routines       []libs.Routine

	VM        *otto.Otto
	TargetObj database.Target
	ScanObj   database.Scan

	Target map[string]string
	// this is same as targets but won't change during the execution time
	Params map[string]string
}

Runner runner struct to start a job

func InitRunner

func InitRunner(input string, opt libs.Options) (Runner, error)

InitRunner init runner

func (*Runner) BackupWorkspace

func (r *Runner) BackupWorkspace()

func (*Runner) CheckCondition

func (r *Runner) CheckCondition(conditions []string) error

CheckCondition check if required file exist or not

func (*Runner) CheckRequired

func (r *Runner) CheckRequired(requires []string) error

CheckRequired check if required file exist or not

func (*Runner) ConditionExecScript

func (r *Runner) ConditionExecScript(script string) bool

func (*Runner) DBDoneScan

func (r *Runner) DBDoneScan()

func (*Runner) DBNewReports

func (r *Runner) DBNewReports(module libs.Module)

func (*Runner) DBNewScan

func (r *Runner) DBNewScan()

func (*Runner) DBNewTarget

func (r *Runner) DBNewTarget()

func (*Runner) DBRuntimeUpdate

func (r *Runner) DBRuntimeUpdate()

func (*Runner) DBUpdateScan

func (r *Runner) DBUpdateScan()

func (*Runner) ExecScript

func (r *Runner) ExecScript(script string) string

func (*Runner) GenMarkdownReport

func (r *Runner) GenMarkdownReport(markdownFile string, outputHTML string)

func (*Runner) InitVM

func (r *Runner) InitVM()

InitVM init scripting engine

func (*Runner) LoadDBScripts

func (r *Runner) LoadDBScripts() string

func (*Runner) LoadEngineScripts

func (r *Runner) LoadEngineScripts()

func (*Runner) LoadExternalScripts

func (r *Runner) LoadExternalScripts() string

func (*Runner) LoadGitScripts

func (r *Runner) LoadGitScripts() string

func (*Runner) LoadNotiScripts

func (r *Runner) LoadNotiScripts() string

func (*Runner) LoadScripts

func (r *Runner) LoadScripts() string

func (*Runner) ParamsFromCLI

func (r *Runner) ParamsFromCLI()

PrepareParams prepare global params

func (*Runner) PrepareModule

func (r *Runner) PrepareModule()

func (*Runner) PrepareParams

func (r *Runner) PrepareParams()

func (*Runner) PrepareRoutine

func (r *Runner) PrepareRoutine()

func (*Runner) PrepareWorkflow

func (r *Runner) PrepareWorkflow()

PrepareWorkflow prepare workflow file

func (*Runner) ResolveContentSrc

func (r *Runner) ResolveContentSrc(tag string) string

func (*Runner) ResolveContentTag

func (r *Runner) ResolveContentTag(rawData string) string

func (*Runner) ResolveReportsTag

func (r *Runner) ResolveReportsTag(rawMarkDown string) string

func (*Runner) ResolveRoutine

func (r *Runner) ResolveRoutine()

ResolveRoutine resolve the module name first

func (*Runner) ResolveScanInfoTag

func (r *Runner) ResolveScanInfoTag(rawMarkdown string) string

func (*Runner) RetryCommandWithExpectString

func (r *Runner) RetryCommandWithExpectString(cmd string, expectString string, timeoutRaw ...string) string

func (*Runner) RunCommands

func (r *Runner) RunCommands(commands []string, std string) string

RunCommands run list of commands in parallel

func (*Runner) RunModule

func (r *Runner) RunModule(module libs.Module)

RunModule run the module

func (*Runner) RunModulesWithTimeout

func (r *Runner) RunModulesWithTimeout(timeoutRaw string, module libs.Module, options libs.Options)

func (*Runner) RunOse

func (r *Runner) RunOse(scriptName string)

RunOse really start the runner

func (*Runner) RunRoutine

func (r *Runner) RunRoutine(modules []libs.Module)

func (*Runner) RunScript

func (r *Runner) RunScript(script string) string

RunScript really run a script

func (*Runner) RunScripts

func (r *Runner) RunScripts(scripts []string) string

RunScripts run list of scripts

func (*Runner) RunScriptsWithTimeOut

func (r *Runner) RunScriptsWithTimeOut(timeoutRaw string, scripts []string) string

RunScriptsWithTimeOut run list of scripts with timeout

func (*Runner) RunStep

func (r *Runner) RunStep(step libs.Step) (string, error)

func (*Runner) RunStepWithSource

func (r *Runner) RunStepWithSource(step libs.Step) (out string, err error)

RunStepWithSource really run a step

func (*Runner) RunStepWithTimeout

func (r *Runner) RunStepWithTimeout(timeout int, step libs.Step) (out string, err error)

RunStepWithTimeout run step with timeout

func (*Runner) RunSteps

func (r *Runner) RunSteps(steps []libs.Step) error

RunSteps run list of steps

func (*Runner) Start

func (r *Runner) Start()

func (*Runner) StartRoutines

func (r *Runner) StartRoutines()

StartRoutines start the scan

func (*Runner) Validator

func (r *Runner) Validator() error

type Tmux

type Tmux struct {
	ApplyAll       bool
	SelectedWindow string
	Exclude        string
	Limit          int
	Windows        []string
}

func InitTmux

func InitTmux(options libs.Options) (Tmux, error)

func (*Tmux) CatchSession

func (t *Tmux) CatchSession() string

func (*Tmux) ListTmux

func (t *Tmux) ListTmux()

Jump to

Keyboard shortcuts

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