diff --git a/lib/Spellbook/Exploit/Django_DEBUG.pm b/lib/Spellbook/Exploit/Django_DEBUG.pm new file mode 100755 index 0000000..38d9040 --- /dev/null +++ b/lib/Spellbook/Exploit/Django_DEBUG.pm @@ -0,0 +1,61 @@ +package Spellbook::Exploit::Django_DEBUG { + use strict; + use warnings; + use Spellbook::Core::UserAgent; + + sub new { + my ($self, $parameters) = @_; + my ($help, $target, @results); + + Getopt::Long::GetOptionsFromArray ( + $parameters, + "h|help" => \$help, + "t|target=s" => \$target + ); + + if ($target){ + if ($target !~ /^http(s)?:\/\//){ + $target = "https://$target"; + } + + my $data = "foo=bar&instriq=io"; + + my $useragent = Spellbook::Core::UserAgent -> new (); + my @payloads = ( + "/instriqwashere", + "/api/instriqwashere", + "/api/v1/instriqwashere", + "/admin/instriqwashere", + "/admin/1" + ); + + foreach my $payload (@payloads) { + my $response = $useragent -> get($target . $payload); + + if ($response =~ /RuntimeError/) { + push @results, "$target has \"debug mode\" enabled! - [Method: GET]"; + } + + my $response_post = $useragent -> post($target . $payload, Content => $data); + + if ($response_post =~ /RuntimeError/) { + push @results, "$target has \"debug mode\" enabled! - [Method: POST]"; + } + } + + return @results + } + + if ($help) { + return (" + \rExploit::Django_DEBUG + \r======================= + \r-h, --help See this menu + \r-t, --target Define a target"); + } + + return 0; + } +} + +1; \ No newline at end of file