utils

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Permission0755 = 0755
	Permission0644 = 0644
)

Variables

This section is empty.

Functions

func CreateHostOutputFolder added in v1.3.2

func CreateHostOutputFolder(host string)

CreateHostOutputFolder creates the host output folder for the HTTP responses. If it fails exits with an error message.

func CreateIndexOutputFile added in v1.3.2

func CreateIndexOutputFile(filename string)

CreateIndexOutputFile takes as input the name of the index file. It creates the output folder if needed, then checks if the index output file already exists, if no cariddi creates it. Whenever an instruction fails, it exits with an error message.

func CreateOutputFile

func CreateOutputFile(target string, subcommand string, format string) string

CreateOutputFile takes as input a target (of the attack), a subcommand and a format (json-html-txt). It creates the output folder if needed, then checks if the output file already exists, if yes asks the user if cariddi has to overwrite it; if no cariddi creates it. Whenever an instruction fails, it exits with an error message.

func CreateOutputFolder

func CreateOutputFolder()

CreateOutputFolder creates the output folder If it fails exits with an error message.

func ElementExists

func ElementExists(path string) (bool, error)

ElementExists returns whether the given file or directory exists.

func ReadEntireFile

func ReadEntireFile(inputFile string) []byte

ReadEntireFile returns the content of the inputted file.

func ReadFile

func ReadFile(inputFile string) []string

ReadFile reads a file line per line and returns a slice of strings.

func ReadHTTPRequestFromFile

func ReadHTTPRequestFromFile(inputFile string) (*http.Request, error)

ReadHTTPRequestFromFile reads from a file an HTTP request and returns a *http.Request object.

func ReplaceBadCharacterOutput

func ReplaceBadCharacterOutput(input string) string

ReplaceBadCharacterOutput replaces forward-slashes with dashes (to avoid problems with output folder).

Types

This section is empty.

Jump to

Keyboard shortcuts

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