Skip to content
Merged
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ RATE-LIMIT:
-jsc, -js-concurrency int maximum number of javascript runtimes to be executed in parallel (default 120)
-pc, -payload-concurrency int max payload concurrency for each template (default 25)
-prc, -probe-concurrency int http probe concurrency with httpx (default 50)
-tlc, -template-loading-concurrency int maximum number of concurrent template loading operations (default 50)

OPTIMIZATIONS:
-timeout int time to wait in seconds before timeout (default 10)
Expand Down
1 change: 1 addition & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ UNCOVER引擎:
-c, -concurrency int 并行执行的最大模板数量(默认:25)
-hbs, -headless-bulk-size int 每个模板并行运行的无头主机最大数量(默认:10)
-headc, -headless-concurrency int 并行指定无头主机最大数量(默认:10)
-tlc, -template-loading-concurrency int 最大并发模板加载操作数(默认:50)


优化:
Expand Down
1 change: 1 addition & 0 deletions README_ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ RATE-LIMIT:
-headc, -headless-concurrency int número máximo de plantillas headless a ejecutar en paralelo (por defecto 10)
-jsc, -js-concurrency int número máximo de entornos de ejecución de JavaScript a ejecutar en paralelo (por defecto 120)
-pc, -payload-concurrency int concurrencia máxima de carga útil para cada plantilla (por defecto 25)
-tlc, -template-loading-concurrency int número máximo de operaciones de carga de plantillas concurrentes (por defecto 50)

OPTIMIZATIONS:
-timeout int tiempo de espera en segundos (por defecto 10)
Expand Down
1 change: 1 addition & 0 deletions README_ID.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ RATE-LIMIT:
-c, -concurrency int maximum number of templates to be executed in parallel (default 25)
-hbs, -headless-bulk-size int maximum number of headless hosts to be analyzed in parallel per template (default 10)
-headc, -headless-concurrency int maximum number of headless templates to be executed in parallel (default 10)
-tlc, -template-loading-concurrency int maximum number of concurrent template loading operations (default 50)

OPTIMIZATIONS:
-timeout int time to wait in seconds before timeout (default 10)
Expand Down
1 change: 1 addition & 0 deletions README_KR.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ RATE-LIMIT:
-c, -concurrency int 병렬로 실행할 최대 템플릿 수 (기본값 25)
-hbs, -headless-bulk-size int 템플릿당 병렬로 분석할 최대 headless 호스트 수 (기본값 10)
-headc, -headless-concurrency int 병렬로 실행할 최대 headless 템플릿 수 (기본값 10)
-tlc, -template-loading-concurrency int 최대 동시 템플릿 로딩 작업 수 (기본값 50)

OPTIMIZATIONS:
-timeout int 타임아웃 전에 기다릴 초 수 (기본값 10)
Expand Down
1 change: 1 addition & 0 deletions README_PT-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ RATE-LIMIT:
-headc, -headless-concurrency int número máximo de templates headless a serem executados em paralelo (padrão 10)
-jsc, -js-concurrency int número máximo de ambientes de execução de JavaScript a serem executados em paralelo (padrão 120)
-pc, -payload-concurrency int concorrência máxima de payload para cada template (padrão 25)
-tlc, -template-loading-concurrency int número máximo de operações de carregamento de templates concorrentes (padrão 50)

OPTIMIZATIONS:
-timeout int tempo limite em segundos (padrão 10)
Expand Down
1 change: 1 addition & 0 deletions cmd/nuclei/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ on extensive configurability, massive extensibility and ease of use.`)
flagSet.IntVarP(&options.JsConcurrency, "js-concurrency", "jsc", 120, "maximum number of javascript runtimes to be executed in parallel"),
flagSet.IntVarP(&options.PayloadConcurrency, "payload-concurrency", "pc", 25, "max payload concurrency for each template"),
flagSet.IntVarP(&options.ProbeConcurrency, "probe-concurrency", "prc", 50, "http probe concurrency with httpx"),
flagSet.IntVarP(&options.TemplateLoadingConcurrency, "template-loading-concurrency", "tlc", types.DefaultTemplateLoadingConcurrency, "maximum number of concurrent template loading operations"),
)
flagSet.CreateGroup("optimization", "Optimizations",
flagSet.IntVar(&options.Timeout, "timeout", 10, "time to wait in seconds before timeout"),
Expand Down
6 changes: 5 additions & 1 deletion pkg/catalog/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,11 @@ func (store *Store) LoadTemplatesWithTags(templatesList, tags []string) []*templ
}
}

wgLoadTemplates, errWg := syncutil.New(syncutil.WithSize(50))
concurrency := store.config.ExecutorOptions.Options.TemplateLoadingConcurrency
if concurrency <= 0 {
concurrency = types.DefaultTemplateLoadingConcurrency
}
wgLoadTemplates, errWg := syncutil.New(syncutil.WithSize(concurrency))
if errWg != nil {
panic("could not create wait group")
}
Expand Down
31 changes: 18 additions & 13 deletions pkg/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import (
unitutils "github.com/projectdiscovery/utils/unit"
)

const DefaultTemplateLoadingConcurrency = 50

var (
// ErrNoMoreRequests is internal error to indicate that generator has no more requests to generate
ErrNoMoreRequests = io.EOF
Expand Down Expand Up @@ -429,6 +431,8 @@ type Options struct {
PayloadConcurrency int
// ProbeConcurrency is the number of concurrent http probes to run with httpx
ProbeConcurrency int
// TemplateLoadingConcurrency is the number of concurrent template loading operations
TemplateLoadingConcurrency int
// Dast only runs DAST templates
DAST bool
// DASTServer is the flag to start nuclei as a DAST server
Expand Down Expand Up @@ -775,19 +779,20 @@ func (options *Options) HasClientCertificates() bool {
// DefaultOptions returns default options for nuclei
func DefaultOptions() *Options {
return &Options{
RateLimit: 150,
RateLimitDuration: time.Second,
BulkSize: 25,
TemplateThreads: 25,
HeadlessBulkSize: 10,
PayloadConcurrency: 25,
HeadlessTemplateThreads: 10,
ProbeConcurrency: 50,
Timeout: 5,
Retries: 1,
MaxHostError: 30,
ResponseReadSize: 10 * unitutils.Mega,
ResponseSaveSize: unitutils.Mega,
RateLimit: 150,
RateLimitDuration: time.Second,
BulkSize: 25,
TemplateThreads: 25,
HeadlessBulkSize: 10,
PayloadConcurrency: 25,
HeadlessTemplateThreads: 10,
ProbeConcurrency: 50,
TemplateLoadingConcurrency: DefaultTemplateLoadingConcurrency,
Timeout: 5,
Retries: 1,
MaxHostError: 30,
ResponseReadSize: 10 * unitutils.Mega,
ResponseSaveSize: unitutils.Mega,
}
}

Expand Down
Loading