utils

package
v0.0.0-...-3c44fd7 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Const_notification_delay_unit = 10
	Const_example_target_cidr     = "127.0.0.1/32"
	Const_example_target_desc     = "Target CIDR or /32 for single target"
)
View Source
var (
	Const_UDP_PORTS         = "19,53,69,79,111,123,135,137,138,161,177,445,500,514,520,1434,1900,5353"
	Const_NMAP_SWEEP        = "-n -sn -PE -PP"
	Const_NMAP_TCP_FULL     = "--randomize-hosts -Pn -sS -sC -A -T4 -g53 -p-"
	Const_NMAP_TCP_STANDARD = "--randomize-hosts -Pn -sS -A -T4 -g53 --top-ports 1000"
	Const_NMAP_TCP_PROD     = "--randomize-hosts -Pn -sT -sV -T3 -p-"
	Const_NMAP_TCP_VULN     = "--randomize-hosts -Pn -sT -sV -p- --script=vulscan/vulscan.nse"
	Const_NMAP_UDP_STANDARD = fmt.Sprintf("--randomize-hosts -Pn -sU -sC -A -T4 -p%s", Const_UDP_PORTS)
	Const_NMAP_UDP_PROD     = fmt.Sprintf("--randomize-hosts -Pn -sU -sC -sV -T3 -p%s", Const_UDP_PORTS)
)

NMAP COMMANDS

View Source
var (
	WORDLIST_FUZZ_NAMELIST  = "/usr/share/wfuzz/wordlist/fuzzdb/wordlists-user-passwd/names/namelist.txt"
	WORDLIST_MSF_PWDS       = "/usr/share/wordlists/metasploit/unix_passwords.txt"
	WORDLIST_FINGER_USER    = WORDLIST_FUZZ_NAMELIST
	WORDLIST_FTP_USER       = WORDLIST_FUZZ_NAMELIST
	WORDLIST_SMTP           = WORDLIST_FUZZ_NAMELIST
	WORDLIST_SNMP           = "/usr/share/doc/onesixtyone/dict.txt"
	WORDLIST_DNS_BRUTEFORCE = WORDLIST_FUZZ_NAMELIST
	WORDLIST_HYDRA_SSH_USER = WORDLIST_FUZZ_NAMELIST
	WORDLIST_HYDRA_SSH_PWD  = WORDLIST_MSF_PWDS
	WORDLIST_HYDRA_FTP_USER = WORDLIST_FUZZ_NAMELIST
	WORDLIST_HYDRA_FTP_PWD  = WORDLIST_MSF_PWDS
)

WORDLISTS

View Source
var Config config

Functions

func ChangeOutFolder

func ChangeOutFolder(path string)

ChangeOutFolder Change output folder as instructed by the user and re-init the db

func CheckSudo

func CheckSudo()

CheckSudo Ensures the program is run as root

func CleanPath

func CleanPath(s string) string

CleanPath Replace slashes with underscores, when the string is used in a path

func Connected

func Connected() bool

func EnsureDir

func EnsureDir(dir string)

EnsureDir Ensure the directory exists, or creates it otherwise

func InitConfig

func InitConfig()

InitConfig Initialize global config (db, logger, etc.) From now on it will be accessible as utils.Config

func ParseAddress

func ParseAddress(addr string) (string, bool)

ParseAddress Parse a string, regardless if it is an IP or CIDR, and returns its string representation

func ParseAllArgs

func ParseAllArgs(args []string) string

ParseAllArgs Parse all remaining arguments from command line

func ParseCIDR

func ParseCIDR(s string) (string, error)

ParseCIDR Parse a string and returns the corresponding CIDR and error status

func ParseCmd

func ParseCmd(s string) (string, []string)

ParseCmd Tokenize the command line

func ParseIP

func ParseIP(s string) string

ParseIP Parse a string and returns the corresponding IP address, or nil

func ParseLocalIP

func ParseLocalIP() map[string]string

ParseLocalIP Returns all the addresses of the local network interfaces

func ParseNextArg

func ParseNextArg(args []string) (string, []string)

ParseNextArg Extract the next argument from command line

func RemoveDir

func RemoveDir(dir string)

RemoveDir Delete the specified directory

func ShellCmd

func ShellCmd(cmd string) (string, error)

func WriteArrayToFile

func WriteArrayToFile(path string, s []string)

WriteArrayToFile Given a path and a list of strings, writes them to file

Types

type Logger

type Logger struct{}

func InitLogger

func InitLogger() *Logger

func (*Logger) LogDebug

func (l *Logger) LogDebug(message string)

func (*Logger) LogError

func (l *Logger) LogError(message string)

func (*Logger) LogInfo

func (l *Logger) LogInfo(message string)

func (*Logger) LogNotify

func (l *Logger) LogNotify(message string)

func (*Logger) LogWarning

func (l *Logger) LogWarning(message string)

Jump to

Keyboard shortcuts

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