dorkgen

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: MIT Imports: 2 Imported by: 2

README

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

Try it in the Go playground

Get started
package main

import "github.com/sundowndev/dorkgen"

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

  dork.Site("example.com").Intext("text").ToString()
  // returns: site:example.com "text"
}
Operators
dork.Site("facebook.com").Or().Site("twitter.com").ToString()
// returns: site:facebook.com OR site:twitter.com

dork.Intext("facebook").And().Intext("twitter").ToString()
// returns: "facebook" AND "twitter"
Exclude results
dork.
  Exclude((&dorkgen.GoogleSearch{}).
    Site("example.com").
    ToString()).
  Site("example.*").
  Or().
  Intext("text")
// returns: -site:example.com site:example.* OR "text"
Group tags along with operators
  dork.
    Group((&dorkgen.GoogleSearch{}).
      Site("facebook.com").
      Or().
      Site("twitter.com").
      ToString()).
    Intext("wtf").
    ToString()
  // returns: (site:facebook.com OR site:twitter.com) "wtf"
}
URL conversion
dork.Site("facebook.*").Exclude("site:facebook.com").ToURL()
// returns: https://www.google.com/search?q=site%3A"facebook.*"+-site%3Afacebook.com

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EngineFactory

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
	Group(string) *GoogleSearch
}

EngineFactory is the main interface for search engine implementations.

type GoogleSearch

type GoogleSearch struct {
	EngineFactory
	// contains filtered or unexported fields
}

GoogleSearch is the Google implementation for Dorkgen

func (*GoogleSearch) Cache

func (e *GoogleSearch) Cache(url string) *GoogleSearch

Cache ...

func (*GoogleSearch) Exclude

func (e *GoogleSearch) Exclude(value string) *GoogleSearch

Exclude ...

func (*GoogleSearch) Ext

func (e *GoogleSearch) Ext(ext string) *GoogleSearch

Ext ...

func (*GoogleSearch) Filetype

func (e *GoogleSearch) Filetype(filetype string) *GoogleSearch

Filetype ...

func (*GoogleSearch) Group added in v1.0.0

func (e *GoogleSearch) Group(value string) *GoogleSearch

Group ...

func (*GoogleSearch) Intext

func (e *GoogleSearch) Intext(text string) *GoogleSearch

Intext ...

func (*GoogleSearch) Inurl

func (e *GoogleSearch) Inurl(url string) *GoogleSearch

Inurl ...

func (*GoogleSearch) Or

func (e *GoogleSearch) Or() *GoogleSearch

Or ...

func (*GoogleSearch) Related

func (e *GoogleSearch) Related(url string) *GoogleSearch

Related ...

func (*GoogleSearch) Site

func (e *GoogleSearch) Site(site string) *GoogleSearch

Site ...

func (*GoogleSearch) ToString

func (e *GoogleSearch) ToString() string

ToString converts all tags to a single request

func (*GoogleSearch) ToURL

func (e *GoogleSearch) ToURL() string

ToURL ...

Jump to

Keyboard shortcuts

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