Rudy Ruckerの同名の著書とは直接関係ありませんが、私の思考の道具箱であることは確かです。大抵のページは書きかけで、内容も不完全ですのでご注意を。

WPAのクラッキング手法を理解する:痛烈な一撃だったが、まだ破られたわけではない

Battered, but not broken: understanding the WPA crack
元記事:http://arstechnica.com/articles/paedia/wpa-cracked...

By Glenn Fleishman | Published: November 06, 2008 - 07:25PM CT

スリムなベクタ(データ)を探すことから始まる

Finding a slim vector

学者たちが、無線LANの暗号化方式としてポピュラーな規格の弱点を発見した。
それは802.11iという規格の一部でWPAの基礎となる部分にあった。つまり、このセキュリティホールは世界中の無線LANルータに影響がある。ドイツErik Tewsとaricrack-ngのメンバーであるMartin Beckが11/12にTokyoで開かれるPacSecで論文を発表する。この論文では、WPAの前身の規格の名残りを利用して、どのようにWPAをクラックしたかが明らかにされる。
Academic researchers have found an exploitable hole in a popular form of wireless networking encryption. The hole is in a part of 802.11i that forms the basis of WiFi Protected Access (WPA), so it could affect routers worldwide. German graduate student Erik Tews will present a paper at next week's PacSec in Tokyo coauthored with fellow student and aircrack-ng team member Martin Beck that reveals how remnants of WPA's predecessor allow them to slip a knife into a crack in the encryption scheme and send bogus data to an unsuspecting WiFi client.

Tewsは独Darmstdt工科大学のPhD課程で暗号について学んでいるが、その試問で、TewsはWEPに対する既存の攻撃方法を修正して、TKIP(Temporal Key Integrity Protocol)を使っているネットワークにどんなデータでも流し込めるslim vectorを得る方法を説明した。(論文の共著者のBeckはDresden工科大学の学生であるが、発見者として論文に記載されている)
In an interview from Germany, where he is a PhD candidate studying encryption at the Technical University of Darmstadt, Tews explained that an existing attack on Wired Equivalent Privacy (WEP) was modified to provide a slim vector for sending arbitrary data to networks that use the Temporal Key Integrity Protocol (TKIP). (Tews' collaborator Beck is a student at the Technical University of Dresden; Tews credits Beck with the discovery, after which they jointly developed the paper that Tews will present at PacSec.)

Tews/Beckの手法によれば、まず、攻撃者は、ネットワークに流れているパケットを監視して、チェックサムに関係するようなちょっとした細工をして、アクセスポイントのルータへとパケットを戻し、それに対する応答を調べる。
Tewsいわく、「この手法は、暗号化鍵を得るためのものじゃない。それぞれのパケットの内容を暗号化された状態から復号できるようにするんだ」
この手法は、短いパケットにのみ通用するが、それだけでもARPを混乱させたり、DNS情報の成りすましや汚染が可能だ。
With the Tews/Beck method, an attacker sniffs a packet, makes minor modifications to affect the checksum, and checks the results by sending the packet back to the access point. "It's not a key recovery attack," Tews said, "It just allows you to do the decryption of individual packets." This approach works only with short packets, but could allow ARP (Address Resolution Protocol) poisoning and possibly DNS (Domain Name Service) spoofing or poisoning.

Practical Attacks against WEP and WPA”と題された論文はすでにダウンロードできる。
The paper, Practical Attacks against WEP and WPA, is now available for download.

暗号化の脆弱性の歴史

A history of encryption weakness

IEEEの標準化グループから802.11bの仕様が出されたとき、電波に乗せて傍受可能な状態で平文を送るのはためらわれたのか、最初から暗号化の機能が仕様に含まれていた。
The 802.11b specification from the IEEE engineering standards group came with a basic encryption mechanism built in to assuage worries that data would simply be sent in the clear.
WEP(Wired Equivalent Privacy)は、有線LAN(ethernet)と同程度のセキュリティを実現しようとして制定された。しかし、すぐ破られてしまった。2001年に最初に破られ、2004年には全く役に立たないレベルとされた。ある研究者によれば、1分もあれば、ネットワークで使われているWEPの暗号化鍵を破れるというのだ。(したがって、企業の多くはVPNを利用して、脆弱な無線LANアクセスポイントを経由して接続するユーザのセキュリティを確保するようになった)
Wired Equivalent Privacy (WEP) had as its goal a simple baseline: be as secure as an Ethernet jack. It quickly failed. Cracks were seen in 2001, and it was thoroughly broken as early as 2004. Some researchers claim to be able to recover a WEP key in under a minute from an active network. (Most corporations relied on virtual private network connections, which were tunneled through access points located outside a strong firewall, to allow WiFi use without compromising the network.)

より強力な暗号化でWEPを置き換えるために、802.11iの仕様策定グループが作られた。そして2つの解決策ができた。1つは過去の資産を利用する方向で、もう1つは全く新しい仕様だった。
過去の資産を利用するもの:802.11iの仕様では、1991年からこれまで出荷されたすべての無線LAN機器をカバーするTKIPという規格を定めた。
The 802.11i task group was formed to replace WEP with something stronger, and they came up with two separate solutions: one looking backwards, the other forwards. Looking back, 802.11i encompassed all WiFi devices ever shipped―starting in 1999―with TKIP.
TKIPは、古いカードでも、ファームウェアやデバイスドライバを改変することで対応可能だった。TKIPによるセキュリティ改善のほうが先に実現し、WPAとして業界から認知された。(誰でも802.11に準拠するカードはつくれるが、テストしてもらって、WPA対応としてラベルを貼ってもらうには、業界団体に金を払う必要があるのだ)
TKIP could be retrofitted to work with older cards through firmware and driver updates. The TKIP work was done first, and incorporated into a branded standard called WPA by the Wi-Fi Alliance, the organization that certifies WiFi gear for interoperability. (You can make 802.11 devices til the cows come home, but you have to be a member of the trade group and pay testing fees―and pass the tests―to label a device with the WiFi moniker.)


WEP:まぁ、セキュアなようなものかなぁ
WEP: not all that secure

802.11iの仕様策定グループはAES-128の暗号化に基づいたAES(Advanced Encryption System)も仕様に追加した。これはCCMPと呼ばれるものだが、これを使って、データの正当性を認証できる。Tews/Beckの手法はこのAESには通用しない。
The 802.11i group also added Advanced Encryption System (AES) support―the AES-128 flavor―which uses, take a breath, the Counter Mode with CBC-MAC (Cipher Block Chaining Message Authentication Code) Protocol or CCMP. This flavor of AES both encrypts data and ensures its integrity. The flaw discovered by Tews and Beck cannot work against AES.

802.11iの仕様が固まる前に、Wi-Fi業界はWPAの仕様をWPA2に進化させた。WPAはTKIPしか必要としなかったが、WPAはTKIPとAESの両方をサポートすることになった。2002年以降に出荷された製品は、AESに対応可能である。2006年の3月には、WPA2のサポートはどのカードでも必須となった。
When 802.11i started winding down, the Wi-Fi Alliance updated its WPA standard to WPA2. WPA includes a requirement for just TKIP encryption; WPA2 requires support for both TKIP and AES. Almost all gear shipped starting in late 2002 could be upgraded to work with AES―all 802.11g silicon was prepared knowing that AES was coming along―and the Wi-Fi Alliance added mandatory WPA2 support for WiFi certified devices starting in March 2006.

TewsとBeckの調査によれば、802.11iの仕様の問題は、過去の製品との互換性からくるものだった。互換性を取るために、正しくないWEPアルゴリズムの動作にも対応する必要があったのだ。そこが付け入る隙だった。
The backwards-looking part of 802.11i is where the standard gets into trouble, according to Tews and Beck's research. By making the WPA algorithm compatible with hardware that could handle the broken WEP algorithm, the WiFi alliance left a tiny gap that the researchers could exploit.

WEPを破れ:chopchopで行こう

Crack that WEP: chop, chop!

TKIPの欠陥は、チェックサムの取り扱いにあった。チェックサムは、データが壊れていないかどうかを検証するためにつける冗長なデータだ。転送されるデータについて、ある計算を行って出た結果を、データにくっつけて送るのである。
The flaw in TKIP has to do with checksums, which are used to ensure the integrity and accuracy of data. Checksums work by taking a sequence of numbers that are to be transmitted, applying a transformation to produce a short result, and appending that result to the transmission.

例えば、978で始まるISBN番号は、13桁の数字である。そのうちの12桁は、本の固有の番号をあらわしている。最後の13番目の桁は、12桁の数字から、それぞれの桁の数字を掛け合わせたり足したりした結果を10で割った余りである。もし、ISBN番号を打ち間違ったら、最初の12桁の部分から計算される数字と、最後の13桁目を照合すれば、誤りが分かるのだ。
For instance, an ISBN that starts with 978 is 13 digits long, 12 of which represent a unique book number. The 13th is a base 10 number derived from alternately multiplying successive digits by 1 or 3, adding the results, and taking the modulo of 10. If you type in an ISBN incorrectly, a system that recalculates the checksum can determine in many cases if digits are swapped or wrong digits are entered.

無線でデータをやり取りするので、データが壊れる可能性は高まるものと思われていた。そこで、チェックサムを使って、データのやり取りが正常に行われたか、データは正しいかを判定しようとした。もし、データが変化していて、チェックサムがそのままならば、データを受け取った側は、データが改竄されたのではないかと疑うのである。
With wireless transmission, the odds of missing a bit or getting it wrong are relatively high, and checksums are used both to determine whether there was an error in reception and to ensure the integrity of a packet. If the payload changes and the checksum does not, then a receiver can tell that the packet was tampered with.

しかし、WEPの場合、この手法は役に立たなかった。データを改竄して、それにあわせてチェックサムも改竄してしまえばいいだけのことだからだ。例えば、Tewsはchopchopというクラッキングツールを紹介している。これを使えば、WEPの暗号化鍵が分からなくても、パケットの中身を知ることができる。このプログラムは今回のクラッキングの手がかりとして使われている。
This fell apart in WEP, because the checksum was so weak that techniques were developed to allow the data in a packet to be changed and a new checksum calculated. Tews mentioned the tool chopchop, which allows individual packets to be decrypted without cracking a WEP key. This program served as part of the wedge for the exploit.

フラグメンテーション攻撃 
A fragmentation attack

chopchopは、データから1バイトづつ”chopping out"ちぎりとって、別の値に変更して、その結果についてチェックサムを計算する。chopchopは変更されたパケットをアクセスポイントに送りつける。すると、アクセスポイントはチェックサムが間違っているよ、と正直に教えてくれる。WEPのプロトコルでは、このような攻撃がいくら繰り返されても制限を掛けることはしていない。
Chopchop works by "chopping" out one byte of data at a time and substituting different values for that byte while calculating a new potential checksum. Chopchop sends each modified packet to an access point, and the AP rejects packets for which the decrypted checksum is invalid. WEP doesn't prevent endless testing in this manner―there's no flood control or other protection.

TKIPは、チェックサムのほかにMIC(Message Integrity Code:”Michael”と呼ばれる)というチェックの仕組を追加している。Michaelは暗号化とチェックサムの機能をもっとうまく実装したものだ。chopchopのような単純な攻撃を排するために、続けて2回Micahelチェックサムが間違っていたら、1分間は攻撃者はアクセスポイントに接続できないし、暗号化鍵も新しくなってしまう。(802.11iの仕様ではパスフレーズやネットワーク鍵無しでも暗号化鍵を変更できるようになっている)
TKIP added a second layer of integrity through Message Integrity Code (MIC), nicknamed Michael. Michael performs a better-designed checksum that's also encrypted. To prevent the simplicity of chopchop, a client will respond after it receives two bad Michael checksums within 60 seconds: the client shuts down for 60 seconds and then requests a new key exchange with the AP. An AP, faced with the same situation, also shuts down for 60 seconds, then rekeys every client. (802.11i allows new master keys to be created on demand without changing the starting passphrase or network key.)

Tewsによれば、ここがBeckのすごいところらしい。WEPとTKIPのそれぞれのチェックサム機構を交互に攻撃することによって、2回に1回は、WEPによる(脆弱な)チェックサム攻撃を、Michaelは「正当なもの」として容認してしまい、chopchopによるクラッキングをMichaelによる監視の目をくぐって続行できるのだ。
Here's where Tews said his colleague Beck got extremely clever: because both the WEP and TKIP mechanisms are used one after another, and because the Michael code is contained within the packet that's checksummed by the weaker WEP method, an attempt to crack a packet can first use chopchop without triggering the Michael countermeasures.

Micahelは万能の天使じゃない:ARPが脆弱なんだ

Michael's no angel: its ARP is broken

Erik Tews

Tewsは、ネットワーク上を流れる非常に短いパケット、例えばARPのブロードキャストパケット(IPアドレスとMACアドレスの関連付けのための情報)などは、いちいち内容を解読しなくても中身は分かっていることに気が付いた。
Tews noted that for very short packets, such as those containing ARP broadcasts―the information that associates an IP address typically with an Ethernet Media Access Control (MAC) address―there's not much left to guess.

Tewsいわく、個々のARPパケットについては、データのうち不明なのはIPアドレス部分の2バイトと、それ以外の12バイト、すなわちMichaelのコードの8バイト、そしてWEPのチェックサムの4バイトでしかない。chopchopでMichaelとWEPの暗号化をクラックしてしまえば、残りの2バイトは60秒以内に判明する。アクセスポイントからの接続拒否や鍵の更新など無しにだ。全体としては、およそ12分から15分でARPパケットを破ることができる。
Tews said that with an ARP packet, every detail of the payload is known except two bytes of IP address in the message, and that overall only 12 other bytes are unknown: 8 bytes for the Michael code and 4 bytes for the WEP checksum. Once the software cracks Michael and WEP through chopchop, values for the two remaining byte can be tested every 60 seconds without causing a shutdown and rekeying. On average, this takes just 12 to 15 minutes to obtain the values.

すでにBeckの賢さは証明済みだが、ここからさらに一ひねりしてくれている。ここまで述べた攻撃手法では、データの暗号化のための鍵、もしくは暗号化プロセスの情報を得られた。しかし、TKIPは暗号化されたパケットを再利用できないようになっている。Tewsによれば、パケットのreplayができないようにするカウンタが仕組まれているのだ。だから、同じ内容のパケットを再送しても受け付けられないし、同じ暗号化をしてもダメなのだ。
We've already established that Beck is clever: here's where he went one step further. This method obtains the keystream, or the part of the process that was used to encrypt the data in the packet. But TKIP has mechanisms to prevent reuse. "There's a replay protection counter," Tews said. "This should usually prevent you from resending packets to the network or re-using the keystream."

しかし、Beckは802.11標準の別バージョンである802.11eの仕様の中から、例外となるケースを見つけ出した。コレを利用すると、7回から15回も任意の内容のパケットを再送できる。QoS(Quality of Service)関係のパケットがそれだ。例えば、電話のためのパケットを、他のデータ通信の混雑を避けて通すために、別のキューを利用させたりするために802.11eの仕様作成グループが定義していたのだ。
But Beck discovered that due to yet another 802.11 standard, 802.11e, there was a way to reuse a keystream, thus allowing a packet to be retransmitted with arbitrary data in it, from 7 to 15 more times. Quality of service (QoS), which is used to prioritize packets, falls under the 802.11e task group's work. This was built into WiFi by allowing different queues that can be set to have priority over one another, allowing voice packets to pierce through a miasma of plain data, for instance.

QoSのための専用のキューは、他のデータ通信と同じ暗号化プロセス(鍵)を共有しながらも、replay防御のためのカウンターを進ませることなくデータの再送ができる。Tewsによれば、最初802.11eの仕様では当初は4つまでしかキューが必要ではなかったが、標準になってみると8つのキューが定義されていた。さらに、データの分別のために8つのキューが追加されていることが分かった。結果的に、これらのキューを使えば、7回から15回のデータの再送(replay)が可能になる。
Associated with those queues is the ability to use the same keystream from another queue without triggering the replay protection counter. Tews said that although 802.11e is thought of as having just 4 queues, there are 8 in the standard, and they have found that 8 more also seem to be available for marking packets in some way. They believe this gives them a total of 7 to 15 replays for each packet they extract.

(攻撃用のコードはaircrack-ngサイトのin-progressのところのtkiptun-ngからアクセスできる)
(The crack is available as an in-progress part of aircrack-ng, called tkiptun-ng.)

Tewsいわく、これまで述べたテクニックは、ARPパケット以外でも利用できるそうだ。中身が大体予想できるものならば使える。例えば、TCP/IPのSYNパケットや、ある種のDNS問い合わせなどだ。
This can work with a few different kinds of packets, Tews said. "You just need a short packet with hopefully not so much unknown bytes" such as a TCP/IP SYN packet or certain DNS queries.

そして、解読された鍵情報は、1方向の通信にしか使えない。TKIPの鍵そのものや暗号化の鍵そのものが解読されたわけではないからだ。アクセスポイントから、クライアントのPCへ送られるパケットだけが弄れる。それでも、ARP情報の汚染は簡単だろう、と、Tewsは言う。"IPアドレスとMACアドレスの組み合わせを狂わせて、パケットの流れを乗っ取ることは可能なはずだ。"
The extraction only works in one direction, too: because it doesn't reveal the TKIP key or any other keys in use, only packets that appear to be sent from an AP to a client can be injected. But "ARP poisoning should be trivial," Tews noted, allowing an IP address to be associated with a different Ethernet or WiFi adapter on the network.

Tewsはこうも言う。"インターネットからLANへ入ってくるパケットだけをブロックするようなファイアウォールの設定ならば、ARP情報を汚染して、さもLANからパケットが来たように偽装すればファイアウォールをバイパスすることができるはずだ"
Tews also believes that firewalls that block only incoming (Internet to LAN) connections could be bypassed with an ARP request that fakes a client into thinking the request is coming from inside the network.

あまり心配することはない、大抵の場合は危険じゃない

Don't hyperventilate yet; you're (mostly) safe

ちょっとここで安心する情報をひとつ。この攻撃手法についての初期の記事ではTKIPの鍵が破られたということだったが、実はそうではなかった。Tewsいわく"我々が取り出せたのは、暗号化のための特定のパターンだけで、パターンを生成する大本の鍵を取り出せたわけじゃない"
Now let's back up a little. The early coverage of this crack indicated that TKIP keys were broken. They are not. "We only have a single keystream; we do not recover the keys used for encryption in generating the keystream," Tews said.

この攻撃手法を要約すればこうなる:TKIPを使ったルータとPCが接続されたネットワークに流れている短いが暗号化されたパケットを解読し、再び暗号化してネットワークに流すことができる。これは非常に重大な問題で、TKIPに関して初めて明らかにされたセキュリティホールを衝いている。しかし、crackingの重要なステップではあるが、暗号化システムを破ったとまでは言えない
To describe the attack succinctly, it's a method of decrypting and arbitrarily and successfully re-encrypting and re-injecting short packets on networks that have devices using TKIP. That's a very critical distinction; this is a serious attack, and the first real flaw in TKIP that's been found and exploited. But it's still a subset of a true key crack.

Tewsの指摘するところによれば"他人に自分の帯域を使わせないような設定がされていれば(訳注:つまりQoSの設定をしていなければ)、まったく問題は無い"そうだ。そして、自宅などで無線LANを構築しているユーザのほとんどがそのような設定になっているはずだ。その場合、誰も自宅や会社のLANに侵入したり、データを復号化したりはできない。
Tews pointed out that "if you used security features just for preventing other people from using your bandwidth, you are perfectly safe," which is the case for most home users. Someone can't use this attack to break into a home or corporate network, nor decipher all the data that passes.

ネットワークでAESを使っている場合も問題は無い。多くの企業やセキュリティが重要なネットワークではAESが数年前に実用化された時点でAESに乗り換えているはずだ。というのも、TKIPはときたま顔を出す問題を抱えていたからだ。
If a network uses AES, it's immune to this attack, and many corporate and high-security networks settled on AES when it became feasible a couple of years ago in order to avoid any lingering problems with TKIP that might eventually rear their heads.

定期的に鍵を変更するような設定になっている場合も、リスクは少ない。ただし、そのような設定が可能かどうかは機器にもよるし、そのような設定をすべきかどうかは確かとは言えない。
For networks in which an access point is set to rekey at a regular interval, the attack should be less effective, too. It's unclear whether that setting is available on enterprise access points, and whether network administrations should think about setting it now.

Tewsによれば、流量の多いネットワークも、この攻撃に強いかもしれない。ルータによっては、ある一定量のパケットを処理した後に鍵を変更するようになっているかもしれないからだ。流量が多ければ、解読が終わる前に鍵が変わってしまう可能性が高くなるのだ。
Tews also said that a busy network might defeat this attack; he's unsure whether some access points rekey after a certain amount of traffic passes. "A lot of traffic won't be good for the attack, because it will rekey faster," he said.

Tewsいわく"ネットワークのセキュリティの基本も大事だ。TKIPを使おうがAESを使おうが20文字以上でランダムな鍵ならば、総当り方式で鍵を当てることは困難だ"
Tews said that the basics of network security are still valid, too: for WPA with TKIP or AES, choosing a long network key, perhaps 20 characters that are relatively random, can defeat all known brute-force key cracking methods.

結論として、WPAは破られたとは言いがたいことがわかった。そして、TKIPも大抵の場合はまだ有効である。しかし、パケットの整合性とチェックサムに関する攻撃が明らかになった今、今後の研究の進展を考えれば、セキュリティに敏感なビジネスネットワークはTKIPを捨ててAESへ乗り換える傾向が強まることは間違いない。
そして、TewsとBeckがWPAが攻撃可能だと示されたからには、多くのハッカーたちが(それが善玉であるか悪玉であるかにかかわらず)この分野に殺到することになるだろう。
So WPA isn't broken, it turns out, and TKIP remains mostly intact. But this exploit based on integrity and checksums should argue for a fast migration to AES-only WiFi networks for businesses who want to keep themselves secure against further research in this area―research already planned by Tews and Beck. And now that these two have opened the door, WPA will certainly become subject to even closer scrutiny by thousands of others interested in this space: black-, gray-, and white-hatted.

Wiki内検索

メニューバーA

ここは自由に編集できるエリアです。

フリーエリア

編集にはIDが必要です