{"id":13432557,"url":"https://github.com/003random/getJS","last_synced_at":"2025-03-17T09:31:32.852Z","repository":{"id":41066940,"uuid":"156891331","full_name":"003random/getJS","owner":"003random","description":"A tool to fastly get all javascript sources/files","archived":false,"fork":false,"pushed_at":"2024-07-30T15:17:22.000Z","size":73,"stargazers_count":765,"open_issues_count":2,"forks_count":109,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-14T15:49:58.857Z","etag":null,"topics":["bugbounty","extract","files","go","golang","goquery","hacking","hacktoberfest","javascript","parser","pentesting","recon","reconnaissance","urls"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/003random.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":"2018-11-09T16:50:21.000Z","updated_at":"2025-03-13T07:53:19.000Z","dependencies_parsed_at":"2024-01-14T08:55:30.608Z","dependency_job_id":"341b348e-8903-4205-9997-8113cc241114","html_url":"https://github.com/003random/getJS","commit_stats":{"total_commits":42,"total_committers":6,"mean_commits":7.0,"dds":"0.11904761904761907","last_synced_commit":"2f687c7fce089090a2160759a52c4ba23dec8e1f"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/003random%2FgetJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/003random%2FgetJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/003random%2FgetJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/003random%2FgetJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/003random","download_url":"https://codeload.github.com/003random/getJS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244009087,"owners_count":20382969,"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":["bugbounty","extract","files","go","golang","goquery","hacking","hacktoberfest","javascript","parser","pentesting","recon","reconnaissance","urls"],"created_at":"2024-07-31T02:01:13.361Z","updated_at":"2025-03-17T09:31:32.495Z","avatar_url":"https://github.com/003random.png","language":"Go","readme":"\n\u003ch1 align=\"center\"\u003eJavaScript Extraction CLI \u0026 Package\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/003random/getJS\"\u003e\n    \u003cimg src=\"https://pkg.go.dev/badge/github.com/003random/getJS\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/003random/getJS/releases\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/release/003random/getJS.svg\"\u003e\n  \u003c/a\u003e\n    \u003ca href=\"https://github.com/003random/getJS/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\nThis is a powerful tool for extracting JavaScript sources from URLs and web pages / HTTP responses. It offers a command-line interface (CLI) for straightforward URL processing and a package interface for custom integrations, making it ideal for pentesters, bug bounty hunters, and developers needing to extract JS sources efficiently.\n## Table of Contents\n\n- [Installation](#installation)\n- [CLI Usage](#cli-usage)\n  - [Options](#options)\n  - [Examples](#examples)\n- [Package Usage](#package-usage)\n  - [Importing the Extractor](#importing-the-extractor)\n  - [Example](#example)\n- [Version Information](#version-information)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Installation\n\nTo install `getJS`, use the following command:\n\n`go install github.com/003random/getJS/v2@latest`\n\n## CLI Usage\n\n### Options\n\n`getJS` provides several command-line options to customize its behavior:\n\n- `-url string`: The URL from which JavaScript sources should be extracted.\n- `-input string`: Optional URLs input files. Each URL should be on a new line in plain text format. Can be used multiple times.\n- `-output string`: Optional output file where results are written to. Can be used multiple times.\n- `-complete`: Complete/Autofill relative URLs by adding the current origin.\n- `-resolve`: Resolve the JavaScript files. Can only be used in combination with `--complete`.\n- `-threads int`: The number of processing threads to spawn (default: 2).\n- `-verbose`: Print verbose runtime information and errors.\n- `-method string`: The request method used to fetch remote contents (default: \"GET\").\n- `-header string`: Optional request headers to add to the requests. Can be used multiple times.\n- `-timeout duration`: The request timeout while fetching remote contents (default: 5s).\n\n### Examples\n\n#### Extracting JavaScript from a Single URL\n\n`getJS -url https://destroy.ai`\n\nor \n\n`curl https://destroy.ai | getJS`\n\n#### Using Custom Request Options\n\n`getJS -url \"http://example.com\" -header \"User-Agent: foo bar\" -method POST --timeout=15s`\n\n#### Processing Multiple URLs from a File\n\n`getJS -input foo.txt -input bar.txt`\n\n#### Saving Results to an Output File\n\n`getJS -url \"http://example.com\" -output results.txt`\n\n## Package Usage\n\n### Importing the Extractor\n\nTo use `getJS` as a package, you need to import the `extractor` package and utilize its functions directly.\n\n### Example\n\n```Go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n    \"net/http\"\n    \"net/url\"\n\n    \"github.com/003random/getJS/extractor\"\n)\n\nfunc main() {\n    baseURL, err := url.Parse(\"https://google.com\")\n    if (err != nil) {\n        log.Fatalf(\"Error parsing base URL: %v\", err)\n    }\n\n    resp, err := extractor.FetchResponse(baseURL.String(), \"GET\", http.Header{})\n    if (err != nil) {\n        log.Fatalf(\"Error fetching response: %v\", err)\n    }\n    defer resp.Body.Close()\n\n    // Custom extraction points (optional).\n    extractionPoints := map[string][]string{\n        \"script\": {\"src\", \"data-src\"},\n        \"a\": {\"href\"},\n    }\n\n    sources, err := extractor.ExtractSources(resp.Body, extractionPoints)\n    if (err != nil) {\n        log.Fatalf(\"Error extracting sources: %v\", err)\n    }\n\n    // Filtering and extending extracted sources.\n    filtered, err := extractor.Filter(sources, extractor.WithComplete(baseURL), extractor.WithResolve())\n    if (err != nil) {\n        log.Fatalf(\"Error filtering sources: %v\", err)\n    }\n\n    for source := range filtered {\n        fmt.Println(source.String())\n    }\n}\n```\n\n## Version Information\n\nThis is the v2 version of `getJS`. The original version can be found under the tag [v1](https://github.com/003random/getJS/tree/v1).\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request for any bugs, feature requests, or improvements.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](https://github.com/003random/getJS/blob/master/LICENSE) file for details.\n","funding_links":[],"categories":["Go","Recon","Weapons"],"sub_categories":["Links","Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F003random%2FgetJS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F003random%2FgetJS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F003random%2FgetJS/lists"}