Updated and made some misc changes

master
ice3man 2018-04-06 18:19:12 +05:30
parent 565d301da0
commit f57df62b0b
4 changed files with 41 additions and 6 deletions

View File

@ -19,6 +19,7 @@ import (
"subfinder/libsubfinder/sources/certspotter"
"subfinder/libsubfinder/sources/crtsh"
"subfinder/libsubfinder/sources/hackertarget"
"subfinder/libsubfinder/sources/findsubdomains"
//"subfinder/libsubfinder/sources/dnsdb"
"subfinder/libsubfinder/sources/threatcrowd"
"subfinder/libsubfinder/sources/virustotal"
@ -32,27 +33,29 @@ func PassiveDiscovery(state *helper.State) (finalPassiveSubdomains []string) {
fmt.Printf("\n\n[-] Searching For Subdomains in Crt.sh")
fmt.Printf("\n[-] Searching For Subdomains in Certspotter")
fmt.Printf("\n[-] Searching For Subdomains in Threatcrowd")
fmt.Printf("\n[-] Searching For Subdomains in Findsubdomains")
fmt.Printf("\n[-] Searching For Subdomains in Hackertarget")
fmt.Printf("\n[-] Searching For Subdomains in Virustotal")
fmt.Printf("\n[-] Searching For Subdomains in Netcraft\n")
ch := make(chan helper.Result, 6)
ch := make(chan helper.Result, 7)
// Create goroutines for added speed and recieve data via channels
go crtsh.Query(state, ch)
go certspotter.Query(state, ch)
go hackertarget.Query(state, ch)
go findsubdomains.Query(state, ch)
go threatcrowd.Query(state, ch)
go virustotal.Query(state, ch)
go netcraft.Query(state, ch)
// recieve data from all goroutines running
for i := 1; i <= 6; i++ {
for i := 1; i <= 7; i++ {
result := <-ch
if result.Error != nil {
// some error occured
fmt.Println(result.Error)
fmt.Printf("\nerror: %v\n", result.Error)
}
for _, subdomain := range result.Subdomains {
finalPassiveSubdomains = append(finalPassiveSubdomains, subdomain)

View File

@ -13,8 +13,8 @@ package helper
var (
Red = "\033[31;1;4m" // red color
Cyan = "\033[36;1;4m" // cyan color
Cyan = "\033[36;6;4m" // cyan color
Green = "\033[32;6;4m" // Green color
Reset = "\033[0m" // reset for default color
)

View File

@ -10,7 +10,10 @@ package helper
import (
"io/ioutil"
"crypto/rand"
"io"
"encoding/json"
"fmt"
)
// Current result structure
@ -19,6 +22,31 @@ 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
}
//
// NewUUID generates a random UUID according to RFC 4122
// Taken from : https://play.golang.org/p/4FkNSiUDMg
//
// Used for bruteforcing and detection of Wildcard Subdomains :-)
func NewUUID() (string, error) {
uuid := make([]byte, 16)
n, err := io.ReadFull(rand.Reader, uuid)
if n != len(uuid) || err != nil {
return "", err
}
// variant bits; see section 4.1.1
uuid[8] = uuid[8]&^0xc0 | 0x80
// version 4 (pseudo-random); see section 4.1.3
uuid[6] = uuid[6]&^0xf0 | 0x40
return fmt.Sprintf("%x-%x-%x-%x-%x", uuid[0:4], uuid[4:6], uuid[6:8], uuid[8:10], uuid[10:]), nil
}
//
// ReadConfigFile : Reads a config file from disk
//

View File

@ -17,6 +17,10 @@ type State struct {
Verbose bool // Show verbose information
Domain string // Domain name to find subdomains for
Recursive bool // Whether perform recursive subdomain discovery or not
Wordlist string // Wordlist file for subdomains bruteforcing
Bruteforce bool // Flag to decide whether to bruteforce or not
WildcardIPs []string // Wildcard IP Structure
IsWildcard bool // Does the host has wildcard subdomains, if yes parse them carefully
ConfigState Config // Current configuration file state
}
@ -33,5 +37,5 @@ func InitState() (state State, err error) {
return state, err
}
return State{true, 10, 180, false, "", false, *config}, nil
return State{true, 10, 180, false, "", false, "", false, []string{}, true, *config}, nil
}