1 00:00:00,000 --> 00:00:01,600 All right, I'd like to get started. 2 00:00:01,880 --> 00:00:03,320 My name is John Rose. 3 00:00:03,560 --> 00:00:06,500 I work for Trustwave in Spider Labs, 4 00:00:06,840 --> 00:00:09,960 which is their division that does pen testing, 5 00:00:10,660 --> 00:00:12,980 code review, network pen testing, 6 00:00:13,840 --> 00:00:15,020 forensics, and things like that. 7 00:00:15,500 --> 00:00:17,620 So basically what this talk is about is 8 00:00:17,620 --> 00:00:21,240 it's a tool that I wrote for an assessment 9 00:00:21,240 --> 00:00:23,020 I was doing for Flex servers. 10 00:00:23,800 --> 00:00:26,140 So the tool is called Dblaze, 11 00:00:26,200 --> 00:00:28,560 mainly because when I first wrote it, 12 00:00:28,560 --> 00:00:31,200 it was working on Blaze DS servers. 13 00:00:31,680 --> 00:00:34,460 And so I'll tell you guys a little bit about that 14 00:00:34,460 --> 00:00:36,340 and basically how it works. 15 00:00:36,580 --> 00:00:40,200 So I wrote a quick little demo app 16 00:00:40,200 --> 00:00:42,720 to show you guys how this stuff works. 17 00:00:43,640 --> 00:00:46,380 So it's just your standard Swift file. 18 00:00:46,860 --> 00:00:48,660 This application is supposed to represent 19 00:00:49,280 --> 00:00:50,580 a banking application. 20 00:00:50,920 --> 00:00:55,280 And you can log in and get your banking information 21 00:00:55,280 --> 00:00:58,360 and make funds. 22 00:00:58,560 --> 00:00:59,660 It transfers and log out. 23 00:00:59,780 --> 00:01:01,180 That's pretty much all it does at this point. 24 00:01:01,280 --> 00:01:02,100 It's not a whole lot. 25 00:01:02,380 --> 00:01:05,580 So what happens is with this application, 26 00:01:06,200 --> 00:01:08,120 you have the SWF file, 27 00:01:08,260 --> 00:01:09,860 which is running on the client side, 28 00:01:10,080 --> 00:01:13,960 and it's making remoting calls to the server side, 29 00:01:14,080 --> 00:01:14,900 which is all Java, 30 00:01:15,440 --> 00:01:18,820 or it can be Python or a couple different back ends. 31 00:01:19,060 --> 00:01:23,160 When this application communicates to the server, 32 00:01:23,380 --> 00:01:26,000 it goes through an HTTP post, 33 00:01:26,140 --> 00:01:28,260 and in that body of that post is 34 00:01:28,260 --> 00:01:31,160 AMF is the format, 35 00:01:31,440 --> 00:01:33,760 which is action message script. 36 00:01:33,920 --> 00:01:35,900 So it's a serialized version of that. 37 00:01:36,460 --> 00:01:38,320 I was doing an assessment of an application 38 00:01:38,320 --> 00:01:39,300 similar to this one, 39 00:01:39,880 --> 00:01:42,400 and I realized that it was very difficult 40 00:01:42,400 --> 00:01:45,280 to actually invoke those remoting methods 41 00:01:45,280 --> 00:01:47,260 with any of the tools that were out there. 42 00:01:47,340 --> 00:01:49,000 There basically wasn't anything that did it. 43 00:01:49,340 --> 00:01:54,340 So what I did is I leveraged a library called PYAMF, 44 00:01:54,480 --> 00:01:56,540 which basically is a Python library 45 00:01:56,540 --> 00:01:58,240 for doing AMFs. 46 00:01:58,260 --> 00:01:58,860 AMF communication. 47 00:01:59,440 --> 00:02:01,480 And I wrote just a generic client 48 00:02:01,480 --> 00:02:04,000 that would work on any Flex server. 49 00:02:04,800 --> 00:02:06,620 So it was really interesting 50 00:02:06,620 --> 00:02:08,960 as I started looking more and more into this 51 00:02:08,960 --> 00:02:12,140 and seeing what you could access on these servers, 52 00:02:12,340 --> 00:02:15,940 and it seemed like nobody really implemented 53 00:02:15,940 --> 00:02:18,720 a lot of access controls on the remoting methods. 54 00:02:19,300 --> 00:02:22,900 Either the developers felt like you couldn't find it, 55 00:02:23,020 --> 00:02:26,820 or it was just difficult to call or something like that. 56 00:02:28,780 --> 00:02:32,240 So I'll give you a quick example of this tool I wrote. 57 00:02:33,100 --> 00:02:34,320 It's called Dblaze. 58 00:02:34,380 --> 00:02:35,660 It's got a couple different methods 59 00:02:35,660 --> 00:02:38,320 for querying a Flex server. 60 00:02:40,680 --> 00:02:43,540 Basically, this may be somewhat difficult to see. 61 00:02:43,640 --> 00:02:44,620 It's kind of bright up here, 62 00:02:44,780 --> 00:02:47,240 but I'll walk through the different options. 63 00:02:47,600 --> 00:02:52,200 So one of the first options is to brute force 64 00:02:52,200 --> 00:02:54,320 different methods and services. 65 00:02:55,080 --> 00:02:58,240 The way that you communicate with a Flex server, 66 00:02:58,260 --> 00:03:01,540 is there's first the Flex gateway. 67 00:03:01,800 --> 00:03:02,740 So that's in the URL. 68 00:03:03,060 --> 00:03:06,400 There will be this gateway URI 69 00:03:06,400 --> 00:03:07,980 that you actually communicate with. 70 00:03:08,280 --> 00:03:11,260 And then you talk to a specific service. 71 00:03:11,620 --> 00:03:15,400 That service is going to map to a class file, 72 00:03:15,700 --> 00:03:18,020 and then you have the actual method 73 00:03:18,020 --> 00:03:18,920 that you're going to call. 74 00:03:19,200 --> 00:03:21,520 So the three things you need are the gateway, 75 00:03:21,800 --> 00:03:23,660 the service, and then the method 76 00:03:23,660 --> 00:03:25,700 to actually invoke any of the functionality 77 00:03:25,700 --> 00:03:26,640 on a Flex server. 78 00:03:27,080 --> 00:03:27,640 So, 79 00:03:28,260 --> 00:03:31,060 what I did is I came up with a couple different ways 80 00:03:31,060 --> 00:03:33,760 when you were analyzing a Flex server for security 81 00:03:33,760 --> 00:03:36,220 to figure out these things. 82 00:03:36,820 --> 00:03:39,720 So the first way is to just brute force them. 83 00:03:40,280 --> 00:03:43,320 You can figure out the gateway a couple different ways. 84 00:03:43,640 --> 00:03:44,980 Once you have the gateway, 85 00:03:45,240 --> 00:03:47,480 then you can brute force the service name, 86 00:03:47,640 --> 00:03:49,000 and then the method name. 87 00:03:50,440 --> 00:03:52,920 Different types of Flex servers 88 00:03:52,920 --> 00:03:57,520 respond differently to the request that you make. 89 00:03:57,620 --> 00:03:57,840 So, 90 00:03:58,260 --> 00:03:58,900 you can actually, 91 00:03:59,180 --> 00:04:01,220 a lot of them are not case sensitive, 92 00:04:01,400 --> 00:04:04,300 so you can brute force method names and service names, 93 00:04:04,980 --> 00:04:05,640 you know, 94 00:04:05,660 --> 00:04:06,260 and it doesn't matter, 95 00:04:06,340 --> 00:04:06,760 uppercase, 96 00:04:06,780 --> 00:04:07,140 lowercase, 97 00:04:07,320 --> 00:04:08,760 you'll still get the same response. 98 00:04:10,800 --> 00:04:11,620 And so, 99 00:04:12,160 --> 00:04:12,640 BlazeDS, 100 00:04:12,740 --> 00:04:13,900 from what I've seen, 101 00:04:14,000 --> 00:04:14,880 is case sensitive, 102 00:04:15,000 --> 00:04:16,980 but none of the other Flex servers are. 103 00:04:18,400 --> 00:04:20,620 And then once you've figured out the service 104 00:04:20,620 --> 00:04:21,580 and the method, 105 00:04:21,740 --> 00:04:23,440 then you can figure out the parameters 106 00:04:23,440 --> 00:04:25,000 that those methods take. 107 00:04:25,280 --> 00:04:25,680 Now, 108 00:04:25,700 --> 00:04:27,380 each method, 109 00:04:28,340 --> 00:04:29,880 will give you an error message 110 00:04:29,880 --> 00:04:31,680 based on the parameters that you supply, 111 00:04:31,860 --> 00:04:32,440 saying, you know, 112 00:04:32,500 --> 00:04:33,500 you only supplied, 113 00:04:33,600 --> 00:04:34,280 you know, 114 00:04:34,280 --> 00:04:35,320 you supplied zero parameters, 115 00:04:35,420 --> 00:04:36,840 this method takes two parameters. 116 00:04:37,200 --> 00:04:39,160 So it's easy to automate this 117 00:04:39,160 --> 00:04:40,120 and figure out exactly, 118 00:04:40,200 --> 00:04:40,660 you know, 119 00:04:40,660 --> 00:04:41,200 what it takes. 120 00:04:41,300 --> 00:04:42,140 The server tells you. 121 00:04:42,420 --> 00:04:43,840 And then it'll also say, 122 00:04:43,980 --> 00:04:44,220 you know, 123 00:04:44,240 --> 00:04:45,240 you supplied an int, 124 00:04:45,300 --> 00:04:47,480 this service takes a string. 125 00:04:47,740 --> 00:04:49,900 So there's a lot of information that comes back 126 00:04:49,900 --> 00:04:51,300 when you're invoking these services. 127 00:04:53,240 --> 00:04:56,040 So to give you a quick example of how this works, 128 00:04:57,540 --> 00:04:58,100 I've got, 129 00:04:58,100 --> 00:04:58,420 I've got a couple, 130 00:04:58,460 --> 00:04:59,080 a couple of demos. 131 00:04:59,300 --> 00:05:01,260 Hopefully you guys can see it and it's not too hard. 132 00:05:01,420 --> 00:05:02,400 Can, can you guys see that? 133 00:05:02,600 --> 00:05:03,260 Is that okay? 134 00:05:04,240 --> 00:05:08,120 I, I built a website that shows basically all these examples. 135 00:05:08,560 --> 00:05:10,180 I feel like it's a pretty good walkthrough. 136 00:05:10,300 --> 00:05:13,120 So if you are ever doing an assessment of a Flex application, 137 00:05:13,580 --> 00:05:14,600 you should be able to, 138 00:05:14,700 --> 00:05:15,220 to, you know, 139 00:05:15,240 --> 00:05:18,480 go through the walkthroughs and get enough information to, 140 00:05:19,720 --> 00:05:20,800 to use the tool. 141 00:05:20,960 --> 00:05:21,240 So, 142 00:05:22,340 --> 00:05:23,440 hopefully that'll work for you. 143 00:05:29,720 --> 00:05:30,400 All right. 144 00:05:30,400 --> 00:05:31,580 So my first example here, 145 00:05:31,700 --> 00:05:34,340 basically I'm calling dblaze, 146 00:05:34,340 --> 00:05:35,020 which is the tool. 147 00:05:35,160 --> 00:05:39,280 I'm supplying the URL to the gateway. 148 00:05:39,700 --> 00:05:40,520 It's up here. 149 00:05:40,680 --> 00:05:47,060 And then also I'm supplying the dash one parameter. 150 00:05:47,240 --> 00:05:48,500 That means brute force the service. 151 00:05:48,720 --> 00:05:51,480 And then also I'm supplying a test method. 152 00:05:51,740 --> 00:05:53,580 And I'm just grepping through the results. 153 00:05:53,660 --> 00:05:56,080 Otherwise it'll just spit out, 154 00:05:56,140 --> 00:05:56,560 you know, 155 00:05:56,580 --> 00:05:57,080 what's there, 156 00:05:57,120 --> 00:05:57,840 what's not there. 157 00:05:58,100 --> 00:06:02,160 And so it just brute forces the different services based on whatever, 158 00:06:02,320 --> 00:06:02,880 you know, 159 00:06:02,940 --> 00:06:04,640 list you have of service names. 160 00:06:05,600 --> 00:06:07,120 And so if you can see here, 161 00:06:07,200 --> 00:06:08,500 these two that came out, 162 00:06:08,560 --> 00:06:09,360 they're a little bit longer. 163 00:06:09,600 --> 00:06:13,280 It says this method test was not found on the service balance. 164 00:06:13,600 --> 00:06:16,480 So now I know that that service named balance is valid, 165 00:06:16,980 --> 00:06:18,340 but it doesn't have, 166 00:06:18,380 --> 00:06:19,400 you know, 167 00:06:19,440 --> 00:06:20,580 a method called test. 168 00:06:22,660 --> 00:06:23,600 So then next, 169 00:06:23,660 --> 00:06:24,880 once you've figured out that service, 170 00:06:25,420 --> 00:06:27,140 you can go back and then, 171 00:06:27,140 --> 00:06:28,080 basically, 172 00:06:28,080 --> 00:06:28,720 based on that service, 173 00:06:28,900 --> 00:06:31,960 you can brute force the method. 174 00:06:32,560 --> 00:06:34,120 And it's pretty much the same thing. 175 00:06:36,680 --> 00:06:38,700 And then if you can see this thing right here, 176 00:06:40,100 --> 00:06:43,900 we actually made a valid request to the balance service, 177 00:06:44,620 --> 00:06:46,880 and the method was get balance, 178 00:06:47,100 --> 00:06:48,580 which we brute forced as well. 179 00:06:48,740 --> 00:06:49,620 And so we know that's valid, 180 00:06:49,740 --> 00:06:53,400 but it gives me an empty array collection. 181 00:06:53,560 --> 00:06:56,420 So that means the result doesn't have any information. 182 00:06:56,620 --> 00:06:57,540 So it means it's a valid, 183 00:06:57,540 --> 00:06:58,380 if it's a valid request, 184 00:06:58,760 --> 00:07:01,080 you just didn't get any information back for it. 185 00:07:05,080 --> 00:07:06,840 So one of the things I wanted to do is, 186 00:07:06,940 --> 00:07:09,100 once you've figured out you have a valid service, 187 00:07:09,180 --> 00:07:10,000 you have a valid method, 188 00:07:10,180 --> 00:07:12,140 you want to go through and you want to try different parameters 189 00:07:12,140 --> 00:07:12,740 to try to, 190 00:07:12,760 --> 00:07:13,280 you know, 191 00:07:13,280 --> 00:07:15,320 fuzz that and see what responses you can get. 192 00:07:18,640 --> 00:07:19,640 So in this example, 193 00:07:19,760 --> 00:07:22,180 I'm just going through and fuzzing these different, 194 00:07:22,220 --> 00:07:23,760 different parameters that I'm, 195 00:07:23,760 --> 00:07:25,120 that for that same method. 196 00:07:25,380 --> 00:07:27,020 And if you see some of these responses, 197 00:07:28,040 --> 00:07:28,920 it's going to say, 198 00:07:29,060 --> 00:07:29,800 let's see, 199 00:07:29,880 --> 00:07:33,300 cannot convert type Java lang string to value, 200 00:07:33,520 --> 00:07:33,820 you know, 201 00:07:33,840 --> 00:07:35,200 whatever the fuzz value is. 202 00:07:35,360 --> 00:07:37,800 It's all these different values to instance of int. 203 00:07:37,980 --> 00:07:39,580 So it's providing a lot of information. 204 00:07:39,780 --> 00:07:42,520 I've seen this on all the different implementations of flex servers, 205 00:07:42,760 --> 00:07:47,940 whether it's Python or AMF PHP or blaze DS 206 00:07:47,940 --> 00:07:49,960 or the lifecycle data services. 207 00:07:50,140 --> 00:07:52,920 So all of them provide a lot of information back. 208 00:07:54,720 --> 00:07:56,560 So here's an example of a valid, 209 00:07:57,540 --> 00:07:58,180 a valid call. 210 00:08:01,280 --> 00:08:01,720 Basically, 211 00:08:01,820 --> 00:08:04,340 the parameter that I'm supplying here is, 212 00:08:04,340 --> 00:08:07,640 is the account number for get balance and you know, 213 00:08:07,660 --> 00:08:09,180 returns back my account balance, 214 00:08:09,240 --> 00:08:09,840 you know, 215 00:08:09,860 --> 00:08:11,500 information from that banking app. 216 00:08:12,420 --> 00:08:15,300 One of the things that I noticed a lot was applications, 217 00:08:15,580 --> 00:08:16,100 you know, 218 00:08:16,140 --> 00:08:18,560 they try to put some of the security controls in the client side. 219 00:08:18,720 --> 00:08:18,840 It's, 220 00:08:18,900 --> 00:08:19,120 you know, 221 00:08:19,140 --> 00:08:19,840 the same old problem, 222 00:08:19,920 --> 00:08:22,320 but they don't enforce it on the server side. 223 00:08:22,440 --> 00:08:26,380 So I've seen flex apps where you can just reset users passwords like this. 224 00:08:26,460 --> 00:08:26,660 I mean, 225 00:08:26,680 --> 00:08:26,920 you just, 226 00:08:26,920 --> 00:08:29,460 you're just arbitrarily grabbing you know, 227 00:08:29,480 --> 00:08:30,640 accounts and things like that. 228 00:08:31,600 --> 00:08:35,500 So another thing you can do is I created, 229 00:08:35,620 --> 00:08:35,940 you know, 230 00:08:35,960 --> 00:08:38,580 just a little bash script, 231 00:08:38,840 --> 00:08:39,620 you know, 232 00:08:39,620 --> 00:08:42,000 and you can just loop through these different account balances, 233 00:08:43,200 --> 00:08:44,080 potential accounts. 234 00:08:44,240 --> 00:08:44,300 So, 235 00:08:44,380 --> 00:08:44,560 you know, 236 00:08:44,580 --> 00:08:46,240 you go through like just brute force them. 237 00:08:46,480 --> 00:08:48,780 And so this is going to return all this information. 238 00:08:48,940 --> 00:08:49,120 All right. 239 00:08:49,220 --> 00:08:50,120 And it depends what, 240 00:08:50,240 --> 00:08:50,580 you know, 241 00:08:50,620 --> 00:08:52,020 your services and things like that. 242 00:08:55,000 --> 00:08:56,720 So another thing that I did, 243 00:08:56,720 --> 00:08:58,360 besides manually calling these, 244 00:08:58,580 --> 00:09:02,180 one of the ways that I figured out how to determine 245 00:09:02,180 --> 00:09:05,320 whether there were valid services and methods and stuff like that 246 00:09:05,320 --> 00:09:07,740 is I used this SWF dump tool. 247 00:09:08,160 --> 00:09:10,600 And so what SWF dump is going to do is, 248 00:09:10,860 --> 00:09:15,180 it's going to take your SWF file and basically convert it back 249 00:09:15,180 --> 00:09:19,020 into a more human readable like bytecode. 250 00:09:19,480 --> 00:09:23,440 So what you can do is you can grab a SWF file, 251 00:09:23,540 --> 00:09:25,000 convert it back to that bytecode, 252 00:09:25,120 --> 00:09:25,700 and then grep, 253 00:09:25,700 --> 00:09:30,900 grep through that for the remoting methods and other things that'll give you more information 254 00:09:30,900 --> 00:09:31,400 on the, 255 00:09:31,400 --> 00:09:32,780 the remoting stuff. 256 00:09:33,920 --> 00:09:35,000 So in this example, 257 00:09:35,220 --> 00:09:35,700 and this is, 258 00:09:35,820 --> 00:09:42,580 I've seen this on every version of SWF that was built with FlexBuilder. 259 00:09:42,680 --> 00:09:42,920 So, 260 00:09:43,040 --> 00:09:43,820 you know, 261 00:09:43,860 --> 00:09:43,980 it, 262 00:09:44,060 --> 00:09:45,260 it really depends on how you, 263 00:09:45,280 --> 00:09:46,020 you build it, 264 00:09:46,060 --> 00:09:47,100 but the ones that I've seen, 265 00:09:47,200 --> 00:09:48,240 I've all been like this. 266 00:09:48,420 --> 00:09:51,820 And basically what this does is I'm grepping through, 267 00:09:52,020 --> 00:09:53,580 I'm converting it back into, 268 00:09:54,080 --> 00:09:54,680 you know, 269 00:09:54,680 --> 00:09:55,200 the bytecode. 270 00:09:55,320 --> 00:09:57,580 I'm grepping through for a specific service tag, 271 00:09:57,880 --> 00:10:03,520 and which is embedded in a variable in the SWF which tells you where the gateway is and 272 00:10:03,520 --> 00:10:04,760 what the services are. 273 00:10:05,200 --> 00:10:06,140 So on here, 274 00:10:07,100 --> 00:10:07,760 you know, 275 00:10:07,780 --> 00:10:08,500 you can look through this. 276 00:10:08,560 --> 00:10:09,820 It's actually an XML file. 277 00:10:09,940 --> 00:10:10,840 It comes back as. 278 00:10:11,000 --> 00:10:12,280 And it gives you the information. 279 00:10:12,620 --> 00:10:13,020 Right? 280 00:10:13,640 --> 00:10:14,140 So, 281 00:10:14,550 --> 00:10:17,200 instead of having to actually like parse through all that stuff, 282 00:10:18,460 --> 00:10:19,100 you know, 283 00:10:19,120 --> 00:10:20,140 I've created a little, 284 00:10:20,810 --> 00:10:24,020 I've kind of filled out the tool so it actually automatically does that for you. 285 00:10:24,020 --> 00:10:25,820 Which is kind of nice. 286 00:10:26,900 --> 00:10:29,900 So here's another example where I search for the remoting methods. 287 00:10:30,360 --> 00:10:31,980 So actually after you, 288 00:10:32,080 --> 00:10:32,720 you know, 289 00:10:32,740 --> 00:10:36,080 query and figure out all the gateways from the SWF, 290 00:10:36,080 --> 00:10:37,360 you can find the methods too. 291 00:10:37,660 --> 00:10:38,060 Right? 292 00:10:38,100 --> 00:10:38,620 So here they are. 293 00:10:38,660 --> 00:10:39,300 There's our balance, 294 00:10:39,820 --> 00:10:40,340 trans, 295 00:10:40,680 --> 00:10:41,280 and login. 296 00:10:41,580 --> 00:10:42,100 Right? 297 00:10:42,220 --> 00:10:43,820 Now this isn't always the case, 298 00:10:43,840 --> 00:10:45,860 depending on how the SWF is written. 299 00:10:46,080 --> 00:10:47,840 So you may have to search for different things, 300 00:10:48,000 --> 00:10:48,740 but it, 301 00:10:48,760 --> 00:10:53,060 it definitely helps out in finding these things. 302 00:10:54,020 --> 00:10:54,100 So, 303 00:10:54,780 --> 00:10:55,720 another thing I, 304 00:10:55,740 --> 00:10:58,600 I guess I should say is that if you are using this tool to, 305 00:10:58,640 --> 00:10:59,560 to brute force method, 306 00:10:59,660 --> 00:10:59,980 or to, 307 00:11:00,060 --> 00:11:00,720 you know, 308 00:11:00,760 --> 00:11:03,080 grep through and find the methods in an SWF, 309 00:11:03,240 --> 00:11:06,460 that might not be all the methods available on that flex server. 310 00:11:06,740 --> 00:11:09,220 So you still probably want to brute force some things too. 311 00:11:09,560 --> 00:11:13,240 Because maybe there's different SWFs for like an admin or a normal user. 312 00:11:13,480 --> 00:11:14,540 And all those server, 313 00:11:14,680 --> 00:11:15,660 all those methods and, 314 00:11:15,660 --> 00:11:15,980 and, 315 00:11:15,980 --> 00:11:16,400 you know, 316 00:11:16,400 --> 00:11:17,720 remoting stuff is exposed, 317 00:11:17,840 --> 00:11:20,320 but you don't actually see it in the, 318 00:11:20,320 --> 00:11:20,680 in the, 319 00:11:21,920 --> 00:11:23,400 in the SWF. 320 00:11:23,560 --> 00:11:24,000 So, 321 00:11:27,120 --> 00:11:29,360 the next way that you can do it is there's a, 322 00:11:29,440 --> 00:11:33,960 this fully automated mode that I created that basically is gonna download the SWF, 323 00:11:34,620 --> 00:11:35,040 grep through, 324 00:11:35,160 --> 00:11:36,040 pull out all the, 325 00:11:36,060 --> 00:11:37,200 the things for it, 326 00:11:37,260 --> 00:11:38,360 all the remoting methods, 327 00:11:38,440 --> 00:11:39,040 the gateways, 328 00:11:39,040 --> 00:11:39,560 the end points. 329 00:11:39,860 --> 00:11:42,160 It's gonna go through all the services and the methods. 330 00:11:42,240 --> 00:11:44,300 It's gonna figure out the proper number of parameters. 331 00:11:44,680 --> 00:11:47,840 Then it's going to do some basic fuzzing of those parameters 332 00:11:47,840 --> 00:11:49,580 and generate a report for you. 333 00:11:49,760 --> 00:11:50,320 I mean, 334 00:11:50,320 --> 00:11:52,280 this isn't gonna auto-own anything for you, 335 00:11:52,340 --> 00:11:53,800 but it definitely gets you a lot closer. 336 00:11:53,800 --> 00:11:55,000 Because those methods, 337 00:11:55,160 --> 00:11:56,300 once you can access them, 338 00:11:56,560 --> 00:11:57,000 you know, 339 00:11:57,000 --> 00:11:58,980 potentially privilege escalation if it's, 340 00:11:58,980 --> 00:11:59,260 you know, 341 00:11:59,300 --> 00:12:00,200 admin related functionality. 342 00:12:00,780 --> 00:12:03,260 A lot of times there's information that leaks out. 343 00:12:03,420 --> 00:12:03,600 They, 344 00:12:03,740 --> 00:12:04,080 you know, 345 00:12:04,100 --> 00:12:04,600 SQL injection, 346 00:12:04,780 --> 00:12:05,420 all your standard, 347 00:12:05,460 --> 00:12:05,840 you know, 348 00:12:05,880 --> 00:12:06,540 web app stuff. 349 00:12:17,900 --> 00:12:19,740 So this is the report that it generates. 350 00:12:20,500 --> 00:12:23,220 And the first page here has just the SWF analysis. 351 00:12:23,220 --> 00:12:25,700 So this is running SWF dump. 352 00:12:25,980 --> 00:12:27,520 Basically the things that I pull out. 353 00:12:27,640 --> 00:12:29,980 So this is your gateways, your services and your methods. 354 00:12:30,300 --> 00:12:31,180 Once you have that, 355 00:12:31,260 --> 00:12:32,760 it's basically all you really need to, 356 00:12:32,780 --> 00:12:35,620 to manually call all those things and start doing it yourself 357 00:12:35,620 --> 00:12:36,200 if you want. 358 00:12:37,300 --> 00:12:39,940 Then I also have the methods that came back with 359 00:12:39,940 --> 00:12:40,680 a valid or, 360 00:12:40,700 --> 00:12:42,040 or seemingly valid response. 361 00:12:42,620 --> 00:12:44,940 And so you can see here it's got the URL, 362 00:12:45,160 --> 00:12:46,040 and that's your gateway. 363 00:12:46,940 --> 00:12:48,720 And then, you know, the service, 364 00:12:48,960 --> 00:12:50,580 which is login for this example, 365 00:12:50,740 --> 00:12:52,120 and the method is check creds. 366 00:12:52,120 --> 00:12:54,040 This was all pulled out of that SWF. 367 00:12:54,600 --> 00:12:55,880 It takes two parameters. 368 00:12:56,040 --> 00:12:58,580 The ones we supplied during the fuzzing was just zero, 369 00:12:58,620 --> 00:12:58,820 zero. 370 00:12:59,280 --> 00:13:02,520 And then the result was invalid username and password. 371 00:13:02,720 --> 00:13:02,900 Right. 372 00:13:02,960 --> 00:13:03,680 So there's the login. 373 00:13:04,260 --> 00:13:06,540 And I think that's the only one that comes up here. 374 00:13:06,700 --> 00:13:08,040 And then you look at the errors, 375 00:13:08,140 --> 00:13:12,500 and you'll see that we found this transfer method. 376 00:13:13,340 --> 00:13:16,700 The transfer service with the make trans method. 377 00:13:16,900 --> 00:13:18,840 And it takes four parameters and, 378 00:13:18,940 --> 00:13:20,940 but none of these actually worked correctly. 379 00:13:20,940 --> 00:13:23,420 And so you see here we get the wrong data type, 380 00:13:23,560 --> 00:13:25,740 which we saw earlier when I ran it manually. 381 00:13:26,300 --> 00:13:28,800 And then if you keep looking down through all these logs, 382 00:13:28,940 --> 00:13:29,940 it gives you a lot of information. 383 00:13:30,240 --> 00:13:32,240 So, like for this example it's got, 384 00:13:32,460 --> 00:13:36,340 it gives you the whole SQL query and other stuff about, 385 00:13:36,480 --> 00:13:37,100 you know, what, 386 00:13:37,220 --> 00:13:39,340 it's, it's just a stack trace basically. 387 00:13:42,240 --> 00:13:43,460 And then also, 388 00:13:43,620 --> 00:13:47,600 I also show any of the empty results. 389 00:13:47,920 --> 00:13:50,540 So that's basically where you query a method, 390 00:13:50,740 --> 00:13:50,920 and then you're gonna create the, 391 00:13:50,920 --> 00:13:54,060 with what appears to be the right parameters, 392 00:13:54,160 --> 00:13:55,640 but you don't get any response back. 393 00:13:55,960 --> 00:13:58,220 So for this example, I have the balance 394 00:13:58,220 --> 00:13:59,700 and then the get balance method, 395 00:14:00,220 --> 00:14:02,420 but with one parameter of just zero, 396 00:14:02,520 --> 00:14:04,760 and I get an empty array collection back. 397 00:14:05,020 --> 00:14:06,020 So I didn't get anything. 398 00:14:06,240 --> 00:14:09,760 So if you remember earlier, I threw in the proper numbers 399 00:14:09,760 --> 00:14:12,240 for the account number, and I got the results back. 400 00:14:26,220 --> 00:14:29,980 So another way that you can figure out, you know, 401 00:14:30,020 --> 00:14:31,280 what the methods that are being called, 402 00:14:31,380 --> 00:14:34,040 if you don't want to decompile the Swift file or whatever, 403 00:14:34,240 --> 00:14:37,180 is you can just use, like, Wireshark to grab the data. 404 00:14:37,520 --> 00:14:42,140 I don't think Wireshark has an AMF decoder yet, 405 00:14:42,320 --> 00:14:44,320 but you can still kind of pull it out 406 00:14:44,320 --> 00:14:48,500 and just see it, you know, in the actual body of that post. 407 00:14:48,940 --> 00:14:50,020 So it's not that hard. 408 00:14:50,080 --> 00:14:50,340 Also, 409 00:14:51,080 --> 00:14:53,000 charlsproxy will pull out some of that information, 410 00:14:53,160 --> 00:14:54,900 although it doesn't pull out all of that information. 411 00:14:56,200 --> 00:14:58,000 It's kind of interesting when I was going through 412 00:14:58,000 --> 00:15:00,740 the different decompilers to figure out some of the information 413 00:15:00,740 --> 00:15:02,520 about what the services and methods are. 414 00:15:02,840 --> 00:15:07,120 When you look at, I was using HPSWFscan, 415 00:15:07,220 --> 00:15:08,620 which came out fairly recently. 416 00:15:08,880 --> 00:15:11,720 That doesn't actually decompile all of the code for you. 417 00:15:11,840 --> 00:15:14,000 When you export that code, it's missing a lot of stuff, 418 00:15:14,060 --> 00:15:15,620 like the services and stuff like that. 419 00:15:15,980 --> 00:15:19,840 So, and I was using SoThink, but that's commercial, 420 00:15:19,840 --> 00:15:23,420 so it's, you know, not an ideal solution in my mind. 421 00:15:23,560 --> 00:15:28,780 And then SWFdump is open source, and it gets you enough there 422 00:15:28,780 --> 00:15:32,820 to actually manually review the output and figure out, 423 00:15:32,840 --> 00:15:33,740 you know, what's going on. 424 00:15:34,060 --> 00:15:37,820 So, you know, that's pretty much it for this tool. 425 00:15:38,040 --> 00:15:40,260 Like I said, there's three ways to figure out 426 00:15:40,260 --> 00:15:42,840 what the methods and services and gateways are. 427 00:15:43,480 --> 00:15:45,980 Looking through the SWF, grepping through that, 428 00:15:46,080 --> 00:15:48,900 reverse engineering that, just brute forcing them, 429 00:15:48,980 --> 00:15:49,820 and then sniffing the data. 430 00:15:49,840 --> 00:15:50,380 And then network traffic. 431 00:15:50,640 --> 00:15:52,680 So, you know, I've talked to a couple people 432 00:15:52,680 --> 00:15:55,300 over the last week or two who have had projects 433 00:15:55,300 --> 00:15:57,520 where they've had to do an assessment of flex servers, 434 00:15:57,700 --> 00:16:00,120 and they said, you know, it's been really useful 435 00:16:00,120 --> 00:16:01,580 because there's no real tool for it. 436 00:16:02,160 --> 00:16:04,860 So, you know, in the future, I hope to make it a little bit easier. 437 00:16:05,600 --> 00:16:08,220 I'm not a huge Python fan, so, you know, 438 00:16:08,280 --> 00:16:11,000 I don't know how much more coding I'm gonna do on it. 439 00:16:11,040 --> 00:16:12,240 I was thinking about porting it to Java. 440 00:16:13,280 --> 00:16:15,540 But it definitely, you know, does what it does 441 00:16:15,540 --> 00:16:17,420 for a quick and dirty hack tool. 442 00:16:17,740 --> 00:16:19,820 And doing Python, you know, I think, you know, 443 00:16:19,820 --> 00:16:21,460 pen testing as a profession right now, 444 00:16:21,620 --> 00:16:25,360 I've definitely broken into a lot of servers with this. 445 00:16:25,800 --> 00:16:28,060 So it's, you know, it does the trick for me. 446 00:16:28,460 --> 00:16:32,620 I guess as far as talking about how to fix this stuff, 447 00:16:34,900 --> 00:16:37,020 you know, it's kind of like anything else 448 00:16:37,740 --> 00:16:39,540 with the web app security stuff, 449 00:16:39,720 --> 00:16:41,720 is you gotta put access controls on those methods. 450 00:16:41,960 --> 00:16:43,620 Make sure that there's authorization. 451 00:16:44,060 --> 00:16:46,980 It depends on, you know, what your language you're writing in 452 00:16:47,390 --> 00:16:48,760 and the backend and things like that. 453 00:16:48,820 --> 00:16:49,640 But it's not that hard. 454 00:16:49,820 --> 00:16:52,180 And a lot of times, I think, when people use FlexBuilder 455 00:16:52,180 --> 00:16:53,480 or other things to build the GUI, 456 00:16:53,520 --> 00:16:55,640 they don't think about the backend 457 00:16:55,640 --> 00:16:57,080 or they don't really see that part. 458 00:16:57,200 --> 00:16:58,920 They think it's automatically taken care of. 459 00:16:58,960 --> 00:17:00,760 Or you have separate groups writing the backend 460 00:17:00,760 --> 00:17:02,920 and some people writing the frontend. 461 00:17:02,980 --> 00:17:05,660 Or in the frontend, they forget about the security controls 462 00:17:05,660 --> 00:17:07,680 or they think they can implement it there 463 00:17:07,680 --> 00:17:09,180 and they don't need it on the server side. 464 00:17:09,460 --> 00:17:12,160 So I don't know, I've had a lot of success with it. 465 00:17:12,240 --> 00:17:14,520 And yeah, it's worked out pretty good for me. 466 00:17:14,640 --> 00:17:17,060 So, and hopefully, you know, if you guys do any testing, 467 00:17:17,200 --> 00:17:19,120 things like that, you can try it out. 468 00:17:20,080 --> 00:17:21,580 Do you guys have any, any questions? 469 00:17:30,340 --> 00:17:32,260 I don't know if I have tried it on 470 00:17:32,260 --> 00:17:33,800 Lifecycle Data Services 3. 471 00:17:34,080 --> 00:17:37,560 I have tried it on the Lifecycle Data Services, 472 00:17:37,820 --> 00:17:39,340 but I don't know what version it was 473 00:17:39,340 --> 00:17:41,300 because I didn't actually have access to the server. 474 00:17:42,800 --> 00:17:44,340 Do you know if there's any changes 475 00:17:44,340 --> 00:17:46,400 between the last version and, and 3 476 00:17:47,000 --> 00:17:48,500 that would affect this tool? 477 00:17:52,560 --> 00:17:54,360 I don't, I don't think so, honestly, 478 00:17:54,400 --> 00:17:57,800 because I think it's more of an application code specific thing 479 00:17:58,360 --> 00:17:59,580 than really the server. 480 00:17:59,780 --> 00:18:02,100 Although some of the error messages that come back 481 00:18:02,100 --> 00:18:03,720 are definitely generated by the server. 482 00:18:04,580 --> 00:18:06,340 So maybe if those got cleaned up. 483 00:18:06,400 --> 00:18:08,220 But I, I would be surprised, to tell you the truth. 484 00:18:13,060 --> 00:18:16,040 On air, it, you know, if, if an air app 485 00:18:16,040 --> 00:18:18,580 is doing flex remoting to a server, it would. 486 00:18:18,680 --> 00:18:19,620 Because it's not really focused 487 00:18:19,620 --> 00:18:22,040 on the client side, it's focused on the server side. 488 00:18:22,360 --> 00:18:25,340 So if you had an air application that did flex 489 00:18:25,340 --> 00:18:28,020 remoting with AMF, then yes, it would work. 490 00:18:28,180 --> 00:18:32,180 I haven't tried SWF on air, SWF dump on an 491 00:18:32,180 --> 00:18:34,960 air file yet, but I feel like it, it would 492 00:18:34,960 --> 00:18:35,780 probably work. 493 00:18:36,500 --> 00:18:37,840 But I'm not, I'm not positive. 494 00:18:39,720 --> 00:18:40,500 Any other questions? 495 00:18:40,660 --> 00:18:40,940 Any other questions from the audience? 496 00:18:40,940 --> 00:18:43,480 I have a question about, you know, pulling the methods 497 00:18:43,480 --> 00:18:45,360 from the, from the SWF itself. 498 00:18:45,580 --> 00:18:47,860 But there could be methods that aren't used by that. 499 00:18:48,140 --> 00:18:49,600 Are there any other ways to do that? 500 00:19:00,320 --> 00:19:02,200 Right, right. 501 00:19:02,300 --> 00:19:05,460 OK, so the question is, if you pull out the methods 502 00:19:05,460 --> 00:19:08,300 from the SWF, what if there's additional methods that 503 00:19:08,300 --> 00:19:09,460 are not in the SWF? 504 00:19:09,620 --> 00:19:09,900 Right? 505 00:19:09,960 --> 00:19:10,620 How do you find those? 506 00:19:11,000 --> 00:19:12,820 The way I've gone about finding those is 507 00:19:12,820 --> 00:19:13,820 just brute forcing them. 508 00:19:14,480 --> 00:19:15,180 I don't know. 509 00:19:15,880 --> 00:19:18,320 You know, maybe you could find another SWF file that 510 00:19:18,320 --> 00:19:19,020 had that information. 511 00:19:19,020 --> 00:19:21,660 And then basically, you know, do that. 512 00:19:21,800 --> 00:19:24,480 But basically brute force, you just guess them. 513 00:19:24,500 --> 00:19:25,000 That's what I do. 514 00:19:25,220 --> 00:19:26,200 I've been pretty successful. 515 00:19:26,420 --> 00:19:29,760 I mean, people, you know, I, I have a, a small 516 00:19:29,760 --> 00:19:31,860 word list that, that I have with the tool. 517 00:19:32,000 --> 00:19:34,140 Basically with a bunch of common getters and setters 518 00:19:34,140 --> 00:19:35,220 and, and common functions. 519 00:19:35,300 --> 00:19:37,500 And you know, it's pretty successful. 520 00:19:37,600 --> 00:19:39,540 I mean, I think honestly you could put the biggest 521 00:19:39,540 --> 00:19:41,200 word list you want on it and just let it run. 522 00:19:41,320 --> 00:19:43,700 I don't think anyone would notice it on their server. 523 00:19:45,400 --> 00:19:45,780 . 524 00:19:45,780 --> 00:19:46,200 Yeah. 525 00:19:47,040 --> 00:19:47,420 Yeah. 526 00:19:47,420 --> 00:19:47,480 Yeah. 527 00:19:47,480 --> 00:19:47,660 Yeah. 528 00:19:49,020 --> 00:19:49,500 Yes. 529 00:19:49,700 --> 00:19:51,880 I have a list that you can take to either brute 530 00:19:51,880 --> 00:19:53,780 force services or the methods. 531 00:19:54,780 --> 00:19:55,260 Yep. 532 00:19:57,740 --> 00:19:58,220 Yes. 533 00:19:58,340 --> 00:19:59,020 Question back here. 534 00:20:02,060 --> 00:20:02,540 . 535 00:20:10,240 --> 00:20:13,740 If you, okay, if you per, the question is if you 536 00:20:13,740 --> 00:20:19,000 prefix your methods with certain characters, would it make it more difficult or, or, I'm 537 00:20:19,020 --> 00:20:19,820 possible to brute force? 538 00:20:19,960 --> 00:20:22,100 I guess it just matters if it, if those characters are 539 00:20:22,100 --> 00:20:23,360 in your brute force list, right? 540 00:20:23,700 --> 00:20:25,000 I mean, it's obfuscation. 541 00:20:25,020 --> 00:20:26,920 It's a matter of how big your dictionary is. 542 00:20:27,040 --> 00:20:27,300 Right? 543 00:20:29,380 --> 00:20:29,700 So. 544 00:20:31,180 --> 00:20:31,680 All right. 545 00:20:31,720 --> 00:20:32,140 Well, thank you. 546 00:20:32,180 --> 00:20:34,240 I'm out of time here, but I'll be, I'll be around if 547 00:20:34,240 --> 00:20:35,120 anyone has any questions. 548 00:20:35,380 --> 00:20:36,140 Thank you very much.