-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
49 lines (40 loc) · 875 Bytes
/
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
package main
import (
"flag"
"fmt"
"slider/client"
"slider/pkg/conf"
"slider/server"
)
const help = `
Slider is a program able to run as:
* Server with the basic functionality of a Command & Control (C2)
* Client acting as an Agent that connects back to the Server counterpart.
Source Code available at:
https://github.com/rurreac/slider
Usage:
slider [command]
Available Commands:
client Runs a Slider Client instance
help Print this information out
server Runs a Slider Server instance
version Shows Binary Build info`
func main() {
flag.Parse()
var command string
var flags = flag.Args()
if len(flags) > 0 {
command = flags[0]
flags = flags[1:]
}
switch command {
case "server":
server.NewServer(flags)
case "client":
client.NewClient(flags)
case "version":
conf.PrintVersion()
default:
fmt.Printf("%s\n\n", help)
}
}