Jump to content
  • Entries

    16114
  • Comments

    7952
  • Views

    86395334

Contributors to this blog

  • HireHackking 16114

About this blog

Hacking techniques include penetration testing, network security, reverse cracking, malware analysis, vulnerability exploitation, encryption cracking, social engineering, etc., used to identify and fix security flaws in systems.

0x00 前言本文記錄從零開始搭建F5 BIG-IP漏洞調試環境的細節。

0x01 簡介本文將要介紹以下內容:

F5 BIG-IP安裝

F5 BIG-IP漏洞調試環境配置

常用知識

0x02 F5 BIG-IP安裝1.下載OVA文件下載頁面:https://downloads.f5.com/esd/productlines.jsp

下載前需要先註冊用戶併申請激活碼,申請地址:http://www.f5.com/trial

2.安裝(1)在VMware Workstation中導入OVA文件

(2)設置用戶名口令

導入虛擬機後,需要輸入默認用戶名(root)和默認口令(deault),接著需要重設root用戶和admin用戶的口令

(3)配置

輸入ifconfig獲得IP,訪問https://ip ,使用admin用戶的憑據進行登錄

在配置頁面填入激活碼

在配置頁面可以配置開啟ssh允許通過ssh登錄

0x03 F5 BIG-IP漏洞調試環境配置配置文件的定位參考《CVE-2022-1388 F5 BIG-IP iControl REST 处理进程分析与认证绕过漏洞复现》

1.定位java進程查看進程:

psaux|grepjava如下圖

0e25481e601806d5a6a351e6e9de61b.png

定位進程pid 6324,jar包路徑/usr/share/java/rest

查看pid 6324的進程信息:

image.png

如下圖

522c09c544118cd8c3a780d50d2bbd2.png

定位文件/etc/bigstart/scripts/restjavad

修改JVM_OPTIONS,添加調試參數-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000

2.定位服務查看所有服務的狀態:

systemctlstatus找到pid 6324對應的服務名稱runit.service

添加調試參數後需要重啟服務:

servicerunit.servicerestart查看參數是否修改:

psaux|grep8000如下圖

85dc2a39450cb5d3b70c0f97d911528.png

3.開啟防火牆在Web管理面板,依次選擇System - Platform - Security

添加規則,如下圖

3e86a25cf33071fd5c00afa2cea75ea.png

遠程調試成功,如下圖

a7cca7943be08e383a782521f06a5c0.png

使用tmsh查看防火牆規則,參考

https://clouddocs.f5.com/cli/tmsh-reference/v15/modules/security/security_firewall_management-ip-rules.html

命令如下:

tmsh-c'list/securityfirewallmanagement-ip-rules'結果如下圖

63e0d996830ebe51a932a38deb288c0.png

4.常用jar包位置/usr/local/www/tmui/WEB-INF/lib/

/usr/share/java/rest

0x04 常用知識1.tmsh用法參考資料:

https://clouddocs.f5.com/api/tmsh/

https://clouddocs.f5.com/cli/tmsh-reference/latest/

(1)查看版本

tmshshow/sysversion(2)查看所有配置

分步操作:

tmsh

listall-properties

y一鍵操作:

echoy|tmsh-c'listall-properties'(3)查看用戶信息

分步操作:

tmsh

listauth一鍵操作:

tmsh-c'listauth'(4)創建管理員用戶(web和ssh登錄)

參考:https://clouddocs.f5.com/cli/tmsh-reference/v15/modules/auth/auth_user.html

分步操作:

tmsh

createauthuseruser123passwordaaaaaaa1234description'AdminUser'shellbashpartition-accessadd{all-partitions{roleadmin}}需要注意口令不能存在特殊字符

一鍵操作:

tmsh-c'createauthuseruser123passwordaaaaaaa1234description'AdminUser'shellbashpartition-accessadd{all-partitions{roleadmin}}'(5)刪除用戶

分步操作:

tmsh

deleteauthusertest1一鍵操作:

tmsh-c'deleteauthusertest1'2.使用REST API執行命令需要管理員用戶名口令

訪問https://url /mgmt/tm/util/bash

能夠執行bash命令,獲得返回結果

代碼已上傳至github,地址如下:

https://github.com/3gstudent/Homework-of-Python/blob/master/BIG-IP_RunBash.py

3.日誌相關(1)搜索帶有指定關鍵詞的日誌

grep-iRaaaaaaaa/var/log/(2)web管理後台同日誌文件的對應關係

審計日誌,位置System -Logs - audit,對應文件/var/log/audit

用戶登錄歷史記錄,位置Logins - History,對應文件/var/log/secure

(3)其他日誌位置

/var/log/restjavad-audit.0.log

/var/log/auditd/audit.log

/var/log/btmp

/var/log/wtmp

/var/log/lastlog

(4)查看web訪問日誌

journalctl/usr/bin/logger清除所有:

rm-rf/var/log/journal/*

systemctlrestartsystemd-journald0x05 小結在我們搭建好F5 BIG-IP漏洞調試環境後,接下來就可以著手對漏洞進行學習。