1 00:00:00,660 --> 00:00:02,660 So, yeah, what are we going to do? 2 00:00:02,760 --> 00:00:03,820 Quick intro barcodes. 3 00:00:04,020 --> 00:00:07,180 I'm going to talk about encoding, decoding, scanners. 4 00:00:07,460 --> 00:00:09,780 Some simple tricks, some more simple tricks. 5 00:00:10,620 --> 00:00:15,060 Some backend stuff, and some unsolved cases and stuff. 6 00:00:18,160 --> 00:00:22,000 So this is actually all not really hard, so relax. 7 00:00:22,280 --> 00:00:25,940 You don't need your brain, or at least the left side of it. 8 00:00:26,980 --> 00:00:28,680 What about history of barcodes? 9 00:00:28,680 --> 00:00:34,140 Like, they got developed in 1948 by two people. 10 00:00:34,500 --> 00:00:41,560 And the first usage attempt, and that's actually really funny, was the American Railroad people 11 00:00:42,120 --> 00:00:45,760 that tried to barcode all the cars that they have. 12 00:00:46,120 --> 00:00:52,600 It took them 17 years to label all the cars, and then the system didn't work. 13 00:00:53,060 --> 00:00:54,240 It never did. 14 00:00:55,780 --> 00:00:58,500 At that point in time, people figured barcodes. 15 00:00:58,500 --> 00:00:58,880 Barcodes are useless. 16 00:01:00,240 --> 00:01:07,860 However, in 1966, the National Association of Food Chains started to require having 17 00:01:07,860 --> 00:01:13,200 barcodes on products to speed up the checkout process so they could make more money. 18 00:01:13,620 --> 00:01:17,940 And that usually tends to be a really good driver for technology, either making more 19 00:01:17,940 --> 00:01:18,720 money or porn. 20 00:01:19,260 --> 00:01:28,480 So in 69, the same requested an industry standard, which later became the UPC code. 21 00:01:28,500 --> 00:01:32,820 The UPC code is the code that you all have on your grocery products and stuff here in 22 00:01:32,820 --> 00:01:33,120 the States. 23 00:01:33,880 --> 00:01:42,480 And since 81, the U's Department of Defense required a code 39 barcode on all products 24 00:01:42,480 --> 00:01:43,720 that are sold to the military. 25 00:01:44,720 --> 00:01:47,220 And you will see why that is a bad idea. 26 00:01:49,480 --> 00:01:57,180 So in barcode speech, the little barcodes, the thing that we just call barcodes, are 27 00:01:57,180 --> 00:01:57,940 called symbologies. 28 00:01:58,580 --> 00:02:02,440 And we have one-dimensional symbologies and two-dimensional symbologies. 29 00:02:03,080 --> 00:02:08,880 Here you see a few samples, and the smarter ones of you will actually start to notice 30 00:02:08,880 --> 00:02:13,800 that the R in the samples, it's probably just hard to read. 31 00:02:14,400 --> 00:02:16,780 Some of the samples contain only numbers. 32 00:02:17,100 --> 00:02:19,180 Some of the samples actually contain letters. 33 00:02:19,500 --> 00:02:23,540 So we can actually have letters in barcodes. 34 00:02:24,060 --> 00:02:25,480 Here's some more symbologies. 35 00:02:26,040 --> 00:02:28,060 We will talk about a few of those. 36 00:02:28,060 --> 00:02:29,580 In more detail in the talk. 37 00:02:30,020 --> 00:02:31,280 This is just an overview. 38 00:02:31,520 --> 00:02:35,420 So there's a bunch of different symbology standards out there. 39 00:02:36,860 --> 00:02:43,140 And they differ mostly in error correction, and they differ also in what resolution you 40 00:02:43,140 --> 00:02:45,960 can print them in, and all kinds of other stuff. 41 00:02:46,340 --> 00:02:50,200 So it's really like with protocols, everyone invents his own. 42 00:02:52,140 --> 00:02:54,800 Then you have really weird barcodes. 43 00:02:55,180 --> 00:02:58,040 Like this, the upper one, you've probably seen on YouTube. 44 00:02:58,060 --> 00:03:01,020 This is actually a post-net barcode. 45 00:03:01,140 --> 00:03:03,420 This is actually a routing information for letters. 46 00:03:04,780 --> 00:03:11,920 The British, always being very separate of island folks, of course had to invent their 47 00:03:11,920 --> 00:03:15,960 own postal barcode that roughly looks the same, but it's the British one. 48 00:03:18,060 --> 00:03:20,540 And then we have two-dimensional barcodes. 49 00:03:20,740 --> 00:03:26,580 Now if you look at this graphic, and then you look at your batch, who can tell me what 50 00:03:26,580 --> 00:03:28,020 type of barcode you have? 51 00:03:28,020 --> 00:03:28,680 What do you have on your batch? 52 00:03:29,540 --> 00:03:30,340 Data metrics. 53 00:03:30,640 --> 00:03:31,400 That is right. 54 00:03:32,280 --> 00:03:36,340 And you will probably notice that this data matrix here looks a bit different. 55 00:03:36,760 --> 00:03:38,740 It actually has like a cross in the middle. 56 00:03:38,900 --> 00:03:40,520 This is because you can cluster them. 57 00:03:40,700 --> 00:03:44,160 So you can actually extend the amount of information that goes into a data matrix code. 58 00:03:44,420 --> 00:03:46,720 That is true for most two-dimensional barcodes. 59 00:03:48,120 --> 00:03:51,620 You often see at stake barcodes on UPS parcel. 60 00:03:52,820 --> 00:03:58,000 I've rarely seen maxi code, except for on stuff that Cisco sent me. 61 00:03:58,000 --> 00:03:58,680 Once in a mail. 62 00:03:59,920 --> 00:04:06,480 And PDF barcodes are widely used in Europe for ticketing systems, and we're going to 63 00:04:06,480 --> 00:04:07,920 go into those later. 64 00:04:08,600 --> 00:04:14,000 Now when you see a barcode, and you need to decode it, how many people raise your hands 65 00:04:14,000 --> 00:04:16,000 if you actually decoded the barcode on your batch? 66 00:04:19,080 --> 00:04:21,320 Yeah, you kind of like were sitting next to me. 67 00:04:22,160 --> 00:04:22,860 Okay, cool. 68 00:04:22,960 --> 00:04:24,180 So some people actually did it. 69 00:04:26,400 --> 00:04:27,980 Now, are you interested in it? 70 00:04:28,000 --> 00:04:28,760 In knowing what's on there? 71 00:04:29,840 --> 00:04:31,780 It's a URL, and I'm not telling you which. 72 00:04:34,540 --> 00:04:38,380 Yeah, it seems to be part of like a scavenger hunt kind of thing. 73 00:04:40,280 --> 00:04:43,460 So essentially if you want to decode a barcode, there are two ways. 74 00:04:44,100 --> 00:04:50,840 One is you just take a scanner, and go like beep, and see what's on your computer screen. 75 00:04:51,460 --> 00:04:53,920 And the other one is decoding software. 76 00:04:54,420 --> 00:04:55,600 This is what I use. 77 00:04:55,600 --> 00:04:58,300 Some decoding software is free. 78 00:04:58,980 --> 00:05:04,920 Other decoding software comes for the cost of like a few hundred dollars, or the modification 79 00:05:04,920 --> 00:05:05,560 of two bytes. 80 00:05:07,940 --> 00:05:14,160 And I'm like really lazy, so I went the capitalist way and actually bought one that was really 81 00:05:14,160 --> 00:05:15,380 expensive, but it's really good. 82 00:05:17,600 --> 00:05:22,500 Most scanners actually output the stuff directly into your keyboard loop. 83 00:05:22,720 --> 00:05:23,720 That's the older scanners. 84 00:05:23,780 --> 00:05:24,600 You also have USB. 85 00:05:25,600 --> 00:05:28,300 So they're actually seen as input devices by the computer. 86 00:05:29,340 --> 00:05:31,140 And that makes it really easy. 87 00:05:31,200 --> 00:05:32,440 You don't need any special software. 88 00:05:34,400 --> 00:05:37,300 So assume we want to generate barcodes. 89 00:05:37,340 --> 00:05:38,180 How do we do that? 90 00:05:40,100 --> 00:05:45,580 There is a very good for one dimensional barcode, so it's a very, very good generator, which 91 00:05:45,580 --> 00:05:50,880 is surprising because it is called GNU, and it's actually good, and like it even compiles. 92 00:05:52,020 --> 00:05:52,540 So... 93 00:05:53,240 --> 00:05:55,580 This GNU barcode is actually decent. 94 00:05:55,600 --> 00:05:58,160 And you can, like, generate a lot of barcodes with it. 95 00:05:58,800 --> 00:06:01,560 You can online generate barcodes. 96 00:06:01,680 --> 00:06:04,560 There are many PHP scripts and stuff to do that. 97 00:06:05,900 --> 00:06:07,960 They're an uncountable commercial solution. 98 00:06:08,880 --> 00:06:14,900 Many of them actually ship as TrueType fonts, which I find kind of weird, but you can do 99 00:06:14,900 --> 00:06:15,060 that. 100 00:06:16,160 --> 00:06:18,880 You can write your own generator really easily. 101 00:06:19,240 --> 00:06:23,980 The fun part is you need the specs. 102 00:06:24,260 --> 00:06:25,480 And the specs actually... 103 00:06:25,480 --> 00:06:25,580 I don't know. 104 00:06:25,600 --> 00:06:27,640 They come in a very, very fucked up form. 105 00:06:27,820 --> 00:06:33,160 I was actually buying the specs for the AdState code, and the way you get them is you get 106 00:06:33,160 --> 00:06:39,180 a skinned-in printout that was written on a typewriter way back that has, like, hand 107 00:06:39,180 --> 00:06:43,600 corrections in it, and this is what you pay 20 US dollars for. 108 00:06:44,260 --> 00:06:45,300 So go figure. 109 00:06:45,660 --> 00:06:46,840 But it's really easy. 110 00:06:46,960 --> 00:06:48,720 Generation is really easy, as with everything. 111 00:06:50,360 --> 00:06:55,440 So in general, barcodes are used for, like, three different things. 112 00:06:55,440 --> 00:06:59,580 And I have to excuse the German in this slide, but there's just no other way to say it. 113 00:07:01,160 --> 00:07:07,260 Either they're used as tags and IDs, so you're just putting a number on something and tag 114 00:07:07,260 --> 00:07:14,780 it, or the two-dimensional ones are actually used as virtual data transport or virtual 115 00:07:14,780 --> 00:07:19,200 to physical, because barcodes have this unique property that you can send them by email and 116 00:07:19,200 --> 00:07:23,320 then print them out, and you get a physical data carrier in your hand that you call email. 117 00:07:23,780 --> 00:07:25,420 And this is what people actually use. 118 00:07:25,440 --> 00:07:26,140 It's used in Europe a lot. 119 00:07:26,240 --> 00:07:27,460 I don't know how much it's used here. 120 00:07:28,660 --> 00:07:33,920 The third application they're used for is other bullshit, and we will cover some of 121 00:07:33,920 --> 00:07:34,480 that as well. 122 00:07:36,440 --> 00:07:40,700 So now we're coming to the first interesting thing about barcodes. 123 00:07:40,960 --> 00:07:48,580 The scanners, the scanners that, like, face outside to a potentially hostile barcode are 124 00:07:48,580 --> 00:07:50,360 actually configured by barcodes. 125 00:07:50,780 --> 00:07:52,020 So you have a scanner. 126 00:07:52,160 --> 00:07:54,760 The one side faces to an attacker. 127 00:07:54,940 --> 00:07:55,420 And the other side faces to an attacker. 128 00:07:55,440 --> 00:07:57,000 And the other one is connected to a computer. 129 00:07:57,320 --> 00:08:01,700 And you actually configure it from the attacker side, which is really stupid. 130 00:08:02,660 --> 00:08:04,300 So what happens is this. 131 00:08:04,420 --> 00:08:08,680 You have a special, like, enter configuration mode barcode that ships with every scanner. 132 00:08:09,140 --> 00:08:14,680 You scan this enter configuration barcode thingy, and then he goes in config mode. 133 00:08:14,820 --> 00:08:18,960 And then you can scan other barcodes that, like, change the configuration, like the 134 00:08:18,960 --> 00:08:20,980 output character set to Japanese or something. 135 00:08:21,420 --> 00:08:23,600 And then you send a... 136 00:08:23,600 --> 00:08:25,260 You scan an end of configuration. 137 00:08:25,260 --> 00:08:27,240 And it gets saved to the scanner. 138 00:08:28,220 --> 00:08:30,020 This is really not a good idea. 139 00:08:30,520 --> 00:08:34,040 I mean, you really change how this device works. 140 00:08:34,400 --> 00:08:41,000 I've actually seen a scanner that offered software update over barcode, which was scary. 141 00:08:43,700 --> 00:08:44,500 What the hell? 142 00:08:45,100 --> 00:08:46,980 So this is essentially what you do. 143 00:08:47,100 --> 00:08:54,460 You go to the vendor's page, and, like, many vendors actually post the configuration barcodes 144 00:08:54,460 --> 00:08:55,600 on their web page. 145 00:08:56,120 --> 00:09:00,420 You can just, like, call up the dealer that, like, sells those barcode scanners. 146 00:09:01,880 --> 00:09:03,520 And then you reconfigure it. 147 00:09:03,640 --> 00:09:09,060 You can change the supported barcode types, which means that the system that formerly 148 00:09:09,060 --> 00:09:15,080 thought it's only accepting, let's say, UPC barcodes, now suddenly accepts all types 149 00:09:15,080 --> 00:09:15,720 of barcodes. 150 00:09:15,800 --> 00:09:20,640 Because one thing that you need to know is all the scanners support all the barcode types. 151 00:09:20,840 --> 00:09:24,420 Like you don't buy a separate scanner for UPC or something. 152 00:09:24,460 --> 00:09:29,600 The chipsets became so easy and cheap that, like, all the scanners support all the barcodes. 153 00:09:30,060 --> 00:09:32,500 And you have to actually configure them away. 154 00:09:33,080 --> 00:09:43,360 So the system that used to only accept UPC with a simple configuration will suddenly 155 00:09:43,360 --> 00:09:45,080 accept pretty much everything you feed it. 156 00:09:45,840 --> 00:09:46,540 Not good. 157 00:09:47,020 --> 00:09:49,480 Some scanners actually support special key codes. 158 00:09:49,600 --> 00:09:54,340 This is cool when you have a cash register system that still runs on MS-DOS, for example. 159 00:09:54,340 --> 00:09:54,440 It's a good thing. 160 00:09:55,180 --> 00:09:59,180 There are many of those because they're really stable in contrast to modern operating 161 00:09:59,180 --> 00:09:59,700 systems. 162 00:10:00,860 --> 00:10:06,540 The thing is, with the special barcode that, like, has a special key code, you can actually 163 00:10:06,540 --> 00:10:08,560 go and scan an escape key. 164 00:10:08,740 --> 00:10:12,840 And since it's looped into the keyboard, it actually has the same effect as someone 165 00:10:12,840 --> 00:10:16,900 hitting escape on the keyboard, which means it's going to exit the cash register application. 166 00:10:18,540 --> 00:10:21,980 Quite nicely, you can pretty much shut down entire shopping centers. 167 00:10:24,800 --> 00:10:25,320 Yeah. 168 00:10:25,920 --> 00:10:32,880 So the easiest hack in quotes with barcodes is, in most cases, actually just copying them. 169 00:10:35,260 --> 00:10:43,000 If the barcode actually transports the information that you want already, get a good camera and 170 00:10:43,580 --> 00:10:48,980 get a printer, make a picture, print it out, have a copy of the barcode, and use that one 171 00:10:48,980 --> 00:10:49,300 as well. 172 00:10:50,340 --> 00:10:50,860 Happens. 173 00:10:50,860 --> 00:10:52,360 So there is a stand-up. 174 00:10:52,420 --> 00:10:52,680 Come on. 175 00:10:52,780 --> 00:10:53,180 Yeah. 176 00:10:54,460 --> 00:10:59,940 There is this person who actually, like, at ph-neutral, we have those badges. 177 00:11:00,080 --> 00:11:02,300 And some of those badges are the alcoholic badges. 178 00:11:02,960 --> 00:11:05,380 Like, you can actually get free beer with them. 179 00:11:06,540 --> 00:11:11,080 And this guy didn't want to pay beer but get free beer. 180 00:11:11,200 --> 00:11:19,200 So he actually took a picture of someone's get-free-beer badge and then went to the copy 181 00:11:19,200 --> 00:11:22,480 shop and got it printed out and laminated and, like, got free beer. 182 00:11:22,480 --> 00:11:25,420 Which is why we now have chip cards. 183 00:11:30,200 --> 00:11:33,760 Another thing, like, I don't know how common that is here. 184 00:11:34,000 --> 00:11:36,160 Much of this is European-centric. 185 00:11:36,540 --> 00:11:43,940 So many parking systems, like, parking garage payment systems, actually use barcodes nowadays 186 00:11:43,940 --> 00:11:45,800 in our areas. 187 00:11:46,060 --> 00:11:49,960 And for the residents, they have, like, special barcodes. 188 00:11:50,120 --> 00:11:52,460 And so I ended up in a hotel. 189 00:11:52,480 --> 00:11:58,700 And they gave me for a parking place in a city in Germany, they gave me a long-term 190 00:11:58,700 --> 00:12:02,140 pass because I was staying at the hotel and so I didn't have to pay for the parking. 191 00:12:02,400 --> 00:12:05,400 Now, this long-term pass is just a simple encoded number. 192 00:12:05,580 --> 00:12:10,620 And I don't need to actually know what this number means because I can just copy it and 193 00:12:10,620 --> 00:12:15,100 then, like, distribute around, like, free parking passes for the city center, which 194 00:12:15,100 --> 00:12:15,820 I actually did. 195 00:12:19,480 --> 00:12:22,240 So you guys don't do any of that recycling bullshit. 196 00:12:22,240 --> 00:12:24,400 Now, it's really, really bad in Europe. 197 00:12:24,740 --> 00:12:30,160 So they make you actually come back, like, bring back your empty bottles and then they 198 00:12:30,160 --> 00:12:35,320 make you stand in front of a machine and feed them individually into this machine until 199 00:12:35,320 --> 00:12:35,940 you are done. 200 00:12:36,240 --> 00:12:39,880 The whole process actually takes longer than drinking the beer. 201 00:12:40,060 --> 00:12:43,280 So this is really retarded. 202 00:12:43,480 --> 00:12:48,320 And they are using barcodes that come out of the machine. 203 00:12:48,480 --> 00:12:49,720 They get printed out of the machine. 204 00:12:49,760 --> 00:12:50,860 And you walk up to the register. 205 00:12:50,860 --> 00:12:54,360 And you get your refund for the recycling, right? 206 00:12:57,000 --> 00:12:59,140 So getting paid for drinking beer. 207 00:13:00,600 --> 00:13:06,300 The thing is, in those systems, they actually have no connection between the recycling machine 208 00:13:06,300 --> 00:13:07,280 and the cash register. 209 00:13:08,280 --> 00:13:11,520 That means all the information has to be on the barcode. 210 00:13:11,800 --> 00:13:14,220 Like, there is no other way to transport the information. 211 00:13:15,180 --> 00:13:20,440 And the vouchers that they use that come out of the machine are EAN13, which is, like, 212 00:13:20,440 --> 00:13:21,460 our version of UPC. 213 00:13:21,800 --> 00:13:22,700 It's just a bit longer. 214 00:13:24,900 --> 00:13:31,600 And this EAN13 is actually the super standard that UPC is under. 215 00:13:31,800 --> 00:13:35,540 And your UPC is actually missing a leading digit, a zero. 216 00:13:35,680 --> 00:13:37,180 That's why it's not printed. 217 00:13:37,760 --> 00:13:43,220 All other countries have a leading digit that says from which country this product comes. 218 00:13:43,660 --> 00:13:45,980 And there are special use digits, too. 219 00:13:46,260 --> 00:13:49,040 For example, it's used for store internal use. 220 00:13:50,440 --> 00:13:55,540 Now, what I did was, like, I actually went, actually, I didn't do that. 221 00:13:55,920 --> 00:13:57,280 Someone else did that for me. 222 00:13:58,100 --> 00:14:00,720 Went to this store and gave back two bottles. 223 00:14:02,180 --> 00:14:08,020 And so you see, I'm getting back, like, 55 cents, euro, which is about $2. 224 00:14:09,600 --> 00:14:15,720 And when you're checking down here, nah, those are all fixed, yeah, I cannot walk around. 225 00:14:16,280 --> 00:14:20,420 When you're checking down at the barcode, it actually ends with this. 226 00:14:20,420 --> 00:14:21,580 0555. 227 00:14:22,120 --> 00:14:28,140 Now if you happen to know that the last digit is actually a checksum, so it's not part of 228 00:14:28,140 --> 00:14:33,160 the transported data, it suspiciously looks like the amount of money that you get back. 229 00:14:33,980 --> 00:14:40,640 Now we got a second bottle checked in, and that was 25 cents, and it exhibited the same 230 00:14:40,640 --> 00:14:41,060 pattern. 231 00:14:41,560 --> 00:14:49,040 So you can actually, like, count it and see that you can get up to 999 euros in refund 232 00:14:49,040 --> 00:14:50,400 for, like, returning stuff. 233 00:14:50,420 --> 00:14:53,320 Which is actually pretty decent. 234 00:14:54,800 --> 00:15:00,880 The thing is, Berlin is full of people that don't like to work but to drink a lot of alcohol. 235 00:15:01,720 --> 00:15:08,740 And so when they introduced the systems, people immediately realized that this is cool, because 236 00:15:08,740 --> 00:15:11,820 they didn't even read the barcode, but they did what I told you earlier. 237 00:15:12,020 --> 00:15:15,980 They just copied them in masses and, like, went into stores and got money. 238 00:15:17,380 --> 00:15:19,920 And to prevent this, the stores... 239 00:15:19,920 --> 00:15:24,200 The stores actually started to use, like, special paper, so they would recognize their 240 00:15:24,200 --> 00:15:24,660 own paper. 241 00:15:24,880 --> 00:15:30,940 But the thing is, if you stick the barcode under your six-pack, which is heavy, and the 242 00:15:31,380 --> 00:15:35,720 lady at the cash register doesn't like to, like, lift it up, so they just scan it over. 243 00:15:35,940 --> 00:15:42,080 So if you stick something under this and you are not too greedy, you actually get paid 244 00:15:42,080 --> 00:15:42,800 for drinking beer. 245 00:15:45,500 --> 00:15:48,700 Another thing that people use barcodes for is access control. 246 00:15:49,380 --> 00:15:49,900 0555. 247 00:15:50,960 --> 00:15:55,860 More often than you would actually expect, the access control system only verifies that 248 00:15:55,860 --> 00:16:00,040 the structure of the data is nice, which means that it can read a barcode. 249 00:16:00,300 --> 00:16:02,100 Like it will not look at the content. 250 00:16:02,640 --> 00:16:03,480 Not at all. 251 00:16:04,300 --> 00:16:05,780 It's a really easy test. 252 00:16:05,920 --> 00:16:09,720 Like when you have an access system that uses barcodes, just take your pack of cigarettes 253 00:16:09,720 --> 00:16:14,820 or whatever you currently have on you with a UPC and just scan it and see if the door 254 00:16:14,820 --> 00:16:15,180 opens. 255 00:16:15,860 --> 00:16:17,580 Don't be too surprised if it does. 256 00:16:17,740 --> 00:16:19,660 Because that's, like, really irregular. 257 00:16:19,660 --> 00:16:20,060 Regular case. 258 00:16:22,380 --> 00:16:27,300 Other than that, you can just, like, get the right number of digits on your barcode and 259 00:16:27,300 --> 00:16:28,700 scan it, and it will open the door. 260 00:16:28,840 --> 00:16:30,200 That frequently works. 261 00:16:32,420 --> 00:16:41,960 So a tag, in quotes, because that's all really silly stuff that I used, actually, is this. 262 00:16:42,120 --> 00:16:43,500 So desynchronization. 263 00:16:43,920 --> 00:16:49,640 The thing is, people do not realize that the barcode and the numbers that are going to 264 00:16:49,660 --> 00:16:54,340 be the digits that are actually printed below the barcode do not have anything to do with 265 00:16:54,340 --> 00:16:58,200 each other except for your assumption that this number is what the barcode says. 266 00:16:59,000 --> 00:17:00,700 Like this is an assumption. 267 00:17:01,020 --> 00:17:04,340 And many people have that assumption, which can be exploited. 268 00:17:04,860 --> 00:17:08,600 So what you do is you can just change it. 269 00:17:08,680 --> 00:17:12,260 Like you can change the number or the barcode and leave the other one intact. 270 00:17:12,820 --> 00:17:15,820 And then, yeah, do stuff with it. 271 00:17:17,600 --> 00:17:19,220 Other people do that as well. 272 00:17:19,660 --> 00:17:22,140 Like this is, we had a company trip to the zoo. 273 00:17:22,920 --> 00:17:23,820 Don't even ask. 274 00:17:25,740 --> 00:17:27,380 So this is the tickets we got. 275 00:17:27,520 --> 00:17:29,600 And of course, I collected them all and scanned the barcodes. 276 00:17:29,780 --> 00:17:31,440 And this is what they do as well. 277 00:17:31,620 --> 00:17:35,920 The numbers that they show next to the barcode are the shorter ones. 278 00:17:36,160 --> 00:17:39,200 And when you decode the barcodes, you see the longer numbers there. 279 00:17:40,960 --> 00:17:44,040 And deleting digit actually says if you need to pay or not. 280 00:17:44,600 --> 00:17:46,320 Everything else is pretty much useless. 281 00:17:48,420 --> 00:17:48,860 So. 282 00:17:48,860 --> 00:17:51,460 Desynchronization can be used for property tracking. 283 00:17:52,020 --> 00:17:56,680 Now let us assume you work as a contractor at this company. 284 00:17:56,940 --> 00:18:02,540 And your fellow co-contractor working next to you has this nice laptop. 285 00:18:02,960 --> 00:18:07,320 So let's assume you have a Mac and you're like really finally understanding that they're 286 00:18:07,320 --> 00:18:08,980 crap and you want his IBM. 287 00:18:10,220 --> 00:18:11,120 This is what you do. 288 00:18:12,380 --> 00:18:18,840 In this company that I'm contracting there, they actually do property checking by, you 289 00:18:19,960 --> 00:18:25,080 go and you get a barcode and stick it on your laptop. 290 00:18:25,400 --> 00:18:27,740 And then they say this barcode belongs to this guy. 291 00:18:27,920 --> 00:18:29,060 So this is FX's laptop. 292 00:18:29,640 --> 00:18:32,800 And when you check out, they scan the barcode and they see if that's yours. 293 00:18:33,580 --> 00:18:37,520 So what you do is you replace the barcode on your badge. 294 00:18:38,080 --> 00:18:43,480 Just the barcode, not the number, temporarily with the barcode on the badge of the legitimate 295 00:18:43,480 --> 00:18:43,880 owner. 296 00:18:44,260 --> 00:18:45,840 Now, how do you know the value? 297 00:18:46,080 --> 00:18:47,260 Well, it's printed below. 298 00:18:47,500 --> 00:18:48,820 So you can just generate it. 299 00:18:48,820 --> 00:18:49,120 You don't need the barcode. 300 00:18:49,340 --> 00:18:50,560 You don't need any magic. 301 00:18:51,420 --> 00:18:57,360 Now you stuck that on, go out, check it out, like check your new IBM laptop out. 302 00:18:57,880 --> 00:19:02,760 Go back in, because right now he's not at work, but he's about to leave. 303 00:19:02,880 --> 00:19:05,580 So that is not good, right? 304 00:19:05,780 --> 00:19:11,940 So you have to go back in, fix your badge again, and then remove it, and then check 305 00:19:11,940 --> 00:19:13,500 out and go home and have two laptops. 306 00:19:14,580 --> 00:19:15,360 Easy as that. 307 00:19:16,680 --> 00:19:18,160 You can also use that. 308 00:19:18,160 --> 00:19:22,520 You can use that for changing the identity of your laptop. 309 00:19:22,740 --> 00:19:27,820 Many companies actually use the barcodes that are below your machine that actually 310 00:19:27,820 --> 00:19:28,600 contain the MAC address. 311 00:19:28,940 --> 00:19:32,780 They use that for port access security, for example. 312 00:19:32,960 --> 00:19:35,980 So you bring your laptop, then you scan the barcode, and then they know your MAC address 313 00:19:35,980 --> 00:19:36,380 and stuff. 314 00:19:36,840 --> 00:19:39,120 Of course, you can put a different MAC address in there. 315 00:19:39,980 --> 00:19:45,320 So one of the ideas I had was putting the broadcast MAC address in there, like all F. 316 00:19:45,640 --> 00:19:48,140 And so when they put it into the network access code, you can put the broadcast MAC address 317 00:19:48,160 --> 00:19:48,740 control system. 318 00:19:48,920 --> 00:19:50,180 It's going to fuck up the network. 319 00:19:54,600 --> 00:19:59,420 The thing about barcodes is it's a really simple technology, but you actually have to 320 00:19:59,420 --> 00:20:00,640 get your procedure right. 321 00:20:02,320 --> 00:20:05,020 This is what happens when you're really lucky. 322 00:20:05,540 --> 00:20:10,360 This is actually a picture of the place, the apartment building I live in, and they put 323 00:20:10,360 --> 00:20:16,860 in a store, an automated DVD rental system unattended, right there. 324 00:20:16,980 --> 00:20:18,080 It had a barcode scanner. 325 00:20:18,080 --> 00:20:22,540 It had a barcode scanner at the door, and I walked right in there and asked them for 326 00:20:22,540 --> 00:20:26,480 an account and figured out that they're actually using biometric authentication. 327 00:20:27,020 --> 00:20:30,260 They wanted my fingerprint, and I'm like, yeah, you're going to get my fingerprint 328 00:20:30,260 --> 00:20:30,800 this side. 329 00:20:32,120 --> 00:20:33,880 I only go for the PIN. 330 00:20:35,540 --> 00:20:41,100 Now this is really cool because it's unattended and it's in my house, so I can go at night 331 00:20:41,100 --> 00:20:42,360 and play with their systems. 332 00:20:44,900 --> 00:20:45,540 Here's this. 333 00:20:45,620 --> 00:20:47,960 Here's the rental procedure and the pickup procedure. 334 00:20:48,080 --> 00:20:51,880 The rental procedure is you go in, you swipe your card, you enter your PIN, you select 335 00:20:51,880 --> 00:20:53,240 the movie you want, you log out. 336 00:20:54,260 --> 00:20:56,740 You can do the same thing on their website. 337 00:20:57,680 --> 00:21:03,100 The pickup procedure to actually get to the physical data carrier, the DVD, is you swipe 338 00:21:03,100 --> 00:21:04,720 your card, you get the DVD from the machine. 339 00:21:05,540 --> 00:21:07,620 Is anyone seeing an issue here? 340 00:21:10,540 --> 00:21:12,900 The second doesn't ask for a PIN. 341 00:21:14,300 --> 00:21:17,420 The card that you get actually has a barcode on it. 342 00:21:17,620 --> 00:21:18,060 It's not a PIN. 343 00:21:18,060 --> 00:21:20,840 The barcode is actually highly complicated. 344 00:21:23,400 --> 00:21:29,700 Over there, the top, it actually has four digits and one character. 345 00:21:30,160 --> 00:21:33,640 The one character is actually pretty much static. 346 00:21:33,860 --> 00:21:42,460 It is the first letter of your last name, and then the numbers just increase, which 347 00:21:42,460 --> 00:21:46,480 means you can just guess who just rented a movie. 348 00:21:46,480 --> 00:21:53,740 Then print the barcode with this number, swipe it, and if they ordered it over the 349 00:21:53,740 --> 00:21:54,860 web, you get it. 350 00:21:55,320 --> 00:22:00,420 Their problem is they cannot prove that they don't have it, so they have to pay for it. 351 00:22:01,060 --> 00:22:03,840 You get to watch DVDs and even keep them. 352 00:22:07,840 --> 00:22:09,740 This is what I did. 353 00:22:10,180 --> 00:22:15,900 Also what's really funny, on this website where you can pre-order this stuff, they will 354 00:22:15,900 --> 00:22:18,620 actually tell you if it's rented out or not. 355 00:22:18,900 --> 00:22:23,200 It will actually look a little bit different if it's already taken out or just reserved, 356 00:22:23,420 --> 00:22:30,400 so you already know what movies are rented and are pre-ordered, so you're not picking 357 00:22:30,400 --> 00:22:32,240 up, I don't know, Disney crap. 358 00:22:35,320 --> 00:22:36,000 It's good. 359 00:22:37,060 --> 00:22:41,520 The next class that we have is injections and multi-decoding. 360 00:22:41,840 --> 00:22:45,460 Most barcode readers, as I mentioned, actually don't know how to decode. 361 00:22:45,460 --> 00:22:45,480 They don't know how to decode. 362 00:22:45,900 --> 00:22:51,080 They don't read everything, like every possible type of barcode, and they're usually left 363 00:22:51,080 --> 00:22:53,100 in their factory setting because nobody cares. 364 00:22:53,440 --> 00:22:58,000 Even if they're not, we have learned already, we have configured barcodes, we can make them 365 00:22:58,000 --> 00:22:58,500 so again. 366 00:22:59,140 --> 00:23:03,900 The back-end application, however, will in many cases only expect the barcode type it's 367 00:23:03,900 --> 00:23:04,540 written for. 368 00:23:04,940 --> 00:23:05,800 How surprise. 369 00:23:06,340 --> 00:23:08,420 Ever hear of people forgetting input validation? 370 00:23:08,900 --> 00:23:10,180 It is the same deal. 371 00:23:11,120 --> 00:23:14,920 Using a very powerful barcode, like code 128. 372 00:23:14,920 --> 00:23:18,000 You can inject arbitrary characters. 373 00:23:18,420 --> 00:23:23,600 That brings us to actually having SQL injections and format string attacks in barcodes. 374 00:23:23,920 --> 00:23:26,560 You will be surprised how good this works. 375 00:23:27,280 --> 00:23:33,680 The really interesting part of that is, the older the application, the less likely that 376 00:23:33,680 --> 00:23:39,220 you actually succeed, because people back in the days called actually code, and the 377 00:23:39,220 --> 00:23:44,840 later the application, like the latest PHP written shit, is going to fail all over you, 378 00:23:44,840 --> 00:23:46,440 if you have a SQL injection barcode. 379 00:23:48,540 --> 00:23:55,040 This is actually I had the pleasure of professionally playing with barcodes as well. 380 00:23:55,600 --> 00:24:01,380 This is actually from a medical system, which is really important because it tests your 381 00:24:01,380 --> 00:24:02,240 blood for HIV. 382 00:24:03,460 --> 00:24:06,280 You can actually, you see barcodes over there? 383 00:24:06,540 --> 00:24:08,780 I found the injection in that system. 384 00:24:09,460 --> 00:24:13,880 You could actually make test results go away. 385 00:24:14,180 --> 00:24:14,820 It is a good thing. 386 00:24:14,840 --> 00:24:17,460 This is scary. You don't want to do that. 387 00:24:19,360 --> 00:24:22,440 I mentioned that people use barcodes for utter bullshit. 388 00:24:22,920 --> 00:24:26,580 It's called QR codes. The idea is this. 389 00:24:26,880 --> 00:24:33,940 You have a newspaper, like a paper newspaper. For us hackers, we probably don't have seen 390 00:24:33,940 --> 00:24:38,720 those in years. A physical RSS. 391 00:24:42,660 --> 00:24:45,900 The idea is they print barcodes on the newspaper. 392 00:24:47,060 --> 00:24:52,140 It is a two-dimensional barcode. Then there is commercial decoder software 393 00:24:52,140 --> 00:24:56,160 for your mobile phone. Nokia actually ships with one, I think, later. 394 00:24:57,100 --> 00:25:02,240 That will scan the barcode, decode the barcode automatically, and point your browser right 395 00:25:02,240 --> 00:25:08,300 at the URL this is pointing to. This is actually a really, really bad idea. 396 00:25:08,400 --> 00:25:08,700 I'm sorry. 397 00:25:08,720 --> 00:25:13,480 Here are some more of them. The German newspapers, they actually started 398 00:25:13,480 --> 00:25:16,800 off with using them and said everyone else is using them now. 399 00:25:18,540 --> 00:25:23,820 The thing is this. We took one of those commercial software thingies 400 00:25:23,820 --> 00:25:30,540 and looked at it and realized that it's actually not even going to the newspaper's website, 401 00:25:30,820 --> 00:25:35,100 but it's just going to some Web 2.0 marketing bullshit company. 402 00:25:37,260 --> 00:25:41,540 The problem is the picture. When you brood force the numbers you can see 403 00:25:41,540 --> 00:25:45,940 who else is using the service. Which is kind of nice, but it's not really 404 00:25:45,940 --> 00:25:49,520 barcode related. The problem really is this. 405 00:25:49,620 --> 00:25:53,140 People can actually print arbitrary content in newspapers. 406 00:25:53,520 --> 00:25:57,920 We call this advertisement. This is how the newspapers actually make 407 00:25:57,920 --> 00:26:05,000 their money. Most people, especially most suit-and-tie-wearing people do actually trust their physical 408 00:26:05,100 --> 00:26:10,480 newspaper. Not only do they believe what they read in there, but they also do not think 409 00:26:10,480 --> 00:26:17,340 it could be evil content. You're pointing your browser to a not-to-you-known 410 00:26:17,340 --> 00:26:28,000 URL automatically with your newspaper. Is that potentially a bad idea? Anyone? Have 411 00:26:28,000 --> 00:26:37,160 you ever heard of a vulnerable browser before? You get to cross-site script people with your 412 00:26:37,160 --> 00:26:43,340 newspaper. You put a cross-site scripting attack in a newspaper, he's logged into Gmail, 413 00:26:43,640 --> 00:26:50,040 he's against this shit, you delete all his email. It's a no-brainer. It's like cross-site 414 00:26:50,040 --> 00:26:56,000 scripting 101. How about just renting very little advertisement space and then pointing 415 00:26:56,000 --> 00:26:57,980 it to an ice pack or MP3? 416 00:26:57,980 --> 00:27:04,300 Or whatever exploitation framework you use against browsers and owning mass-owning managers. 417 00:27:04,640 --> 00:27:09,940 We have now to tell our CEOs they should not click on images in their fucking morning newspaper. 418 00:27:10,760 --> 00:27:16,760 Thank you. There is another great property of barcodes. 419 00:27:18,540 --> 00:27:25,640 This is the density thing. The barcodes are actually designed to have a variety of density. 420 00:27:26,100 --> 00:27:27,380 The thing is, 421 00:27:27,380 --> 00:27:27,680 some 422 00:27:27,680 --> 00:27:33,440 of them are arbitrary length, so you can print as much as you want. If you have a 423 00:27:33,440 --> 00:27:39,500 really long reader, that's not a problem. But the programs, the software that is going 424 00:27:39,500 --> 00:27:45,080 to handle the barcode that you're just giving it, is actually written for this fixed amount 425 00:27:45,080 --> 00:27:50,720 of digits that it was expecting. So, even in the same space, physical space that you 426 00:27:50,720 --> 00:27:55,600 probably need, like when you print it on a card or on a slip here in Vegas, you can actually 427 00:27:55,600 --> 00:27:57,000 print a lot more digits. 428 00:27:57,920 --> 00:27:59,880 Ever hear of buffer overflows before? 429 00:28:00,700 --> 00:28:03,540 Like, have you noticed that putting more stuff 430 00:28:03,540 --> 00:28:05,300 into something that it was expecting 431 00:28:05,720 --> 00:28:07,740 is actually something that hackers really like? 432 00:28:08,440 --> 00:28:10,320 So, yes, it does happen. 433 00:28:10,460 --> 00:28:12,860 Like, we did find buffer overflows with barcodes 434 00:28:13,400 --> 00:28:15,580 simply by just, like, printing more. 435 00:28:16,920 --> 00:28:20,460 It is a lot less common than the injection attacks. 436 00:28:21,740 --> 00:28:24,040 But your tool of choice here is the code 128 437 00:28:24,040 --> 00:28:27,780 because it's full 7-bit ASCII character set, 438 00:28:27,980 --> 00:28:29,560 and you can chain them together. 439 00:28:29,760 --> 00:28:31,360 Like, you print multiple of them, 440 00:28:31,460 --> 00:28:33,780 and they end with a control code, FC4, 441 00:28:34,420 --> 00:28:37,740 and that says, watch, there's more coming. 442 00:28:37,920 --> 00:28:40,540 And the barcode reader is actually caching that. 443 00:28:40,800 --> 00:28:42,780 So the barcode reader is actually, like, 444 00:28:42,780 --> 00:28:44,360 buffering all the barcodes you're scanning, 445 00:28:44,520 --> 00:28:46,400 and then you send the final one and say, go! 446 00:28:46,700 --> 00:28:50,900 And then you finally scan, like, a 1K big barcode, 447 00:28:51,500 --> 00:28:52,780 which is kind of cool. 448 00:28:52,920 --> 00:28:54,020 I mean, really cool. 449 00:28:54,020 --> 00:28:54,440 It breaks shit. 450 00:28:55,580 --> 00:28:57,960 Warning, it is, I have to warn you, 451 00:28:58,020 --> 00:29:01,160 it is a pain to develop shell code on barcodes. 452 00:29:04,220 --> 00:29:05,900 I can tell you from experience. 453 00:29:06,900 --> 00:29:09,200 Yeah, and coming back to this QR thing, 454 00:29:09,400 --> 00:29:10,960 like taking pictures in your newspaper 455 00:29:10,960 --> 00:29:13,640 and then routing your browser to it, 456 00:29:13,800 --> 00:29:15,640 yeah, you put it into a disassembler, 457 00:29:16,180 --> 00:29:19,140 right away you find a place where they have a percent S 458 00:29:19,140 --> 00:29:22,320 that they later on pass to a Wsprintf. 459 00:29:24,020 --> 00:29:26,880 You'll find, like, some phone number that is undocumented 460 00:29:27,480 --> 00:29:31,200 and, like, funny statements, and you'll find their username 461 00:29:31,200 --> 00:29:34,980 and their password for, like, some HP OpenView looking glass 462 00:29:35,480 --> 00:29:36,360 in their software. 463 00:29:36,640 --> 00:29:38,560 I don't actually know what that is, but, like, 464 00:29:38,620 --> 00:29:40,320 it was too cool to pass on. 465 00:29:40,400 --> 00:29:42,200 It has nothing to do with barcodes, but, like, 466 00:29:42,220 --> 00:29:45,220 if you want to own some fucked up Web 2.0 company, 467 00:29:45,420 --> 00:29:45,960 there it is. 468 00:29:49,680 --> 00:29:52,160 We actually tested a lot of stuff that didn't break. 469 00:29:52,400 --> 00:29:53,780 So this is something we have 470 00:29:53,780 --> 00:29:54,500 in Germany. 471 00:29:55,000 --> 00:29:56,220 It's called the PAX station. 472 00:29:58,300 --> 00:30:00,120 You get a barcode in your mail. 473 00:30:00,480 --> 00:30:03,180 It's an EN13, and then you walk up to the station, 474 00:30:03,360 --> 00:30:06,240 and then you scan it, and it spits out the delivery 475 00:30:06,240 --> 00:30:09,780 that you got, because the UPS guy, again, 476 00:30:09,820 --> 00:30:11,120 didn't find the door or something. 477 00:30:12,120 --> 00:30:12,920 So wait a second. 478 00:30:21,720 --> 00:30:23,160 So what I'm spending 479 00:30:23,160 --> 00:30:27,260 my weekends with sometimes is going to public barcode scanners 480 00:30:28,030 --> 00:30:29,360 and then fuzzing them. 481 00:30:29,900 --> 00:30:30,980 And this is how that looks like. 482 00:30:31,340 --> 00:30:32,680 So you have a few numbers. 483 00:30:32,960 --> 00:30:34,300 You have a few more numbers. 484 00:30:35,320 --> 00:30:36,360 More numbers. 485 00:30:37,080 --> 00:30:42,220 Then you end up at some point with very dense barcodes. 486 00:30:43,660 --> 00:30:47,420 And SQL injection should be in here as well. 487 00:30:47,820 --> 00:30:49,700 Yeah, you have special character sets. 488 00:30:50,100 --> 00:30:52,800 And you just go there and scan them and see what happens. 489 00:30:54,460 --> 00:30:57,360 This thing actually didn't crash, quite disappointing. 490 00:30:58,060 --> 00:31:05,440 I also tried IKEA because they use Interleave 205, which is a bit more powerful. 491 00:31:05,580 --> 00:31:12,420 You get more digits in, and all their scanners accept almost all one-dimensional barcodes, 492 00:31:12,520 --> 00:31:14,560 but their application is actually well written. 493 00:31:14,680 --> 00:31:19,460 It's one of these MS-DOS written programs, and it actually didn't crash. 494 00:31:22,280 --> 00:31:28,700 Then we have what I call recreation attacks, which means, can I predict what the barcode 495 00:31:29,020 --> 00:31:32,300 is going to contain for a specific scenario that I want? 496 00:31:32,500 --> 00:31:34,740 If so, I can just print it out. 497 00:31:34,860 --> 00:31:35,820 It's that simple. 498 00:31:37,200 --> 00:31:40,320 The most obvious target is postal codes. 499 00:31:41,140 --> 00:31:45,720 Postal codes are used instead of stamps, so they're actually worth money. 500 00:31:47,840 --> 00:31:49,200 They use... 501 00:31:49,200 --> 00:31:51,800 Postal codes use two-dimensional barcodes now because they can automate the process. 502 00:31:52,000 --> 00:31:56,800 They don't have to have an intern leaking stamps and placing them on letters, but they 503 00:31:56,800 --> 00:31:59,360 print the barcodes on the letters, and it goes a lot faster. 504 00:32:00,920 --> 00:32:06,340 Some of the postal systems, as we've seen in the intro, actually use different systems, 505 00:32:06,480 --> 00:32:07,920 but most actually use data matrix. 506 00:32:09,700 --> 00:32:16,880 I got just simple letters from companies that write me invoices and stuff, and decoded them 507 00:32:16,880 --> 00:32:18,640 and checked out what's in there. 508 00:32:18,640 --> 00:32:20,020 What can you actually verify? 509 00:32:20,780 --> 00:32:22,460 This is one thing that I got. 510 00:32:22,980 --> 00:32:29,720 It has the Australian post barcode over there, and I decoded it, and it is literally this 511 00:32:29,720 --> 00:32:30,460 line of zeros. 512 00:32:31,760 --> 00:32:32,480 That's it. 513 00:32:33,280 --> 00:32:38,700 How do you actually verify that someone paid for this letter with a bunch of zeros? 514 00:32:39,920 --> 00:32:41,080 How do you do that? 515 00:32:41,260 --> 00:32:42,600 Probably not at all. 516 00:32:43,180 --> 00:32:48,620 If you want to send mail in Austria, get a bunch of zeros and put them in there. 517 00:32:48,640 --> 00:32:49,060 If you want to send mail to Austria, you probably need to put some tens of them in a barcode. 518 00:32:50,100 --> 00:32:56,440 They also had real barcodes, but those were postal system barcodes and interleaved, and 519 00:32:56,440 --> 00:32:58,940 they just had nothing to do with the payment. 520 00:33:01,460 --> 00:33:03,760 Then we have the U.S. postal system. 521 00:33:03,880 --> 00:33:05,160 This is probably going to get me in trouble. 522 00:33:07,180 --> 00:33:10,780 They have this labeling system that's called Intelligent Mail. 523 00:33:13,600 --> 00:33:18,620 I assume it got this name because compared to the other ones that I've seen, it's basically 524 00:33:18,620 --> 00:33:21,000 author, the system was actually written there. 525 00:33:21,420 --> 00:33:22,320 Not getting there. 526 00:33:23,380 --> 00:33:25,680 It uses code 128 labels. 527 00:33:26,480 --> 00:33:32,560 I actually found the specs on the internet, literally like the doc file specs on the internet 528 00:33:33,100 --> 00:33:34,240 on how this works. 529 00:33:34,520 --> 00:33:39,040 Here you see how big this thing has to be and stuff. 530 00:33:40,240 --> 00:33:41,140 What's in the barcode? 531 00:33:41,480 --> 00:33:42,900 They have the spec in the barcode. 532 00:33:43,100 --> 00:33:44,820 It says, here's the zip code. 533 00:33:45,000 --> 00:33:45,860 That kind of makes sense here. 534 00:33:45,980 --> 00:33:46,620 Where should this go? 535 00:33:46,620 --> 00:33:52,040 Oh, and mind you, this only works for crates and big stuff, not for small letters. 536 00:33:53,820 --> 00:33:56,380 You have the zip code where it goes. 537 00:33:56,760 --> 00:33:58,240 You have a CIN. 538 00:33:58,240 --> 00:34:05,660 You have a label source, so it says where that came from or what type. 539 00:34:05,960 --> 00:34:10,620 You have a mailer ID, which is unique, and I'm coming to that in a minute, and a unique 540 00:34:10,620 --> 00:34:12,000 identifier for the shipment. 541 00:34:12,300 --> 00:34:15,620 You have a label type, and that is about it. 542 00:34:15,620 --> 00:34:17,740 I don't see any authentication. 543 00:34:19,340 --> 00:34:26,440 I don't see any way you can prove that this is your mail or this wasn't your mail. 544 00:34:27,840 --> 00:34:32,440 This unique identifier could be a problem because we're not able to predict it, but 545 00:34:32,440 --> 00:34:37,580 then in the same specs it says, to maintain the uniqueness of the barcode, the data for 546 00:34:37,580 --> 00:34:40,720 these label types must be unique for 30 to 45 days. 547 00:34:41,200 --> 00:34:44,860 Mailers are asked to check with their postal service marketing representative. 548 00:34:44,860 --> 00:34:47,280 To confirm the requirement for uniqueness. 549 00:34:50,040 --> 00:34:51,440 It's absolutely random. 550 00:34:51,920 --> 00:34:53,400 It doesn't really care. 551 00:34:54,740 --> 00:35:01,060 Now on the other hand, I'm trying to get ... On the other hand, I compared that to another 552 00:35:01,060 --> 00:35:04,760 spec that at first sight has nothing to do with it. 553 00:35:04,980 --> 00:35:10,520 This is the Pentagon Building Security Emergency Procedures Guide that also has a guide on 554 00:35:10,520 --> 00:35:13,320 how to handle mail and recognize letter bombs. 555 00:35:14,860 --> 00:35:16,200 It has all those things. 556 00:35:16,300 --> 00:35:19,640 It has foreign mail or excessive postage. 557 00:35:19,980 --> 00:35:23,180 It actually has pre-tuning wires and tin foil. 558 00:35:24,980 --> 00:35:27,700 Whoever wrote that probably never built a bomb. 559 00:35:28,200 --> 00:35:35,840 It does not contain ... You get a large shipment of a crate that has a sender ID of the Pentagon, 560 00:35:36,260 --> 00:35:38,640 and in that is actually the bomb. 561 00:35:40,340 --> 00:35:44,660 You can send pretty much everything anywhere for free. 562 00:35:44,860 --> 00:35:49,740 And it will be trusted because the center ID says, like, this is the Department of Defense. 563 00:35:53,440 --> 00:35:57,560 Do you guys use barcodes for boarding tickets, airline boarding tickets here in the States? 564 00:35:57,840 --> 00:35:58,180 Yeah? 565 00:35:58,380 --> 00:35:58,840 Okay. 566 00:35:58,940 --> 00:35:59,720 You're going to love this. 567 00:36:00,040 --> 00:36:02,660 So this is the latest trend. 568 00:36:03,480 --> 00:36:14,640 So the security on our biggest hub, Frankfurt Main Airport, of course our capital doesn't have a large airport, relies on the boarding ticket. 569 00:36:14,860 --> 00:36:20,060 They don't actually have anything anymore except for the scanner that goes red or green. 570 00:36:20,300 --> 00:36:21,820 And if it goes green, you can go in. 571 00:36:22,000 --> 00:36:23,340 And if it's red, then no. 572 00:36:25,080 --> 00:36:27,000 The security checkpoint is central. 573 00:36:27,160 --> 00:36:29,620 Therefore, it's not airline specific, right? 574 00:36:30,220 --> 00:36:42,000 Now, on the other hand, the security, like, this implies that the security checkpoint may not know everyone who's already checked in because that would mean everything else is rewired with each other. 575 00:36:42,160 --> 00:36:44,000 And I don't think that is the case. 576 00:36:44,080 --> 00:36:44,700 So the validity. 577 00:36:44,860 --> 00:36:46,320 The validity must be in a barcode. 578 00:36:47,820 --> 00:36:48,760 I fly a lot. 579 00:36:49,520 --> 00:36:53,240 So this is, like, barcodes from trips all over the place. 580 00:36:57,400 --> 00:36:58,140 Here's some more. 581 00:36:59,320 --> 00:37:01,780 So I got all those, and then I decoded them. 582 00:37:02,240 --> 00:37:07,420 And this is a tool I wrote myself for this barcode research so I can, like, color hex dumps and stuff. 583 00:37:08,820 --> 00:37:11,160 So this is what I found in the barcode. 584 00:37:11,300 --> 00:37:12,200 It has a passenger number. 585 00:37:12,220 --> 00:37:14,100 It has a last name, first name, booking code. 586 00:37:14,860 --> 00:37:22,300 From where you're flying to where you're flying, which flight number, the day of the year, in which class you're flying. 587 00:37:22,900 --> 00:37:23,460 Interesting. 588 00:37:23,580 --> 00:37:24,060 Important. 589 00:37:24,560 --> 00:37:28,900 What seat you have, what your ticket number is, and a security check number. 590 00:37:30,980 --> 00:37:36,080 However, like, the last row, the last column here is the security check number. 591 00:37:36,460 --> 00:37:37,920 Do we notice a pattern? 592 00:37:38,300 --> 00:37:38,980 Yes, we do. 593 00:37:40,200 --> 00:37:41,520 Everything else changes. 594 00:37:41,680 --> 00:37:43,560 Security check number stays the same. 595 00:37:43,640 --> 00:37:44,060 Bad. 596 00:37:44,060 --> 00:37:45,840 Turns out that thing is static. 597 00:37:47,120 --> 00:37:56,760 Now, what's really scary is the two red ones that I have in there are actually online check-in boarding passes. 598 00:37:57,020 --> 00:38:00,740 So you check in on the website instead of at the counter. 599 00:38:01,520 --> 00:38:04,140 And they don't have anything in the second column. 600 00:38:04,420 --> 00:38:08,880 The second column is what is called the passenger record number. 601 00:38:09,280 --> 00:38:13,920 And everything, like, literally everything in airline security routing. 602 00:38:14,060 --> 00:38:14,520 And whatnot. 603 00:38:15,200 --> 00:38:19,620 Depends on a PNR being there and correct and unique. 604 00:38:19,920 --> 00:38:21,380 Like, all the airline software. 605 00:38:21,800 --> 00:38:23,020 Everything works with PNR. 606 00:38:23,340 --> 00:38:24,900 Now, they don't have a PNR. 607 00:38:25,620 --> 00:38:29,540 Which means we don't have any piece of information we cannot predict. 608 00:38:30,900 --> 00:38:33,540 So we can say from where to where we want to fly. 609 00:38:33,740 --> 00:38:35,000 What our name is. 610 00:38:35,280 --> 00:38:36,700 What flight we want to be on. 611 00:38:36,820 --> 00:38:37,920 What class we want to be on. 612 00:38:38,040 --> 00:38:41,320 And we are going to be, like, checked in. 613 00:38:41,440 --> 00:38:43,280 And they will, like, bring us to the gate. 614 00:38:46,320 --> 00:38:53,780 On the other hand, luggage tagging actually works by logically attaching a one-dimensional barcode to your trip and to you. 615 00:38:53,980 --> 00:38:58,200 So baggage is actually routed in the airport delivery system depending on this barcode. 616 00:38:59,000 --> 00:39:07,080 And with online boarding, you can actually connect any piece of luggage that you have to your boarding pass. 617 00:39:07,860 --> 00:39:10,380 Simply by dropping it off at the counter. 618 00:39:10,540 --> 00:39:11,900 Like, when you online check-in, right? 619 00:39:12,020 --> 00:39:12,840 You check-in online. 620 00:39:13,020 --> 00:39:13,660 Then you got a bag. 621 00:39:13,820 --> 00:39:13,980 Yeah. 622 00:39:14,060 --> 00:39:15,400 Like, a big trolley. 623 00:39:15,440 --> 00:39:17,140 You go, like, drop it at the counter. 624 00:39:17,280 --> 00:39:19,580 Show them your online check-in boarding pass. 625 00:39:19,780 --> 00:39:22,260 And they're connected logically to your trip. 626 00:39:22,840 --> 00:39:25,120 Which may not necessarily be yours. 627 00:39:25,320 --> 00:39:26,300 So here's the scenario. 628 00:39:27,580 --> 00:39:34,420 We have this person that is considered a potential terrorist because just he wears blankets. 629 00:39:36,320 --> 00:39:39,600 And then we have his boarding pass. 630 00:39:41,360 --> 00:39:43,200 We have this other person. 631 00:39:43,200 --> 00:39:47,240 Who strangely looks like a government official in our country. 632 00:39:49,760 --> 00:39:57,220 Who actually has an agent and wants to make this innocent blanket-wearing person look like a real terrorist. 633 00:39:58,160 --> 00:40:04,080 So he actually creates, recreates a boarding pass on the name of the other fellow. 634 00:40:05,120 --> 00:40:08,780 And drops some luggage in with some extras. 635 00:40:10,960 --> 00:40:12,160 Gets x-rayed. 636 00:40:13,240 --> 00:40:14,100 Evil security 637 00:40:15,560 --> 00:40:16,320 Finds a terrorist 638 00:40:16,800 --> 00:40:17,900 This is how it works 639 00:40:17,900 --> 00:40:19,320 You can totally do that 640 00:40:22,220 --> 00:40:23,140 So, recommendation 641 00:40:23,140 --> 00:40:26,020 I mean, they made water illegal in flights 642 00:40:26,020 --> 00:40:28,240 They can actually make luggage illegal as well 643 00:40:28,240 --> 00:40:30,160 For security and anti-terror reasons 644 00:40:31,340 --> 00:40:33,760 Because the same concept as with the water 645 00:40:33,760 --> 00:40:34,920 Is going to apply here 646 00:40:34,920 --> 00:40:38,080 You buy a bottle of water before you go to the airport 647 00:40:38,080 --> 00:40:38,900 It's like $1 648 00:40:38,900 --> 00:40:41,000 You buy it at the airport, it's like $5 649 00:40:41,000 --> 00:40:42,900 They can do that with luggage too 650 00:40:42,900 --> 00:40:46,620 I don't see why we should be allowed to have luggage 651 00:40:46,620 --> 00:40:48,180 For security reasons 652 00:40:50,240 --> 00:40:51,920 There are some unsolved cases 653 00:40:51,920 --> 00:40:54,420 One thing that I find really interesting 654 00:40:54,420 --> 00:40:57,040 Is this US visit immigration thing 655 00:40:57,040 --> 00:40:58,160 That they used to have 656 00:40:58,160 --> 00:41:01,020 It kind of like no longer is in use 657 00:41:01,020 --> 00:41:04,380 So, for a period of time 658 00:41:04,380 --> 00:41:07,040 You actually got this huge barcode over there 659 00:41:07,040 --> 00:41:08,040 That looks like an enter 660 00:41:08,980 --> 00:41:10,780 When you checked out 661 00:41:10,780 --> 00:41:10,980 Of the barcode 662 00:41:11,000 --> 00:41:11,740 Of the United States 663 00:41:11,740 --> 00:41:13,840 Like literally when you left the country 664 00:41:13,840 --> 00:41:16,160 And I decoded those 665 00:41:16,160 --> 00:41:18,000 And they're like entirely crypto 666 00:41:20,320 --> 00:41:23,080 And so, I decoded those 667 00:41:23,080 --> 00:41:24,660 And they're entirely crypto 668 00:41:24,660 --> 00:41:28,100 And I decoded like a few train tickets in Germany 669 00:41:28,100 --> 00:41:29,640 And they're actually done right 670 00:41:29,640 --> 00:41:31,820 They actually have a crypto certificate 671 00:41:31,820 --> 00:41:33,320 In the 2D barcode 672 00:41:33,320 --> 00:41:35,000 This is how you do it 673 00:41:35,000 --> 00:41:37,940 Like, consider your barcode 674 00:41:37,940 --> 00:41:39,080 Like a browser cookie 675 00:41:39,080 --> 00:41:40,760 Whoever you give it to 676 00:41:40,760 --> 00:41:42,560 Is going to fuck with it 677 00:41:42,560 --> 00:41:44,640 If you give it to me 678 00:41:44,640 --> 00:41:45,560 I'm going to fuck with it 679 00:41:46,240 --> 00:41:47,400 Let's put it this way 680 00:41:47,400 --> 00:41:50,660 And so, everything that people will do to their cookies 681 00:41:50,660 --> 00:41:53,280 They will potentially also do to their barcodes 682 00:41:53,800 --> 00:41:57,040 If you can only use one-dimensional barcodes 683 00:41:57,040 --> 00:41:59,620 Make really sure it is like a one-time pad 684 00:41:59,620 --> 00:42:01,380 Like you draw a random number 685 00:42:01,380 --> 00:42:04,300 Out of a non-Debian random number generator 686 00:42:04,780 --> 00:42:07,940 And then you post it on whatever you want to tag 687 00:42:07,940 --> 00:42:09,200 And then you have a central database 688 00:42:09,200 --> 00:42:10,740 Where you put the barcode in 689 00:42:10,740 --> 00:42:11,360 And then you put the stuff together 690 00:42:11,360 --> 00:42:12,600 And you don't tell anyone 691 00:42:12,600 --> 00:42:15,700 Do not try to put information into one-dimensional barcodes 692 00:42:16,500 --> 00:42:17,780 If you have a two-dimensional 693 00:42:17,780 --> 00:42:18,700 Use real crypto 694 00:42:18,700 --> 00:42:20,560 Like, the German systems 695 00:42:20,560 --> 00:42:21,820 Like the railway system and everything 696 00:42:21,820 --> 00:42:23,180 They have done it right 697 00:42:23,180 --> 00:42:25,760 They have actual crypto on the barcode 698 00:42:25,760 --> 00:42:28,880 And it may actually provide for non-repudiation 699 00:42:28,880 --> 00:42:29,900 In both ways anyway 700 00:42:30,520 --> 00:42:32,120 And make sure your process works 701 00:42:32,120 --> 00:42:34,340 Like, do not what my video store did 702 00:42:34,340 --> 00:42:36,760 Make really sure that, like 703 00:42:36,760 --> 00:42:39,540 The people cannot do something with the barcode 704 00:42:39,540 --> 00:42:40,720 And just because you don't want to do it 705 00:42:40,740 --> 00:42:41,900 You're implicitly trusted 706 00:42:42,240 --> 00:42:44,300 Do not trust a printed number 707 00:42:45,940 --> 00:42:48,340 I hope that was somewhat entertaining 708 00:42:49,040 --> 00:42:51,980 If you have barcodes that you want to play with 709 00:42:52,620 --> 00:42:54,620 Generate barcodes or scan barcodes 710 00:42:54,620 --> 00:42:55,980 And decode them 711 00:42:55,980 --> 00:42:58,600 We have on this funny URL 712 00:42:58,600 --> 00:43:00,100 We have set up a wiki 713 00:43:00,780 --> 00:43:05,520 That contains all the decoding software that we know 714 00:43:05,860 --> 00:43:07,960 And all the free decoding software 715 00:43:07,960 --> 00:43:09,020 And everything else 716 00:43:09,020 --> 00:43:10,660 And has some war stories 717 00:43:10,740 --> 00:43:11,280 Of people 718 00:43:11,280 --> 00:43:13,400 Like, what went wrong with barcodes 719 00:43:13,400 --> 00:43:16,420 And actually people contributing content there 720 00:43:16,420 --> 00:43:18,060 So, it's actually pretty cool 721 00:43:18,920 --> 00:43:20,080 Yeah, thank you 722 00:43:23,880 --> 00:43:24,960 Right on time 723 00:43:24,960 --> 00:43:25,640 Any questions? 724 00:43:27,900 --> 00:43:29,060 Any barcodes? 725 00:43:34,780 --> 00:43:37,180 No, actually the slides are not on a disk 726 00:43:37,180 --> 00:43:38,800 Because I was, like 727 00:43:38,800 --> 00:43:40,580 Getting myself into this talk 728 00:43:40,580 --> 00:43:42,880 Tuesday, something 729 00:43:42,880 --> 00:43:44,840 But I will post them up 730 00:43:44,840 --> 00:43:46,880 They should be up the Phenolite website 731 00:43:53,740 --> 00:43:56,500 Oh, this is really funny 732 00:43:56,500 --> 00:43:57,240 You're going to love this 733 00:43:57,240 --> 00:43:59,680 If you have seen the Port Bunny talk 734 00:43:59,680 --> 00:44:01,520 That I gave together with Fabs 735 00:44:01,520 --> 00:44:03,240 This system is actually 736 00:44:03,240 --> 00:44:04,540 Like the backend 737 00:44:04,540 --> 00:44:05,820 Is the other side 738 00:44:05,820 --> 00:44:06,740 Like the victim system 739 00:44:06,740 --> 00:44:07,640 That he tested 740 00:44:07,640 --> 00:44:09,840 His firewall detection 741 00:44:10,580 --> 00:44:12,540 Packet storm shit against 742 00:44:12,540 --> 00:44:15,320 So, the system is actually broken right now 743 00:44:15,320 --> 00:44:16,720 Because Fabs killed it 744 00:44:16,720 --> 00:44:18,680 And it's going to be back up in a few days 745 00:44:20,540 --> 00:44:21,860 Okay, thank you very much 746 00:44:21,860 --> 00:44:22,920 See you at the next party