Type-safe dork queries for search engines such as Google, Yahoo, DuckDuckGo & Bing
Go to file
Raphaël 4354ffa550
chore: create license
2020-02-24 20:34:46 +01:00
.github/workflows ci: create build config 2020-02-24 20:23:58 +01:00
vendor feat: init package 2020-02-24 20:21:12 +01:00
LICENSE chore: create license 2020-02-24 20:34:46 +01:00
README.md chore: readme 2020-02-24 20:34:02 +01:00
dorkgen.go feat: init package 2020-02-24 20:21:12 +01:00
go.mod feat: init package 2020-02-24 20:21:12 +01:00
go.sum feat: init package 2020-02-24 20:21:12 +01:00
google.go feat: init package 2020-02-24 20:21:12 +01:00
google_test.go feat: init package 2020-02-24 20:21:12 +01:00

README.md

Dorkgen

Dorkgen is a dork request generator for popular search engines such as Google, DuckDuckGo and Bing. Learn more about Google Hacking.

Install

go get github.com/sundowndev/dorkgen

Usage

package main

import (
	"fmt"
  
  	"github.com/sundowndev/dorkgen"
)

func main() {
  dork := dorkgen.Google{}
  // dork := dorkgen.DuckDuckGo{}
  // dork := dorkgen.Bing{}
 
  dork.Site("example.com").Intext("06792489265").ToString()
  // site:"example.com" "06792489265"

  dork.Site("example.com").Or().Intext("06792489265").ToString()
  // site:"example.com" OR "06792489265"

  dork.Site("facebook.*").Exclude("site:facebook.com").ToUrl()
  // https://www.google.com/search?q=site%3A"facebook.*"+-site%3Afacebook.com&oq=site%3A"facebook.*"+-site%3Afacebook.com
}

API

type EngineFactory interface {
	Site(string) *GoogleSearch
	ToString() string
	Intext(string) *GoogleSearch
	Inurl(string) *GoogleSearch
	Filetype(string) *GoogleSearch
	Cache(string) *GoogleSearch
	Related(string) *GoogleSearch
	Ext(string) *GoogleSearch
	Exclude(string) *GoogleSearch
}