Type-safe dork queries for search engines such as Google, Yahoo, DuckDuckGo & Bing
Go to file
sundowndev 1e33e4f0c6 docs: usage 2020-06-15 11:00:15 +02:00
.github/workflows ci: setup coverage (#1) 2020-02-26 12:21:22 +01:00
docs docs: add jetbrains support notice 2020-06-05 14:36:11 +02:00
.codeclimate.yml chore: codeclimate config 2020-02-24 21:22:55 +01:00
.gitignore chore: gitignore 2020-04-25 14:20:03 +01:00
LICENSE chore: create license 2020-02-24 20:34:46 +01:00
README.md docs: usage 2020-06-15 11:00:15 +02:00
doc.go docs: usage 2020-06-15 11:00:15 +02:00
dorkgen.go refactor: engine factory struct 2020-04-25 14:31:29 +01:00
go.mod Update module stretchr/testify to v1.6.1 2020-06-05 12:26:56 +00:00
go.sum chore: dependencies 2020-06-15 10:50:47 +02:00
google.go feat: create NewGoogleSearch method 2020-06-15 11:00:03 +02:00
google_test.go feat: create NewGoogleSearch method 2020-06-15 11:00:03 +02:00
renovate.json chore(deps): add renovate.json 2020-03-18 20:49:37 +00: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.

For now, only Google is supported.

Install

go get github.com/sundowndev/dorkgen

Usage

Try it in the Go playground

Get started

package main

import "github.com/sundowndev/dorkgen"

func main() {
  dork := dorkgen.NewGoogleSearch()
  // dork := dorkgen.NewDuckDuckGo()
  // dork := dorkgen.NewBing()

  dork.Site("example.com").Intext("text").String()
  // returns: site:example.com intext:"text"
}

Operators

func main() {
  dork.Site("facebook.com").Or().Site("twitter.com").String()
  // returns: site:facebook.com OR site:twitter.com

  dork.Intext("facebook").And().Intext("twitter").String()
  // returns: intext:"facebook" AND intext:"twitter"
}

Exclude results

func main() {
  dork.
    Exclude((dorkgen.NewGoogleSearch()).
      Site("example.com").
      String()).
    Site("example.*").
    Or().
    Intext("text")
  // returns: -site:example.com site:example.* OR "text"
}

Group tags along with operators

func main() {
  dork.
    Group((dorkgen.NewGoogleSearch()).
      Site("facebook.com").
      Or().
      Site("twitter.com")).
    Intext("wtf").
    String()
  // returns: (site:facebook.com OR site:twitter.com) "wtf"
}

URL conversion

func main() {
  dork.
    Site("facebook.*").
    Exclude((dorkgen.NewGoogleSearch()).
      Site("facebook.com").
      String())

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

Support

Thanks to JetBrains for supporting my open-source projects.