dorkgen/README.md

2.0 KiB

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 "github.com/sundowndev/dorkgen"

func main() {
  dork := &dorkgen.GoogleSearch{}
  // dork := &dorkgen.DuckDuckGo{}
  // dork := &dorkgen.Bing{}

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

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

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

API

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