All Projects → audibleblink → Kh

audibleblink / Kh

Keyhack - Golang API token/webhook validator

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Labels

Projects that are alternatives of or similar to Kh

Holehe
holehe allows you to check if the mail is used on different sites like twitter, instagram and will retrieve information on sites with the forgotten password function.
Stars: ✭ 568 (+4269.23%)
Mutual labels:  osint
Trape
People tracker on the Internet: OSINT analysis and research tool by Jose Pino
Stars: ✭ 6,753 (+51846.15%)
Mutual labels:  osint
Pwnedornot
OSINT Tool for Finding Passwords of Compromised Email Addresses
Stars: ✭ 888 (+6730.77%)
Mutual labels:  osint
Pagodo
pagodo (Passive Google Dork) - Automate Google Hacking Database scraping and searching
Stars: ✭ 603 (+4538.46%)
Mutual labels:  osint
Harpoon
CLI tool for open source and threat intelligence
Stars: ✭ 679 (+5123.08%)
Mutual labels:  osint
Paramspider
Mining parameters from dark corners of Web Archives
Stars: ✭ 781 (+5907.69%)
Mutual labels:  osint
Favfreak
Making Favicon.ico based Recon Great again !
Stars: ✭ 564 (+4238.46%)
Mutual labels:  osint
Commoncrawlparser
Simple multi threaded tool to extract domain related data from commoncrawl.org
Stars: ✭ 25 (+92.31%)
Mutual labels:  osint
Attacksurfacemapper
AttackSurfaceMapper is a tool that aims to automate the reconnaissance process.
Stars: ✭ 702 (+5300%)
Mutual labels:  osint
Torbot
Dark Web OSINT Tool
Stars: ✭ 821 (+6215.38%)
Mutual labels:  osint
Powerful Plugins
Powerful plugins and add-ons for hackers
Stars: ✭ 621 (+4676.92%)
Mutual labels:  osint
Spiderfoot
SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Stars: ✭ 6,882 (+52838.46%)
Mutual labels:  osint
Osint collection
Maintained collection of OSINT related resources. (All Free & Actionable)
Stars: ✭ 809 (+6123.08%)
Mutual labels:  osint
Git Hound
Reconnaissance tool for GitHub code search. Finds exposed API keys using pattern matching, commit history searching, and a unique result scoring system.
Stars: ✭ 602 (+4530.77%)
Mutual labels:  osint
Probe spider
Probe_Spider is a Open Source Intelligence Tool made complete out of Python.
Stars: ✭ 20 (+53.85%)
Mutual labels:  osint
Gitrob
Reconnaissance tool for GitHub organizations
Stars: ✭ 5,256 (+40330.77%)
Mutual labels:  osint
Awesome Osint
😱 A curated list of amazingly awesome OSINT
Stars: ✭ 7,830 (+60130.77%)
Mutual labels:  osint
Urlhunter
a recon tool that allows searching on URLs that are exposed via shortener services
Stars: ✭ 934 (+7084.62%)
Mutual labels:  osint
Apullo
A scanner for taking basic fingerprints
Stars: ✭ 22 (+69.23%)
Mutual labels:  osint
Sn0int
Semi-automatic OSINT framework and package manager
Stars: ✭ 814 (+6161.54%)
Mutual labels:  osint

kh is a programmatic way to check for the validity of API tokens or webhooks. The services against which it is able to check originally came from the popular keyhack repo by @streaak.

Usage

$ kh github-token XXXXXXXXXXXXXXXXXXXXXXXXX

$ ./my-custom-token-scanner | kh slack-token - | tee -a valid_slack_tokens.txt

$ xargs kh slack-token < maybe_tokens.txt| tee -a valid_slack_tokens.txt

If the token is valid, kh will print the token and return a 0 status to bash. If the token is invalid, nothing will be printed and the status returned will be 1. The output is minimal so that the tool can be used in existing workflows, bash pipelines and scripts.

Expandability

It's possible to add services to the tool by modifying the configuration YAML file.

# Demo Service With All Params
sass-api:
  name: sass-api
  request:
    method: POST # [REQUIRED]
    url: 'https://sass-api.io/api/auth' # [REQUIRED]
    headers:
      Authorization: Bearer %s
  validator: # [REQUIRED if 200/40x http status is not indicative of success/failure]
    custom: true

In the parameters where a token is to be interpolated, place a template symbol, %s, in place of the token value.

By default, kh will declare a token as valid if the API returns a 200 HTTP status. Not all APIs are create equal nor do they use semantic HTTP status codes when replying. If you're attempting to add a new service to kh and both valid and invalid tokens return a 200, then a custom validator must be written.

In addition to editing the configuration YAML, users must add the subcommand to the /cmd folder in this repository's root. When declaring a custom validator in the YAML file, users must also define what a valid response looks like

// each subcommand's init function must add the subcommand to the root cli command
// and then add the validator function to the keyhack registry so that it knows
// what a good http response looks like
func init() {
	rootCmd.AddCommand(slackTokenCmd)
	keyhack.Registry["slack-token"].Validator.Fn = validateSlack
}

// ensure the command name matches the entry in the YAML file
var slackTokenCmd = newCommand("slack-token", "Checks a token against the Slack API")

// validator functions define what a successful authentication means 
// based on the http response of the API call issued by keyhacks
func validateSlack(resp *http.Response) (ok bool, err error) {
	ok = resp.Header["X-Oauth-Scopes"] != nil
	return
}

If you don't need a custom validator, that is, if the API returns anything but a 200 with invalid creds, then the following is all that's needed in the new service:

// cmd/github.go
package cli

func init() {
	githubTokenCmd := newCommand("github-token", "Checks a token against the GitHub API")
	rootCmd.AddCommand(githubTokenCmd)
}

Structure

├── cmd			# this is where new plugins go
│   ├── cli.go		# main entry point logic for the CLI utility
│   └── <more services here>
├── go.mod
├── go.sum
├── keyhacks.yml	# tool configuration; add new service definitions here
├── main.go		
├── pkg
│   └── keyhack
│       └── keyhack.go	# core keyhack framework logic

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].