@hashangit/breachhound
v1.0.1
Published
An efficient OSINT tool for uncovering digital footprints associated with a username. TypeScript port of GoSearch.
Downloads
9
Maintainers
Readme
BreachHound
BreachHound is an efficient Open Source Intelligence (OSINT) tool designed for uncovering digital footprints associated with a given username across numerous online platforms.
Origin and Credit
BreachHound is a TypeScript port of the excellent Go-based tool GoSearch.
We extend our sincere gratitude and credit to Shaffan, the original developer of GoSearch. BreachHound aims to provide the same core functionality within the Node.js ecosystem, leveraging the foundation laid by GoSearch. Thank you, Shaffan, for creating and sharing GoSearch!
Features
- Extensive Platform Coverage: Searches hundreds of websites (dynamically updated from GoSearch's config).
- Fast & Concurrent: Leverages asynchronous operations in Node.js for speed.
- API Integrations:
- Checks HudsonRock's Cybercrime Intelligence Database for info-stealer infections linked to the username.
- Searches BreachDirectory.org for compromised credentials (requires API key).
- (If BreachDirectory finds hashes) Attempts to crack hashes using the Weakpass API.
- Queries ProxyNova's Comb DB for publicly leaked credentials.
- Domain Availability: Checks common TLDs for domain registration matching the username.
- Clear Output: Color-coded terminal output and results saved to a text file (
<username>.txt). - Flexible Usage: Can be used as a command-line tool or integrated as a library into other JavaScript/TypeScript projects.
- Configurable: Handles potential false positives and uses external API keys via environment variables.
Installation
Using the Command Line Tool
Prerequisites:
- Node.js (Version 16 or higher recommended)
- npm (usually included with Node.js)
Install Globally:
npm install -g @hashangit/breachhoundNow you can run breachhound from anywhere.
OR Run Directly with npx (No Installation Needed):
# Replace @your-npm-username with your actual npm scope or desired package name
npx @hashangit/breachhound -u <username> [options]Integrating as a Library
# Replace @your-npm-username with your actual npm scope or desired package name
npm install @hashangit/breachhound
# or
yarn add @your-npm-username/breachhoundUsage
Command Line
breachhound -u <username> [options]
# or positional username:
breachhound <username> [options]Options:
-u, --username <username>: The username to search for (required if not provided positionally).-b, --breach-directory-key <key>: Your API key from RapidAPI for BreachDirectory to enable breach checks.--no-false-positives: Hide uncertain results (marked with[?]and colored yellow).-h, --help: Show help message.--version: Show version number.
Examples:
# Basic search
breachhound johndoe
# Search with BreachDirectory check (API key set in .env or passed via -b)
breachhound -u janedoe -b YOUR_API_KEY
# Search and hide uncertain results
breachhound -u testuser --no-false-positivesLibrary Usage (JavaScript/TypeScript)
// Replace @your-npm-username with your actual npm scope or desired package name
import { runChecks, BreachHoundConfig } from '@hashangit/breachhound';
async function findUser(username: string) {
console.log(`Starting checks for: ${username}`);
// API keys can be passed in the config object
const config: BreachHoundConfig = {
breachDirectoryApiKey: process.env.BREACH_DIRECTORY_API_KEY, // Load from env or elsewhere
hudsonRockApiKey: process.env.HUDSON_ROCK_API_KEY, // Load HudsonRock key
// Add other API keys here if needed
};
const results = await runChecks(username, config);
if (results) {
console.log('--- Website Results ---');
results.websiteResults.forEach(site => {
if (site.status === 'found') {
console.log(`Found: ${site.siteName} - ${site.profileUrl}`);
} else if (site.status === 'uncertain') {
console.log(`Uncertain: ${site.siteName} - ${site.profileUrl}`);
}
});
console.log('\n--- API Check Summary ---');
console.log(`HudsonRock Found: ${results.hudsonRockResult.found}`);
console.log(`BreachDirectory Found: ${results.breachDirectoryResult.found}`);
console.log(`ProxyNova Found: ${results.proxyNovaResult.found}`);
console.log(`Domains Found: ${results.domainCheckResult.found} (${results.domainCheckResult.details?.found?.join(', ')})`);
console.log(`\nSummary: Found ${results.summary.profilesFound} profiles in ${results.summary.durationSeconds}s`);
} else {
console.error('BreachHound checks failed.');
}
}
// Example call
findUser('some_username_here');
API Key Setup (Important!)
BreachHound uses external APIs that may require API keys for full functionality.
- Obtain Keys:
- BreachDirectory: Get a key from RapidAPI.
- Set Environment Variables:
- Create a file named
.envin the root of your project (if using the library) or in the directory where you run thebreachhoundcommand (if installed globally, setting system-wide env variables is another option). - Add your keys to the
.envfile, following the format in.env.example:BREACH_DIRECTORY_API_KEY=YOUR_RAPIDAPI_KEY_HERE - The CLI tool will automatically load variables from a
.envfile in the current working directory. - Alternatively, you can pass the BreachDirectory key directly using the
-bflag. - HudsonRock: Add your API key for HudsonRock if required by the endpoint (check their documentation). Add it to your
.envfile asHUDSON_ROCK_API_KEY=YOUR_HUDSONROCK_API_KEY_HERE.
- Create a file named
Note: Ensure the .env file is added to your .gitignore file to avoid committing your secret keys.
Publishing to GitHub and npm
Follow these steps to publish BreachHound:
- Code Cleanup: Remove any debug
console.logorconsole.errorstatements you added during development. - Update
package.json:
- Ensure
name,version,repository,author,bugs, andhomepagefields are correct. - Add a
filesarray to specify which files to include in the npm package (e.g.,["dist", "README.md", "LICENSE", "package.json"]).
- Create
.npmignore: Create a.npmignorefile in the project root to explicitly exclude files likesrc/,test/,.env, etc. - Add
LICENSEFile: Create aLICENSEfile in the project root and paste the full text of the GPL-3.0 license into it. - Build: Run
npm run buildto compile your TypeScript code. - Local Test: Run
npm packto create a.tgzfile, then install and test it locally (npm install -g ./your-package.tgz). - GitHub: Initialize a Git repository, add files (ensure
.gitignoreis correct), commit, and push to your GitHub repository. - npm Login: Run
npm loginin your terminal. - Publish: Run
npm publish --access public.
Contributing
Contributions are welcome! Please feel free to open an issue or submit a pull request.
Areas for contribution include:
- Improving detection logic.
- Adding support for more websites (requires contributing to the upstream GoSearch
data.jsonprimarily). - Enhancing error handling.
- Adding tests.
- Improving documentation.
License
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details. This matches the license of the original GoSearch project.
