File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 "encoding/xml"
55 "fmt"
66 "os"
7+ "net"
78
89 "github.com/sensepost/gowitness/internal/islazy"
910)
@@ -134,15 +135,21 @@ func (nr *NessusReader) Read(ch chan<- string) error {
134135func (nr * NessusReader ) urlsFor (target string , ports []int ) []string {
135136 var urls []string
136137
138+ ip := net .ParseIP (target )
139+
140+ host := target
141+ if ip != nil && ip .To4 () == nil {
142+ host = fmt .Sprintf ("[%s]" , target )
143+ }
144+
137145 for _ , port := range ports {
138146 if ! nr .Options .NoHTTP {
139- urls = append (urls , fmt .Sprintf ("http://%s:%d" , target , port ))
147+ urls = append (urls , fmt .Sprintf ("http://%s:%d" , host , port ))
140148 }
141-
142149 if ! nr .Options .NoHTTPS {
143- urls = append (urls , fmt .Sprintf ("https://%s:%d" , target , port ))
150+ urls = append (urls , fmt .Sprintf ("https://%s:%d" , host , port ))
144151 }
145152 }
146-
153+
147154 return urls
148155}
You can’t perform that action at this time.
0 commit comments