libs

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: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VERSION of this project
	VERSION = "v4.6.4"
	// DESC description of the tool
	DESC = "A Workflow Engine for Offensive Security"
	// BINARY name of osmedeus
	BINARY = "osmedeus"
	// SNAPSHOT binary name of osmedeus
	SNAPSHOT = "osm"
	// AUTHOR of this
	AUTHOR = "@j3ssiejjj"
	// DOCS private document
	DOCS = "https://docs.osmedeus.org"
	// METADATA domain for checking update
	METADATA = "https://metadata.osmedeus.org"
	// INSTALL default install script
	INSTALL = "https://raw.githubusercontent.com/osmedeus/osmedeus-base/master/install.sh"
)

Variables

View Source
var LDIR = fmt.Sprintf("/tmp/%s-log/", SNAPSHOT)
View Source
var TEMP = fmt.Sprintf("/tmp/%s-inputs/", SNAPSHOT)

TEMP default folder to store inputs

Functions

This section is empty.

Types

type Cdn

type Cdn struct {
	Bucket      string
	Region      string
	SecretKey   string
	AccessKeyId string
}

Cdn credentials for other client

type Client

type Client struct {
	Username string
	Password string
	JWT      string
	URL      string
}

Client credentials for other client

type Cloud

type Cloud struct {
	CheckingLimit      bool
	ReBuildBaseImage   bool
	IgnoreConfigFile   bool
	BackgroundRun      bool
	OnlyCreateDroplet  bool
	OnlyCreateInstance bool
	EnablePrivateIP    bool

	EnableSyncWorkflow   bool
	AddNewProvider       bool
	RemoteWorkflowFolder string
	TokensFile           string

	CopyWorkspaceToGit bool
	ClearTime          string
	InstanceName       string
	TempTarget         string
	// content of secret key to avoid reading it too much
	SecretKeyContent string
	PublicKeyContent string

	// enable terraform
	EnableTerraform bool

	// chunk options
	ChunkInputs      string
	BaseWorkspace    string
	LocalSyncFolder  string
	DisableLocalSync bool
	RemoteRunList    bool
	TargetAsFile     bool
	EnableChunk      bool
	IgnoreProcess    bool
	NumberOfParts    int
	Threads          int

	// specific cloud instance resources
	Size        string
	Region      string
	Token       string
	Provider    string
	IgnoreSetup bool

	// for pre-commands and post-commands
	RemotePreRun []string
	// run script on local machine after scan done
	LocalSteps   []Step `yaml:"local_steps"`
	LocalPreRun  []string
	LocalPostRun []string

	// use to clone build-osm repo
	SecretKey   string
	PublicKey   string
	BuildRepo   string
	Binary      string
	Retry       int
	UnzipResult bool

	// for health check
	ForEverHealthCheck bool
	NoDelete           bool

	// raw command here
	Extra      string
	Flow       string
	Module     string
	Workspace  string
	RawCommand string
	Params     []string

	WsSource string
	WsDest   string

	Input      string
	Inputs     []string
	InputsFile string

	Target map[string]string
}

Cloud struct define folder to push data

type Cron

type Cron struct {
	Command  string
	Schedule int
	Forever  bool
}

Cron credentials for other client

type Environment

type Environment struct {
	RootFolder       string // ~/.osmedeus
	StoragesFolder   string // ~/.osmedeus/storages/
	WorkspacesFolder string // ~/workspaces-osmedeus/

	// Base one
	BaseFolder      string // ~/osmedeus-base
	BinariesFolder  string // ~/osmedeus-base/binaries
	DataFolder      string // ~/osmedeus-base/data/
	OseFolder       string // ~/osmedeus-base/ose/
	WorkFlowsFolder string // ~/osmedeus-base/workflow/

	// cloud stuff
	CloudConfigFolder string // ~/osmedeus-base/clouds/
	ProviderFolder    string // ~/.osmedeus/providers/
	InstancesFolder   string // ~/.osmedeus/instances/
	BackupFolder      string

	// Mics
	ScriptsFolder string
	UIFolder      string
}

Environment some config path

type Flow

type Flow struct {
	NoDB        bool `yaml:"nodb"`
	SkipIndexed bool `yaml:"skip-indexed"`
	ForceParams bool `yaml:"force-params"`
	Input       string
	Validator   string // domain, cidr, ip or domain-file, cidr-file and so on

	Name        string
	Type        string
	DefaultType string
	Desc        string
	Usage       string

	Params   []map[string]string
	Routines []Routine

	RemotePreRun []string `yaml:"remote_pre_run"`
	// run script on local machine after scan done
	LocalPreRun  []string `yaml:"local_pre_run"`
	LocalPostRun []string `yaml:"local_post_run"`
}

Flow struct to define specific field for a mode

type Git

type Git struct {
	BaseURL       string
	Username      string
	Password      string
	Token         string
	Group         string
	DefaultPrefix string
	DefaultTag    string
	DefaultUser   string
	DefaultUID    int
	DeStorage     string
}

Git credentials for other client

type InputFormat

type InputFormat struct {
	Input       string   `json:"input"`
	Flow        string   `json:"flow"`
	Modules     []string `json:"module"`
	Params      []string `json:"params"`
	Workspaces  string   `json:"workspace"`
	Extra       string   `json:"extra"`
	Command     string   `json:"command"`
	InputAsFile bool     `json:"input-as-file"`
}

type Module

type Module struct {
	NoDB        bool   `yaml:"nodb"`
	Validator   string // domain, cidr, ip
	ForceParams bool   `yaml:"force-params"`

	// just for print some info
	Name  string
	Desc  string
	Usage string

	// enable resume, if all reports file exist then skip the module
	Resume bool
	// run module despite resume enable
	Forced bool

	MTimeout   string `yaml:"mtimeout"`
	Params     []map[string]string
	ModulePath string

	PreRun []string `yaml:"pre_run"`
	Report struct {
		Final []string
		Noti  []string
		Diff  []string
	}
	Steps   []Step
	PostRun []string `yaml:"post_run"`

	RemotePreRun []string `yaml:"remote_pre_run"`
	// run script on local machine after scan done
	LocalSteps   []Step   `yaml:"local_steps"`
	LocalPreRun  []string `yaml:"local_pre_run"`
	LocalPostRun []string `yaml:"local_post_run"`
}

Module struct to define specific field for a module

type Notification

type Notification struct {
	ClientName string
	// SlacksWebHooks list
	SlacksWebHooks map[string]string
	// TelegramWebHooks list
	TelegramWebHooks map[string]string
	// Telegram part
	TelegramToken            string
	TelegramChannel          string
	TelegramStatusChannel    string
	TelegramReportChannel    string
	TelegramDirbChannel      string
	TelegramSensitiveChannel string
	TelegramMicsChannel      string
	// use this when we want to send a file to channel
	SlackWebHook       string
	SlackToken         string
	SlackReportChannel string
	SlackStatusChannel string
	SlackDiffChannel   string
	// later then
	DiscordToken string
}

Notification struct define notification method

type Options

type Options struct {
	ConfigFile  string
	LogFile     string
	Concurrency int

	// default threads hold for running module
	Tactics string
	Threads int

	Timeout           string
	EnableFormatInput bool
	Verbose           bool
	FullHelp          bool

	// some disable options
	NoPostRun            bool
	NoPreRun             bool
	NoNoti               bool
	NoBanner             bool
	NoGit                bool
	NoClean              bool
	NoDB                 bool
	NoCdn                bool
	DisableValidateInput bool

	PremiumPackage   bool
	Resume           bool
	Quite            bool
	Force            bool
	WildCardCheck    bool
	Debug            bool
	EnableDeStorage  bool
	PID              int
	SyncTimes        int
	PollingTime      int
	MDCodeBlockLimit int
	Exclude          []string
	Params           []string
	CustomGit        bool
	EnableBackup     bool
	JsonOutput       bool

	Client Client
	Queue  Queue
	Git    Git
	Sync   Sync
	Scan   Scan
	Server Server
	Env    Environment
	Noti   Notification
	Flow   Flow
	Module Module
	Tmux   TmuxOpt
	Cron   Cron
	Remote Remote
	Cdn    Cdn
	Update Update

	ThreadsHold     ThreadsHold
	Cloud           Cloud
	Report          Report
	CloudConfigFile string
	TokenConfigFile string
	GitSync         bool

	ScanID   string
	Storages map[string]string
}

Options global options

type Queue

type Queue struct {
	QueueFolder string
	QueueFile   string
	RawCommand  string

	InputAsFile bool
	Add         bool
}

Queue sub options for quque

type Remote

type Remote struct {
	MasterHost string
	MasterCred string
	PoolHost   string
	PoolCred   string
}

Remote credentials for other client

type Report

type Report struct {
	CustomPreFix  string
	PublicIP      string
	ExtractFolder string
	Static        bool
	Raw           bool
}

Report sub options for report

type Request

type Request struct {
	Timeout  int
	Repeat   int
	Scheme   string
	Host     string
	Port     string
	Path     string
	URL      string
	Proxy    string
	Method   string
	Redirect bool
	Headers  []map[string]string
	Body     string
	Beautify string
}

Request all information about request

type Response

type Response struct {
	HasPopUp       bool
	StatusCode     int
	Status         string
	ContentType    string
	Headers        []map[string]string
	Body           string
	ResponseTime   float64
	Length         int
	Beautify       string
	Location       string
	BeautifyHeader string
}

Response all information about response

type Routine

type Routine struct {
	RoutineName   string
	FlowFolder    string `yaml:"flow"`
	Timeout       string `yaml:"timeout"`
	ParsedModules []Module
	Modules       []string
}

Routine for each scan

type Scan

type Scan struct {
	ROptions   map[string]string
	Params     []string
	Input      string
	InputType  string // domain, url, ip, cidr or domainList, urlList, ipList, cidrList
	ParamsFile string
	Inputs     []string
	InputList  string
	Modules    []string
	Flow       string

	BaseWorkspace   string
	CustomWorkspace string
	SuffixName      string
	Force           bool
	// this is true when calling from cloud scan
	RemoteCall bool
}

Scan sub options for scan

type Server

type Server struct {
	DisableWorkspaceListing bool
	DisableSSL              bool
	PreFork                 bool
	NoAuthen                bool

	PollingTime    int
	Bind           string
	Port           string
	StaticPrefix   string
	JWTSecret      string
	Cors           string
	UIPath         string
	MasterPassword string

	// database
	DBPath       string
	DBType       string
	DBConnection string
	DBName       string
	DBUser       string
	DBPass       string
	DBHost       string
	DBPort       string

	// for SSL
	CertFile string
	KeyFile  string
}

Server sub options for api server

type Step

type Step struct {
	// timeout for commands and script
	Timeout string
	// use for run loop command
	Parallel int
	Threads  string
	Source   string

	Label string

	Conditions []string
	Required   []string

	Commands []string
	Ose      []string `yaml:"ose"`
	Scripts  []string

	// run when conditions are false
	RCommands []string `yaml:"rcommands"`
	RScripts  []string `yaml:"rscripts"`

	// post condition and script
	PConditions []string
	PScripts    []string

	Std string
}

Step struct to define component about a command

type Storage

type Storage struct {
	SecretKey      string
	SummaryStorage string
	SummaryRepo    string
	HTTPStorage    string
	HTTPRepo       string
	AssetsStorage  string
	AssetsRepo     string
}

Storage struct define folder to push data

type Sync

type Sync struct {
	BaseURL string
	Prefix  string
	Pool    string
}

Sync credentials for other client

type ThreadsHold

type ThreadsHold struct {
	Default    int
	Aggressive int
	Gently     int
}

type TmuxOpt

type TmuxOpt struct {
	ApplyAll       bool
	SelectedWindow string
	Exclude        string
	Limit          int
}

TmuxOpt credentials for other client

type Update

type Update struct {
	UpdateURL    string // url to download the update script
	UpdateScript string
	MetaDataURL  string
	UpdateKey    string //
	UpdateType   string // git, http
	UpdateConfig string // ~/.osmedeus/update

	UpdateVersion string
	UpdateFolder  string
	UpdateDate    string
	CleanOldData  bool
	VulnUpdate    bool
	GenerateMeta  string
	ForceUpdate   bool
	IsUpdateBin   bool
	EnableUpdate  bool
	NoUpdate      bool
}

Update some config path

type UpdateMetaData

type UpdateMetaData struct {
	WorkflowVersion string `json:"workflow_version"`
	CoreVersion     string `json:"core_version"`
	UpdatedAt       string `json:"updated_at"`
}

Jump to

Keyboard shortcuts

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