Merge branch 'dev'

dev
sandeep 2023-05-28 16:58:08 +05:30
commit 74ab1428be
59 changed files with 874 additions and 1229 deletions

View File

@ -12,7 +12,7 @@ jobs:
name: Test Builds
strategy:
matrix:
go-version: [1.19.x]
go-version: [1.20.x]
os: [ubuntu-latest, windows-latest, macOS-13]
runs-on: ${{ matrix.os }}

View File

@ -18,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.20.x
- name: Check out code
uses: actions/checkout@v3

View File

@ -15,9 +15,11 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.20.x
- name: Checkout code
uses: actions/checkout@v3
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3.4.0
with:

View File

@ -18,7 +18,7 @@ jobs:
- name: "Set up Go"
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.20.x
- name: Generate YAML Syntax Documentation
id: generate-docs

View File

@ -17,7 +17,7 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.20.x
- uses: goreleaser/goreleaser-action@v4
with:

View File

@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.20.x
- name: Template Validation
run: |

2
.gitignore vendored
View File

@ -15,4 +15,4 @@ v2/pkg/protocols/common/helpers/deserialization/testdata/Deserialize.class
v2/pkg/protocols/common/helpers/deserialization/testdata/ValueObject.class
v2/pkg/protocols/common/helpers/deserialization/testdata/ValueObject2.ser
*.exe
v2/.gitignore

View File

@ -1,5 +1,5 @@
# Build
FROM golang:1.20.3-alpine AS build-env
FROM golang:1.20.4-alpine AS build-env
RUN apk add build-base
WORKDIR /app
COPY . /app
@ -8,7 +8,7 @@ RUN go mod download
RUN go build ./cmd/nuclei
# Release
FROM alpine:3.17.3
FROM alpine:3.18.0
RUN apk -U upgrade --no-cache \
&& apk add --no-cache bind-tools chromium ca-certificates
COPY --from=build-env /app/v2/nuclei /usr/local/bin/

View File

@ -53,7 +53,7 @@ We have a [dedicated repository](https://github.com/projectdiscovery/nuclei-temp
# Install Nuclei
Nuclei requires **go1.19** to install successfully. Run the following command to install the latest version -
Nuclei requires **go1.20** to install successfully. Run the following command to install the latest version -
```sh
go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest
@ -368,7 +368,7 @@ Nuclei immensely improve how you approach security assessment by augmenting the
Pen-testers get the full power of our public templates and customization capabilities to speed up their assessment process, and specifically with the regression cycle where you can easily verify the fix.
- Easily create your compliance, standards suite (e.g. OWASP Top 10) checklist.
- With capabilities like [fuzz](https://nuclei.projectdiscovery.io/templating-guide/#advance-fuzzing) and [workflows](https://nuclei.projectdiscovery.io/templating-guide/#workflows), complex manual steps and repetitive assessment can be easily automated with Nuclei.
- With capabilities like [fuzz](https://nuclei.projectdiscovery.io/templating-guide/protocols/http-fuzzing/) and [workflows](https://nuclei.projectdiscovery.io/templating-guide/workflows/), complex manual steps and repetitive assessment can be easily automated with Nuclei.
- Easy to re-test vulnerability-fix by just re-running the template.
</td>

View File

@ -52,7 +52,7 @@ Nuclei使用零误报的定制模板向目标发送请求同时可以对主
# 安装Nuclei
Nuclei需要**go1.19**才能安装成功。执行下列命令安装最新版本的Nuclei
Nuclei需要**go1.20**才能安装成功。执行下列命令安装最新版本的Nuclei
```sh
go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest
@ -303,7 +303,7 @@ Nuclei通过增加手动、自动的过程极大地改变了安全评估的
渗透测试员可以使用公共模板或者自定义模板来更快的完成渗透测试,特别是漏洞验证时,可以轻松的验证漏洞是否修复。
- 轻松根据您的要求创建标准清单例如OWASP TOP 10
- 通过[FUZZ](https://nuclei.projectdiscovery.io/templating-guide/#advance-fuzzing)和[工作流](https://nuclei.projectdiscovery.io/templating-guide/#workflows)等功能可以使用Nuclei完成复杂的手动步骤和重复性渗透测试
- 通过[FUZZ](https://nuclei.projectdiscovery.io/templating-guide/protocols/http-fuzzing/)和[工作流](https://nuclei.projectdiscovery.io/templating-guide/workflows/)等功能可以使用Nuclei完成复杂的手动步骤和重复性渗透测试
- 只需要重新运行Nuclei即可验证漏洞修复情况
</td>

View File

@ -52,7 +52,7 @@ Kami memiliki [repositori khusus](https://github.com/projectdiscovery/nuclei-tem
# Instalasi Nuclei
Nuclei membutuhkan **go1.19** agar dapat diinstall. Jalankan perintah berikut untuk menginstal versi terbaru -
Nuclei membutuhkan **go1.20** agar dapat diinstall. Jalankan perintah berikut untuk menginstal versi terbaru -
```sh
go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest
@ -304,7 +304,7 @@ Nuclei sangat meningkatkan cara Anda mendekati penilaian keamanan dengan menamba
Para penguji penetrasi mendapatkan kekuatan penuh dari templat publik dan kemampuan penyesuaian kami untuk mempercepat proses penilaian mereka, dan khususnya dengan siklus regresi di mana Anda dapat dengan mudah memverifikasi perbaikannya.
- Mudah untuk membuat daftar pemeriksa kepatuhan Anda, sederet standar (mis., OWASP 10 Teratas).
- Dengan kemampuan seperti [fuzz](https://nuclei.projectdiscovery.io/templating-guide/#advance-fuzzing) dan [alur kerja](https://nuclei.projectdiscovery.io/templating-guide/#workflows), langkah manual yang rumit dan penilaian berulang dapat dengan mudah diotomatisasi dengan Nuclei.
- Dengan kemampuan seperti [fuzz](https://nuclei.projectdiscovery.io/templating-guide/protocols/http-fuzzing/) dan [alur kerja](https://nuclei.projectdiscovery.io/templating-guide/workflows/), langkah manual yang rumit dan penilaian berulang dapat dengan mudah diotomatisasi dengan Nuclei.
- Mudah untuk menguji ulang perbaikan kerentanan hanya dengan menjalankan ulang template.
</td>

View File

@ -50,7 +50,7 @@ Nuclei는 템플릿을 기반으로 대상 간에 요청을 보내기 위해 사
# 설치
Nuclei를 성공적으로 설치하기 위해서 **go1.19**가 필요합니다. 다음 명령을 실행하여 최신 버전을 설치합니다.
Nuclei를 성공적으로 설치하기 위해서 **go1.20**가 필요합니다. 다음 명령을 실행하여 최신 버전을 설치합니다.
```sh
go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest
@ -289,7 +289,7 @@ Nuclei는 수동적이고 반복적인 프로세스를 보강하여 보안 평
침투 테스터는 평가 프로세스, 특히 수정 사항을 쉽게 확인할 수 있는 회귀 주기를 통해 공개 템플릿 및 사용자 지정 기능을 최대한 활용할 수 있습니다.
- 규정 준수, 표준 제품군(예: OWASP Top 10) 체크리스트 쉽게 생성.
- Nuclei의 [fuzz](https://nuclei.projectdiscovery.io/templating-guide/#advance-fuzzing) 및 [workflows](https://nuclei.projectdiscovery.io/templating-guide/#workflows) 같은 기능으로 복잡한 수동 단계와 반복 평가를 쉽게 자동화할 수 있음.
- Nuclei의 [fuzz](https://nuclei.projectdiscovery.io/templating-guide/protocols/http-fuzzing/) 및 [workflows](https://nuclei.projectdiscovery.io/templating-guide/workflows/) 같은 기능으로 복잡한 수동 단계와 반복 평가를 쉽게 자동화할 수 있음.
- 템플릿 재실행으로 취약점 수정 재테스트 용이.
</td>

View File

@ -184,8 +184,6 @@ file:
- amzn\.mws\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
extensions:
- all
archive: false
mimetype: false
```
@ -353,6 +351,19 @@ Variables contains any variables for the current request.
<hr />
<div class="dd">
<code>constants</code> <i>map[string]interface{}</i>
</div>
<div class="dt">
Constants contains any scalar costant for the current template
</div>
<hr />
@ -1470,6 +1481,8 @@ Appears in:
- <code><a href="#httprequest">http.Request</a>.attack</code>
- <code><a href="#dnsrequest">dns.Request</a>.attack</code>
- <code><a href="#networkrequest">network.Request</a>.attack</code>
- <code><a href="#headlessrequest">headless.Request</a>.attack</code>
@ -1949,6 +1962,39 @@ trace-max-recursion: 100
```
</div>
<hr />
<div class="dd">
<code>attack</code> <i><a href="#generatorsattacktypeholder">generators.AttackTypeHolder</a></i>
</div>
<div class="dt">
Attack is the type of payload combinations to perform.
Batteringram is inserts the same payload into all defined payload positions at once, pitchfork combines multiple payload sets and clusterbomb generates
permutations and combinations for all payloads.
</div>
<hr />
<div class="dd">
<code>payloads</code> <i>map[string]interface{}</i>
</div>
<div class="dt">
Payloads contains any payloads for the current request.
Payloads support both key-values combinations where a list
of payloads is provided, or optionally a single file can also
be provided as payload which will be read on run-time.
</div>
<hr />
@ -2031,6 +2077,8 @@ Enum Values:
- <code>CAA</code>
- <code>TLSA</code>
- <code>ANY</code>
</div>
<hr />
@ -2055,8 +2103,6 @@ extractors:
- amzn\.mws\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
extensions:
- all
archive: false
mimetype: false
```
Part Definitions:
@ -2163,6 +2209,32 @@ max-size: 5Mb
```
</div>
<hr />
<div class="dd">
<code>archive</code> <i>bool</i>
</div>
<div class="dt">
elaborates archives
</div>
<hr />
<div class="dd">
<code>mime-type</code> <i>bool</i>
</div>
<div class="dt">
enables mime types check
</div>
<hr />

View File

@ -1,12 +1,12 @@
{{- if .Values.interactsh.ingress.enabled -}}
{{- $fullName := include "nuclei.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if and .Values.interactsh.ingress.className (not (semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if and .Values.interactsh.ingress.className (not (semverCompare ">=1.20-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.interactsh.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.interactsh.ingress.annotations "kubernetes.io/ingress.class" .Values.interactsh.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
{{- if semverCompare ">=1.20-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
@ -23,7 +23,7 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.interactsh.ingress.className (semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion) }}
{{- if and .Values.interactsh.ingress.className (semverCompare ">=1.20-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.interactsh.ingress.className }}
{{- end }}
{{- if .Values.interactsh.ingress.tls }}
@ -43,11 +43,11 @@ spec:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion) }}
{{- if and .pathType (semverCompare ">=1.20-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
{{- if semverCompare ">=1.20-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:

View File

@ -0,0 +1,29 @@
id: dns-attack
info:
name: basic dns template
author: pdteam
severity: info
dns:
- name: "{{subdomain_wordlist}}.{{FQDN}}"
type: A
attack: batteringram
payloads:
subdomain_wordlist:
- one
- docs
- drive
matchers:
- type: word
words:
- "IN\tA"
extractors:
- type: regex
group: 1
regex:
- "IN\tA\t(.+)"

View File

@ -0,0 +1,18 @@
id: cli-with-constants
info:
name: Cli Var with Constants
author: pdteam
severity: info
constants:
test: test-in-template
requests:
- method: GET
path:
- "{{BaseURL}}?p={{test}}"
matchers:
- type: word
words:
- "test-in-template"

View File

@ -0,0 +1,5 @@
one
docs
drive
play

View File

@ -383,9 +383,10 @@
"description": "Type of the attack"
},
"variables.Variable": {
"properties": {},
"additionalProperties": false,
"type": "object"
"additionalProperties": true,
"type": "object",
"title": "variables for the request",
"description": "Additional variables for the request"
},
"dns.DNSRequestTypeHolder": {
"enum": [
@ -399,7 +400,8 @@
"TXT",
"AAAA",
"CAA",
"TLSA"
"TLSA",
"ANY"
],
"type": "string",
"title": "type of DNS request to make",
@ -476,6 +478,21 @@
"title": "trace-max-recursion level for dns request",
"description": "TraceMaxRecursion is the number of max recursion allowed for trace operations"
},
"attack": {
"$ref": "#/definitions/generators.AttackTypeHolder",
"title": "attack is the payload combination",
"description": "Attack is the type of payload combinations to perform"
},
"payloads": {
"patternProperties": {
".*": {
"additionalProperties": true
}
},
"type": "object",
"title": "payloads for the network request",
"description": "Payloads contains any payloads for the current request"
},
"recursion": {
"type": "boolean",
"title": "recurse all servers",
@ -494,10 +511,6 @@
"type": "object"
},
"file.Request": {
"required": [
"Archive",
"MimeType"
],
"properties": {
"matchers": {
"items": {
@ -550,11 +563,15 @@
"title": "max size data to run request on",
"description": "Maximum size of the file to run request on"
},
"Archive": {
"type": "boolean"
"archive": {
"type": "boolean",
"title": "enable archives",
"description": "Process compressed archives without unpacking"
},
"MimeType": {
"type": "boolean"
"mime-type": {
"type": "boolean",
"title": "enable filtering by mime-type",
"description": "Filter files by mime-type"
},
"no-recursive": {
"type": "boolean",
@ -1457,6 +1474,16 @@
"$ref": "#/definitions/variables.Variable",
"title": "variables for the http request",
"description": "Variables contains any variables for the current request"
},
"constants": {
"patternProperties": {
".*": {
"additionalProperties": true
}
},
"type": "object",
"title": "constant for the template",
"description": "constants contains any constant for the template"
}
},
"additionalProperties": false,

View File

@ -10,12 +10,23 @@ import (
"net/http"
"net/url"
"os"
"path/filepath"
"reflect"
"regexp"
"sort"
"strconv"
"strings"
"github.com/pkg/errors"
"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/gologger/levels"
"github.com/projectdiscovery/nuclei/v2/pkg/catalog"
"github.com/projectdiscovery/nuclei/v2/pkg/catalog/disk"
"github.com/projectdiscovery/nuclei/v2/pkg/protocols"
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/protocolinit"
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/protocolstate"
"github.com/projectdiscovery/nuclei/v2/pkg/templates"
"github.com/projectdiscovery/nuclei/v2/pkg/types"
"github.com/projectdiscovery/nvd"
"github.com/projectdiscovery/retryablehttp-go"
sliceutil "github.com/projectdiscovery/utils/slice"
@ -29,26 +40,64 @@ const (
var cisaKnownExploitedVulnerabilities map[string]struct{}
// allTagsRegex is a list of all tags in nuclei templates except id, info, and -
var allTagsRegex []*regexp.Regexp
var defaultOpts = types.DefaultOptions()
func init() {
var tm templates.Template
t := reflect.TypeOf(tm)
for i := 0; i < t.NumField(); i++ {
tag := t.Field(i).Tag.Get("yaml")
if strings.Contains(tag, ",") {
tag = strings.Split(tag, ",")[0]
}
// ignore these tags
if tag == "id" || tag == "info" || tag == "" || tag == "-" {
continue
}
re := regexp.MustCompile(tag + `:\s*\n`)
allTagsRegex = append(allTagsRegex, re)
}
defaultOpts := types.DefaultOptions()
// need to set headless to true for headless templates
defaultOpts.Headless = true
if err := protocolstate.Init(defaultOpts); err != nil {
gologger.Fatal().Msgf("Could not initialize protocol state: %s\n", err)
}
if err := protocolinit.Init(defaultOpts); err != nil {
gologger.Fatal().Msgf("Could not initialize protocol state: %s\n", err)
}
if err := fetchCISAKnownExploitedVulnerabilities(); err != nil {
panic(err)
}
}
var (
input = flag.String("i", "", "Templates to annotate")
templateDir = flag.String("d", "", "Custom template directory for update")
input = flag.String("i", "", "Templates to annotate")
verbose = flag.Bool("v", false, "show verbose output")
)
func main() {
flag.Parse()
if *input == "" || *templateDir == "" {
if *input == "" {
log.Fatalf("invalid input, see -h\n")
}
if strings.HasPrefix(*input, "~/") {
home, err := os.UserHomeDir()
if err != nil {
log.Fatalf("Failed to read UserHomeDir: %v, provide absolute template path/directory\n", err)
}
*input = filepath.Join(home, (*input)[2:])
}
gologger.DefaultLogger.SetMaxLevel(levels.LevelSilent)
if *verbose {
gologger.DefaultLogger.SetMaxLevel(levels.LevelVerbose)
}
if err := process(); err != nil {
log.Fatalf("could not process: %s\n", err)
gologger.Error().Msgf("could not process: %s\n", err)
}
}
@ -60,8 +109,7 @@ func process() error {
defer os.RemoveAll(tempDir)
client := nvd.NewClientV2()
catalog := disk.NewCatalog(*templateDir)
catalog := disk.NewCatalog(filepath.Dir(*input))
paths, err := catalog.GetTemplatePath(*input)
if err != nil {
return err
@ -72,14 +120,18 @@ func process() error {
return err
}
dataString := string(data)
// First try to resolve references to tags
// try to fill max-requests
dataString, err = parseAndAddMaxRequests(catalog, path, dataString)
if err != nil {
gologger.Error().Msgf("Could not compile max request %s: %s\n", path, err)
}
// try to resolve references to tags
dataString, err = parseAndAddReferenceBasedTags(path, dataString)
if err != nil {
log.Printf("Could not parse reference tags %s: %s\n", path, err)
gologger.Error().Msgf("Could not parse reference tags %s: %s\n", path, err)
continue
}
// Next try and fill CVE data
// try and fill CVE data
getCVEData(client, path, dataString)
}
return nil
@ -126,7 +178,7 @@ func getCVEData(client *nvd.ClientV2, filePath, data string) {
}
}
if err != nil {
log.Printf("Could not parse cisa data %s: %s\n", cveName, err)
gologger.Error().Msgf("Could not parse cisa data %s: %s\n", cveName, err)
return
}
@ -138,7 +190,7 @@ func getCVEData(client *nvd.ClientV2, filePath, data string) {
cveItem, err := client.FetchCVE(cveName)
if err != nil {
log.Printf("Could not fetch cve %s: %s\n", cveName, err)
gologger.Error().Msgf("Could not fetch cve %s: %s\n", cveName, err)
return
}
var cweID []string
@ -149,7 +201,7 @@ func getCVEData(client *nvd.ClientV2, filePath, data string) {
}
cvssData, err := getPrimaryCVSSData(cveItem)
if err != nil {
log.Printf("Could not get CVSS data %s: %s\n", cveName, err)
gologger.Error().Msgf("Could not get CVSS data %s: %s\n", cveName, err)
return
}
cvssScore := cvssData.BaseScore
@ -175,14 +227,14 @@ func getCVEData(client *nvd.ClientV2, filePath, data string) {
infoBlock := InfoBlock{}
err = yaml.Unmarshal([]byte(data), &infoBlock)
if err != nil {
log.Printf("Could not unmarshal info block: %s\n", err)
gologger.Warning().Msgf("Could not unmarshal info block: %s\n", err)
}
var changed bool
if newSeverity := isSeverityMatchingCvssScore(severityValue, cvssScore); newSeverity != "" {
changed = true
infoBlock.Info.Severity = newSeverity
fmt.Printf("Adjusting severity for %s from %s=>%s (%.2f)\n", filePath, severityValue, newSeverity, cvssScore)
gologger.Info().Msgf("Adjusting severity for %s from %s=>%s (%.2f)\n", filePath, severityValue, newSeverity, cvssScore)
}
isCvssEmpty := cvssScore == 0 || cvssMetrics == ""
hasCvssChanged := infoBlock.Info.Classification.CvssScore != cvssScore || cvssMetrics != infoBlock.Info.Classification.CvssMetrics
@ -267,7 +319,7 @@ func getCVEData(client *nvd.ClientV2, filePath, data string) {
yamlEncoder.SetIndent(yamlIndentSpaces)
err = yamlEncoder.Encode(infoBlock)
if err != nil {
log.Printf("Could not marshal info block: %s\n", err)
gologger.Warning().Msgf("Could not marshal info block: %s\n", err)
return
}
newInfoBlockData := strings.TrimSuffix(newInfoBlock.String(), "\n")
@ -275,7 +327,7 @@ func getCVEData(client *nvd.ClientV2, filePath, data string) {
newTemplate := strings.ReplaceAll(data, infoBlockClean, newInfoBlockData)
if changed {
_ = os.WriteFile(filePath, []byte(newTemplate), 0644)
fmt.Printf("Wrote updated template to %s\n", filePath)
gologger.Info().Msgf("Wrote updated template to %s\n", filePath)
}
}
@ -503,11 +555,96 @@ type TemplateClassification struct {
type TemplateInfo struct {
Name string `yaml:"name"`
Author string `yaml:"author"`
Severity string `yaml:"severity"`
Severity string `yaml:"severity,omitempty"`
Description string `yaml:"description,omitempty"`
Reference []string `yaml:"reference,omitempty"`
Remediation string `yaml:"remediation,omitempty"`
Classification TemplateClassification `yaml:"classification,omitempty"`
Metadata map[string]string `yaml:"metadata,omitempty"`
Metadata map[string]interface{} `yaml:"metadata,omitempty"`
Tags string `yaml:"tags,omitempty"`
}
// parseAndAddMaxRequests parses and adds max requests to templates
func parseAndAddMaxRequests(catalog catalog.Catalog, path, data string) (string, error) {
template, err := parseTemplate(catalog, path)
if err != nil {
gologger.Warning().Label("max-request").Msgf("Could not parse template: %s\n", err)
return data, err
}
if template.TotalRequests < 1 {
return data, nil
}
// Marshal the updated info block back to YAML.
infoBlockStart, infoBlockEnd := getInfoStartEnd(data)
infoBlockOrig := data[infoBlockStart:infoBlockEnd]
infoBlockOrig = strings.TrimRight(infoBlockOrig, "\n")
infoBlock := InfoBlock{}
err = yaml.Unmarshal([]byte(data), &infoBlock)
if err != nil {
gologger.Warning().Label("max-request").Msgf("Could not unmarshal info block: %s\n", err)
return data, err
}
// if metadata is nil, create a new map
if infoBlock.Info.Metadata == nil {
infoBlock.Info.Metadata = make(map[string]interface{})
}
// do not update if it is already present and equal
if mr, ok := infoBlock.Info.Metadata["max-request"]; ok && mr.(int) == template.TotalRequests {
return data, nil
}
infoBlock.Info.Metadata["max-request"] = template.TotalRequests
var newInfoBlock bytes.Buffer
yamlEncoder := yaml.NewEncoder(&newInfoBlock)
yamlEncoder.SetIndent(yamlIndentSpaces)
err = yamlEncoder.Encode(infoBlock)
if err != nil {
gologger.Warning().Msgf("Could not marshal info block: %s\n", err)
return data, err
}
newInfoBlockData := strings.TrimSuffix(newInfoBlock.String(), "\n")
// replace old info block with new info block
newTemplate := strings.ReplaceAll(data, infoBlockOrig, newInfoBlockData)
err = os.WriteFile(path, []byte(newTemplate), 0644)
if err == nil {
gologger.Info().Label("max-request").Msgf("Wrote updated template to %s\n", path)
}
return newTemplate, err
}
// parseTemplate parses a template and returns the template object
func parseTemplate(catalog catalog.Catalog, templatePath string) (*templates.Template, error) {
executerOpts := protocols.ExecuterOptions{
Catalog: catalog,
Options: defaultOpts,
}
reader, err := executerOpts.Catalog.OpenFile(templatePath)
if err != nil {
return nil, err
}
template, err := templates.ParseTemplateFromReader(reader, nil, executerOpts)
if err != nil {
return nil, err
}
return template, nil
}
// find the start and end of the info block
func getInfoStartEnd(data string) (int, int) {
info := strings.Index(data, "info:")
var indices []int
for _, re := range allTagsRegex {
// find the first occurance of the label
match := re.FindStringIndex(data)
if match != nil {
indices = append(indices, match[0])
}
}
// find the first one after info block
sort.Ints(indices)
return info, indices[0] - 1
}

View File

@ -10,6 +10,7 @@ var dnsTestCases = map[string]testutils.TestCase{
"dns/caa.yaml": &dnsCAA{},
"dns/tlsa.yaml": &dnsTLSA{},
"dns/variables.yaml": &dnsVariables{},
"dns/payload.yaml": &dnsPayload{},
"dns/dsl-matcher-variable.yaml": &dnsDSLMatcherVariable{},
}
@ -68,6 +69,26 @@ func (h *dnsVariables) Execute(filePath string) error {
return expectResultsCount(results, 1)
}
type dnsPayload struct{}
// Execute executes a test case and returns an error if occurred
func (h *dnsPayload) Execute(filePath string) error {
results, err := testutils.RunNucleiTemplateAndGetResults(filePath, "google.com", debug)
if err != nil {
return err
}
if err := expectResultsCount(results, 3); err != nil {
return err
}
// override payload from CLI
results, err = testutils.RunNucleiTemplateAndGetResults(filePath, "google.com", debug, "-var", "subdomain_wordlist=subdomains.txt")
if err != nil {
return err
}
return expectResultsCount(results, 4)
}
type dnsDSLMatcherVariable struct{}
// Execute executes a test case and returns an error if occurred

View File

@ -77,6 +77,7 @@ var httpTestcases = map[string]testutils.TestCase{
"http/cl-body-without-header.yaml": &httpCLBodyWithoutHeader{},
"http/cl-body-with-header.yaml": &httpCLBodyWithHeader{},
"http/save-extractor-values-to-file.yaml": &httpSaveExtractorValuesToFile{},
"http/cli-with-constants.yaml": &ConstantWithCliVar{},
}
type httpInteractshRequest struct{}
@ -1403,3 +1404,22 @@ func (h *httpSaveExtractorValuesToFile) Execute(filePath string) error {
}
return expectResultsCount(results, 1)
}
// constant shouldn't be overwritten by cli var with same name
type ConstantWithCliVar struct{}
// Execute executes a test case and returns an error if occurred
func (h *ConstantWithCliVar) Execute(filePath string) error {
router := httprouter.New()
router.GET("/", func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
fmt.Fprint(w, r.URL.Query().Get("p"))
})
ts := httptest.NewTLSServer(router)
defer ts.Close()
got, err := testutils.RunNucleiTemplateAndGetResults(filePath, ts.URL, debug, "-V", "test=fromcli")
if err != nil {
return err
}
return expectResultsCount(got, 1)
}

View File

@ -232,7 +232,7 @@ on extensive configurability, massive extensibility and ease of use.`)
flagSet.StringSliceVarP(&options.UncoverEngine, "uncover-engine", "ue", nil, fmt.Sprintf("uncover search engine (%s) (default shodan)", uncover.GetUncoverSupportedAgents()), goflags.FileStringSliceOptions),
flagSet.StringVarP(&options.UncoverField, "uncover-field", "uf", "ip:port", "uncover fields to return (ip,port,host)"),
flagSet.IntVarP(&options.UncoverLimit, "uncover-limit", "ul", 100, "uncover results to return"),
flagSet.IntVarP(&options.UncoverDelay, "uncover-delay", "ucd", 1, "delay between uncover query requests in seconds (0 to disable)"),
flagSet.IntVarP(&options.UncoverRateLimit, "uncover-ratelimit", "ur", 60, "override ratelimit of engines with unknown ratelimit (default 60 req/min)"),
)
flagSet.CreateGroup("rate-limit", "Rate-Limit",

View File

@ -1,6 +1,6 @@
module github.com/projectdiscovery/nuclei/v2
go 1.19
go 1.20
require (
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible
@ -10,10 +10,10 @@ require (
github.com/bluele/gcache v0.0.2
github.com/corpix/uarand v0.2.0
github.com/go-playground/validator/v10 v10.11.2
github.com/go-rod/rod v0.112.9
github.com/gobwas/ws v1.1.0
github.com/go-rod/rod v0.113.0
github.com/gobwas/ws v1.2.1
github.com/google/go-github v17.0.0+incompatible
github.com/itchyny/gojq v0.12.11
github.com/itchyny/gojq v0.12.12
github.com/json-iterator/go v1.1.12
github.com/julienschmidt/httprouter v1.3.0
github.com/logrusorgru/aurora v2.0.3+incompatible
@ -21,18 +21,17 @@ require (
github.com/olekukonko/tablewriter v0.0.5
github.com/pkg/errors v0.9.1
github.com/projectdiscovery/clistats v0.0.12
github.com/projectdiscovery/fastdialer v0.0.25
github.com/projectdiscovery/fastdialer v0.0.26
github.com/projectdiscovery/hmap v0.0.11
github.com/projectdiscovery/interactsh v1.1.3
github.com/projectdiscovery/interactsh v1.1.4
github.com/projectdiscovery/rawhttp v0.1.11
github.com/projectdiscovery/retryabledns v1.0.24
github.com/projectdiscovery/retryablehttp-go v1.0.15
github.com/projectdiscovery/stringsutil v0.0.2 // indirect
github.com/projectdiscovery/retryablehttp-go v1.0.16
github.com/projectdiscovery/yamldoc-go v1.0.4
github.com/remeh/sizedwaitgroup v1.0.0
github.com/rs/xid v1.5.0
github.com/segmentio/ksuid v1.0.4
github.com/shirou/gopsutil/v3 v3.23.3 // indirect
github.com/shirou/gopsutil/v3 v3.23.4 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/cast v1.5.0
github.com/syndtr/goleveldb v1.0.0
@ -40,8 +39,8 @@ require (
github.com/weppos/publicsuffix-go v0.30.1-0.20230422193905-8fecedd899db
github.com/xanzy/go-gitlab v0.83.0
go.uber.org/multierr v1.11.0
golang.org/x/net v0.9.0
golang.org/x/oauth2 v0.7.0
golang.org/x/net v0.10.0
golang.org/x/oauth2 v0.8.0
golang.org/x/text v0.9.0
gopkg.in/yaml.v2 v2.4.0
moul.io/http2curl v1.0.0
@ -56,10 +55,10 @@ require (
github.com/antchfx/xmlquery v1.3.15
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
github.com/aws/aws-sdk-go-v2 v1.18.0
github.com/aws/aws-sdk-go-v2/config v1.18.22
github.com/aws/aws-sdk-go-v2/credentials v1.13.21
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.64
github.com/aws/aws-sdk-go-v2/service/s3 v1.33.0
github.com/aws/aws-sdk-go-v2/config v1.18.25
github.com/aws/aws-sdk-go-v2/credentials v1.13.24
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.67
github.com/aws/aws-sdk-go-v2/service/s3 v1.33.1
github.com/docker/go-units v0.5.0
github.com/fatih/structs v1.1.0
github.com/go-git/go-git/v5 v5.6.1
@ -67,21 +66,21 @@ require (
github.com/klauspost/compress v1.16.5
github.com/labstack/echo/v4 v4.10.2
github.com/mholt/archiver v3.1.1+incompatible
github.com/projectdiscovery/dsl v0.0.7
github.com/projectdiscovery/dsl v0.0.9
github.com/projectdiscovery/fasttemplate v0.0.2
github.com/projectdiscovery/goflags v0.1.8
github.com/projectdiscovery/gologger v1.1.8
github.com/projectdiscovery/httpx v1.3.0
github.com/projectdiscovery/mapcidr v1.1.1
github.com/projectdiscovery/gologger v1.1.10
github.com/projectdiscovery/httpx v1.3.1
github.com/projectdiscovery/mapcidr v1.1.2
github.com/projectdiscovery/nvd v1.0.10-0.20230327073015-721181aba1e8
github.com/projectdiscovery/ratelimit v0.0.6
github.com/projectdiscovery/rdap v0.9.1-0.20221108103045-9865884d1917
github.com/projectdiscovery/sarif v0.0.1
github.com/projectdiscovery/tlsx v1.0.9
github.com/projectdiscovery/uncover v1.0.2
github.com/projectdiscovery/utils v0.0.26
github.com/projectdiscovery/wappalyzergo v0.0.92
github.com/stretchr/testify v1.8.2
github.com/projectdiscovery/uncover v1.0.4
github.com/projectdiscovery/utils v0.0.32
github.com/projectdiscovery/wappalyzergo v0.0.94
github.com/stretchr/testify v1.8.3
gopkg.in/src-d/go-git.v4 v4.13.1
gopkg.in/yaml.v3 v3.0.1
)
@ -91,6 +90,7 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect
github.com/Mzack9999/gostruct v0.0.0-20230415193108-30b70932da81 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.25 // indirect
@ -122,11 +122,11 @@ require (
github.com/muesli/termenv v0.15.1 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/projectdiscovery/asnmap v1.0.3 // indirect
github.com/projectdiscovery/cdncheck v1.0.1 // indirect
github.com/projectdiscovery/asnmap v1.0.4 // indirect
github.com/projectdiscovery/cdncheck v1.0.2 // indirect
github.com/projectdiscovery/freeport v0.0.4 // indirect
github.com/sashabaranov/go-openai v1.8.0 // indirect
github.com/shoenig/go-m1cpu v0.1.4 // indirect
github.com/sashabaranov/go-openai v1.9.1 // indirect
github.com/shoenig/go-m1cpu v0.1.5 // indirect
github.com/skeema/knownhosts v1.1.0 // indirect
github.com/smartystreets/assertions v1.0.0 // indirect
github.com/tidwall/btree v1.6.0 // indirect
@ -137,7 +137,8 @@ require (
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tidwall/rtred v0.1.2 // indirect
github.com/tidwall/tinyqueue v0.1.1 // indirect
github.com/ysmood/fetchup v0.2.2 // indirect
github.com/ysmood/fetchup v0.2.3 // indirect
github.com/ysmood/got v0.34.1 // indirect
github.com/yuin/goldmark v1.5.4 // indirect
github.com/yuin/goldmark-emoji v1.0.1 // indirect
go.uber.org/atomic v1.10.0 // indirect
@ -192,7 +193,7 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/projectdiscovery/blackrock v0.0.1 // indirect
github.com/projectdiscovery/networkpolicy v0.0.5
github.com/projectdiscovery/networkpolicy v0.0.6
github.com/rivo/uniseg v0.4.4 // indirect
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
@ -214,7 +215,7 @@ require (
golang.org/x/crypto v0.7.0
golang.org/x/exp v0.0.0-20230420155640-133eef4313cb
golang.org/x/mod v0.10.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.8.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
@ -233,15 +234,14 @@ require (
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.34 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.12.9 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.9 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.18.10 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.12.10 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.10 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.19.0 // indirect
github.com/aws/smithy-go v1.13.5 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.4.1 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect

137
v2/go.sum
View File

@ -25,6 +25,8 @@ github.com/Mzack9999/gcache v0.0.0-20230410081825-519e28eab057 h1:KFac3SiGbId8ub
github.com/Mzack9999/gcache v0.0.0-20230410081825-519e28eab057/go.mod h1:iLB2pivrPICvLOuROKmlqURtFIEsoJZaMidQfCG1+D4=
github.com/Mzack9999/go-http-digest-auth-client v0.6.1-0.20220414142836-eb8883508809 h1:ZbFL+BDfBqegi+/Ssh7im5+aQfBRx6it+kHnC7jaDU8=
github.com/Mzack9999/go-http-digest-auth-client v0.6.1-0.20220414142836-eb8883508809/go.mod h1:upgc3Zs45jBDnBT4tVRgRcgm26ABpaP7MoTSdgysca4=
github.com/Mzack9999/gostruct v0.0.0-20230415193108-30b70932da81 h1:rwHZjxG8Cx3+FNujiZRuJbYTLHmW8U9+6xIoTseKA/I=
github.com/Mzack9999/gostruct v0.0.0-20230415193108-30b70932da81/go.mod h1:iXPMmoXMc0ZsSmbbHqhWCWd8w7FkXM7DU2IBf5OS+5g=
github.com/Mzack9999/ldapserver v1.0.2-0.20211229000134-b44a0d6ad0dd h1:RTWs+wEY9efxTKK5aFic5C5KybqQelGcX+JdM69KoTo=
github.com/Mzack9999/ldapserver v1.0.2-0.20211229000134-b44a0d6ad0dd/go.mod h1:AqtPw7WNT0O69k+AbPKWVGYeW94TqgMW/g+Ppc8AZr4=
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA=
@ -73,14 +75,14 @@ github.com/aws/aws-sdk-go-v2 v1.18.0 h1:882kkTpSFhdgYRKVZ/VCgf7sd0ru57p2JCxz4/oN
github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 h1:dK82zF6kkPeCo8J1e+tGx4JdvDIQzj7ygIoLg8WMuGs=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10/go.mod h1:VeTZetY5KRJLuD/7fkQXMU6Mw7H5m/KP2J5Iy9osMno=
github.com/aws/aws-sdk-go-v2/config v1.18.22 h1:7vkUEmjjv+giht4wIROqLs+49VWmiQMMHSduxmoNKLU=
github.com/aws/aws-sdk-go-v2/config v1.18.22/go.mod h1:mN7Li1wxaPxSSy4Xkr6stFuinJGf3VZW3ZSNvO0q6sI=
github.com/aws/aws-sdk-go-v2/credentials v1.13.21 h1:VRiXnPEaaPeGeoFcXvMZOB5K/yfIXOYE3q97Kgb0zbU=
github.com/aws/aws-sdk-go-v2/credentials v1.13.21/go.mod h1:90Dk1lJoMyspa/EDUrldTxsPns0wn6+KpRKpdAWc0uA=
github.com/aws/aws-sdk-go-v2/config v1.18.25 h1:JuYyZcnMPBiFqn87L2cRppo+rNwgah6YwD3VuyvaW6Q=
github.com/aws/aws-sdk-go-v2/config v1.18.25/go.mod h1:dZnYpD5wTW/dQF0rRNLVypB396zWCcPiBIvdvSWHEg4=
github.com/aws/aws-sdk-go-v2/credentials v1.13.24 h1:PjiYyls3QdCrzqUN35jMWtUK1vqVZ+zLfdOa/UPFDp0=
github.com/aws/aws-sdk-go-v2/credentials v1.13.24/go.mod h1:jYPYi99wUOPIFi0rhiOvXeSEReVOzBqFNOX5bXYoG2o=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3 h1:jJPgroehGvjrde3XufFIJUZVK5A2L9a3KwSFgKy9n8w=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3/go.mod h1:4Q0UFP0YJf0NrsEuEYHpM9fTSEVnD16Z3uyEF7J9JGM=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.64 h1:9QJQs36z61YB8nxGwRDfWXEDYbU6H7jdI6zFiAX1vag=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.64/go.mod h1:4Q7R9MFpXRdjO3YnAfUTdnuENs32WzBkASt6VxSYDYQ=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.67 h1:fI9/5BDEaAv/pv1VO1X1n3jfP9it+IGqWsCuuBQI8wM=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.67/go.mod h1:zQClPRIwQZfJlZq6WZve+s4Tb4JW+3V6eS+4+KrYeP8=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33 h1:kG5eQilShqmJbv11XL1VpyDbaEJzWxd4zRiCG30GSn4=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33/go.mod h1:7i0PF1ME/2eUPFcjkVIwq+DOygHEoK92t5cDqNgYbIw=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27 h1:vFQlirhuM8lLlpI7imKOMsjdQLuN9CPi+k44F/OFVsk=
@ -97,14 +99,14 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27 h1:0iKliEXAc
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27/go.mod h1:EOwBD4J4S5qYszS5/3DpkejfuK+Z5/1uzICfPaZLtqw=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.2 h1:NbWkRxEEIRSCqxhsHQuMiTH7yo+JZW1gp8v3elSVMTQ=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.2/go.mod h1:4tfW5l4IAB32VWCDEBxCRtR9T4BWy4I4kr1spr8NgZM=
github.com/aws/aws-sdk-go-v2/service/s3 v1.33.0 h1:L5h2fymEdVJYvn6hYO8Jx48YmC6xVmjmgHJV3oGKgmc=
github.com/aws/aws-sdk-go-v2/service/s3 v1.33.0/go.mod h1:J9kLNzEiHSeGMyN7238EjJmBpCniVzFda75Gxl/NqB8=
github.com/aws/aws-sdk-go-v2/service/sso v1.12.9 h1:GAiaQWuQhQQui76KjuXeShmyXqECwQ0mGRMc/rwsL+c=
github.com/aws/aws-sdk-go-v2/service/sso v1.12.9/go.mod h1:ouy2P4z6sJN70fR3ka3wD3Ro3KezSxU6eKGQI2+2fjI=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.9 h1:TraLwncRJkWqtIBVKI/UqBymq4+hL+3MzUOtUATuzkA=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.9/go.mod h1:AFvkxc8xfBe8XA+5St5XIHHrQQtkxqrRincx4hmMHOk=
github.com/aws/aws-sdk-go-v2/service/sts v1.18.10 h1:6UbNM/KJhMBfOI5+lpVcJ/8OA7cBSz0O6OX37SRKlSw=
github.com/aws/aws-sdk-go-v2/service/sts v1.18.10/go.mod h1:BgQOMsg8av8jset59jelyPW7NoZcZXLVpDsXunGDrk8=
github.com/aws/aws-sdk-go-v2/service/s3 v1.33.1 h1:O+9nAy9Bb6bJFTpeNFtd9UfHbgxO1o4ZDAM9rQp5NsY=
github.com/aws/aws-sdk-go-v2/service/s3 v1.33.1/go.mod h1:J9kLNzEiHSeGMyN7238EjJmBpCniVzFda75Gxl/NqB8=
github.com/aws/aws-sdk-go-v2/service/sso v1.12.10 h1:UBQjaMTCKwyUYwiVnUt6toEJwGXsLBI6al083tpjJzY=
github.com/aws/aws-sdk-go-v2/service/sso v1.12.10/go.mod h1:ouy2P4z6sJN70fR3ka3wD3Ro3KezSxU6eKGQI2+2fjI=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.10 h1:PkHIIJs8qvq0e5QybnZoG1K/9QTrLr9OsqCIo59jOBA=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.10/go.mod h1:AFvkxc8xfBe8XA+5St5XIHHrQQtkxqrRincx4hmMHOk=
github.com/aws/aws-sdk-go-v2/service/sts v1.19.0 h1:2DQLAKDteoEDI8zpCzqBMaZlJuoE9iTYD0gFmXVax9E=
github.com/aws/aws-sdk-go-v2/service/sts v1.19.0/go.mod h1:BgQOMsg8av8jset59jelyPW7NoZcZXLVpDsXunGDrk8=
github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8=
github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4=
@ -161,7 +163,6 @@ github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8Wlg
github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
@ -186,16 +187,16 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU=
github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s=
github.com/go-rod/rod v0.112.9 h1:uA/yLbB+t0UlqJcLJtK2pZrCNPzd15dOKRUEOnmnt9k=
github.com/go-rod/rod v0.112.9/go.mod h1:l0or0gEnZ7E5C0L/W7iD+yXBnm/OM3avP1ji74k8N9s=
github.com/go-rod/rod v0.113.0 h1:E7+GLjYVZnScewIB2u8+66joQLaDGbOLzSOT4orNHms=
github.com/go-rod/rod v0.113.0/go.mod h1:aiedSEFg5DwG/fnNbUOTPMTTWX3MRj6vIs/a684Mthw=
github.com/goburrow/cache v0.1.4 h1:As4KzO3hgmzPlnaMniZU9+VmoNYseUhuELbxy9mRBfw=
github.com/goburrow/cache v0.1.4/go.mod h1:cDFesZDnIlrHoNlMYqqMpCRawuXulgx+y7mXU8HZ+/c=
github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU=
github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og=
github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
github.com/gobwas/ws v1.1.0 h1:7RFti/xnNkMJnrK7D1yQ/iCIB5OrrY/54/H930kIbHA=
github.com/gobwas/ws v1.1.0/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0=
github.com/gobwas/ws v1.2.1 h1:F2aeBZrm2NDsc7vbovKrWSogd4wvfAxg0FQ89/iqOTk=
github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY=
github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
@ -212,14 +213,12 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/certificate-transparency-go v1.1.4 h1:hCyXHDbtqlr/lMXU0D4WgbalXL0Zk4dSWWMbPV8VrqY=
github.com/google/certificate-transparency-go v1.1.4/go.mod h1:D6lvbfwckhNrbM9WVl1EVeMOyzC19mpIjMOI4nxBHtQ=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
@ -250,8 +249,6 @@ github.com/hashicorp/go-retryablehttp v0.7.2 h1:AcYqCvkpalPnPF2pn0KamgwamS42TqUD
github.com/hashicorp/go-retryablehttp v0.7.2/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru/v2 v2.0.1 h1:5pv5N1lT1fjLg2VQ5KWc7kmucp2x/kvFOnxuVTqZ6x4=
github.com/hashicorp/golang-lru/v2 v2.0.1/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/hbakhtiyor/strsim v0.0.0-20190107154042-4d2bbb273edf h1:umfGUaWdFP2s6457fz1+xXYIWDxdGc7HdkLS9aJ1skk=
@ -263,8 +260,8 @@ github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 h1:i462o439Z
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA=
github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg=
github.com/itchyny/gojq v0.12.11 h1:YhLueoHhHiN4mkfM+3AyJV6EPcCxKZsOnYf+aVSwaQw=
github.com/itchyny/gojq v0.12.11/go.mod h1:o3FT8Gkbg/geT4pLI0tF3hvip5F3Y/uskjRz9OYa38g=
github.com/itchyny/gojq v0.12.12 h1:x+xGI9BXqKoJQZkr95ibpe3cdrTbY8D9lonrK433rcA=
github.com/itchyny/gojq v0.12.12/go.mod h1:j+3sVkjxwd7A7Z5jrbKibgOLn0ZfLWkV+Awxr/pyzJE=
github.com/itchyny/timefmt-go v0.1.5 h1:G0INE2la8S6ru/ZI5JecgyzbbJNs5lG1RcBqa7Jm6GE=
github.com/itchyny/timefmt-go v0.1.5/go.mod h1:nEP7L+2YmAbT2kZ2HfSs1d8Xtw9LY8D2stDBckWakZ8=
github.com/jarcoal/httpmock v1.0.4 h1:jp+dy/+nonJE4g4xbVtl9QdrUNbn6/3hDT5R4nDIZnA=
@ -284,7 +281,6 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/karlseguin/ccache/v2 v2.0.8 h1:lT38cE//uyf6KcFok0rlgXtGFBWxkI6h/qg4tbFyDnA=
github.com/kataras/jwt v0.1.8 h1:u71baOsYD22HWeSOg32tCHbczPjdCk7V4MMeJqTtmGk=
github.com/kataras/jwt v0.1.8/go.mod h1:Q5j2IkcIHnfwy+oNY3TVWuEBJNw0ADgCcXK9CaZwV4o=
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
@ -368,7 +364,6 @@ github.com/muesli/termenv v0.13.0/go.mod h1:sP1+uffeLaEYpyOTb8pLCUctGcGLnoFjSn4Y
github.com/muesli/termenv v0.15.1 h1:UzuTb/+hhlBugQz28rpzey4ZuKcZ03MeKsoG7IJZIxs=
github.com/muesli/termenv v0.15.1/go.mod h1:HeAQPTzpfs016yGtA4g00CsdYnVLJvxsS4ANqrZs2sQ=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0=
github.com/nwaples/rardecode v1.1.3 h1:cWCaZwfM5H7nAD6PyEdcVnczzV8i/JtotnyW/dD9lEc=
github.com/nwaples/rardecode v1.1.3/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
@ -381,7 +376,6 @@ github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa
github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c=
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo=
github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM=
github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
@ -395,36 +389,36 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/projectdiscovery/asnmap v1.0.3 h1:Jxo8bcLui9OphkABDEuuEYne0UWMvgSThReecv08FTk=
github.com/projectdiscovery/asnmap v1.0.3/go.mod h1:tR5ZE2RxDvyPJ/w1mpmTusPeLW8rTz1ojZ5M4ATKeO4=
github.com/projectdiscovery/asnmap v1.0.4 h1:dmXrls7Y0Sdeb6cLlKGwdYX8h1K9q2iYOGXioD4U2AY=
github.com/projectdiscovery/asnmap v1.0.4/go.mod h1:iTLDyYsblEwYHcLiKZCRx8Et+xV7NlvgGLusANpgegc=
github.com/projectdiscovery/blackrock v0.0.1 h1:lHQqhaaEFjgf5WkuItbpeCZv2DUIE45k0VbGJyft6LQ=
github.com/projectdiscovery/blackrock v0.0.1/go.mod h1:ANUtjDfaVrqB453bzToU+YB4cUbvBRpLvEwoWIwlTss=
github.com/projectdiscovery/cdncheck v1.0.1 h1:kv1LRsHJl8TY5zMOhhcpGaBrBAdu01nmMVYqOxGwcMU=
github.com/projectdiscovery/cdncheck v1.0.1/go.mod h1:5l2DFwQNbR3uDYiyUpUQLN0I37+JnE8rSeBpd7WQR/Y=
github.com/projectdiscovery/cdncheck v1.0.2 h1:8bd7Ed8NgTyH4nyhf0jwRQdGIrTFsnQoPGr2shxR/xM=
github.com/projectdiscovery/cdncheck v1.0.2/go.mod h1:6otjXPoRQ42LRbEUqOeTDvFwToOVJptdvlUkiXe/rEE=
github.com/projectdiscovery/clistats v0.0.12 h1:KLYJxpiwEFidduU4PbcwEcCQ2L7c5wrf7DI5IN5fZ+8=
github.com/projectdiscovery/clistats v0.0.12/go.mod h1:9luKJj+7Hjq3+a7g129sKWRYx4SbTdkUWZQxabn3H5Y=
github.com/projectdiscovery/dsl v0.0.7 h1:Jn2dUN9Le7lrw8BvWcU50ueV+pQREhUkikDrIkjGpAs=
github.com/projectdiscovery/dsl v0.0.7/go.mod h1:71bLB5xpDKWSFTMaiV49uG2Sl2AtO9FHsMNPJ4eCpoE=
github.com/projectdiscovery/fastdialer v0.0.25 h1:/j7M8sL35ZqpRYmz9hDjnWNBnN8Yj5iL0kab7qzp1nQ=
github.com/projectdiscovery/fastdialer v0.0.25/go.mod h1:jQLHYaNsDc3MhpySVjKIo4o0GaUb07ISlDdkKURAxSo=
github.com/projectdiscovery/dsl v0.0.9 h1:VfznBxpbNKMn2amQd9gtRnMfK1/Sf9MwsJD9x2Et/fY=
github.com/projectdiscovery/dsl v0.0.9/go.mod h1:kdPdbbqceWxkSedXm99z0Hzh9z/DFj42A9L95GJjybo=
github.com/projectdiscovery/fastdialer v0.0.26 h1:7dihwvnm76GU/cw0ViZvIlAB7dLHppifRYlVdJdMnRw=
github.com/projectdiscovery/fastdialer v0.0.26/go.mod h1:kcWKnyh/H6iyZKlzQXSMZ4cDSZJpB4zdZV9W6PNty1k=
github.com/projectdiscovery/fasttemplate v0.0.2 h1:h2cISk5xDhlJEinlBQS6RRx0vOlOirB2y3Yu4PJzpiA=
github.com/projectdiscovery/fasttemplate v0.0.2/go.mod h1:XYWWVMxnItd+r0GbjA1GCsUopMw1/XusuQxdyAIHMCw=
github.com/projectdiscovery/freeport v0.0.4 h1:H4VrK/7hUcC1zbg46zv9iSMBACBDpUqcHkV+FUyXISw=
github.com/projectdiscovery/freeport v0.0.4/go.mod h1:PY0bxSJ34HVy67LHIeF3uIutiCSDwOqKD8ruBkdiCwE=
github.com/projectdiscovery/goflags v0.1.8 h1:Urhm2Isq2BdRt8h4h062lHKYXO65RHRjGTDSkUwex/g=
github.com/projectdiscovery/goflags v0.1.8/go.mod h1:Yxi9tclgwGczzDU65ntrwaIql5cXeTvW5j2WxFuF+Jk=
github.com/projectdiscovery/gologger v1.1.8 h1:CFlCzGlqAhPqWIrAXBt1OVh5jkMs1qgoR/z4xhdzLNE=
github.com/projectdiscovery/gologger v1.1.8/go.mod h1:bNyVaC1U/NpJtFkJltcesn01NR3K8Hg6RsLVce6yvrw=
github.com/projectdiscovery/gologger v1.1.10 h1:XNRdtzLTdxiFGuK9gutoL752mykzXDoii4P2yDovqck=
github.com/projectdiscovery/gologger v1.1.10/go.mod h1:VqANHK7qcEq3i6/vV5HNWwdyv2aFPSrlaVDU4Ogrc6U=
github.com/projectdiscovery/hmap v0.0.11 h1:nA3qCFzWPcOw27T8PII5IWI3ZP0ys7TGCi2nLSnHXVA=
github.com/projectdiscovery/hmap v0.0.11/go.mod h1:5sbLn2OHexvpVupStNOhusWO9jLCyEm5jcHwWB2nOkI=
github.com/projectdiscovery/httpx v1.3.0 h1:x7XbAUd1i3SL/SqVBZFM5EXv7YRXL58jdwonwxR4bvE=
github.com/projectdiscovery/httpx v1.3.0/go.mod h1:tglYwSUBz1zl2cC3NtjgURrI3cZsGepH1DLyQZZY2/M=
github.com/projectdiscovery/interactsh v1.1.3 h1:xZvIF4pYXGXAwjwbYSRiE/97kOCvTl7xiEl9LPJfmJo=
github.com/projectdiscovery/interactsh v1.1.3/go.mod h1:UlpOGINO7wLjS2M8OhfBhfIBX0NIdAag5nhPDAz/9MQ=
github.com/projectdiscovery/mapcidr v1.1.1 h1:68Xvw9cKugNeAVxHE3Nl1Ej26nm1taWq6e1WPXpluc0=
github.com/projectdiscovery/mapcidr v1.1.1/go.mod h1:yyp9ghqmmC0+r5DySgDBXE4cf2QW8SBloVESCteWiAg=
github.com/projectdiscovery/networkpolicy v0.0.5 h1:yiW1+nqtZmVB4RRt20Rhxs0tAO7ghPy+OY5kv3iaAG8=
github.com/projectdiscovery/networkpolicy v0.0.5/go.mod h1:egI9+HL+Q80AzXs1PrOfARWZm1bAn6n3HMONM49uWS8=
github.com/projectdiscovery/httpx v1.3.1 h1:yrpQJ/v31LLNiiSwfs0NAowtXDj4EWooKfTvCwucbZ8=
github.com/projectdiscovery/httpx v1.3.1/go.mod h1:BIahPS6H86IArVsXV/T3SJ0CDuz2e6BIXz89eo0+IKQ=
github.com/projectdiscovery/interactsh v1.1.4 h1:1qVxJ14aG/X7TLJoK5AHnaX6I7hnbPp5R2ql1bSYzqI=
github.com/projectdiscovery/interactsh v1.1.4/go.mod h1:rM8IEm6AAm68fWWExzBHjhBWfRhFYzR9gY5emOFiZCY=
github.com/projectdiscovery/mapcidr v1.1.2 h1:Mmq/nPqvVc7fjvH/kJVK0IBOny/LrJIxZ4tQsLPCrsA=
github.com/projectdiscovery/mapcidr v1.1.2/go.mod h1:Aoq0x/wJl6KDbtQ8OcPkjIDCqx2iEyx5ty1nzso8wXM=
github.com/projectdiscovery/networkpolicy v0.0.6 h1:yDvm0XCrS9HeemRrBS+J+22surzVczM94W5nHiOy/1o=
github.com/projectdiscovery/networkpolicy v0.0.6/go.mod h1:8HJQ/33Pi7v3a3MRWIQGXzpj+zHw2d60TysEL4qdoQk=
github.com/projectdiscovery/nvd v1.0.10-0.20230327073015-721181aba1e8 h1:aDq18tNWbnN5ZM0ADQb+8KB4DEPIGZMXdDmcXyFUoNg=
github.com/projectdiscovery/nvd v1.0.10-0.20230327073015-721181aba1e8/go.mod h1:JiVXOIewstCBMPsO+ZnmI43UXMPJGEE1jwuFVz4ujKM=
github.com/projectdiscovery/ratelimit v0.0.6 h1:SAD2ArdT9F8NmbkAIZpl7DjNnbiXdUQLnMZt5dbVmZ0=
@ -435,21 +429,20 @@ github.com/projectdiscovery/rdap v0.9.1-0.20221108103045-9865884d1917 h1:m03X4gB
github.com/projectdiscovery/rdap v0.9.1-0.20221108103045-9865884d1917/go.mod h1:JxXtZC9e195awe7EynrcnBJmFoad/BNDzW9mzFkK8Sg=
github.com/projectdiscovery/retryabledns v1.0.24 h1:CbC0a1EcyRDBcGFHZDGfW5orkWkOCfa0mAMF060XJpI=
github.com/projectdiscovery/retryabledns v1.0.24/go.mod h1:bCmv0neiqgemgmFChevfX2BgCxIp8sn5OnbwL1Gov9M=
github.com/projectdiscovery/retryablehttp-go v1.0.15 h1:kP9x9f++QimRwb8ABqnI1dhEymvnZXS2Wp2Zs4rWk/c=
github.com/projectdiscovery/retryablehttp-go v1.0.15/go.mod h1:+OzSFUv3sQcPt+MgbNx6X/Q3ESxqPUQSphqG5kxoIgI=
github.com/projectdiscovery/retryablehttp-go v1.0.16 h1:xrEK9VVkLf0eN4bYOTc2Pg0qRqz47g8T823vqpCIsl8=
github.com/projectdiscovery/retryablehttp-go v1.0.16/go.mod h1:9m76To4lNgBtVfqADzLxZg1wWajv6y/uYMWCOs1Olo8=
github.com/projectdiscovery/sarif v0.0.1 h1:C2Tyj0SGOKbCLgHrx83vaE6YkzXEVrMXYRGLkKCr/us=
github.com/projectdiscovery/sarif v0.0.1/go.mod h1:cEYlDu8amcPf6b9dSakcz2nNnJsoz4aR6peERwV+wuQ=
github.com/projectdiscovery/stringsutil v0.0.2 h1:uzmw3IVLJSMW1kEg8eCStG/cGbYYZAja8BH3LqqJXMA=
github.com/projectdiscovery/stringsutil v0.0.2/go.mod h1:EJ3w6bC5fBYjVou6ryzodQq37D5c6qbAYQpGmAy+DC0=
github.com/projectdiscovery/tlsx v1.0.9 h1:StUwVpPG0lrXq6FvxbFarPM+fu9Vke1sOPoyJcBVOFA=
github.com/projectdiscovery/tlsx v1.0.9/go.mod h1:4vGhl8lxUWjXuyoVvnL2ObMY/FSrb9Mpx5U2KaTV05A=
github.com/projectdiscovery/uncover v1.0.2 h1:mRFzflYyvwKkHd3XKufMlDRrb6p1mjFZTSHoNAUpFwo=
github.com/projectdiscovery/uncover v1.0.2/go.mod h1:lz4QYfArSA6jJkXyB71kN2/Pc7IW7nJB8c95n7xtwqY=
github.com/projectdiscovery/uncover v1.0.4 h1:d0lUNcnqDMfG4gR/WP2+UoQKLVmLE7opBiwnmI7ir/0=
github.com/projectdiscovery/uncover v1.0.4/go.mod h1:fvSHBhj8zZFEXGOhQIpPe5j5LtDXI7adOns1iFJ5TTY=
github.com/projectdiscovery/utils v0.0.3/go.mod h1:ne3eSlZlUKuhjHr8FfsfGcGteCzxcbJvFBx4VDBCxK0=
github.com/projectdiscovery/utils v0.0.26 h1:89t05av9r5gtHBZLCiEkid1rrUjHlwKppz5z5iYzeG0=
github.com/projectdiscovery/utils v0.0.26/go.mod h1:lCiVsbo79iqy4ihUQWUY4ywz0J13Mqudirgk+IV767o=
github.com/projectdiscovery/wappalyzergo v0.0.92 h1:IQgYS3xN6J9KKq1FjMVjso+gVchhPBqi/wzChYrr1JA=
github.com/projectdiscovery/wappalyzergo v0.0.92/go.mod h1:HvYuW0Be4JCjVds/+XAEaMSqRG9yrI97UmZq0TPk6A0=
github.com/projectdiscovery/utils v0.0.32 h1:TjUxFmRG9hiV6jauYsnIRiy08lTgGHGi8avstedNGXw=
github.com/projectdiscovery/utils v0.0.32/go.mod h1:SaOpcZ2dJ47NE3t4R/YC2XpUyRZC6v5k8sj2TFro6+k=
github.com/projectdiscovery/wappalyzergo v0.0.94 h1:IVRskuU95MajWCKYgvH5L67+MXDOWJDWSeBD61OsS/A=
github.com/projectdiscovery/wappalyzergo v0.0.94/go.mod h1:HvYuW0Be4JCjVds/+XAEaMSqRG9yrI97UmZq0TPk6A0=
github.com/projectdiscovery/yamldoc-go v1.0.4 h1:eZoESapnMw6WAHiVgRwNqvbJEfNHEH148uthhFbG5jE=
github.com/projectdiscovery/yamldoc-go v1.0.4/go.mod h1:8PIPRcUD55UbtQdcfFR1hpIGRWG0P7alClXNGt1TBik=
github.com/remeh/sizedwaitgroup v1.0.0 h1:VNGGFwNo/R5+MJBf6yrsr110p0m4/OX4S3DCy7Kyl5E=
@ -464,18 +457,18 @@ github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU=
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d h1:hrujxIzL1woJ7AwssoOcM/tq5JjjG2yYOc8odClEiXA=
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU=
github.com/sashabaranov/go-openai v1.8.0 h1:IZrNK/gGqxtp0j19F4NLGbmfoOkyDpM3oC9i/tv9bBM=
github.com/sashabaranov/go-openai v1.8.0/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
github.com/sashabaranov/go-openai v1.9.1 h1:3N52HkJKo9Zlo/oe1AVv5ZkCOny0ra58/ACvAxkN3MM=
github.com/sashabaranov/go-openai v1.9.1/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c=
github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/shirou/gopsutil/v3 v3.23.3 h1:Syt5vVZXUDXPEXpIBt5ziWsJ4LdSAAxF4l/xZeQgSEE=
github.com/shirou/gopsutil/v3 v3.23.3/go.mod h1:lSBNN6t3+D6W5e5nXTxc8KIMMVxAcS+6IJlffjRRlMU=
github.com/shoenig/go-m1cpu v0.1.4 h1:SZPIgRM2sEF9NJy50mRHu9PKGwxyyTTJIWvCtgVbozs=
github.com/shoenig/go-m1cpu v0.1.4/go.mod h1:Wwvst4LR89UxjeFtLRMrpgRiyY4xPsejnVZym39dbAQ=
github.com/shirou/gopsutil/v3 v3.23.4 h1:hZwmDxZs7Ewt75DV81r4pFMqbq+di2cbt9FsQBqLD2o=
github.com/shirou/gopsutil/v3 v3.23.4/go.mod h1:ZcGxyfzAMRevhUR2+cfhXDH6gQdFYE/t8j1nsU4mPI8=
github.com/shoenig/go-m1cpu v0.1.5 h1:LF57Z/Fpb/WdGLjt2HZilNnmZOxg/q2bSKTQhgbrLrQ=
github.com/shoenig/go-m1cpu v0.1.5/go.mod h1:Wwvst4LR89UxjeFtLRMrpgRiyY4xPsejnVZym39dbAQ=
github.com/shoenig/test v0.6.3 h1:GVXWJFk9PiOjN0KoJ7VrJGH6uLPnqxR7/fe3HUPfE0c=
github.com/shoenig/test v0.6.3/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k=
github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
@ -508,8 +501,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE=
github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
github.com/tidwall/assert v0.1.0 h1:aWcKyRBUAdLoVebxo95N7+YZVTFF/ASTr7BN4sLP6XI=
@ -541,7 +535,6 @@ github.com/trivago/tgo v1.0.7/go.mod h1:w4dpD+3tzNIIiIfkWWa85w5/B77tlvdZckQ+6PkF
github.com/twmb/murmur3 v1.1.6 h1:mqrRot1BRxm+Yct+vavLMou2/iJt0tNVTTC0QoIjaZg=
github.com/twmb/murmur3 v1.1.6/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ=
github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8=
github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/ulule/deepcopier v0.0.0-20200430083143-45decc6639b6 h1:TtyC78WMafNW8QFfv3TeP3yWNDG+uxNkk9vOrnDu6JA=
@ -565,8 +558,8 @@ github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofm
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos=
github.com/yl2chen/cidranger v1.0.2 h1:lbOWZVCG1tCRX4u24kuM1Tb4nHqWkDxwLdoS+SevawU=
github.com/yl2chen/cidranger v1.0.2/go.mod h1:9U1yz7WPYDwf0vpNWFaeRh0bjwz5RVgRy/9UEQfHl0g=
github.com/ysmood/fetchup v0.2.2 h1:Qn8/q5uDW7szclt4sVXCFJ1TXup3hogz94OaLf6kloo=
github.com/ysmood/fetchup v0.2.2/go.mod h1:xhibcRKziSvol0H1/pj33dnKrYyI2ebIvz5cOOkYGns=
github.com/ysmood/fetchup v0.2.3 h1:ulX+SonA0Vma5zUFXtv52Kzip/xe7aj4vqT5AJwQ+ZQ=
github.com/ysmood/fetchup v0.2.3/go.mod h1:xhibcRKziSvol0H1/pj33dnKrYyI2ebIvz5cOOkYGns=
github.com/ysmood/goob v0.4.0 h1:HsxXhyLBeGzWXnqVKtmT9qM7EuVs/XOgkX7T6r1o1AQ=
github.com/ysmood/goob v0.4.0/go.mod h1:u6yx7ZhS4Exf2MwciFr6nIM8knHQIE22lFpWHnfql18=
github.com/ysmood/gop v0.0.2 h1:VuWweTmXK+zedLqYufJdh3PlxDNBOfFHjIZlPT2T5nw=
@ -670,12 +663,12 @@ golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I=
golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g=
golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4=
golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8=
golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@ -699,7 +692,6 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201207223542-d4d67f95c62d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210228012217-479acdf4ea46/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@ -726,8 +718,9 @@ golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
@ -737,7 +730,7 @@ golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ=
golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=

View File

@ -95,7 +95,7 @@ func (t *TemplateManager) installTemplatesAt(dir string) error {
return errorutil.NewWithErr(err).Msgf("failed to create directory at %s", dir)
}
}
ghrd, err := updateutils.NewghReleaseDownloader(config.OfficialNucleiTeamplatesRepoName)
ghrd, err := updateutils.NewghReleaseDownloader(config.OfficialNucleiTemplatesRepoName)
if err != nil {
return errorutil.NewWithErr(err).Msgf("failed to install templates at %s", dir)
}
@ -116,7 +116,7 @@ func (t *TemplateManager) updateTemplatesAt(dir string) error {
oldchecksums = make(map[string]string)
}
ghrd, err := updateutils.NewghReleaseDownloader(config.OfficialNucleiTeamplatesRepoName)
ghrd, err := updateutils.NewghReleaseDownloader(config.OfficialNucleiTemplatesRepoName)
if err != nil {
return errorutil.NewWithErr(err).Msgf("failed to install templates at %s", dir)
}

View File

@ -14,6 +14,7 @@ import (
"github.com/projectdiscovery/nuclei/v2/internal/installer"
"github.com/projectdiscovery/nuclei/v2/internal/runner/nucleicloud"
uncoverlib "github.com/projectdiscovery/uncover"
updateutils "github.com/projectdiscovery/utils/update"
"github.com/logrusorgru/aurora"
@ -489,7 +490,14 @@ func (r *Runner) RunEnumeration() error {
// add the hosts from the metadata queries of loaded templates into input provider
if r.options.Uncover && len(r.options.UncoverQuery) == 0 {
ret := uncover.GetUncoverTargetsFromMetadata(store.Templates(), r.options.UncoverDelay, r.options.UncoverLimit, r.options.UncoverField)
uncoverOpts := &uncoverlib.Options{
Limit: r.options.UncoverLimit,
MaxRetry: r.options.Retries,
Timeout: r.options.Timeout,
RateLimit: uint(r.options.UncoverRateLimit),
RateLimitUnit: time.Minute, // default unit is minute
}
ret := uncover.GetUncoverTargetsFromMetadata(context.TODO(), store.Templates(), r.options.UncoverField, uncoverOpts)
for host := range ret {
r.hmapInputProvider.Set(host)
}

View File

@ -17,8 +17,7 @@ const (
CLIConifgFileName = "config.yaml"
ReportingConfigFilename = "reporting-config.yaml"
// Version is the current version of nuclei
Version = `v2.9.4`
Version = `v2.9.5`
// Directory Names of custom templates
CustomS3TemplatesDirName = "s3"
CustomGithubTemplatesDirName = "github"
@ -26,8 +25,7 @@ const (
CustomGitLabTemplatesDirName = "gitlab"
)
// IsOutdatedVersion compares two versions and returns true
// if current version is outdated
// IsOutdatedVersion compares two versions and returns true if the current version is outdated
func IsOutdatedVersion(current, latest string) bool {
if latest == "" {
// if pdtm api call failed it's assumed that current version is outdated
@ -45,6 +43,7 @@ func IsOutdatedVersion(current, latest string) bool {
return newVer.GreaterThan(currentVer)
}
// trimDevIfExists trims `-dev` suffix from version string if it exists
func trimDevIfExists(version string) string {
if strings.HasSuffix(version, "-dev") {
return strings.TrimSuffix(version, "-dev")

View File

@ -67,7 +67,7 @@ func getRemoteContent(URL string, remoteTemplateDomainList []string, remoteConte
}
return
}
if strings.HasPrefix(URL, "http") && stringsutil.HasSuffixAny(URL, extensions.YAML, extensions.YML) {
if strings.HasPrefix(URL, "http") && stringsutil.HasSuffixAny(URL, extensions.YAML) {
remoteContentChannel <- RemoteContent{
Content: []string{URL},
Type: contentType,

View File

@ -4,6 +4,7 @@ package hybrid
import (
"bufio"
"context"
"fmt"
"io"
"os"
@ -22,6 +23,7 @@ import (
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/protocolstate"
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/uncover"
"github.com/projectdiscovery/nuclei/v2/pkg/types"
uncoverlib "github.com/projectdiscovery/uncover"
fileutil "github.com/projectdiscovery/utils/file"
iputil "github.com/projectdiscovery/utils/ip"
readerutil "github.com/projectdiscovery/utils/reader"
@ -137,7 +139,16 @@ func (i *Input) initializeInputSources(opts *Options) error {
}
if options.Uncover && options.UncoverQuery != nil {
gologger.Info().Msgf("Running uncover query against: %s", strings.Join(options.UncoverEngine, ","))
ch, err := uncover.GetTargetsFromUncover(options.UncoverDelay, options.UncoverLimit, options.UncoverField, options.UncoverEngine, options.UncoverQuery)
uncoverOpts := &uncoverlib.Options{
Agents: options.UncoverEngine,
Queries: options.UncoverQuery,
Limit: options.UncoverLimit,
MaxRetry: options.Retries,
Timeout: options.Timeout,
RateLimit: uint(options.UncoverRateLimit),
RateLimitUnit: time.Minute, // default unit is minute
}
ch, err := uncover.GetTargetsFromUncover(context.TODO(), options.UncoverField, uncoverOpts)
if err != nil {
return err
}

View File

@ -1,512 +1,2 @@
103.57.226.0
103.57.226.1
103.57.226.2
103.57.226.3
103.57.226.4
103.57.226.5
103.57.226.6
103.57.226.7
103.57.226.8
103.57.226.9
103.57.226.10
103.57.226.11
103.57.226.12
103.57.226.13
103.57.226.14
103.57.226.15
103.57.226.16
103.57.226.17
103.57.226.18
103.57.226.19
103.57.226.20
103.57.226.21
103.57.226.22
103.57.226.23
103.57.226.24
103.57.226.25
103.57.226.26
103.57.226.27
103.57.226.28
103.57.226.29
103.57.226.30
103.57.226.31
103.57.226.32
103.57.226.33
103.57.226.34
103.57.226.35
103.57.226.36
103.57.226.37
103.57.226.38
103.57.226.39
103.57.226.40
103.57.226.41
103.57.226.42
103.57.226.43
103.57.226.44
103.57.226.45
103.57.226.46
103.57.226.47
103.57.226.48
103.57.226.49
103.57.226.50
103.57.226.51
103.57.226.52
103.57.226.53
103.57.226.54
103.57.226.55
103.57.226.56
103.57.226.57
103.57.226.58
103.57.226.59
103.57.226.60
103.57.226.61
103.57.226.62
103.57.226.63
103.57.226.64
103.57.226.65
103.57.226.66
103.57.226.67
103.57.226.68
103.57.226.69
103.57.226.70
103.57.226.71
103.57.226.72
103.57.226.73
103.57.226.74
103.57.226.75
103.57.226.76
103.57.226.77
103.57.226.78
103.57.226.79
103.57.226.80
103.57.226.81
103.57.226.82
103.57.226.83
103.57.226.84
103.57.226.85
103.57.226.86
103.57.226.87
103.57.226.88
103.57.226.89
103.57.226.90
103.57.226.91
103.57.226.92
103.57.226.93
103.57.226.94
103.57.226.95
103.57.226.96
103.57.226.97
103.57.226.98
103.57.226.99
103.57.226.100
103.57.226.101
103.57.226.102
103.57.226.103
103.57.226.104
103.57.226.105
103.57.226.106
103.57.226.107
103.57.226.108
103.57.226.109
103.57.226.110
103.57.226.111
103.57.226.112
103.57.226.113
103.57.226.114
103.57.226.115
103.57.226.116
103.57.226.117
103.57.226.118
103.57.226.119
103.57.226.120
103.57.226.121
103.57.226.122
103.57.226.123
103.57.226.124
103.57.226.125
103.57.226.126
103.57.226.127
103.57.226.128
103.57.226.129
103.57.226.130
103.57.226.131
103.57.226.132
103.57.226.133
103.57.226.134
103.57.226.135
103.57.226.136
103.57.226.137
103.57.226.138
103.57.226.139
103.57.226.140
103.57.226.141
103.57.226.142
103.57.226.143
103.57.226.144
103.57.226.145
103.57.226.146
103.57.226.147
103.57.226.148
103.57.226.149
103.57.226.150
103.57.226.151
103.57.226.152
103.57.226.153
103.57.226.154
103.57.226.155
103.57.226.156
103.57.226.157
103.57.226.158
103.57.226.159
103.57.226.160
103.57.226.161
103.57.226.162
103.57.226.163
103.57.226.164
103.57.226.165
103.57.226.166
103.57.226.167
103.57.226.168
103.57.226.169
103.57.226.170
103.57.226.171
103.57.226.172
103.57.226.173
103.57.226.174
103.57.226.175
103.57.226.176
103.57.226.177
103.57.226.178
103.57.226.179
103.57.226.180
103.57.226.181
103.57.226.182
103.57.226.183
103.57.226.184
103.57.226.185
103.57.226.186
103.57.226.187
103.57.226.188
103.57.226.189
103.57.226.190
103.57.226.191
103.57.226.192
103.57.226.193
103.57.226.194
103.57.226.195
103.57.226.196
103.57.226.197
103.57.226.198
103.57.226.199
103.57.226.200
103.57.226.201
103.57.226.202
103.57.226.203
103.57.226.204
103.57.226.205
103.57.226.206
103.57.226.207
103.57.226.208
103.57.226.209
103.57.226.210
103.57.226.211
103.57.226.212
103.57.226.213
103.57.226.214
103.57.226.215
103.57.226.216
103.57.226.217
103.57.226.218
103.57.226.219
103.57.226.220
103.57.226.221
103.57.226.222
103.57.226.223
103.57.226.224
103.57.226.225
103.57.226.226
103.57.226.227
103.57.226.228
103.57.226.229
103.57.226.230
103.57.226.231
103.57.226.232
103.57.226.233
103.57.226.234
103.57.226.235
103.57.226.236
103.57.226.237
103.57.226.238
103.57.226.239
103.57.226.240
103.57.226.241
103.57.226.242
103.57.226.243
103.57.226.244
103.57.226.245
103.57.226.246
103.57.226.247
103.57.226.248
103.57.226.249
103.57.226.250
103.57.226.251
103.57.226.252
103.57.226.253
103.57.226.254
103.57.226.255
103.58.114.0
103.58.114.1
103.58.114.2
103.58.114.3
103.58.114.4
103.58.114.5
103.58.114.6
103.58.114.7
103.58.114.8
103.58.114.9
103.58.114.10
103.58.114.11
103.58.114.12
103.58.114.13
103.58.114.14
103.58.114.15
103.58.114.16
103.58.114.17
103.58.114.18
103.58.114.19
103.58.114.20
103.58.114.21
103.58.114.22
103.58.114.23
103.58.114.24
103.58.114.25
103.58.114.26
103.58.114.27
103.58.114.28
103.58.114.29
103.58.114.30
103.58.114.31
103.58.114.32
103.58.114.33
103.58.114.34
103.58.114.35
103.58.114.36
103.58.114.37
103.58.114.38
103.58.114.39
103.58.114.40
103.58.114.41
103.58.114.42
103.58.114.43
103.58.114.44
103.58.114.45
103.58.114.46
103.58.114.47
103.58.114.48
103.58.114.49
103.58.114.50
103.58.114.51
103.58.114.52
103.58.114.53
103.58.114.54
103.58.114.55
103.58.114.56
103.58.114.57
103.58.114.58
103.58.114.59
103.58.114.60
103.58.114.61
103.58.114.62
103.58.114.63
103.58.114.64
103.58.114.65
103.58.114.66
103.58.114.67
103.58.114.68
103.58.114.69
103.58.114.70
103.58.114.71
103.58.114.72
103.58.114.73
103.58.114.74
103.58.114.75
103.58.114.76
103.58.114.77
103.58.114.78
103.58.114.79
103.58.114.80
103.58.114.81
103.58.114.82
103.58.114.83
103.58.114.84
103.58.114.85
103.58.114.86
103.58.114.87
103.58.114.88
103.58.114.89
103.58.114.90
103.58.114.91
103.58.114.92
103.58.114.93
103.58.114.94
103.58.114.95
103.58.114.96
103.58.114.97
103.58.114.98
103.58.114.99
103.58.114.100
103.58.114.101
103.58.114.102
103.58.114.103
103.58.114.104
103.58.114.105
103.58.114.106
103.58.114.107
103.58.114.108
103.58.114.109
103.58.114.110
103.58.114.111
103.58.114.112
103.58.114.113
103.58.114.114
103.58.114.115
103.58.114.116
103.58.114.117
103.58.114.118
103.58.114.119
103.58.114.120
103.58.114.121
103.58.114.122
103.58.114.123
103.58.114.124
103.58.114.125
103.58.114.126
103.58.114.127
103.58.114.128
103.58.114.129
103.58.114.130
103.58.114.131
103.58.114.132
103.58.114.133
103.58.114.134
103.58.114.135
103.58.114.136
103.58.114.137
103.58.114.138
103.58.114.139
103.58.114.140
103.58.114.141
103.58.114.142
103.58.114.143
103.58.114.144
103.58.114.145
103.58.114.146
103.58.114.147
103.58.114.148
103.58.114.149
103.58.114.150
103.58.114.151
103.58.114.152
103.58.114.153
103.58.114.154
103.58.114.155
103.58.114.156
103.58.114.157
103.58.114.158
103.58.114.159
103.58.114.160
103.58.114.161
103.58.114.162
103.58.114.163
103.58.114.164
103.58.114.165
103.58.114.166
103.58.114.167
103.58.114.168
103.58.114.169
103.58.114.170
103.58.114.171
103.58.114.172
103.58.114.173
103.58.114.174
103.58.114.175
103.58.114.176
103.58.114.177
103.58.114.178
103.58.114.179
103.58.114.180
103.58.114.181
103.58.114.182
103.58.114.183
103.58.114.184
103.58.114.185
103.58.114.186
103.58.114.187
103.58.114.188
103.58.114.189
103.58.114.190
103.58.114.191
103.58.114.192
103.58.114.193
103.58.114.194
103.58.114.195
103.58.114.196
103.58.114.197
103.58.114.198
103.58.114.199
103.58.114.200
103.58.114.201
103.58.114.202
103.58.114.203
103.58.114.204
103.58.114.205
103.58.114.206
103.58.114.207
103.58.114.208
103.58.114.209
103.58.114.210
103.58.114.211
103.58.114.212
103.58.114.213
103.58.114.214
103.58.114.215
103.58.114.216
103.58.114.217
103.58.114.218
103.58.114.219
103.58.114.220
103.58.114.221
103.58.114.222
103.58.114.223
103.58.114.224
103.58.114.225
103.58.114.226
103.58.114.227
103.58.114.228
103.58.114.229
103.58.114.230
103.58.114.231
103.58.114.232
103.58.114.233
103.58.114.234
103.58.114.235
103.58.114.236
103.58.114.237
103.58.114.238
103.58.114.239
103.58.114.240
103.58.114.241
103.58.114.242
103.58.114.243
103.58.114.244
103.58.114.245
103.58.114.246
103.58.114.247
103.58.114.248
103.58.114.249
103.58.114.250
103.58.114.251
103.58.114.252
103.58.114.253
103.58.114.254
103.58.114.255
103.57.226.0/24
103.58.114.0/24

View File

@ -1,256 +1 @@
216.101.17.0
216.101.17.1
216.101.17.2
216.101.17.3
216.101.17.4
216.101.17.5
216.101.17.6
216.101.17.7
216.101.17.8
216.101.17.9
216.101.17.10
216.101.17.11
216.101.17.12
216.101.17.13
216.101.17.14
216.101.17.15
216.101.17.16
216.101.17.17
216.101.17.18
216.101.17.19
216.101.17.20
216.101.17.21
216.101.17.22
216.101.17.23
216.101.17.24
216.101.17.25
216.101.17.26
216.101.17.27
216.101.17.28
216.101.17.29
216.101.17.30
216.101.17.31
216.101.17.32
216.101.17.33
216.101.17.34
216.101.17.35
216.101.17.36
216.101.17.37
216.101.17.38
216.101.17.39
216.101.17.40
216.101.17.41
216.101.17.42
216.101.17.43
216.101.17.44
216.101.17.45
216.101.17.46
216.101.17.47
216.101.17.48
216.101.17.49
216.101.17.50
216.101.17.51
216.101.17.52
216.101.17.53
216.101.17.54
216.101.17.55
216.101.17.56
216.101.17.57
216.101.17.58
216.101.17.59
216.101.17.60
216.101.17.61
216.101.17.62
216.101.17.63
216.101.17.64
216.101.17.65
216.101.17.66
216.101.17.67
216.101.17.68
216.101.17.69
216.101.17.70
216.101.17.71
216.101.17.72
216.101.17.73
216.101.17.74
216.101.17.75
216.101.17.76
216.101.17.77
216.101.17.78
216.101.17.79
216.101.17.80
216.101.17.81
216.101.17.82
216.101.17.83
216.101.17.84
216.101.17.85
216.101.17.86
216.101.17.87
216.101.17.88
216.101.17.89
216.101.17.90
216.101.17.91
216.101.17.92
216.101.17.93
216.101.17.94
216.101.17.95
216.101.17.96
216.101.17.97
216.101.17.98
216.101.17.99
216.101.17.100
216.101.17.101
216.101.17.102
216.101.17.103
216.101.17.104
216.101.17.105
216.101.17.106
216.101.17.107
216.101.17.108
216.101.17.109
216.101.17.110
216.101.17.111
216.101.17.112
216.101.17.113
216.101.17.114
216.101.17.115
216.101.17.116
216.101.17.117
216.101.17.118
216.101.17.119
216.101.17.120
216.101.17.121
216.101.17.122
216.101.17.123
216.101.17.124
216.101.17.125
216.101.17.126
216.101.17.127
216.101.17.128
216.101.17.129
216.101.17.130
216.101.17.131
216.101.17.132
216.101.17.133
216.101.17.134
216.101.17.135
216.101.17.136
216.101.17.137
216.101.17.138
216.101.17.139
216.101.17.140
216.101.17.141
216.101.17.142
216.101.17.143
216.101.17.144
216.101.17.145
216.101.17.146
216.101.17.147
216.101.17.148
216.101.17.149
216.101.17.150
216.101.17.151
216.101.17.152
216.101.17.153
216.101.17.154
216.101.17.155
216.101.17.156
216.101.17.157
216.101.17.158
216.101.17.159
216.101.17.160
216.101.17.161
216.101.17.162
216.101.17.163
216.101.17.164
216.101.17.165
216.101.17.166
216.101.17.167
216.101.17.168
216.101.17.169
216.101.17.170
216.101.17.171
216.101.17.172
216.101.17.173
216.101.17.174
216.101.17.175
216.101.17.176
216.101.17.177
216.101.17.178
216.101.17.179
216.101.17.180
216.101.17.181
216.101.17.182
216.101.17.183
216.101.17.184
216.101.17.185
216.101.17.186
216.101.17.187
216.101.17.188
216.101.17.189
216.101.17.190
216.101.17.191
216.101.17.192
216.101.17.193
216.101.17.194
216.101.17.195
216.101.17.196
216.101.17.197
216.101.17.198
216.101.17.199
216.101.17.200
216.101.17.201
216.101.17.202
216.101.17.203
216.101.17.204
216.101.17.205
216.101.17.206
216.101.17.207
216.101.17.208
216.101.17.209
216.101.17.210
216.101.17.211
216.101.17.212
216.101.17.213
216.101.17.214
216.101.17.215
216.101.17.216
216.101.17.217
216.101.17.218
216.101.17.219
216.101.17.220
216.101.17.221
216.101.17.222
216.101.17.223
216.101.17.224
216.101.17.225
216.101.17.226
216.101.17.227
216.101.17.228
216.101.17.229
216.101.17.230
216.101.17.231
216.101.17.232
216.101.17.233
216.101.17.234
216.101.17.235
216.101.17.236
216.101.17.237
216.101.17.238
216.101.17.239
216.101.17.240
216.101.17.241
216.101.17.242
216.101.17.243
216.101.17.244
216.101.17.245
216.101.17.246
216.101.17.247
216.101.17.248
216.101.17.249
216.101.17.250
216.101.17.251
216.101.17.252
216.101.17.253
216.101.17.254
216.101.17.255
216.101.17.0/24

View File

@ -40,7 +40,7 @@ func NewCustomTemplatesManager(options *types.Options) (*CustomTemplatesManager,
return ctm, nil
}
// Add github providers
// Add GitHub providers
githubProviders, err := NewGithubProviders(options)
if err != nil {
return nil, errorutil.NewWithErr(err).Msgf("could not create github providers for custom templates")
@ -49,7 +49,7 @@ func NewCustomTemplatesManager(options *types.Options) (*CustomTemplatesManager,
ctm.providers = append(ctm.providers, v)
}
// Add Aws S3 providers
// Add AWS S3 providers
s3Providers, err := NewS3Providers(options)
if err != nil {
return nil, errorutil.NewWithErr(err).Msgf("could not create s3 providers for custom templates")

View File

@ -76,13 +76,15 @@ func New(options *Options) (*Client, error) {
func (c *Client) poll() error {
if c.options.NoInteractsh {
return nil // do not init if disabled
// do not init if disabled
return ErrInteractshClientNotInitialized
}
interactsh, err := client.New(&client.Options{
ServerURL: c.options.ServerURL,
Token: c.options.Authorization,
DisableHTTPFallback: c.options.DisableHttpFallback,
HTTPClient: c.options.HTTPClient,
KeepAliveInterval: time.Minute,
})
if err != nil {
return errorutil.NewWithErr(err).Msgf("could not create client")
@ -196,18 +198,17 @@ func (c *Client) AlreadyMatched(data *RequestData) bool {
// URL returns a new URL that can be interacted with
func (c *Client) URL() (string, error) {
// first time initialization
var err error
c.Do(func() {
err = c.poll()
})
if err != nil {
return "", errorutil.NewWithErr(err).Wrap(ErrInteractshClientNotInitialized)
}
if c.interactsh == nil {
var err error
c.Do(func() {
err = c.poll()
})
if err != nil {
return "", errorutil.NewWithErr(err).Wrap(ErrInteractshClientNotInitialized)
}
// ensures interactsh is not nil
if c.interactsh == nil {
return "", ErrInteractshClientNotInitialized
}
return "", ErrInteractshClientNotInitialized
}
c.generated.Store(true)

View File

@ -1,11 +1,12 @@
package randomip
import (
"math/rand"
"crypto/rand"
"net"
"github.com/pkg/errors"
iputil "github.com/projectdiscovery/utils/ip"
randutil "github.com/projectdiscovery/utils/rand"
)
const (
@ -16,7 +17,13 @@ func GetRandomIPWithCidr(cidrs ...string) (net.IP, error) {
if len(cidrs) == 0 {
return nil, errors.Errorf("must specify at least one cidr")
}
cidr := cidrs[rand.Intn(len(cidrs))]
randIdx, err := randutil.IntN(len(cidrs))
if err != nil {
return nil, err
}
cidr := cidrs[randIdx]
if !iputil.IsCIDR(cidr) {
return nil, errors.Errorf("%s is not a valid cidr", cidr)
@ -56,7 +63,7 @@ func getRandomIP(ipnet *net.IPNet, size int) net.IP {
return ip
}
rand.Read(r)
_, _ = rand.Read(r)
for i := 0; i <= quotient; i++ {
if i == quotient {

View File

@ -3,247 +3,133 @@ package uncover
import (
"context"
"fmt"
"os"
"runtime"
"strings"
"sync"
"time"
"github.com/pkg/errors"
"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/nuclei/v2/pkg/templates"
"github.com/projectdiscovery/ratelimit"
ucRunner "github.com/projectdiscovery/uncover/runner"
"github.com/projectdiscovery/uncover/uncover"
"github.com/projectdiscovery/uncover/uncover/agent/censys"
"github.com/projectdiscovery/uncover/uncover/agent/criminalip"
"github.com/projectdiscovery/uncover/uncover/agent/fofa"
"github.com/projectdiscovery/uncover/uncover/agent/hunter"
"github.com/projectdiscovery/uncover/uncover/agent/netlas"
"github.com/projectdiscovery/uncover/uncover/agent/quake"
"github.com/projectdiscovery/uncover/uncover/agent/shodan"
"github.com/projectdiscovery/uncover/uncover/agent/shodanidb"
"github.com/projectdiscovery/uncover/uncover/agent/zoomeye"
"github.com/projectdiscovery/uncover"
"github.com/projectdiscovery/uncover/sources"
mapsutil "github.com/projectdiscovery/utils/maps"
"github.com/remeh/sizedwaitgroup"
stringsutil "github.com/projectdiscovery/utils/strings"
)
const maxConcurrentAgents = 50
// returns csv string of uncover supported agents
func GetUncoverSupportedAgents() string {
uncoverSupportedAgents := []string{"shodan", "shodan-idb", "fofa", "censys", "quake", "hunter", "zoomeye", "netlas", "criminalip"}
return strings.Join(uncoverSupportedAgents, ",")
u, _ := uncover.New(&uncover.Options{})
return strings.Join(u.AllAgents(), ",")
}
func GetTargetsFromUncover(delay, limit int, field string, engine, query []string) (chan string, error) {
uncoverOptions := &ucRunner.Options{
Provider: &ucRunner.Provider{},
Delay: delay,
Limit: limit,
Query: query,
Engine: engine,
// GetTargetsFromUncover returns targets from uncover
func GetTargetsFromUncover(ctx context.Context, outputFormat string, opts *uncover.Options) (chan string, error) {
u, err := uncover.New(opts)
if err != nil {
return nil, err
}
for _, eng := range engine {
err := loadKeys(eng, uncoverOptions)
if err != nil {
gologger.Error().Label("WRN").Msgf(err.Error())
continue
}
resChan, err := u.Execute(ctx)
if err != nil {
return nil, err
}
return getTargets(uncoverOptions, field)
}
func GetUncoverTargetsFromMetadata(templates []*templates.Template, delay, limit int, field string) chan string {
ret := make(chan string)
var uqMap = make(map[string][]string)
var eng, query string
for _, template := range templates {
for k, v := range template.Info.Metadata {
switch k {
case "shodan-query":
eng = "shodan"
case "fofa-query":
eng = "fofa"
case "censys-query":
eng = "censys"
case "quake-query":
eng = "quake"
case "hunter-query":
eng = "hunter"
case "zoomeye-query":
eng = "zoomeye"
case "netlas-query":
eng = "netlas"
case "criminalip-query":
eng = "criminalip"
default:
continue
}
query = fmt.Sprintf("%v", v)
uqMap[eng] = append(uqMap[eng], query)
}
}
keys := mapsutil.GetKeys(uqMap)
gologger.Info().Msgf("Running uncover query against: %s", strings.Join(keys, ","))
var wg sync.WaitGroup
outputChan := make(chan string) // buffered channel
go func() {
for k, v := range uqMap {
wg.Add(1)
go func(engine, query []string) {
ch, _ := GetTargetsFromUncover(delay, limit, field, engine, query)
for c := range ch {
ret <- c
defer close(outputChan)
for {
select {
case <-ctx.Done():
return
case res, ok := <-resChan:
if !ok {
return
}
wg.Done()
}([]string{k}, v)
if res.Error != nil {
// only log in verbose mode
gologger.Verbose().Msgf("uncover: %v", res.Error)
continue
}
outputChan <- processUncoverOutput(res, outputFormat)
}
}
wg.Wait()
close(ret)
}()
return ret
return outputChan, nil
}
func getTargets(uncoverOptions *ucRunner.Options, field string) (chan string, error) {
var rateLimiter *ratelimit.Limiter
// create rateLimiter for uncover delay
if uncoverOptions.Delay > 0 {
rateLimiter = ratelimit.New(context.Background(), 1, time.Duration(uncoverOptions.Delay))
} else {
rateLimiter = ratelimit.NewUnlimited(context.Background())
// processUncoverOutput returns output strign depending on uncover field
func processUncoverOutput(result sources.Result, outputFormat string) string {
if (result.IP == "" || result.Port == 0) && stringsutil.ContainsAny(outputFormat, "ip", "port") {
// if ip or port is not present, fallback to using host
outputFormat = "host"
}
var agents []uncover.Agent
// declare clients
for _, engine := range uncoverOptions.Engine {
var (
agent uncover.Agent
err error
)
switch engine {
case "shodan":
agent, err = shodan.NewWithOptions(&uncover.AgentOptions{RateLimiter: rateLimiter})
case "censys":
agent, err = censys.NewWithOptions(&uncover.AgentOptions{RateLimiter: rateLimiter})
case "fofa":
agent, err = fofa.NewWithOptions(&uncover.AgentOptions{RateLimiter: rateLimiter})
case "shodan-idb":
agent, err = shodanidb.NewWithOptions(&uncover.AgentOptions{RateLimiter: rateLimiter})
case "quake":
agent, err = quake.NewWithOptions(&uncover.AgentOptions{RateLimiter: rateLimiter})
case "hunter":
agent, err = hunter.NewWithOptions(&uncover.AgentOptions{RateLimiter: rateLimiter})
case "zoomeye":
agent, err = zoomeye.NewWithOptions(&uncover.AgentOptions{RateLimiter: rateLimiter})
case "netlas":
agent, err = netlas.NewWithOptions(&uncover.AgentOptions{RateLimiter: rateLimiter})
case "criminalip":
agent, err = criminalip.NewWithOptions(&uncover.AgentOptions{RateLimiter: rateLimiter})
default:
err = errors.Errorf("%s unknown uncover agent type", engine)
}
if err != nil {
return nil, err
}
agents = append(agents, agent)
}
// enumerate
swg := sizedwaitgroup.New(maxConcurrentAgents)
ret := make(chan string)
go func() {
for _, q := range uncoverOptions.Query {
uncoverQuery := &uncover.Query{
Query: q,
Limit: uncoverOptions.Limit,
replacer := strings.NewReplacer(
"ip", result.IP,
"host", result.Host,
"port", fmt.Sprint(result.Port),
"url", result.Url,
)
return replacer.Replace(outputFormat)
}
// GetUncoverTargetsFromMetadata returns targets from uncover metadata
func GetUncoverTargetsFromMetadata(ctx context.Context, templates []*templates.Template, outputFormat string, opts *uncover.Options) chan string {
// contains map[engine]queries
queriesMap := make(map[string][]string)
for _, template := range templates {
innerLoop:
for k, v := range template.Info.Metadata {
if !strings.HasSuffix(k, "-query") {
// this is not a query
// query keys are like shodan-query, fofa-query, etc
continue innerLoop
}
for _, agent := range agents {
swg.Add()
go func(agent uncover.Agent, uncoverQuery *uncover.Query) {
defer swg.Done()
keys := uncoverOptions.Provider.GetKeys()
session, err := uncover.NewSession(&keys, uncoverOptions.Retries, uncoverOptions.Timeout)
if err != nil {
gologger.Error().Label(agent.Name()).Msgf("couldn't create uncover new session: %s", err)
}
ch, err := agent.Query(session, uncoverQuery)
if err != nil {
gologger.Warning().Msgf("%s", err)
engine := strings.TrimSuffix(k, "-query")
if queriesMap[engine] == nil {
queriesMap[engine] = []string{}
}
queriesMap[engine] = append(queriesMap[engine], fmt.Sprint(v))
}
}
keys := mapsutil.GetKeys(queriesMap)
gologger.Info().Msgf("Running uncover queries from template against: %s", strings.Join(keys, ","))
result := make(chan string, runtime.NumCPU())
go func() {
defer close(result)
// unfortunately uncover doesn't support execution of map[engine]queries
// if queries are given they are executed against all engines which is not what we want
// TODO: add support for map[engine]queries in uncover
// Note below implementation is intentionally sequential to avoid burning all the API keys
counter := 0
for eng, queries := range queriesMap {
// create new uncover options for each engine
uncoverOpts := &uncover.Options{
Agents: []string{eng},
Queries: queries,
Limit: opts.Limit,
MaxRetry: opts.MaxRetry,
Timeout: opts.Timeout,
RateLimit: opts.RateLimit,
RateLimitUnit: opts.RateLimitUnit,
}
ch, err := GetTargetsFromUncover(ctx, outputFormat, uncoverOpts)
if err != nil {
gologger.Error().Msgf("Could not get targets using %v engine from uncover: %s", eng, err)
return
}
for {
select {
case <-ctx.Done():
return
case res, ok := <-ch:
if !ok {
return
}
for result := range ch {
replacer := strings.NewReplacer(
"ip", result.IP,
"host", result.Host,
"port", fmt.Sprint(result.Port),
)
ret <- replacer.Replace(field)
result <- res
counter++
if opts.Limit > 0 && counter >= opts.Limit {
return
}
}(agent, uncoverQuery)
}
}
}
swg.Wait()
close(ret)
}()
return ret, nil
}
func loadKeys(engine string, options *ucRunner.Options) error {
switch engine {
case "fofa":
if email, exists := os.LookupEnv("FOFA_EMAIL"); exists {
if key, exists := os.LookupEnv("FOFA_KEY"); exists {
options.Provider.Fofa = append(options.Provider.Fofa, fmt.Sprintf("%s:%s", email, key))
} else {
return errors.New("missing FOFA_KEY env variable")
}
} else {
return errors.Errorf("FOFA_EMAIL & FOFA_KEY env variables are not configured")
}
case "shodan":
if key, exists := os.LookupEnv("SHODAN_API_KEY"); exists {
options.Provider.Shodan = append(options.Provider.Shodan, key)
} else {
return errors.Errorf("SHODAN_API_KEY env variable is not configured")
}
case "censys":
if id, exists := os.LookupEnv("CENSYS_API_ID"); exists {
if secret, exists := os.LookupEnv("CENSYS_API_SECRET"); exists {
options.Provider.Censys = append(options.Provider.Censys, fmt.Sprintf("%s:%s", id, secret))
} else {
return errors.New("missing CENSYS_API_SECRET env variable")
}
} else {
return errors.Errorf("CENSYS_API_ID & CENSYS_API_SECRET env variable is not configured")
}
case "hunter":
if key, exists := os.LookupEnv("HUNTER_API_KEY"); exists {
options.Provider.Hunter = append(options.Provider.Hunter, key)
} else {
return errors.Errorf("HUNTER_API_KEY env variable is not configured")
}
case "zoomeye":
if key, exists := os.LookupEnv("ZOOMEYE_API_KEY"); exists {
options.Provider.ZoomEye = append(options.Provider.ZoomEye, key)
} else {
return errors.Errorf("ZOOMEYE_API_KEY env variable is not configured")
}
case "quake":
if key, exists := os.LookupEnv("QUAKE_TOKEN"); exists {
options.Provider.Quake = append(options.Provider.Quake, key)
} else {
return errors.Errorf("QUAKE_TOKEN env variable is not configured")
}
case "netlas":
if key, exists := os.LookupEnv("NETLAS_API_KEY"); exists {
options.Provider.Netlas = append(options.Provider.Netlas, key)
} else {
return errors.Errorf("NETLAS_API_KEY env variable is not configured")
}
case "criminalip":
if key, exists := os.LookupEnv("CRIMINALIP_API_KEY"); exists {
options.Provider.CriminalIP = append(options.Provider.CriminalIP, key)
} else {
return errors.Errorf("CRIMINALIP_API_KEY env variable is not configured")
}
default:
return errors.Errorf("unknown uncover agent")
}
return nil
return result
}

View File

@ -6,6 +6,7 @@ package variables
// 3. OptionsMap - Variables passed using CLI Options (+ Env) (available at generators.BuildPayloadFromOptions)
// 4. DynamicMap - Variables Obtained by extracting data from templates (available at Request.ExecuteWithResults + merged with previous internalEvent)
// 5. ProtocolMap - Variables generated by Evaluation Request / Responses of xyz protocol (available in Request.Make)
// 6. ConstantsMap - Constants defined in the template (available at Request.options.Constants in protocols)
// As we can tell , all variables sources are not linear i.e why they need to re-evaluated
// consider example
@ -22,3 +23,5 @@ package variables
// 1. VariablesMap
// 2. PayloadsMap
// Everytime Linear Sources are updated , Non-Linear Sources need to be re-evaluated
// Constants (no need to re-evaluate, should contain only scalars)

View File

@ -21,11 +21,12 @@ type Variable struct {
utils.InsertionOrderedStringMap `yaml:"-" json:"-"`
}
func (variables *Variable) JSONSchemaType() *jsonschema.Type {
func (variables Variable) JSONSchemaType() *jsonschema.Type {
gotType := &jsonschema.Type{
Type: "map[string]string",
Title: "variables for the request",
Description: "Additional variables for the request",
Type: "object",
Title: "variables for the request",
Description: "Additional variables for the request",
AdditionalProperties: []byte("true"),
}
return gotType
}

View File

@ -9,9 +9,11 @@ import (
"github.com/projectdiscovery/nuclei/v2/pkg/operators"
"github.com/projectdiscovery/nuclei/v2/pkg/protocols"
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/expressions"
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/generators"
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/replacer"
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/dns/dnsclientpool"
"github.com/projectdiscovery/retryabledns"
fileutil "github.com/projectdiscovery/utils/file"
)
// Request contains a DNS protocol request to be made from a template
@ -60,6 +62,21 @@ type Request struct {
// value: 100
TraceMaxRecursion int `yaml:"trace-max-recursion,omitempty" jsonschema:"title=trace-max-recursion level for dns request,description=TraceMaxRecursion is the number of max recursion allowed for trace operations"`
// description: |
// Attack is the type of payload combinations to perform.
//
// Batteringram is inserts the same payload into all defined payload positions at once, pitchfork combines multiple payload sets and clusterbomb generates
// permutations and combinations for all payloads.
AttackType generators.AttackTypeHolder `yaml:"attack,omitempty" json:"attack,omitempty" jsonschema:"title=attack is the payload combination,description=Attack is the type of payload combinations to perform,enum=batteringram,enum=pitchfork,enum=clusterbomb"`
// description: |
// Payloads contains any payloads for the current request.
//
// Payloads support both key-values combinations where a list
// of payloads is provided, or optionally a single file can also
// be provided as payload which will be read on run-time.
Payloads map[string]interface{} `yaml:"payloads,omitempty" json:"payloads,omitempty" jsonschema:"title=payloads for the network request,description=Payloads contains any payloads for the current request"`
generator *generators.PayloadGenerator
CompiledOperators *operators.Operators `yaml:"-"`
dnsClient *retryabledns.Client
options *protocols.ExecuterOptions
@ -143,6 +160,23 @@ func (request *Request) Compile(options *protocols.ExecuterOptions) error {
request.class = classToInt(request.Class)
request.options = options
request.question = questionTypeToInt(request.RequestType.String())
for name, payload := range options.Options.Vars.AsMap() {
payloadStr, ok := payload.(string)
// check if inputs contains the payload
if ok && fileutil.FileExists(payloadStr) {
if request.Payloads == nil {
request.Payloads = make(map[string]interface{})
}
request.Payloads[name] = payloadStr
}
}
if len(request.Payloads) > 0 {
request.generator, err = generators.New(request.Payloads, request.AttackType.Value, request.options.TemplatePath, request.options.Options.Sandbox, request.options.Catalog, request.options.Options.AttackType)
if err != nil {
return errors.Wrap(err, "could not parse payloads")
}
}
return nil
}
@ -170,6 +204,11 @@ func (request *Request) getDnsClient(options *protocols.ExecuterOptions, metadat
// Requests returns the total number of requests the YAML rule will perform
func (request *Request) Requests() int {
if request.generator != nil {
payloadRequests := request.generator.NewIterator().Total()
return payloadRequests
}
return 1
}
@ -226,6 +265,8 @@ func questionTypeToInt(questionType string) uint16 {
question = dns.TypeCAA
case "TLSA":
question = dns.TypeTLSA
case "ANY":
question = dns.TypeANY
}
return question
}

View File

@ -35,3 +35,55 @@ func TestDNSCompileMake(t *testing.T) {
require.Nil(t, err, "could not make dns request")
require.Equal(t, "one.one.one.one.", req.Question[0].Name, "could not get correct dns question")
}
func TestDNSRequests(t *testing.T) {
options := testutils.DefaultOptions
recursion := false
testutils.Init(options)
const templateID = "testing-dns"
t.Run("dns-regular", func(t *testing.T) {
request := &Request{
RequestType: DNSRequestTypeHolder{DNSRequestType: A},
Class: "INET",
Retries: 5,
ID: templateID,
Recursion: &recursion,
Name: "{{FQDN}}",
}
executerOpts := testutils.NewMockExecuterOptions(options, &testutils.TemplateInfo{
ID: templateID,
Info: model.Info{SeverityHolder: severity.Holder{Severity: severity.Low}, Name: "test"},
})
err := request.Compile(executerOpts)
require.Nil(t, err, "could not compile dns request")
reqCount := request.Requests()
require.Equal(t, 1, reqCount, "could not get correct dns request count")
})
// test payload requests count is correct
t.Run("dns-payload", func(t *testing.T) {
request := &Request{
RequestType: DNSRequestTypeHolder{DNSRequestType: A},
Class: "INET",
Retries: 5,
ID: templateID,
Recursion: &recursion,
Name: "{{subdomain}}.{{FQDN}}",
Payloads: map[string]interface{}{"subdomain": []string{"a", "b", "c"}},
}
executerOpts := testutils.NewMockExecuterOptions(options, &testutils.TemplateInfo{
ID: templateID,
Info: model.Info{SeverityHolder: severity.Holder{Severity: severity.Low}, Name: "test"},
})
err := request.Compile(executerOpts)
require.Nil(t, err, "could not compile dns request")
reqCount := request.Requests()
require.Equal(t, 3, reqCount, "could not get correct dns request count")
})
}

View File

@ -35,6 +35,8 @@ const (
CAA
// name:TLSA
TLSA
// name:ANY
ANY
limit
)
@ -51,6 +53,7 @@ var DNSRequestTypeMapping = map[DNSRequestType]string{
AAAA: "AAAA",
CAA: "CAA",
TLSA: "TLSA",
ANY: "ANY",
}
// GetSupportedDNSRequestTypes returns list of supported types

View File

@ -96,7 +96,10 @@ func (request *Request) responseToDSLMap(req, resp *dns.Msg, host, matched strin
"type": request.Type().String(),
"trace": traceToString(traceData, false),
}
return generators.MergeMaps(ret, recordsKeyValue(resp.Answer))
if len(resp.Answer) > 0 {
ret = generators.MergeMaps(ret, recordsKeyValue(resp.Answer))
}
return ret
}
// MakeResultEvent creates a result event from internal wrapped event
@ -156,12 +159,14 @@ func recordsKeyValue(resourceRecords []dns.RR) output.InternalEvent {
key := strings.ToLower(dns.TypeToString[resourceRecord.Header().Rrtype])
value := strings.ReplaceAll(resourceRecord.String(), resourceRecord.Header().String(), "")
if preVal, ok := oe[key]; ok {
switch v := oe[key].(type) {
// if the key is already present, we need to convert the value to a slice
// if the key has slice, then append the value to the slice
if previous, ok := oe[key]; ok {
switch v := previous.(type) {
case string:
oe[key] = []string{value, preVal.(string)}
oe[key] = []string{v, value}
case []string:
oe[key] = append(v, preVal.([]string)...)
oe[key] = append(v, value)
}
continue
}

View File

@ -43,12 +43,12 @@ func TestResponseToDSLMap(t *testing.T) {
resp := new(dns.Msg)
resp.Rcode = dns.RcodeSuccess
resp.Answer = append(resp.Answer, &dns.A{A: net.ParseIP("1.1.1.1"), Hdr: dns.RR_Header{Name: "one.one.one.one.", Rrtype: dns.TypeA}}, &dns.A{A: net.ParseIP("2.2.2.2"), Hdr: dns.RR_Header{Name: "one.one.one.one.", Rrtype: dns.TypeA}})
resp.Answer = append(resp.Answer, &dns.A{A: net.ParseIP("1.1.1.1"), Hdr: dns.RR_Header{Name: "one.one.one.one.", Rrtype: dns.TypeA}}, &dns.A{A: net.ParseIP("2.2.2.2"), Hdr: dns.RR_Header{Name: "one.one.one.one.", Rrtype: dns.TypeA}}, &dns.A{A: net.ParseIP("3.3.3.3"), Hdr: dns.RR_Header{Name: "one.one.one.one.", Rrtype: dns.TypeA}})
event := request.responseToDSLMap(req, resp, "one.one.one.one", "one.one.one.one", nil)
require.Len(t, event, 15, "could not get correct number of items in dsl map")
require.Equal(t, dns.RcodeSuccess, event["rcode"], "could not get correct rcode")
require.ElementsMatch(t, []string{net.ParseIP("1.1.1.1").String(), net.ParseIP("2.2.2.2").String()}, event["a"], "could not get correct a record")
require.ElementsMatch(t, []string{net.ParseIP("1.1.1.1").String(), net.ParseIP("2.2.2.2").String(), net.ParseIP("3.3.3.3").String()}, event["a"], "could not get correct a record")
}
func TestDNSOperatorMatch(t *testing.T) {

View File

@ -4,9 +4,11 @@ import (
"encoding/hex"
"fmt"
"net/url"
"strings"
"github.com/miekg/dns"
"github.com/pkg/errors"
"golang.org/x/exp/maps"
"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/nuclei/v2/pkg/output"
@ -53,7 +55,29 @@ func (request *Request) ExecuteWithResults(input *contextargs.Context, metadata,
// merge with metadata (eg. from workflow context)
vars = generators.MergeMaps(vars, metadata, optionVars)
variablesMap := request.options.Variables.Evaluate(vars)
vars = generators.MergeMaps(variablesMap, vars)
vars = generators.MergeMaps(vars, variablesMap, request.options.Constants)
if request.generator != nil {
iterator := request.generator.NewIterator()
for {
value, ok := iterator.Value()
if !ok {
break
}
value = generators.MergeMaps(vars, value)
if err := request.execute(domain, metadata, previous, value, callback); err != nil {
return err
}
}
} else {
value := maps.Clone(vars)
return request.execute(domain, metadata, previous, value, callback)
}
return nil
}
func (request *Request) execute(domain string, metadata, previous output.InternalEvent, vars map[string]interface{}, callback protocols.OutputEventCallback) error {
if vardump.EnableVarDump {
gologger.Debug().Msgf("Protocol request variables: \n%s\n", vardump.DumpVariables(vars))
@ -74,14 +98,20 @@ func (request *Request) ExecuteWithResults(input *contextargs.Context, metadata,
return nil
}
}
question := domain
if len(compiledRequest.Question) > 0 {
question = compiledRequest.Question[0].Name
}
// remove the last dot
question = strings.TrimSuffix(question, ".")
requestString := compiledRequest.String()
if varErr := expressions.ContainsUnresolvedVariables(requestString); varErr != nil {
gologger.Warning().Msgf("[%s] Could not make dns request for %s: %v\n", request.options.TemplateID, domain, varErr)
gologger.Warning().Msgf("[%s] Could not make dns request for %s: %v\n", request.options.TemplateID, question, varErr)
return nil
}
if request.options.Options.Debug || request.options.Options.DebugRequests || request.options.Options.StoreResponse {
msg := fmt.Sprintf("[%s] Dumped DNS request for %s", request.options.TemplateID, domain)
msg := fmt.Sprintf("[%s] Dumped DNS request for %s", request.options.TemplateID, question)
if request.options.Options.Debug || request.options.Options.DebugRequests {
gologger.Info().Str("domain", domain).Msgf(msg)
gologger.Print().Msgf("%s", requestString)
@ -98,14 +128,15 @@ func (request *Request) ExecuteWithResults(input *contextargs.Context, metadata,
if err != nil {
request.options.Output.Request(request.options.TemplatePath, domain, request.Type().String(), err)
request.options.Progress.IncrementFailedRequestsBy(1)
} else {
request.options.Progress.IncrementRequests()
}
if response == nil {
return errors.Wrap(err, "could not send dns request")
}
request.options.Progress.IncrementRequests()
request.options.Output.Request(request.options.TemplatePath, domain, request.Type().String(), err)
gologger.Verbose().Msgf("[%s] Sent DNS request to %s\n", request.options.TemplateID, domain)
gologger.Verbose().Msgf("[%s] Sent DNS request to %s\n", request.options.TemplateID, question)
// perform trace if necessary
var traceData *retryabledns.TraceData
@ -116,7 +147,8 @@ func (request *Request) ExecuteWithResults(input *contextargs.Context, metadata,
}
}
outputEvent := request.responseToDSLMap(compiledRequest, response, input.MetaInput.Input, input.MetaInput.Input, traceData)
// Create the output event
outputEvent := request.responseToDSLMap(compiledRequest, response, domain, question, traceData)
for k, v := range previous {
outputEvent[k] = v
}
@ -125,9 +157,9 @@ func (request *Request) ExecuteWithResults(input *contextargs.Context, metadata,
}
event := eventcreator.CreateEvent(request, outputEvent, request.options.Options.Debug || request.options.Options.DebugResponse)
dumpResponse(event, request, request.options, response.String(), domain)
dumpResponse(event, request, request.options, response.String(), question)
if request.Trace {
dumpTraceData(event, request.options, traceToString(traceData, true), domain)
dumpTraceData(event, request.options, traceToString(traceData, true), question)
}
callback(event)

View File

@ -51,11 +51,11 @@ type Request struct {
// description: |
// elaborates archives
Archive bool
Archive bool `yaml:"archive,omitempty" json:"archive,omitempty" jsonschema:"title=enable archives,description=Process compressed archives without unpacking"`
// description: |
// enables mime types check
MimeType bool
MimeType bool `yaml:"mime-type,omitempty" json:"mime-type,omitempty" jsonschema:"title=enable filtering by mime-type,description=Filter files by mime-type"`
CompiledOperators *operators.Operators `yaml:"-" json:"-"`

View File

@ -64,9 +64,7 @@ func newHttpClient(options *types.Options) (*http.Client, error) {
dc := dialer.(interface {
DialContext(ctx context.Context, network, addr string) (net.Conn, error)
})
if proxyErr == nil {
transport.DialContext = dc.DialContext
}
transport.DialContext = dc.DialContext
}
jar, _ := cookiejar.New(nil)

View File

@ -41,7 +41,7 @@ func (request *Request) ExecuteWithResults(input *contextargs.Context, metadata,
payloads := generators.BuildPayloadFromOptions(request.options.Options)
values := generators.MergeMaps(vars, metadata, payloads)
variablesMap := request.options.Variables.Evaluate(values)
payloads = generators.MergeMaps(variablesMap, payloads)
payloads = generators.MergeMaps(variablesMap, payloads, request.options.Constants)
// check for operator matches by wrapping callback
gotmatches := false

View File

@ -112,7 +112,7 @@ func (r *requestGenerator) Make(ctx context.Context, input *contextargs.Context,
r.interactshURLs = append(r.interactshURLs, interactURLs...)
}
// allVars contains all variables from all sources
allVars := generators.MergeMaps(dynamicValues, defaultReqVars, optionVars, variablesMap)
allVars := generators.MergeMaps(dynamicValues, defaultReqVars, optionVars, variablesMap, r.options.Constants)
// Evaluate payload variables
// eg: payload variables can be username: jon.doe@{{Hostname}}
@ -170,10 +170,10 @@ func (r *requestGenerator) makeSelfContainedRequest(ctx context.Context, data st
signerVars := GetDefaultSignerVars(r.request.Signature.Value)
// this will ensure that default signer variables are overwritten by other variables
values = generators.MergeMaps(signerVars, values)
values = generators.MergeMaps(signerVars, values, r.options.Constants)
// priority of variables is as follows (from low to high) for self contained templates
// default signer vars < variables < cli vars < payload < dynamic values
// default signer vars < variables < cli vars < payload < dynamic values < constants
// evaluate request
data, err := expressions.Evaluate(data, values)

View File

@ -47,7 +47,7 @@ func (rule *Rule) Execute(input *ExecuteRuleInput) error {
baseValues := input.Values
if rule.generator == nil {
evaluatedValues, interactURLs := rule.options.Variables.EvaluateWithInteractsh(baseValues, rule.options.Interactsh)
input.Values = generators.MergeMaps(evaluatedValues, baseValues)
input.Values = generators.MergeMaps(evaluatedValues, baseValues, rule.options.Constants)
input.InteractURLs = interactURLs
err := rule.executeRuleValues(input)
return err
@ -60,7 +60,7 @@ func (rule *Rule) Execute(input *ExecuteRuleInput) error {
}
evaluatedValues, interactURLs := rule.options.Variables.EvaluateWithInteractsh(generators.MergeMaps(values, baseValues), rule.options.Interactsh)
input.InteractURLs = interactURLs
input.Values = generators.MergeMaps(values, evaluatedValues, baseValues)
input.Values = generators.MergeMaps(values, evaluatedValues, baseValues, rule.options.Constants)
if err := rule.executeRuleValues(input); err != nil {
return err

View File

@ -318,7 +318,7 @@ func (request *Request) executeFuzzingRule(input *contextargs.Context, previous
func (request *Request) ExecuteWithResults(input *contextargs.Context, dynamicValues, previous output.InternalEvent, callback protocols.OutputEventCallback) error {
if request.Pipeline || request.Race && request.RaceNumberRequests > 0 || request.Threads > 0 {
variablesMap := request.options.Variables.Evaluate(generators.MergeMaps(dynamicValues, previous))
dynamicValues = generators.MergeMaps(variablesMap, dynamicValues)
dynamicValues = generators.MergeMaps(variablesMap, dynamicValues, request.options.Constants)
}
// verify if pipeline was requested
if request.Pipeline {
@ -638,7 +638,7 @@ func (request *Request) executeRequest(input *contextargs.Context, generatedRequ
if !request.Unsafe && resp != nil && generatedRequest.request != nil && resp.Request != nil && !request.Race {
bodyBytes, _ := generatedRequest.request.BodyBytes()
resp.Request.Body = io.NopCloser(bytes.NewReader(bodyBytes))
command, _ := http2curl.GetCurlCommand(resp.Request)
command, err := http2curl.GetCurlCommand(resp.Request)
if err == nil && command != nil {
curlCommand = command.String()
}

View File

@ -38,7 +38,7 @@ func (request *Request) Type() templateTypes.ProtocolType {
}
// ExecuteWithResults executes the protocol requests and returns results instead of writing them.
func (request *Request) ExecuteWithResults(input *contextargs.Context, metadata /*TODO review unused parameter*/, previous output.InternalEvent, callback protocols.OutputEventCallback) error {
func (request *Request) ExecuteWithResults(input *contextargs.Context, metadata, previous output.InternalEvent, callback protocols.OutputEventCallback) error {
var address string
var err error
@ -54,7 +54,7 @@ func (request *Request) ExecuteWithResults(input *contextargs.Context, metadata
}
variables := protocolutils.GenerateVariables(address, false, nil)
variablesMap := request.options.Variables.Evaluate(variables)
variables = generators.MergeMaps(variablesMap, variables)
variables = generators.MergeMaps(variablesMap, variables, request.options.Constants)
for _, kv := range request.addresses {
actualAddress := replacer.Replace(kv.address, variables)

View File

@ -70,6 +70,8 @@ type ExecuterOptions struct {
StopAtFirstMatch bool
// Variables is a list of variables from template
Variables variables.Variable
// Constants is a list of constants from template
Constants map[string]interface{}
// ExcludeMatchers is the list of matchers to exclude
ExcludeMatchers *excludematchers.ExcludeMatchers
// InputHelper is a helper for input normalization

View File

@ -190,7 +190,7 @@ func (request *Request) ExecuteWithResults(input *contextargs.Context, dynamicVa
hostnameVariables := protocolutils.GenerateDNSVariables(hostname)
values := generators.MergeMaps(payloadValues, hostnameVariables)
variablesMap := request.options.Variables.Evaluate(values)
payloadValues = generators.MergeMaps(variablesMap, payloadValues)
payloadValues = generators.MergeMaps(variablesMap, payloadValues, request.options.Constants)
if vardump.EnableVarDump {
gologger.Debug().Msgf("Protocol request variables: \n%s\n", vardump.DumpVariables(payloadValues))

View File

@ -176,7 +176,7 @@ func (request *Request) executeRequestWithPayloads(input, hostname string, dynam
defaultVars := protocolutils.GenerateVariables(parsed, false, nil)
optionVars := generators.BuildPayloadFromOptions(request.options.Options)
variables := request.options.Variables.Evaluate(generators.MergeMaps(defaultVars, optionVars, dynamicValues))
payloadValues := generators.MergeMaps(variables, defaultVars, optionVars, dynamicValues)
payloadValues := generators.MergeMaps(variables, defaultVars, optionVars, dynamicValues, request.options.Constants)
requestOptions := request.options
for key, value := range request.Headers {

View File

@ -92,7 +92,7 @@ func (request *Request) ExecuteWithResults(input *contextargs.Context, dynamicVa
optionVars := generators.BuildPayloadFromOptions(request.options.Options)
vars := request.options.Variables.Evaluate(generators.MergeMaps(defaultVars, optionVars, dynamicValues))
variables := generators.MergeMaps(vars, defaultVars, optionVars, dynamicValues)
variables := generators.MergeMaps(vars, defaultVars, optionVars, dynamicValues, request.options.Constants)
if vardump.EnableVarDump {
gologger.Debug().Msgf("Protocol request variables: \n%s\n", vardump.DumpVariables(variables))

View File

@ -2,6 +2,7 @@ package sarif
import (
"fmt"
"math"
"os"
"path"
"sync"
@ -125,7 +126,7 @@ func (exporter *Exporter) Export(event *output.ResultEvent) error {
}
// If rule is added
ruleIndex := len(exporter.rules) - 1
ruleIndex := int(math.Max(0, float64(len(exporter.rules)-1)))
if exporter.rulemap[rule.Id] == nil {
exporter.rulemap[rule.Id] = &ruleIndex
exporter.rules = append(exporter.rules, rule)

View File

@ -232,6 +232,8 @@ func ParseTemplateFromReader(reader io.Reader, preprocessor Preprocessor, option
options.Variables = template.Variables
}
options.Constants = template.Constants
// If no requests, and it is also not a workflow, return error.
if template.Requests() == 0 {
return nil, fmt.Errorf("no requests defined for %s", template.ID)

View File

@ -113,6 +113,10 @@ type Template struct {
// Variables contains any variables for the current request.
Variables variables.Variable `yaml:"variables,omitempty" json:"variables,omitempty" jsonschema:"title=variables for the http request,description=Variables contains any variables for the current request"`
// description: |
// Constants contains any scalar costant for the current template
Constants map[string]interface{} `yaml:"constants,omitempty" json:"constants,omitempty" jsonschema:"title=constant for the template,description=constants contains any constant for the template"`
// TotalRequests is the total number of requests for the template.
TotalRequests int `yaml:"-" json:"-"`
// Executer is the actual template executor for running template requests

View File

@ -42,7 +42,7 @@ func init() {
TemplateDoc.Type = "Template"
TemplateDoc.Comments[encoder.LineComment] = " Template is a YAML input file which defines all the requests and"
TemplateDoc.Description = "Template is a YAML input file which defines all the requests and\n other metadata for a template."
TemplateDoc.Fields = make([]encoder.Doc, 16)
TemplateDoc.Fields = make([]encoder.Doc, 17)
TemplateDoc.Fields[0].Name = "id"
TemplateDoc.Fields[0].Type = "string"
TemplateDoc.Fields[0].Note = ""
@ -138,6 +138,11 @@ func init() {
TemplateDoc.Fields[15].Note = ""
TemplateDoc.Fields[15].Description = "Variables contains any variables for the current request."
TemplateDoc.Fields[15].Comments[encoder.LineComment] = "Variables contains any variables for the current request."
TemplateDoc.Fields[16].Name = "constants"
TemplateDoc.Fields[16].Type = "map[string]interface{}"
TemplateDoc.Fields[16].Note = ""
TemplateDoc.Fields[16].Description = "Constants contains any scalar costant for the current template"
TemplateDoc.Fields[16].Comments[encoder.LineComment] = "Constants contains any scalar costant for the current template"
MODELInfoDoc.Type = "model.Info"
MODELInfoDoc.Comments[encoder.LineComment] = " Info contains metadata information about a template"
@ -606,6 +611,10 @@ func init() {
TypeName: "http.Request",
FieldName: "attack",
},
{
TypeName: "dns.Request",
FieldName: "attack",
},
{
TypeName: "network.Request",
FieldName: "attack",
@ -807,7 +816,7 @@ func init() {
Value: "Trace contains trace data for DNS request if enabled",
},
}
DNSRequestDoc.Fields = make([]encoder.Doc, 9)
DNSRequestDoc.Fields = make([]encoder.Doc, 11)
DNSRequestDoc.Fields[0].Name = "id"
DNSRequestDoc.Fields[0].Type = "string"
DNSRequestDoc.Fields[0].Note = ""
@ -857,16 +866,26 @@ func init() {
DNSRequestDoc.Fields[6].Comments[encoder.LineComment] = "TraceMaxRecursion is the number of max recursion allowed for trace operations"
DNSRequestDoc.Fields[6].AddExample("Use a retry of 100 to 150 generally", 100)
DNSRequestDoc.Fields[7].Name = "recursion"
DNSRequestDoc.Fields[7].Type = "dns.bool"
DNSRequestDoc.Fields[7].Name = "attack"
DNSRequestDoc.Fields[7].Type = "generators.AttackTypeHolder"
DNSRequestDoc.Fields[7].Note = ""
DNSRequestDoc.Fields[7].Description = "Recursion determines if resolver should recurse all records to get fresh results."
DNSRequestDoc.Fields[7].Comments[encoder.LineComment] = "Recursion determines if resolver should recurse all records to get fresh results."
DNSRequestDoc.Fields[8].Name = "resolvers"
DNSRequestDoc.Fields[8].Type = "[]string"
DNSRequestDoc.Fields[7].Description = "Attack is the type of payload combinations to perform.\n\nBatteringram is inserts the same payload into all defined payload positions at once, pitchfork combines multiple payload sets and clusterbomb generates\npermutations and combinations for all payloads."
DNSRequestDoc.Fields[7].Comments[encoder.LineComment] = "Attack is the type of payload combinations to perform."
DNSRequestDoc.Fields[8].Name = "payloads"
DNSRequestDoc.Fields[8].Type = "map[string]interface{}"
DNSRequestDoc.Fields[8].Note = ""
DNSRequestDoc.Fields[8].Description = "Resolvers to use for the dns requests"
DNSRequestDoc.Fields[8].Comments[encoder.LineComment] = " Resolvers to use for the dns requests"
DNSRequestDoc.Fields[8].Description = "Payloads contains any payloads for the current request.\n\nPayloads support both key-values combinations where a list\nof payloads is provided, or optionally a single file can also\nbe provided as payload which will be read on run-time."
DNSRequestDoc.Fields[8].Comments[encoder.LineComment] = "Payloads contains any payloads for the current request."
DNSRequestDoc.Fields[9].Name = "recursion"
DNSRequestDoc.Fields[9].Type = "dns.bool"
DNSRequestDoc.Fields[9].Note = ""
DNSRequestDoc.Fields[9].Description = "Recursion determines if resolver should recurse all records to get fresh results."
DNSRequestDoc.Fields[9].Comments[encoder.LineComment] = "Recursion determines if resolver should recurse all records to get fresh results."
DNSRequestDoc.Fields[10].Name = "resolvers"
DNSRequestDoc.Fields[10].Type = "[]string"
DNSRequestDoc.Fields[10].Note = ""
DNSRequestDoc.Fields[10].Description = "Resolvers to use for the dns requests"
DNSRequestDoc.Fields[10].Comments[encoder.LineComment] = " Resolvers to use for the dns requests"
DNSRequestTypeHolderDoc.Type = "DNSRequestTypeHolder"
DNSRequestTypeHolderDoc.Comments[encoder.LineComment] = " DNSRequestTypeHolder is used to hold internal type of the DNS type"
@ -895,6 +914,7 @@ func init() {
"AAAA",
"CAA",
"TLSA",
"ANY",
}
FILERequestDoc.Type = "file.Request"
@ -938,7 +958,7 @@ func init() {
Value: "Raw contains the raw file contents",
},
}
FILERequestDoc.Fields = make([]encoder.Doc, 5)
FILERequestDoc.Fields = make([]encoder.Doc, 7)
FILERequestDoc.Fields[0].Name = "extensions"
FILERequestDoc.Fields[0].Type = "[]string"
FILERequestDoc.Fields[0].Note = ""
@ -965,11 +985,21 @@ func init() {
FILERequestDoc.Fields[3].Comments[encoder.LineComment] = "MaxSize is the maximum size of the file to run request on."
FILERequestDoc.Fields[3].AddExample("", "5Mb")
FILERequestDoc.Fields[4].Name = "no-recursive"
FILERequestDoc.Fields[4].Name = "archive"
FILERequestDoc.Fields[4].Type = "bool"
FILERequestDoc.Fields[4].Note = ""
FILERequestDoc.Fields[4].Description = "NoRecursive specifies whether to not do recursive checks if folders are provided."
FILERequestDoc.Fields[4].Comments[encoder.LineComment] = "NoRecursive specifies whether to not do recursive checks if folders are provided."
FILERequestDoc.Fields[4].Description = "elaborates archives"
FILERequestDoc.Fields[4].Comments[encoder.LineComment] = "elaborates archives"
FILERequestDoc.Fields[5].Name = "mime-type"
FILERequestDoc.Fields[5].Type = "bool"
FILERequestDoc.Fields[5].Note = ""
FILERequestDoc.Fields[5].Description = "enables mime types check"
FILERequestDoc.Fields[5].Comments[encoder.LineComment] = "enables mime types check"
FILERequestDoc.Fields[6].Name = "no-recursive"
FILERequestDoc.Fields[6].Type = "bool"
FILERequestDoc.Fields[6].Note = ""
FILERequestDoc.Fields[6].Description = "NoRecursive specifies whether to not do recursive checks if folders are provided."
FILERequestDoc.Fields[6].Comments[encoder.LineComment] = "NoRecursive specifies whether to not do recursive checks if folders are provided."
NETWORKRequestDoc.Type = "network.Request"
NETWORKRequestDoc.Comments[encoder.LineComment] = " Request contains a Network protocol request to be made from a template"

View File

@ -321,7 +321,7 @@ type Options struct {
// Uncover search limit
UncoverLimit int
// Uncover search delay
UncoverDelay int
UncoverRateLimit int
// ScanAllIPs associated to a dns record
ScanAllIPs bool
// IPVersion to scan (4,6)