Documentation ¶
Overview ¶
Package util provides misc utility functions for gophish
Index ¶
- func Benchmark(start time.Time, name string)
- func CheckAndCreateSSL(cp string, kp string) error
- func Deobfuscate(s string) string
- func GenerateSecureKey() string
- func GenerateUsername(fullname, email string) string
- func IsEmail(s string) bool
- func IsLocalBusinessTime(utcTime time.Time, startTime string, endTime string, tz string) bool
- func IsValidDomain(domain string) bool
- func Obfuscate(s string) string
- func ParseCSV(r *http.Request) ([]models.Target, error)
- func ParseMail(r *http.Request) (email.Email, error)
- func RandomString(length int) string
- func Reverse(s string) string
- func Rot13(r rune) rune
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Benchmark ¶
Benchmark logs time since start with a named label Usage: defer util.Benchmark(time.Now(), "something")
func CheckAndCreateSSL ¶
CheckAndCreateSSL is a helper to setup self-signed certificates for the administrative interface.
func GenerateSecureKey ¶
func GenerateSecureKey() string
GenerateSecureKey creates a secure key to use as an API key
func GenerateUsername ¶
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 IsLocalBusinessTime ¶
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 ¶
IsValidDomain tells if the given string is a valid domain name
func ParseCSV ¶
ParseCSV contains the logic to parse the user provided csv file containing Target entries
func ParseMail ¶
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 ¶
RandomString returns random string of the given length
Types ¶
This section is empty.