-
Notifications
You must be signed in to change notification settings - Fork 15
/
main.go
56 lines (44 loc) · 1.13 KB
/
main.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
package main
import (
"fmt"
"strings"
"sulab/core/cli"
"sulab/core/utils"
"github.com/c-bata/go-prompt"
"github.com/fatih/color"
)
var (
author string = "sulab"
version string = "0.1"
)
func showBanner() {
name := fmt.Sprintf("Taiji (v.%s)", version)
banner := `
_________ ____ ____________ ________________
/_ __/ _ | / _/_ / / _/ __/ / / / _/_ __/ __/
/ / / __ |_/ // // // /_\ \/ /_/ // / / / / _/
/_/ /_/ |_/___/\___/___/___/\____/___/ /_/ /___/
`
all_lines := strings.Split(banner, "\n")
w := len(all_lines[1])
fmt.Println(banner)
color.Green(fmt.Sprintf("%[1]*s", -w, fmt.Sprintf("%[1]*s", (w+len(name))/2, name)))
color.Blue(fmt.Sprintf("%[1]*s", -w, fmt.Sprintf("%[1]*s", (w+len(author))/2, author)))
fmt.Println()
}
func initCore() {
showBanner()
utils.InitConfig()
}
func main() {
initCore()
p := prompt.New(
cli.Executor,
cli.Completer,
prompt.OptionTitle("Taiji: Penetration Test Framework"),
prompt.OptionPrefix("[Taiji] > "),
prompt.OptionLivePrefix(cli.ChangeLivePrefix),
prompt.OptionInputTextColor(prompt.White),
)
p.Run()
}