|
@@ -46,6 +46,7 @@ var (
|
|
requestsFile = flag.String("requests", "", "CSV file containing requests (IP and URL)")
|
|
requestsFile = flag.String("requests", "", "CSV file containing requests (IP and URL)")
|
|
protocol = flag.String("protocol", "http", "which protocol to parse: http or ajp13")
|
|
protocol = flag.String("protocol", "http", "which protocol to parse: http or ajp13")
|
|
useXForwardedAsSource = flag.Bool("use-x-forwarded", false, "Use the IP address in X-Forwarded-For as source")
|
|
useXForwardedAsSource = flag.Bool("use-x-forwarded", false, "Use the IP address in X-Forwarded-For as source")
|
|
|
|
+ useVhostAsSource = flag.Bool("use-vhost-as-source", false, "Use the Vhost as source")
|
|
trace = flag.Bool("trace", false, "Trace the packet capturing")
|
|
trace = flag.Bool("trace", false, "Trace the packet capturing")
|
|
apacheLog = flag.String("apache-log", "", "Parse an Apache Log file")
|
|
apacheLog = flag.String("apache-log", "", "Parse an Apache Log file")
|
|
apacheReplay = flag.String("apache-replay", "", "Apache log file to replay into the system")
|
|
apacheReplay = flag.String("apache-replay", "", "Apache log file to replay into the system")
|
|
@@ -92,6 +93,7 @@ type Config struct {
|
|
SleepFor duration
|
|
SleepFor duration
|
|
RequestsFile string
|
|
RequestsFile string
|
|
UseXForwardedAsSource bool
|
|
UseXForwardedAsSource bool
|
|
|
|
+ UseVhostAsSource bool
|
|
Quiet bool
|
|
Quiet bool
|
|
Protocol string
|
|
Protocol string
|
|
Trace bool
|
|
Trace bool
|
|
@@ -139,6 +141,7 @@ func (c Config) print() {
|
|
fmt.Printf("HostName: %s\n", c.HostName)
|
|
fmt.Printf("HostName: %s\n", c.HostName)
|
|
fmt.Printf("AccessWatchKey: %s\n", c.AccessWatchKey)
|
|
fmt.Printf("AccessWatchKey: %s\n", c.AccessWatchKey)
|
|
fmt.Printf("UseXForwardedAsSource: %t\n", c.UseXForwardedAsSource)
|
|
fmt.Printf("UseXForwardedAsSource: %t\n", c.UseXForwardedAsSource)
|
|
|
|
+ fmt.Printf("UseVhostAsSource: %t\n", c.UseVhostAsSource)
|
|
fmt.Printf("Protocol: %s\n", c.Protocol)
|
|
fmt.Printf("Protocol: %s\n", c.Protocol)
|
|
fmt.Printf("Reset Live Cap After: %s\n", c.ResetLiveCaptureAfter.String())
|
|
fmt.Printf("Reset Live Cap After: %s\n", c.ResetLiveCaptureAfter.String())
|
|
fmt.Printf("RPCAddress: %s\n", c.RPCAddress)
|
|
fmt.Printf("RPCAddress: %s\n", c.RPCAddress)
|
|
@@ -769,6 +772,7 @@ func loadConfig() {
|
|
config.SleepFor.Duration = *sleepFor
|
|
config.SleepFor.Duration = *sleepFor
|
|
config.RequestsFile = *requestsFile
|
|
config.RequestsFile = *requestsFile
|
|
config.UseXForwardedAsSource = *useXForwardedAsSource
|
|
config.UseXForwardedAsSource = *useXForwardedAsSource
|
|
|
|
+ config.UseVhostAsSource = *useVhostAsSource
|
|
config.Protocol = *protocol
|
|
config.Protocol = *protocol
|
|
config.ApacheLog = *apacheLog
|
|
config.ApacheLog = *apacheLog
|
|
config.ApacheReplay = *apacheReplay
|
|
config.ApacheReplay = *apacheReplay
|