mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 19:05:26 +00:00
Misc + cmd + final
This commit is contained in:
parent
2db1ad6ce9
commit
b1cd18b99d
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
cmd/nuclei/nuclei
|
||||||
19
cmd/nuclei/main.go
Normal file
19
cmd/nuclei/main.go
Normal file
@ -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 {
|
func ParseOptions() *Options {
|
||||||
options := &Options{}
|
options := &Options{}
|
||||||
|
|
||||||
flag.StringVar(&options.Templates, "f", "", "Template/templates to use during enumeration")
|
flag.StringVar(&options.Templates, "t", "", "Template input file/files to run on host")
|
||||||
flag.StringVar(&options.Targets, "l", "", "Targets to scan using templates during enumeration")
|
flag.StringVar(&options.Targets, "l", "", "List of URLs to run templates on")
|
||||||
flag.StringVar(&options.Output, "o", "", "File to write output to (optional)")
|
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.Silent, "silent", false, "Show only results in output")
|
||||||
flag.BoolVar(&options.Version, "version", false, "Show version of shuffledns")
|
flag.BoolVar(&options.Version, "version", false, "Show version of nuclei")
|
||||||
flag.BoolVar(&options.Verbose, "v", false, "Show Verbose output")
|
flag.BoolVar(&options.Verbose, "v", false, "Show Verbose output")
|
||||||
flag.BoolVar(&options.NoColor, "nC", false, "Don't Use colors in 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.IntVar(&options.Timeout, "timeout", 30, "Time to wait in seconds before timeout")
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|||||||
@ -59,6 +59,10 @@ func (r *Runner) Close() {}
|
|||||||
// RunEnumeration sets up the input layer for giving input to massdns
|
// RunEnumeration sets up the input layer for giving input to massdns
|
||||||
// binary and runs the actual enumeration
|
// binary and runs the actual enumeration
|
||||||
func (r *Runner) RunEnumeration() {
|
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 the template path is a single template and not a glob, use that.
|
||||||
if !strings.Contains(r.options.Templates, "*") {
|
if !strings.Contains(r.options.Templates, "*") {
|
||||||
r.processTemplate(r.options.Templates)
|
r.processTemplate(r.options.Templates)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user