1 00:00:00,000 --> 00:00:03,700 Hi, my name is Ian Harris. I'm a professor at the University of California, Irvine. 2 00:00:03,980 --> 00:00:07,060 I'm going to describe a fuzzer. Oh, please cut that music in the background. 3 00:00:07,060 --> 00:00:10,400 I can still hear We Will Rock You going on the back of my... 4 00:00:10,400 --> 00:00:12,960 I don't know if you can hear it, but I can hear it. It's quite distracting. 5 00:00:14,480 --> 00:00:17,460 I'm at the University of California, Irvine. I'm going to describe this fuzzer 6 00:00:17,460 --> 00:00:24,060 that we have made that fuzzes SIP, so Session Initiation Protocol for Voice Over IP Phones. 7 00:00:24,300 --> 00:00:28,960 It fuzzes the server, so we send messages to the phone and try to break the phone, basically. 8 00:00:28,960 --> 00:00:35,620 And there have been several talks about fuzzing, so I don't have to talk too much to introduce the ideas. 9 00:00:36,640 --> 00:00:43,060 But the co-authors, most of the co-authors, all the first co-authors are all my students at UCI. 10 00:00:43,340 --> 00:00:47,820 And then the co-author on the right is from Fort Consult. That's Marcel Carlson. He's in the back over there. 11 00:00:51,640 --> 00:00:57,280 Okay. All right, so fuzzing basics, in case you haven't seen any of the numerous talks before this 12 00:00:57,280 --> 00:00:58,360 that talk about fuzzing. 13 00:00:59,680 --> 00:01:05,180 So the idea is, and we're doing network fuzzing, so we're sending messages, actually UDP messages, 14 00:01:05,480 --> 00:01:09,920 messages over UDP, SIP messages over UDP, to a SIP phone. 15 00:01:10,940 --> 00:01:18,260 And what you do is, it's a text protocol, so all you do is you take fields and you fuzz them. 16 00:01:18,360 --> 00:01:21,720 You have what I'll call fuzz functions. I don't know what other guys have been calling them. 17 00:01:21,940 --> 00:01:26,400 But you take the field, and we're doing, if I use the definitions of the previous talks, 18 00:01:26,580 --> 00:01:28,940 we're doing not mutation-based, but generalization. 19 00:01:28,960 --> 00:01:34,000 So we don't take an existing sequence of messages and modify it. 20 00:01:34,060 --> 00:01:38,060 We actually generate the sequence of messages, and then we modify the one we generated. 21 00:01:38,360 --> 00:01:42,460 So we generate a good message, and then we randomly fuzz something. 22 00:01:42,700 --> 00:01:44,700 So here's an example of something we might fuzz. 23 00:01:45,120 --> 00:01:48,060 Actually, this isn't something we do, but you put some junk characters in here 24 00:01:48,060 --> 00:01:50,560 just to try to cause a buffer overflow, say, right? 25 00:01:50,740 --> 00:01:54,900 So if you just make a field, and I'm probably pretty sure that most people are familiar with these things, 26 00:01:54,980 --> 00:01:57,780 but one thing you would do to a field is you make it extremely long, 27 00:01:57,920 --> 00:01:58,820 try to cause a buffer overflow. 28 00:01:58,960 --> 00:02:01,900 Another thing you might do is command injection. 29 00:02:02,440 --> 00:02:07,460 So maybe the field is being passed directly to a shell, right? 30 00:02:07,600 --> 00:02:13,580 So you might want to insert shell meta characters just to see how the phone reacts to it. 31 00:02:14,320 --> 00:02:15,780 You might do SQL injection. 32 00:02:16,120 --> 00:02:19,420 Actually, we wouldn't, because it's unlikely that you're going to take a field 33 00:02:19,420 --> 00:02:23,400 and pass it to an SQL interpreter in this context. 34 00:02:23,640 --> 00:02:26,260 But another common fuzzing function is SQL injection. 35 00:02:26,400 --> 00:02:28,780 You put SQL commands, because maybe the field goes, you know, 36 00:02:28,960 --> 00:02:30,980 straight to some kind of a SQL interpreter, 37 00:02:31,120 --> 00:02:33,360 and so you put some command in there, see how it reacts. 38 00:02:34,060 --> 00:02:34,940 So that's the idea. 39 00:02:35,060 --> 00:02:38,300 We're generating a sequence of these messages, and then we fuzz them. 40 00:02:38,400 --> 00:02:40,740 We randomly throw in different types of garbage 41 00:02:40,740 --> 00:02:44,860 made to stimulate common errors that people make in their coding. 42 00:02:47,440 --> 00:02:49,340 So session initiation protocol, 43 00:02:50,340 --> 00:02:55,880 the job of that protocol is to start and end phone sessions, voice over IP sessions. 44 00:02:56,960 --> 00:02:58,060 It's the standard. 45 00:02:58,120 --> 00:02:58,940 Not everybody uses it. 46 00:02:58,960 --> 00:03:02,400 You know, Skype uses something else, but basically everybody else uses it. 47 00:03:02,460 --> 00:03:07,020 Most of the other phones are SIP phones, and I know it's a little hard to read that, 48 00:03:07,140 --> 00:03:10,720 but what I'm showing here is a typical transaction. 49 00:03:11,180 --> 00:03:14,720 So there's a user agent client, a user agent client, and a user agent server. 50 00:03:15,060 --> 00:03:17,740 The client is the phone that starts the phone call. 51 00:03:17,940 --> 00:03:19,360 The server is the receiving phone. 52 00:03:20,060 --> 00:03:22,180 So we are fuzzing the server. 53 00:03:22,720 --> 00:03:26,580 Now, of course, any phone that you get, you want it to be able to start calls and receive calls. 54 00:03:27,880 --> 00:03:28,940 It should be able to do both. 55 00:03:28,960 --> 00:03:36,640 But you can segment the code according to the code that does the server stuff and the code that does the client stuff. 56 00:03:37,040 --> 00:03:38,560 So we're testing the server stuff. 57 00:03:38,840 --> 00:03:43,200 So our fuzzer, it acts like a phone that is starting a phone call with another phone. 58 00:03:43,680 --> 00:03:49,440 And so it's testing that other phone, the server phone, to see if it has any bugs in its server side activities. 59 00:03:50,340 --> 00:03:54,420 And this is just a typical conversation between a client and a server. 60 00:03:54,700 --> 00:03:58,940 So you might send an invite message to start the phone call. 61 00:03:58,960 --> 00:04:01,380 In fact, you'd have to send an invite message to start the phone call. 62 00:04:01,680 --> 00:04:04,280 100 trying means you got the invite. 63 00:04:04,720 --> 00:04:07,660 180 ringing, you send back to say, look, my phone is ringing now. 64 00:04:07,800 --> 00:04:08,840 We're waiting for somebody to pick up. 65 00:04:09,640 --> 00:04:13,120 Then 200 okay you might send after somebody's actually picked it up. 66 00:04:13,160 --> 00:04:14,760 You say, okay, I'm ready to start the phone call. 67 00:04:15,840 --> 00:04:21,380 Then this client would send an act message back to say, look, I see that you are ready to start my phone call now. 68 00:04:21,580 --> 00:04:22,620 So let's start talking. 69 00:04:23,080 --> 00:04:25,720 So after that, there would be a media session right there. 70 00:04:25,840 --> 00:04:27,640 Now, the media session isn't handled by SIP. 71 00:04:27,720 --> 00:04:28,680 It's handled by... 72 00:04:28,960 --> 00:04:29,880 Some other protocol. 73 00:04:30,060 --> 00:04:34,580 Usually RTP, real-time transport protocol, but it doesn't matter what it is. 74 00:04:34,620 --> 00:04:35,380 It could be something else. 75 00:04:35,880 --> 00:04:37,900 But some other protocol handles that. 76 00:04:38,300 --> 00:04:41,500 And then at the end, somebody hangs up the phone. 77 00:04:41,660 --> 00:04:43,540 So let's say the client hangs up the phone. 78 00:04:43,640 --> 00:04:45,100 He sends a buy message. 79 00:04:45,300 --> 00:04:48,300 And then the SIP server sends an okay to say, look, I got that. 80 00:04:48,580 --> 00:04:49,400 And then they're done. 81 00:04:49,680 --> 00:04:50,540 So that's what SIP does. 82 00:04:50,620 --> 00:04:52,960 It starts phone calls, and it tears down phone calls. 83 00:04:55,780 --> 00:04:58,880 So I just want to go over previous work in SIP buzzers. 84 00:04:58,960 --> 00:04:59,800 Really briefly. 85 00:05:01,040 --> 00:05:07,600 First one that, if you know anything about this stuff, you've probably heard of, is Protos fuzzing suite. 86 00:05:08,100 --> 00:05:09,120 So this isn't actually... 87 00:05:09,120 --> 00:05:10,220 They don't provide you with a fuzzer. 88 00:05:10,340 --> 00:05:13,020 They provide you with a suite that was generated by a fuzzer. 89 00:05:13,100 --> 00:05:17,760 So a sequence of messages, of SIP messages, that was generated by their fuzzer that they have internally. 90 00:05:18,040 --> 00:05:20,220 And it was done by these Finns. 91 00:05:20,560 --> 00:05:22,700 University of Finland somewhere. 92 00:05:22,980 --> 00:05:23,800 I can't remember now. 93 00:05:24,100 --> 00:05:27,240 Anyway, and Codamicon is the company that they spun off. 94 00:05:27,400 --> 00:05:28,660 So now it's an industrial project. 95 00:05:30,740 --> 00:05:32,140 So it's a predefined test suite. 96 00:05:32,280 --> 00:05:33,100 There's many test cases. 97 00:05:33,420 --> 00:05:35,100 It basically fuzzes the invite message. 98 00:05:35,420 --> 00:05:40,300 So it takes the invite message, and every time it sends an invite, it throws lots of different fuzzes into it. 99 00:05:40,500 --> 00:05:42,660 Lots of different weird things into it. 100 00:05:42,720 --> 00:05:45,360 And they have a long list of different type of fuzzing functions that they apply. 101 00:05:46,180 --> 00:05:49,900 And after the invite, they tear down the call with a cancel-ack message. 102 00:05:50,220 --> 00:05:52,820 So the sequence is always invite, cancel-ack, invite, cancel-ack. 103 00:05:53,780 --> 00:05:55,240 And they detected... 104 00:05:55,240 --> 00:05:56,620 Actually, I didn't go into any depth. 105 00:05:56,700 --> 00:05:57,880 But they detected a lot of vulnerabilities. 106 00:05:58,040 --> 00:05:58,620 And they were basically... 107 00:05:58,960 --> 00:06:02,280 As far as I know, the first fuzzing protocol suite for SIP. 108 00:06:06,020 --> 00:06:07,600 So SnoozeFuzzer is another one. 109 00:06:08,280 --> 00:06:12,780 These guys, they're at University of California, Santa Barbara. 110 00:06:13,500 --> 00:06:16,240 And besides these two that I mentioned, there are more I know. 111 00:06:16,380 --> 00:06:19,420 But these are the only ones I could find to actually publish data easily. 112 00:06:19,980 --> 00:06:22,400 I could find out exactly what's going on inside the fuzzer. 113 00:06:23,060 --> 00:06:27,520 There's a SnoozeFuzzer where what they do is they have a protocol state machine. 114 00:06:27,760 --> 00:06:28,800 So, you know, 115 00:06:28,800 --> 00:06:30,200 this protocol is a stateful protocol. 116 00:06:30,500 --> 00:06:32,420 So there is a state machine that describes the protocol. 117 00:06:32,640 --> 00:06:33,940 And I'll show that in a couple of slides. 118 00:06:34,740 --> 00:06:36,400 But they just... 119 00:06:36,400 --> 00:06:36,700 Somebody... 120 00:06:36,700 --> 00:06:40,400 Some user has to describe that protocol in an XML format. 121 00:06:40,680 --> 00:06:41,820 They read that in. 122 00:06:42,180 --> 00:06:46,160 And then they use what's called... 123 00:06:46,160 --> 00:06:47,400 What they're calling a fuzzing scenario. 124 00:06:47,660 --> 00:06:53,180 So basically, the user, the person who wants to do the fuzzing has to define the sequence of messages that they want. 125 00:06:53,420 --> 00:06:56,720 So say I want invite and then cancel-ack. 126 00:06:56,860 --> 00:06:57,720 That's the sequence I want. 127 00:06:57,800 --> 00:06:58,680 So I would define that. 128 00:06:58,800 --> 00:06:59,140 I would put that in a file. 129 00:06:59,280 --> 00:07:00,500 Say that's the sequence that I want. 130 00:07:00,740 --> 00:07:01,720 And then I would... 131 00:07:01,720 --> 00:07:03,900 I also define what fuzzing primitives to use. 132 00:07:04,040 --> 00:07:05,300 Maybe I want to do SQL injection. 133 00:07:05,500 --> 00:07:06,740 Maybe I want to do command injection, whatever. 134 00:07:07,360 --> 00:07:09,360 And also which fields to fuzz. 135 00:07:09,620 --> 00:07:13,420 So I, as a user, would define that, and then it would go about, you know, automatically 136 00:07:14,100 --> 00:07:16,740 sending these message sequences according to my parameters. 137 00:07:17,140 --> 00:07:18,760 So it's not fully automated. 138 00:07:19,040 --> 00:07:20,700 The scenarios had to be generated manually. 139 00:07:23,160 --> 00:07:26,900 So contributions, sort of new things of what we're doing. 140 00:07:27,140 --> 00:07:28,780 First, we're automatically... 141 00:07:28,780 --> 00:07:30,300 We're automatically exploring the state machine on the server. 142 00:07:31,020 --> 00:07:36,880 So we, like the snooze fuzzer, we take the state machine, but we automatically explore it. 143 00:07:36,940 --> 00:07:38,520 Where they, sort of, they had... 144 00:07:38,520 --> 00:07:43,460 And in fact, if somebody out here, if I'm wrong about this, and, you know, and somebody from UC Santa Barbara is here, 145 00:07:43,500 --> 00:07:44,440 please come out and tell me. 146 00:07:44,480 --> 00:07:46,020 President Vigna, I think, was doing it. 147 00:07:46,200 --> 00:07:51,620 But what they do is they follow a strict path specified by the user, right? 148 00:07:51,740 --> 00:07:58,760 So if you want to explore the whole state machine, go through lots of different paths, which is often important to testing lots of different code paths, 149 00:07:58,780 --> 00:08:01,100 you would need to do that manually. 150 00:08:01,240 --> 00:08:03,360 You'd have to enumerate manually all the different paths. 151 00:08:03,700 --> 00:08:07,980 Where we'll do that, we'll automatically just walk through to a random walk through the state space. 152 00:08:09,220 --> 00:08:11,040 Also, we evaluate the response messages. 153 00:08:11,200 --> 00:08:13,520 And this is not completely new, but what we do is... 154 00:08:13,900 --> 00:08:19,540 So one way to check if you cause a failure is just to see if you never get a response back, right? 155 00:08:19,640 --> 00:08:23,020 So maybe you've killed the server, it's now dead, and you'll never get a response back. 156 00:08:23,100 --> 00:08:26,500 So after a certain timeout, you say, okay, succeeded, I crashed it. 157 00:08:26,780 --> 00:08:28,760 But there are other areas... 158 00:08:28,780 --> 00:08:30,340 That's sort of a drastic way to die. 159 00:08:30,640 --> 00:08:33,540 Another thing could happen is that instead of sending back... 160 00:08:33,540 --> 00:08:36,020 You could send back a message, but you might send back the wrong message. 161 00:08:36,160 --> 00:08:37,280 The server might respond the wrong way. 162 00:08:37,620 --> 00:08:38,660 So we check that. 163 00:08:38,720 --> 00:08:42,700 We check the messages that come back and verify that they are the type of message that we expect, 164 00:08:42,920 --> 00:08:47,580 according to the protocol as described in the RFC, which would be in the state machine. 165 00:08:47,700 --> 00:08:48,740 We check that they're the right type. 166 00:08:49,060 --> 00:08:52,140 And we check the dialogue information about it. 167 00:08:52,200 --> 00:08:55,000 So there's tag information that uniquely identifies a dialogue. 168 00:08:55,340 --> 00:08:58,660 The two tags, the call ID, we check all those things to make sure 169 00:08:58,660 --> 00:08:59,840 that they match what they should be. 170 00:09:01,880 --> 00:09:05,440 Also, we control the server GUI during fuzzing. 171 00:09:05,540 --> 00:09:07,160 So this is something other people don't do. 172 00:09:07,460 --> 00:09:12,200 The idea is that if you look at the server state machine, which I'll show you in a slide, 173 00:09:12,260 --> 00:09:18,300 I think, there are certain edges that in order to traverse the edge, the user, the person 174 00:09:18,300 --> 00:09:21,480 on the receiving end of the phone call, the person who's sitting at the server phone, 175 00:09:21,700 --> 00:09:22,520 has to do. 176 00:09:22,760 --> 00:09:28,640 So for instance, if I'm fuzzing a phone and nobody ever accepts the phone call, then the 177 00:09:28,660 --> 00:09:30,560 you're missing a lot of the state space. 178 00:09:30,700 --> 00:09:31,900 You're not testing a lot of the state space. 179 00:09:32,020 --> 00:09:35,100 Because there's a lot of interesting state space out there, which you can only reach if 180 00:09:35,100 --> 00:09:36,080 somebody accepts the phone call. 181 00:09:36,420 --> 00:09:39,300 So we will control the GUI. 182 00:09:39,380 --> 00:09:45,740 So we will force the accept to happen or decline to happen on the user side. 183 00:09:46,200 --> 00:09:49,840 Now one drawback of that is you might say, well, then maybe that's not a real vulnerability. 184 00:09:50,200 --> 00:09:56,740 Because it does not purely depend on what the attacker does in certain terms of sending 185 00:09:56,740 --> 00:09:57,080 messages. 186 00:09:57,080 --> 00:09:59,300 It depends on what the person at the phone does. 187 00:10:00,900 --> 00:10:05,540 But sometimes, for instance, the bug that we found, the person has to accept the phone 188 00:10:05,540 --> 00:10:05,720 call. 189 00:10:05,800 --> 00:10:08,080 But it is very easy to get somebody to accept a phone call. 190 00:10:08,200 --> 00:10:10,620 Meaning it's not uncommon that someone accepts a phone call. 191 00:10:10,780 --> 00:10:15,140 So if there's an exploit that you can only use if somebody accepts a phone call, that's 192 00:10:15,140 --> 00:10:15,320 valid. 193 00:10:15,740 --> 00:10:16,340 That's important. 194 00:10:16,680 --> 00:10:20,000 So we have to control the GUI to find those type of things. 195 00:10:21,900 --> 00:10:22,260 Yeah. 196 00:10:22,820 --> 00:10:25,660 And in fact, yeah, there's a lot of social engineering stuff you can do. 197 00:10:25,780 --> 00:10:26,820 So for instance, there's another. 198 00:10:27,280 --> 00:10:28,380 I'll show you a few slides. 199 00:10:28,560 --> 00:10:33,160 But in order to get something to happen, you need to get the person to decline a phone 200 00:10:33,160 --> 00:10:33,360 call. 201 00:10:33,500 --> 00:10:34,100 You can do that. 202 00:10:34,200 --> 00:10:36,540 You just call them a million times on the same phone number. 203 00:10:36,620 --> 00:10:38,800 And eventually, they're going to just decline, right? 204 00:10:38,880 --> 00:10:41,800 And then that one time, well, then that's the vulnerable time, right? 205 00:10:42,060 --> 00:10:47,240 So you've got to figure you can in some ways control the person at the server end. 206 00:10:47,420 --> 00:10:51,780 So if all you want to do is accept and reject a phone call, you can do that. 207 00:10:51,880 --> 00:10:52,620 You can get them to do that. 208 00:10:52,740 --> 00:10:53,720 So we do that. 209 00:10:53,840 --> 00:10:55,880 And that's different. 210 00:10:56,000 --> 00:10:56,260 All right. 211 00:11:01,380 --> 00:11:01,860 Okay. 212 00:11:01,980 --> 00:11:06,020 Here's basically what the system looks like almost out of time. 213 00:11:06,200 --> 00:11:07,960 We've got the protocol description right here. 214 00:11:08,160 --> 00:11:10,380 So that's input to us, right? 215 00:11:10,420 --> 00:11:12,840 Somebody gives us this state machine, which describes a protocol. 216 00:11:13,220 --> 00:11:17,820 There's a sequence generator, which sends out requests, you know, messages, and sends 217 00:11:17,820 --> 00:11:19,200 out GUI commands. 218 00:11:19,500 --> 00:11:21,520 So press, you know, accept, reject. 219 00:11:21,940 --> 00:11:24,820 And then there's a response analyzer, which gets back the responses. 220 00:11:24,880 --> 00:11:26,240 Also uses a data framework. 221 00:11:26,240 --> 00:11:29,220 So you can read from the protocol description to check to see if they match what the protocol 222 00:11:29,220 --> 00:11:29,800 description says. 223 00:11:32,840 --> 00:11:33,740 And, yeah, okay. 224 00:11:33,800 --> 00:11:35,980 So here's the state machine, and it's hard to read anyway. 225 00:11:36,160 --> 00:11:39,440 But just to give you just a walkthrough of one path through the state machine, so the 226 00:11:39,440 --> 00:11:40,040 common path. 227 00:11:40,360 --> 00:11:41,380 So you're at the start state. 228 00:11:41,560 --> 00:11:45,760 Somebody says they want to, somebody, you send an invite, and it goes to the invite 229 00:11:45,760 --> 00:11:47,960 state where it stays there just for a short time. 230 00:11:48,600 --> 00:11:50,700 Oh, I should name, I should describe how these are linked. 231 00:11:50,800 --> 00:11:51,900 You can't read it too well right here. 232 00:11:51,980 --> 00:11:52,640 I'll show you the next slide. 233 00:11:52,840 --> 00:11:54,480 But so they, it starts ringing. 234 00:11:54,620 --> 00:11:55,200 The phone rings. 235 00:11:55,280 --> 00:11:56,100 So you're staying in this ring. 236 00:11:56,240 --> 00:11:56,260 You go back to the start state. 237 00:11:56,600 --> 00:11:59,640 Until somebody picks up the phone, then you go to the okay state. 238 00:12:00,080 --> 00:12:03,940 Then if, then you send back the, once it gets the act message back, then it says, okay, 239 00:12:04,000 --> 00:12:04,640 I'm ready to start. 240 00:12:04,780 --> 00:12:06,160 So you're in the media connection state. 241 00:12:06,360 --> 00:12:10,820 Media connection, you just sit there until the, you know, let RTP do all the work. 242 00:12:11,120 --> 00:12:15,440 Until eventually somebody says bye, and when they click on bye, you go back to the start 243 00:12:15,440 --> 00:12:15,600 state. 244 00:12:15,860 --> 00:12:16,100 Okay. 245 00:12:16,400 --> 00:12:16,900 Go ahead. 246 00:12:18,280 --> 00:12:18,640 Two. 247 00:12:22,160 --> 00:12:22,800 Not many. 248 00:12:23,000 --> 00:12:23,500 K phone. 249 00:12:23,740 --> 00:12:24,260 Go ahead. 250 00:12:24,500 --> 00:12:24,860 . 251 00:12:25,860 --> 00:12:26,220 Okay. 252 00:12:34,680 --> 00:12:38,480 So what he just said, just to repeat, he's talking about fingerprinting the type of phone 253 00:12:38,480 --> 00:12:40,700 that you're using based on the bugs that you find in the phone. 254 00:12:41,040 --> 00:12:43,340 So you can say, okay, that's what, if I heard you right. 255 00:12:43,480 --> 00:12:46,180 So if you find certain type of bugs, you say, okay, that's got to be Cisco, right? 256 00:12:46,260 --> 00:12:47,620 We didn't do anything like that. 257 00:12:48,040 --> 00:12:49,720 You know, maybe soon. 258 00:12:50,700 --> 00:12:54,000 But we found other problems, other things, though, because when you go from one phone 259 00:12:54,000 --> 00:12:56,220 to another, they don't necessarily adhere to the RFC example. 260 00:12:56,220 --> 00:12:56,480 Exactly. 261 00:12:56,700 --> 00:12:57,140 Right? 262 00:12:57,220 --> 00:12:58,640 So you need to tweak the state machine. 263 00:12:59,000 --> 00:12:59,440 . 264 00:13:01,640 --> 00:13:02,080 Yes. 265 00:13:02,440 --> 00:13:02,880 . 266 00:13:04,040 --> 00:13:04,480 Yes. 267 00:13:04,540 --> 00:13:04,980 Absolutely. 268 00:13:05,160 --> 00:13:07,320 There are undefined things in the RFC. 269 00:13:07,500 --> 00:13:11,860 So the state machine that we're using exactly fits the phones that we're using. 270 00:13:12,280 --> 00:13:15,680 The vast majority of it stays the same, independent of the phone. 271 00:13:15,860 --> 00:13:20,560 But there was this manual discovery process that we did, where you go to the vague parts 272 00:13:20,560 --> 00:13:25,360 in the spec, and you just see what happens, and then you fill in the state machine based 273 00:13:25,360 --> 00:13:25,660 on that. 274 00:13:26,220 --> 00:13:31,520 So the generation of the state machine is tedious and manual from the RFC, and there 275 00:13:31,520 --> 00:13:34,100 are these vague parts in the RFC that you have to deal with somehow. 276 00:13:34,660 --> 00:13:35,980 So that's how we dealt with it. 277 00:13:36,020 --> 00:13:36,260 Question? 278 00:13:37,040 --> 00:13:37,400 . 279 00:13:38,940 --> 00:13:39,440 I'm sorry. 280 00:13:39,500 --> 00:13:39,940 I didn't hear it. 281 00:13:40,940 --> 00:13:41,300 . 282 00:13:43,320 --> 00:13:44,080 God, I don't know. 283 00:13:44,220 --> 00:13:45,280 I mean, I only use two. 284 00:13:45,520 --> 00:13:46,280 So I don't know. 285 00:13:46,400 --> 00:13:49,380 I mean, they almost, those two, K phone, K phone inside, they're pretty close. 286 00:13:50,460 --> 00:13:50,820 . 287 00:13:51,360 --> 00:13:51,720 . 288 00:13:51,720 --> 00:13:51,800 . 289 00:13:52,380 --> 00:13:52,740 . 290 00:13:52,740 --> 00:13:52,820 . 291 00:13:58,880 --> 00:13:59,320 . 292 00:14:05,200 --> 00:14:05,640 . 293 00:14:08,040 --> 00:14:08,480 . 294 00:14:08,480 --> 00:14:09,020 . 295 00:14:09,020 --> 00:14:09,060 . 296 00:14:09,060 --> 00:14:09,200 . 297 00:14:09,200 --> 00:14:09,220 . 298 00:14:09,220 --> 00:14:09,440 . 299 00:14:09,440 --> 00:14:09,460 . 300 00:14:09,460 --> 00:14:09,480 . 301 00:14:22,360 --> 00:14:22,800 . 302 00:14:22,800 --> 00:14:29,460 room at the end. All right. So, okay. So the algorithm, I don't even need to say this. All 303 00:14:29,460 --> 00:14:33,640 it does is you start in the start state. You assume the server's in its start state. You pick 304 00:14:33,640 --> 00:14:39,060 a, randomly pick an outgoing edge from that state. You take that edge and you look at the inputs on 305 00:14:39,060 --> 00:14:44,200 that edge. So the inputs meaning the events that trigger it. Okay. So there are three types of 306 00:14:44,200 --> 00:14:49,120 events that can trigger an edge. One is receiving a message. I got an invite, say. Okay. If that 307 00:14:49,120 --> 00:14:52,720 happens, you send the invite. If that's the edge that you want, you send the invite. Another thing 308 00:14:52,720 --> 00:14:58,160 is a GUI event. So somebody clicks accept. So if that's the edge, then that's the input, 309 00:14:58,240 --> 00:15:02,360 then you cause the GUI event. The other thing is a timeout. So like, say the phone's ringing 310 00:15:02,360 --> 00:15:06,240 and it's rung enough for a certain time limit. And then after a certain time limit, it just 311 00:15:06,240 --> 00:15:10,160 stops ringing. It goes to a new state. So the timeout is the third thing. Timeout, we basically 312 00:15:10,160 --> 00:15:15,500 fudge. We just wait. We know what the timer is from experimenting with the phone. So we just 313 00:15:15,500 --> 00:15:17,740 wait for that amount of time. And that's how we do that. 314 00:15:19,940 --> 00:15:24,140 And, okay, so this is just one example of that. Actually, this is a little zoomed in so you can 315 00:15:24,140 --> 00:15:28,740 actually look at the edge. The way this edges are labeled, start, invite, here, two states, 316 00:15:28,860 --> 00:15:32,640 you got this edge. It's labeled with something, there's something on the left and then there's 317 00:15:32,640 --> 00:15:36,420 a slash and something on the right. Okay. The thing to the left of the slash are the inputs. 318 00:15:36,600 --> 00:15:40,600 That's what triggers the edge. So in this case, you go from start to invite if you receive an 319 00:15:40,600 --> 00:15:46,000 invite message. Okay. Then the thing on the right is the output. Okay. What comes from the server, 320 00:15:46,040 --> 00:15:48,980 goes from the server back to the client. So it should send, 321 00:15:49,120 --> 00:15:53,100 the 100 trying message as a response to the invite. So that, so we check against that. We 322 00:15:53,100 --> 00:16:00,500 say, okay, did we receive that 100 trying or not? Okay. And then, so that's, so that's for the 323 00:16:00,500 --> 00:16:03,600 messages. But then there's some edges where, like, if you're in the ringing state and the 324 00:16:03,600 --> 00:16:07,960 timeout happens, then you go to the, go back to the start state. If you're in the ringing state 325 00:16:07,960 --> 00:16:11,940 and somebody clicks on decline, then you go to the decline state. Okay. So those are the three 326 00:16:11,940 --> 00:16:16,340 things that can happen. Either messages trigger the edge, timeout triggers it, or a GUI event. 327 00:16:16,460 --> 00:16:18,980 And we just cause all those to happen. And the GUI events, we use, 328 00:16:20,040 --> 00:16:25,600 X11 GUI test tool kit. You can find it on SourceForge. And it's just any, so we, we can only 329 00:16:25,600 --> 00:16:32,240 deal with soft, soft, soft phones. And they have to have an X interface. Because we're using 330 00:16:32,240 --> 00:16:38,360 X11 GUI test. And so the bug we found was in, in K phone we found a bug. And actually it 331 00:16:38,360 --> 00:16:42,820 was very fast to find the bug. Because it hadn't, actually this phone had been fuzzed before 332 00:16:42,820 --> 00:16:46,640 by previous work and they didn't find anything. But we found it very quickly because we could 333 00:16:46,640 --> 00:16:47,720 cause the accept to happen. 334 00:16:48,040 --> 00:16:48,440 So, 335 00:16:49,380 --> 00:16:53,280 Or off hook as I'm calling it here. So the, the, the problem was, the, what happens is 336 00:16:53,280 --> 00:16:57,300 you start, start state, you send an invite. Then it starts ringing, so it sends you back 337 00:16:57,300 --> 00:17:01,080 a ringing message and it starts a timer when it goes into the ringing state. Then, 338 00:17:01,080 --> 00:17:05,120 if, if somebody picks up, if it goes off hook, so the user, the GUI, somebody clicks 339 00:17:05,120 --> 00:17:09,960 off the, either picks up the phone or clicks accept. If that happens, when that happens 340 00:17:09,960 --> 00:17:13,540 you go from the ringing state to the okay state, right? But it, there's a short period 341 00:17:13,540 --> 00:17:18,420 of time in there where if you send a buy message right in that, right before it gets to the 342 00:17:18,420 --> 00:17:23,040 okay state, then it'll crash the phone. So, that's what happened. You know, we randomly 343 00:17:23,040 --> 00:17:26,820 tried messages and eventually just sent that buy in the right timing window and it crashed 344 00:17:26,820 --> 00:17:27,180 the phone. 345 00:17:28,700 --> 00:17:33,200 And this is just detail about exactly what happened. This is, the, actually it only 346 00:17:33,200 --> 00:17:37,960 had to traverse one, eight edges before it found that error. Ran, it was doing it randomly, 347 00:17:38,080 --> 00:17:41,240 right? It was doing it randomly and it traversed eight edges before it actually ran into the 348 00:17:41,240 --> 00:17:41,480 bug. 349 00:17:43,660 --> 00:17:47,900 And so, conclusion. So, we automatically looked through, we automatically explored the state 350 00:17:47,900 --> 00:17:53,460 state machine randomly. We verify the correct response messages. These are the right responses. 351 00:17:54,000 --> 00:18:00,540 And we control the GUI so that we can explore more of the state space. Future work, okay, 352 00:18:00,580 --> 00:18:06,580 so test more phones, obviously, and we're doing that. Debug the phones. So just because 353 00:18:06,580 --> 00:18:10,080 we crash the phone doesn't necessarily mean that there's an exploit there, right? Maybe 354 00:18:10,080 --> 00:18:14,320 it's just denial of service, but maybe it's a stack overflow or something. It's a buffer 355 00:18:14,320 --> 00:18:18,280 overflow. So we want to debug these phones, so I have a student trying to debug the phones 356 00:18:18,280 --> 00:18:23,580 right now. And then examine hard phones. So hard phones, so we got this Cisco phone that 357 00:18:23,580 --> 00:18:27,360 somebody from D-Link gave me. And I'm just going to open it up. I actually bought all 358 00:18:27,360 --> 00:18:31,680 my nice hardware equipment the other day. Open it up, and its button interface is just 359 00:18:31,680 --> 00:18:34,440 a bunch of switches, so we'll just replace it with solid state switches that are controlled 360 00:18:34,440 --> 00:18:40,780 from the machine, and then we can control its GUI interface in a hardware way and do 361 00:18:40,780 --> 00:18:43,300 the same thing and test the Cisco phone the same way. 362 00:18:44,520 --> 00:18:49,420 That's the hope, anyway. Okay, I don't know how to do that, but I'll 363 00:18:49,420 --> 00:18:53,700 ask you. Just a sec. Oh, yeah, but, oh, I'm sorry. We could auto-answer, but if we auto-answered, 364 00:18:53,720 --> 00:18:57,820 then it'll always accept, right? But I want it to, I want to be able to control it accepts 365 00:18:57,820 --> 00:19:02,680 now, it declines now, you know what I mean? So I want to have control over it. Go ahead. 366 00:19:11,360 --> 00:19:14,300 . So how, okay, so how sustainable is this? 367 00:19:14,320 --> 00:19:29,860 . I, man in the middle, he's saying, how 368 00:19:29,860 --> 00:19:33,320 success, how susceptible do I think these SIP phones are to man in the middle attacks? 369 00:19:34,000 --> 00:19:39,040 I don't know. I really don't know. I would refer you to David Angler, and who's the other 370 00:19:39,040 --> 00:19:42,620 guy who wrote that book? You must, you probably know that book, that Hacking VoIP Exposed 371 00:19:42,620 --> 00:19:43,740 book. That's a good book. 372 00:19:44,320 --> 00:19:48,680 And they talk about it in there, but I don't remember what they say. But that's, that, 373 00:19:48,800 --> 00:20:01,560 I don't know. . Yeah, I, yeah, I'm not, I really don't know. Thanks. Okay, that's 374 00:20:01,560 --> 00:20:06,260 it then. And we'll have to take questions offline, so there's that room back, like across 375 00:20:06,260 --> 00:20:10,120 the hall, down to the left a little bit, where I'm going to go right now. And if you have 376 00:20:10,120 --> 00:20:12,700 a question, just please follow, please come over there. Thanks.