Projects STRLCPY afrog Commits 6285107c
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    internal/runner/runner.go
    skipped 63 lines
    64 64   // console print
    65 65   fmt.Println(log.LogColor.Info("指定脚本 " + options.PocsFilePath))
    66 66   }
     67 + 
    67 68   allPocsYamlSlice := runner.catalog.GetPocsPath(options.PocsDirectory)
     69 + 
    68 70   if len(allPocsYamlSlice) == 0 {
    69 71   return errors.New("未找到可执行脚本(POC),请检查`默认脚本`或指定新の脚本(POC)")
    70 72   }
    skipped 16 lines
  • ■ ■ ■ ■ ■ ■
    pkg/catalog/path.go
    skipped 7 lines
    8 8   "github.com/pkg/errors"
    9 9  )
    10 10   
    11  -// ResolvePath resolves the path to an absolute one in various ways.
    12  -//
    13  -// It checks if the filename is an absolute path, looks in the current directory
    14  -// or checking the nuclei pocs directory. If a second path is given,
    15  -// it also tries to find paths relative to that second path.
    16 11  func (c *Catalog) ResolvePath(pocName, second string) (string, error) {
    17 12   if filepath.IsAbs(pocName) {
    18 13   return pocName, nil
    skipped 11 lines
    30 25   }
    31 26   
    32 27   pocPath := filepath.Join(curDirectory, pocName)
    33  - if potentialPath, err := c.tryResolve(pocPath); err != errNoValidCombination {
    34  - return potentialPath, nil
     28 + if len(pocPath) > 0 {
     29 + return pocPath, nil
    35 30   }
     31 + // if potentialPath, err := c.tryResolve(pocPath); err != errNoValidCombination {
     32 + // return potentialPath, nil
     33 + // }
    36 34   
    37 35   if c.pocsDirectory != "" {
    38 36   pocPath := filepath.Join(c.pocsDirectory, pocName)
    39  - if potentialPath, err := c.tryResolve(pocPath); err != errNoValidCombination {
    40  - return potentialPath, nil
     37 + if len(pocPath) > 0 {
     38 + return pocPath, nil
    41 39   }
     40 + // if potentialPath, err := c.tryResolve(pocPath); err != errNoValidCombination {
     41 + // return potentialPath, nil
     42 + // }
    42 43   }
    43 44   return "", fmt.Errorf("no such path found: %s", pocName)
    44 45  }
    skipped 24 lines
Please wait...
Page is in error, reload to recover