| 1 | package inputscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/ |
| 2 | |
| 3 | import ( |
| 4 | "bytesscip-go gomod github.com/golang/go/src go1.18 bytes/" |
| 5 | "osscip-go gomod github.com/golang/go/src go1.18 os/" |
| 6 | "os/execscip-go gomod github.com/golang/go/src go1.18 `os/exec`/" |
| 7 | "strconvscip-go gomod github.com/golang/go/src go1.18 strconv/" |
| 8 | |
| 9 | "github.com/ffuf/ffuf/v2/pkg/ffufscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/ffuf`/" |
| 10 | ) |
| 11 | |
| 12 | type CommandInputscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput# struct { |
| 13 | configscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#config. *ffufscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/ffuf`/.Configscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/ffuf`/Config# |
| 14 | countscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#count. int |
| 15 | activescip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#active. bool |
| 16 | keywordscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#keyword. string |
| 17 | commandscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#command. string |
| 18 | shellscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#shell. string |
| 19 | } |
| 20 | |
| 21 | func NewCommandInputscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/NewCommandInput().(keyword string, value string, conf *ffufscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/ffuf`/.Configscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/ffuf`/Config#) (*CommandInputscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#, error) { |
| 22 | var cmd CommandInputscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput# |
| 23 | cmd.activescip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#active. = true |
| 24 | cmd.keywordscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#keyword. = keyword |
| 25 | cmd.configscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#config. = conf |
| 26 | cmd.countscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#count. = 0 |
| 27 | cmd.commandscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#command. = value |
| 28 | cmd.shellscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#shell. = SHELL_CMDscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/SHELL_CMD. |
| 29 | |
| 30 | if cmd.configscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#config..InputShellscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/ffuf`/Config#InputShell. != "" { |
| 31 | cmd.shellscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#shell. = cmd.configscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#config..InputShellscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/ffuf`/Config#InputShell. |
| 32 | } |
| 33 | |
| 34 | return &cmd, nil |
| 35 | } |
| 36 | |
| 37 | // Keyword returns the keyword assigned to this InternalInputProvider |
| 38 | func (c *CommandInputscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#) Keywordscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#Keyword().() string { |
| 39 | return c.keywordscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#keyword. |
| 40 | } |
| 41 | |
| 42 | // Position will return the current position in the input list |
| 43 | func (c *CommandInputscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#) Positionscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#Position().() int { |
| 44 | return c.countscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#count. |
| 45 | } |
| 46 | |
| 47 | // SetPosition will set the current position of the inputprovider |
| 48 | func (c *CommandInputscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#) SetPositionscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#SetPosition().(pos int) { |
| 49 | c.countscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#count. = pos |
| 50 | } |
| 51 | |
| 52 | // ResetPosition will reset the current position of the InternalInputProvider |
| 53 | func (c *CommandInputscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#) ResetPositionscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#ResetPosition().() { |
| 54 | c.countscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#count. = 0 |
| 55 | } |
| 56 | |
| 57 | // IncrementPosition increments the current position in the inputprovider |
| 58 | func (c *CommandInputscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#) IncrementPositionscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#IncrementPosition().() { |
| 59 | c.countscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#count. += 1 |
| 60 | } |
| 61 | |
| 62 | // Next will increment the cursor position, and return a boolean telling if there's iterations left |
| 63 | func (c *CommandInputscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#) Nextscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#Next().() bool { |
| 64 | return c.countscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#count. < c.configscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#config..InputNumscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/ffuf`/Config#InputNum. |
| 65 | } |
| 66 | |
| 67 | // Value returns the input from command stdoutput |
| 68 | func (c *CommandInputscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#) Valuescip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#Value().() []byte { |
| 69 | var stdout bytesscip-go gomod github.com/golang/go/src go1.18 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.18 bytes/Buffer# |
| 70 | osscip-go gomod github.com/golang/go/src go1.18 os/.Setenvscip-go gomod github.com/golang/go/src go1.18 os/Setenv().("FFUF_NUM", strconvscip-go gomod github.com/golang/go/src go1.18 strconv/.Itoascip-go gomod github.com/golang/go/src go1.18 strconv/Itoa().(c.countscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#count.)) |
| 71 | cmd := execscip-go gomod github.com/golang/go/src go1.18 `os/exec`/.Commandscip-go gomod github.com/golang/go/src go1.18 `os/exec`/Command().(c.shellscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#shell., SHELL_ARGscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/SHELL_ARG., c.commandscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#command.) |
| 72 | cmd.Stdoutscip-go gomod github.com/golang/go/src go1.18 `os/exec`/Cmd#Stdout. = &stdout |
| 73 | err := cmd.Runscip-go gomod github.com/golang/go/src go1.18 `os/exec`/Cmd#Run().() |
| 74 | if err != nil { |
| 75 | return []byte("") |
| 76 | } |
| 77 | return stdout.Bytesscip-go gomod github.com/golang/go/src go1.18 bytes/Buffer#Bytes().() |
| 78 | } |
| 79 | |
| 80 | // Total returns the size of wordlist |
| 81 | func (c *CommandInputscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#) Totalscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#Total().() int { |
| 82 | return c.configscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#config..InputNumscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/ffuf`/Config#InputNum. |
| 83 | } |
| 84 | |
| 85 | func (c *CommandInputscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#) Activescip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#Active().() bool { |
| 86 | return c.activescip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#active. |
| 87 | } |
| 88 | |
| 89 | func (c *CommandInputscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#) Enablescip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#Enable().() { |
| 90 | c.activescip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#active. = true |
| 91 | } |
| 92 | |
| 93 | func (c *CommandInputscip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#) Disablescip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#Disable().() { |
| 94 | c.activescip-go gomod github.com/ffuf/ffuf/v2 . `github.com/ffuf/ffuf/v2/pkg/input`/CommandInput#active. = false |
| 95 | } |