is a lightweight and efficient tool to identify potential dependency confusion risks by scanning package.json files hosted at given URLs. The tool works with piped input, processes URLs concurrently, and supports optional verbose logging for detailed outputs.
- Concurrent URL Processing: Specify the number of threads using the
-cflag for faster scanning. - Dependency Validation: Checks if dependencies listed in
package.jsonexist on npm. - Potential Dependency Confusion Alerts: Flags dependencies not found on npm.
- Piped Input: Accepts a list of URLs via
stdinfor streamlined workflows. - Verbose Logging: Enable detailed logs using the
-vflag.
- Go 1.22 or higher
- Internet connection
go install -v github.com/Vulnpire/HexDox@latest
The tool accepts a list of URLs (one per line) via stdin. Each URL should point to a package.json file.
| Flag | Description | Default |
|---|---|---|
-c |
Number of concurrent threads for processing | 5 |
-v |
Enable verbose output for informational logs | Disabled |
-
Create a file
urls.txtwith a list of URLs:https://example.com/path/to/package.json https://another-example.com/package.json -
Run the tool with piped input:
cat urls.txt | ./HexDox -c=10This will process the URLs with a concurrency level of 10.
-
Enable verbose output for detailed logging:
cat urls.txt | ./HexDox -c=10 -v
[WARNING] Potential Dependency Confusion: 'my-fake-dependency' not found on npm
[INFO] Dependency 'express' exists on npm
[WARNING] Potential Dependency Confusion: 'my-fake-dependency' not found on npm
[ERROR] Failed to fetch 'https://invalid-url.com': no such host
- URL Fetching: The tool fetches the
package.jsonfile from each URL. - Dependency Parsing: It parses
dependenciesanddevDependenciesfrom the JSON file. - Validation: Each dependency is checked against npm using the
api.allorigins.winproxy to avoid bot detection. - Output:
[WARNING]: Dependencies not found on npm are flagged for potential dependency confusion.[INFO]: Valid dependencies are logged when-vis enabled.[ERROR]: Fetching or parsing issues are logged when-vis enabled.
Contributions are welcome! Please fork the repository, create a feature branch, and submit a pull request with your changes.
- Add support for npm scopes (e.g.,
@org/package). - Improve error handling for edge cases like malformed JSON or unreachable URLs.
This tool is for educational and bug bounty purposes only. Ensure you have proper permissions before testing third-party systems.