mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
Merge remote-tracking branch 'origin/main' into main
This commit is contained in:
+14
-13
@@ -6,7 +6,6 @@ import (
|
||||
"github.com/shadow1ng/fscan/WebScan/info"
|
||||
"github.com/shadow1ng/fscan/common"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type CheckDatas struct {
|
||||
@@ -14,7 +13,7 @@ type CheckDatas struct {
|
||||
Headers string
|
||||
}
|
||||
|
||||
func InfoCheck(Url string, CheckData []CheckDatas) {
|
||||
func InfoCheck(Url string, CheckData []CheckDatas) []string {
|
||||
var matched bool
|
||||
var infoname []string
|
||||
|
||||
@@ -36,12 +35,14 @@ func InfoCheck(Url string, CheckData []CheckDatas) {
|
||||
}
|
||||
}
|
||||
|
||||
infostr := RemoveMore(infoname)
|
||||
infoname = removeDuplicateElement(infoname)
|
||||
|
||||
if len(infoname) > 0 {
|
||||
result := fmt.Sprintf("[+] InfoScan:%-25v %s ", Url, infostr)
|
||||
result := fmt.Sprintf("[+] InfoScan:%-25v %s ", Url, infoname)
|
||||
common.LogSuccess(result)
|
||||
return infoname
|
||||
}
|
||||
return []string{""}
|
||||
}
|
||||
|
||||
func CalcMd5(Body []byte) (bool, string) {
|
||||
@@ -55,15 +56,15 @@ func CalcMd5(Body []byte) (bool, string) {
|
||||
return false, ""
|
||||
}
|
||||
|
||||
func RemoveMore(a []string) (infostr string) {
|
||||
var ret []string
|
||||
for i := 0; i < len(a); i++ {
|
||||
if (i > 0 && a[i-1] == a[i]) || len(a[i]) == 0 {
|
||||
continue
|
||||
func removeDuplicateElement(languages []string) []string {
|
||||
result := make([]string, 0, len(languages))
|
||||
temp := map[string]struct{}{}
|
||||
for _, item := range languages {
|
||||
if _, ok := temp[item]; !ok {
|
||||
temp[item] = struct{}{}
|
||||
result = append(result, item)
|
||||
}
|
||||
ret = append(ret, a[i])
|
||||
}
|
||||
infostr = strings.ReplaceAll(fmt.Sprintf("%s ", ret), "[", "")
|
||||
infostr = strings.ReplaceAll(infostr, "]", "")
|
||||
return
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
+10
-5
@@ -6,6 +6,7 @@ import (
|
||||
"github.com/shadow1ng/fscan/WebScan/lib"
|
||||
"github.com/shadow1ng/fscan/common"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
//go:embed pocs
|
||||
@@ -13,11 +14,15 @@ var Pocs embed.FS
|
||||
|
||||
func WebScan(info *common.HostInfo) {
|
||||
var pocinfo = common.Pocinfo
|
||||
pocinfo.Target = info.Url
|
||||
err := Execute(pocinfo)
|
||||
if err != nil {
|
||||
errlog := fmt.Sprintf("[-] webtitle %v %v", info.Url, err)
|
||||
common.LogError(errlog)
|
||||
buf := strings.Split(info.Url,"/")
|
||||
pocinfo.Target = strings.Join(buf[:3],"/")
|
||||
for _,infostr := range info.Infostr {
|
||||
pocinfo.PocName = lib.CheckInfoPoc(infostr)
|
||||
err := Execute(pocinfo)
|
||||
if err != nil {
|
||||
errlog := fmt.Sprintf("[-] webtitle %v %v", info.Url, err)
|
||||
common.LogError(errlog)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,11 @@ type Md5Data struct {
|
||||
Md5Str string
|
||||
}
|
||||
|
||||
type PocData struct {
|
||||
Name string
|
||||
Alias string
|
||||
}
|
||||
|
||||
var RuleDatas = []RuleData{
|
||||
{"Shiro", "headers", "(=deleteMe|rememberMe=)"},
|
||||
{"Portainer(Docker管理)", "code", "(portainer.updatePassword|portainer.init.admin)"},
|
||||
@@ -155,3 +160,17 @@ var Md5Datas = []Md5Data{
|
||||
{"GitLab", "85c754581e1d4b628be5b7712c042224"},
|
||||
{"Hikvision-视频监控", "89b932fcc47cf4ca3faadb0cfdef89cf"},
|
||||
}
|
||||
|
||||
var PocDatas = []PocData{
|
||||
{"致远OA","seeyon"},
|
||||
{"泛微OA","weaver-oa"},
|
||||
{"通达OA","tongda"},
|
||||
{"ThinkPHP","thinkphp"},
|
||||
{"Nexus","nexus"},
|
||||
{"齐治堡垒机","qizhi"},
|
||||
{"weaver-ebridge","weaver-ebridge"},
|
||||
{"weblogic","weblogic"},
|
||||
{"zabbix","zabbix"},
|
||||
{"VMware vSphere","vmware"},
|
||||
{"Jboss","jboss"},
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"embed"
|
||||
"fmt"
|
||||
"github.com/google/cel-go/cel"
|
||||
"github.com/shadow1ng/fscan/WebScan/info"
|
||||
"github.com/shadow1ng/fscan/common"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
@@ -689,3 +690,13 @@ func evalset(env *cel.Env, variableMap map[string]interface{}) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func CheckInfoPoc(infostr string) string {
|
||||
for _, poc := range info.PocDatas {
|
||||
if strings.Compare(poc.Name,infostr) == 0 {
|
||||
return poc.Alias
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user