Skip to content

Commit

Permalink
add port
Browse files Browse the repository at this point in the history
  • Loading branch information
firefart committed May 12, 2024
1 parent 3d97c5d commit e3cf8c4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cli/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ func ParseBasicHTTPOptions(c *cli.Context) (libgobuster.BasicHTTPOptions, error)
}
opts.LocalAddr = a
case localIP != "":
a, err := net.ResolveTCPAddr("ip", localIP)
if !strings.Contains(localIP, ":") {
localIP = fmt.Sprintf("%s:0", localIP)
}
a, err := net.ResolveTCPAddr("tcp", localIP)
if err != nil {
return opts, err
}
Expand Down

0 comments on commit e3cf8c4

Please sign in to comment.