# Jsfinder | Fetches JavaScript Files Quickly And Comprehensively

**URL:** <https://onehack.st/t/jsfinder-fetches-javascript-files-quickly-and-comprehensively/241938>\
**Category:** Tools & Scripts\
**Tags:** tools, programming, freebies\
**Created:** [May 26, 2023, 9:14pm UTC](https://onehack.st/t/jsfinder-fetches-javascript-files-quickly-and-comprehensively/241938 "2023-05-26T21:14:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![WhiteHat](https://onehack.st/user_avatar/onehack.st/whitehat/32/162514_2.png) [@WhiteHat](https://onehack.st/u/WhiteHat)\
**Post date:** [May 26, 2023, 9:14pm UTC](https://onehack.st/t/jsfinder-fetches-javascript-files-quickly-and-comprehensively/241938/1 "2023-05-26T21:14:16Z")

</div>

[![Logo](https://user-images.githubusercontent.com/64865400/223338196-d572481b-f2d3-435e-943e-fc52a8c31ecd.jpg)](https://user-images.githubusercontent.com/64865400/223338196-d572481b-f2d3-435e-943e-fc52a8c31ecd.jpg)

[![](https://camo.githubusercontent.com/a7dd71822f91d60edd454ddf6ef4b72cabc7bf95d7e1a92e52a472fb5aa46066/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f476f2d76312e32302d626c7565)](https://golang.org/doc/go1.20) [![](https://camo.githubusercontent.com/78f47a09877ba9d28da1887a93e5c3bc2efb309c1e910eb21135becd2998238a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://github.com/kacakb/jsfinder/blob/main/LICENSE) [![](https://camo.githubusercontent.com/8e608689e52bf745f0e088078f0eb2b0ec3b6f7aa44676678a6a9e09b6b5aa36/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f52656c65617365732d566965772d627269676874677265656e)](https://github.com/kacakb/jsfinder/releases) [![](https://camo.githubusercontent.com/d48d4b051fee25f1f66e3815a2551f624e08875788dc7cb25f9a9c47f2653d7e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4973737565732d57656c636f6d652d626c756576696f6c6574)](https://github.com/kacakb/jsfinder/issues)

[Features](https://github.com/kacakb/jsfinder#features) | [Installation](https://github.com/kacakb/jsfinder#installation) | [Usage](https://github.com/kacakb/jsfinder#usage) | [Demo](https://github.com/kacakb/jsfinder#demo) | [TODOs](https://github.com/kacakb/jsfinder#todos)| [Contact](https://github.com/kacakb/jsfinder#contact)

jsFinder is a command-line tool written in Go that scans web pages to find JavaScript files linked in the HTML source code. It searches for any attribute that can contain a JavaScript file (e.g., src, href, data-main, etc.) and extracts the URLs of the files to a text file. The tool is designed to be simple to use, and it supports reading URLs from a file or from standard input.

jsFinder is useful for web developers and security professionals who want to find and analyze the JavaScript files used by a web application. By analyzing the JavaScript files, it’s possible to understand the functionality of the application and detect any security vulnerabilities or sensitive information leakage.

## Features

- Reading URLs from a file or from **stdin** using command line arguments.
- Running **multiple** HTTP GET requests concurrently to each URL.
- Limiting the **concurrency** of HTTP GET requests using a flag.
- Using a **regular expression** to search for JavaScript files in the response body of the HTTP GET requests.
- **Writing the found JavaScript files** to a file specified in the command line arguments or to a default file named “output.txt”.
- **Printing informative messages to the console** indicating the status of the program’s execution and the output file’s location.
- Allowing the program to run in **verbose or silent mode** using a flag.

## Installation

jsfinder requires Go 1.20 to install successfully.Run the following command to get the repo :

```auto
go install -v github.com/kacakb/jsfinder@latest

```

## Usage

To see which flags you can use with the tool, use the -h flag.

```auto
jsfinder -h 

```

| Flag | Description |
| --- | --- |
| -l | Specifies the filename to read URLs from. |
| -c | Specifies the maximum number of concurrent requests to be made. The default value is 20. |
| -s | Runs the program in silent mode. If this flag is not set, the program runs in verbose mode. |
| -o | Specifies the filename to write found URLs to. The default filename is output.txt. |
| -read | Reads URLs from stdin instead of a file specified by the -l flag. |

## Demo

## I

[![Demo](https://camo.githubusercontent.com/ab1dc7868ff8b762f93c950b6c04becb5a2e0a7e0ccc248208b5f506677b6034/68747470733a2f2f61736369696e656d612e6f72672f612f456874626377793149456f527166586e524f514732627241612e737667)](https://asciinema.org/a/Ehtbcwy1IEoRqfXnROQG2brAa)

If you want to read from stdin and run the program in silent mode, use this command:

```auto
cat list.txt| jsfinder -read -s -o js.txt

```

## II

[![Demo](https://camo.githubusercontent.com/03976d9a6a6414729a822eb49167ad4fb4512c342fb9e84c922d205a7d0d9289/68747470733a2f2f61736369696e656d612e6f72672f612f644f745632587264747371467a6b59457971765062396d72592e737667)](https://asciinema.org/a/dOtV2XrdtsqFzkYEyqvPb9mrY)

If you want to read from a file, you should specify it with the -l flag and use this command:

```auto
jsfinder -l list.txt -s -o js.txt

```

You can also specify the concurrency with the -c flag.The default value is 20. If you want to read from a file, you should specify it with the -l flag and use this command:

```auto
jsfinder -l list.txt -c 50 -s -o js.txt

```

## TODOs

- Adding new features
- Improving performance
- Adding a cookie flag
- Reading regex from a file
- Integrating the [kacak](https://github.com/kacakb/kacak) tool (coming soon)

## Screenshot

[![IMG_0241 (1)](https://user-images.githubusercontent.com/64865400/223191654-00d0e2a5-01f4-4e70-bde7-7888da638c6a.JPG)](https://user-images.githubusercontent.com/64865400/223191654-00d0e2a5-01f4-4e70-bde7-7888da638c6a.JPG)

## GitHub:

[https://github.com/kacakb/jsfinder](https://github.com/kacakb/jsfinder)
