forked from Velocidex/velociraptor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbanner.go
58 lines (49 loc) · 1.51 KB
/
banner.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
58
package main
import (
"os"
"strings"
"www.velocidex.com/golang/velociraptor/config"
logging "www.velocidex.com/golang/velociraptor/logging"
)
var (
nobanner_flag = app.Flag(
"nobanner", "Suppress the Velociraptor banner").Bool()
)
var banner = `
<green> _ __ __ _ __
<green>| | / /__ / /___ _____(_)________ _____ / /_____ _____
<green>| | / / _ \/ / __ \/ ___/ / ___/ __ ` + "`" + `/ __ \/ __/ __ \/ ___/
<green>| |/ / __/ / /_/ / /__/ / / / /_/ / /_/ / /_/ /_/ / /
<green>|___/\___/_/\____/\___/_/_/ \__,_/ .___/\__/\____/_/
<green> /_/
<red>Digging deeper! <cyan>https://www.velocidex.com
`
func doBanner() {
if *nobanner_flag {
return
}
for _, line := range strings.Split(banner, "\n") {
if len(line) > 0 {
logging.Prelog(line)
}
}
version := config.GetVersion()
logging.Prelog("<yellow>This is Velociraptor %v built on %v (%v)", version.Version,
version.BuildTime, version.Commit)
// Record some important environment variables to the log.
for _, e := range os.Environ() {
pair := strings.SplitN(e, "=", 2)
if len(pair) != 2 {
continue
}
switch pair[0] {
case // Ignore this one as it is the actual configuration "VELOCIRAPTOR_CONFIG",
"VELOCIRAPTOR_SLOW_FILESYSTEM",
"VELOCIRAPTOR_DISABLE_CSRF", "VELOCIRAPTOR_INJECT_API_SLEEP",
"GOGC", "GOTRACEBACK", "GOMAXPROCS", "GODEBUG", "GOMEMLIMIT",
"GORACE":
logging.Prelog("<yellow>Environment Variable %v:</> %v",
pair[0], pair[1])
}
}
}