SlideShare a Scribd company logo
1 of 141
Download to read offline
1
from ZareGoto
uzzingF
Ashigirl96
2
from ZareGoto
uzzingF
Ashigirl96
(入門)
3
Self - Introduction
Handle Name: Ashigirl96 - あしがる 西村 礼恩
趣味: Twitter
専門: Network/Control System Security
言語: Python
好きなもの: Scapyとママの作ったオムライス
キャンプのきっかけ
もともとパソコンをあまり触ってなかったけど、
まっちゃ139(去年の1,2月)に興味行ったら、
セキュリティに興味持って、
応募用紙に名前書いたら、
もともとパソコンをあまり触ってなかったけど、
まっちゃ139(去年の1,2月)に興味行ったら、
セキュリティに興味持って、
応募用紙に名前書いたら、
受かりました。
いきなりですが…
8
Scapy is 何?
9
いず 何?
10
is 何?
Fuzzing
11
というほど、おおげさなものではありません…。
12
13
と、言いたいですが…
14
(☝ ՞ਊ ՞)☝
中二病君
自動車.....
15
(☝ ՞ਊ ՞)☝
中二病君
http://policecar.nomaki.jp/1.jpg
16
(☝ ՞ਊ ՞)☝
中二病君
http://home-bb.biz/wp-content/uploads/2013/07/c5cdaf66f8642101a3da8a60ec825ecf.jpg
17
(☝ ՞ਊ ՞)☝
中二病君
工場.....
18
(☝ ՞ਊ ՞)☝
中二病君
http://cdn-ak.f.st-hatena.com/images/fotolife/w/wami/20090219/20090219234336.jpg
19
(☝ ՞ਊ ՞)☝
中二病君 http://tomtittot.asablo.jp/blog/img/2012/04/23/1f4451.jpg
20
(☝ ՞ਊ ՞)☝
中二病君
リア充.....
21
(☝ ՞ਊ ՞)☝
中二病君
http://yaplog.jp/cv/warabidani/img/138/earthmoon_p.jpg
22
(☝ ՞ਊ ՞)☝
中二病君
http://yaplog.jp/cv/warabidani/img/138/earthmoon_p.jpg
23
に繋がるかも…
不謹慎ですみまへん
24
(o´・ω・`)
25
(ヾノ・ ・`)ナイナイ
Scapy とは、
26
27
Scapy is a powerful interactive packet manipulation
program.
http://www.secdev.org/projects/scapy/にて
28
Scapy is a powerful interactive packet manipulation
program.
It is able to forge or decode packets of a wide
number of protocols
29
Scapy is a powerful interactive packet manipulation
program.
It is able to forge or decode packets of a wide
number of protocols
send them on the wire, capture
them, match requests and replies,
and much more.
30
Scapy is a powerful interactive packet manipulation
program.
It is able to forge or decode packets of a wide
number of protocols
send them on the wire, capture
them, match requests and replies,
and much more.
andle most classical tasks like scannin
, probing, unit tests, attacks or networ
an replace hping, 85% of nmap, arpspo
ng, tcpdump, tethereal, p0f, etc.). It als
well at a lot of other specific tasks that m
an't handle, like sending invalid frame
r own 802.11 frames, combining techni
g+ARP cache poisoning, VOIP decoding
31
平たくいえば、
32
平たくいえば、簡易パケット生成モジュール in Python
33
次に、
制御システム とは、
34
35
---- from kotobank.jp
36
それは重要じゃない。
37
???
38
興味あるのは、制御システムのセキュリティ
39
では、制御システムのセキュリティで有名なのは
40
組織、システム自体のレイヤ、制御システムの業界、

それぞれの標準が提案されている
41
組織、システム自体のレイヤ、制御システムの業界、

それぞれの標準が提案されている
IEC62443
注目されている
42
IEC62443シリーズ統合化(しつつある)
WIB (nternational Instrument User’s Association)
!
ISCI (ISA Security Compliance Institut)
!
EDSA認証
43
EDSA認証対象
44
EDSA認証対象
制御システム向けの組み込み機器
45
組み込み機器は、組み込みソフトウェアのプロセスの制御、監視を実行する
46
EDSA認証は3つにカテゴリできる
ソフトウェア開発セキュリティ評価(SDSA)
機能セキュリティ評価(FSA)
通信ロバストネス試験(CRT)
Level1 Level2 Level3
47
一旦ここまで…次に、
とは、
48
Fuzzing
49
Fuzzingとは、意図的なデータ(Fuzz)をプログラムに
自動的に与えることで、クラッシュやバグを発見するプロセスのことです。
50
つまり、脆弱性を見つけるプロセス。
51
Fuzzデータはvictimによって変わります。
52
For Example:
HTTPリクエスト --->----
Webサーバ(足軽画伯)
GET / HTTP/1.1

Host: www.hoge.jp

Host: www.hoge.jp

Host: www.hoge.jp

Host: www.hoge.jp

Host: www.hoge.jp
53
For Example:
異常なコマンドライン
54
For Example:
他にも、デバイスがプロトコル実装が正確に作動していて、
悪意のあるネットワークトラフィックにも対応できるか
というテストをしていきます。
なら、こんなことできるのではないか。
55
次の3つを組み合わせてみました。
56
57
・ターゲット: 制御システムで使うプロトコル
58
・ターゲット: 制御システムで使うプロトコル
・何をするか: ファジングによる脆弱性発見
59
・ターゲット: 制御システムで使うプロトコル
・何をするか: ファジングによる脆弱性発見
・ツール: Scapy
60
今回使うプロトコル DNP3.0
61
DNP3.0とは
Distributed Network Protocol
HMI/SCADA∼RTU間で使用されてる通信プロトコル
米国で多用
62
DNP3.0とは
レイヤはこのように
なっています
63
もっと…もっと詳しく
Application Layer
64
65
Transport Function
66
Data Link Layer
67
それぞれのFieldをScapyを使い記述します
68
難しい?
69
うん、難しい
70
っ Scapy Reference
71
72
興味ある人はここで調べてください☆
73
95 FunctionCode = {!
96 0:"Confirm ",!
97 1:"Read ",!
98 2:"Write ",!
99 3:"Select ",!
100 4:"Operate ",!
101 5:"Dir operate ",!
102 6:"Dir operate – No resp ",!
103 7:"Freeze ",!
104 8:"Freeze – No resp ",!
105 9:"Freeze clear ",!
106 10:"Freeze clear – No resp ",!
107 11:"Freeze at time ",!
108 12:"Freeze at time – No resp ",!
109 13:"Cold restart ",!
110 14:"Warm restart ",!
111 15:"Initialize data ",!
112 16:"Initialize application ",!
113 17:"Start application ",!
114 18:"Stop application ",!
115 19:"Save configuration ",!
116 20:"Enable unsolicited ",!
!
(オレオレ)コードの一部①
74
117 21:"Disable unsolicited ",!
118 22:"Assign class ",!
119 23:"Delay measurement ",!
120 24:"Record current time ",!
121 25:"Open file ",!
122 26:"Close file ",!
123 27:"Delete file ",!
124 28:"Get file information ",!
125 29:"Authenticate file ",!
126 30:"Abort file "!
127 }!
128 class DNP3QR(Packet):!
129 name = "DNP3.0 request"!
130 fields_desc = [!
131 #Application Header!
132 #Application Control!
133 XByteField('seq',0),!
134 BitField('uns',0),!
135 BitField('con',0),!
136 BitField('fin',0),!
137 BitField('fir',0),!
138 !
139 #Function Code!
140 ShortEnumField("type", 1, Funct
(オレオレ)コードの一部②
75
DNP3.0プロトコルで使われるデータに合わせたファズデータを作る
76
ここを意識しましょう
・整数オーバーフロー
・バッファオーバーフロー
・Off by one
・境界値未チェック
・異常フラグ
・サービス妨害攻撃
・リソース異常消費
77
実は、まだ作ってる最中で…
78
話飛びます。
79
ちょっと前のインシデント
80
Stuxnet
81
の、(インシデント)概要。
82
1.USBメモリやインターネットを通じて情報システムへの侵入
83
2.システムの脆弱性を利用し、権限昇格、システム環境内部でウィルスの拡散実行
84
3.バックドアを作成し、外部指令サーバ(C&Cサーバ)や
80番ポート(HTTP)を介し通信し、ウィルスの増強化
85
4.組織内のネットワークに入り、制御システムへの侵入
86
5.制御システム上にある装置に対する攻撃実行
87
ヤバイ
88
Function of Stuxnet
89
1. 500 KBのプログラムで4000弱の機能を持っている
90
2. 複雑/オブジェクト指向
91
3. 複数のゼロデイを利用
92
4. 2つのrootkitを使用し、制御システムをターゲットとしている
93
5. Windowsに詳しい、制御システムであるWinCC/Step7についても詳しい
94
Stuxnetが出るまでの前後
95
汎用製品や標準プロトコルで構成されている情報システム
(以前)
96
(以前)
制御システムのオープン化(汎用製品や標準プロトコルの 利用)
97
(以前)
端末の9割以上がWindows系を利用している
98
How to 対策
99
How to 対策
個別攻撃手法の回避法
100
システム設計時におけるネットワーク設計
101
システム設計時におけるネットワーク設計
『外部との隔離や接続ルートの明確』
102
外部との通信における接続先のフィルタリング
103
外部との通信における接続先のフィルタリング
&&
外部との接続点における通信の監視、制御機構
104
どうですか?



中二病妄想力の足しになりましたでしょうか?
105
参考資料(Scapy):
http://fossies.org/dox/scapy-2.2.0/
http://www.secdev.org/projects/scapy/doc/build_dissect.html
http://www.secdev.org/projects/scapy/doc/advanced_usage.html
106
参考資料(DNP3.0):
http://www.dnp.org/default.aspx
http://www.softech.co.jp/mm_120404_firm.htm
http://www05.abb.com/global/scot/scot229.nsf/veritydisplay/
65b4a3780db3b3f3c2256e68003dffe6/$file/rec523_dnpprotmanend.pdf
107
参考資料(Fuzzing):
http://www.ipa.go.jp/security/vuln/fuzzing.html
http://lifeofpentester.blogspot.jp/2013/10/
fuzz-testing-web-applications-with-burp.html
108
ご清聴ありがとうございました。
109
話しそれますが…
110
演習しましょう!
111
(実践的に)Scapy使ってみよう...!!
112
こんなことしたい。
113
1.ettercapでARPキャッシュポイゾニングします

2.ettercapでキャプチャしたパケットをScapyで解析します

3.解析したのをPythonでごみょごみょして、ソースコードを取り出します。

4.それを某サイトに送ります。
114
使うもの、ettercap、Scapy
115
192.168.1.17(Backtrack5)
192.168.1.4(Mac)
某サイト
116
192.168.1.17(Backtrack5)
192.168.1.4(Mac)
ARPキャッシュポイズニング
某サイト
117
192.168.1.17(Backtrack5)
192.168.1.4(Mac)
ARPキャッシュポイズニング
某サイト
ソースコード投げる
118
192.168.1.17(Backtrack5)
192.168.1.4(Mac)
ARPキャッシュポイズニング
某サイト
ソースコード投げる
BT5が奪取(?)
119
192.168.1.17(Backtrack5)
192.168.1.4(Mac)
ARPキャッシュポイズニング
某サイト
ソースコード投げる
解析...
120
Ettercapは、スイッチドLAN環境のための多
目的なスニファ/インターセプター/ロガー
です。多くのプロトコル(暗号化されたもの
も含む)のアクティブもしくはパッシブな分
析をサポートし、ネットワークとホスト分
析のための多くの機能を含んでいます。
121
Ettercapは、スイッチドLAN環境のための多
目的なスニファ/インターセプター/ロガー
です。多くのプロトコル(暗号化されたもの
も含む)のアクティブもしくはパッシブな分
析をサポートし、ネットワークとホスト分
析のための多くの機能を含んでいます。
長い
122
Ettercapは、スイッチドLAN環境のための多
目的なスニファ/インターセプター/ロガー
です。多くのプロトコル(暗号化されたもの
も含む)のアクティブもしくはパッシブな分
析をサポートし、ネットワークとホスト分
析のための多くの機能を含んでいます。
長い
長い
123
Ettercapは、スイッチドLAN環境のための多
目的なスニファ/インターセプター/ロガー
です。多くのプロトコル(暗号化されたもの
も含む)のアクティブもしくはパッシブな分
析をサポートし、ネットワークとホスト分
析のための多くの機能を含んでいます。
長い
長い
長い
124
Ettercapは、スイッチドLAN環境のための多
目的なスニファ/インターセプター/ロガー
です。多くのプロトコル(暗号化されたもの
も含む)のアクティブもしくはパッシブな分
析をサポートし、ネットワークとホスト分
析のための多くの機能を含んでいます。
中二病の
おもちゃ
125
http://sourceforge.jp/projects/sfnet_ettercap/
ここからダウンロード出来ます!
126
1.ettercapでARPキャッシュポイゾニングします

2.ettercapでキャプチャしたパケットをScapyで解析します

3.解析したのをPythonでごみょごみょして、ソースコードを取り出します。

4.それを某サイトに送ります。

5.正答します。
127
128
%ettercap -T -M arp -i eth1 /192.168.1.4/ /192.168.1.1/ -w 01.pcap
コマンド
129
%ettercap -T -M arp -i eth1 /192.168.1.4/ /192.168.1.1/ -w 01.pcap
コマンド
use text only CUI
130
%ettercap -T -M arp -i eth1 /192.168.1.4/ /192.168.1.1/ -w 01.pcap
コマンド
METHOD:ARGS perform a mitm attack



in this case , ARP cache poisoning
131
%ettercap -T -M arp -i eth1 /192.168.1.4/ /192.168.1.1/ -w 01.pcap
コマンド
-i, –iface use this network interface

in this case, use 'eth1'
132
%ettercap -T -M arp -i eth1 /192.168.1.4/ /192.168.1.1/ -w 01.pcap
コマンド
Attacker and victim
133
%ettercap -T -M arp -i eth1 /192.168.1.4/ /192.168.1.1/ -w 01.pcap
コマンド
-w, –write write sniffed data to pcapfile
134
とあるサイトで…192.168.1.4(victim)が…
135
1.ettercapでARPキャッシュポイゾニングします

2.ettercapでキャプチャしたパケットをScapyで解析します

3.解析したのをPythonでごみょごみょして、ソースコードを取り出します。

4.それを某サイトに送ります。
136
図1.
137
図2.
138
図3.
139
図4.
140
演習…終わりです…
141
ありがとうございました!!

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
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)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
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...
 

Fuzzing