{"id":19544876,"url":"https://github.com/ariary/jsextractor","last_synced_at":"2025-07-14T23:06:38.058Z","repository":{"id":109492979,"uuid":"438675375","full_name":"ariary/JSextractor","owner":"ariary","description":"Fastly gather all JavaScript from url  (CLi+TUI)","archived":false,"fork":false,"pushed_at":"2023-03-07T15:20:59.000Z","size":7093,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-26T19:39:26.888Z","etag":null,"topics":["bug-bounty","cli","extract","extractor","html-parser","javascript","js","parser","pentest","recon","tui","web-pentest","xss"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ariary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-15T15:16:54.000Z","updated_at":"2024-12-14T23:36:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"b8890be4-56b7-443a-bc18-90812a265a68","html_url":"https://github.com/ariary/JSextractor","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/ariary/JSextractor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariary%2FJSextractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariary%2FJSextractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariary%2FJSextractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariary%2FJSextractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ariary","download_url":"https://codeload.github.com/ariary/JSextractor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariary%2FJSextractor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265365631,"owners_count":23753363,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bug-bounty","cli","extract","extractor","html-parser","javascript","js","parser","pentest","recon","tui","web-pentest","xss"],"created_at":"2024-11-11T03:32:51.217Z","updated_at":"2025-07-14T23:06:38.031Z","avatar_url":"https://github.com/ariary.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n \u003ch1\u003e JSextractor\u003c/h1\u003e  \n\u003cimg src=\"https://github.com/ariary/JSextractor/blob/main/img/jse-small.png\"\u003e\n \u003ch4\u003e JSextractor is a command line utility to gather JavaScript from webpages \u003c/h4\u003e\n \u003cp\u003e Gather all JavaScript code of html webpages from command line by supplying them in stdin. JSextractor search for JavaScript in \u003ccode\u003e\u003cscript\u003e\u003c/code\u003e tag (\u003ccode\u003esrc\u003c/code\u003e  attribute or inline code) and in event handlers. \u003c/p\u003e\n  \u003cp\u003e\u003cstrong\u003e\u003ccode\u003e{ \u003ca href=\"#install\"\u003eInstall it\u003c/a\u003e ; \u003ca href=\"#usage\"\u003eUse it\u003c/a\u003e } \u003c/code\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n## TL;DR\nFetch all js code from webpage:\n\n```shell\nexport URL=[endpoint]\ncurl $URL -s | jse -gather-src -u $URL\n```\n\n## Demo\n|⬇️ TUI demo|\n|:---:| \n|![demo](https://github.com/ariary/JSextractor/blob/main/img/jse-tui.gif)|\n|➡️ [command line demo](https://github.com/ariary/JSextractor/blob/main/img/jse.gif)|\n\n## Usage\n* [Gather JavaScript](#basic-usage)\n* [Gather JavaScript for further analysis on it](#output-js-code-into-file)\n* [Gather JavaScript from specific source](#restrict-harvest)\n* [Launch Terminal based UI (TUI)](#launch-terminal-based-ui-tui)\n\n### Basic usage\n\n* Retrieve Javascript from an offline HTML file:\n```shell\njse \u003c [html_file]\n```\n\n* Alternatively, you could gather it following a curl command:\n```shell\ncurl -s [url] | jse\n```\n\n### Output js code into file\n\nThis could be useful to perform further actions later on JavaScript, like scanning it or beautifying it. But in this case, the output **must** be a valid script:\n```\ncurl [url] | jse -gather-src -u [url] \u003e output.js\n```\nWe use  `-gather-src` to retrieve code from `src` attribute (fetching the code). Otherwise it would return only the URL corresponding to the `src` value and thus making the output a non-valid JavaScript code.\nWhen we use `-gather-src` we must also define the url from which we got the html page (this is used to fetch script hosting by te same site *e.g.* `src=/this/is/a/path.js`).\n\nAlso, all informative logs (line and source) are output to `stderr` to keep only js code in `stdout`\n\n### Restrict harvest\n\n`jse` search for js code from 3 sources by default. Sometimes, you only want code from a specific source. In this case you can disable other source gathering:\n* `-ds`: don't look for js in src attribute of `\u003cscript\u003e` tag\n* `-de`: don't look for js from event handler attributes\n* `-dt`: don't look for inline js of `\u003cscript\u003e` tag\n\n### Launch Terminal based UI (TUI)\n`jse` comes w/ a TUI which makes JS browsing/gathering/analysis simpler.\n \nFrom the TUI you browse all the scripts found, gather javascript from `src`attributes (`[CTRL] + G`). You can also change the url (`[CTRL] + U`);\nTo launch it add `-tui` falg (It is recommended to specify url also):\n```\ncurl https://[domain]/path/to/file.html | jse -u  https://[domain]/path/to/file.html -tui\n```\n\n|view|shortcut|description|\n|:---:|:---:|:---:|\n|all|`CTRL+H`|Toogle help windows|\n|all|`CTRL+C`|Exit TUI|\n|scripts|`CTRL+G`|Gather script from source attribute for the current item|\n|scripts|`CTRL+A`|Gather scripts from all source attributes|\n|scripts|`CTRL+U`|Change tu url view|\n|url|`TAB`|Change request method (`GET`or `cURL`)|\n|url|`ENTER`|Perform request and gather js|\n|url|`CTRL+Z`|Don't perform request, go back to scripts view|\n\n[with 💥](https://github.com/ariary/bang/blob/main/EXAMPLES.md#jse)\n\n## Install\n\n### from release\n\n```\ncurl -lO -L https://github.com/ariary/JSextractor/releases/latest/download/jse\n```\n\n### from code source\n\n```shell\ngit clone https://github.com/ariary/JSextractor.git\nmake before.build\nmake build.jse\n#install it in your $PATH\nmv jse $HOME/.local/bin/\n```\n\n\n## Enhancement 🛣️\n\n* Line counter is not working perfectly and must be improved\n* Beautify js? (jse is only for gathering js, maybe it is a better idea to not add other features)\n\n\n## 🎁\n\nThe equivalent with WebAssembly: [`wasme`](https://gist.github.com/ariary/b5a6062b89a62ba33734ba4638b0b20b)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fariary%2Fjsextractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fariary%2Fjsextractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fariary%2Fjsextractor/lists"}