So allow me to introduce myself. I'm Guy Martin. I come from Belgium, so sorry about the accent. Sometimes it's going to be a bit lousy. All right, so today I'll go and speak about sniffing cable modems. You'll see it's actually a very, very easy thing. It took me about just one day when I had the idea about, oh, let's do that this way, and oh, I get packets now. I can sniff everybody. Cool. So, sure, sorry. So as I said, it took me just one day to find out how to sniff the packets out of a simple TV card. You'll see it's very easy and really freaky, actually. Let's see. So I will speak about DOCSIS, of course. This is the agenda for today. What is DOCSIS? First, explain what is this protocol, which is the... This is the one used by the cable modems. Detailed bit, the general architecture, so this way you find out... You will understand how DOCSIS network is implemented around... Across the city and why you can sniff this or this part of the network. I'll talk about the registration process. It's an interesting part of this wall sniffing stuff because it gives a lot of information about the modem, its configuration. You'll see it's really interesting. About encryption on the link. There is encryption. Sometimes it's not mandatory. I'll talk about this later. Then how to sniff it, of course, what you came for, the crunchy part. DVBC and ATC card, that will be the hardware that I use. So there are two parts there. The hardware, the software. Software. I'll talk about Packetomatic, which is the the software I developed to do the sniffing. And eventually talk about what you can do once you sniff this. There are things related to privacy. You can do a lot of SNMP acts on the modems as well that allow you to have, well, you'll see. And miscellaneous stuff, and eventually the references. When I'll be done with the talk, I'll do a demo so you can actually see this going on. All right, so let's see. What is DOCSIS? DOCSIS stands for Data Over Cable Service Interface Specification. There are actually, right now, three versions of the DOCSIS protocol. DOCSIS 1, which is the very first one, doesn't have a lot of stuff. It basically allows you to transfer packets and that's it. Sorry, DOCSIS 1.1, that was the new one. New OS version because they've seen, oh, hmm, we can actually clone the Macs of the modem and there is no authentication. All right, let's fix that. So that was fixed in DOCSIS 1.1. And then DOCSIS 2.0, that has implemented some more stuff, not much more. And eventually DOCSIS 3, which is not out yet. I mean, it's still in development because the hardware required to support that new version, which has higher encryption, higher performance, and higher bandwidth, is really expensive. That means that if you want to upgrade to this newer version, you have to change the whole infrastructure, meaning all the modems of everybody, of all your customers, and also the CMTS. So the CMTS part is not that big, but changing all the modems is not easy. The use of DOCSIS, well, you most commonly know that DOCSIS is used to provide internet. That's one thing. Second thing, it's used for your network. It's used for your devices. It's used as well for telephony. Most of the modems right now, they have got an ATA, so it's phone plugs. You just plug your phone, your normal analogic phone, and you get voice or IP via the modem. It's really important, this part, because the ISPs provide triple play subscription, so you get internet, you get phone, and you get, as well, television, since it's the same media. Also right now, I've seen somerunner.com on some TVD colers, and they build in cable modems inside it. This way, the ISP can provide On-Demand TV and also find out what you're looking at, which is really nice. The general architecture now. This is how it works. On the ISP side, you have a big box, which is called the CMTS. This is a nice little box. It's kind of like a box. And the CMTS will send all the packets on a single frequency. So it's shared media, as in the old days with the 10 megs Ethernet. It sends everything on the same frequency. So every modem is listening on that frequency and filters out what it needs, what it doesn't need. So compared to Ethernet, the old 10 megs coax cable, the return path is different, meaning it's running on different frequencies. And the modems have time slots allocated for each other, so they know when they have to send packets. And because of this, we can actually only sniff the downstream of it. Because the cards that I use, they're not able to get... They don't get that lower frequency that the upstream use. I'll detail that later. A CMTS, that's used for either a full city. So where I come from, there is one city which has just one single CMTS. You plug your TV cable there on your back of your PC, and you got everybody's traffic. The whole city, it's huge. Also, in Bayer City, of course, it's just a small neighborhood, but it's still a lot of people. It's when you count all the big buildings and stuff. Also, really important, the DOCSIS protocol has been engineered in a way that it could be compatible with all the existing equipments. For example, the frequency range is the very same as in the TV frequency range. I mean, talking about the downstream, of course. This means that if you have a TV card, well, you can tune to either DOCSIS, the DV, whatever, it's the very same one. Also, it uses MPEG packets for encapsulation. This is, again, on purpose that it's been done this way, because digital forwarders can just read the MPEG packets and forward it as if it was TV, so it doesn't really matter. Okay. Registration process. The very first thing that MUTM has to do is acquire the downstream frequency. So, all it does is that it simply scans the whole range, the whole frequency range. So, it starts from bottom, goes to top. Once it gets a good look on the certain frequencies, it looks if there are the packets that it's supposed to have, a.k.a. the sync messages. So, there are specific DOCSIS messages. There are sent every now and then, but you're supposed to receive something like 10 in a second. So, it's very easy for MUTM to find out in a timely fashion if this is DOCSIS frequency or not. Once it got the downstream frequency, it tunes on it, read the packets from it, and then the upstream parameters are sent to MUTM this way. Then it configures itself and is able to, at this point, have a link. A byte. A bi-directional link. So, this way, it can get an IP address. This is done via simply DHCP, as in every network. And then once it's got its IP address, it downloads the configuration file via TFTP. This configuration file is very interesting because it contains a lot of information. For example, you'll find in there what is your downstream speed. So, your download speed, your upload speed. For example, what device can actually manage the IP address, sorry, the MUTM via SNMP. So, it will tell you, okay, now you get this IP address, this source IP address is allowed with that SNMP community. And it will be able to do all sorts of stuff to the MUTM. There's also ACLs for IP filters. For example, the common way to disable the port 24. There's a port 25 for SNMP connections. That's done via this TFTP configuration. They simply block port 25 on the MUTM. This way, you cannot send or receive e-mails. And then, of course, if you can hack around it, you can get rid of it. So once it's got the TFTP configuration, it simply applies all the configuration in the memory. And that's it. The MUTM is fully up and running. One thing I forgot about that configuration is that... All the configuration entries, besides the upstream, the speed, is done using OIDs like in SNMP. So it says .1 and et cetera equals this value. So you can, later on, change those values via SNMP as well. Whoops. That's not the one. Let's talk about the encryption. That's the interesting part. So the very first... The important thing to know is that encryption is not mandatory, meaning that you may run on... At your place, you may have a connection which is not encrypted at all, meaning everybody can just plug, sniff, and that's it. It sees everything you do. That's really, really scary to me. There is also, of course, encryption mechanisms. So BPI. BPI. BPI stands for Baseline Privacy Interface. There are two versions of BPI, BPI, the normal one, and BPI+, and this one provides authentication. So as I said, DOCSIS 1.0 didn't provide any means of authentication. You could just change your MUTM, take another one that you hacked, and clone the MAC, change the MAC, and that's it. You were on the network. You could do whatever you like. But no, with BPI+, it uses certificates. So each device has a certificate. The CNTS as well, and that's the way they authenticate each other, and then eventually they negotiate the key this way as well. Another interesting stuff is that currently the encryption algorithm, it's DES, and it's only 56-bit key. That is too scary. So, well, right now, I'm not cracking it because my cryptanalysis skills are pretty... Well, they're nil. So I like to use this opportunity to ask here if anybody has crypto skills. I'm sure there is. If you could help me on that, find a way to crack this DES key, that would be amazing, meaning we could sniff the whole word. So that DES key, for example, it's just a shared key between the ISP and the MUTM, and the key lasts for 12 hours. So there's plenty of time to crack it. You can even dump it, and then eventually we covered the data. Talking about AES. AES, that's going to come later on in DOCSIS 3.0, but as I said, this AES encryption is really expensive, so you need a special chip in the MUTM, and that raised the price really high. That's why all the ISPs are not going to go through DOCSIS 3.0 right now. You may see that some ISPs do. But it's not really the real DOCSIS 3.0. It's just for the larger bandwidth that DOCSIS 3.0 provides. It provides a larger bandwidth in the fact that it bounds multiple downstream in a single channel, so it can go to speeds like 100 megs. So AES is not going to come until one or two years, I think. Well, it depends on your ISP. Probably some ISPs will stick to DOCSIS 1 or 2.0. DOCSIS 2, even. Okay, so how to sniff it. What you need is this. What is this? A TV card. Digital TV card. So it's either an ATSC card or a DVBC card. The DVBC card you'll find out in Europe, it has more advantages. For example, it can use different symbol rates. Well, that's Arab stuff you don't really care about. But anyway. In the U.S., you use ATSC, and in Europe, DVBC, you can sniff everybody. This is possible just because they did engineer that to use the very same frequencies. So that's it. Yeah, talking about the price of this card, it's $100. So everybody can afford it. There is one downside is that you, as I said, you only have the downstream because the upstream is a different frequency. It's below 50 megahertz, and those cards can't handle it. But the downstream is way enough. You'll see. We can do a lot of stuff already. I like to try different hardware, too. For example, the USRP. I'm not sure if you guys know. USRP stands for Universal Software Radio Peripheral. And it's actually coupled with GNU radio. And you can use whatever tuner and whatever. Yeah. So tuner and antenna has to send and receive. You could even code a cable modem yourself with that device. That would be really nice. On the software part, there is Packet-O-Matic. So it works this way. You got the input module. So it's fully modular. You get the input module. You can select, okay, I want to sniff from DOCSIS. I want to sniff from PCAP. So interface, files, whatever. Then all your packets are processed. It's processed using the rules that you specified. So you can say, okay, I want Ethernet, then IPv4, then everything that is TCP on port whatever. Or even if you use the DOCSIS input and say, okay, my layer is going to be, first layer is going to be DOCSIS. You can say, okay, I want all the DOCSIS packets with, well, I'll show you there. It's very this way. Once it's processed, at the same time, there is the helpers. For example, if you got a fragmented IPv4 packet. It's just going to reassemble it and sends the complete IPv4 packet to the upper layer. This way, the software layer doesn't have to care about all these specificities of the protocols. I forget to say that each protocol is also just a module. So for example, if let's say IPv8 is going to come later on, I hope not. You can just code a module and that's it. You got IPv8 support. So once you match your packets, you know what you want, it's processed by the target. And the target does whatever you like. So for example, right now, there are targets to dump HTTP traffic. So it's going to dump the images. It's going to dump the HTML file. It's going to dump the video file. So let's say you start that software, Pack-O-Matic, on a DOCSIS stream. You say, hmm, okay. Everything that is on port 80. Dump the video file. And you'll see what people are going to say, sorry, you'll see everything that people go and see on YouTube. And you can just click and see. That's cool. Also, everything occurs real time. Yeah, I didn't want something like, you know, Ethereum, WaterShark. You dump all your stuff. You got a PCAP. You read the file. And then if you, let's say, want to extract, if you want to extract some audio files, you have to right click. And then. Extract. And it's boring. So what you do is simply set this up. Say, okay, all these ports, you know, it's RTP traffic. It's voice traffic. Simply process them as audio. And it will just reassemble all the files real time. So you will see everything growing in your directory. It's really scary, too, because there are five at the same time usually. You can't just listen to all of them. Yep. So, also, there is a telnet and an XMLRPC interface. The XMLRPC interface, it's actually a web interface I'll show you there. You can use both at the same time, it's really cool. Okay. So what you can do. First privacy. Of course, you can sniff all the data. That's easy. But then you need to process them. Sniffing all the data. Well, you got, let's say, five. Five megs per second of traffic. This is huge. So you need to really sort out and say, okay, I want this part of the traffic. So you probably will need to use Wireshark to first analyze the traffic that you get and see, oh, okay, these IP addresses are used for voice. These IP addresses are used for other stuff. Then you build your rules, build your targets, and that's it. It will do whatever you like. Okay. So, yeah, there are additional targets, for example, the mails. I tried once on a test network. So for example, let's take this scenario. You have one ISP who has a POP3 server, so it gives accounts to all its customers. And of course, the POP3 server is not encrypted, which is never encrypted anyway. And everybody is going to connect to the POP3 server. And, well, it's very easy simply to say, okay, sort all the mails that you retrieve. Put them in IP. So sort them by directories. For each directory, it's going to be the IP address of the guy. And it's email for all its emails in a maildir format. And that's it. Simply start a NIMAP server, and you get everybody's email in your mail client. You can also... Okay. You can also do denial of service. So if you're bored, if it's, like, 4 p.m., 8 p.m., and you don't have a lot of bandwidth available for you, so, well, you simply sniff, see, you know, run NTOP or whatever. See who's taking all your bandwidth. And it's actually possible to re-inject. So it works this way. You've got... You run your PC with the TV card. You sniff packets. And you re-inject the TCP reset packets through your modem. And that's going to go through. Because the modem itself is just a stupid Ethernet bridge. I mean, of course, provided you remove the right ACLs on the modem. Anyway, so it just works. It's amazing. All right. SNMPX. So, as I said... Yeah. So once you get access to the modem via SNMP, you can do a lot of stuff. First of all, the most interesting stuff is to change the IP filter. So you can't send e-mail. You can't receive e-mail on port 25. Well, no problem. SNMP said, well, there you go. It's removed. It goes as well for the firewalling rules that are usually set to access the other modems in the network. So each modem gets, you know, an IP address in a private range, like 10 dot something. And you cannot access those range for obvious reasons. But, well, once you remove the filter, you can access it, huh? And, well, you can do the very same thing, meaning connect via the web interface, SNMP, change, reboot the people's modem, have fun. So I mean, I haven't been through the whole SNMP documentation for the modems, but they're just too much. Also, yeah. Misaligning stuff. So yeah, sniffing the doc's stream is nice, but then you probably want to use the tools that you have already. I don't know. Tools like, well, if you simply want a TCP dump or a Wireshark or a dsniff, well, you know. You simply create a tab device, and it's going to help output every packets that you got to that device. So it will create a virtual interface in your Linux system. And you can use it as a normal interface with SNMP for it. OK. So references, if you want to dig deeper into this protocol, you can find the full protocol specification on CableLabs.com. It's all open. They just hide a bit of stuff regarding the encryption, but still, you can find it. MPEG, yeah. As I said, the encapsulation works this way. So you've got MPEG packets, which are 188 bytes. And then in each of these packets are encapsulated doc's streams. And in those doc's streams, you've got Ethernet frames and then the known suite of protocol. So IP for TCP, whatever. And for the software, just go on packet-o-matic.com and download it. All right. Let's do the demo now. Oh, it's already running. OK. All right. So to start the software, just do minus E, so it starts with an empty configuration. Is it readable? Or... OK. What about this? OK. Oh, damn. Sorry. I don't think I can do anything about that. I tested it, though, but... Anyway, that should be way enough. OK. Cool. So let me show you Telnet interface. Simply Telnet to it, port 4655. Choose that, like, you know, like Debian, random dice, and that's it. First thing to do, set up the input module that you want to use. To do this, very easy. Set input type doc's. OK. And we got our input configured. So you can see current input doc's. It's a normal input. Normal mode. It's Euro doc's. I'm coming from Europe, so I just set that to true. You just kind of have to change that yourself. Frequency, well, that's a default one. But it's not what I want to do. I don't know right now what is on this network. So, well, let's scan. So there's another mode for this input set. Input mode. Let's see what we have. Scan. Scan. Good. OK. So now it's in mode scan. Start frequency is zero. Well, I know where it is, so I'll put it to something closer. Set input parameter. Come on. Is that it? Three? Nope. That should do. Yeah, maybe I should change that to megahertz. Anyway. So this is it. Well, the only thing left is to start the input. So that's it. Just start to scan. It goes from the frequency I specified to the maximum one. It's going to look into every single megahertz, see what's going there. OK. Oh. It got a frequency. It was able to tune, but obviously it was not a DOCSIS stream because it didn't receive any sync message. So it goes to skip it. It's probably a TV cable. Sorry. TV, you know. OK. There we go. So it found it. That's it. This is it. Frequency tuned. Download stream acquired. You got the frequency. 442 megahertz. Symbol rates. Well, you don't care about that. QM. Yeah. You may. There are two of them that are available. QM 256 and 64. So if you don't find anything on QM 256, just try 64. You'll certify something. OK. So this is nice. We got our input. Is it dumping packets? Oh, yeah. It is. Quite a lot, actually. OK. So let's do something with that. Just for... Sorry. Let's close this. I don't need it. For privacy reasons, I'll just not show anything. Come on, guys. I can't do that. You know I can't. Hold on. I'm not done yet. All right. So... Well, let's just see how much bandwidth you got. So this is in Belgium. It's like... It's about 4 a.m. there. So I don't expect to have a lot of traffic. Let's see. So first of all, let's add a rule. Rule. Hmm. I don't know. I want all the Ethernet traffic. OK. So that's it. Got my rule. Show rules. It's disabled. Let's just enable it. Enable rule zero. OK. So it starts to process packets already. I see it's matching stuff. So after the rules, we need the target. OK. Let's try to do that virtual interface stuff. Add target. Oops. Target to rule zero. And this is all the target. Target available. So you just do tab. You get the completion. And you see what you can do. So I'll use target tab. Show targets. There we go. It stopped. Interface name. Palm zero. That's fine. Let's start it. Oops. Start. Target. Zero. Zero. There we go. OK. Let's see. If config. Palm zero. Hmm. Cool. It's working. Let's take it out. Tab. OK. A bit of traffic. Not much. But there is something. So that's it. I will not show any packets. But I'll do some more demo on my laptop. You'll see. So yeah. This is one of the possibilities. Let's say, no. I want to dump the whole doxy stream in a PCAP file. So as you all know, Wireshark, it dumps ethernet traffic. So at the ethernet level. It's a layer. But it can also. You can put different stuff in those PCAP files. You can put doxy packets. So you can go up one layer. So you've got doxy, ethernet, IPv4, and et cetera. Or you can even go down one layer. Meaning you can just save the row IP in PCAP. And it's all manageable here. So let me start again with the new configuration. It will be easier. Sorry. Stop it. But you can see there are a few stats. It tells me to get that much MPEG packets on. So it's not IP packets. And apparently, my link was quite good. Because I didn't miss anything. OK. But probably because there is no much bandwidth. I mean, no much traffic. All right. So let's start again. I know about the input. So let's set input type docsis. Let's do this quickly. And put parameter frequency. Come on. 3, 4, 4, 2, 1, 3, 1, 2, 3. Start input. There we go. Too easy. All right. So add row. Oh, yeah. I forgot something. So here you can see alt layer is ethernet. So by default, that input is going to give you ethernet packets. Because you probably don't care about that docsis layer. But you can change it here by setting that parameter. To docsis. Set input parameter out layer docsis. Start input. There we go. Yeah. I forgot to mention something. All the rules that you specify, you have to specify all the full layers that you want to use. So in this case, if I want to dump, let's say, TCP traffic, I have to specify docsis. Because the very first layer that I'll have from the input is going to be docsis. Then ethernet. Then IPv4. I do the differentiate IPv4 and IPv6 just this way. And TCP. Show rules. OK. It's disabled. Enabled row 0. There we go. There is a bit of traffic. And add target 0 PCAP. Let's save all of these. It will be useful. Target is stopped. So here again, this is what I was talking about. You can set whatever layer you want to save. So if you want to save docsis packets, so it can be useful for docsis engineers who want to troubleshoot what was going on. Well, OK. Without the upstream, you do set target parameter 00 layer docsis. There we go. Where did I dump it? Oh, dump the PCAP. OK. Where is it? There we go. So you can see it's got everything. And it's docsis. It's not the ethernet layer. That's very useful. OK. So. Let me show you some more stuff. No, but not on this docsis network, simply because it's too far away. And it was such a burden to try to get something out of it. So I'll just use on my laptop and show you some extra stuff you can do. But consider this as if it was just on the docsis network. All right. So let's try to dump some images that I will go on. Go and see on the internet. So I just started. Minus E, empty config. Minus X, enable the web interface. Whoops. I forgot that it's already running here. OK. So I started here. Let me show you the web interface. Is this readable? That's a bit too much. OK. OK, good. So as usual, configure the input. I'll just use PCAP here. I need to select the mode. I'll say interface this way. I mean, you can either sniff from an interface or sniff from a file that you recorded already. VTH0, snap, then it's all fine. Save changes and start input. Come on. OK. Operation, of course. Come on. It works better as root. All right. Let's try again. Configure input. OK. It started now. So you see it's the same stuff you see in the console. All right. So let's see images. Hmm. That must be on port 80. Come on. I've got difficulties to click. IPv4. TCP.sport equal call 80. Yeah. About this source port, you just select one side of the direct, one side of the communication because there are contract, so connection tracking modules. They will just find out what is coming out from the reverse direction. So if you want to sniff anything that is on port 80, select source or destination, it does not really matter because once the target will start to dump the very first connection, it will say, hey, no, you saved the contract information, and I want to know about every single packet from the reverse direction. So it's all taken care of. OK. I've got my nice rule. Let's add a target. HTTP. HTTP. Default mode. Dump images. Yes. Slash tmp. That will do. OK. So input is started. Let's start the rule. I mean, sorry. Enable the rule. Start the target. Let's see if we can get the same. Just to confirm. Nope. Nope. Come on. So input is configured, found. Rules are OK. Targets are cool. All right. Well, let's go on a stupid website. Do you guys like LOLcats? Whoops. OK. That's nice. Nobody cares about it. Oh, there are a few images. OK. Works. So as I said, it's that easy. You select your inputs. OK. DOCSIS. Say I want everything on that port 80. And dump image, video, PDF, binary files, HTML files, whatever. You're just going to get it. You can look at it and have fun. All right. So that's one thing. No. Let's do something a bit more nasty because OK. Let's get rid of this. Goodbye. No. HTTP is fine, but TCPKill is funnier. So simply, again, select the mode interface. There are two modes. Oh, yeah. I forgot to mention that, yeah, I like the TCPKill a lot. So I kind of perfect it in a way that it works for IPv4, IPv6, and IPv4 in IPv6. No. Sorry. What was it? IPv6 in IPv4. So if you find somebody who's got a tool, you can still have fun with them. All right. There we go. So let's start it. I'm not going to use the web browser this time simply because it caches everything. So I'll connect myself. OK. It connects. But oh. Oh. That's not good. Let's try again. No. OK. All right. So well, that's about it. I could show you a lot more stuff because there are a lot more things. There's a lot more stuff to do and to try. But it's best if you just go through it yourself. As a conclusion, yeah, connect to your modem. Make sure it's encrypted. If possible, ask your ISP to switch to DOCSIS 3. Because DOCSIS 2, I mean, the DES encryption is most probably not going to last long. And yeah, well, thanks for attending. I hope you had fun.