SSブログ
エステ

無線LANの復習 [無線LAN関連]

Aircrack-ngを使う前に、無線LANとその安全性についての整理。

---
このコンテンツと関係のあるコンテンツはこちら。

Aircrack-ng のページ

Aircrack-ng newbie guide のページ
---


Aircrack-ngやその他、無線LANに関係するツールを使う際、3〜4文字のアルファベットや聞き慣れない言葉がしばしば出てきて、ちょっと混乱します。
そこで、わりとしっかり整理。


よく出てくるアルファベット3〜4文字のキーワードのほとんどは認証や暗号にまつわる用語が多いので、必然的にその周辺についてのまとめとなります。
もちろん全部知らなくても、ツールは使えますが、知っているとエラーメッセージの意味がわかりトラブルシュートがうまくゆくかもしれません。


無線LANによる通信には2つの方式があります。

・アドホックモード
 アクセスポイントを介さずに無線LAN機器同士が通信を行います。

・インフラストラクチャモード
 アクセスポイントと無線LAN機器が通信を行います。アクセスポイント
 内部でのブリッジにより、実質的に無線LAN機器同士が通信している
 ように見えます。


1台のアクセスポイントとその電波到達範囲に存在するコンピュータで構成されたネットワークをBSS(Basic Service Set)と呼びます。
BSSにはそれらを区別するための48bitのIDがつけられ、BSSIDと呼ばれます。BSSIDは通常アクセスポイントのMACアドレスが利用されます。

BSSに所属するアクセスポイントとコンピュータは同じSSID(Service Set ID)と呼ばれるIDが設定される必要があります。
SSIDは最大32文字までの任意の英数字を設定できます。


またBSS同士が接続されたネットワークとBSSを構成するコンピュータの集合をESS(Extended Service Set)と呼びます。
ESS内で設定されたSSIDはESSIDと呼ばれます。
無線LANでローミングを実現する場合、ESS内で同じESSIDを設定する必要があります。


以降では簡単のために、インフラストラクチャモードで考え、1台を無線LANアクセスポイント、もう1台を無線LAN機能付きのコンピュータとしておきましょう。



アクセスポイントとコンピュータが無線通信を行うには、おおざっぱに

・アクセスポイントから送信されたビーコン情報を元に利用できるチャネル、ESSIDの情報がコンピュータで保持される。
 または、コンピュータからESSIDをブロードキャストし、チャネル情報を得る。
・アクセスポイントとコンピュータが互いに認証を行う。
・アクセスポイントとコンピュータが互いにアソシエーションを行う。
・暗号化したデータを伝送する。

このような手順が必要です。



ここで無線LANで登場する主な暗号化方式のおさらいです。

3文字言葉のオンパレードです。

WEP-WPA2.png



WEP(Wired Equivalent Privacy)


WEPでは暗号化アルゴリズムにストリーム暗号のRC4を用います。

ストリーム暗号では暗号化・復号化の際に秘密鍵や初期化ベクトル(IV)をシードとしてキーストリームと呼ばれる任意長の疑似乱数系列を生成します。

キーストリームZと平文Pの排他的論理和(XOR)で暗号文Cが得られます。(Z XOR P = C) 

復号化には暗号文CとキーストリームZの排他的論理和をとることにより、平文Pが得られます。(C XOR Z = P)

疑似乱数発生アルゴリズムは2段階に分かれ、KSA(Key Scheduling Algorithm)と呼ばれる、疑似乱数発生器の内部状態を初期化するアルゴリズムと、PRGA(Pseudo-Random Generation Algorithm)と呼ばれる、内部状態からキーストリームを生成するアルゴリズムです。

RC4ではKSA、PRGAともに内部状態の要素を定められた手法で十分に攪拌するアルゴリズムです。
KSAに秘密鍵とIVを入力することにより初期化された内部状態を初期状態と呼びます。
初期状態をPRGAに入力することでキーストリームを出力します。


暗号アルゴリズムとしてRC4を用いるWEPですが、暗号としてのRC4とは異なります。
WEPではパケットごとに、WEPキーと呼ばれる5文字(40bit)または13文字(104bit)の文字列と24bitの初期化ベクトル(IV)を結合し、合計64bitまたは128bitのセッション鍵をKSAに入力し内部状態を初期化、PRGAにより256byte分のキーストリームを生成します。

[IV 24bit]+[WEPキー:秘密鍵 40/104bit]=[セッション鍵 64/128bit]

[セッション鍵 64/128bit]→【KSA】→【PRGA】→[キーストリーム]


ストリーム暗号に対する攻撃手法は、総当たり攻撃に加え、次の4つが存在します。

・識別攻撃
・出力予想攻撃
・内部状態復元攻撃
・鍵復元攻撃


総当たり攻撃、いわゆるブルートフォースアタックにおいて n bit のセッション鍵を用いた場合の計算量は2^nですが、その計算量よりも少ない計算量での解読法が発見された場合、その暗号は「安全でない」といえます。


ストリーム暗号の安全性は平文の一部を推測可能という条件の下で評価されます。

平文の一部Pが得られているとき、スニッフした暗号文の一部Pを利用することにより、

P XOR C = P XOR (Z XOR P) = P XOR (P XOR Z) = φ XOR Z = Z

と、キーストリームの一部Zを得ることが可能です。

P XOR C = Z
Z XOR P = C
C XOR Z = P

これらから、P、C、Zのうち二つが得られれば残りの一つが得られることが判ります。

重要な点は、キーストリームの品質がストリーム暗号の安全性を左右すると言うことです。
たとえば、キーストリームの一部から他のキーストリームが得られれば、上記排他論理和の通り、対応する平文が得られますし、キーストリームの一部から秘密鍵や初期状態を得られるのであればキーストリーム全てが解けるため、暗号文は解読されてしまいます。


4つの攻撃手法の中で脅威になるものは、キーストリームの一部から初期状態を復元し、そこからキーストリーム全体を解く「内部状態復元攻撃」と、キーストリームの一部から秘密鍵を解く「鍵復元攻撃」です。



ここで、実際のWEPフレームを見てみますと、初期化ベクトル(IV)が平文で格納されていることがわかります。

80211frame.png


したがって、64bitまたは128bitのWEP鍵のうち24bitはパケットごとに変わりますが平文なので容易に取得できることと、残り40bitまたは104bitのWEPキーは通常固定されていることになります。

RC4では同じIVからは同じ鍵が作られますから、同じキーストリームが生成されます。
IVは24bit、つまり16777216通りあることになりますが、一定の条件を満たすIVはキーストリームとIV、WEP鍵との間に強い相関があることが示されています。
いわゆるWeakIVと呼ばれるものですが、このIVを利用してキーストリームを作成した場合、キーストリームの先頭にWEP鍵の情報が漏れ、鍵の全数検索に比べ少ない計算量で鍵を算出することが可能で、鍵復元攻撃の一種でFMS攻撃と呼ばれ、多くのクラッキングツールに組み込まれています。


さらにこの相関について、理想的な暗号である場合の相関との偏差を利用し、効率的に鍵を推定する方法が生み出され、PTW攻撃と呼ばれています。
この偏差を評価するための式を攻撃方程式または攻撃関数 A と呼び、A[i] は K[i] の推定値を意味します。

PTW攻撃では、内部状態とキーストリームの相関について、理想的な暗号である場合と相関がある場合での偏差を利用するため、実際に使われたキーストリームが必要となります。

実際にスニッフできるのはキーストリームと平文との排他的論理和(Z XOR P = C)しか得られないので、それでは困ることになるわけですが、特定のパケットについては一部のデータフレームが知られており、つまり平文Pが判ることになるため、P XOR C = Z からキーストリームを特定することが可能です。


ここで言う特定のパケットとは、たとえば、ARPパケットがそれに該当します。
ARPパケットのLLC/SNAPヘッダは、 AA-AA-03-00-00-00-08-06 で固定されており、さらにその後の8バイトもリクエスト時は、00-01-08-00-06-04-00-01で固定、レスポンス時は00-01-08-00-06-04-00-02で固定という具合に、固定されています。

これを用いることにより、キーストリームの頭16byte分が得られます。

またそれに対応する初期化ベクトルは平文で入手できます。


セッション鍵Kを24bitの初期化ベクトルIVと104bitの秘密鍵Rkとするとき、K[]、IV[]、Rk[]を8bitの変数として、

セッション鍵     K = { K[0], K[1], … ,K[15] }
初期化ベクトル IV = { IV[0], IV[1], IV[2] }
秘密鍵            Rk = { Rk[0], Rk[1], … ,Rk[12] }

{K[0], K[1], K[2], K[3], … ,K[15] } = {  IV[0], IV[1], IV[2], Rk[0], … , Rk[12] }

と表せます。

一方、RC4では、時刻 t におけるKSAの内部状態 S(t) は2つのポインタ i, j と K[x] (x = 0,1, … ,15) の関係式で与えられており、S(3) は IV[0], IV[1], IV[2] を用いて計算できます。

ARPパケットからキーストリーム Z = { Z[0], Z[1], …, Z[15] } が得られ、PTW攻撃関数 A[i] の定義から、S(3)と得られたキーストリームZより、A[0], A[1], …, A[12] が計算できます。

得られたARPパケットと初期化ベクトルの対に全てに対して、この計算を実施します。

それにより、A[0], A[1], …, A[12] のそれぞれに対して発生し得た0〜255までの数値についての頻度をカウントします。
各A[i]はK[i]の推定値でしたので、頻度が最も高かった数値をK[i]の候補として、セッション鍵を得ます。
およそ4万パケット程度を得ることにより、104bitの秘密鍵を得ることが可能です。


さらに発展したTeAM-OK攻撃では、暗号化された通常のIPパケットを得るだけで104bitの秘密鍵が得られるようです。


これら、WEPの脆弱性の原因は暗号化アルゴリズムのRC4ではなく、その使い方に問題があったということになります。
そして、鍵は変化しないため一度解読すれば、だれでもアクセスポイントに接続できます。


以上の事柄がおおむねわかっていれば、WEPを対象としてAitcrack-ngを利用する上で、用語ややっていることの意味がわからなくて困ることはないかと思われます。

WEPの脆弱性を克服した規格が、WPA(Wi-Fi Protected Access)、あるいは、WPA2(Wi-Fi Protected Access2)です。


WPA、WPA2については、また別の機会に。


[参考]

 

Breaking 104 bit WEP in less than 60 seconds

Erik Tews, Ralf-Philipp Weinmann, and Andrei Pyshkin

TU Darmstadt, FB Informatik Hochschulstrasse 10, 64289 Darmstadt, Germany

http://eprint.iacr.org/2007/120.pdf

 

 

Using the Fluhrer, Mantin, and Shamir Attack to Break WEP

Adam Stubblefield John Ioannidis Aviel D. Rubin

http://www.isoc.org/isoc/conferences/ndss/02/papers/stubbl.pdf

 


nice!(0)  コメント(42)  トラックバック(2) 
共通テーマ:パソコン・インターネット

nice! 0

コメント 42

Jeashibia

Zithromax Picture Levitra Prix Italie Spirulina [url=http://tadalafonline.com]cialis without a doctor's prescription[/url] Amoxicillin 250mg Description Viagra Forum Best Pharmacy In Canada Comprar Propecia Sin Receta [url=http://genericcial.com]cialis[/url] Wirkung Von Viagra Wiki Cialis Generika Bewertung Dapoxetina Shopping
by Jeashibia (2019-01-02 02:14) 

Jeashibia

Can I Buy Cialis Without Prescriptio Viagra Dapoxetine Online Purchase 259 [url=http://rxbill6.com]levitra shipped from us[/url] Buy Viagra In Brisbane 58 Spertomax [url=http://asacdz.com]generic cialis from india[/url] Does Amoxicillin Work On Dogs Does Generic Viagra Really Work Buy Cialis With No Perscription Viagra Espagne [url=http://drugs2k.net]buy generic cialis[/url] Acheter Du Viagra En Toute Confiance Cheap Soft Viagra
by Jeashibia (2019-01-31 20:55) 

Jeashibia

Prednisone Without Prescription In Uk [url=http://achetercialisfr.com]acheter cialis original ligne[/url] Viagra Que Es Viagra Pfizer Effets Secondaires Where To Order Finasteride Medicament Acheter Levitra Prix Alli Xenical Cialis 10mg Prix [url=http://cialgeneric.com]cialis from canada[/url] Amoxicillin Medicine Canadianbreez Neurontin 300mg Drugs33 [url=http://cialicheap.com]cialis without a doctor's prescription[/url] Keflex Not Work Canadian Viagra 400mg Cialis Pas Cher Montpellier Cialis Gгјnstig Kaufen 40mg Ciallis [url=http://etrobax.com]tadalafil cialis from india[/url] Purchase Amoxycillin 25o Mg Buy Female Viagra In India Kamagra Generique Suisse Cialis Generico Consigli [url=http://uscagsa.com]cheapest cialis[/url] Cialis Modo Empleo Genericos De Propecia Comprar
by Jeashibia (2019-02-09 14:00) 

Jeashibia

Cephalexin 500 Mg Sinus Infections Discount fedex isotretinoin with overnight delivery medication overseas [url=http://drisdol.com]cheapest cialis 20mg[/url] Cephalexin And Urinary Tract Infections
by Jeashibia (2019-02-20 02:51) 

AustJath

Generic Real Clobetasol Free Shipping Cheap Store Achat Cialis Generique 24h Canadian Pharmacy [url=http://try-rx.com]generic cialis from india[/url] Prix Viagra Levitra Cialis Cialis Jaune
by AustJath (2019-05-08 17:13) 

Kelavaify

Comment Durer Longtemps [url=http://cidovir.com]cialis online[/url] Free Viagra Lasix Sweden
by Kelavaify (2019-06-07 16:47) 

RandMES

Can Amoxicillin Kill Yeast Ceallas And Viag For Sale Feline Urinary Tract Infection And Amoxicillin [url=http://drugsir.com]online cialis[/url] Walmart Rx Plans
by RandMES (2019-06-13 13:03) 

StevNite

Viagra Indian Pharmacy Cialis Auch Billiger [url=http://cial40mg.com]cialis price[/url] Kamagra 100mg Erfahrung
by StevNite (2019-06-16 08:31) 

AustJath

Priligy Opiniones [url=http://ausgsm.com][/url] Kamagra Oral Jellies Preis Erythromycin Price In Las Vegas Kamagra Jelly 100mg Tolosa
by AustJath (2019-06-17 10:24) 

Kelavaify

Cialis Viagra Hypertension Propecia Contradicciones Viagra Tabletten [url=http://etrobax.com]buy cialis online[/url] Europa Kamagra Vendita Propecia Para Mujeres
by Kelavaify (2019-06-18 22:36) 

RandMES

Spanish Pharmacies Online [url=http://cialtadalaff.com]cialis without a doctor's prescription[/url] Free Shipping Zentel Best Website Tablets Amex Accepted Stendra Avana Low Price Drugs Overseas Venta Cialis Sin Receta
by RandMES (2019-06-26 13:58) 

RandMES

500mg Penicillin For Std To Buy Kamagra Villeurbanne 100mg [url=http://mdsmeds.com]generic cialis overnight delivery[/url] Dutasteride Canada Overnight Shipping Overseas On Line Xenical Pas Cher France
by RandMES (2019-07-09 05:16) 

StevNite

Viagra Belgium 5mg Cialis Canada Lioresal Pas Cher [url=http://cialonlineno.com]cialis prices[/url] Cialis 20 Bestellen Viagra From Mexico Pharmacy
by StevNite (2019-07-12 02:59) 

Kelavaify

Buying Anipryl Without A Prescription Tadalis Sx Original All Pill Shop [url=http://rxbill7.com]generic cialis overnight delivery[/url] Soft Viagra
by Kelavaify (2019-07-13 17:55) 

StevNite

Does Amoxicillin Cause Headaches Kamagra South Africa [url=http://cialcost.com]cialis price[/url] Viagra Questions Costo Cialis Generico Can Cephalexin Damage Liver
by StevNite (2019-07-21 22:01) 

Kelavaify

Stendra Where To Buy [url=http://ciali20mg.com]cialis online[/url] Acheter Tadalis Sx 10 Mg Isotretinoin With Free Shipping Visa Low Cost Drugs From Canada
by Kelavaify (2019-07-26 10:59) 

Estuase

Amoxicillin For Diabetic And Elderly [url=https://cheapcialisll.com/]Cialis[/url] Last Longer Tips <a href=https://cheapcialisll.com/#>Cheap Cialis</a> Preise Viagra Bestellen
by Estuase (2020-06-22 17:59) 

Wilsonvor

chloroguine
[url=https://chloroquineorigin.com/#]chloroquine price in india[/url]
erectile dysfunction causes
[url=https://erectiledysfunctionpillscvs.com/#]erectile health[/url]
hydroxychloroquine 400 mg
[url=https://hydroxychloroquinex.com/#]hcq[/url]
erectile issues
[url=https://plaquenilx.com/#]plaquenil drug[/url]
toptada
[url=https://tadalisxs.com/#]tadalafil pills 20mg[/url]
zithromax instructions
[url=https://zithromaxes.com/#]zithromax pfizer[/url]
by Wilsonvor (2021-01-20 22:09) 

couples counseling in phoenix az

impressive knowledge


by couples counseling in phoenix az (2021-07-05 09:46) 

couples counseling fort wayne in

Making sure it's fine


by couples counseling fort wayne in (2021-07-05 09:46) 

Aberthap

коли закінчиться війна в україні <a href="http://bitly.com/skilky-shche-bude-tryvaty-viyna-v-ukrayini">скільки буде тривати війна в україні 2022</a> скільки ще буде тривати війна в україні
by Aberthap (2022-03-05 11:03) 

Abrthap

https://bitbin.it/M6s1z3Ei/
by Abrthap (2022-03-12 14:05) 

Abrthap

https://t.me/holostyaktntofficial2022
by Abrthap (2022-03-12 18:23) 

Abrthap

https://t.me/holostyaktntofficial2022
by Abrthap (2022-03-14 17:09) 

Abrthap

<a href="https://t.me/filmfilmfilmes/18">Последний богатырь 2</a>
by Abrthap (2022-03-19 06:04) 

Abrthap

<a href="https://t.me/filmfilmfilmes/23">Во все тяжкиеё</a>
by Abrthap (2022-03-20 06:01) 

안전놀이터

Lee Woo-kyung defeated Lee Mi-rae, who lost her will to chase, 11-7, and finished the third set with a victory. Cha Yu-ram and Yong Hyun-ji, who played around the same time, recorded long-term hits up to

by 안전놀이터 (2022-03-30 04:49) 

먹튀검증

Only in the eighth inning did the scoring path, which had been blocked with one run each, break through, but failed to hit clearly. It was only in 13 innings that Cha Yu-ram broke the wall of another long hit with

by 먹튀검증 (2022-03-30 04:49) 

먹튀검증커뮤니티

However, once he set the mood, Cha Yu-ram also won the second set 11-8. In the third set, five high-run points broke out at the last minute, ending the game 11-6. As a result, Cha Yu-ram, who won the set score

by 먹튀검증커뮤니티 (2022-03-30 04:50) 

안전놀이터

The World Golf Championship Dell Technologies Match Play, which follows the Professional Golf Tour Players Championship, which ended two weeks ago, is another special tournament that will touch a lot of

by 안전놀이터 (2022-03-30 04:50) 

안전놀이터순위

The prize money for winning the Players Championship, which ended on the 15th, was $3.6 million, the largest in PGA Tour history. In 70th place, the last place among the preliminary passers also received $41,000

by 안전놀이터순위 (2022-03-30 04:50) 

먹튀검증커뮤니티

The Dell Technologies Match Play, which will be held at Austin Country Club in Austin, Texas, from the 24th, will also receive a lot of prize money. It will be organized and held as a regular tournament for the PGA

by 먹튀검증커뮤니티 (2022-03-30 04:50) 

먹튀검증커뮤니티

Ko Jin-young kept the top spot, but failed to set a new record for the 60s in consecutive rounds. Ko Jin-young tied three birdies and two bogeys to score a 1-under 71 in the second round of the JTBC Classic

by 먹튀검증커뮤니티 (2022-03-30 04:51) 

pg joker

<a href="https://pgslot-th.com/%e0%b8%9a%e0%b8%a3%e0%b8%b4%e0%b8%81%e0%b8%b2%e0%b8%a3-pg-slot/pg-joker/">pg joker</a> has many promotions for you to choose, special privileges for our special members, when registering as a new member, receive an instant bonus of the deposit amount. Fun game plus unlimited money, PG slot , only one website.
by pg joker (2022-10-07 22:04) 

ak88bet

ak88bet is the most suitable online casino, original and not copied. from another website ready to feel Have fun, fun with exciting games and earn money with pg slot-th.com. Easy to break. Get real money.
by ak88bet (2022-10-07 22:05) 

totoforce

Thank you for your post. The article is neatly organized with the information I want, so there are many things to refer to. Add this site to your favorites and visit frequently later. Thank you again.^^

토토사이트 https://totoforce.com/
by totoforce (2022-12-09 15:35) 

majornoriter

I found this blog. For what you have suggested to us, I have found some new data in your post, all things considered. The cerebrum is incredibly satisfying and I am all thanks to the astonishing degree of your article.

토토사이트 https://majornoriter.com/
by majornoriter (2022-12-09 15:36) 

totoguy

I would like to compliment you for your expert opinion on the subject you have written. How can you understand it so easily? Also, how good the quality of information is. I know your efforts to write this article better than anyone else. Thank you for sharing a good message. 메이저사이트

https://totoguy.com/
by totoguy (2022-12-12 13:21) 

totovi

Wow! It could be an incredible and valuable post. Actually, I really like it. It's so cool. It's so cool. I was just surprised. I want you to simply try and perform your functions similar to this download. 사설토토사이트

https://totovi.com/
by totovi (2022-12-12 13:22) 

jaeseu

I love it I'd love to see work like this and I've got some really cool results for you to see.
I'm so glad that you're updating us regarding this matter. Thanks for sharing.

제이나인 먹튀 카지노
제이나인 먹튀 보증 사이트
제이나인 먹튀 사이트 조회
제이나인 먹튀 인증
제이나인 온라인 카지노 추천
https://www.j9korea.com
<a href="https://www.j9korea.com" title="제이나인 토토 꽁 머니 ">제이나인 토토 꽁 머니 </a>
by jaeseu (2022-12-27 14:07) 

สล็อตฟรี

<a href="https://pg-slot.game/pg-slot/%e0%b8%aa%e0%b8%a5%e0%b9%87%e0%b8%ad%e0%b8%95%e0%b8%9f%e0%b8%a3%e0%b8%b5/">สล็อตฟรี</a>บโบนัสเครดิตฟรี 50% เพียงแค่สมัครสมาชิกเท่านั้น เปิดให้บริการตลอด 24 ชั่วโมง เล่นได้บนมือถือทุกระบบ
by สล็อตฟรี (2023-05-07 05:16) 

ทางเข้า slotkingkong 569

ทางเข้า slotkingkong 569 เพื่อความบันเทิงที่ไม่หยุดนิ่งและชัยชนะครั้งใหญ่ PGSLOT เรียนรู้เกี่ยวกับประสบการณ์ กลยุทธ์ และอื่นๆ เตรียมออกเดินทางสู่ความสนุก!คุณพร้อม
by ทางเข้า slotkingkong 569 (2023-08-21 19:08) 

コメントを書く

お名前:
URL:
コメント:
画像認証:
下の画像に表示されている文字を入力してください。

トラックバック 2

この広告は前回の更新から一定期間経過したブログに表示されています。更新すると自動で解除されます。