utils

package
v0.0.0-...-17b0823 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config config

--------------------------------------------------------------------------------------- CONSTANTS ---------------------------------------------------------------------------------------

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

NMAP COMMANDS

View Source
var Const_example_target_cidr = "127.0.0.1/32"
View Source
var Const_example_target_desc = "Target CIDR or /32 for single target"
View Source
var Const_notification_delay_unit = 10
View Source
var WORDLIST_DNS_BRUTEFORCE = WORDLIST_FUZZ_NAMELIST
View Source
var WORDLIST_FINGER_USER = WORDLIST_FUZZ_NAMELIST
View Source
var WORDLIST_FTP_USER = WORDLIST_FUZZ_NAMELIST
View Source
var WORDLIST_FUZZ_NAMELIST = "/usr/share/wfuzz/wordlist/fuzzdb/wordlists-user-passwd/names/namelist.txt"

WORDLISTS

View Source
var WORDLIST_HYDRA_FTP_PWD = WORDLIST_MSF_PWDS
View Source
var WORDLIST_HYDRA_FTP_USER = WORDLIST_FUZZ_NAMELIST
View Source
var WORDLIST_HYDRA_SSH_PWD = WORDLIST_MSF_PWDS
View Source
var WORDLIST_HYDRA_SSH_USER = WORDLIST_FUZZ_NAMELIST
View Source
var WORDLIST_MSF_PWDS = "/usr/share/wordlists/metasploit/unix_passwords.txt"
View Source
var WORDLIST_SMTP = WORDLIST_FUZZ_NAMELIST
View Source
var WORDLIST_SNMP = "/usr/share/doc/onesixtyone/dict.txt"

Functions

func ChangeOutFolder

func ChangeOutFolder(path string)

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

func CheckSudo

func CheckSudo()

--------------------------------------------------------------------------------------- MANAGE FILES --------------------------------------------------------------------------------------- Ensures the program is run as root

func CleanPath

func CleanPath(s string) string

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

func Connected

func Connected() bool

func EnsureDir

func EnsureDir(dir string)

Ensure the directory exists, or creates it otherwise

func InitConfig

func 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)

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

func ParseAllArgs

func ParseAllArgs(args []string) string

Parse all remaining arguments from command line

func ParseCIDR

func ParseCIDR(s string) (string, error)

Parse a string and returns the corresponding CIDR and error status

func ParseCmd

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

--------------------------------------------------------------------------------------- MANAGE COMMANDS --------------------------------------------------------------------------------------- Tokenize the command line

func ParseIP

func ParseIP(s string) string

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

func ParseLocalIP

func ParseLocalIP() map[string]string

--------------------------------------------------------------------------------------- IP addresses --------------------------------------------------------------------------------------- Returns all the addresses of the local network interfaces

func ParseNextArg

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

Extract the next argument from command line

func RemoveDir

func RemoveDir(dir string)

Delete the specified directory

func ShellCmd

func ShellCmd(cmd string) (string, error)

func WriteArrayToFile

func WriteArrayToFile(path string, s []string)

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

Types

type Logger

type Logger struct{}

--------------------------------------------------------------------------------------- LOGGER ---------------------------------------------------------------------------------------

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