Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
難読化Bashの検知
Search
udon-yuya
November 28, 2020
Technology
210
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
難読化Bashの検知
udon-yuya
November 28, 2020
More Decks by udon-yuya
See All by udon-yuya
NTTコミュニケーションズ インターンシップレポート
udonyuya
1
1k
Other Decks in Technology
See All in Technology
PagerDuty Tech Hub-鳴らすけれど、人は動かない
ezaki
0
170
パスキーの自動テストはどこまでいけるのか
teamlab
PRO
0
200
DGX Spark でどこまでハッキングができるのか?
kash1064
3
1.3k
二歩目のフロントエンド・ウェブアクセシビリティ
camiha
2
570
継続的なAIコスト最適化
bgpat
1
340
AI駆動で「他アプリの音を加工できる」アプリを作った
satomasahiro2005
0
150
Conditional PED-ANOVA: Hyperparameter Importance in Hierarchical & Dynamic Search Spaces
pfn
PRO
0
130
宣言型部分更新は何を解決しどこへ向かうのか
shuta13
1
450
AIにシークレットを見せない、WSL2で安全な開発環境
yazm
0
300
AI × アーキテクト 第1・2章|生成AIの課題とアーキテクトの素養
daidaidai
0
170
スプシの手作業からの解脱 ~更新はClaude Codeに、見せ方と使い方はGASアプリに任せる~
kentarofujii
0
150
「Docker Desktop不要の時代」は 来たのか?
ueponx
0
770
Featured
See All Featured
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
990
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Writing Fast Ruby
sferik
630
63k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
310
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
620
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
540
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
The Limits of Empathy - UXLibs8
cassininazir
2
720
Automating Front-end Workflow
addyosmani
1369
210k
Color Theory Basics | Prateek | Gurzu
gurzu
1
490
The agentic SEO stack - context over prompts
schlessera
0
970
Transcript
Z5. 難読化Bashの検知 セキュリティ・キャンプ2020 Z5トラック 田島 裕也
動機 ・攻撃者は隠蔽のために攻撃用のシェルスクリプトに難 読化処理を施すことがある. ・難読化されたスクリプトを自動で検知することで,攻撃 のバリエーションを減らすことが出来そう. 2
難読化の手法 ・自動で難読化処理を施すツール. ・https://github.com/Bashfuscator/Bashfuscator 3
難読化の手法 $ cat /etc/passwd $ $'\u0063a\x74' /e${@^^}tc/p${*%Frf\[4]}as\s'wd' ・上二つは同じ意味 ・$'\u0063a\x74' ->
cat (unicode, ascii) ・${@^^}, ${*%Frf\[4]} -> empty ・\ は無視される 4
検知するために考えたこと ・難読化されたスクリプトはかなり乱雑に見えるため,エントロピー が高そう. → テキストのエントロピーを計算したところ,正規のスクリプトと 難読化スクリプトであまり変わらない → 人間が見ると,意味のある文字列は乱雑には見えないが,実 際のエントロピーは高い 5
検知するために考えたこと ・難読化されたスクリプトは ‘$’や’{}’,’\’など特殊記号が多く 現れる. → 特殊記号が多く現れるスクリプトを検知 → かなり単純な考えだが,意外とうまくいった. 6
検知基準 ・特殊記号がファイル全体の25%より多く現れる場合,難読 化と検知する. ・閾値適当なの絶対よくない 7
実験・評価 ・難読化マルウェア → 114 / 133 (0.483s) ・正規スクリプト(/bin, /sbin, /usr, /etc, /var/lib)
→ 0 / 1656 (2.120s) ・TP rate = 0.857 ・FP rate = 0 ・Accuracy = (114 + 1656) / (133 + 1656) = 0.989 8
おまけ ・ランダムで追加される意味のない(empty)な部分をなるべく排除 することで,難読化スクリプトを見やすくする. ・無駄な部分が減って何となく見やすくなった... 9
まとめ・感想 ・特殊記号の出現比率を用いて,高い精度で難読化スクリプ トを検知することが出来た. ・正直,こんな難読化が出来ないように規約をもっと厳しいも のにしてもいいんじゃないかと思った. 10