2. About the speaker
• 職業 : Webセキュリティエンジニア
• 所属 : 三井物産セキュアディレクション
• 趣味 : 脆弱性スキャナ作り、機械学習
• ブログ: http://www.mbsd.jp/blog/
• Black Hat Asia 2016 Arsenal
• AISECjpを主催
高江洲 勲
MBSD
タカエス イサオ
CODE BLUE 2016
35. MBSD
SPAM:0.672 ← こっちを選択
HAM :0.03
期間 SPAM:10%
HAM :30%
カテゴリ
限定
ココ
クリック
http://
wana.jp
SPAM:40%
HAM :10%
SPAM:30%
HAM :40%
SPAM:70%
HAM :50%
SPAM:80%
HAM :5%
メール本文からキーワードを抽出
SPAM・HAMの確率を求め、確率が高いカテゴリを選択
スパムメールフィルタへの利用例
CODE BLUE 2016
46. MBSD
<h2>2 errors prohibited this user from being saved </h2>
<p>There were problems with these fields:</p>
<ul>
<li> Password doesn't match confirmation </li>
<li> Email is invalid </li>
["Password doesn't match confirmation","Email is invalid
"]
</ul>
CODE BLUE 2016
遷移成否を特徴付けるキーワードを抽出
ストップワードは除外
機械による遷移成否認識
57. ロボット歩行動作習得への利用例
MBSD CODE BLUE 2016
エージェント
環境
a1 前進
a2 左折
a3 右折
a4 後退
行動
状態 s
・・・
次の状態 s’
政策 ( a | s ) 遷移確率 ( s’ | s, a )
目の前に穴が…
報酬 r = R( s, a, s’ )
タスク:障害物を避けてゴールすること
報酬の合計が最大となる政策を学習
Q( s, a )値の更新
76. word2vec?
単語同士の類似度を求める自然言語処理の手法
単語をベクトルで表現
MBSD CODE BLUE 2016
利用例)
単語の類似度
Input : e-mail
単語の加算・減算
word cos distance
email 0.956302
mail 0.927386
reply 0.920610
formula answer
Iraq - Violence Jordan
Human - Animal Ethics
Japan – Tokyo + France Paris
77. 類似度計算への利用例
MBSD CODE BLUE 2016
注目単語周辺の単語を基に類似度を計算
学習データ)
interpretation further. However, if anyone wishes to discuss this, I‘m certainly willing
(either offline - e-mail - or Stephen In article bevans@carina.unm.edu (Mathemagician)
writes: Just what do gay people do that straight・・・
carries archives of old alt.atheism.moderated articles and assorted other files. For more
information, send mail to archive-server@mantis.co.uk saying help send atheism/index
and it will mail back a reply. mathew An・・・
send mail to archive-server@mantis.co.uk saying help send atheism/index and it will
mail back a reply. mathew An Introduction to Atheism by Mathew. This article attempts
to provide a general introduction・・・
「e-mail」「mail」「reply」の類似度は高い
78. word2vecの学習データ
MBSD CODE BLUE 2016
The 20 Newsgroups data set.
約2万のニュースグループドキュメント集
ニュースグループ例)
コンピュータ(Graphics, MS-Windows, Hardware)
サイエンス(Cryptography, Electronics, Space)
趣味(Motorcycles, Baseball, Hockey)
79. SAIVSの訓練
MBSD CODE BLUE 2016
Windows Crypt Hardware Space
SAIVS
The 20 Newsgroups data set
類似度の学習
単語同士の類似度の習得
・・・
word2vec
151. MBSD
<!doctype html><html><head><title>Full Javascript
Injection (full.1)</title></head><body>
Hello!<BR>
The value of cgi parameter "in"
is:saivs12345
</body></html>
http://xxx/reflect/full1?in=saivs12345
出力箇所 :BODYタグ内
サニタイズ:なし
Case1:正常リクエスト送信時
CODE BLUE 2016
152. MBSD
<!doctype html><html><head><title>Full Javascript
Injection (full.1)</title></head><body>
Hello!<BR>
The value of cgi parameter "in" is:
lasther=''></form>D0i7Q"VW53N'nT7t0<script>alert(3122)
;kc5i3</script>ueFj8
</body></html>
http://xxx/reflect/full1?in=lasther=''%3E%3C/form%3ED0i7Q%22VW
53N'nT7t0%3Cscript%3Ealert(3122);kc5i3%3C/script%3EueFj8
試行回数:1回
Case1:検査リクエスト送信時
CODE BLUE 2016
169. SAIVSのデモ
MBSD CODE BLUE 2016
Top Sign up
Login New snippet
Sign up
complete
1.Sign upでアカウント作成
2.ログイン
3.Snippet 登録
4.Profile 更新
Profile
New snippet
register
Profile
update
脆弱性
170. SAIVSのデモ
MBSD CODE BLUE 2016
Top Sign up
Login New snippet
Sign up
complete
1.Sign upでアカウント作成
2.ログイン
3.Snippet 登録
4.Profile 更新
Profile
New snippet
register
Profile
update
171. SAIVSのデモ
MBSD CODE BLUE 2016
Top Sign up
Login New snippet
Sign up
complete
1.Sign upでアカウント作成
2.ログイン
3.Snippet 登録
4.Profile 更新
Profile
New snippet
register
Profile
update
172. SAIVSのデモ
MBSD CODE BLUE 2016
Top Sign up
Login New snippet
Sign up
complete
1.Sign upでアカウント作成
2.ログイン
3.Snippet 登録
4.Profile 更新
Profile
New snippet
register
Profile
update
173. SAIVSのデモ
MBSD CODE BLUE 2016
Top Sign up
Login
Sign up
complete
1.Sign upでアカウント作成
2.ログイン
3.Snippet 登録
4.Profile 更新
Profile Profile
update
New snippet
New snippet
register
174. SAIVSのデモ
MBSD CODE BLUE 2016
機能名
サニタ
イズ
出力箇所/サニタイズ
New snippet register 〇
BODY タグ内
SCRIPTタグをサニタイズ
Profile update 〇
A タグ内
「<」「>」をサニタイズ