SlideShare a Scribd company logo
MITRE ATT&CK - T1611
Privilege Escalation
Escape to Host
May 24, 2021 kataokaw
T1611 - Escape to Hostの立ち位置
MITRE ATT&CKマトリックスでの立ち位置
a
TACTICS - Privilege Escalation (TA0004)
ATT&CKマトリックスの列名「Privilege Escalation」は、
攻撃者がシステムまたはネットワークにおいて、
より高いレベルのアクセス権を取得するために使用する手法で構成されている。
一般的なアプローチは、システムの弱点/構成の誤り/脆弱性の利用とされている。
権限昇格後に利用される権限の例
 SYSTAM/root
 local administrator
 管理者のようなアクセス権を持つユーザーアカウント
 特定システムへのアクセスや、特定機能を実行するユーザーアカウント
[MITER ATT&CK TACTICS (Enterprise) – Privilege Escalation] https://attack.mitre.org/tactics/TA0004/
TECHNIQUES - Escape to Host (T1611)
ID 名前
T1548 - 不正な昇格制御機構
.001 SetuidとSetgid
.002 ユーザーアカウント制御のバイパス
.003 SudoとSudoキャッシング
.004 プロンプトによる高度な実行
.010 ポートモニタ
.011 Plistの変更
.012 プリントプロセッサ
.013 XDG オートスタートの入力
.014 アクティブセットアップ
~省略~
T1611 ホストへのエスケープ
~省略~
「Privilege Escalation」には、
13のテクニックと82のサブテクニックがあるが、今回はT1611にフォーカスする。
[MITER ATT&CK TACTICS (Enterprise) – Privilege Escalation] https://attack.mitre.org/tactics/TA0004/
TECHNIQUES - Escape to Host (T1611)
T1611の詳細
攻撃者はコンテナを抜け出し、基盤となるホストにアクセスすることがあります。
これにより、攻撃者は、ホスト層から他のコンテナ化されたリソースへのアクセスや、ホスト自体へのアクセスが可能になります。
原則、コンテナ化されたリソースは、アプリの機能を明確に分離し、ホスト環境から隔離されている必要があります。
攻撃者が、ホスト環境へ抜け出す方法は複数あります。
bindパラメータを利用してホストのFSをマウントするよう構成したコンテナを作成し、
ホスト上で、ペイロードのダウンロードや、制御ユーティリティ(cron等)の実行などができます。
また、特権付きのコンテナを利用して、基盤となるホスト上でコマンドを実行することもできます。
ホストにアクセスできるようになると、
攻撃者は、永続性の確立、環境内での横移動、ホスト上でのC&Cチャネルの設定など、
次の目的を達成する機会を得ることができます。
->コンテナに何かしらの権限を付与する機会は無いのか?
[MITER ATT&CK TECHNIQUES (Enterprise) –Escape to Host] https://attack.mitre.org/techniques/T1611/
Dockerコンテナの権限を変更する事例
 openvpnの利用
「ERROR: Cannot ioctl TUNSETIFF tun: Operation not permitted (errno=1)」
”Linux capabilities”の「CAP_NET_ADMIN」が必要なので、オプション「--cap-add NET_ADMIN」を使用する。
 mountの利用
「mount: permission denied」
”Linux capabilities”の「CAP_SYS_ADMIN」が必要なので、オプション「--cap-add SYS_ADMIN」を使用する。
tmpfsのマウント等では、下記エラーが出力されるが、
オプション「--security-opt apparmor:unconfined」か、AppArmorのカスタムプロファイルで回避可能とのこと。
「mount: tmpfs is write-protected, mounting read-only
mount: cannot mount tmpfs read-only」
コンテナ起動コマンドの例
docker run --cap-add NET_ADMIN --cap-add SYS_ADMIN --name <C-NAME> -itd -p <HOST-PORT>:<C-
PORT> <REPO-NAME>:<TAG-NAME>
[Linux capabilities] https://man7.org/linux/man-pages/man7/capabilities.7.html
[Google Cloud Platform - AppArmor によるコンテナの保護] https://cloud.google.com/container-optimized-os/docs/how-to/secure-apparmor?hl=ja
権限付与の事例 コンテナの起動時のオプションで各種権限が
付与できるが、その分リスクも高まるので注意。
特権でコンテナを
起動したらどうなるの?
Dockerコンテナを特権で実行
[情シスNavi. - セキュリティブログ:Dockerコンテナを特権モードで実行することが危険な理由]
https://josys-navi.hiblead.co.jp/tmsb_21jan20_docker-in-docker
[paloalto - コンテナでプログラムをrootとして実行することがなぜ問題なのか KubernetsのCVE-2019-11245を例に考える]
https://unit42.paloaltonetworks.jp/non-root-containers-kubernetes-cve-2019-11245-care/
特権コンテナを起動した際のリスク
特権コンテナは、ホストに対してルート権限を備えたコンテナのため、
コンテナ内のユーザは、ホストのリソースへの高度なアクセス権限を持つことになる。
よって、考えられるリスクは下記となる。
 AppArmor、 cgroups、SECcomp等のセキュリティ機構の無効化
 C&Cサーバの設定
 コンテナブレイクアウト(ホスト上のコマンド実行/バイナリ変更)
 システムファイルの変更
 特権プロセスの停止・起動
etc.
コンテナを対象とした攻撃ツール
脅威グループ「TeamTNT」は、下記ツールを利用していた。
 BotB
->一般的なコンテナの脆弱性を悪用し、コンテナブレイクアウトを実行する。
その結果として、ホストでのコマンド実行やバイナリの変更などが可能となる。
CVE-2019-5736を利用している。
 Peirates
->Peiratesは複数のインフラストラクチャとクラウドの資格情報を収集できる。
Kubernetesクラスタからサービスアカウントトークンを検索する際に使えるらしい。
[paloalto - Hildegard: Kubernetesを標的とする新たなTeamTNTのクリプトジャックマルウェア] https://unit42.paloaltonetworks.jp/hildegard-malware-teamtnt/
[Github -brompwnie/botb] https://github.com/brompwnie/botb
[Github - inguardians/peirates] https://github.com/inguardians/peirates
攻撃ツールの事例
どうやって防ぐのか
対策方法
[Github - brompwnie/botb] https://github.com/brompwnie/botb
[Paloalto - runCによるDockerコンテナブレークアウト: CVE-2019-5736の解説]https://unit42.paloaltonetworks.jp/breaking-docker-via-runc-explaining-cve-2019-5736/
[Qiita - Dockerコンテナを本番環境で使うためのセキュリティ設定] https://qiita.com/muff1225/items/4edea7b039dd9f26098f#root%E6%A8%A9%E9%99%90%E3%82%92%E5%89%A5%E5%A5%AA%E3%81%99%E3%82%8B
[docker-docs-ja] https://docs.docker.jp/engine/security/rootless.html
 信頼できる公開元のイメージのみ利用する/content trust機能を利用する(バックドアやファイルレスマルウェアの回避)
 特権コンテナを外部公開しない
 外部公開するコンテナには、不要な権限を付与しない(CAP_SYS_ADMINなど)
 外部公開するコンテナ内サービスは、特権で実行しない
->コンテナ起動オプション「-u <uid>」でUIDを指定する方法や、DockerfileのUserディレクティブ、KubernetesのSecurityContextを利用する。
 不要なコンテナ間通信を閉じる
->Docker daemon起動時に--icc=falseオプションを利用する
 コンテナにファイルをマウントする場合はRead-onlyを指定する
docker run -v .:/src/app:ro <C-ID>
 Docker自体や外部公開するコンテナ内のOSSを常にアップデートしておく(特にrunCなど)
 Docker-in-Dockerしない
 (番外)kubletへのAnonymousアクセスを禁止する
実験的なものではあるが、将来的にはRootless Dockerの利用が推奨されるかもしれない(Docker 19.03以降)。
なお、現時点ではcgroupを利用できないなどの制約がある。
おわり

More Related Content

Recently uploaded

TaketoFujikawa_物語のコンセプトに基づく情報アクセス手法の基礎検討_JSAI2024
TaketoFujikawa_物語のコンセプトに基づく情報アクセス手法の基礎検討_JSAI2024TaketoFujikawa_物語のコンセプトに基づく情報アクセス手法の基礎検討_JSAI2024
TaketoFujikawa_物語のコンセプトに基づく情報アクセス手法の基礎検討_JSAI2024
Matsushita Laboratory
 
FIDO Alliance Osaka Seminar: Welcome Slides.pdf
FIDO Alliance Osaka Seminar: Welcome Slides.pdfFIDO Alliance Osaka Seminar: Welcome Slides.pdf
FIDO Alliance Osaka Seminar: Welcome Slides.pdf
FIDO Alliance
 
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
NTT DATA Technology & Innovation
 
FIDO Alliance Osaka Seminar: CloudGate.pdf
FIDO Alliance Osaka Seminar: CloudGate.pdfFIDO Alliance Osaka Seminar: CloudGate.pdf
FIDO Alliance Osaka Seminar: CloudGate.pdf
FIDO Alliance
 
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LBカタログ
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LBカタログLoRaWAN 4チャンネル電流センサー・コンバーター CS01-LBカタログ
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LBカタログ
CRI Japan, Inc.
 
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching
harmonylab
 
FIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdf
FIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdfFIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdf
FIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdf
FIDO Alliance
 
【AI論文解説】Consistency ModelとRectified Flow
【AI論文解説】Consistency ModelとRectified Flow【AI論文解説】Consistency ModelとRectified Flow
【AI論文解説】Consistency ModelとRectified Flow
Sony - Neural Network Libraries
 
FIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdf
FIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdfFIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdf
FIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdf
FIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdfFIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdf
FIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdf
FIDO Alliance
 
CS集会#13_なるほどわからん通信技術 発表資料
CS集会#13_なるほどわからん通信技術 発表資料CS集会#13_なるほどわからん通信技術 発表資料
CS集会#13_なるほどわからん通信技術 発表資料
Yuuitirou528 default
 
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
iPride Co., Ltd.
 
単腕マニピュレータによる 複数物体の同時組み立ての 基礎的考察 / Basic Approach to Robotic Assembly of Multi...
単腕マニピュレータによる 複数物体の同時組み立ての 基礎的考察 / Basic Approach to Robotic Assembly of Multi...単腕マニピュレータによる 複数物体の同時組み立ての 基礎的考察 / Basic Approach to Robotic Assembly of Multi...
単腕マニピュレータによる 複数物体の同時組み立ての 基礎的考察 / Basic Approach to Robotic Assembly of Multi...
Fukuoka Institute of Technology
 
論文紹介:When Visual Prompt Tuning Meets Source-Free Domain Adaptive Semantic Seg...
論文紹介:When Visual Prompt Tuning Meets Source-Free Domain Adaptive Semantic Seg...論文紹介:When Visual Prompt Tuning Meets Source-Free Domain Adaptive Semantic Seg...
論文紹介:When Visual Prompt Tuning Meets Source-Free Domain Adaptive Semantic Seg...
Toru Tamaki
 
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
yassun7010
 

Recently uploaded (15)

TaketoFujikawa_物語のコンセプトに基づく情報アクセス手法の基礎検討_JSAI2024
TaketoFujikawa_物語のコンセプトに基づく情報アクセス手法の基礎検討_JSAI2024TaketoFujikawa_物語のコンセプトに基づく情報アクセス手法の基礎検討_JSAI2024
TaketoFujikawa_物語のコンセプトに基づく情報アクセス手法の基礎検討_JSAI2024
 
FIDO Alliance Osaka Seminar: Welcome Slides.pdf
FIDO Alliance Osaka Seminar: Welcome Slides.pdfFIDO Alliance Osaka Seminar: Welcome Slides.pdf
FIDO Alliance Osaka Seminar: Welcome Slides.pdf
 
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
 
FIDO Alliance Osaka Seminar: CloudGate.pdf
FIDO Alliance Osaka Seminar: CloudGate.pdfFIDO Alliance Osaka Seminar: CloudGate.pdf
FIDO Alliance Osaka Seminar: CloudGate.pdf
 
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LBカタログ
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LBカタログLoRaWAN 4チャンネル電流センサー・コンバーター CS01-LBカタログ
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LBカタログ
 
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching
 
FIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdf
FIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdfFIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdf
FIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdf
 
【AI論文解説】Consistency ModelとRectified Flow
【AI論文解説】Consistency ModelとRectified Flow【AI論文解説】Consistency ModelとRectified Flow
【AI論文解説】Consistency ModelとRectified Flow
 
FIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdf
FIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdfFIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdf
FIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdf
 
FIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdf
FIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdfFIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdf
FIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdf
 
CS集会#13_なるほどわからん通信技術 発表資料
CS集会#13_なるほどわからん通信技術 発表資料CS集会#13_なるほどわからん通信技術 発表資料
CS集会#13_なるほどわからん通信技術 発表資料
 
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
 
単腕マニピュレータによる 複数物体の同時組み立ての 基礎的考察 / Basic Approach to Robotic Assembly of Multi...
単腕マニピュレータによる 複数物体の同時組み立ての 基礎的考察 / Basic Approach to Robotic Assembly of Multi...単腕マニピュレータによる 複数物体の同時組み立ての 基礎的考察 / Basic Approach to Robotic Assembly of Multi...
単腕マニピュレータによる 複数物体の同時組み立ての 基礎的考察 / Basic Approach to Robotic Assembly of Multi...
 
論文紹介:When Visual Prompt Tuning Meets Source-Free Domain Adaptive Semantic Seg...
論文紹介:When Visual Prompt Tuning Meets Source-Free Domain Adaptive Semantic Seg...論文紹介:When Visual Prompt Tuning Meets Source-Free Domain Adaptive Semantic Seg...
論文紹介:When Visual Prompt Tuning Meets Source-Free Domain Adaptive Semantic Seg...
 
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
 

Featured

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
 

Featured (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

MITRE ATT&CK T1611 Escape to Host

  • 1. MITRE ATT&CK - T1611 Privilege Escalation Escape to Host May 24, 2021 kataokaw
  • 2. T1611 - Escape to Hostの立ち位置 MITRE ATT&CKマトリックスでの立ち位置 a
  • 3. TACTICS - Privilege Escalation (TA0004) ATT&CKマトリックスの列名「Privilege Escalation」は、 攻撃者がシステムまたはネットワークにおいて、 より高いレベルのアクセス権を取得するために使用する手法で構成されている。 一般的なアプローチは、システムの弱点/構成の誤り/脆弱性の利用とされている。 権限昇格後に利用される権限の例  SYSTAM/root  local administrator  管理者のようなアクセス権を持つユーザーアカウント  特定システムへのアクセスや、特定機能を実行するユーザーアカウント [MITER ATT&CK TACTICS (Enterprise) – Privilege Escalation] https://attack.mitre.org/tactics/TA0004/
  • 4. TECHNIQUES - Escape to Host (T1611) ID 名前 T1548 - 不正な昇格制御機構 .001 SetuidとSetgid .002 ユーザーアカウント制御のバイパス .003 SudoとSudoキャッシング .004 プロンプトによる高度な実行 .010 ポートモニタ .011 Plistの変更 .012 プリントプロセッサ .013 XDG オートスタートの入力 .014 アクティブセットアップ ~省略~ T1611 ホストへのエスケープ ~省略~ 「Privilege Escalation」には、 13のテクニックと82のサブテクニックがあるが、今回はT1611にフォーカスする。 [MITER ATT&CK TACTICS (Enterprise) – Privilege Escalation] https://attack.mitre.org/tactics/TA0004/
  • 5. TECHNIQUES - Escape to Host (T1611) T1611の詳細 攻撃者はコンテナを抜け出し、基盤となるホストにアクセスすることがあります。 これにより、攻撃者は、ホスト層から他のコンテナ化されたリソースへのアクセスや、ホスト自体へのアクセスが可能になります。 原則、コンテナ化されたリソースは、アプリの機能を明確に分離し、ホスト環境から隔離されている必要があります。 攻撃者が、ホスト環境へ抜け出す方法は複数あります。 bindパラメータを利用してホストのFSをマウントするよう構成したコンテナを作成し、 ホスト上で、ペイロードのダウンロードや、制御ユーティリティ(cron等)の実行などができます。 また、特権付きのコンテナを利用して、基盤となるホスト上でコマンドを実行することもできます。 ホストにアクセスできるようになると、 攻撃者は、永続性の確立、環境内での横移動、ホスト上でのC&Cチャネルの設定など、 次の目的を達成する機会を得ることができます。 ->コンテナに何かしらの権限を付与する機会は無いのか? [MITER ATT&CK TECHNIQUES (Enterprise) –Escape to Host] https://attack.mitre.org/techniques/T1611/
  • 6. Dockerコンテナの権限を変更する事例  openvpnの利用 「ERROR: Cannot ioctl TUNSETIFF tun: Operation not permitted (errno=1)」 ”Linux capabilities”の「CAP_NET_ADMIN」が必要なので、オプション「--cap-add NET_ADMIN」を使用する。  mountの利用 「mount: permission denied」 ”Linux capabilities”の「CAP_SYS_ADMIN」が必要なので、オプション「--cap-add SYS_ADMIN」を使用する。 tmpfsのマウント等では、下記エラーが出力されるが、 オプション「--security-opt apparmor:unconfined」か、AppArmorのカスタムプロファイルで回避可能とのこと。 「mount: tmpfs is write-protected, mounting read-only mount: cannot mount tmpfs read-only」 コンテナ起動コマンドの例 docker run --cap-add NET_ADMIN --cap-add SYS_ADMIN --name <C-NAME> -itd -p <HOST-PORT>:<C- PORT> <REPO-NAME>:<TAG-NAME> [Linux capabilities] https://man7.org/linux/man-pages/man7/capabilities.7.html [Google Cloud Platform - AppArmor によるコンテナの保護] https://cloud.google.com/container-optimized-os/docs/how-to/secure-apparmor?hl=ja 権限付与の事例 コンテナの起動時のオプションで各種権限が 付与できるが、その分リスクも高まるので注意。
  • 8. Dockerコンテナを特権で実行 [情シスNavi. - セキュリティブログ:Dockerコンテナを特権モードで実行することが危険な理由] https://josys-navi.hiblead.co.jp/tmsb_21jan20_docker-in-docker [paloalto - コンテナでプログラムをrootとして実行することがなぜ問題なのか KubernetsのCVE-2019-11245を例に考える] https://unit42.paloaltonetworks.jp/non-root-containers-kubernetes-cve-2019-11245-care/ 特権コンテナを起動した際のリスク 特権コンテナは、ホストに対してルート権限を備えたコンテナのため、 コンテナ内のユーザは、ホストのリソースへの高度なアクセス権限を持つことになる。 よって、考えられるリスクは下記となる。  AppArmor、 cgroups、SECcomp等のセキュリティ機構の無効化  C&Cサーバの設定  コンテナブレイクアウト(ホスト上のコマンド実行/バイナリ変更)  システムファイルの変更  特権プロセスの停止・起動 etc.
  • 9. コンテナを対象とした攻撃ツール 脅威グループ「TeamTNT」は、下記ツールを利用していた。  BotB ->一般的なコンテナの脆弱性を悪用し、コンテナブレイクアウトを実行する。 その結果として、ホストでのコマンド実行やバイナリの変更などが可能となる。 CVE-2019-5736を利用している。  Peirates ->Peiratesは複数のインフラストラクチャとクラウドの資格情報を収集できる。 Kubernetesクラスタからサービスアカウントトークンを検索する際に使えるらしい。 [paloalto - Hildegard: Kubernetesを標的とする新たなTeamTNTのクリプトジャックマルウェア] https://unit42.paloaltonetworks.jp/hildegard-malware-teamtnt/ [Github -brompwnie/botb] https://github.com/brompwnie/botb [Github - inguardians/peirates] https://github.com/inguardians/peirates 攻撃ツールの事例
  • 10. どうやって防ぐのか 対策方法 [Github - brompwnie/botb] https://github.com/brompwnie/botb [Paloalto - runCによるDockerコンテナブレークアウト: CVE-2019-5736の解説]https://unit42.paloaltonetworks.jp/breaking-docker-via-runc-explaining-cve-2019-5736/ [Qiita - Dockerコンテナを本番環境で使うためのセキュリティ設定] https://qiita.com/muff1225/items/4edea7b039dd9f26098f#root%E6%A8%A9%E9%99%90%E3%82%92%E5%89%A5%E5%A5%AA%E3%81%99%E3%82%8B [docker-docs-ja] https://docs.docker.jp/engine/security/rootless.html  信頼できる公開元のイメージのみ利用する/content trust機能を利用する(バックドアやファイルレスマルウェアの回避)  特権コンテナを外部公開しない  外部公開するコンテナには、不要な権限を付与しない(CAP_SYS_ADMINなど)  外部公開するコンテナ内サービスは、特権で実行しない ->コンテナ起動オプション「-u <uid>」でUIDを指定する方法や、DockerfileのUserディレクティブ、KubernetesのSecurityContextを利用する。  不要なコンテナ間通信を閉じる ->Docker daemon起動時に--icc=falseオプションを利用する  コンテナにファイルをマウントする場合はRead-onlyを指定する docker run -v .:/src/app:ro <C-ID>  Docker自体や外部公開するコンテナ内のOSSを常にアップデートしておく(特にrunCなど)  Docker-in-Dockerしない  (番外)kubletへのAnonymousアクセスを禁止する 実験的なものではあるが、将来的にはRootless Dockerの利用が推奨されるかもしれない(Docker 19.03以降)。 なお、現時点ではcgroupを利用できないなどの制約がある。