Documentation ¶
Index ¶
- Variables
- func ExtractBodyEndpoints(data string) []string
- func ExtractRelativeEndpoints(data string) []string
- func FlattenHeaders(headers map[string][]string) map[string]string
- func FormInputFillSuggestions(inputs []FormInput) mapsutil.OrderedMap[string, string]
- func IsPathCommonJSLibraryFile(path string) bool
- func IsURL(url string) bool
- func ParseFormFields(document *goquery.Document) []navigation.Form
- func ParseLinkTag(value string) []string
- func ParseRefreshTag(value string) string
- func ParseSRCSetTag(value string) []string
- func ReplaceAllQueryParam(reqUrl, val string) string
- func WebUserAgent() string
- type FormFillData
- type FormInput
- type JSLuiceEndpoint
Constants ¶
This section is empty.
Variables ¶
var ( BodyA0 = `(?:` BodyB0 = `(` BodyC0 = `(?:[\.]{1,2}/[A-Za-z0-9\-_/\\?&@\.?=%]+)` BodyC1 = `|(https?://[A-Za-z0-9_\-\.]+([\.]{0,2})?\/[A-Za-z0-9\-_/\\?&@\.?=%]+)` BodyC2 = `|(/[A-Za-z0-9\-_/\\?&@\.%]+\.(aspx?|action|cfm|cgi|do|pl|css|x?html?|js(p|on)?|pdf|php5?|py|rss))` BodyC3 = `|([A-Za-z0-9\-_?&@\.%]+/[A-Za-z0-9/\\\-_?&@\.%]+\.(aspx?|action|cfm|cgi|do|pl|css|x?html?|js(p|on)?|pdf|php5?|py|rss))` BodyB1 = `)` BodyA1 = `)` JsA0 = `(?:"|'|\s)` JsB0 = `(` JsC0 = `((https?://[A-Za-z0-9_\-\.]+(:\d{1,5})?)+([\.]{1,2})?/[A-Za-z0-9/\-_\.\\%]+([\?|#][^"']+)?)` JsC1 = `|((\.{1,2}/)?[a-zA-Z0-9\-_/\\%]+\.(aspx?|js(on|p)?|html|php5?|html|action|do)([\?|#][^"']+)?)` JsC2 = `|((\.{0,2}/)[a-zA-Z0-9\-_/\\%]+(/|\\)[a-zA-Z0-9\-_]{3,}([\?|#][^"|']+)?)` JsC3 = `|((\.{0,2})[a-zA-Z0-9\-_/\\%]{3,}/)` JsB1 = `)` JsA1 = `(?:"|'|\s)` )
var ( // CommonJSLibraryFileRegex is a regex to match common js library files. CommonJSLibraryFileRegex = `` /* 367-byte string literal not displayed */ )
var DefaultFormFillData = FormFillData{ Email: fmt.Sprintf("%s@katanacrawler.io", xid.New().String()), Color: "#e66465", Password: "katanaP@assw0rd1", PhoneNumber: "2124567890", Placeholder: "katana", }
Functions ¶
func ExtractBodyEndpoints ¶
ExtractBodyEndpoints extracts body endpoints from a data item
func ExtractRelativeEndpoints ¶
ExtractRelativeEndpoints extracts relative endpoints from a data item
func FormInputFillSuggestions ¶
func FormInputFillSuggestions(inputs []FormInput) mapsutil.OrderedMap[string, string]
FormInputFillSuggestions returns a list of form filling suggestions for inputs returning the specified recommended values.
func IsPathCommonJSLibraryFile ¶
IsPathCommonJSLibraryFile checks if a given path is a common js library file.
func ParseFormFields ¶
func ParseFormFields(document *goquery.Document) []navigation.Form
parses form, input, textarea & select elements
func ParseLinkTag ¶
ParseLinkTag parses link tag values returning found urls
Inspired from: https://github.com/tomnomnom/linkheader
func ParseRefreshTag ¶
ParseRefreshTag parses refresh tag values returning found urls
func ParseSRCSetTag ¶
ParseSRCSetTag parses srcset tag returning found URLs
func ReplaceAllQueryParam ¶
ReplaceAllQueryParam replaces all the query param with the given value
Types ¶
type FormFillData ¶
type FormFillData struct { Email string `yaml:"email"` Color string `yaml:"color"` Password string `yaml:"password"` PhoneNumber string `yaml:"phone"` Placeholder string `yaml:"placeholder"` }
FormFillData contains suggestions for form filling
var FormData FormFillData
FormData is the global form fill data instance
type FormInput ¶
type FormInput struct { Type string Name string Value string Attributes mapsutil.OrderedMap[string, string] }
FormInput is an input for a form field
func ConvertGoquerySelectionToFormInput ¶
ConvertGoquerySelectionToFormInput converts goquery selection to form input
type JSLuiceEndpoint ¶
func ExtractJsluiceEndpoints ¶
func ExtractJsluiceEndpoints(data string) []JSLuiceEndpoint
ExtractJsluiceEndpoints extracts jsluice endpoints from a given string.
We use tomnomnom and bishopfox's jsluice to extract endpoints from javascript files.
We apply several optimizations before running jsluice:
- We skip common js library files.
- We skip lines that are too long and contain a lot of characters.