Skip to content

Commit

Permalink
Merge pull request #607 from hahwul/improve-cmd
Browse files Browse the repository at this point in the history
Add Args struct to cmd package for command-line argument handling
  • Loading branch information
hahwul authored Dec 9, 2024
2 parents fb1819b + 2b1b0be commit 138ada5
Show file tree
Hide file tree
Showing 6 changed files with 197 additions and 148 deletions.
57 changes: 57 additions & 0 deletions cmd/args.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package cmd

type Args struct {
Header []string
P []string
IgnoreParams []string
Config string
Cookie string
Data string
CustomPayload string
CustomAlertValue string
CustomAlertType string
UserAgent string
Blind string
Output string
Format string
FoundAction string
FoundActionShell string
Proxy string
Grep string
IgnoreReturn string
MiningWord string
Method string
CookieFromRaw string
RemotePayloads string
RemoteWordlists string
OnlyPoC string
PoCType string
ReportFormat string
HarFilePath string
Timeout int
Delay int
Concurrence int
OnlyDiscovery bool
Silence bool
Mining bool
FindingDOM bool
FollowRedirect bool
NoColor bool
NoSpinner bool
UseBAV bool
SkipBAV bool
SkipMiningDom bool
SkipMiningDict bool
SkipMiningAll bool
SkipXSSScan bool
OnlyCustomPayload bool
SkipGrep bool
Debug bool
SkipHeadless bool
UseDeepDXSS bool
OutputAll bool
WAFEvasion bool
ReportBool bool
OutputRequest bool
OutputResponse bool
}
24 changes: 12 additions & 12 deletions cmd/payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ func initializeObjects() []Object {

func init() {
rootCmd.AddCommand(payloadCmd)
payloadCmd.Flags().BoolVar(&makeBulk, "make-bulk", false, "Make bulk payloads for stored xss")
payloadCmd.Flags().BoolVar(&enumCommon, "enum-common", false, "Enumerate a common xss payloads")
payloadCmd.Flags().BoolVar(&enumHTML, "enum-html", false, "Enumerate a in-html xss payloads")
payloadCmd.Flags().BoolVar(&enumAttr, "enum-attr", false, "Enumerate a in-attr xss payloads")
payloadCmd.Flags().BoolVar(&enumInJS, "enum-injs", false, "Enumerate a in-js xss payloads")
payloadCmd.Flags().BoolVar(&remotePayloadbox, "remote-payloadbox", false, "Enumerate a payloadbox's xss payloads")
payloadCmd.Flags().BoolVar(&remotePortswigger, "remote-portswigger", false, "Enumerate a portswigger xss cheatsheet payloads")
payloadCmd.Flags().BoolVar(&entityGF, "entity-gf", false, "Enumerate a gf-patterns xss params")
payloadCmd.Flags().BoolVar(&entityEventHandler, "entity-event-handler", false, "Enumerate a event handlers for xss")
payloadCmd.Flags().BoolVar(&entityUsefulTags, "entity-useful-tags", false, "Enumerate a useful tags for xss")
payloadCmd.Flags().BoolVar(&entitySpecialChars, "entity-special-chars", false, "Enumerate a special chars for xss")
payloadCmd.Flags().BoolVar(&urlEncode, "encoder-url", false, "Encoding output [URL]")
payloadCmd.Flags().BoolVar(&makeBulk, "make-bulk", false, "Generate bulk payloads for stored XSS. Example: --make-bulk")
payloadCmd.Flags().BoolVar(&enumCommon, "enum-common", false, "Enumerate common XSS payloads. Example: --enum-common")
payloadCmd.Flags().BoolVar(&enumHTML, "enum-html", false, "Enumerate in-HTML XSS payloads. Example: --enum-html")
payloadCmd.Flags().BoolVar(&enumAttr, "enum-attr", false, "Enumerate in-attribute XSS payloads. Example: --enum-attr")
payloadCmd.Flags().BoolVar(&enumInJS, "enum-injs", false, "Enumerate in-JavaScript XSS payloads. Example: --enum-injs")
payloadCmd.Flags().BoolVar(&remotePayloadbox, "remote-payloadbox", false, "Enumerate payloads from Payloadbox's XSS payloads. Example: --remote-payloadbox")
payloadCmd.Flags().BoolVar(&remotePortswigger, "remote-portswigger", false, "Enumerate payloads from PortSwigger's XSS cheatsheet. Example: --remote-portswigger")
payloadCmd.Flags().BoolVar(&entityGF, "entity-gf", false, "Enumerate parameters from GF-Patterns for XSS. Example: --entity-gf")
payloadCmd.Flags().BoolVar(&entityEventHandler, "entity-event-handler", false, "Enumerate event handlers for XSS. Example: --entity-event-handler")
payloadCmd.Flags().BoolVar(&entityUsefulTags, "entity-useful-tags", false, "Enumerate useful tags for XSS. Example: --entity-useful-tags")
payloadCmd.Flags().BoolVar(&entitySpecialChars, "entity-special-chars", false, "Enumerate special characters for XSS. Example: --entity-special-chars")
payloadCmd.Flags().BoolVar(&urlEncode, "encoder-url", false, "Encode output as URL. Example: --encoder-url")
}
8 changes: 4 additions & 4 deletions cmd/pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ func runSingleMode(targets []string, sf bool) {

func init() {
rootCmd.AddCommand(pipeCmd)
pipeCmd.Flags().Bool("multicast", false, "Parallel scanning N*Host mode (show only poc code)")
pipeCmd.Flags().Bool("mass", false, "Parallel scanning N*Host mode (show only poc code)")
pipeCmd.Flags().Bool("silence-force", false, "Only print PoC (not print progress)")
pipeCmd.Flags().Int("mass-worker", 10, "Parallel worker of --mass and --multicast option")
pipeCmd.Flags().Bool("multicast", false, "Enable parallel scanning in N*Host mode (only shows PoC code). Example: --multicast")
pipeCmd.Flags().Bool("mass", false, "Enable parallel scanning in N*Host mode (only shows PoC code). Example: --mass")
pipeCmd.Flags().Bool("silence-force", false, "Only print PoC code, suppress progress output. Example: --silence-force")
pipeCmd.Flags().Int("mass-worker", 10, "Set the number of parallel workers for --mass and --multicast options. Example: --mass-worker 10")
}
Loading

0 comments on commit 138ada5

Please sign in to comment.