MCPcopy Create free account
hub / github.com/SummerSec/SpringExploit / Run

Method Run

cmd/commons/core/runner.go:30–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28}
29
30func (r *Runner) Run() {
31 log.Info("Starting SpringExploit")
32 log.Debug("Runner Running")
33 //ip := r.options.IP
34 var urls []string
35 // TODO: check if options are valid
36 //r.options.Url = "http://127.0.0.1:8090/"
37
38 if r.options.Url != "" {
39 urls = append(urls, r.options.Url)
40 } else if r.options.File != "" {
41 urls, _ = utils.ReadFile(r.options.File)
42 } else if r.options.IP != "" {
43 urls = utils.GetIPToUrlsLinks(r.options.IP, urls)
44 } else if r.options.Update {
45 // go update
46 //selfUpdate()
47 // go github update
48 doSelfUpdate()
49 return
50 } else if r.options.Version {
51 // go update
52 //getLatestVersion()
53 // go github update
54 confirmAndSelfUpdate()
55 return
56 } else if r.options.SP {
57 return
58 } else {
59 log.Error("No file or url or ips specified")
60 return
61 }
62
63 log.Debugln("URLs Numbers: ", len(urls))
64 var i = 0
65 k := r.options.Thread
66 var wg sync.WaitGroup
67 hashmap := structs.Map(&r.options)
68 defer ants.Release()
69 // TODO: check if options are valid
70 if k <= 0 {
71 k = 500
72 }
73 log.Info("Running with ", k, " threads")
74 pool, err1 := ants.NewPool(k+1, ants.WithPreAlloc(true))
75 if err1 != nil {
76 log.Error("Error creating pool")
77 return
78 }
79 log.Info("Total URLs: ", len(urls))
80
81 for i < len(urls) {
82 //TODO 老代码
83 //for t := 0; t < k; t++ {
84 // if i == len(urls) {
85 // break
86 // }
87 // if urls[i] != "" {

Callers 3

mainFunction · 0.95
Test_selfUpdateFunction · 0.80

Calls 5

ReadFileFunction · 0.92
GetIPToUrlsLinksFunction · 0.92
doSelfUpdateFunction · 0.85
confirmAndSelfUpdateFunction · 0.85
Start2Function · 0.85

Tested by 2

Test_selfUpdateFunction · 0.64