Ice3man 2022-12-07 22:28:45 +05:30
parent ccfa249f14
commit b95501e641
5 changed files with 10 additions and 7 deletions

View File

@ -30,6 +30,7 @@ func main() {
return nil
}
pathIndex := path[strings.Index(path, "nuclei-templates/")+17:]
pathIndex = strings.TrimPrefix(pathIndex, "nuclei-templates/")
// Ignore items starting with dots
if strings.HasPrefix(pathIndex, ".") {
return nil

View File

@ -294,7 +294,7 @@ on extensive configurability, massive extensibility and ease of use.`)
flagSet.CreateGroup("cloud", "Cloud",
flagSet.BoolVar(&options.Cloud, "cloud", false, "run scan on nuclei cloud"),
flagSet.StringVarEnv(&options.CloudURL, "cloud-server", "cs", "http://cloud-dev.nuclei.sh", "NUCLEI_CLOUD_SERVER", "nuclei cloud server to use (NUCLEI_CLOUD_SERVER)"),
flagSet.StringVarEnv(&options.CloudURL, "cloud-server", "cs", "https://cloud-dev.nuclei.sh", "NUCLEI_CLOUD_SERVER", "nuclei cloud server to use (NUCLEI_CLOUD_SERVER)"),
flagSet.StringVarEnv(&options.CloudAPIKey, "cloud-api-key", "ak", "", "NUCLEI_CLOUD_APIKEY", "api-key for the nuclei cloud server (NUCLEI_CLOUD_APIKEY)"),
flagSet.BoolVarP(&options.ScanList, "list-scan", "ls", false, "list previous cloud scans"),
flagSet.BoolVarP(&options.NoStore, "no-store", "ns", false, "disable scan/output storage on cloud"),

View File

@ -85,9 +85,9 @@ func (r *Runner) runCloudEnumeration(store *loader.Store, nostore bool) (*atomic
// TODO: Add payload file and workflow support for private templates
catalogChecksums := nucleicloud.ReadCatalogChecksum()
targets := make([]*contextargs.MetaInput, 0, r.hmapInputProvider.Count())
targets := make([]string, 0, r.hmapInputProvider.Count())
r.hmapInputProvider.Scan(func(value *contextargs.MetaInput) bool {
targets = append(targets, value)
targets = append(targets, value.Input)
return true
})
templates := make([]string, 0, len(store.Templates()))

View File

@ -2,14 +2,12 @@ package nucleicloud
import (
"time"
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/contextargs"
)
// AddScanRequest is a nuclei scan input item.
type AddScanRequest struct {
// RawTargets is a list of raw target URLs for the scan.
RawTargets []*contextargs.MetaInput `json:"raw_targets,omitempty"`
RawTargets []string `json:"raw_targets,omitempty"`
// PublicTemplates is a list of public templates for the scan
PublicTemplates []string `json:"public_templates,omitempty"`
// PrivateTemplates is a map of template-name->contents that

View File

@ -30,7 +30,11 @@ func ReadCatalogChecksum() map[string]string {
if len(text) < 2 {
continue
}
checksums[text[0]] = text[1]
path := strings.TrimPrefix(text[0], "nuclei-templates/")
if strings.HasPrefix(path, ".") {
continue
}
checksums[path] = text[1]
}
return checksums
}