Documentation
¶
Index ¶
- Variables
- func Banner()
- func Blue(text string) string
- func Cyan(text string) string
- func EnsureDir(dirName string) error
- func GetFormattedTime() string
- func Green(text string) string
- func InitializeLogger()
- func IsValidIP(ip string) bool
- func IsValidTarget(t string) bool
- func ParseTargetInput(input string) (targets []string, fileMode bool)
- func Red(text string) string
- func SanitizeFileName(name string) string
- func SanitizeString(input string) string
- func SanitizeTarget(t string) string
- func WriteTargetsToFile(filePath string, targets []string) error
- func Yellow(text string) string
- type Config
Constants ¶
This section is empty.
Variables ¶
var ( // MESSAGENS AppName = "ArthxRecon" WelcomeMessage = "Welcome to ArthxRecon!" AppDescription = "A modular recon tool for pentesting" CmdUsage = "Use this tool with the provided subcommands to run various enumeration modules." ErrInvalidIP = "Invalid IP address provided." LogFileNotFound = "Log file not found, using console output." ErrInvalidTarget = "No valid target provided. Use --target to specify IP(s), CIDR, or a file containing targets." FatalErrHD = "Host Discovery Failed!" FatalErrPS = "Port Scan Failed!" FallbackConsoleMsg = "Failed to open log file, using console output" // FallbackConsoleMsg is the message used when the log file cannot be opened. HDAppDescription = "Executes host discovery using Nmap" //CONST DefaultTimeFormat = zerolog.TimeFormatUnix // DefaultTimeFormat defines the default time field format for Zerolog. ConfigFilePath = "config/config.toml" // ConfigFilePath is the path to the configuration file. HostDiscoveryName = "hostDiscovery" PortScanName = "portScan" HostDiscoveryFlagNmap = "-PS22,2222,53,80,443,445,3389" )
Labels centralizes all application messages and texts.
var ( MarkerGreen = Green("[+]") MarkerCyan = Cyan("[*]") MarkerRed = Red("[-]") MarkerYellow = Yellow("[!]") )
Variáveis globais para os printers, criadas uma única vez.
Functions ¶
func GetFormattedTime ¶
func GetFormattedTime() string
GetFormattedTime retorna a data e hora atual formatada no padrão "YYYY/MM/DD HH:MM:SS".
func InitializeLogger ¶
func InitializeLogger()
InitializeLogger configures the global logger using Zerolog. It reads the configuration from the TOML file at ConfigFilePath.
func IsValidTarget ¶
IsValidTarget valida se o target é um IP válido ou um range em CIDR.
func ParseTargetInput ¶
ParseTargetInput verifica se o valor fornecido na flag -t é um arquivo existente. Se for, retorna um slice contendo o próprio caminho e fileMode=true. Caso contrário, considera que o valor é uma lista de targets separados por vírgula, valida cada um e retorna o slice com fileMode=false.
func SanitizeFileName ¶
SanitizeFileName remove caracteres inválidos de um nome de arquivo. Remove caracteres: < > : " / \ | ? *
func SanitizeString ¶
SanitizeString trims spaces from the input string.
func SanitizeTarget ¶
SanitizeTarget substitui "/" por "_" para que o target possa ser usado em nomes de arquivos.
func WriteTargetsToFile ¶
WriteTargetsToFile writes the slice of targets (IPs) to the specified file, one target per line.