1 00:00:01,940 --> 00:00:08,020 Welcome. We will talk about Citrix and terminal servers. I have found some new 2 00:00:08,020 --> 00:00:16,060 stuff about published applications and I will show them how to connect to these 3 00:00:16,060 --> 00:00:25,180 published applications, but with a Citrix client you can't do that. First I have to 4 00:00:25,180 --> 00:00:37,560 say that this presentation will be up later on this webpage. Also the programs 5 00:00:37,560 --> 00:00:44,140 you have on your CD is like old, it's like very very old, like three months old or 6 00:00:44,140 --> 00:00:53,320 something. So there are new stuff there as well and I think the tools are there already. 7 00:00:55,860 --> 00:01:07,400 And about questions, if something is really not clear, okay you can ask for it, but otherwise 8 00:01:07,400 --> 00:01:12,940 it's better for you to come up to see me or one of my friends who have all these t-shirts. 9 00:01:14,220 --> 00:01:18,420 Yeah, Rick is sitting there, you can wave. Give Rick a hand now. 10 00:01:25,260 --> 00:01:35,260 So you don't have to take notes really. I will also make a link on this page from my 11 00:01:35,260 --> 00:01:48,080 part. DEF CON .org. So we will talk about what is terminal servers, terminal services, one 12 00:01:48,080 --> 00:01:54,980 slide or something, and then how to abuse terminal services and scanning for non-public 13 00:01:55,180 --> 00:02:02,340 published applications, like there are published applications that are public, that you could 14 00:02:02,340 --> 00:02:09,840 reach, can reach, and there are several servers out there that has published applications, 15 00:02:10,400 --> 00:02:19,160 but you can't just see them or connect to them. I will make a demonstration of this 16 00:02:19,160 --> 00:02:25,680 machine. This is a freshly installed Citrix server with some published applications. 17 00:02:25,980 --> 00:02:38,400 It has two network interfaces. One network interface is a master browser, it's called, 18 00:02:39,360 --> 00:02:45,760 Citrix Master Browser, and I can't reach it from this computer. I will show you how it 19 00:02:46,080 --> 00:02:46,800 can be done. 20 00:02:50,700 --> 00:02:59,720 Then I will show statistics from a very large scan. It's a scan for some millions of iPad 21 00:02:59,720 --> 00:03:04,660 addresses. I will not tell you how many servers I've found, but I will tell you about the 22 00:03:04,660 --> 00:03:05,860 statistics about them. 23 00:03:10,000 --> 00:03:18,560 What is terminal services? It's like a remote multi-user desktop. It's more or less like 24 00:03:18,560 --> 00:03:26,980 X. It's not that fancy for us UNIX freaks, but for Windows it's really weird. It starts 25 00:03:26,980 --> 00:03:33,720 an application on one server. It runs over at the server, and all changes in thegi 26 00:03:37,520 --> 00:03:45,380 window are going over the network, to you, the client. It's like sitting locally on 27 00:03:45,380 --> 00:03:47,500 a PC, but over a network. 28 00:03:47,840 --> 00:03:48,540 Then, Amanda says, right on target, that's yogurt! 29 00:03:48,540 --> 00:03:51,460 So everything, you have just a client 30 00:03:52,220 --> 00:03:53,420 to connect to the server, 31 00:03:53,540 --> 00:03:56,260 and everything is run on the server, you know? 32 00:03:56,640 --> 00:03:59,480 So you have to remember that. 33 00:04:00,480 --> 00:04:04,960 And Citrix has a feature called published application. 34 00:04:06,220 --> 00:04:07,760 And this means, like, 35 00:04:07,860 --> 00:04:11,380 well, we'll come very much into that, 36 00:04:11,480 --> 00:04:17,640 but it is like you can execute a program 37 00:04:17,640 --> 00:04:18,760 like Word or something. 38 00:04:20,500 --> 00:04:22,520 And you can, like, say to a server, 39 00:04:23,180 --> 00:04:25,620 what applications do you have that I can run? 40 00:04:25,900 --> 00:04:28,120 And it says, like, Word, okay, try Word, let's try it. 41 00:04:28,460 --> 00:04:29,960 So it's a little bit weird. 42 00:04:32,380 --> 00:04:34,260 So everything works fine, 43 00:04:34,360 --> 00:04:37,520 and it's really beautiful, this terminal services, 44 00:04:38,140 --> 00:04:41,540 because it's, you no longer have to, like, 45 00:04:42,200 --> 00:04:44,960 like, download lots of data and programs 46 00:04:45,780 --> 00:04:47,580 over your modern line. 47 00:04:49,020 --> 00:04:51,580 Because it's, the only thing that's good 48 00:04:51,580 --> 00:04:53,500 is, like, changes in the desktop. 49 00:04:55,540 --> 00:04:58,580 And it's very fast and very, very nice. 50 00:04:58,700 --> 00:04:59,740 So I really like it. 51 00:04:59,820 --> 00:05:02,460 But there are some weird things 52 00:05:02,460 --> 00:05:04,680 that you really have to know setting this up. 53 00:05:04,940 --> 00:05:07,320 There are, like, there are several people 54 00:05:07,780 --> 00:05:12,500 running different desktops on the Citrix server, okay? 55 00:05:12,980 --> 00:05:17,620 That means, like, the Citrix server created. 56 00:05:17,640 --> 00:05:21,400 starts up lots of desktops, and then sends the changes 57 00:05:21,400 --> 00:05:25,840 of each desktop to the right client, okay? 58 00:05:27,140 --> 00:05:33,120 If you own the Citrix server, you have access 59 00:05:33,120 --> 00:05:36,040 to all these desktops, of course. 60 00:05:37,520 --> 00:05:39,040 So that's a little bit weird. 61 00:05:39,940 --> 00:05:43,620 So elevation of rights, and this is done on Windows 2000, 62 00:05:43,620 --> 00:05:49,680 so I usually use Pipe App Admin, or Pipe App SAM. 63 00:05:50,240 --> 00:05:55,520 There are some different tools for elevation 64 00:05:56,480 --> 00:05:58,400 of rights on MT. 65 00:06:02,100 --> 00:06:05,240 You also, when you're starting up your application, 66 00:06:07,040 --> 00:06:10,020 your published application, like Notepad or something, 67 00:06:10,280 --> 00:06:12,800 it's just Notepad, nothing there, or is it? 68 00:06:12,800 --> 00:06:15,860 Well, the desktop is there, but it's just hidden. 69 00:06:16,040 --> 00:06:17,820 You can start it up, another thing. 70 00:06:17,960 --> 00:06:22,200 The problem is is breaking out from the given environment 71 00:06:22,200 --> 00:06:22,740 that you had. 72 00:06:25,320 --> 00:06:29,980 One really fun thing or weird thing about Citrix 73 00:06:32,220 --> 00:06:37,620 you can say these published applications are anonymous. 74 00:06:40,460 --> 00:06:42,780 These means you're sitting on your laptop 75 00:06:42,780 --> 00:06:47,080 on the internet, a Citrix server has published application 76 00:06:47,920 --> 00:06:50,080 that you can connect to anonymously 77 00:06:50,340 --> 00:06:52,540 and execute this published application. 78 00:06:53,100 --> 00:06:55,100 You break out from that environment 79 00:06:56,060 --> 00:07:00,960 and upload your cool new Elevation Rights stuff to it, 80 00:07:01,040 --> 00:07:06,000 elevate your rights, and you have the whole server 81 00:07:06,000 --> 00:07:11,160 with lots of users and bosses and so on to it, 82 00:07:11,160 --> 00:07:17,820 reading their mail and so on, so it's quite fun. 83 00:07:22,540 --> 00:07:25,620 So how do you find these published applications? 84 00:07:26,000 --> 00:07:31,080 I think the fastest way to find published application 85 00:07:31,080 --> 00:07:36,280 is to port scan for the TCP port 1494, 86 00:07:36,680 --> 00:07:40,900 it's like the Citrix, you always need that port. 87 00:07:40,900 --> 00:07:43,680 If you don't have that port, you can't connect. 88 00:07:44,690 --> 00:07:47,220 So it's very easy to just scan for it. 89 00:07:48,100 --> 00:07:50,820 But it's even easier to just search 90 00:07:50,820 --> 00:07:53,680 for published applications that companies 91 00:07:53,680 --> 00:07:58,500 are publishing for you, like Dmoves and so on. 92 00:07:59,040 --> 00:08:01,720 And it's weird how many servers is out there 93 00:08:01,720 --> 00:08:04,440 that want you to take over their network. 94 00:08:07,020 --> 00:08:09,880 And the use, 95 00:08:12,180 --> 00:08:17,680 if you find a port 1494, you can use a Citrix client 96 00:08:17,680 --> 00:08:20,200 to enumerate the published application. 97 00:08:21,040 --> 00:08:23,880 It's, you start up the Citrix network client 98 00:08:23,880 --> 00:08:25,560 or something, what's it called, Citrix client, 99 00:08:25,720 --> 00:08:27,720 and make a new connection, so it's like, 100 00:08:27,780 --> 00:08:30,680 I want to connect to this Citrix server, 101 00:08:30,840 --> 00:08:33,260 and what kind of published application does it have? 102 00:08:33,280 --> 00:08:34,280 And it's just like, yeah, these, 103 00:08:34,540 --> 00:08:37,160 and you know, go, you can start checking. 104 00:08:39,780 --> 00:08:45,400 Here's a network dump from normal Citrix client 105 00:08:46,300 --> 00:08:49,560 published application enumeration session, okay? 106 00:08:50,200 --> 00:08:54,760 It's like the Citrix client is asking the server, 107 00:08:56,260 --> 00:08:59,520 like what kind of published applications do you have? 108 00:09:00,060 --> 00:09:03,260 But the client do this in this way. 109 00:09:04,740 --> 00:09:06,600 I don't see if you see that. 110 00:09:06,680 --> 00:09:07,140 It occurs automatically. 111 00:09:07,160 --> 00:09:19,940 here, but here's the client asking the Citrix server, it's a UDP question on port 164, so 112 00:09:19,940 --> 00:09:33,320 the Citrix client sends a first package asking where is the master browser, and the response 113 00:09:33,320 --> 00:09:45,720 will be like the master browser is C1, OB, OC, OD, C1, OB, OC, OD, like twice, it's not, 114 00:09:49,340 --> 00:10:01,020 yeah, I'm lying a little bit, but more or less, and then, but this C1, OB, OC, OD is 115 00:10:01,020 --> 00:10:01,960 an IP address. 116 00:10:04,260 --> 00:10:14,760 So, if you just, it's from hex to digits, so then the client will ask, of course, the 117 00:10:14,760 --> 00:10:21,460 server, okay, I hope I'm, you are the master browser, give me your published applications, 118 00:10:22,340 --> 00:10:28,540 and the server will, yeah, enumerate all the published applications for you. 119 00:10:30,560 --> 00:10:32,480 But this is some problems. 120 00:10:36,720 --> 00:10:40,340 What happens if the master browser is not public? 121 00:10:41,020 --> 00:10:46,080 The client asks first, like, where is the master browser? 122 00:10:46,440 --> 00:10:51,700 And it says, like, it's on the TEM network, like our internal network, it's firewalled 123 00:10:51,700 --> 00:11:02,320 and everything, and the Citrix server, the Citrix client will try to connect to this 124 00:11:02,320 --> 00:11:02,900 TEM address. 125 00:11:02,960 --> 00:11:03,300 It's private. 126 00:11:03,320 --> 00:11:04,400 It's not a private address, but it will fail. 127 00:11:05,620 --> 00:11:13,480 So, you have a written small tool that just asks the Citrix server directly, give me 128 00:11:13,480 --> 00:11:21,540 your published applications, because otherwise, if you use the Citrix client connecting to 129 00:11:21,540 --> 00:11:28,980 a Citrix server and asks the server for published applications, of course, the client asks, 130 00:11:30,680 --> 00:11:32,120 where is the master browser? 131 00:11:33,320 --> 00:11:41,680 The server answers, like, it's TEM.11.12.13, so the client tries to connect to it, and 132 00:11:41,680 --> 00:11:42,620 of course, new connection. 133 00:11:48,600 --> 00:11:55,300 The little Perl script I've written, it only works in Unix, because we're using alarm 134 00:11:55,300 --> 00:12:02,900 functions, choosing blocking sockets. 135 00:12:04,600 --> 00:12:10,820 I only send, like, give me all your published applications, and it works perfectly, it's 136 00:12:10,820 --> 00:12:11,360 beautiful. 137 00:12:11,900 --> 00:12:16,740 So, it sends back one or more packages of published applications. 138 00:12:17,320 --> 00:12:18,320 Very cool. 139 00:12:19,140 --> 00:12:20,220 I'll show you later. 140 00:12:25,800 --> 00:12:31,000 But connecting to these published applications, okay, you have a list now, okay, here's the 141 00:12:31,000 --> 00:12:32,040 published applications. 142 00:12:32,040 --> 00:12:34,100 But how should you connect to it? 143 00:12:34,400 --> 00:12:45,700 Because the Citrix client is not open source, what I know, and there are really weird stuff 144 00:12:45,700 --> 00:12:46,780 you have to do to connect. 145 00:12:46,980 --> 00:12:49,780 It's not hard stuff, but it's weird stuff. 146 00:12:50,530 --> 00:12:58,760 Because the Citrix client, you have to spoof the answers from the Citrix server twice. 147 00:12:59,780 --> 00:13:00,460 This is a problem. 148 00:13:00,960 --> 00:13:01,540 You have to spoof the answers from the Citrix server twice. 149 00:13:01,540 --> 00:13:02,020 You have to spoof the answers from the Citrix server twice. 150 00:13:02,020 --> 00:13:10,840 There's the master browser spoof, and the application server spoof. 151 00:13:11,060 --> 00:13:13,460 I will show you, it's not that hard. 152 00:13:14,360 --> 00:13:22,860 I have written two programs that can connect directly to the published applications when 153 00:13:24,900 --> 00:13:31,000 the master browser is not public. 154 00:13:31,200 --> 00:13:31,620 Okay. 155 00:13:32,000 --> 00:13:40,040 I will just show you how the connection to a published application goes. 156 00:13:40,360 --> 00:13:45,480 First the client asks, give me, where is the master browser? 157 00:13:46,900 --> 00:13:52,840 And the server will tell it, yeah, it's this non-public IP address, so I have to spoof 158 00:13:52,840 --> 00:13:53,280 that one. 159 00:13:55,180 --> 00:14:01,980 And then the client will ask, like, okay, I want to connect to it. 160 00:14:02,000 --> 00:14:03,120 I want to connect to this published application. 161 00:14:03,720 --> 00:14:11,580 And the server will ask, yeah, you are welcome to do that on a non-public IP address. 162 00:14:14,080 --> 00:14:16,080 So the connection will fail. 163 00:14:17,380 --> 00:14:29,280 But if you change all the red stuff here to the public Citrix server IP address, you 164 00:14:29,280 --> 00:14:30,160 will get that connection. 165 00:14:30,860 --> 00:14:31,500 Understand? 166 00:14:32,060 --> 00:14:35,340 The master browser is just trying to trick you. 167 00:14:37,040 --> 00:14:41,360 The server is, the Citrix server has these sorts of applications. 168 00:14:41,660 --> 00:14:48,820 You have no need to, like, connect to this internal IP address. 169 00:14:50,920 --> 00:14:59,000 It's usually like they're having a firewall or something, or a NAT network. 170 00:14:59,380 --> 00:15:00,140 So it's, yeah. 171 00:15:00,140 --> 00:15:10,080 I've also written a script that will take the output from the Citrix PIS scan, that program 172 00:15:10,080 --> 00:15:15,180 that animate all the applications, and step through it and try to connect to all the applications. 173 00:15:15,760 --> 00:15:23,020 And after each connect, it will ask you how it went, like, how did it went, and will log 174 00:15:23,020 --> 00:15:24,320 these results. 175 00:15:25,820 --> 00:15:30,120 And I've checked, like, thousands of power sources. 176 00:15:30,140 --> 00:15:34,240 And I've published applications, so it's really a fast way to do it. 177 00:15:34,400 --> 00:15:38,340 It takes just a few seconds on every published application. 178 00:15:41,200 --> 00:15:50,400 So the Citrix PIS scan takes input, an IP address, a minus for standard input, or a 179 00:15:51,740 --> 00:15:59,520 file, or the keyword random, when it reads from slash dev slash u random. 180 00:15:59,720 --> 00:16:00,120 And then it takes the output. 181 00:16:00,120 --> 00:16:01,820 To get the IP addresses. 182 00:16:02,320 --> 00:16:09,020 And it just sends, like, get me the, yeah, the published applications. 183 00:16:09,320 --> 00:16:11,980 And the server will, yeah, give it to you. 184 00:16:13,880 --> 00:16:15,760 The proxy is a little bit weirder. 185 00:16:16,260 --> 00:16:18,060 You have to bear with me. 186 00:16:18,500 --> 00:16:21,520 The client, you start up your proxy. 187 00:16:21,760 --> 00:16:24,940 It can be locally on another Linux computer or something. 188 00:16:26,940 --> 00:16:29,340 You connect to the proxy. 189 00:16:29,540 --> 00:16:30,100 And you log in. 190 00:16:30,100 --> 00:16:35,520 And the proxy connects to the server, like, where's the master browser? 191 00:16:36,300 --> 00:16:43,740 The server will respond to the proxy, saying, like, it is non-public master browser IP address. 192 00:16:44,340 --> 00:16:50,240 But the proxy changes it to saying, like, well, the master browser is the proxy. 193 00:16:51,060 --> 00:16:56,100 So your client connects to the proxy next time and says, like, oh, I want to run this 194 00:16:57,320 --> 00:16:58,360 published application. 195 00:16:59,160 --> 00:17:00,080 It sends the IP address. 196 00:17:00,080 --> 00:17:00,820 It sends it to the server. 197 00:17:00,980 --> 00:17:06,060 And the server sends back, welcome to this non-public master browser address. 198 00:17:07,140 --> 00:17:10,720 And the proxy will change it again, like, okay, okay. 199 00:17:11,020 --> 00:17:17,460 Will change it again, saying, like, you are welcome to this public IP address. 200 00:17:18,120 --> 00:17:21,520 And then it starts the normal TCP connection. 201 00:17:22,540 --> 00:17:28,820 You understand that to do this, we need UDP 1604 to the Citrix server. 202 00:17:29,360 --> 00:17:30,060 And then it starts the normal TCP connection. 203 00:17:30,080 --> 00:17:33,440 And then, of course, 1494, otherwise we can't connect, okay? 204 00:17:35,560 --> 00:17:37,540 So we'll make a demonstration now. 205 00:17:41,220 --> 00:17:44,820 I will do an NMAP scan and show you the tools. 206 00:17:47,440 --> 00:17:48,040 Here it is. 207 00:18:02,000 --> 00:18:02,880 Don't sleep. 208 00:18:05,560 --> 00:18:09,020 So here's my Linux computer. 209 00:18:09,480 --> 00:18:12,760 And I set an IP address for it. 210 00:18:13,240 --> 00:18:14,680 Did you make a response there? 211 00:18:14,980 --> 00:18:15,640 No. 212 00:18:15,640 --> 00:18:16,760 I tried. 213 00:18:18,240 --> 00:18:20,420 I tried for, like, one hour. 214 00:18:20,520 --> 00:18:24,060 And when it didn't work, I'm really sorry. 215 00:18:24,260 --> 00:18:25,560 I really tried. 216 00:18:25,860 --> 00:18:26,740 Oh, it sucks. 217 00:18:28,880 --> 00:18:29,400 . 218 00:18:33,720 --> 00:18:34,240 What? 219 00:18:34,900 --> 00:18:35,420 . 220 00:18:38,740 --> 00:18:39,660 What do you say? 221 00:18:40,400 --> 00:18:40,920 . 222 00:18:41,940 --> 00:18:42,460 . 223 00:18:42,460 --> 00:18:42,480 . 224 00:18:42,480 --> 00:18:43,000 . 225 00:18:43,000 --> 00:18:43,180 . 226 00:18:46,500 --> 00:18:46,940 . 227 00:18:46,940 --> 00:18:47,140 . 228 00:18:47,140 --> 00:18:48,180 No, no, no. 229 00:18:48,340 --> 00:18:48,460 No, no. 230 00:18:48,460 --> 00:18:48,480 . 231 00:18:48,480 --> 00:18:49,040 . . 232 00:18:49,040 --> 00:18:49,660 It's a . 233 00:18:49,660 --> 00:18:50,660 It's a . 234 00:18:50,660 --> 00:18:50,920 . 235 00:18:50,920 --> 00:18:51,800 It's a . 236 00:18:51,800 --> 00:18:53,280 I tried to find a phone number. 237 00:18:53,400 --> 00:18:54,820 It's, like, not working. 238 00:18:55,280 --> 00:18:55,720 Okay. 239 00:18:55,840 --> 00:18:56,000 . 240 00:18:56,000 --> 00:18:56,760 . 241 00:18:56,760 --> 00:18:57,120 . 242 00:18:57,120 --> 00:19:01,320 I can tell you a little bit, I'm making a port scan, 243 00:19:01,420 --> 00:19:04,120 it says like port scan for 1494, 244 00:19:04,820 --> 00:19:09,520 and it has written like three IP addresses 245 00:19:09,520 --> 00:19:17,900 I wanted to check, and well, 192.168.0100 246 00:19:18,420 --> 00:19:21,680 has an open port, so okay. 247 00:19:22,480 --> 00:19:26,080 We'll try to connect to it with our Citrix client. 248 00:19:30,280 --> 00:19:32,740 So, I start up my Citrix client, 249 00:19:35,180 --> 00:19:39,260 and I said like, oh, it's way far away, 250 00:19:40,060 --> 00:19:42,240 and I call it DMO, it doesn't matter, 251 00:19:42,500 --> 00:19:44,240 it's published applications, and here, 252 00:19:44,400 --> 00:19:49,240 on the server location, I enter the IP address 253 00:19:49,240 --> 00:19:52,880 of the server that has this open. 254 00:19:55,000 --> 00:19:57,100 Add, it's 192.168.0100. 255 00:19:57,120 --> 00:20:01,260 Add, it's 192.168.0100 for this one. 256 00:20:03,820 --> 00:20:09,540 So, and that's just, ah, it doesn't work. 257 00:20:11,520 --> 00:20:13,420 No, no, no, it shouldn't work, okay. 258 00:20:15,620 --> 00:20:19,780 So, I can't right now enumerate the published applications 259 00:20:19,780 --> 00:20:21,220 because they have two interfaces, 260 00:20:21,640 --> 00:20:24,060 and the one interface that I can't, 261 00:20:24,060 --> 00:20:26,180 I'm not connected to is the master browser. 262 00:20:27,120 --> 00:20:29,760 So, I can't really get the published applications right now. 263 00:20:30,160 --> 00:20:31,720 A lot of people, I think, like, 264 00:20:31,720 --> 00:20:34,520 having their Citrix servers, and like, 265 00:20:34,580 --> 00:20:37,160 trying to publish applications, and like, 266 00:20:37,240 --> 00:20:39,860 well, I can't get it with the client, 267 00:20:39,920 --> 00:20:43,140 so people can't see my published applications. 268 00:20:43,720 --> 00:20:46,240 Well, surprise for you. 269 00:20:49,360 --> 00:20:53,860 Now, running Citrix PSCAD, it's a small Perl script 270 00:20:53,860 --> 00:20:56,900 that just asks the server right away, like, 271 00:20:57,120 --> 00:21:01,040 what's your, what's your published applications? 272 00:21:01,780 --> 00:21:06,180 And there it is, and it says, the output is, like, 273 00:21:06,640 --> 00:21:08,940 the IP address you're connected to, 274 00:21:09,120 --> 00:21:14,900 and then it's the master browser IP address, 275 00:21:15,920 --> 00:21:22,280 and a boolean if you're, like, like, need a proxy or not. 276 00:21:23,100 --> 00:21:26,460 And then there comes all the published applications. 277 00:21:27,120 --> 00:21:29,380 And there can be hundreds of them, you know? 278 00:21:32,100 --> 00:21:35,340 So, we now start up our proxy instead. 279 00:21:35,620 --> 00:21:38,360 So, we use our proxy to connect to the, 280 00:21:39,380 --> 00:21:40,540 to the Citrix server. 281 00:21:43,060 --> 00:21:45,560 So, I now have started up the proxy, okay? 282 00:21:47,300 --> 00:21:51,840 It says, like, the Citrix server, 283 00:21:52,060 --> 00:21:56,340 we are proxy for 192.168.0.100. 284 00:21:56,480 --> 00:21:57,100 That's 192.168.0.100. 285 00:21:57,120 --> 00:21:58,000 I couldn't connect to. 286 00:21:58,180 --> 00:22:01,240 And I will listen on this address, 287 00:22:01,340 --> 00:22:04,240 because this is a remote computer that is a proxy. 288 00:22:04,440 --> 00:22:06,160 So, I will listen on this IP address 289 00:22:06,160 --> 00:22:09,100 and proxy it to the 100 address. 290 00:22:09,960 --> 00:22:10,480 Okay. 291 00:22:13,340 --> 00:22:16,060 So, I have to change server location, of course, 292 00:22:17,840 --> 00:22:18,900 to the proxy. 293 00:22:24,980 --> 00:22:26,020 And, okay. 294 00:22:27,120 --> 00:22:27,860 And I try to, 295 00:22:30,640 --> 00:22:35,960 and I try now to, to enumerate the published applications 296 00:22:35,960 --> 00:22:39,880 from, from, from the proxy, more or less. 297 00:22:40,040 --> 00:22:41,180 And the proxy tries it. 298 00:22:41,420 --> 00:22:45,320 But the proxy, like, saying, like, oh, wait a sec. 299 00:22:45,440 --> 00:22:46,620 Because the first packages, 300 00:22:46,680 --> 00:22:47,880 you don't know really what it is. 301 00:22:48,000 --> 00:22:50,040 So, the proxy says, like, oh, stop. 302 00:22:50,700 --> 00:22:53,360 I recognize this is an enumeration of PR, 303 00:22:53,960 --> 00:22:54,660 published applications. 304 00:22:55,900 --> 00:22:57,100 So, please try it. 305 00:22:57,100 --> 00:22:57,180 Try it again. 306 00:22:57,740 --> 00:22:58,180 Okay. 307 00:22:59,340 --> 00:23:00,060 We'll do that. 308 00:23:02,200 --> 00:23:03,000 We'll try again. 309 00:23:04,900 --> 00:23:05,900 Oh, there it is. 310 00:23:08,600 --> 00:23:09,900 So, thank you, thank you. 311 00:23:15,020 --> 00:23:17,700 So, we can connect to, like, Notepad or something 312 00:23:17,700 --> 00:23:20,460 and hope it's not passworded, anonymous. 313 00:23:21,960 --> 00:23:25,020 And it's more like, oh, I wanted a remote desktop window. 314 00:23:25,100 --> 00:23:26,120 It's more fun. 315 00:23:27,300 --> 00:23:28,160 So, there we'll see. 316 00:23:28,760 --> 00:23:31,380 And that's, like, default, default, default, finished. 317 00:23:31,680 --> 00:23:35,060 And I double-click here and make a prayer. 318 00:23:38,840 --> 00:23:39,340 Yeah. 319 00:23:41,480 --> 00:23:42,360 It's awesome. 320 00:23:43,040 --> 00:23:43,280 It's... 321 00:23:45,400 --> 00:23:47,900 Every time it works for me, I'm like, oh, baby. 322 00:23:54,360 --> 00:23:55,540 So, here's the... 323 00:23:55,540 --> 00:24:00,240 So, we are now connected to the main public 324 00:24:00,240 --> 00:24:01,740 Moser browser, public application. 325 00:24:02,480 --> 00:24:06,260 And there are, like, three ways of breaking out 326 00:24:06,260 --> 00:24:06,860 of the environment. 327 00:24:09,360 --> 00:24:12,320 The easiest way is, like, file, open, explore. 328 00:24:12,620 --> 00:24:13,560 I will do that. 329 00:24:16,400 --> 00:24:18,860 And, no, no, it's serious. 330 00:24:19,060 --> 00:24:23,140 I have done so many tests and penetration tests and so on. 331 00:24:23,520 --> 00:24:24,120 And... 332 00:24:24,120 --> 00:24:28,520 If no one of these three works, you know, it's, like, taking hours. 333 00:24:29,540 --> 00:24:31,900 But you have to learn these three. 334 00:24:32,260 --> 00:24:33,660 And there's, like, F1. 335 00:24:34,460 --> 00:24:35,500 Remember F1? 336 00:24:36,140 --> 00:24:45,240 If you have, like, a SAP, SAP L3, like, login window or something, that's F1 and start breaking 337 00:24:45,240 --> 00:24:45,860 out from there. 338 00:24:46,820 --> 00:24:49,960 And the third is, like, the task manager. 339 00:24:51,300 --> 00:24:51,820 People... 340 00:24:51,820 --> 00:24:52,640 Believe me. 341 00:24:52,720 --> 00:24:53,280 I, like... 342 00:24:54,120 --> 00:25:00,240 I checked out, like, thousands of thousands of published applications, and these three 343 00:25:00,240 --> 00:25:00,660 works. 344 00:25:00,820 --> 00:25:02,380 I will show you the statistics later. 345 00:25:04,200 --> 00:25:13,800 So, it's more or less, like, a file, open, and then you just take one, right-click, explore, 346 00:25:14,760 --> 00:25:16,320 and then magic starts happening. 347 00:25:17,660 --> 00:25:19,220 Like, oh, where's the desktop? 348 00:25:19,360 --> 00:25:19,860 Where's the desktop? 349 00:25:22,780 --> 00:25:23,540 Where is it? 350 00:25:23,820 --> 00:25:24,100 Where is it? 351 00:25:30,680 --> 00:25:34,860 And then you have to give it a name. 352 00:25:34,860 --> 00:25:35,280 You can do this. 353 00:25:35,280 --> 00:25:35,660 It's called a Hacking. 354 00:25:35,660 --> 00:25:35,900 It was hidden. 355 00:25:36,080 --> 00:25:36,600 It was... 356 00:25:36,600 --> 00:25:39,420 I recognize this. 357 00:25:40,840 --> 00:25:42,460 Oh, well. 358 00:25:43,220 --> 00:25:44,000 We'll see. 359 00:25:44,880 --> 00:25:45,680 could we hack it? 360 00:25:45,680 --> 00:25:47,700 Oh, that's it? 361 00:25:47,700 --> 00:25:50,600 You want me to hack it? 362 00:25:51,820 --> 00:25:54,780 No, it's a 100 machine. 363 00:25:55,100 --> 00:25:55,840 Okay, cool. 364 00:25:56,340 --> 00:25:58,900 Well, there's one way to do it. 365 00:26:02,520 --> 00:26:04,000 Think twice or something. 366 00:26:09,140 --> 00:26:16,620 This was with the proxy, but it takes very, very long time if you have hundreds of 367 00:26:16,620 --> 00:26:17,940 published applications to test. 368 00:26:18,500 --> 00:26:24,920 I've written another script called something. 369 00:26:25,340 --> 00:26:29,620 It's pas.pearl. 370 00:26:30,140 --> 00:26:33,720 It's just a small PEARL script that makes an ICA file. 371 00:26:34,800 --> 00:26:43,100 It takes the template ICA file, changes stuff in it, and then launches it. 372 00:26:43,240 --> 00:26:44,000 Really easy. 373 00:26:44,660 --> 00:26:45,420 Okay. 374 00:26:47,520 --> 00:26:54,280 I can show the template file. 375 00:26:54,540 --> 00:26:56,540 You will not see in this font, I guess. 376 00:27:00,220 --> 00:27:02,220 Something like this, bold or something. 377 00:27:06,740 --> 00:27:07,680 It's nothing really. 378 00:27:07,940 --> 00:27:14,980 It's like this PEARL, PEARL, PEARL changed to the published application. 379 00:27:16,340 --> 00:27:18,420 Name and IP, IP, IP. 380 00:27:18,700 --> 00:27:22,500 It's like changing to the public IP address. 381 00:27:23,800 --> 00:27:28,300 If you need encryption, you just add this one line here. 382 00:27:28,420 --> 00:27:29,360 It's in the readme files. 383 00:27:30,240 --> 00:27:31,440 It's not that hard. 384 00:27:33,880 --> 00:27:37,720 Then you have the output. 385 00:27:40,340 --> 00:27:43,960 The output from the scanner program. 386 00:27:43,960 --> 00:27:46,300 Anyway, it's the published applications. 387 00:27:46,600 --> 00:27:49,800 You have to rename it to pas.v. 388 00:27:51,760 --> 00:27:58,920 This is the output from the scanner program. 389 00:27:59,720 --> 00:28:02,900 I can just, if you want me, it's not that. 390 00:28:05,720 --> 00:28:06,480 This sucks. 391 00:28:08,580 --> 00:28:09,960 Something like this, I guess. 392 00:28:12,240 --> 00:28:17,480 It says my output here, but here it starts, like the IP address and everything. 393 00:28:18,480 --> 00:28:23,180 This script will parse it, like taking data from it and step through it. 394 00:28:24,080 --> 00:28:24,560 I can show you. 395 00:28:28,280 --> 00:28:30,140 Yes, from the pas.pl. 396 00:28:30,480 --> 00:28:37,340 It just looks up the IP address on the first application, creates an ICA file, launches 397 00:28:37,340 --> 00:28:39,500 the ICA file, connects to it. 398 00:28:39,500 --> 00:28:45,180 It's for this application called the Policy Editor for Administrators. 399 00:28:45,420 --> 00:28:46,780 You need a password. 400 00:28:48,060 --> 00:28:49,820 I don't give a fuck. 401 00:28:49,920 --> 00:28:54,400 The output here, I just say, okay, login required. 402 00:28:55,020 --> 00:28:56,160 Take the next one. 403 00:28:57,660 --> 00:28:59,720 It's like fax queue program. 404 00:28:59,940 --> 00:29:01,080 You need a password. 405 00:29:01,640 --> 00:29:03,740 I say login required. 406 00:29:04,540 --> 00:29:07,540 It's like fax cover page editor. 407 00:29:07,820 --> 00:29:08,400 Oh, okay. 408 00:29:08,460 --> 00:29:08,940 This works. 409 00:29:09,860 --> 00:29:11,320 Oh, what a surprise. 410 00:29:15,780 --> 00:29:25,540 Usually, you can just press F1 to fax cover page editor and try to connect or try to explore 411 00:29:25,540 --> 00:29:26,480 something from there. 412 00:29:26,760 --> 00:29:34,460 Usually, it tries to start up the web help and the favorites there. 413 00:29:35,140 --> 00:29:37,700 The open explore is much faster. 414 00:29:37,700 --> 00:29:40,420 I can show you the task manager. 415 00:29:40,780 --> 00:29:44,640 In Citrix, you press Control-F3 to get the task manager. 416 00:29:45,420 --> 00:29:48,420 It's just like run, explore. 417 00:29:55,260 --> 00:29:57,400 This is cool stuff. 418 00:29:58,300 --> 00:30:05,960 The Citrix client asked, the Citrix server wants access to your computer, your files, 419 00:30:06,020 --> 00:30:07,680 your local files on your computer. 420 00:30:07,680 --> 00:30:09,540 This is what it does for your client. 421 00:30:10,260 --> 00:30:12,800 Of course, I want full access. 422 00:30:13,560 --> 00:30:23,280 I will show you why because now, I can just open my computer and have all my local exploits 423 00:30:23,280 --> 00:30:25,740 just drag them over to the computer. 424 00:30:33,740 --> 00:30:34,780 Very beautiful. 425 00:30:35,000 --> 00:30:35,560 Thank you. 426 00:30:35,680 --> 00:30:36,220 Thank you. 427 00:30:36,980 --> 00:30:37,660 Thank you. 428 00:30:38,840 --> 00:30:41,820 Oh, I have to like, I'll press Control-C here. 429 00:30:42,820 --> 00:30:45,140 Back to the presentation somewhere. 430 00:30:46,400 --> 00:30:46,900 Here. 431 00:30:47,280 --> 00:30:47,780 Wow. 432 00:30:48,220 --> 00:30:51,640 So, how does it look out there? 433 00:30:52,020 --> 00:30:58,560 I can't really tell you how many servers I tried, but there are a lot. 434 00:31:02,380 --> 00:31:04,840 I will give you some statistics about it. 435 00:31:07,740 --> 00:31:15,100 It's not that wow thing, but it's some nice facts. 436 00:31:15,660 --> 00:31:23,260 You have to remember, these statistics, it's not statistical right, of course. 437 00:31:23,280 --> 00:31:25,580 It's more like a guideline or something. 438 00:31:26,600 --> 00:31:35,200 Because I'm using so short timeout values on the scans, and I met some very, very large 439 00:31:35,200 --> 00:31:36,060 server farms. 440 00:31:36,060 --> 00:31:40,300 Like, I have hundreds of applications, and on several IP addresses. 441 00:31:40,740 --> 00:31:47,640 So, it's the same applications in like 10 IP addresses, and that makes like, it takes 442 00:31:47,640 --> 00:31:48,460 over the statistics. 443 00:31:48,880 --> 00:31:49,240 You know? 444 00:31:49,360 --> 00:31:58,000 It's, you have to be, yeah, it's just more like guidelines for like, what to expect to 445 00:31:58,000 --> 00:31:58,340 find. 446 00:32:03,000 --> 00:32:05,040 Forty-two percent of the servers... 447 00:32:05,040 --> 00:32:05,440 Okay. 448 00:32:06,060 --> 00:32:06,720 That had... 449 00:32:07,560 --> 00:32:08,760 That had... 450 00:32:08,760 --> 00:32:15,160 Forty-two percent of the secret servers, you didn't need a proxy. 451 00:32:15,380 --> 00:32:15,600 Okay? 452 00:32:16,420 --> 00:32:19,520 The master browser was the public IP address tested. 453 00:32:21,880 --> 00:32:29,900 And, 44 percent of these servers, that you just can connect to and enumerate all the 454 00:32:29,900 --> 00:32:32,360 public applications, had no published applications. 455 00:32:35,800 --> 00:32:40,720 Fifty-eight percent of the Citrix server, you needed proxy. 456 00:32:42,860 --> 00:32:50,100 And, but there were less percentage that hadn't any published application. 457 00:32:52,060 --> 00:32:53,320 Here's the fun stuff. 458 00:32:54,260 --> 00:33:00,000 The servers, the Citrix servers, that you didn't need a proxy for, and had published 459 00:33:00,000 --> 00:33:02,720 applications, so it removes like many. 460 00:33:04,440 --> 00:33:07,820 The average were like 12 published applications per server. 461 00:33:08,500 --> 00:33:15,820 Five percent of all the published applications were, had, was anonymous and vulnerable. 462 00:33:16,300 --> 00:33:17,420 You understand me? 463 00:33:17,560 --> 00:33:24,660 So, five percent of all the published applications on these conditions, I could just connect 464 00:33:24,660 --> 00:33:29,380 to, get the desktop and everything, and like, do what stuff I... 465 00:33:29,820 --> 00:33:30,820 Wanted to do it with. 466 00:33:31,240 --> 00:33:34,460 I have to tell you, like, I didn't do anything. 467 00:33:34,760 --> 00:33:36,660 I really just tried to connect to it. 468 00:33:39,120 --> 00:33:40,960 I did connect to it. 469 00:33:41,420 --> 00:33:42,340 It let me in. 470 00:33:42,480 --> 00:33:44,460 I checked if I can break out from the environment. 471 00:33:45,060 --> 00:33:47,260 And then, if it could, I just logged off. 472 00:33:47,920 --> 00:33:50,480 If you needed to log in, I never tried to log in. 473 00:33:50,680 --> 00:33:54,380 And I never tried to hide data or something right to the hard disk and everything. 474 00:33:56,900 --> 00:33:57,700 So, it's... 475 00:33:57,700 --> 00:33:58,420 But... 476 00:33:59,380 --> 00:34:00,560 No, whatever. 477 00:34:01,700 --> 00:34:05,080 Five percent of the published applications are anonymous and vulnerable. 478 00:34:05,260 --> 00:34:08,740 And that's about 20 percent of the servers I tested. 479 00:34:09,060 --> 00:34:13,580 20 percent of the servers was mine or more or less. 480 00:34:14,580 --> 00:34:21,120 And if you just there check, it's almost every time it's on an internal network. 481 00:34:23,240 --> 00:34:28,240 Less than one percent of the published application, you had anonymous access. 482 00:34:29,580 --> 00:34:33,640 But somehow you couldn't break out from the environment. 483 00:34:34,960 --> 00:34:35,740 It's good. 484 00:34:36,440 --> 00:34:38,160 It's like two percent of the servers. 485 00:34:38,340 --> 00:34:38,920 It's really nice. 486 00:34:39,840 --> 00:34:42,580 Ninety-two percent of the published application required login. 487 00:34:42,980 --> 00:34:48,460 And like, three percent of the published application got an expected error, like licensing problems, 488 00:34:49,200 --> 00:34:51,460 like, yeah, not enough licensing and so on. 489 00:34:55,880 --> 00:34:58,040 For the servers that... 490 00:34:58,040 --> 00:35:04,340 You need a proxy for, it's only two percent of the published applications. 491 00:35:04,440 --> 00:35:07,820 About 10 percent of the servers that are anonymous and vulnerable. 492 00:35:09,780 --> 00:35:12,340 One percent of the published applications have... 493 00:35:13,000 --> 00:35:18,780 Even less, like one percent of the servers had an anonymous application that I couldn't break out from. 494 00:35:20,840 --> 00:35:23,700 It could be like a DOS script or something. 495 00:35:23,880 --> 00:35:25,680 I tried to break with Control-C or something. 496 00:35:26,020 --> 00:35:26,760 And it... 497 00:35:26,760 --> 00:35:28,920 You just quit me out or something. 498 00:35:30,120 --> 00:35:33,760 And 96 percent of the published application required login. 499 00:35:34,060 --> 00:35:37,500 And two percent of the publication gave expected errors. 500 00:35:38,040 --> 00:35:38,380 I can... 501 00:35:38,380 --> 00:35:39,160 For... 502 00:35:39,760 --> 00:35:40,340 Who's... 503 00:35:40,340 --> 00:35:41,960 Don't need proxy. 504 00:35:42,160 --> 00:35:43,080 Need proxy. 505 00:35:47,480 --> 00:35:48,080 Yeah. 506 00:35:48,100 --> 00:35:48,500 So it's... 507 00:35:48,500 --> 00:35:50,360 It's less... 508 00:35:50,360 --> 00:35:52,840 So the servers that are... 509 00:35:52,840 --> 00:35:55,520 That are behind a firewall or something, that you... 510 00:35:55,520 --> 00:35:56,380 And don't have a... 511 00:35:56,380 --> 00:35:56,740 A proxy. 512 00:35:56,740 --> 00:35:59,300 That's why the public master browser seems to be less vulnerable. 513 00:36:00,040 --> 00:36:00,600 Yeah. 514 00:36:01,720 --> 00:36:05,100 People that don't have firewalls don't give care or something. 515 00:36:05,440 --> 00:36:06,660 So what can you do? 516 00:36:07,120 --> 00:36:07,480 Yeah. 517 00:36:07,620 --> 00:36:09,120 Of course, you need a firewall. 518 00:36:09,380 --> 00:36:09,900 You need... 519 00:36:09,900 --> 00:36:15,600 If you really want to have published applications or something, try to invest in like a VPN 520 00:36:15,600 --> 00:36:16,820 or solution or something. 521 00:36:17,040 --> 00:36:19,040 So you need to authenticate real good. 522 00:36:21,700 --> 00:36:26,200 And the breaking out stuff is also really hard. 523 00:36:26,200 --> 00:36:31,540 It's very, very, very, very, very hard because like Windows, everything is like merged 524 00:36:31,540 --> 00:36:32,320 with this other. 525 00:36:32,520 --> 00:36:34,240 Like the Explorer is like everywhere. 526 00:36:34,500 --> 00:36:39,480 Like open something, closing something, everything is Explorer or a web page or something. 527 00:36:39,740 --> 00:36:45,180 Open a document, write a URL and you can click on it and there's an Internet Explorer 528 00:36:45,180 --> 00:36:45,700 and everything. 529 00:36:46,060 --> 00:36:52,560 So I learned like strong ACLs and Regedit32 like makes it. 530 00:36:52,720 --> 00:36:55,400 And of course, Citrix white papers. 531 00:36:55,400 --> 00:37:05,000 You need white papers to connect to like checklists on white papers to how to protect 532 00:37:05,000 --> 00:37:05,260 you. 533 00:37:05,420 --> 00:37:08,860 If you don't into reading, you can like buying stuff. 534 00:37:09,820 --> 00:37:16,300 And there's two commercial stuff called AppSense and one other called SecureXE from SecureWave. 535 00:37:16,740 --> 00:37:24,060 I think the SecureXE way of doing it is really cool and they have also the website for SecureXE. 536 00:37:24,180 --> 00:37:25,200 They have a demonstration. 537 00:37:25,200 --> 00:37:29,300 They have a demonstration site running and an anonymous FTP account where you can upload 538 00:37:29,300 --> 00:37:31,320 your exploits to test their system. 539 00:37:31,700 --> 00:37:32,640 I think it's cool. 540 00:37:35,260 --> 00:37:36,880 So is this the end? 541 00:37:37,160 --> 00:37:39,000 Oh no, just scratching. 542 00:37:40,180 --> 00:37:46,960 It's so much more to do like if I sound like I want to connect to this very long published 543 00:37:46,960 --> 00:37:53,200 application name or something, what happens with the Citrix server and lots of more stuff, 544 00:37:53,300 --> 00:37:53,520 protocol. 545 00:37:53,520 --> 00:37:57,920 I don't want to call things that I really want to go into and not have the time right 546 00:37:57,920 --> 00:37:58,180 now. 547 00:37:59,720 --> 00:38:05,720 There are probably some vulnerabilities about the terminal server, but yeah, I will check 548 00:38:05,720 --> 00:38:05,880 it. 549 00:38:05,940 --> 00:38:06,500 Maybe next year. 550 00:38:08,280 --> 00:38:11,600 So I hope you have enjoyed it and my tools are available. 551 00:38:11,980 --> 00:38:20,080 If you need me, I have my business card lying here and if you have questions, you can call 552 00:38:20,080 --> 00:38:20,480 me also. 553 00:38:21,520 --> 00:38:22,800 Yeah, I live in Sweden. 554 00:38:22,920 --> 00:38:23,500 So if you have questions, you can call me also. 555 00:38:24,720 --> 00:38:27,660 It's central European time there, so don't wake me in the middle of the night. 556 00:38:29,280 --> 00:38:30,100 Thank you very much. 557 00:38:31,220 --> 00:38:37,600 Thank you very much.