#[naabu library] nmap related options not working

1 messages · Page 1 of 1 (latest)

fallen musk
#

Naabu library has the option to do the service scan, run nmap, etc, but all these options are not working. Bellow is the code snippet I am trying to run. Please let me know if I am doing something wrong

package main

import (
    "context"
    "log"

    "github.com/projectdiscovery/goflags"
    "github.com/projectdiscovery/naabu/v2/pkg/result"
    "github.com/projectdiscovery/naabu/v2/pkg/runner"
)

func main() {
    options := runner.Options{
        Host:     goflags.StringSlice{"scanme.sh"},
        ScanType: "s",
        OnResult: func(hr *result.HostResult) {
            log.Println(hr.Host, hr.Ports, hr)
        },
        Ports:   "80,443,8000,8080,8443",
        Timeout: 10000,
        Stdin:   false,
        //Silent:           true,
        Verify:           true,
        ExcludeCDN:       false,
        Nmap:             true,
        ServiceDiscovery: true,
        OutputCDN:        true,
    }

    naabuRunner, err := runner.NewRunner(&options)
    if err != nil {
        log.Fatal(err)
    }
    defer naabuRunner.Close()

    err = naabuRunner.RunEnumeration(context.Background())
    if err != nil {
        return
    }
    return
}

Output

[INF] Running CONNECT scan with non root privileges
scanme.sh:80
scanme.sh:443
[INF] Found 2 ports on host scanme.sh (128.199.158.128)
2024/09/23 23:26:01 scanme.sh [80-0-false 443-0-false] &{scanme.sh 128.199.158.128 [80-0-false 443-0-false]}