-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(perl #133706) remove exploit code from Storable
Storable packaged the metasploit framework code for CVE-2015-1592, which triggered virus scanners. To prevent that remove the packaged exploit code and test for the underlying structure we trigger the warning on.
- Loading branch information
Showing
3 changed files
with
12 additions
and
275 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,22 +1,21 @@ | ||
#!/usr/bin/perl | ||
|
||
use strict; | ||
use warnings; | ||
use Test::More; | ||
use Storable qw(freeze thaw); | ||
plan tests => 1; | ||
|
||
use File::Temp qw(tempdir); | ||
use File::Spec; | ||
my $tmp_dir = tempdir(CLEANUP => 1); | ||
my $tmp_file = File::Spec->catfile($tmp_dir, 'sploit'); | ||
# this original worked with the packaged exploit, but that | ||
# triggers virus scanners, so test for the behaviour instead | ||
my $x = bless \(my $y = "mt-config.cgi"), "CGITempFile"; | ||
|
||
my $frozen = freeze($x); | ||
|
||
my $file = __FILE__; | ||
$file =~ s/\.t$/.inc/; | ||
my $inc = $ENV{PERL_CORE} ? "-Ilib -I../../lib" : "-I".join(" -I", @INC); | ||
system qq($^X $inc -w "$file" 2>$tmp_file); | ||
open(my $fh, "<", $tmp_file) or die "$tmp_file $!"; | ||
{ | ||
local $/; | ||
my $err = <$fh>; | ||
like($err, qr/SECURITY: Movable-Type CVE-2015-1592 Storable metasploit attack/, | ||
'Detect CVE-2015-1592'); | ||
my $warnings = ''; | ||
local $SIG{__WARN__} = sub { $warnings .= "@_" }; | ||
thaw($frozen); | ||
like($warnings, qr/SECURITY: Movable-Type CVE-2015-1592 Storable metasploit attack/, | ||
'Detect CVE-2015-1592'); | ||
} |