86ea36ac28 | ||
---|---|---|
.github/workflows | ||
docs | ||
.codeclimate.yml | ||
.gitignore | ||
LICENSE | ||
README.md | ||
doc.go | ||
dorkgen.go | ||
go.mod | ||
go.sum | ||
google.go | ||
google_test.go | ||
renovate.json |
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
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 intext:"text"
}
Operators
func main() {
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: intext:"facebook" AND intext:"twitter"
}
Exclude results
func main() {
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
func main() {
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
func main() {
dork.
Site("facebook.*").
Exclude((&dorkgen.GoogleSearch{}).
Site("facebook.com").
ToString())
dork.ToString()
// 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.