Indexed by TopGit from live GitHub metadata: BishopFox/jsluice has 2.0k stars, written primarily in Go. Extract URLs, paths, secrets, and other interesting bits from JavaScript
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
jsluice is a Go package and command-line tool for extracting URLs, paths, secrets,
and other interesting data from JavaScript source code.
If you want to do those things right away: look at the command-line tool.
If you want to integrate jsluice's capabilities with your own project: look at the examples,
and read the package documentation.
Install
To install the command-line tool, run:
▶ go install github.com/BishopFox/jsluice/cmd/jsluice@latest
To add the package to your project, run:
▶ go get github.com/BishopFox/jsluice
Extracting URLs
Rather than using regular expressions alone, jsluice uses go-tree-sitter to look for places that URLs are known to be used,
such as being assigned to document.location, passed to window.open(), or passed to fetch() etc.
jsluice understands string concatenation, and replaces any expressions it cannot know the value
of with EXPR. Although not a foolproof solution, this approach results in a valid URL or path
more often than not, and means that it's possible to discover things that aren't easily found using
other approaches. In this case, a naive regular expression may well miss the method query string
parameter:
jsluice comes with some built-in URL matchers for common scenarios, but you can add more
with the AddURLMatcher function:
analyzer := jsluice.NewAnalyzer([]byte(`
var fn = () => {
var meta = {
contact: "mailto:[email protected]",
home: "https://example.com"
}
return meta
}
`))
analyzer.AddURLMatcher(
// The first value in the jsluice.URLMatcher struct is the type of node to look for.
// It can be one of "string", "assignment_expression", or "call_expression"
jsluice.URLMatcher{"string", func(n *jsluice.Node) *jsluice.URL {
val := n.DecodedString()
if !strings.HasPrefix(val, "mailto:") {
return nil
}
return &jsluice.URL{
URL: val,
Type: "mailto",
}
}},
)
for _, match := range analyzer.GetURLs() {
fmt.Println(match.URL)
}
There's a copy of this example here. You can run it like this:
▶ go run examples/urlmatcher/main.go
mailto:[email protected]
https://example.com
jsluice doesn't match mailto: URIs by default, it was found by the custom URLMatcher.
Extracting Secrets
As well as URLs, jsluice can extract secrets. As with URL extraction, custom matchers can
be supplied to supplement the default matchers. There's a short example program here
that does just that:
analyzer := jsluice.NewAnalyzer([]byte(`
var config = {
apiKey: "AUTH_1a2b3c4d5e6f",
apiURL: "https://api.example.com/v2/"
}
`))
analyzer.AddSecretMatcher(
// The first value in the jsluice.SecretMatcher struct is a
// tree-sitter query to run on the JavaScript source.
jsluice.SecretMatcher{"(pair) @match", func(n *jsluice.Node) *jsluice.Secret {
key := n.ChildByFieldName("key").DecodedString()
value := n.ChildByFieldName("value").DecodedString()
if !strings.Contains(key, "api") {
return nil
}
if !strings.HasPrefix(value, "AUTH_") {
return nil
}
return &jsluice.Secret{
Kind: "fakeApi",
Data: map[string]string{
"key": key,
"value": value,
},
Severity: jsluice.SeverityLow,
Context: n.Parent().AsMap(),
}
}},
)
for _, match := range analyzer.GetSecrets() {
j, err := json.MarshalIndent(match, "", " ")
if err != nil {
continue
}
fmt.Printf("%s\n", j)
}
Because we have a syntax tree available for the entire JavaScript source,
it was possible to inspect both the key and value, and also to easily
provide the parent object as context for the match.
The most recent commit recorded on BishopFox/jsluice was 2.5 years ago, based on the GitHub push timestamp. The repository has 152 forks — one of the better signals of community interest.
How does BishopFox/jsluice compare to other Frontend projects?
BishopFox/jsluice is tracked by TopGit in the Frontend category, with 2.0k GitHub stars and written in Go. Browse the Frontend topic page on TopGit to compare it against similar projects by stars and activity.
How many stars does BishopFox/jsluice have?
BishopFox/jsluice has 2.0k GitHub stars — refresh the page for the live number, or check github.com/BishopFox/jsluice. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is BishopFox/jsluice open source?
Yes — BishopFox/jsluice ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/BishopFox/jsluice.
What is BishopFox/jsluice?
BishopFox/jsluice (BishopFox/jsluice) is a Go project on GitHub. From the project's own README: Extract URLs, paths, secrets, and other interesting bits from JavaScript
Where do I read more about BishopFox/jsluice?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/BishopFox/jsluice is the definitive source.
Read full README in the tab above.
Is jsluice worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of jsluice.