Documentation ¶
Index ¶
- func CompareDates(date1, date2 time.Time) bool
- func ConvertToStringSlice(rawMsg json.RawMessage) []string
- func ConvertURLToDomain(inputURL string) string
- func CreateFileRequest(src, content, fileType string) types.FileRequest
- func CurrentDate() time.Time
- func ExtractTitle(doc *html.Node) string
- func GenerateID() string
- func Get24HoursAgo() time.Time
- func GetCurrentTime() time.Time
- func IPNetsToStrings(ipnets []*net.IPNet) []string
- func IPsToStrings(ips []net.IP) []string
- func IsFont(node *html.Node) bool
- func IsLocalURL(input string) bool
- func IsNumeric(s string) bool
- func IsStylesheet(node *html.Node) bool
- func MD5(data string) string
- func NewSecret(regex string) string
- func NormalizeURL(input string) string
- func ParseQuery(query string) (map[string][]string, error)
- func ParseUint(input string) (uint, error)
- func ProcessFontNode(node *html.Node) types.FileRequest
- func ProcessLinkNode(node *html.Node) types.FileRequest
- func ProcessScriptNode(node *html.Node) types.FileRequest
- func ProcessStyleNode(node *html.Node) types.FileRequest
- func SHA1(data string) string
- func SHA256(data string) string
- func SafeString(s string) string
- func StripProtocol(url string) string
- func TraverseHTML(node *html.Node, fn func(*html.Node))
- func URIsToStrings(uris []*url.URL) []string
- func ValidateURL(input string) bool
- type FileType
- type Match
- type RegexPattern
- type RegexReturn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareDates ¶
func ConvertToStringSlice ¶
func ConvertToStringSlice(rawMsg json.RawMessage) []string
func ConvertURLToDomain ¶
func CreateFileRequest ¶
func CreateFileRequest(src, content, fileType string) types.FileRequest
CreateFileRequest constructs a FileRequest with content details.
func CurrentDate ¶
func ExtractTitle ¶
ExtractTitle retrieves the title from the parsed HTML.
func GenerateID ¶
func GenerateID() string
func Get24HoursAgo ¶
func GetCurrentTime ¶
func IPNetsToStrings ¶
func IPsToStrings ¶
func IsLocalURL ¶
Check if the URL is local or remote. If local then return true, otherwise false.
func IsStylesheet ¶
IsStylesheet checks if a link element is a stylesheet.
func NormalizeURL ¶
NormalizeURL formats the URL into a standard form, adds 'https' if necessary, removes 'www.' and trailing slashes.
func ParseUint ¶
ParseUint safely parses a string to uint, with an upper bound check for 32-bit systems.
func ProcessFontNode ¶
func ProcessFontNode(node *html.Node) types.FileRequest
ProcessFontNode extracts data from a link element if it's a font.
func ProcessLinkNode ¶
func ProcessLinkNode(node *html.Node) types.FileRequest
ProcessLinkNode extracts data from a link element if it's a stylesheet.
func ProcessScriptNode ¶
func ProcessScriptNode(node *html.Node) types.FileRequest
ProcessScriptNode extracts data from a script element.
func ProcessStyleNode ¶
func ProcessStyleNode(node *html.Node) types.FileRequest
ProcessStyleNode extracts data from a style element.
func SafeString ¶
SafeString returns a default value if the string is empty
func StripProtocol ¶
func TraverseHTML ¶
TraverseHTML recursively walks through the HTML nodes and applies the given function.
func URIsToStrings ¶
func ValidateURL ¶
ValidateURL checks if a URL is valid, looking for malformed URLs, SQL injection patterns, and illegal characters.
Types ¶
type Match ¶
type Match struct { Match string `json:"match"` Line int `json:"line"` Source string `json:"source"` }
func GenericScan ¶
func GenericScan(rule types.Rule, script types.FileRequest) []Match