types

package module
v1.2.14 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 10 Imported by: 6

README

Vulcan Types

A package that helps guessing the type of an asset

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAWSARN

func IsAWSARN(target string) bool

IsAWSARN returns true if the target is an AWS ARN.

func IsAWSAccount added in v1.1.0

func IsAWSAccount(target string) bool

IsAWSAccount returns true if the target is an AWS account.

func IsCIDR

func IsCIDR(target string) bool

IsCIDR returns true if the target is a CIDR.

func IsDockerImage

func IsDockerImage(target string) bool

IsDockerImage returns true if the target is a Docker image.

The registry must be specified, while the tag is optional:

  • Valid: registry.hub.docker.com/metasploitframework/metasploit-framework:latest
  • Valid: registry.hub.docker.com/metasploitframework/metasploit-framework
  • Valid: registry.hub.docker.com/library/debian
  • Valid: registry.hub.docker.com/path1/path2/artifact (compliant with V2 spec)
  • Valid: registry.hub.docker.com/artifact (compliant with V2 spec)
  • Valid: localhost:5500/library/debian
  • Valid: registry-1.docker.io/library/postgres:latest
  • Valid: docker.io/library/busybox
  • Valid: ghcr.io/puppeteer/puppeteer
  • Not valid: metasploitframework/metasploit-framework:latest
  • Not valid: metasploitframework/metasploit-framework
  • Not valid: debian

func IsDomainName

func IsDomainName(target string) (bool, error)

IsDomainName returns true if a query to a domain server returns a SOA record for the target.

func IsGCPProjectID added in v1.1.1

func IsGCPProjectID(target string) bool

IsGCPProjectID returns true if the target is a GCP Project.

A GCP project id is the unique, user-assigned id of the project. It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. It must start with a letter. Trailing hyphens are prohibited.

Valid: googleproject
Valid: google-project
Valid: google-project123
Valid: google-123-project
Not valid: googleProject
Not valid: google_project
Not valid: google-project-
Not valid: 123-google-project

func IsGitRepository

func IsGitRepository(target string) bool

IsGitRepository returns true if the target has the format of a Git repository.

func IsHost

func IsHost(target string) bool

IsHost returns true if the target is a CIDR with mask '/32'.

func IsHostname

func IsHostname(target string) bool

IsHostname returns true if the target is not an IP but can be resolved to an IP.

func IsHostnameNoDNSResolution added in v1.2.12

func IsHostnameNoDNSResolution(target string) bool

IsHostnameNoDNSResolution returns true if the target is not an IP.

func IsIP

func IsIP(target string) bool

IsIP returns true if the target is an IP address.

func IsURL

func IsURL(target string) bool

IsURL returns true if the target is an absolute URL (it has a non-empty scheme).

This method is kept to don't break compatibility, use IsWebAddress instead.

func IsWebAddress

func IsWebAddress(target string) bool

IsWebAddress returns true if the target is an absolute URL.

  • It has a non-empty scheme (http or https)
  • It has a non-empty hostname

Types

type AssetType added in v1.1.0

type AssetType string
const (
	AWSAccount    AssetType = "AWSAccount"
	DockerImage   AssetType = "DockerImage"
	GitRepository AssetType = "GitRepository"
	IP            AssetType = "IP"
	IPRange       AssetType = "IPRange"
	DomainName    AssetType = "DomainName"
	Hostname      AssetType = "Hostname"
	WebAddress    AssetType = "WebAddress"
)

Asset types for vulcan assets.

func DetectAssetTypes added in v1.1.0

func DetectAssetTypes(identifier string) ([]AssetType, error)

DetectAssetTypes detects the asset types from an identifier.

func Parse added in v1.1.0

func Parse(assetType string) (t AssetType, err error)

Parse parses a string representing an asset type into an AssetType. It returns error if the provided string does not match any known asset type.

func (AssetType) IsValid added in v1.2.0

func (t AssetType) IsValid() bool

IsValid reports whether the AssetType is known. The zero value is considered valid.

func (AssetType) String added in v1.1.0

func (t AssetType) String() string

String returns the string representation of the AssetType.

Jump to

Keyboard shortcuts

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