Skip to content

Commit

Permalink
[+]目前来看完美解决了乱码问题~
Browse files Browse the repository at this point in the history
  • Loading branch information
lcvvvv committed Jun 17, 2021
1 parent 2b7aa85 commit 89993db
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
18 changes: 16 additions & 2 deletions get-appbanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,36 @@ func GetAppBannerFromTcpBanner(banner *TcpBanner) *AppBanner {
url = fmt.Sprintf("%s://%s", banner.TcpFinger.Service, banner.Uri)
parse, _ := urlparse.Load(url)
appBanner = getAppBanner(parse)
appBanner.LoadTcpBanner(banner)
if appBanner.Response == "" {
return nil
}
return appBanner
}
if banner.TcpFinger.Service == "ssl" {
if banner.TcpFinger.Service == "ssl" && strings.Contains(banner.Response.string, "HTTP") {
url = fmt.Sprintf("https://%s", banner.Uri)
parse, _ := urlparse.Load(url)
appBanner = getAppBanner(parse)
appBanner.LoadTcpBanner(banner)
if appBanner.Response == "" {
return nil
}
return appBanner
}
if strings.Contains(banner.Response.string, "HTTP") {
url = "http://" + banner.Uri
parse, _ := urlparse.Load(url)
appBanner = getAppBanner(parse)
appBanner.LoadTcpBanner(banner)
if appBanner.Response == "" {
return nil
}
return appBanner
}
appBanner.LoadTcpBanner(banner)
if appBanner.Response == "" {
return nil
}

return appBanner
}

Expand Down
3 changes: 3 additions & 0 deletions gonmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ func (n *Nmap) Scan(ip string, port int) TcpBanner {
if b.TcpFinger.Service == "ssl/http" {
b.TcpFinger.Service = "https"
}
if b.TcpFinger.Service == "ssl/https" {
b.TcpFinger.Service = "https"
}
return b
}

Expand Down

0 comments on commit 89993db

Please sign in to comment.