2020-02-24 19:34:02 +00:00
# Dorkgen
2020-02-24 10:34:35 +00:00
2020-02-24 19:53:31 +00:00
< div align = "left" >
2020-02-24 19:49:54 +00:00
< a href = "https://godoc.org/github.com/sundowndev/dorkgen" >
< img src = "https://godoc.org/github.com/sundowndev/dorkgen?status.svg" alt = "GoDoc" >
< / a >
2020-02-24 20:44:50 +00:00
< a href = "https://github.com/sundowndev/dorkgen/actions" >
< img src = "https://img.shields.io/endpoint.svg?url=https://actions-badge.atrox.dev/sundowndev/dorkgen/badge?ref=master" alt = "build status" / >
< / a >
2020-02-24 19:34:02 +00:00
< a href = "https://goreportcard.com/report/github.com/sundowndev/dorkgen" >
< img src = "https://goreportcard.com/badge/github.com/sundowndev/dorkgen" alt = "go report" / >
< / a >
< a href = "https://codeclimate.com/github/sundowndev/dorkgen/maintainability" >
2020-02-24 19:53:31 +00:00
< img src = "https://api.codeclimate.com/v1/badges/e827d7cc994c6519d319/maintainability" / >
2020-02-24 19:34:02 +00:00
< / a >
< a href = "https://github.com/sundowndev/dorkgen/releases" >
< img src = "https://img.shields.io/github/release/SundownDEV/dorkgen.svg" alt = "Latest version" / >
< / a >
< / div >
Dorkgen is a dork request generator for popular search engines such as Google, DuckDuckGo and Bing. [Learn more about Google Hacking ](https://en.wikipedia.org/wiki/Google_hacking ).
## Install
```bash
go get github.com/sundowndev/dorkgen
```
## Usage
```go
package main
2020-02-25 09:03:38 +00:00
import "github.com/sundowndev/dorkgen"
2020-02-24 19:34:02 +00:00
func main() {
2020-02-25 09:03:38 +00:00
dork := & dorkgen.GoogleSearch{}
2020-02-24 21:06:34 +00:00
// dork := & dorkgen.DuckDuckGo{}
// dork := & dorkgen.Bing{}
2020-02-24 19:34:02 +00:00
dork.Site("example.com").Intext("06792489265").ToString()
2020-02-25 09:03:38 +00:00
// returns: site:example.com "06792489265"
2020-02-24 19:34:02 +00:00
dork.Site("example.com").Or().Intext("06792489265").ToString()
2020-02-25 09:03:38 +00:00
// returns: site:example.com OR "06792489265"
2020-02-24 19:34:02 +00:00
2020-02-25 09:03:38 +00:00
dork.Site("facebook.*").Exclude("site:facebook.com").ToURL()
// returns: https://www.google.com/search?q=site%3A"facebook.*"+-site%3Afacebook.com
2020-02-24 19:34:02 +00:00
}
```
## API
```go
type EngineFactory interface {
2020-02-25 09:03:38 +00:00
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
2020-02-24 19:34:02 +00:00
}
```