spray/pkg/types.go

46 lines
682 B
Go
Raw Normal View History

2022-09-19 14:42:29 +08:00
package pkg
import (
2022-11-10 21:18:26 +08:00
"github.com/chainreactors/parsers"
2022-09-19 14:42:29 +08:00
"strings"
)
2022-11-10 21:18:26 +08:00
type Frameworks []*parsers.Framework
2022-09-19 14:42:29 +08:00
2022-12-02 15:21:17 +08:00
func (fs Frameworks) String() string {
2022-09-19 14:42:29 +08:00
frameworkStrs := make([]string, len(fs))
for i, f := range fs {
frameworkStrs[i] = " [" + f.String() + "]"
2022-09-19 14:42:29 +08:00
}
2022-12-02 15:21:17 +08:00
return strings.Join(frameworkStrs, " ") + " "
2022-09-19 14:42:29 +08:00
}
func GetSourceName(s int) string {
switch s {
case 1:
return "check"
case 2:
return "random"
case 3:
return "index"
case 4:
return "redirect"
case 5:
return "crawl"
case 6:
return "active"
case 7:
return "word"
case 8:
return "waf"
case 9:
return "rule"
case 10:
return "bak"
case 11:
return "common"
default:
return "unknown"
}
}