SlideShare ist ein Scribd-Unternehmen logo
1 von 54
Under the hood of
Wslink’s multilayered
virtual machine
Vladislav Hrčka | Malware Researcher
Vladislav Hrčka
Malware Researcher at ESET
@HrckaVladislav
アジェンダ
•仮想マシン一般とシンボリック実行の紹介
•Wslinkで使用する仮想マシンの内部構造
•難読化に対応するためのアプローチ
•アプローチのデモンストレーション
プロセス仮想マシンの基本
• インタプリタがバ
イトコードを実行
する
• バイトコードには
命令が含まれてい
ます。
• オペコード
• オペランド
• ハンドラが個々の
オペコードを定義
仮想マシンベースの難読化
仮想マシンベースの難読化
Miasmにおけるシンボリックな実行
• コードを数式で表現する
• レジスタやメモリはシンボル値として扱われる
• シンボル値に対するコードの効果をまとめる
• 頻繁に使用することになる
• オリジナルのASM。
MOV EAX, EBX
MOV ECX, DWORD PTR [EDX]
XOR ECX, 0x123
MOV AX, WORD PTR [ESI]
JMP ECX
• シンボリック実行を行った。
EAX = {@16[ESI] 0 16, EBX[16:32] 16 32}
ECX = @32[EDX] ^ 0x123
zf = @32[EDX] == 0x123
nf = (@32[EDX] ^ 0x123)[31:32]
...
EIP = @32[EDX] ^ 0x123
IRDst = @32[EDX] ^ 0x123
Miasmにおけるシンボリックな実行
• 既知の具体的な数値を単純に適用することができる
• 具体的な値によって、式を簡略化することができます
• シンボリック実行を行った。
EAX = {@16[ESI] 0 16, EBX[16:3…
ECX = @32[EDX] ^ 0x123
zf = @32[EDX] == 0x123
nf = (@32[EDX] ^ 0x123)[31:32]
...
EIP = @32[EDX] ^ 0x123
IRDst = @32[EDX] ^ 0x123
• 応用編 EDX = 0x96 と
@32[0x96] = 0xFEED:
EAX = {@16[ESI] 0 16, EBX[16:3…
ECX = 0xFFCE
zf = 0x0
nf = 0x0
...
EIP = 0xFFCE
IRDst = 0xFFCE
EDX = 0x96
@32[0x96] = 0xFEED
紹介終了
• 仮想化された機能
• 仮想化された機能
が含まれます。
• プロローグ
• 仮想マシンのエントリー
を呼び出す
• ギボシコード
Wslink ファーストコンタクト
Junk code
仮想マシンの構成概要
仮想マシンの構成概要
• 次の仮想命令を準備する
• 仮想プログラムカウンタを増加させる
• レジスタをゼロにする
• RBP_init はコンテキストポ
インタ
• オフセット 0xA4 の命令表
• 仮想プログラムカウンタ(オ
フセット0x28
VM2: 最初に実行された仮想命令
•バーチャル・インストラクション 2
• 複数の仮想レジスタをゼロにする
•バーチャル・インストラクション 3
• RSPを仮想レジスタに格納
VM2: 仮想インストラクション2、3
VM2: 仮想インストラクション 4
• 複数の基本ブロック。
• 複数の基本ブロック。
VM2: 仮想インストラクション 4
• 第1ブロックの概要 – メモリアサインとIRDst
• 複数の基本ブロック。
VM2: 仮想インストラクション 4
• 第1ブロックの概要 – メモリアサインとIRDst
• 複数の基本ブロック。
VM2: 仮想インストラクション 4
• 第1ブロックの概要 – メモリアサインとIRDst
• ローリングデクリプション – オペランドの暗号化
• オフセット0x0Bと0x70の仮想レジスタの値が先に設
定されていた
VM2: 仮想命令4 - 難読化解除
• 最初のオリジナルブロック
VM2: 仮想命令4 - 難読化解除
• 最初のオリジナルブロック
VM2: 仮想命令4 - 難読化解除
• 最初のオリジナルブロック
• ローリングデクリプションレジスタの既知の値の適用
• 既知のバイトコード値を適用するとPOPが判明
IRDst = (-@16[@64[RBP_init + 0x28] + 0x4] ^ 0x3038 == @16[@64[RBP_init +
0x28] + 0x6])?(0x7FEC91ABD1C,0x7FEC91ABCF6)
@64[RBP_init + {-@16[@64[RBP_init + 0x28] + 0x4] ^ 0x3038, 0, 16, 0x0,
16, 64}] = @64[RSP_init]
IRDst = @64[@64[RBP_init + 0xA4] + 0x5A8]
@64[RBP_init + 0x28] = @64[RBP_init + 0x28] + 0x8
@64[RBP_init + 0x141] = @64[RBP_init + 0x141] + 0x8
@64[RBP_init + 0x12A] = @64[RSP_init]
• バーチャルインストラクション4まとめ。
VM2: バイトコードチャンクの難読化を解除する
IRDst = @64[@64[RBP_init + 0xA4] + 0x5A8]
@64[RBP_init + 0x28] = @64[RBP_init + 0x28] + 0x8
@64[RBP_init + 0x141] = @64[RBP_init + 0x141] + 0x8
@64[RBP_init + 0x12A] = @64[RSP_init]
• サマリーからグラフを作成
• 一部の値を具象値として扱う。
• ローリングデクリプションレジスタ
• バイトコードポインタからの相対的なメモリアクセス
• ブロック間で復号化レジスタの値のみを保持する
VM2: バイトコードチャンクの難読化を解除する
IRDst = @64[@64[RBP_init + 0xA4] + 0x5A8]
@64[RBP_init + 0x28] = @64[RBP_init + 0x28] + 0x8
@64[RBP_init + 0x141] = @64[RBP_init + 0x141] + 0x8
@64[RBP_init + 0x12A] = @64[RSP_init]
virtual_instruction2_1(vpc)
virtual_instruction2_2(vpc)
virtual_instruction2_1(vpc) virtual_instruction2_3(vpc)
virtual_instruction2_4(vpc)
• バーチャルインストラクション4まとめ。
VM1: 難読化を解除した仮想命令構造
CFG
VM1: 難読化を解除した仮想命令構造
OUTRO
CFG
INTRO
OUTRO
CFG
INTRO
CFG
INTRO
レジェンダ
Yellow – 仮想レジスタをプッシュ
Red – 仮想レジスタのポップアップ、コ
ンテキストの切り替え
Green – アキュムレータレジスタへジャ
ンプ
OUTRO
• 仮想命令1、2、3
• VM2と同じ動作
VM1: 最初に実行される仮想命令
VM1: 最初に実行される仮想命令
VM1: 最初に実行される仮想命令
• 命令のマージ - POPとPUSHの操作などを含む
• オペランドは、どの命令を実行するかを決定する
• PUSH:
VM1: 最初に実行される仮想命令
• 命令のマージ - POPとPUSHの操作などを含む
• オペランドは、どの命令を実行するかを決定する
• POP:
• 命令のマージ - POPとPUSHの操作などを含む
• オペランドは、どの命令を実行するかを決定する
• PUSH/POP
• オペランドを具象化することで単純化できる
VM1: 最初に実行される仮想命令
VM1: バイトコードチャンクの難読化を解除する
• VM2 と同じ方法を使用します。
• サマリーからグラフを構築する
• 特定の値を具体的な値として扱う
• ブロック間で特定の値を保持する
• 両方の仮想マシンを一度に処理する。
• さらにVM2全体をコンクリート化す
る
• VM2 コンテキストへの割り当てを無
視する
virtual_instruction2_1(vpc)
virtual_instruction2_2(vpc)
virtual_instruction2_1(vpc) virtual_instruction2_3(vpc)
virtual_instruction2_4(vpc)
POPの連続ではなく、予期せぬ分岐
を含むグラフになった
VM1: 難読化解除時の不透明な述語に関する問題
VM1: 難読化解除時の不透明な述語に関する問題
•ブランチは既知の値をチェックする
• 値を適用して簡略化することができる
• これは一種の不透明述語である
その手法は有効か?
結果の分析
バイトコードブロック VM1 VM2
サイズ(バイト) 695 1,145
処理された仮想インストラクションの総数 62 109
基礎となるネイティブ命令の総数 3,536,427 17,406
IR命令(IRDstsを含む)の総数 192 307
実行時間(秒) 382 10
NON-OBFUSCATED SAMPLE*
処理されたServiceMainバイトコード
OBFUSCATED
DEOBFUSCATED
ORIGINAL SAMPLE
DEOBFUSCATED SIMPLIFIED
mov R0, [R0]
mov R1, 28
lea R2, BASE+0xE3808
ORIGINAL SAMPLE
DEOBFUSCATED SIMPLIFIED
ORIGINAL SAMPLE
DEOBFUSCATED
ORIGINAL SAMPLE
DEOBFUSCATED
ORIGINAL SAMPLE
DEOBFUSCATED
lea R2, BASE+0x2FB0
mov R3, R0
SIMPLIFIED
ORIGINAL SAMPLE
DEOBFUSCATED SIMPLIFIED
lea Rdest, BASE+0x8C038
ORIGINAL SAMPLE
DEOBFUSCATED
lea Rdest, BASE+0x8C038
...
jmp Rdest
RETaddr = &vm_pre_initX()
•シンボリック実行では、非束縛ループを
処理できない
制限事項
• このようなループを使用する命令は、他の手段
で対処する必要があります。
シンボリック実行は、正しい値を具体的なも
のとして扱えば、高度で未知の仮想マシンを
合理的な時間でデヴァーチャライズするのに
役立つ
テイクアウェイ
リンク集
ホワイトペーパーは、以下のサイトで
読むことができます。
WeLiveSecurity.com
ソースコードの全文はこちら
ESET git repository
www.eset.com | www.welivesecurity.com | @ESETresearch
Vladislav Hrčka
Malware Researcher
vladislav.hrcka@eset.com | @HrckaVladislav
質問はありますか?

Weitere ähnliche Inhalte

Ähnlich wie [cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka

関東GPGPU勉強会 LLVM meets GPU
関東GPGPU勉強会 LLVM meets GPU関東GPGPU勉強会 LLVM meets GPU
関東GPGPU勉強会 LLVM meets GPUTakuro Iizuka
 
Unix32 v 20100508
Unix32 v 20100508Unix32 v 20100508
Unix32 v 20100508xylnao
 
LLVMで遊ぶ(整数圧縮とか、x86向けの自動ベクトル化とか)
LLVMで遊ぶ(整数圧縮とか、x86向けの自動ベクトル化とか)LLVMで遊ぶ(整数圧縮とか、x86向けの自動ベクトル化とか)
LLVMで遊ぶ(整数圧縮とか、x86向けの自動ベクトル化とか)Takeshi Yamamuro
 
4章 Linuxカーネル - 割り込み・例外 2
4章 Linuxカーネル - 割り込み・例外 24章 Linuxカーネル - 割り込み・例外 2
4章 Linuxカーネル - 割り込み・例外 2mao999
 
HaskellではじめるCortex-M3組込みプログラミング
HaskellではじめるCortex-M3組込みプログラミングHaskellではじめるCortex-M3組込みプログラミング
HaskellではじめるCortex-M3組込みプログラミングKiwamu Okabe
 
Build Node.js-WASM/WASI Tiny compiler with Node.js
Build Node.js-WASM/WASI Tiny compiler with Node.jsBuild Node.js-WASM/WASI Tiny compiler with Node.js
Build Node.js-WASM/WASI Tiny compiler with Node.jsmganeko
 
Polyphony の行く末(2018/3/3)
Polyphony の行く末(2018/3/3)Polyphony の行く末(2018/3/3)
Polyphony の行く末(2018/3/3)ryos36
 
BLS署名の実装とその応用
BLS署名の実装とその応用BLS署名の実装とその応用
BLS署名の実装とその応用MITSUNARI Shigeo
 
第1回【CCNA】ネットワーク基礎講座‗なにわTECH道171208
第1回【CCNA】ネットワーク基礎講座‗なにわTECH道171208第1回【CCNA】ネットワーク基礎講座‗なにわTECH道171208
第1回【CCNA】ネットワーク基礎講座‗なにわTECH道171208Nobuaki Omura
 
201711 vxrailチャンピオンクラブ_ワークショップ~入門編~テキスト
201711 vxrailチャンピオンクラブ_ワークショップ~入門編~テキスト201711 vxrailチャンピオンクラブ_ワークショップ~入門編~テキスト
201711 vxrailチャンピオンクラブ_ワークショップ~入門編~テキストVxRail ChampionClub
 
[CEDEC2017] LINEゲームのセキュリティ診断手法
[CEDEC2017] LINEゲームのセキュリティ診断手法[CEDEC2017] LINEゲームのセキュリティ診断手法
[CEDEC2017] LINEゲームのセキュリティ診断手法LINE Corporation
 
GPUが100倍速いという神話をぶち殺せたらいいな ver.2013
GPUが100倍速いという神話をぶち殺せたらいいな ver.2013GPUが100倍速いという神話をぶち殺せたらいいな ver.2013
GPUが100倍速いという神話をぶち殺せたらいいな ver.2013Ryo Sakamoto
 
SCUGJ第18回勉強会:よろしい、ならばVMMだ
SCUGJ第18回勉強会:よろしい、ならばVMMだSCUGJ第18回勉強会:よろしい、ならばVMMだ
SCUGJ第18回勉強会:よろしい、ならばVMMだwind06106
 
[CB16] マイクロソフトウィンドウズカーネルのデスノート by Peter Hlavaty & Jin Long
[CB16] マイクロソフトウィンドウズカーネルのデスノート by Peter Hlavaty & Jin Long[CB16] マイクロソフトウィンドウズカーネルのデスノート by Peter Hlavaty & Jin Long
[CB16] マイクロソフトウィンドウズカーネルのデスノート by Peter Hlavaty & Jin LongCODE BLUE
 
ツイートID生成とツイッターリアルタイム検索システムの話
ツイートID生成とツイッターリアルタイム検索システムの話ツイートID生成とツイッターリアルタイム検索システムの話
ツイートID生成とツイッターリアルタイム検索システムの話Preferred Networks
 
20210515 cae linux_install_vb
20210515 cae linux_install_vb20210515 cae linux_install_vb
20210515 cae linux_install_vbYohichiShiina
 
OpenStackで始めるクラウド環境構築入門
OpenStackで始めるクラウド環境構築入門OpenStackで始めるクラウド環境構築入門
OpenStackで始めるクラウド環境構築入門VirtualTech Japan Inc.
 
Xbyakの紹介とその周辺
Xbyakの紹介とその周辺Xbyakの紹介とその周辺
Xbyakの紹介とその周辺MITSUNARI Shigeo
 
Idcfクラウドで始める構築自動化
Idcfクラウドで始める構築自動化Idcfクラウドで始める構築自動化
Idcfクラウドで始める構築自動化智之 大野
 

Ähnlich wie [cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka (20)

関東GPGPU勉強会 LLVM meets GPU
関東GPGPU勉強会 LLVM meets GPU関東GPGPU勉強会 LLVM meets GPU
関東GPGPU勉強会 LLVM meets GPU
 
Unix32 v 20100508
Unix32 v 20100508Unix32 v 20100508
Unix32 v 20100508
 
LLVMで遊ぶ(整数圧縮とか、x86向けの自動ベクトル化とか)
LLVMで遊ぶ(整数圧縮とか、x86向けの自動ベクトル化とか)LLVMで遊ぶ(整数圧縮とか、x86向けの自動ベクトル化とか)
LLVMで遊ぶ(整数圧縮とか、x86向けの自動ベクトル化とか)
 
4章 Linuxカーネル - 割り込み・例外 2
4章 Linuxカーネル - 割り込み・例外 24章 Linuxカーネル - 割り込み・例外 2
4章 Linuxカーネル - 割り込み・例外 2
 
HaskellではじめるCortex-M3組込みプログラミング
HaskellではじめるCortex-M3組込みプログラミングHaskellではじめるCortex-M3組込みプログラミング
HaskellではじめるCortex-M3組込みプログラミング
 
Build Node.js-WASM/WASI Tiny compiler with Node.js
Build Node.js-WASM/WASI Tiny compiler with Node.jsBuild Node.js-WASM/WASI Tiny compiler with Node.js
Build Node.js-WASM/WASI Tiny compiler with Node.js
 
Polyphony の行く末(2018/3/3)
Polyphony の行く末(2018/3/3)Polyphony の行く末(2018/3/3)
Polyphony の行く末(2018/3/3)
 
BLS署名の実装とその応用
BLS署名の実装とその応用BLS署名の実装とその応用
BLS署名の実装とその応用
 
第1回【CCNA】ネットワーク基礎講座‗なにわTECH道171208
第1回【CCNA】ネットワーク基礎講座‗なにわTECH道171208第1回【CCNA】ネットワーク基礎講座‗なにわTECH道171208
第1回【CCNA】ネットワーク基礎講座‗なにわTECH道171208
 
201711 vxrailチャンピオンクラブ_ワークショップ~入門編~テキスト
201711 vxrailチャンピオンクラブ_ワークショップ~入門編~テキスト201711 vxrailチャンピオンクラブ_ワークショップ~入門編~テキスト
201711 vxrailチャンピオンクラブ_ワークショップ~入門編~テキスト
 
[CEDEC2017] LINEゲームのセキュリティ診断手法
[CEDEC2017] LINEゲームのセキュリティ診断手法[CEDEC2017] LINEゲームのセキュリティ診断手法
[CEDEC2017] LINEゲームのセキュリティ診断手法
 
Kiso sekkei 01rev03
Kiso sekkei 01rev03Kiso sekkei 01rev03
Kiso sekkei 01rev03
 
GPUが100倍速いという神話をぶち殺せたらいいな ver.2013
GPUが100倍速いという神話をぶち殺せたらいいな ver.2013GPUが100倍速いという神話をぶち殺せたらいいな ver.2013
GPUが100倍速いという神話をぶち殺せたらいいな ver.2013
 
SCUGJ第18回勉強会:よろしい、ならばVMMだ
SCUGJ第18回勉強会:よろしい、ならばVMMだSCUGJ第18回勉強会:よろしい、ならばVMMだ
SCUGJ第18回勉強会:よろしい、ならばVMMだ
 
[CB16] マイクロソフトウィンドウズカーネルのデスノート by Peter Hlavaty & Jin Long
[CB16] マイクロソフトウィンドウズカーネルのデスノート by Peter Hlavaty & Jin Long[CB16] マイクロソフトウィンドウズカーネルのデスノート by Peter Hlavaty & Jin Long
[CB16] マイクロソフトウィンドウズカーネルのデスノート by Peter Hlavaty & Jin Long
 
ツイートID生成とツイッターリアルタイム検索システムの話
ツイートID生成とツイッターリアルタイム検索システムの話ツイートID生成とツイッターリアルタイム検索システムの話
ツイートID生成とツイッターリアルタイム検索システムの話
 
20210515 cae linux_install_vb
20210515 cae linux_install_vb20210515 cae linux_install_vb
20210515 cae linux_install_vb
 
OpenStackで始めるクラウド環境構築入門
OpenStackで始めるクラウド環境構築入門OpenStackで始めるクラウド環境構築入門
OpenStackで始めるクラウド環境構築入門
 
Xbyakの紹介とその周辺
Xbyakの紹介とその周辺Xbyakの紹介とその周辺
Xbyakの紹介とその周辺
 
Idcfクラウドで始める構築自動化
Idcfクラウドで始める構築自動化Idcfクラウドで始める構築自動化
Idcfクラウドで始める構築自動化
 

Mehr von CODE BLUE

[cb22] Hayabusa Threat Hunting and Fast Forensics in Windows environments fo...
[cb22] Hayabusa  Threat Hunting and Fast Forensics in Windows environments fo...[cb22] Hayabusa  Threat Hunting and Fast Forensics in Windows environments fo...
[cb22] Hayabusa Threat Hunting and Fast Forensics in Windows environments fo...CODE BLUE
 
[cb22] Tales of 5G hacking by Karsten Nohl
[cb22] Tales of 5G hacking by Karsten Nohl[cb22] Tales of 5G hacking by Karsten Nohl
[cb22] Tales of 5G hacking by Karsten NohlCODE BLUE
 
[cb22] Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
[cb22]  Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...[cb22]  Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
[cb22] Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...CODE BLUE
 
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...CODE BLUE
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之CODE BLUE
 
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...CODE BLUE
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo PupilloCODE BLUE
 
[cb22] ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...
[cb22]  ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...[cb22]  ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...
[cb22] ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...CODE BLUE
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman
[cb22]  「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman [cb22]  「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman CODE BLUE
 
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...CODE BLUE
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by 高橋 郁夫
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by  高橋 郁夫[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by  高橋 郁夫
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by 高橋 郁夫CODE BLUE
 
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...CODE BLUE
 
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...CODE BLUE
 
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...CODE BLUE
 
[cb22] From Parroting to Echoing: The Evolution of China’s Bots-Driven Info...
[cb22]  From Parroting to Echoing:  The Evolution of China’s Bots-Driven Info...[cb22]  From Parroting to Echoing:  The Evolution of China’s Bots-Driven Info...
[cb22] From Parroting to Echoing: The Evolution of China’s Bots-Driven Info...CODE BLUE
 
[cb22] Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...
[cb22]  Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...[cb22]  Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...
[cb22] Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...CODE BLUE
 
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也CODE BLUE
 
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...CODE BLUE
 
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...CODE BLUE
 
[cb22] What I learned from the direct confrontation with the adversaries who ...
[cb22] What I learned from the direct confrontation with the adversaries who ...[cb22] What I learned from the direct confrontation with the adversaries who ...
[cb22] What I learned from the direct confrontation with the adversaries who ...CODE BLUE
 

Mehr von CODE BLUE (20)

[cb22] Hayabusa Threat Hunting and Fast Forensics in Windows environments fo...
[cb22] Hayabusa  Threat Hunting and Fast Forensics in Windows environments fo...[cb22] Hayabusa  Threat Hunting and Fast Forensics in Windows environments fo...
[cb22] Hayabusa Threat Hunting and Fast Forensics in Windows environments fo...
 
[cb22] Tales of 5G hacking by Karsten Nohl
[cb22] Tales of 5G hacking by Karsten Nohl[cb22] Tales of 5G hacking by Karsten Nohl
[cb22] Tales of 5G hacking by Karsten Nohl
 
[cb22] Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
[cb22]  Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...[cb22]  Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
[cb22] Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
 
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之
 
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo
 
[cb22] ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...
[cb22]  ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...[cb22]  ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...
[cb22] ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman
[cb22]  「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman [cb22]  「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman
 
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by 高橋 郁夫
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by  高橋 郁夫[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by  高橋 郁夫
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by 高橋 郁夫
 
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...
 
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...
 
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...
 
[cb22] From Parroting to Echoing: The Evolution of China’s Bots-Driven Info...
[cb22]  From Parroting to Echoing:  The Evolution of China’s Bots-Driven Info...[cb22]  From Parroting to Echoing:  The Evolution of China’s Bots-Driven Info...
[cb22] From Parroting to Echoing: The Evolution of China’s Bots-Driven Info...
 
[cb22] Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...
[cb22]  Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...[cb22]  Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...
[cb22] Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...
 
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也
 
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...
 
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...
 
[cb22] What I learned from the direct confrontation with the adversaries who ...
[cb22] What I learned from the direct confrontation with the adversaries who ...[cb22] What I learned from the direct confrontation with the adversaries who ...
[cb22] What I learned from the direct confrontation with the adversaries who ...
 

[cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka

Hinweis der Redaktion

  1. Subsequently to starting our analysis found a non-obfuscated sample – we weren’t motivated to fully deobfuscate the code
  2. Since 2017 been focusing on reverse engineering challenging malware samples Computer Science student at the Comenius University in the first years of master’s degree BlackHat Arsenal, AVAR
  3. Work like standard machines – machine code is bytecode here PC is offset to the bytecode here – not necessary Transfer of control from one virtual instruction to the next during interpretation needs to be performed by every VM. This process is generally known as dispatching Centralized interpreter – dispatcher – called direct call threading; can be also simple switch case Can be also inside of handlers – direct threading
  4. Stored in sep.arate section Need context switch Bytecode is generated from a function Original function starts interpreter Interpreter is embedded in the executable Context switch needs to be performed Stored in a separate section Need context switch Bytecode is generated from a function Original function starts interpreter Interpreter is embedded in the executable Context switch needs to be performed
  5. The strength of this obfuscation technique resides in the fact that the ISA of the VM is unknown to any prospective reverse engineer – a thorough analysis of the VM, which can be very time-consuming; Additionally, obfuscating VMs usually virtualize only certain “interesting” functions
  6. SE in IR IRDst 1. stands for 2. is IR instruction pointer, e.g. cmov multiple blocks X bit value dereference Self explainable dereference
  7. SE engine in Miasm automatically performs common optimization techniques
  8. The VM used in the Wslink is a variant of CV (themida) that supports multiple VMs and polymorphic layers of obfuscation techniques. We found this out subsequently to publishing our research
  9. The right side contains a part of the function
  10. Why 1071? They are duplicated! Vm_init – Sync – shared virtual context in the memory Virtual program counter (VPC) register Base address register Instruction table register
  11. Zdorazni nested VM – zacneme VM2
  12. Rolling decryption – present in a blog about VM Protect’s structure
  13. Make values relative to the bytecode ptr concrete
  14. We’ve just deobfuscated one of the VM1 instructions
  15. Let’s start with CFG
  16. Reminder – atomic operations in blocks
  17. Laser point – These IR blocks are effects of VM2 virtual instructions, they represent one VM1 virtual instruction together
  18. Zeroes out a register, stores the RSP, initializes rolling decryption registers
  19. A part of the instruction. When we inspected the code, we realized what the problem is
  20. Memory range of the VMs is known – separate section
  21. Let’s take a closer look at one of the branches <CLICK>
  22. The branches check a known value We can apply the value and simplify it This is a sort of opaque predicates
  23. We will show the results on the first executed bytecode, but before that show statistics
  24. Before we look at the devirtualized bytecode, let’s see what the execution time is approximately like Let’s look at the deobfuscated bytecode block of VM1 <CLICK>
  25. *We discovered the sample after starting our analysis
  26. No ARM R0! – pseudocode close to assembly
  27. Advanced – use junk code, duplicate and merge handlers, encrypt operands Right values – operands and registers for encryption