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

TeamCity 2017.1.5 Privilege Escalation

TeamCity 2017.1.5 Privilege Escalation
Posted Dec 10, 2017
Authored by Heliand Dema

TeamCity version 2017.1.5 suffers from a local privilege escalation vulnerability due to weak file permissions.

tags | exploit, local
SHA-256 | 0913f2e23a971d20e093097a088ef441a13e947630d443ec627bcc5a4b0cdb61

TeamCity 2017.1.5 Privilege Escalation

Change Mirror Download
TeamCity 2017.1.5 - Weak file permissions - Privilege Escalation

=====================================================

# Vendor Homepage: http://www.jetbrains.com
# Date: 17 Oct 2017
# Version : TeamCity Version: 2017.1.5 Build: 47175
# Tested on: Windows 7 Ultimate SP1 (EN) and Windows 10 x64
# Author: Heliand Dema
# Contact: heliand@cyber.al
=====================================================

Teamcity installs two services called 'TCBuildAgent' and
'TeamCityService' with weak file permission running with SYSTEM privileges.
Services configured to use an executable with weak permissions are
vulnerable to privilege escalation attacks.
An unprivileged user could modify or overwrite the executable with
arbitrary code, which would be executed the next time the service is
started. Depending on the user that the service runs as, this could
result in privilege escalation.

>sc qc TCBuildAgent
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: TCBuildAgent
TYPE : 110 WIN32_OWN_PROCESS (interactive)
START_TYPE : 2 AUTO_START
ERROR_CONTROL : 1 NORMAL
BINARY_PATH_NAME :
c:\TeamCity\buildAgent\launcher\bin\TeamCityAgentService-windows-x86-32.exe
-s c:\TeamCity\buildAgent\launcher\conf\wrapper.conf
LOAD_ORDER_GROUP :
TAG : 0
DISPLAY_NAME : TeamCity Build Agent
DEPENDENCIES :
SERVICE_START_NAME : LocalSystem


>icacls.exe
c:\TeamCity\buildAgent\launcher\bin\TeamCityAgentService-windows-x86-32.exe

BUILTIN\Administrators:(I)(F)
NT AUTHORITY\SYSTEM:(I)(F)
BUILTIN\Users:(I)(RX)
Modify --- > NT AUTHORITY\Authenticated Users:(I)(M)

>icacls.exe c:\TeamCity\bin\TeamCityService.exe

BUILTIN\Administrators:(I)(F)
NT AUTHORITY\SYSTEM:(I)(F)
BUILTIN\Users:(I)(RX)
Modify --- > NT AUTHORITY\Authenticated Users:(I)(M)

Notice the line: NT AUTHORITY\Authenticated Users:(I)(M) which lists the
permissions for authenticated however unprivileged users.
The (M) stands for Modify, which grants an unprivileged user the ability
to read, write and delete files and subfolders within this folder.


====Proof-of-Concept====

To properly exploit this vulnerability, the local attacker must insert
an executable file called TeamCityAgentService-windows-x86-32.exe or
TeamCityService.exe and replace the original file. Next time service
starts the malicious file will get executed as SYSTEM.


Disclosure Timeline:
=============================Vendor Notification: 17 Oct 2017
Vendor reply "under investigation" : 17 Oct 2017
Vendor asked for additional information: 20 Oct 2017
Additional info provided: 20 Oct 2017
Vendor acknowledgement of issue : 8 Nov 2017
Fix released as version 2017.2 : 27 Nov 2017
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
    16 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