dorkgen

package module
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2021 License: MIT Imports: 2 Imported by: 2

README

Dorkgen

Dorkgen is a dork query wrapper for popular search engines such as Google Search, DuckDuckGo, Yahoo and Bing. Learn more about Google Hacking. The goal of this package is to provide simple interfaces to creates valid dork queries for various search engines. This library was initially created for PhoneInfoga.

Current status

Version 1 is ongoing, but the API is still not fixed. See below table for supported search engines and status of their implementation.

Search engine Implementation status
Google Search Stable
DuckDuckGo Stable
Yahoo Search WIP
Bing Search WIP

Install

Fetch the module :

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.NewBingSearch()
  // dork := dorkgen.NewYahooSearch()

  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 | site:twitter.com

  dork.InText("facebook").And().InText("twitter").String()
  // returns: intext:"facebook" + intext:"twitter"
}
Exclude results
func main() {
  dork.
    Exclude(dorkgen.NewGoogleSearch().Site("example.com")).
    Site("example.*").
    Or().
    InText("text")
  // returns: -site:example.com site:example.* | "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 | site:twitter.com) "wtf"
}
URL conversion
func main() {
  dork.
    Site("facebook.*").
    Exclude(dorkgen.NewGoogleSearch().Site("facebook.com"))

  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.

Documentation

Overview

Package dorkgen is a Go package to generate dork requests for popular search engines such as Google, DuckDuckGo and Bing. It allows you to define requests programmatically and convert them into string.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDuckDuckGo added in v1.3.0

func NewDuckDuckGo() *duckduckgo.DuckDuckGo

NewDuckDuckGo returns a new instance of DuckDuckGo

func NewGoogleSearch added in v1.2.0

func NewGoogleSearch() *googlesearch.GoogleSearch

NewGoogleSearch returns a new instance of GoogleSearch

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL