mirror of https://github.com/daffainfo/nuclei.git
Misc + cmd + final
parent
2db1ad6ce9
commit
b1cd18b99d
|
@ -0,0 +1 @@
|
|||
cmd/nuclei/nuclei
|
|
@ -0,0 +1,19 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/projectdiscovery/gologger"
|
||||
"github.com/projectdiscovery/nuclei/internal/runner"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Parse the command line flags and read config files
|
||||
options := runner.ParseOptions()
|
||||
|
||||
runner, err := runner.New(options)
|
||||
if err != nil {
|
||||
gologger.Fatalf("Could not create runner: %s\n", err)
|
||||
}
|
||||
|
||||
runner.RunEnumeration()
|
||||
runner.Close()
|
||||
}
|
|
@ -27,14 +27,14 @@ type Options struct {
|
|||
func ParseOptions() *Options {
|
||||
options := &Options{}
|
||||
|
||||
flag.StringVar(&options.Templates, "f", "", "Template/templates to use during enumeration")
|
||||
flag.StringVar(&options.Targets, "l", "", "Targets to scan using templates during enumeration")
|
||||
flag.StringVar(&options.Templates, "t", "", "Template input file/files to run on host")
|
||||
flag.StringVar(&options.Targets, "l", "", "List of URLs to run templates on")
|
||||
flag.StringVar(&options.Output, "o", "", "File to write output to (optional)")
|
||||
flag.BoolVar(&options.Silent, "silent", false, "Show only subdomains in output")
|
||||
flag.BoolVar(&options.Version, "version", false, "Show version of shuffledns")
|
||||
flag.BoolVar(&options.Silent, "silent", false, "Show only results in output")
|
||||
flag.BoolVar(&options.Version, "version", false, "Show version of nuclei")
|
||||
flag.BoolVar(&options.Verbose, "v", false, "Show Verbose output")
|
||||
flag.BoolVar(&options.NoColor, "nC", false, "Don't Use colors in output")
|
||||
flag.IntVar(&options.Threads, "t", 100, "Number of concurrent requests to make")
|
||||
flag.IntVar(&options.Threads, "c", 100, "Number of concurrent requests to make")
|
||||
flag.IntVar(&options.Timeout, "timeout", 30, "Time to wait in seconds before timeout")
|
||||
|
||||
flag.Parse()
|
||||
|
|
|
@ -59,6 +59,10 @@ func (r *Runner) Close() {}
|
|||
// RunEnumeration sets up the input layer for giving input to massdns
|
||||
// binary and runs the actual enumeration
|
||||
func (r *Runner) RunEnumeration() {
|
||||
if !strings.HasSuffix(r.options.Templates, ".yaml") {
|
||||
gologger.Fatalf("Could not run recognize template extension: %s\n", r.options.Templates)
|
||||
}
|
||||
|
||||
// If the template path is a single template and not a glob, use that.
|
||||
if !strings.Contains(r.options.Templates, "*") {
|
||||
r.processTemplate(r.options.Templates)
|
||||
|
|
Loading…
Reference in New Issue