diff --git a/lib/Engine/Fuzzer.pm b/lib/Engine/Fuzzer.pm index e103eed..f509f69 100755 --- a/lib/Engine/Fuzzer.pm +++ b/lib/Engine/Fuzzer.pm @@ -5,13 +5,18 @@ package Engine::Fuzzer { use Mojo::UserAgent; sub new { - my ($self, $timeout, $headers, $skipssl, $content) = @_; + my ($self, $timeout, $headers, $skipssl, $proxy) = @_; my $userAgent = Mojo::UserAgent -> new() -> request_timeout($timeout) -> insecure($skipssl); - + + if ($proxy) { + $userAgent -> proxy -> http($proxy); + $userAgent -> proxy -> https($proxy); + } + bless { useragent => $userAgent, - headers => $headers + headers => $headers }, $self; } @@ -46,4 +51,4 @@ package Engine::Fuzzer { } } -1; # \ No newline at end of file +1; \ No newline at end of file diff --git a/lib/Engine/FuzzerThread.pm b/lib/Engine/FuzzerThread.pm index 72d7aaf..f87de03 100644 --- a/lib/Engine/FuzzerThread.pm +++ b/lib/Engine/FuzzerThread.pm @@ -9,14 +9,14 @@ package Engine::FuzzerThread { my ( $self, $queue, $target, $methods, $agent, $headers, $accept, $timeout, $return, $payload, $json, $delay, $exclude, $skipssl, - $length, $content, $dir_callback + $length, $content, $proxy ) = @_; my @verbs = split (/,/, $methods); my @valid_codes = split /,/, $return || ""; my @invalid_codes = split /,/, $exclude || ""; - my $fuzzer = Engine::Fuzzer -> new($timeout, $headers, $skipssl); + my $fuzzer = Engine::Fuzzer -> new($timeout, $headers, $skipssl, $proxy); my $format = JSON -> new() -> allow_nonref() -> pretty(); my $cmp; diff --git a/lib/Engine/Orchestrator.pm b/lib/Engine/Orchestrator.pm index a73141a..44c8d04 100644 --- a/lib/Engine/Orchestrator.pm +++ b/lib/Engine/Orchestrator.pm @@ -85,6 +85,7 @@ package Engine::Orchestrator { $options{skipssl}, $options{length}, $options{content}, + $options{proxy}, \&add_target ); } diff --git a/lib/Functions/Helper.pm b/lib/Functions/Helper.pm index 36725dc..cb93d93 100755 --- a/lib/Functions/Helper.pm +++ b/lib/Functions/Helper.pm @@ -26,6 +26,7 @@ package Functions::Helper { \r\t-S, --skip-ssl Ignore SSL verification \r\t-l, --length Filter by the length of content response \r\t-c, --content Filter by string based on the content response + \r\t-p, --proxy Send all requests through a proxy server \r\t-h, --help See this screen\n\n"; return 0; diff --git a/nozaki.pl b/nozaki.pl index 2a605ea..1dad94d 100755 --- a/nozaki.pl +++ b/nozaki.pl @@ -12,7 +12,7 @@ use Getopt::Long qw(:config no_ignore_case); sub main { - my ($workflow, $plugin, @targets); + my ($workflow, $proxy, @targets); my %options = ( accept => "*/*", @@ -43,7 +43,7 @@ sub main { "t|timeout=i" => \$options{timeout}, "u|url=s@" => \@targets, "l|length=s" => \$options{length}, - "p|plugin=s" => \$options{plugin} + "p|proxy=s" => \$options{proxy}, ); return Functions::Helper -> new() unless @targets;