util

package
v0.0.0-...-386a0b5 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package util provides misc utility functions for gophish

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Benchmark

func Benchmark(start time.Time, name string)

Benchmark logs time since start with a named label Usage: defer util.Benchmark(time.Now(), "something")

func CheckAndCreateSSL

func CheckAndCreateSSL(cp string, kp string) error

CheckAndCreateSSL is a helper to setup self-signed certificates for the administrative interface.

func Deobfuscate

func Deobfuscate(s string) string

Deobfuscate deobfuscates given string

func GenerateSecureKey

func GenerateSecureKey() string

GenerateSecureKey creates a secure key to use as an API key

func GenerateUsername

func GenerateUsername(fullname, email string) string

GenerateUsername generates a pseudo-unique username from the given combination of full name and email. Returns an empty string if both params are blank.

func IsEmail

func IsEmail(s string) bool

IsEmail tells if the given string is a valid email address

func IsLocalBusinessTime

func IsLocalBusinessTime(utcTime time.Time, startTime string, endTime string, tz string) bool

IsLocalBusinessTime tells if the given UTC time is within the given business hours defined in "AM/PM" format (tz time zone is also taken into account)

func IsValidDomain

func IsValidDomain(domain string) bool

IsValidDomain tells if the given string is a valid domain name

func Obfuscate

func Obfuscate(s string) string

Obfuscate obfuscates given string

func ParseCSV

func ParseCSV(r *http.Request) ([]models.Target, error)

ParseCSV contains the logic to parse the user provided csv file containing Target entries

func ParseMail

func ParseMail(r *http.Request) (email.Email, error)

ParseMail takes in an HTTP Request and returns an Email object TODO: This function will likely be changed to take in a []byte

func RandomString

func RandomString(length int) string

RandomString returns random string of the given length

func Reverse

func Reverse(s string) string

Reverse reverses given string

func Rot13

func Rot13(r rune) rune

Rot13 rotates given rune by 13 positions

Types

This section is empty.

Jump to

Keyboard shortcuts

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