flags

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XSSWordlistURL             = "https://raw.githubusercontent.com/Nowafen/Raven/refs/heads/main/wl/xss.txt"
	XSSWordlistPath            = "/tmp/.raven/wordlists/xss.txt"
	SSTIWordlistURL            = "https://raw.githubusercontent.com/Nowafen/Raven/refs/heads/main/wl/ssti.txt"
	SSTIWordlistPath           = "/tmp/.raven/wordlists/ssti.txt"
	SQLiWordlistURL            = "https://raw.githubusercontent.com/Nowafen/Raven/refs/heads/main/wl/sqli.txt"
	SQLiWordlistPath           = "/tmp/.raven/wordlists/sqli.txt"
	CmdInjectionWordlistURL    = "https://raw.githubusercontent.com/Nowafen/Raven/refs/heads/main/wl/ci.txt"
	CmdInjectionWordlistPath   = "/tmp/.raven/wordlists/ci.txt"
	CacheDeceptionWordlistURL  = "https://raw.githubusercontent.com/Nowafen/Raven/refs/heads/main/wl/wcd.txt"
	CacheDeceptionWordlistPath = "/tmp/.raven/wordlists/wcd.txt"
)

Vulnerability wordlist URLs and paths

View Source
const DefaultBackupPath = "/tmp/.raven/backup.txt"
View Source
const DefaultBackupURL = "https://raw.githubusercontent.com/Nowafen/Raven/refs/heads/main/backup.txt"

DefaultBackupURL is the URL to download the default backup paths wordlist

View Source
const DefaultFilterWordsPath = "/tmp/.raven/filter_words.json"
View Source
const DefaultFilterWordsURL = "https://raw.githubusercontent.com/Nowafen/Raven/refs/heads/main/Config/filter_words.json"

DefaultFilterWordsURL is the URL to download the default filter words JSON

View Source
const DefaultWordlistPath = "/tmp/.raven/wordlist.txt"
View Source
const DefaultWordlistURL = "https://raw.githubusercontent.com/Nowafen/Raven/refs/heads/main/wordlist.txt"

DefaultWordlistURL is the URL to download the default wordlist for subdomain discovery

View Source
const Version = "0.1.6"

Version is the current version of the Raven tool

View Source
const VersionURL = "https://raw.githubusercontent.com/Nowafen/Raven/refs/heads/main/Version.json"

VersionURL is the URL to check the latest version and binary URL

Variables

View Source
var DefaultDNSServers = []string{
	"8.8.8.8:53",
	"8.8.4.4:53",
	"1.1.1.1:53",
	"1.0.0.1:53",
	"9.9.9.9:53",
}

DefaultDNSServers defines a list of default public DNS servers

View Source
var HeaderSlice []string

Functions

func CheckVersion

func CheckVersion() (bool, error)

CheckVersion checks if the current version is outdated

func DisableConfigFile added in v0.1.4

func DisableConfigFile() error

DisableConfigFile sets activation: false in the YAML config file

func DownloadVulnWordlist added in v0.1.6

func DownloadVulnWordlist(url, path string, silent bool, vuln string) error

DownloadVulnWordlist downloads a vulnerability-specific wordlist

func EnableConfigFile added in v0.1.4

func EnableConfigFile() error

EnableConfigFile sets activation: true in the YAML config file

func IsDNSServer added in v0.1.4

func IsDNSServer(server string) bool

IsDNSServer checks if a server is a valid and responsive DNS server

func OutputResults

func OutputResults(results []Result, cfg Config)

OutputResults is a placeholder for compatibility (no longer used for printing)

func ParseHeaders

func ParseHeaders(headers []string) map[string]string

ParseHeaders parses header flag values

func ParseIPRange added in v0.1.5

func ParseIPRange(cidr string) ([]string, error)

ParseIPRange extracts all IP addresses from a CIDR range

func ParseStatusRange added in v0.1.4

func ParseStatusRange(value string) ([]int, error)

ParseStatusRange parses a status code or range

func PrintMainHelp added in v0.1.6

func PrintMainHelp()

PrintMainHelp displays the main help message for `raven` or `raven -h`

func PrintSubcommandGuide added in v0.1.6

func PrintSubcommandGuide(subcommand string) bool

PrintSubcommandGuide displays detailed guide for a specific subcommand

func PrintSubcommandHelp added in v0.1.6

func PrintSubcommandHelp(subcommand string) bool

PrintSubcommandHelp displays short help for a specific subcommand

func ReadWordlist

func ReadWordlist(path string, silent bool, mode string) ([]string, int, error)

ReadWordlist reads the wordlist from the given path or downloads the default based on mode

func ResetConfigFile added in v0.1.4

func ResetConfigFile() error

ResetConfigFile downloads the default config file from GitHub and saves it

func ResolveSubdomain added in v0.1.4

func ResolveSubdomain(subdomain string, servers []string) (bool, error)

ResolveSubdomain checks if a subdomain resolves using the configured DNS servers

func SetupProxyTransport added in v0.1.4

func SetupProxyTransport(transport *http.Transport, proxy string) error

SetupProxyTransport configures the HTTP transport with the given proxy

func ShowConfigFile added in v0.1.4

func ShowConfigFile() error

ShowConfigFile displays the content of the YAML config file without any comments

func ShowVersion

func ShowVersion() (string, error)

ShowVersion returns the latest version and checks if the current version is outdated

func UpdateBinary

func UpdateBinary() error

UpdateBinary updates the Raven binary to the latest version using curl

func ValidateAPIPath added in v0.1.6

func ValidateAPIPath(path string) error

ValidateAPIPath validates the API path

func ValidateDomain

func ValidateDomain(cfg *Config) error

ValidateDomain validates the domain, IP, or CIDR range and extracts protocol

func ValidateListFile added in v0.1.5

func ValidateListFile(path, mode string) error

ValidateListFile validates the list file

func ValidateMethod

func ValidateMethod(method string) error

ValidateMethod validates the HTTP method

func ValidatePacket added in v0.1.6

func ValidatePacket(path string) error

ValidatePacket validates the packet file

func ValidateProxy

func ValidateProxy(proxy string) error

ValidateProxy validates the proxy URL format and content

func ValidateScanMethod added in v0.1.6

func ValidateScanMethod(method string) error

ValidateScanMethod validates the scan-method flag

func ValidateThreads

func ValidateThreads(threads int) error

ValidateThreads validates the threads flag

func ValidateVulnInputs added in v0.1.6

func ValidateVulnInputs(packet, apiPath string) error

ValidateVulnInputs ensures only one of packet or API path is provided

func ValidateWordlist

func ValidateWordlist(path string, mode string) error

ValidateWordlist validates the wordlist path for the given mode

Types

type Config

type Config struct {
	Target       string
	Wordlist     string
	List         string
	Headers      map[string]string
	Method       string
	Output       string
	Silent       bool
	FilterCode   []int
	MatchCode    []int
	Proxy        string
	Threads      int
	Rate         float64
	Validate     bool
	DNS          string
	ResolverCfg  ResolverConfig
	UseDNS       bool
	ConfigFile   YAMLConfig
	ConfigAction string
	Progress     bool
	Protocol     string
	IPRange      []string
	Vuln         string
	Packet       string
	API          string
	Debug        bool
	Version      bool
	Update       bool
}

Config holds all configuration options

func ParseFlags

func ParseFlags(subcommand string, args []string) (Config, error)

ParseFlags parses command-line flags for a given subcommand

type ResolverConfig added in v0.1.4

type ResolverConfig struct {
	Servers []string
}

ResolverConfig holds DNS resolver configuration

func ValidateResolver added in v0.1.4

func ValidateResolver(resolver string) (ResolverConfig, error)

ValidateResolver validates the resolver input (IP or file)

type Result

type Result struct {
	Subdomain  string
	StatusCode int
	Status     string
}

Result holds the scan result for a subdomain

type VersionInfo added in v0.1.3

type VersionInfo struct {
	Version string `json:"version"`
	URL     string `json:"url"`
}

VersionInfo holds the version and binary URL from version.json

func GetVersionInfo added in v0.1.3

func GetVersionInfo() (VersionInfo, error)

GetVersionInfo fetches the version and binary URL from VersionURL

type YAMLConfig added in v0.1.4

type YAMLConfig struct {
	Info struct {
		Name    string `yaml:"name"`
		Author  string `yaml:"author"`
		Version string `yaml:"version"`
	} `yaml:"info"`
	Project struct {
		GitHub  string `yaml:"github"`
		Default string `yaml:"default"`
	} `yaml:"project"`
	FlagConfig struct {
		SyntaxTypes []string `yaml:"Syntax-1 types"`
		Wordlist    struct {
			Path        string `yaml:"path"`
			ConfigUsing *bool  `yaml:"Wordlist-config-using"`
		} `yaml:"Wordlist"`
		Resolvers struct {
			Path        string `yaml:"path"`
			DNSServer   string `yaml:"dns-server"`
			ConfigUsing *bool  `yaml:"Resolvers-config-using"`
		} `yaml:"Resolvers"`
		Proxy struct {
			URL         string `yaml:"url"`
			Port        string `yaml:"port"`
			ConfigUsing *bool  `yaml:"Proxy-config-using"`
		} `yaml:"Proxy"`
		Method struct {
			GET         string `yaml:"GET"`
			POST        string `yaml:"POST"`
			HEAD        string `yaml:"HEAD"`
			TRACE       string `yaml:"TRACE"`
			ConfigUsing *bool  `yaml:"Method-config-using"`
		} `yaml:"Method"`
		Header struct {
			Items []struct {
				Key   string `yaml:"key"`
				Value string `yaml:"value"`
			} `yaml:"items"`
			ConfigUsing *bool `yaml:"Header-config-using"`
		} `yaml:"Header"`
	} `yaml:"Flag config"`
	Syntax struct {
		SyntaxTypes []string `yaml:"Syntax-2 Types"`
		MethodTypes []struct {
			Name        string `yaml:"name"`
			Description string `yaml:"description"`
		} `yaml:"Method Types"`
		Body struct {
			Filters  []string `yaml:"filters"`
			Matchers []string `yaml:"matchers"`
		} `yaml:"body"`
		Header struct {
			Filters []struct {
				Key   string `yaml:"key"`
				Value string `yaml:"value"`
			} `yaml:"filters"`
			Matchers []struct {
				Key   string `yaml:"key"`
				Value string `yaml:"value"`
			} `yaml:"matchers"`
		} `yaml:"header"`
		Status struct {
			Filters  []string `yaml:"filters"`
			Matchers []string `yaml:"matchers"`
			All      *string  `yaml:"all"`
		} `yaml:"status"`
		ConfigUsing *bool `yaml:"Syntax-config-using"`
	} `yaml:"Syntax"`
	Active bool `yaml:"activation"`
}

YAMLConfig holds the parsed YAML configuration

Jump to

Keyboard shortcuts

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