Added Directory checking before run resolving issue #38

master
ice3man 2018-05-09 14:48:48 +05:30
parent 25858f557a
commit d6bdc9b95a
2 changed files with 20 additions and 4 deletions

View File

@ -21,10 +21,10 @@ type Result struct {
Error error // Any error that has occured
}
// Current Bruteforce structure
type BruteforceResult struct {
Entity string // Current Subdomain we found
Error error // Error
// Struct containing jobs
type Job struct {
Work string
Result string
}
// NewUUID generates a random UUID according to RFC 4122

16
main.go
View File

@ -14,6 +14,7 @@ import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"reflect"
"strings"
@ -134,6 +135,21 @@ func main() {
}
}
if state.Output != "" {
dir := filepath.Dir(state.Output)
exists, _ := helper.Exists(dir)
if exists == false {
fmt.Printf("\n[!] The specified output directory does not exists !\n")
os.Exit(1)
}
} else if state.OutputDir != "" {
exists, _ := helper.Exists(state.OutputDir)
if exists == false {
fmt.Printf("\n[!] The specified output directory does not exists !\n")
os.Exit(1)
}
}
if state.Domain == "" && state.DomainList == "" {
if state.Silent != true {
fmt.Printf("\n\nsubfinder: Missing domain argument\nTry './subfinder -h' for more information\n")