Added banners + ui
parent
ce4f3b09fe
commit
2e93df2e91
|
@ -1,6 +1,9 @@
|
|||
package runner
|
||||
|
||||
import "github.com/subfinder/subfinder/pkg/log"
|
||||
import (
|
||||
"github.com/subfinder/subfinder/pkg/log"
|
||||
"github.com/subfinder/subfinder/pkg/resolve"
|
||||
)
|
||||
|
||||
const banner = `
|
||||
_ __ _ _
|
||||
|
@ -39,12 +42,16 @@ func (options *Options) firstRunTasks() {
|
|||
|
||||
// Create the configuration file and display information
|
||||
// about it to the user.
|
||||
config := ConfigFile{}
|
||||
config := ConfigFile{
|
||||
// Use the default list of resolvers by marshalling it to the config
|
||||
Resolvers: resolve.DefaultResolvers,
|
||||
}
|
||||
|
||||
err := config.MarshalWrite(options.ConfigFile)
|
||||
if err != nil {
|
||||
log.Fatalf("Could not write configuration file to %s: %s\n", options.ConfigFile, err)
|
||||
}
|
||||
options.YAMLConfig = config
|
||||
|
||||
log.Infof("Configuration file saved to %s\n", options.ConfigFile)
|
||||
}
|
||||
|
|
|
@ -23,11 +23,8 @@ type Options struct {
|
|||
HostIP bool // HostIP specifies whether to write subdomains in host:ip format
|
||||
Silent bool // Silent suppresses any extra text and only writes subdomains to screen
|
||||
Sources string // Sources contains a comma-separated list of sources to use for enumeration
|
||||
sourcesSlice []string // unmarshaled list of sources
|
||||
ExcludeSources string // ExcludeSources contains the comma-separated sources to not include in the enumeration process
|
||||
excludeSourcesSlice []string // unmarshaled list of excluded sources
|
||||
Resolvers string // Resolvers is the comma-separated resolvers to use for enumeration
|
||||
resolversSlice []string // unmarshaled list of resolvers
|
||||
ResolverList string // ResolverList is a text file containing list of resolvers to use for enumeration
|
||||
RemoveWildcard bool // RemoveWildcard specifies whether to remove potential wildcard or dead subdomains from the results.
|
||||
UnauthenticatedOnly bool // UnauthenticatedOnly specifies to run enumeration using only sources that do not require an API key
|
||||
|
@ -85,6 +82,13 @@ func ParseOptions() *Options {
|
|||
options.normalRunTasks()
|
||||
}
|
||||
|
||||
// Validate the options passed by the user and if any
|
||||
// invalid options have been used, exit.
|
||||
err = options.validateOptions()
|
||||
if err != nil {
|
||||
log.Fatalf("Program exiting: %s\n", err)
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue