Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Add generic timeout flag. only use nmap open ports. #170

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions core/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

type Options struct {
Threads *int
Timeout *int
OutDir *string
Proxy *string
ChromePath *string
Expand All @@ -25,6 +26,7 @@ type Options struct {
func ParseOptions() (Options, error) {
options := Options{
Threads: flag.Int("threads", 0, "Number of concurrent threads (default number of logical CPUs)"),
Timeout: flag.Int("timeout", 0, "Generic timeout for everithing. (specific timeouts will be ignored if set)"),
OutDir: flag.String("out", ".", "Directory to write files to"),
Proxy: flag.String("proxy", "", "Proxy to use for HTTP requests"),
ChromePath: flag.String("chrome-path", "", "Full path to the Chrome/Chromium executable to use. By default, aquatone will search for Chrome or Chromium"),
Expand All @@ -41,5 +43,11 @@ func ParseOptions() (Options, error) {

flag.Parse()

if *options.Timeout != 0 {
*options.ScanTimeout = *options.Timeout
*options.HTTPTimeout = *options.Timeout
*options.ScanTimeout = *options.Timeout
}

return options, nil
}
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ func main() {

sess.Out.Important("Targets : %d\n", len(targets))
sess.Out.Important("Threads : %d\n", *sess.Options.Threads)
sess.Out.Important("Ports : %s\n", strings.Trim(strings.Replace(fmt.Sprint(sess.Ports), " ", ", ", -1), "[]"))
if *sess.Options.Nmap {
sess.Out.Important("Ports : nmap open ports\n")
} else {
sess.Out.Important("Ports : %s\n", strings.Trim(strings.Replace(fmt.Sprint(sess.Ports), " ", ", ", -1), "[]"))
}
sess.Out.Important("Output dir : %s\n\n", *sess.Options.OutDir)

for _, target := range targets {
Expand Down
5 changes: 5 additions & 0 deletions parsers/nmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ func (p *NmapParser) isHTTPPort(port int) bool {
func (p *NmapParser) hostToURLs(host nmap.Host) []string {
var urls []string
for _, port := range host.Ports {

if port.State.State != "open" {
continue
}

var protocol string
if port.Service.Name == "ssl" {
protocol = "https"
Expand Down