MCPcopy Create free account

hub / github.com/BishopFox/jsluice / functions

Functions145 in github.com/BishopFox/jsluice

↓ 33 callersMethodChildByFieldName
Fetches a child Node from a named field. For example, the 'pair' node has two fields: key, and value.
tree.go:67
↓ 31 callersMethodType
Type returns the tree-sitter type string for a Node. E.g. string, object, call_expression. If the node is nil then an empty string is returned.
tree.go:58
↓ 29 callersMethodContent
Content returns the source code for a particular node.
tree.go:48
↓ 21 callersMethodNamedChild
NamedChild returns the 'named' child Node at the provided index. Tree-sitter considers a child to be named if it has a name in the syntax tree. Things
tree.go:88
↓ 20 callersMethodRawString
RawString returns the raw JavaScript representation of a string (i.e. escape sequences are left undecoded) but with the surrounding quotes removed.
tree.go:206
↓ 15 callersMethodIsValid
IsValid returns true if the *Node and the underlying tree-sitter node are both not nil.
tree.go:199
↓ 13 callersMethodAsMap
AsMap returns a representation of the Node as a map[string]any
tree.go:256
↓ 13 callersFunctionNewNode
NewNode creates a new Node for the provided tree-sitter node and a byte-slice containing the JavaScript source. The source provided should be the comp
tree.go:34
↓ 13 callersMethodParent
Parent returns the Parent Node for a Node
tree.go:324
↓ 12 callersMethodAsObject
AsObject returns a Node as jsluice's internal object type, to allow the fetching of keys etc
tree.go:43
↓ 11 callersMethodContains
(item string)
set.go:13
↓ 10 callersMethodCollapsedString
CollapsedString takes a node representing a URL and attempts to make it at least somewhat easily parseable. It's common to build URLs out of variables
tree.go:179
↓ 9 callersFunctionNewAnalyzer
NewAnalyzer accepts a slice of bytes representing some JavaScript source code and returns a pointer to a new Analyzer
analyzer.go:23
↓ 7 callersMethodEmit
Emit adds a token of the provided type to the stringLexer's internal list of tokens. The start pointer is advanced to the current position.
strings.go:118
↓ 7 callersMethodIsStringy
IsStringy returns true if a Node is a string or is an expression starting with a string (e.g. a string concatenation expression).
tree.go:470
↓ 6 callersFunctionDecodeString
DecodeString accepts a raw string as it might be found in some JavaScript source code, and converts any escape sequences. E.g: foo\x3dbar -> foo=bar /
strings.go:189
↓ 6 callersMethodGetKeys
GetKeys returns a slice of all keys in an object
objects.go:85
↓ 6 callersMethodNext
Next returns the next rune in the input string, moving the position pointer on by the size of the rune that was decoded. For ASCII text this wouldn't
strings.go:86
↓ 5 callersMethodGetString
GetString returns the property corresponding to the provided key as a string, or the defaultVal if the key is not found.
objects.go:115
↓ 5 callersMethodIgnore
Ignore moves the start position pointer to the current position without emitting a token; effectively ignoring the chunk of text between the last toke
strings.go:129
↓ 5 callersMethodRootNode
RootNode returns the root note of the parsed JavaScript
analyzer.go:63
↓ 4 callersMethodBackup
Backup moves the position pointer back by the length of the previous rune in the input string.
strings.go:99
↓ 4 callersMethodDecodedString
DecodedString returns a fully decoded version of a JavaScript string. It is just a convenience wrapper around the DecodeString function.
tree.go:213
↓ 4 callersMethodGetObject
GetObject returns the property corresponding to the provided key as an Object
objects.go:108
↓ 4 callersMethodGetStringI
GetStringI is like GetString, but the key is case-insensitive
objects.go:124
↓ 4 callersMethodGetURLs
GetURLs searches the JavaScript source code for absolute and relative URLs and returns a slice of results.
url-matchers.go:30
↓ 4 callersFunctionParseUserPatterns
ParseUserPatterns accepts an io.Reader pointing to a JSON user-pattern definition file, and returns a list of UserPatterns, and any error that occurre
user-patterns.go:212
↓ 4 callersMethodString
()
strings.go:27
↓ 3 callersMethodAccept
Accept advances the position pointer only if the next rune is in the set of valid runes provided
strings.go:135
↓ 3 callersMethodAdd
Add accepts a *Node and adds it to the QueryResult, provided it has a valid CaptureName
tree.go:398
↓ 3 callersMethodAsGoType
AsGoType returns a representation of a Node as a native Go type, defaulting to a string containing the JavaScript source for the Node. Return types ar
tree.go:230
↓ 3 callersMethodGet
Get returns the corresponding *Node for the provided capture name, or nil if no such *Node exists
tree.go:415
↓ 3 callersMethodGetNode
GetNode returns the matching *Node for a given key
objects.go:70
↓ 3 callersMethodGetSecrets
GetSecrets uses the parse tree and a set of Matchers (those provided by AllSecretMatchers()) to find secrets in JavaScript source code.
secret-matchers.go:47
↓ 3 callersMethodHasValidNode
HasValidNode returns true if the underlying node is a valid JavaScript object
objects.go:38
↓ 3 callersMethodMatchValue
MatchValue returns true if a pattern's value regex matches the supplied value, or if there is no value regex.
user-patterns.go:64
↓ 3 callersFunctionMaybeURL
(in string)
maybeurl.go:20
↓ 3 callersMethodNamedChildCount
NamedChildCount returns the number of named children a Node has.
tree.go:104
↓ 3 callersMethodNamedChildren
NamedChildren returns a slice of *Node containg all named children for a node.
tree.go:125
↓ 3 callersMethodQuery
Query executes a tree-sitter query on a specific Node. Nodes captured by the query are passed one at a time to the provided callback function. See ht
tree.go:374
↓ 3 callersMethodString
()
cmd/jsluice/main.go:60
↓ 2 callersMethodAcceptN
AcceptN advances the position pointer N times, only if the next N runes are in the set of valid runes provided
strings.go:145
↓ 2 callersMethodAcceptRun
AcceptRun accepts runes until encountering a rune not in the set of valid runes provided
strings.go:165
↓ 2 callersMethodChildCount
ChildCount returns the number of children a node has
tree.go:96
↓ 2 callersMethodFormat
Format outputs a nicely formatted version of the source code for the Node. Formatting is done by https://github.com/ditashi/jsbeautifier-go/
tree.go:363
↓ 2 callersMethodGetNodeFunc
GetNodeFunc is a general-purpose method for finding object properties by their key. The provided function is called with each key in turn. The first t
objects.go:46
↓ 2 callersMethodIsNamed
IsNamed returns true if the underlying node is named
tree.go:332
↓ 2 callersFunctionNewObject
NewObject returns a jsluice Object for the given Node
objects.go:16
↓ 2 callersMethodQuery
Query peforms a tree-sitter query on the JavaScript being analyzed. The provided function is called once for every node that captured by the query. Se
analyzer.go:49
↓ 2 callersMethodSet
(value string)
cmd/jsluice/main.go:64
↓ 2 callersFunctioncouldBePath
(in string)
cmd/jsurls-sinks/main.go:122
↓ 2 callersFunctiondequote
dequote removes surround quotes from the provided string
tree.go:495
↓ 2 callersFunctiondequote
(in string)
cmd/jsurls-sinks/main.go:192
↓ 2 callersMethodget
(k *Node)
url-match-xhr.go:27
↓ 2 callersFunctionisProbablyHTML
isProbablyHTML returns true for source that is probably HTML. False positives are OK as long as the false positives are not JavaScript source.
analyzer.go:70
↓ 2 callersFunctionnewSet
(items []string)
set.go:5
↓ 2 callersMethodpairMatcher
pairMatcher returns a SecretMatcher for matching against key/value pairs
user-patterns.go:127
↓ 2 callersFunctionstartsWithString
(in string)
cmd/jsurls-sinks/main.go:109
↓ 1 callersMethodAcceptUntil
AcceptUntil accepts any runes until the rune provided is encountered
strings.go:157
↓ 1 callersMethodAddSecretMatcher
AddSecretMatcher allows custom SecretMatchers to be added to the Analyzer
secret-matchers.go:28
↓ 1 callersMethodAddSecretMatchers
AddSecretMatchers allows multiple custom SecretMatchers to be added to the Analyzer
secret-matchers.go:37
↓ 1 callersMethodAddURLMatcher
AddURLMatcher allows custom URLMatchers to be added to the Analyzer
url-matchers.go:129
↓ 1 callersFunctionAllSecretMatchers
AllSecretMatchers returns the default list of SecretMatchers
secret-matchers.go:91
↓ 1 callersFunctionAllURLMatchers
AllURLMatchers returns the detault list of URLMatchers
url-matchers.go:144
↓ 1 callersMethodAsArray
AsArray returns a representation of the Node as a []any
tree.go:279
↓ 1 callersMethodAsNumber
AsNumber returns a representation of the Node as an int or float64. Note: hex, octal etc number formats are currently unsupported
tree.go:298
↓ 1 callersMethodCaptureName
CaptureName returns the name given to a node in a query if one exists, and an empty string otherwise
tree.go:490
↓ 1 callersMethodChild
Child returns the child Node at the provided index
tree.go:75
↓ 1 callersMethodGetNodeI
GetNodeI is like GetNode, but case-insensitive
objects.go:77
↓ 1 callersMethodHas
Has returns true if the QueryResult contains a *Node for the provided capture name
tree.go:408
↓ 1 callersMethodMatchKey
MatchKey returns true if a pattern's key regex matches the supplied value, or if there is no key regex
user-patterns.go:73
↓ 1 callersFunctionNewQueryResult
NewQueryResult returns a QueryResult containing the provided *Nodes
tree.go:386
↓ 1 callersMethodParseRegex
ParseRegex parses all of the user-provided regular expressions for a pattern into Go *regexp.Regexp types
user-patterns.go:28
↓ 1 callersMethodPeek
Peek returns the next rune in the input string without advancing the position pointer
strings.go:109
↓ 1 callersFunctionPrintTree
PrintTree returns a string representation of the syntax tree for the provided JavaScript source
tree.go:510
↓ 1 callersMethodQueryMulti
QueryMulti executes a tree-sitter query on a specific Node. Nodes captured by the query are grouped into a QueryResult and passed to the provided call
tree.go:428
↓ 1 callersMethodQueryMulti
Query peforms a tree-sitter query on the JavaScript being analyzed. The provided function is called for every query match, with captured nodes grouped
analyzer.go:58
↓ 1 callersMethodSecretMatcher
SecretMatcher returns a SecretMatcher based on the UserPattern, for use with (*Analyzer).AddSecretMatcher()
user-patterns.go:82
↓ 1 callersMethodSecretMatchers
SecretMatchers returns a slice of SecretMatcher for use with (*Analyzer).AddSecretMatchers()
user-patterns.go:200
↓ 1 callersMethodType
()
cmd/jsluice/main.go:69
↓ 1 callersFunctionawsMatcher
()
secret-aws.go:8
↓ 1 callersFunctioncontent
content returns the source for the provided tree-sitter node, checking if the node is nil first.
tree.go:501
↓ 1 callersFunctionextractInlineJS
extractInlineJS extracts inline JavaScript from HTML pages using goquery.
analyzer.go:86
↓ 1 callersFunctionfirebaseMatcher
()
secret-gcp.go:51
↓ 1 callersFunctiongcpKeyMatcher
()
secret-gcp.go:8
↓ 1 callersFunctiongetTree
getTree does the actual heavy lifting and recursion for PrintTree TODO: provide a way to print the tree as a JSON object?
tree.go:522
↓ 1 callersFunctiongithubKeyMatcher
()
secret-github.go:7
↓ 1 callersFunctionmatchJQuery
()
url-match-jquery.go:9
↓ 1 callersFunctionmatchXHR
()
url-match-xhr.go:34
↓ 1 callersFunctionnewNodeCache
()
url-match-xhr.go:15
↓ 1 callersFunctionnewStringLexer
(in string)
strings.go:71
↓ 1 callersMethodobjectMatcher
objectMatcher returns a SecretMatcher for matching against objects
user-patterns.go:95
↓ 1 callersFunctionqueryNodes
(n *sitter.Node, enter func(*sitter.Node))
cmd/jsurls-sinks/main.go:134
↓ 1 callersFunctionreadFromFileOrURL
(path string, cookie string, headers []string, ignoreCert bool)
cmd/jsluice/main.go:295
↓ 1 callersFunctionreadWARCFile
(filename string)
cmd/jsluice/main.go:343
↓ 1 callersMethodset
(k *Node, v []*Node)
url-match-xhr.go:21
↓ 1 callersMethodstringMatcher
stringMatcher returns a SecretMatcher for matching against string literals
user-patterns.go:166
↓ 1 callersFunctionunique
(items []T)
url-matchers.go:107
MethodAsMap
AsMap returns a Go map version of the object
objects.go:24
FunctionBenchmarkDecodeString
(b *testing.B)
strings_test.go:53
next →1–100 of 145, ranked by callers