Upgrade to Pro — share decks privately, control downloads, hide ads and more …

OSEP取るまでにやったこと

takahoyo
May 05, 2023
1.2k

 OSEP取るまでにやったこと

「OSCP勉強会 in 秋葉原オフ会」のLTで話した際の資料です。
https://off-sec-lab.connpass.com/event/279745/

takahoyo

May 05, 2023
Tweet

Transcript

  1. OSEPとは? • Offsec社のペンテストの資格試験 • OSEP = OffSec Experienced Pentester •

    PEN-300トレーニングとセット • OSCP (PEN-200) の上位資格 2023/5/5 4 https://www.offsec.com/courses-and-certifications/
  2. PEN-300 2023/5/5 5 • テーマは Evasion Techniques and Breaching Defenses

    (回避手法と防御の突破) • Client Side Code Execution With Office • VBA Shellcode Runner / PowerShell Shellcode Runner • Client Side Code Execution With Windows Script Host • JScript • Process Injection and Migration • Process Injection • DLL Injection / Reflective DLL Injection • Process Hollowing • Introduction to Antivirus Evasion • Advanced Antivirus Evasion • AMSI Bypass / UAC Bypass • Application Whitelisting • AppLocker Bypass • Bypassing Network Filters • Linux Post-Exploitation • Windows Credentials • SAM / LAPS / Access Token / Kerberos Authentication / Credential Dump • Windows Lateral Movement • RDP / PsExec • Linux Lateral Movement • SSH / Ansible / Kerberos on Linux • Microsoft SQL Attacks • Active Directory Exploitation • AD Object ACL, Kerberos Delegation, Forest Evasion Techniques Lateral Movement
  3. PEN-200 vs PEN-300 (AD関連) 2023/5/5 6 PEN-200(OSCP) • Active Directory

    Enumeration • User, Group • SPN • Active Directory Attack • Credential Dump(NTLM Hash, Kerberos Ticket) • Kerberoasting • Password Spray • Pass the Hash • Over Pass the Hash • Pass the Ticket • DCOM • Golden Ticket • DCSync PEN-300(OSEP) • Active Directory Enumeration • ACL • Delegation • Trust (Forest) • Active Directory Attack • Object ACL Abuse • GenericAll, WriteDACL • Kerberos Delegation Abuse • Unconstrained • Constrained • Resource-based • Active Directory Forest Abuse • Multi-domain • Child-domain
  4. OSEP取得までにやったこと • PEN-300 申込み (90日コース) • ラボ(Challenges) をやりつつ、テキスト読む • 試験(1回目)

    • 自分で脆弱性のある環境を作って攻撃 • ラボ(Challenges)を1ヶ月延長 • 試験(2回目) 2023/5/5 7
  5. ラボ(Challenges) をやりつつ、テキスト読む • PEN-300のLabは、 Course Modules と Challenges に分かれている •

    Challenges は 全部で6問 • 1つのChallengeは、3~10台のマシンで構成 • Challengeには、トレーニング内容が盛り込まれていた(体感8割くらい) 2023/5/5 9
  6. ラボ(Challenges) をやりつつ、テキスト読む • わからない部分はテキストを読んだり、Course Moduleを起動して試す • (どうしてもわからない場合は)Discord (#pen-300-labs) で質問 •

    Challenges を通して、試験で使うプロシージャ、ツールを準備 • テキストに書かれているツールの改良 • OSEP Code Snippets ( https://github.com/chvancooten/OSEP-Code-Snippets ) にコードサンプルがある • 既製のOSSツールの検証 • BloodHound : https://github.com/BloodHoundAD/BloodHound • Rubeus: https://github.com/GhostPack/Rubeus • Chisel : https://github.com/jpillora/chisel • SQLRecon: https://github.com/skahwah/SQLRecon • など 2023/5/5 10
  7. OSEP試験 • 約48時間以内に、100点以上、もしくはsecret.txt 取得し、24時間以内に レポート提出で合格 • フラグは、local.txt (一般権限、ない場合もある), proof.txt(管理者権限) 、

    secret.txt (最後のマシンにある) • 1X台程度の環境、複数のドメイン • 複数の攻略ルートがあり、すべてを攻略する必要はなかった • 試験のルールは OSEP Exam Guide を参照 • https://help.offsec.com/hc/en-us/articles/360050293792-OSEP-Exam-Guide 2023/5/5 12
  8. 試験(1回目) • Initial Accessに1/4くらい時間が溶ける • 全然OSEPの範囲じゃないじゃん… • Rabbit Hole にハマる

    • パスワードクラックできたけど、使えない… • Constrained Delegation うまく出来ない… • レポート書かないで終了 2023/5/5 13
  9. 自分で脆弱性のある環境を作って攻撃 • Automated Labを使用して、Windows の AD環境を構築 • ユーザが定義したWindows環境をHyper-V上に立てられる • Windowsの試用版でもOK

    • https://github.com/AutomatedLab/AutomatedLab • Vulnarable-AD を使って、脆弱なAD設定を作る • https://github.com/WazeHell/vulnerable-AD • Windows Defender のON/OFFを試せる環境を作る • ツールが動作しない原因の切り分けをするため • AMSI Bypassのコードが試験環境では反応しなかったが、現在のバージョンの シグネチャだと反応することがわかったりした 2023/5/5 15
  10. 自分で脆弱性のある環境を作って攻撃 • Constrained Delegation が試せる環境を作る • 設定方法は、ired[.]team や Microsoftのドキュメントを参考 2023/5/5

    16 https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/abusing-kerberos-constrained-delegation
  11. 今日話したこと • PEN-300/OSEP の紹介 • OSEP取得までにやったこと • PEN-300 申込み (90日コース)

    • ラボ(Challenges) をやりつつ、テキスト読む • 試験(1回目) • 自分で脆弱性のある環境を作って攻撃 • ラボ(Challenges)を1ヶ月延長 • 試験(2回目) • 学べたことの共有 2023/5/5 19