-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the new Django_DEBUG.pm file (#78)
* Sync (#67) * new module to identify technologies from a web page * added https string * added trigger based on pull request * Add the new Django_DEBUG.pm file --------- Co-authored-by: Heitor Gouvêa <[email protected]>
- Loading branch information
1 parent
e3b3c67
commit ba9d3e7
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |