utils

package
v0.1.14-beta Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Print a message in yellow colour
	Yellow = color.New(color.FgYellow).SprintFunc()

	// Print a message in red colour
	Red = color.New(color.FgRed).SprintFunc()

	// Print a message in green colour
	Green = color.New(color.FgHiGreen).SprintFunc()

	// Print a message in cyan colour
	Cyan = color.New(color.FgCyan).SprintFunc()

	// Print a message in magenta colour
	Debug = color.New(color.FgMagenta).SprintFunc()

	// Declare wordlists global vars
	DirListMedium, DarkwebTop1000, ExtensionsList, UsersList, SnmpList string

	// Declare globals updated and wordlistsLocated, as these may consume a lot of time and aren't needed more than once
	Updated bool

	// Interrupted global, to show user different info if single IP target was unsuccessful
	Interrupted bool

	// Sync: Define a waitgroup to generate goroutines
	Wg sync.WaitGroup

	// Activate all fuzzing and bruteforcing in the script
	OptBrute = getopt.BoolLong("brute", 'b', "Activate all fuzzing and bruteforcing in the script.")

	// Display help dialogue and exit
	OptHelp = getopt.BoolLong("help", 'h', "Display this help and exit.")

	// Only try to install pre-requisite tools and exit
	OptInstall = getopt.BoolLong("install", 'i', "Only try to install pre-requisite tools and exit.")

	// Select a different base folder for the output
	// Default option: "/tmp/enumeraga_output"
	OptOutput = getopt.StringLong("output", 'o', "/tmp/enumeraga_output", "Select a different base folder for the output.")

	// Run port sweep with nmap and the flag --top-ports=<your input>
	OptTopPorts = getopt.StringLong("top-ports", 'p', "", "Run port sweep with nmap and the flag --top-ports=<your input>")

	// Don't print the banner and decrease overall verbosity
	OptQuiet = getopt.BoolLong("quiet", 'q', "Don't print the banner and decrease overall verbosity.")

	// Specify a CIDR range to use tools for whole subnets
	OptRange = getopt.StringLong("range", 'r', "", "Specify a CIDR range to use tools for whole subnets.")

	// Specify target single IP / List of IPs file.
	OptTarget = getopt.StringLong("target", 't', "", "Specify target single IP / List of IPs file.")

	// Flood your terminal with plenty of verbosity!
	OptVVervose = getopt.BoolLong("vv", 'V', "Flood your terminal with plenty of verbosity!")

	// Declare vars for portsIterator
	Target, BaseDir                                                                                                    string
	VisitedFTP, VisitedSMTP, VisitedHTTP, VisitedIMAP, VisitedSMB, VisitedSNMP, VisitedLDAP, VisitedRsvc, VisitedWinRM bool
)

Declare global variables available throughout Enumeraga

Functions

func AptGetInstallCmd

func AptGetInstallCmd(tool string)

Run the apt-get install <tool> command

func AptGetUpdateCmd

func AptGetUpdateCmd()

Run the apt-get update command

func Consent(tool string) rune

Ask for user consent

func CustomMkdir

func CustomMkdir(name string)

Check first if it is possible to create new dir, and send custom msg if not.

func ErrorMsg

func ErrorMsg(errMsg string)

Custom error message printed out to terminal

func FinishLine

func FinishLine(start time.Time, interrupted bool)

Finish the main flow with time tracker and a couple nice messages to the terminal

func GetWordlists

func GetWordlists()

func InstallMissingTools

func InstallMissingTools()

Instruct the program to try and install tools that are absent from the pentesting distro

func PrintBanner

func PrintBanner()

func PrintCustomBiColourMsg

func PrintCustomBiColourMsg(dominantColour, secondaryColour string, text ...string)

Loop over the necessary colours, printing one at a time

func PrintInstallingTool

func PrintInstallingTool(tool string)

func PrintUsageExamples

func PrintUsageExamples()

func ProtocolDetected

func ProtocolDetected(protocol, baseDir string) string

Announce protocol, create base dir and return its name

func ReadTargetsFile

func ReadTargetsFile(filename string) ([]string, int)

Read a targets file from the argument path passed to -t Return number of targets, one per line

func RemoveDuplicates

func RemoveDuplicates(s string) string

Remove duplicate ports from the comma-separated ports string

func WritePortsToFile

func WritePortsToFile(filePath string, ports string, host string) string

Write bytes output to file

func WriteTextToFile

func WriteTextToFile(filePath string, message string)

Write text to a file

Types

This section is empty.

Jump to

Keyboard shortcuts

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