https://github.com/sundowndev/dorkgen
Type-safe dork queries for search engines such as Google, Yahoo, DuckDuckGo & Bing
https://github.com/sundowndev/dorkgen
bing bing-search dork dork-queries duckduckgo google-hacking search-engine search-engines yahoo
Last synced: 15 days ago
JSON representation
Type-safe dork queries for search engines such as Google, Yahoo, DuckDuckGo & Bing
- Host: GitHub
- URL: https://github.com/sundowndev/dorkgen
- Owner: sundowndev
- License: mit
- Created: 2020-02-24T10:34:17.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-04T13:37:14.000Z (about 4 years ago)
- Last Synced: 2025-03-31T09:07:37.069Z (22 days ago)
- Topics: bing, bing-search, dork, dork-queries, duckduckgo, google-hacking, search-engine, search-engines, yahoo
- Language: Go
- Homepage: https://pkg.go.dev/github.com/sundowndev/dorkgen
- Size: 179 KB
- Stars: 95
- Watchers: 6
- Forks: 19
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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](https://en.wikipedia.org/wiki/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](https://github.com/sundowndev/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](https://pkg.go.dev/github.com/sundowndev/dorkgen/googlesearch) | Stable |
| [DuckDuckGo](https://pkg.go.dev/github.com/sundowndev/dorkgen/duckduckgo) | Stable |
| Yahoo Search | WIP |
| Bing Search | WIP |## Install
Fetch the module :
```bash
go get github.com/sundowndev/dorkgen
```## Usage
**[Try it in the Go playground](https://play.golang.org/p/QKHG2cZe4iK)**
#### Get started
```go
package mainimport "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
```go
func main() {
dork.Site("facebook.com").Or().Site("twitter.com").String()
// returns: site:facebook.com | site:twitter.comdork.InText("facebook").And().InText("twitter").String()
// returns: intext:"facebook" + intext:"twitter"
}
```#### Exclude results
```go
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
```go
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
```go
func main() {
dork.
Site("facebook.*").
Exclude(dorkgen.NewGoogleSearch().Site("facebook.com"))dork.String()
// returns: site:facebook.* -site:facebook.comdork.ToURL()
// returns: https://www.google.com/search?q=site%3Afacebook.%2A+-site%3Afacebook.com
}
```## Support
[](https://www.jetbrains.com/?from=sundowndev)
Thanks to [JetBrains](https://www.jetbrains.com/?from=sundowndev) for supporting my open-source projects.