/
banners.go
57 lines (48 loc) · 1.8 KB
/
banners.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package runner
import (
"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/subfinder/pkg/passive"
"github.com/projectdiscovery/subfinder/pkg/resolve"
)
const banner = `
_ __ _ _
____ _| |__ / _(_)_ _ __| |___ _ _
(_-< || | '_ \ _| | ' \/ _ / -_) '_|
/__/\_,_|_.__/_| |_|_||_\__,_\___|_| v2
`
// Version is the current version of subfinder
const Version = `2.3.4`
// showBanner is used to show the banner to the user
func showBanner() {
gologger.Printf("%s\n", banner)
gologger.Printf("\t\tprojectdiscovery.io\n\n")
gologger.Labelf("Use with caution. You are responsible for your actions\n")
gologger.Labelf("Developers assume no liability and are not responsible for any misuse or damage.\n")
gologger.Labelf("By using subfinder, you also agree to the terms of the APIs used.\n\n")
}
// normalRunTasks runs the normal startup tasks
func (options *Options) normalRunTasks() {
configFile, err := UnmarshalRead(options.ConfigFile)
if err != nil {
gologger.Fatalf("Could not read configuration file %s: %s\n", options.ConfigFile, err)
}
options.YAMLConfig = configFile
}
// firstRunTasks runs some housekeeping tasks done
// when the program is ran for the first time
func (options *Options) firstRunTasks() {
// Create the configuration file and display information
// about it to the user.
config := ConfigFile{
// Use the default list of resolvers by marshalling it to the config
Resolvers: resolve.DefaultResolvers,
// Use the default list of passive sources
Sources: passive.DefaultSources,
}
err := config.MarshalWrite(options.ConfigFile)
if err != nil {
gologger.Fatalf("Could not write configuration file to %s: %s\n", options.ConfigFile, err)
}
options.YAMLConfig = config
gologger.Infof("Configuration file saved to %s\n", options.ConfigFile)
}