shared

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Placeholder  = "HOST"
	NotAvailable = "n/a"
)

MARKS

View Source
const (
	Passive        = "PASSIVE"
	Active         = "ACTIVE"
	Dns            = "DNS"
	VHost          = "VHOST"
	HeaderAnalysis = "HTTP-HEADER-ANALYSIS"
)

STANDARD

View Source
const (
	RDns = "RDNS"
	Ping = "PING"
)

EXTERNS

View Source
const (
	VersionUrl       = "https://raw.githubusercontent.com/PlagueByteSec/sentinel-project/main/version.txt"
	DefaultUserAgent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
	TorProxyUrl      = "socks5://127.0.0.1:9050"
)

REQUEST

View Source
const (
	LogFileName     = "sentinel.log"
	LoggerOutputDir = "log"
	OutputDir       = "output"
	VersionFile     = "version.txt"
)

OUTPUT

View Source
const DefaultPermission = 0755

Variables

View Source
var (
	GPoolBase    PoolBase
	GSubdomBase  SubdomainBase
	GSubdomAddrs SubdomainIpAddresses
	GJsonResult  JsonResult
)
View Source
var (
	GDnsResolver *net.Resolver
	GDnsResults  []string
)
View Source
var (
	GDisplayCount     int
	GShowAllHeaders   bool
	GVerbose          bool
	GDisableAllOutput bool
	GObtainedCounter  int       = 0
	GAllCounter       int       = 0
	GStartTime        time.Time = time.Now()
)
View Source
var (
	CustomDnsServer string // IP address
	RequestDelay    int
)
View Source
var (
	GOpenPortsCount int
	GApiCount       int
	GMxCount        int
	GLoginCount     int
	GCorsCount      int
)

SUMMARY

View Source
var (
	GTargetDomain string
	GScanMethod   string
)
View Source
var (
	GCurrentIPv4Filename string
	GCurrentIPv6Filename string
)
View Source
var Db = []string{
	"https://crt.sh/?q=%25.HOST",
	"https://rapiddns.io/subdomain/HOST?full=1",
	"https://jldc.me/anubis/subdomains/HOST",
}
View Source
var GIsExec int
View Source
var GReportPool = make(map[string]SetTestResults)
View Source
var (
	GStdout *bufio.Writer
)

Functions

func PoolAppendValue

func PoolAppendValue(subdomain string, pool *[]string)

func PoolsCleanupCore

func PoolsCleanupCore(pools *PoolBase)

func PoolsCleanupSummary

func PoolsCleanupSummary(pools *PoolBase)

func PoolsInit added in v2.2.1

func PoolsInit(pools *PoolBase)

Types

type Args

type Args struct {
	Verbose             bool
	Domain              string // target domain
	NewOutputDirPath    string // custom output dir path
	HttpCode            bool
	WordlistPath        string
	ExcHttpCodes        string // results to hide (specified by HTTP status code)
	FilHttpCodes        string // results to display (specified by HTTP status code)
	SubOnlyIp           bool
	AnalyzeHeader       bool
	PortScan            string // port range
	DbExtendPath        string // File path containing endpoints
	Timeout             int    // in seconds
	TorRoute            bool
	DnsLookup           bool
	DnsLookupCustom     string // Custom DNS server (args)
	DnsLookupTimeout    int
	HttpRequestDelay    int    // in milliseconds
	RDnsLookupFilePath  string // IP address file path
	DisableAllOutput    bool
	PingSubdomain       bool
	PingCount           int
	PingSubdomainsFile  string // read subdomains from file and ping
	AnalyseHeaderSingle bool   // HTTP
	Subdomain           string
	HttpRequestMethod   string
	ShowAllHeaders      bool
	DetectPurpose       bool // DNS lookups, HTTP header analysis (mail server, API etc.)
	MisconfTest         bool // CORS, header injection, request smuggling etc.
	AllowRedirects      bool
	IpAddress           string
	EnableVHostEnum     bool
	FilterHttpSize      string
}

type DnsLookupOptions

type DnsLookupOptions struct {
	Subdomain string
	IpAddress net.IP
}

ENUM

type EnumerationMethod

type EnumerationMethod struct {
	MethodKey string
	Action    func(*Args, *http.Client, *FilePaths)
}

type ExternsMethod

type ExternsMethod struct {
	MethodKey string
	Action    func(*Args)
}

type FilePaths

type FilePaths struct {
	FilePathSubdomain string
	FilePathIPv4      string
	FilePathIPv6      string
	FilePathJSON      string
}

OUTPUT

type FileStreams

type FileStreams struct {
	Ipv4AddrStream  *os.File
	Ipv6AddrStream  *os.File
	SubdomainStream *os.File
}
var GStreams FileStreams

type HttpHeaders

type HttpHeaders struct {
	Server string
	Hsts   string
	PowBy  string
	Csp    string
}

type JsonResult

type JsonResult struct {
	Subdomains []SubdomainBase `json:"subdomains"`
}

type Params

type Params struct {
	Domain               string
	Subdomain            string
	FilePathSubdomains   string
	FileContentSubdoms   string
	FilePathIPv4Addrs    string
	FilePathIPv6Addrs    string
	FileContentIPv4Addrs string
	FileContentIPv6Addrs string
}

CORE

type ParamsSetupFilesBase

type ParamsSetupFilesBase struct {
	FileParams *Params
	CliArgs    *Args
	FilePaths  *FilePaths
	Subdomain  string
}

type PoolBase

type PoolBase struct {
	// General
	PoolIPv4Addresses         []string
	PoolIPv6Addresses         []string
	PoolSubdomains            []string
	PoolHttpSuccessSubdomains []string
	// Purpose/Service detection
	PoolMailSubdomains  []string
	PoolApiSubdomains   []string
	PoolLoginSubdomains []string
	PoolCmsSubdomains   []string
	// Security testing
	PoolCorsSubdomains   []string
	PoolCookieInjection  []string
	PoolHeaderInjection  []string
	PoolRequestSmuggling []string
}

type SetTestResults added in v2.2.1

type SetTestResults struct {
	TestName   string
	TestResult string
	Subdomain  string
}

type SettingsHandler

type SettingsHandler struct {
	Streams       *FileStreams
	Args          *Args
	Params        Params
	HttpClient    *http.Client
	ConsoleOutput chan<- string
	CodeFilterExc []string
	CodeFilter    []string
	IpAddrs       []string
	IpAddrsOut    string
	URL           string
}

OPTION-MANAGER

type SubdomainBase

type SubdomainBase struct {
	Subdomain   []string `json:"subdomain"`
	OpenPorts   []int    `json:"openPorts"`
	IpAddresses SubdomainIpAddresses
}

type SubdomainIpAddresses

type SubdomainIpAddresses struct {
	IPv4 []net.IP `json:"ipv4Addresses"`
	IPv6 []net.IP `json:"ipv6Addresses"`
}

Jump to

Keyboard shortcuts

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