Skip to content

Commit

Permalink
drafting support to proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
htrgouvea committed Oct 27, 2023
1 parent c543ca9 commit 9d63b07
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
13 changes: 9 additions & 4 deletions lib/Engine/Fuzzer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -46,4 +51,4 @@ package Engine::Fuzzer {
}
}

1; #
1;
4 changes: 2 additions & 2 deletions lib/Engine/FuzzerThread.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions lib/Engine/Orchestrator.pm
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ package Engine::Orchestrator {
$options{skipssl},
$options{length},
$options{content},
$options{proxy},
\&add_target
);
}
Expand Down
1 change: 1 addition & 0 deletions lib/Functions/Helper.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions nozaki.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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 => "*/*",
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9d63b07

Please sign in to comment.