mirror of https://github.com/daffainfo/nuclei.git
Added normalized wappalyzer versioned appName
parent
7e11232952
commit
d7d80e3447
|
@ -171,7 +171,7 @@ func (s *Service) processWappalyzerInputPair(input string) {
|
|||
fingerprints := s.wappalyzer.Fingerprint(resp.Header, data)
|
||||
normalized := make(map[string]struct{})
|
||||
for k := range fingerprints {
|
||||
normalized[strings.ToLower(k)] = struct{}{}
|
||||
normalized[normalizeAppName(k)] = struct{}{}
|
||||
}
|
||||
|
||||
if s.opts.Options.Verbose {
|
||||
|
@ -215,6 +215,15 @@ func (s *Service) processWappalyzerInputPair(input string) {
|
|||
}
|
||||
}
|
||||
|
||||
func normalizeAppName(appName string) string {
|
||||
if strings.Contains(appName, ":") {
|
||||
if parts := strings.Split(appName, ":"); len(parts) == 2 {
|
||||
appName = parts[0]
|
||||
}
|
||||
}
|
||||
return strings.ToLower(appName)
|
||||
}
|
||||
|
||||
func uniqueSlice(slice []string) []string {
|
||||
data := make(map[string]struct{}, len(slice))
|
||||
for _, item := range slice {
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package automaticscan
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestNormalizeAppName(t *testing.T) {
|
||||
appName := normalizeAppName("JBoss")
|
||||
require.Equal(t, "jboss", appName, "could not get normalized name")
|
||||
|
||||
appName = normalizeAppName("JBoss:2.3.5")
|
||||
require.Equal(t, "jboss", appName, "could not get normalized name")
|
||||
}
|
Loading…
Reference in New Issue