Skip to content

Commit

Permalink
initial project gofind domain finder
Browse files Browse the repository at this point in the history
  • Loading branch information
kankburhan committed Feb 15, 2022
0 parents commit 162be35
Show file tree
Hide file tree
Showing 15 changed files with 646 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ko_fi: kankburhan
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
dist/
21 changes: 21 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
builds:
- binary: dofind
main: cmd/dofind/main.go
goos:
- linux
- windows
- darwin
goarch:
- amd64
- 386
- arm
- arm64

archives:
- id: tgz
format: tar.gz
replacements:
darwin: macOS
format_overrides:
- goos: windows
format: zip
116 changes: 116 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<h4 align="center">Dofind is fast domain related finder made with golang.</h4>

[![made-with-Go](https://img.shields.io/badge/made%20with-Go-green.svg)](http://golang.org)
[![issues](https://img.shields.io/github/issues/kankburhan/dofind?color=green)](https://github.com/kankburhan/dofind/issues)

```txt
██████╗░░█████╗░███████╗██╗███╗░░██╗██████╗░
██╔══██╗██╔══██╗██╔════╝██║████╗░██║██╔══██╗
██║░░██║██║░░██║█████╗░░██║██╔██╗██║██║░░██║
██║░░██║██║░░██║██╔══╝░░██║██║╚████║██║░░██║
██████╔╝╚█████╔╝██║░░░░░██║██║░╚███║██████╔╝
╚═════╝░░╚════╝░╚═╝░░░░░╚═╝╚═╝░░╚══╝╚═════╝░
______________ by @kankburhan ______________
Usage:
dofind [options]
Options:
-t, --target <TARGET> Target find domain
-o, --output <FILE> File to save results
-c, --concurrent <i> Set the concurrency level (default: 20)
-s, --silent Silent mode
-v, --verbose Verbose mode
-u, --update-domain Update domain list
-h, --help Display its help
```
---
## Resources

- [Installation](#installation)
- [from Source](#from-source)
- [from GitHub](#from-github)
- [Usage](#usage)
- [Basic Usage](#basic-usage)
- [Flags](#flags)
- [TODOs](#todos)
- [Help & Bugs](#help--bugs)
- [License](#license)
- [Version](#version)

## Installation

### from Source

go compiler:

```bash
▶ go install -v github.com/kankburhan/dofind/cmd/dofind@latest
```

### from GitHub

```bash
▶ git clone https://github.com/kankburhan/dofind
cd dofind/cmd/dofind/
▶ go build .
▶ (sudo) mv dofind /usr/local/bin
```

## Usage

### Basic Usage

Run dofind with:

```bash
▶ dofind -t yahoo -o "/path/output"
```

### Flags

```bash
▶ dofind -h
```

This will display help for the tool.

```txt
██████╗░░█████╗░███████╗██╗███╗░░██╗██████╗░
██╔══██╗██╔══██╗██╔════╝██║████╗░██║██╔══██╗
██║░░██║██║░░██║█████╗░░██║██╔██╗██║██║░░██║
██║░░██║██║░░██║██╔══╝░░██║██║╚████║██║░░██║
██████╔╝╚█████╔╝██║░░░░░██║██║░╚███║██████╔╝
╚═════╝░░╚════╝░╚═╝░░░░░╚═╝╚═╝░░╚══╝╚═════╝░
______________ by @kankburhan ______________
Usage:
dofind [options]
Options:
-t, --target <TARGET> Target find domain
-o, --output <FILE> File to save results
-c, --concurrent <i> Set the concurrency level (default: 20)
-s, --silent Silent mode
-v, --verbose Verbose mode
-u, --update-domain Update domain list
-h, --help Display its help
```
## TODOs

- [ ] Validate parking domain
## Help & Bugs

[![contributions welcome](https://img.shields.io/badge/contributions-welcome-blue.svg)](https://github.com/kankburhan/dofind/issues)

If you are still confused or found a bug, please [open the issue](https://github.com/kankburhan/dofind/issues).

## License

[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)

**dofind** released under MIT. See `LICENSE` for more details.

## Version

**Current version is 1.2.0** and still development.
8 changes: 8 additions & 0 deletions cmd/dofind/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package main

import "github.com/kankburhan/dofind/internal/runner"

func main() {
option := runner.ParseOptions()
runner.New(option)
}
25 changes: 25 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module github.com/kankburhan/dofind

go 1.17

require (
github.com/gojek/heimdall/v7 v7.0.2
github.com/logrusorgru/aurora/v3 v3.0.0
github.com/projectdiscovery/gologger v1.1.4
github.com/reiver/go-telnet v0.0.0-20180421082511-9ff0b2ab096e
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gojek/valkyrie v0.0.0-20190210220504-8f62c1e7ba45 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/reiver/go-oi v1.0.0 // indirect
github.com/stretchr/objx v0.3.0 // indirect
github.com/stretchr/testify v1.7.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
65 changes: 65 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
github.com/DataDog/datadog-go v3.7.1+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
github.com/cactus/go-statsd-client/statsd v0.0.0-20200423205355-cb0885a1018c/go.mod h1:l/bIBLeOl9eX+wxJAzxS4TveKRtAqlyDpHjhkfO0MEI=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gojek/heimdall/v7 v7.0.2 h1:+YutGXZ8oEWbCJIwjRnkKmoTl+Oxt1Urs3hc/FR0sxU=
github.com/gojek/heimdall/v7 v7.0.2/go.mod h1:Z43HtMid7ysSjmsedPTXAki6jcdcNVnjn5pmsTyiMic=
github.com/gojek/valkyrie v0.0.0-20180215180059-6aee720afcdf/go.mod h1:QzhUKaYKJmcbTnCYCAVQrroCOY7vOOI8cSQ4NbuhYf0=
github.com/gojek/valkyrie v0.0.0-20190210220504-8f62c1e7ba45 h1:jrnJW3T+GsaQCD26fe6ERlNpgLB5HlekzBU4lOscr80=
github.com/gojek/valkyrie v0.0.0-20190210220504-8f62c1e7ba45/go.mod h1:QzhUKaYKJmcbTnCYCAVQrroCOY7vOOI8cSQ4NbuhYf0=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8=
github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
github.com/logrusorgru/aurora/v3 v3.0.0 h1:R6zcoZZbvVcGMvDCKo45A9U/lzYyzl5NfYIvznmDfE4=
github.com/logrusorgru/aurora/v3 v3.0.0/go.mod h1:vsR12bk5grlLvLXAYrBsb5Oc/N+LxAlxggSjiwMnCUc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/projectdiscovery/gologger v1.1.4 h1:qWxGUq7ukHWT849uGPkagPKF3yBPYAsTtMKunQ8O2VI=
github.com/projectdiscovery/gologger v1.1.4/go.mod h1:Bhb6Bdx2PV1nMaFLoXNBmHIU85iROS9y1tBuv7T5pMY=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/reiver/go-oi v1.0.0 h1:nvECWD7LF+vOs8leNGV/ww+F2iZKf3EYjYZ527turzM=
github.com/reiver/go-oi v1.0.0/go.mod h1:RrDBct90BAhoDTxB1fenZwfykqeGvhI6LsNfStJoEkI=
github.com/reiver/go-telnet v0.0.0-20180421082511-9ff0b2ab096e h1:quuzZLi72kkJjl+f5AQ93FMcadG19WkS7MO6TXFOSas=
github.com/reiver/go-telnet v0.0.0-20180421082511-9ff0b2ab096e/go.mod h1:+5vNVvEWwEIx86DB9Ke/+a5wBI464eDRo3eF0LcfpWg=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As=
github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
28 changes: 28 additions & 0 deletions internal/runner/constans.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package runner

const (
version = "1.2.0"
header = `
██████╗░░█████╗░███████╗██╗███╗░░██╗██████╗░
██╔══██╗██╔══██╗██╔════╝██║████╗░██║██╔══██╗
██║░░██║██║░░██║█████╗░░██║██╔██╗██║██║░░██║
██║░░██║██║░░██║██╔══╝░░██║██║╚████║██║░░██║
██████╔╝╚█████╔╝██║░░░░░██║██║░╚███║██████╔╝
╚═════╝░░╚════╝░╚═╝░░░░░╚═╝╚═╝░░╚══╝╚═════╝░
______________ by @kankburhan ______________
`
usage = `
dofind [options]`
options = `
-t, --target <TARGET> Target find domain
-o, --output <FILE> File to save results
-c, --concurrent <i> Set the concurrency level (default: 20)
-s, --silent Silent mode
-v, --verbose Verbose mode
-u, --update-domain Update domain list
-h, --help Display its help
`
Timeout = 1000
pathfile = "/.config/.dofind/"
configfile = "config.json"
)
80 changes: 80 additions & 0 deletions internal/runner/options.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package runner

import (
"flag"
"fmt"
"os"
"strings"

"github.com/projectdiscovery/gologger"
)

// Options args
type Options struct {
Target, Saveto string
Concurrency int
Silent, Verbose, UpdateTld bool
Output *os.File
Domains []string
}

var o *Options

func init() {
o = &Options{}
}

func init() {
o = &Options{}

flag.StringVar(&o.Target, "t", "", "")
flag.StringVar(&o.Target, "target", "", "")

flag.StringVar(&o.Saveto, "o", "", "")
flag.StringVar(&o.Saveto, "output", "", "")

flag.IntVar(&o.Concurrency, "c", 20, "")
flag.IntVar(&o.Concurrency, "concurrent", 20, "")

flag.BoolVar(&o.Silent, "s", false, "")
flag.BoolVar(&o.Silent, "silent", false, "")

flag.BoolVar(&o.Verbose, "v", false, "")
flag.BoolVar(&o.Verbose, "verbose", false, "")

flag.BoolVar(&o.UpdateTld, "u", false, "")
flag.BoolVar(&o.UpdateTld, "update-domain", false, "")

// Override help text
flag.Usage = func() {
banner()
h := []string{
"",
"Usage:" + usage,
"",
"Options:" + options,
"",
}

fmt.Fprint(os.Stderr, strings.Join(h, "\n"))
}

flag.Parse()
}

// ParseOptions will parse given args
func ParseOptions() *Options {
// Show banner to user
if !o.Silent {
banner()
}

// Validate input options
o.validate()

return o
}

func banner() {
gologger.Print().Msgf("%s\n\n", header)
}
39 changes: 39 additions & 0 deletions internal/runner/runner.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package runner

import (
"os"

"github.com/kankburhan/dofind/pkg/config"
"github.com/kankburhan/dofind/pkg/dofind"
"github.com/kankburhan/dofind/pkg/domains"
"github.com/projectdiscovery/gologger"
)

func New(options *Options) {
cfg := config.UserHomeDir() + pathfile + configfile
if options.UpdateTld {
gologger.Print().Msgf("Starting update from iana.org")
err := domains.Download(cfg, "https://data.iana.org/TLD/tlds-alpha-by-domain.txt")
if err != nil {
gologger.Error().Msgf("Failed update domains")
os.Exit(1)
}
}

domain, err := config.Get(cfg)
if err != nil {
gologger.Error().Msgf("No domain list found, please update with -u, -update-domain")
os.Exit(1)
}
options.Domains = domain

gologger.Info().Msgf("%d domains loaded.", len(domain))
dofind.Find(
options.Target,
options.Domains,
options.Concurrency,
options.Silent,
options.Verbose,
options.Output,
)
}
Loading

0 comments on commit 162be35

Please sign in to comment.