D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
blackhat.pw
:
/
kunden
/
kunden
/
lib
/
susshi
/
exec
/
Filename :
wp-muplugin-sha256
back
Copy
#!/usr/bin/perl use warnings; use strict; use lib '/usr/lib/susshi/exec'; use Susshi; use Digest::SHA; my $susshi = Susshi->new( -read_input => 1 ); my $docroot = $susshi->get_directory( 'docroot', -mandatory => 1, -must_exist => 1 ); my $filename = $susshi->{filename} // ''; $filename or error_die "Missing 'filename' value"; $filename =~ /^[-_a-zA-Z0-9.]+$/ or error_die "filename does not pass check: $filename"; $filename =~ /\.\./ and error_die "filename does not pass check: $filename"; my $target_file = "$docroot/wp-content/mu-plugins/$filename"; -e $target_file or error_die "File does not exist: $target_file"; -f $target_file or error_die "Not a regular file: $target_file"; -o $target_file or error_die "Owner of $target_file is not $<"; my $sha = Digest::SHA->new(256); $sha->addfile($target_file); my $checksum = $sha->hexdigest; info("sha256 $target_file: $checksum"); send_json_output({ sha256 => $checksum });