@@ -42,8 +42,8 @@ func ReportSubcommandCheckFlags(reportCommand flag.FlagSet, reportTargetPtr *str
4242 reportPortsPtr * string , reportCommonPtr * bool , reportVirusTotalPtr * bool , reportSubdomainDBPtr * bool ,
4343 startPort int , endPort int , reportIgnoreDirPtr * string ,
4444 reportIgnoreSubPtr * string , reportTimeoutPort * int ,
45- reportOutputJSON * string , reportOutputHTML * string , reportOutputTXT * string ) ( int , int ,
46- []int , bool , []string , []string ) {
45+ reportOutputJSON , reportOutputHTML , reportOutputTXT , reportUserAgentPtr * string ,
46+ reportRandomUserAgentPtr * bool ) ( int , int , []int , bool , []string , []string ) {
4747 // Required Flags
4848 if * reportTargetPtr == "" {
4949 reportCommand .PrintDefaults ()
@@ -142,6 +142,11 @@ func ReportSubcommandCheckFlags(reportCommand flag.FlagSet, reportTargetPtr *str
142142 os .Exit (1 )
143143 }
144144
145+ if * reportUserAgentPtr != DefaultUserAgent && * reportRandomUserAgentPtr {
146+ fmt .Println ("You cannot specify both ua and rua." )
147+ os .Exit (1 )
148+ }
149+
145150 return startPort , endPort , portsArray , portArrayBool , reportIgnoreDir , reportIgnoreSub
146151}
147152
@@ -189,7 +194,8 @@ func DNSSubcommandCheckFlags(dnsCommand flag.FlagSet, dnsTargetPtr, dnsOutputJSO
189194func SubdomainSubcommandCheckFlags (subdomainCommand flag.FlagSet , subdomainTargetPtr * string ,
190195 subdomainNoCheckPtr * bool , subdomainDBPtr * bool , subdomainWordlistPtr * string ,
191196 subdomainIgnorePtr * string , subdomainCrawlerPtr * bool , subdomainVirusTotalPtr * bool ,
192- subdomainOutputJSON , subdomainOutputHTML , subdomainOutputTXT * string ) []string {
197+ subdomainOutputJSON , subdomainOutputHTML , subdomainOutputTXT , subdomainUserAgentPtr * string ,
198+ subdomainRandomUserAgentPtr * bool ) []string {
193199 // Required Flags
194200 if * subdomainTargetPtr == "" {
195201 subdomainCommand .PrintDefaults ()
@@ -258,6 +264,11 @@ func SubdomainSubcommandCheckFlags(subdomainCommand flag.FlagSet, subdomainTarge
258264 subdomainIgnore = utils .CheckIgnore (toBeIgnored )
259265 }
260266
267+ if * subdomainUserAgentPtr != DefaultUserAgent && * subdomainRandomUserAgentPtr {
268+ fmt .Println ("You cannot specify both ua and rua." )
269+ os .Exit (1 )
270+ }
271+
261272 return subdomainIgnore
262273}
263274
@@ -352,7 +363,8 @@ func PortSubcommandCheckFlags(portCommand flag.FlagSet, portTargetPtr *string, p
352363// DirSubcommandCheckFlags performs all the necessary checks on the flags
353364// for the dir subcommand.
354365func DirSubcommandCheckFlags (dirCommand flag.FlagSet , dirTargetPtr * string ,
355- dirIgnorePtr * string , dirOutputJSON , dirOutputHTML , dirOutputTXT * string ) []string {
366+ dirIgnorePtr * string , dirOutputJSON , dirOutputHTML , dirOutputTXT , dirUserAgentPtr * string ,
367+ dirRandomUserAgentPtr * bool ) []string {
356368 // Required Flags
357369 if * dirTargetPtr == "" {
358370 dirCommand .PrintDefaults ()
@@ -394,5 +406,10 @@ func DirSubcommandCheckFlags(dirCommand flag.FlagSet, dirTargetPtr *string,
394406 dirIgnore = utils .CheckIgnore (toBeIgnored )
395407 }
396408
409+ if * dirUserAgentPtr != DefaultUserAgent && * dirRandomUserAgentPtr {
410+ fmt .Println ("You cannot specify both ua and rua." )
411+ os .Exit (1 )
412+ }
413+
397414 return dirIgnore
398415}
0 commit comments