1 00:00:00,000 --> 00:00:03,180 Hey guys, uh, so we're gonna talk about SSH. 2 00:00:03,180 --> 00:00:10,200 And this has been probably the most exciting year in SSH since x2.cd got leaked, x2.cd got leaked by Teso. 3 00:00:10,260 --> 00:00:12,720 So, um, uh, props to anyone who used that. 4 00:00:12,720 --> 00:00:24,140 Uh, so, uh, SSH for folks who aren't aware, um, you probably, probably should be here if you don't know what SSH is, but, um, SSH, secure shell, port 22, the thing we've been using to admin the internet for many years, like almost 30 years. 5 00:00:24,220 --> 00:00:28,140 Um, there's really two flavors of SSH that we use the most. 6 00:00:28,140 --> 00:00:31,720 There's open SSH, which is like 80 something percent of all SSH installations. 7 00:00:31,720 --> 00:00:34,880 And then there's DropBear, which is like another like five to eight percent. 8 00:00:34,880 --> 00:00:37,500 And then this long tail of random weird stuff out there. 9 00:00:37,680 --> 00:00:41,620 So we decided to do some research into first looking into the XC backdoor. 10 00:00:41,620 --> 00:00:49,120 And then part of that, we just accidentally found a couple tens of thousands of shells and we're like, well, let's go figure out what all these random things, all these free shells were. 11 00:00:49,120 --> 00:00:52,160 Uh, and that led to this giant pile of work and this open source tool. 12 00:00:52,500 --> 00:00:54,740 Um, so if you want to play with the toolkit, you can get it right now. 13 00:00:54,740 --> 00:00:58,080 It's this, the shamble.com S S H A M B L E. 14 00:00:58,080 --> 00:01:00,500 And that goes to GitHub and you can go grab the stuff and play with it. 15 00:01:00,500 --> 00:01:02,540 And it's a big hot mess, but we're making it better. 16 00:01:02,660 --> 00:01:06,040 And it should be a lot of fun as we start cranking on, make polishing up, making it cool. 17 00:01:06,580 --> 00:01:09,040 Um, so with that, we'll go ahead and get started. 18 00:01:09,580 --> 00:01:13,400 Um, fortunately, we're only doing 67 slides in 45 minutes, not 100. 19 00:01:13,400 --> 00:01:15,260 So we had a little breathing room this time. 20 00:01:15,820 --> 00:01:19,760 Um, so I'm sure we're all very much aware of the XCUTLs backdoor. 21 00:01:19,760 --> 00:01:20,800 Well, step back a little bit. 22 00:01:20,800 --> 00:01:24,100 So there's, you know, four major events this year in SSH that were really important. 23 00:01:24,100 --> 00:01:31,580 Obviously, XCUTLs backdoor targeted SSH using the system vpatches and Debian and, uh, Red Hat builds of OpenSH. 24 00:01:31,680 --> 00:01:36,740 We also had the really cool Terrapin vulnerability, which affected pretty much everything because of the truncation attack. 25 00:01:36,760 --> 00:01:42,180 Um, we also had, uh, the regression vulnerabilities, the really fantastic work by the Qualys Threat Research Unit. 26 00:01:42,180 --> 00:01:46,780 Um, and then the other regression bug found by SolarDesigner that only affected Red Hat. 27 00:01:46,780 --> 00:01:47,880 And regression was amazing. 28 00:01:47,880 --> 00:01:52,180 It's a signal re-entrance bug that gets you remote route in OpenSH by default. 29 00:01:52,180 --> 00:01:56,780 It just takes six hours on a 32-bit machine or weeks or months on a 64-bit to compromise. 30 00:01:57,020 --> 00:01:58,340 So, but it's been a really cool year. 31 00:01:58,560 --> 00:02:01,640 Um, one of my favorite SSH bugs this year kind of flew under the radar. 32 00:02:01,760 --> 00:02:07,720 Um, the guys at Watchtower Labs did a really cool analysis of the move-it vulnerability that uses the SFTP server. 33 00:02:07,740 --> 00:02:12,780 And so they found a vulnerability where any public key being sent to the service, um, would be treated like a file path. 34 00:02:12,780 --> 00:02:14,640 Like the binary blog gets treated like a file path. 35 00:02:14,640 --> 00:02:17,380 And it just opened random UNC URLs and all kinds of fun stuff. 36 00:02:17,380 --> 00:02:20,540 They threaded like a million little needles to be able to get a shell remotely and boot it. 37 00:02:20,540 --> 00:02:25,600 But the really cool thing about that bug is it affected every other vendor also using IPWorks as the underlying library. 38 00:02:25,600 --> 00:02:29,500 So, they actually uncovered like a supply chain bug, if you will, which is really neat. 39 00:02:29,880 --> 00:02:36,020 So, going kind of back on topic again, um, the XEUtils vulnerability or backdoor was amazing. 40 00:02:36,020 --> 00:02:38,980 It was like its own little Netflix docu-series, right? 41 00:02:38,980 --> 00:02:42,180 We're going to see like the true crime of XEUtils for years. 42 00:02:42,180 --> 00:02:43,560 But like who is Gia Chan? 43 00:02:43,560 --> 00:02:46,920 Like it's going to, it's the most dramatic thing to happen to InfoSec in a very long time. 44 00:02:47,180 --> 00:02:55,100 Um, so the, this is a multi-year campaign where this person, um, contributed to open source for a long time, then eventually kind of twisted the knife and tried to backdoor the world. 45 00:02:55,160 --> 00:03:05,060 And I got caught at the very last minute by, uh, Anders Frond, who says, hey, my SSH is taking slightly too much longer than it should, and then unraveled the whole thing right before it got put into the stable distributions. 46 00:03:05,300 --> 00:03:07,580 So, we got really close to the whole internet being backdoored. 47 00:03:07,740 --> 00:03:13,920 Uh, but what was really important about that backdoor that it was a nobody but us backdoor, which is normally, you know, normally the US government is famous for those. 48 00:03:13,920 --> 00:03:15,920 But in this case, who knows who it was. 49 00:03:16,080 --> 00:03:21,800 Um, in fact, it was a encryption key controlled by the attacker that only people with a private key had access could abuse the backdoor. 50 00:03:21,800 --> 00:03:23,500 That was really a neat thing about it. 51 00:03:24,300 --> 00:03:27,360 So, we thought it'd be fun to go figure out who this Gia Chan person was . 52 00:03:27,360 --> 00:03:30,900 And we're like, hey, you know, everyone's looking for Gia Chan, we're going to go find some Gia Chan. 53 00:03:31,480 --> 00:03:36,200 Uh, and we're very happy, Alfredo, if you're out here, thank you so much for designing your graphics, they're amazing. 54 00:03:37,940 --> 00:03:39,380 Um, so we decided to go hunting. 55 00:03:39,420 --> 00:03:43,880 And, you know, before we go hunting for Gia specifically, we want to talk a little bit about SH protocol. 56 00:03:43,880 --> 00:03:48,900 So, uh, Gia Chan targeted SH, uh, with ex- with ex-utils backdoor. 57 00:03:49,040 --> 00:03:51,240 So, we're going to target Gia Chan using SH. 58 00:03:53,220 --> 00:03:56,800 But before we go there, we need to talk about how SH public key authentication works. 59 00:03:56,900 --> 00:03:59,020 So, SH public key authentication is two-stage. 60 00:03:59,020 --> 00:04:03,360 The first thing you do is say, hey server, would you accept this public key for this username on your machine? 61 00:04:03,360 --> 00:04:04,660 And it says, yeah, sure. 62 00:04:04,660 --> 00:04:08,420 And then you have to sign this big blob of data that proves that you have the private key. 63 00:04:08,640 --> 00:04:10,740 But you can do that first part without the private key at all. 64 00:04:10,740 --> 00:04:11,320 And it's really cool. 65 00:04:11,320 --> 00:04:20,540 There's been a module in Metasploit 4 since 2012, lets you take someone else's public key that you got, however you got, and then check a bunch of servers to see whether that public key has access to, uh, those servers for that username. 66 00:04:20,540 --> 00:04:21,940 So, you can kind of see where this is going. 67 00:04:22,300 --> 00:04:25,160 Um, it's, there's this great comment on OpenSH saying, is this a problem ? 68 00:04:25,160 --> 00:04:25,680 I don't know. 69 00:04:25,680 --> 00:04:26,480 But it's been there forever. 70 00:04:26,480 --> 00:04:28,260 It's just kind of the protocol spec at this point. 71 00:04:28,300 --> 00:04:28,840 It is what it is. 72 00:04:28,840 --> 00:04:30,060 Maybe it's not a big security deal. 73 00:04:30,480 --> 00:04:34,440 So, we decided to create this thing called Shamble, which started off being a half-off scanner for SH. 74 00:04:34,480 --> 00:04:42,860 So, what we do is you take a bunch of public keys and then you'd like put them in Shamble and scan the whole internet saying, what on the internet can you access using these public keys? 75 00:04:42,980 --> 00:04:49,620 And the idea is like, well, if we had, let's say, Gia Tan's public key, we can find all the servers that they use and then from there we figure out who they are. 76 00:04:49,620 --> 00:04:50,760 So, that was, that was the idea. 77 00:04:50,860 --> 00:04:55,360 But it ended up evolving to this massive tool to find all kinds of other crap because of all the things that we found. 78 00:04:55,360 --> 00:04:59,900 So, you know, first thing you do say is, hey, my name's Gia Tan, we're gonna go download your GitHub keys. 79 00:04:59,900 --> 00:05:12,060 So, we grabbed our two GitHub keys, which are still present today, um, and basically took those two public keys, ran them into Shamble, and then, um, you know, threw that at the whole internet, all the, all the sh-demons we could find, let it grind out for a couple days. 80 00:05:12,880 --> 00:05:18,740 And what's, what's exciting about it is, like, we spent the whole week on this, we hadn't slept or anything like that, Rob and I were like working at four in the morning, like, we got one! 81 00:05:18,740 --> 00:05:20,060 We got a hit for Gia! 82 00:05:20,120 --> 00:05:21,060 It's really exciting. 83 00:05:21,560 --> 00:05:24,060 Um, in the meantime, we're melting all of our DigitalOcean nodes. 84 00:05:24,060 --> 00:05:27,920 So, this is this poor little DO droplet just like falling apart as we're like destroying it. 85 00:05:27,920 --> 00:05:29,920 It's, I think it's sent like a terabyte of traffic at this point. 86 00:05:29,920 --> 00:05:33,520 Like, we're, yeah, we made DO VMs very unhappy. 87 00:05:34,160 --> 00:05:41,080 Um, so, just heads up for law enforcement, um, we sent the public key for GiaTAN to every server on the internet from RIPs. 88 00:05:41,180 --> 00:05:45,140 We are not GiaTAN, we are not backdoor exe-utils, even though it very much looks like we did. 89 00:05:45,140 --> 00:05:47,300 So we sort of accidentally framed ourselves. 90 00:05:47,300 --> 00:05:56,360 Uh, we realized that after the fact that we probably might, I'm sure the long-arm law will catch up at some point, like, you guys, you're GiaTAN, like, ten years from now, and like, yeah, we are not, sorry. 91 00:05:57,720 --> 00:06:01,980 So, um, unfortunately, like, every single result we found that we thought was false positive. 92 00:06:01,980 --> 00:06:07,920 It was like a buggy server with, like, the memory was corrupted, or the service would accept every fifth public key, or every third public key. 93 00:06:08,020 --> 00:06:12,480 So we had to say, okay, let's try a bunch of random public keys, and if you reject all those, now try the Gia key. 94 00:06:12,480 --> 00:06:15,620 And let's try, like, an RSA key, RSA 1024, 2048. 95 00:06:15,620 --> 00:06:20,020 We've still found devices that just randomly accept or randomly not accept keys, and it just drove us crazy. 96 00:06:20,020 --> 00:06:28,480 So we finally fixed all these bugs, re-scanned, re-scanned, re-scanned, uh, you know, clicked all those digital ocean abuse notices, says, yeah, we're good, our server's not compromised, we're cool. 97 00:06:28,560 --> 00:06:30,680 Um, and we still found no Gia 10. 98 00:06:30,680 --> 00:06:34,860 So, whoever this, you know, actor was, they had really good OPSEC, we found nothing, so good job them. 99 00:06:34,980 --> 00:06:36,880 Um, but we did find, like, thousands of free shells. 100 00:06:36,880 --> 00:06:40,260 So, we're like, how come we're getting all these random shells and all these random machines? 101 00:06:40,260 --> 00:06:42,080 And that's really what this talk is, is about. 102 00:06:42,740 --> 00:06:45,300 Uh, so with that, um, a little bit of a detour. 103 00:06:45,300 --> 00:06:49,660 So, an SH, um, public keys used to not be something that you actually made public. 104 00:06:49,660 --> 00:06:53,560 They used to be something you kind of kept privately, and you were .SH directly, and you copied to a server here and there. 105 00:06:53,640 --> 00:06:58,960 But, um, in the last five or six years, we've seen people using, uh, SH keys like identities. 106 00:06:59,260 --> 00:07:03,960 So, just like people used PGP back in the day, you can now use SH keys as your identity when you're installing a bunch of server. 107 00:07:03,980 --> 00:07:09,140 You can tell it to grab your key from GitHub or from Launchpad and automatically give you access to your server during installation by username. 108 00:07:09,520 --> 00:07:14,560 Um, you can also, uh, um, use these keys for things like, uh, OJ encryption. 109 00:07:14,560 --> 00:07:18,620 So, if you use the OJ tool or H tool, you can use it almost like a PGP key now these days as well. 110 00:07:18,620 --> 00:07:21,660 So, it's all kinds of cool stuff you can do with, uh, SH keys you didn't before. 111 00:07:21,660 --> 00:07:25,540 But the key thing here is, like, keys are effectively public if you use any of these major platforms. 112 00:07:25,880 --> 00:07:26,780 And literally public. 113 00:07:26,840 --> 00:07:30,740 So, there's this great little, uh, daemon by Filippo where if you SSH into it, it'll say who you are. 114 00:07:30,740 --> 00:07:36,060 It'll use the public key you send to the server, dock to you based on the GitHub database and say, oh, you're so and so, welcome. 115 00:07:36,180 --> 00:07:37,380 So, it's kind of a fun little trick. 116 00:07:37,680 --> 00:07:40,160 And effectively, we're doing that, but at scale for the whole internet. 117 00:07:40,500 --> 00:07:45,740 So, if you want to link a user to a particular key on a particular server, you need, um, one, a list of all the SH servers out there. 118 00:07:45,740 --> 00:07:48,940 So, ZMap, Mascan, dump it, show it in, whatever you want to do to get the list. 119 00:07:48,940 --> 00:07:55,100 You want a list of all the public keys, so you go grind all those out of GitHub through their BigQuery API, about 117 million users as of about a month ago. 120 00:07:55,540 --> 00:07:56,700 Launchpad's got a bunch of users, too. 121 00:07:56,700 --> 00:07:57,460 You get all their keys, too. 122 00:07:57,460 --> 00:07:58,200 Why not? 123 00:07:58,220 --> 00:08:03,920 And then Bad Keys is a great project by, uh, Hanno Bach, um, that allows you to, that keeps track of all the compromised keys out there. 124 00:08:03,920 --> 00:08:06,200 So, you can look for keys that give you access to the system. 125 00:08:06,200 --> 00:08:12,880 And then lastly, you need a list of common usernames the user might have, like root, ec2 user for cloud, Ubuntu, et cetera, or whatever the comment is in the key. 126 00:08:13,000 --> 00:08:20,680 So, one of the nice things about GitHub is that when you upload your public key to there, they actually preserve the comment field, which is typically your, your username when you uploaded the key. 127 00:08:20,700 --> 00:08:21,920 So, you know what their default username is. 128 00:08:21,920 --> 00:08:25,940 So, if you're trying to find, like, their server someplace, you can pull it out the comment, use that to talk to the user, and so on. 129 00:08:26,240 --> 00:08:28,640 So, you, you take this nice little recipe and you throw it in the oven. 130 00:08:29,440 --> 00:08:34,260 And, um, it gives you a nice little primitive to take a one key and check lots of servers really fast. 131 00:08:34,260 --> 00:08:37,620 Like, you can grind through all the servers on the internet in, like, an hour or something like that on a single box. 132 00:08:37,620 --> 00:08:38,300 It's pretty quickly. 133 00:08:38,440 --> 00:08:39,540 Just for one key. 134 00:08:39,780 --> 00:08:43,220 Um, but if you want to test, um, so that works great if you're looking for, like, a geotan everywhere. 135 00:08:43,240 --> 00:08:51,720 But what if you want to say, for this server on the internet that's acting fishy, which GitHub user has access to it and do the other way, to check all 117 million keys on one server. 136 00:08:51,960 --> 00:08:53,100 Well, that's a very different attack. 137 00:08:53,100 --> 00:08:56,360 That's like, you know, duck-sized horse or horse-sized ducks, you know, kind of approach. 138 00:08:56,440 --> 00:09:02,360 So if we want to test a million keys against, uh, a single server, it's a little bit tougher because, uh, SH will slow you down. 139 00:09:02,460 --> 00:09:07,680 Uh, they have, uh, this thing called max auth limit, which is how many tries you can authenticate before it kicks you off of that connection. 140 00:09:07,700 --> 00:09:10,720 And there's a max connection limit, so you can only do so many of those at once, right? 141 00:09:10,880 --> 00:09:16,240 So the idea is that with OpenSH, if you try to brute force keys, you get four into it and it knocks you out and you can't auth anymore. 142 00:09:16,320 --> 00:09:22,520 So if you ever had more than four keys in your SH, uh, agent, and you try to shell out a machine and it just immediately says, you know, too many tries, that's why. 143 00:09:22,520 --> 00:09:25,020 It's because you're hitting the max auth limit of OpenSH. 144 00:09:25,540 --> 00:09:28,060 However, um, OpenSH is the only one that does that. 145 00:09:28,060 --> 00:09:30,160 Everything else lets you just bang keys all day long. 146 00:09:30,320 --> 00:09:34,360 So DropBear lets you just grind keys as fast as that little device can, can test them. 147 00:09:34,380 --> 00:09:39,840 Um, also a lot of commercial products like Bitbuys, GlobalScape, Maverick, LanCom, all this stuff, all their SH daemons do not care. 148 00:09:39,840 --> 00:09:42,560 They'll let you just try every possible key in the world until, until you're done. 149 00:09:42,560 --> 00:09:43,200 It's great. 150 00:09:43,400 --> 00:09:47,580 Uh, we emailed the DropBear folks, they didn't care, they didn't even bother replying, so we're like, it's not really a bug, it's a feature. 151 00:09:47,580 --> 00:09:48,960 So, we like that feature. 152 00:09:50,060 --> 00:10:01,200 So, uh, with the shamble code you mentioned before, we tested the GitHub, like 4.6 million key database at the time, and you can do about 10,000 keys per second on a DropBear box on an embedded node without it spiking the CPU on the target device at all. 153 00:10:01,200 --> 00:10:01,980 It just doesn't even care. 154 00:10:01,980 --> 00:10:03,080 It's like super fast. 155 00:10:03,080 --> 00:10:04,340 So it doesn't even murder the machine. 156 00:10:04,340 --> 00:10:08,700 And this is 10 ,000 keys per second per connection, and DropBear is typically configured with 15 connections. 157 00:10:08,700 --> 00:10:14,260 So you can do 150,000 keys per second on a machine for pub key testing to dock someone's server. 158 00:10:14,340 --> 00:10:18,420 So if you see someone like hitting you on a random box and SH is open, just go take all the keys and get it. 159 00:10:18,420 --> 00:10:19,680 I'd be like, yeah, you jerk, stop that. 160 00:10:19,680 --> 00:10:21,000 And just email him, like quit it. 161 00:10:21,020 --> 00:10:23,620 Like, it's really, really easy to dock to your hackers. 162 00:10:23,800 --> 00:10:30,840 And if you're running an SH honeypot and your SH honeypot collects the public key being sent to you, you can turn around and flip that on them again and immediately figure out who they are. 163 00:10:30,860 --> 00:10:35,780 Like, people forget all the time that their SH agent's configured and they're sending their public key to every server they connect to. 164 00:10:35,780 --> 00:10:40,740 Even if their agent is not authenticating to it, they're still automatically sending that public key as a task whenever you touch anything. 165 00:10:40,980 --> 00:10:48,600 So if you're a, a lead hacker and you've been just SHing at random machines on the internet, you're also sending your public key identity to all those machines and if they're logging at your host. 166 00:10:50,040 --> 00:10:54,780 So, um, by contrast, if you try the same attack against open SH, you can do 132 keys per second. 167 00:10:54,780 --> 00:10:58,640 So it'll take you 10 hours to do the same 4.8 million keys with a single connection. 168 00:10:58,760 --> 00:11:04,780 So, um, obviously the open SH approach is much nicer, um, but it's great if you're trying to, um, adapt, docks people. 169 00:11:04,860 --> 00:11:07,700 So, uh, with that, I'll hand it to Rob to talk about shaking out shells. 170 00:11:08,700 --> 00:11:10,200 Testing, testing, testing. 171 00:11:12,700 --> 00:11:13,620 Testing, testing. 172 00:11:13,620 --> 00:11:14,920 Hey, all right. 173 00:11:15,000 --> 00:11:18,460 So shaking out shells, say that five times fast. 174 00:11:18,780 --> 00:11:28,600 Um, what we did with shamble is it resulted in, uh, around 27 million devices on the public internet that are listening on port 22. 175 00:11:28,600 --> 00:11:36,800 We got another, you know, 14 million or so that actually negotiated, uh, SSH off and we ended up with about 110,000 sessions. 176 00:11:37,040 --> 00:11:47,440 Um, what's really interesting about SSH, so SSH, uh, especially open SSH has done an immense amount of work in, do what? 177 00:11:48,520 --> 00:11:50,560 Oh, sorry, front mics are hot. 178 00:11:50,980 --> 00:11:52,700 Uh, so, sorry. 179 00:11:52,740 --> 00:11:59,980 So, uh, we ended up with, um, about 110,000, uh, that are actually listening and we were able to get sessions. 180 00:11:59,980 --> 00:12:06,900 What's fascinating about open SSH is, or SSH, is that there's a fairly large post-authentication attack surface. 181 00:12:07,080 --> 00:12:08,880 So SSH does lots of things. 182 00:12:08,880 --> 00:12:17,320 You can create tunnels, you, uh, can create pseudo-terminals, there's subsystems, there's all sorts of things that are running on, uh, SSH once you're inside. 183 00:12:17,480 --> 00:12:27,460 Uh, it kind of assumes that once you've authenticated, you're okay, but there's an immense, uh, an immense amount of systems out there that actually will do this interesting post-auth-auth. 184 00:12:27,500 --> 00:12:36,280 So you authenticate, uh, non-authentication with left beef and you get in and then it actually gives you a secondary authentication mechanism. 185 00:12:36,280 --> 00:12:40,800 It'll prompt you for a username and then a password, but you're inside the session at that point. 186 00:12:40,800 --> 00:12:42,340 So you can start doing some interesting things. 187 00:12:42,340 --> 00:12:45,660 This is one of the, the interesting cool things that, that Shamble will do. 188 00:12:46,020 --> 00:12:52,960 Um, you can say, oh, okay, uh, I can send signals, I can send, uh, SIGWINCH, I can, uh, forward X11, things like that. 189 00:12:53,340 --> 00:13:01,740 And you can see there's a fair amount of large, uh, devices, uh, popular devices out there that do this post-auth-auth. 190 00:13:01,740 --> 00:13:10,120 So you can see you've got, uh, SonicWall firewalls, um, Juniper network devices, you can SSH in with auth none, and then it'll give you the secondary one. 191 00:13:10,120 --> 00:13:14,820 That, uh, that smaller one, the please login, that's, uh, a ruckus one that HD's gonna talk about here in a minute. 192 00:13:14,820 --> 00:13:16,960 That's super, uh, super fascinating. 193 00:13:16,980 --> 00:13:26,000 But it's worth noting that there is this post-auth attack surface that is kind of not considered, but is exposed. 194 00:13:26,100 --> 00:13:30,140 So, uh, and with that, with sort of the first one that you can talk about is signal injection. 195 00:13:30,140 --> 00:13:32,060 I'm gonna pass it back to HD for that. 196 00:13:32,480 --> 00:13:33,600 Did we get the second mic working? 197 00:13:34,360 --> 00:13:35,260 Cool, thank you. 198 00:13:35,260 --> 00:13:37,680 Sorry, just trying to stay away from the front mic so we don't get feedback here. 199 00:13:38,260 --> 00:13:46,040 Um, so, uh, Rob mentioned that one of the things you can do to a post-auth session is, uh, inject signals into the process before you've fully authenticated. 200 00:13:46,160 --> 00:13:54,200 So if actually you can connect to a machine, it'll pass through the authentication from SH auth equal none, and then drop you to a real login shell, and it'll say, please login. 201 00:13:54,340 --> 00:13:57,260 And you can just say, signal seg v, and it goes, ah, and dies. 202 00:13:57,360 --> 00:13:58,380 Which is a lot of fun. 203 00:13:58,440 --> 00:14:02,640 So effectively you can just, you know, we talk about regression being signal re-entrance, this is just signal entrance. 204 00:14:02,640 --> 00:14:06,440 You just bang signals all day long into whatever process you want and see what terrible things fall back out of it. 205 00:14:06,600 --> 00:14:10,600 So, uh, we didn't get too far into this testing, but we, there's all kinds of fun things that come out of it. 206 00:14:10,600 --> 00:14:20,560 You can send a SIGINT request, you can pass Python scripts that are part of the login shell to crash, uh, you can do SIG alarms, SIG childs, SIG ills, SIG aborts, you can pass core dumps, uh, all kinds of crazy stuff you can just do with signals. 207 00:14:20,560 --> 00:14:27,040 And OpenSH tries to protect you a little bit by limiting things like sig seg v, sig abort, and so on, uh, but DropBear does not. 208 00:14:27,040 --> 00:14:30,840 DropBear is like, anything that you can possibly send me, I'll treat as a signal and deliver to the process, thank you. 209 00:14:30,960 --> 00:14:38,780 Um, so there's a lot of really cool attacks that we think you can do there, and we're gonna start working on expanding the shamble code to then basically just mash symbols into random processes so you get a shell. 210 00:14:39,040 --> 00:14:42,020 And, yeah, um, with that, hand it back to Rob to talk about TSP forwarding. 211 00:14:43,300 --> 00:14:48,860 I, I do always love that, uh, DropBear is like, I, you know, it's like if it were dying, it wouldn't be dictating, right? 212 00:14:48,860 --> 00:14:51,420 It wouldn't be writing it out, it would just say IEE, but no. 213 00:14:51,620 --> 00:14:57,160 Um, but another part of this post-auth, uh, uh, attack surface is forwarding, right? 214 00:14:57,160 --> 00:15:03,620 So SSH allows you to generate or create tunnels, uh, you know, through channels and create encrypted tunnels. 215 00:15:03,960 --> 00:15:08,460 It's almost like a little miniature VPN thing, and this is a pretty popular and common, uh, feature. 216 00:15:08,460 --> 00:15:11,920 But once you po-, once you're in this post-auth situation, you can start doing that. 217 00:15:11,920 --> 00:15:14,340 You can start creating these things on a lot of these systems. 218 00:15:14,500 --> 00:15:28,880 Um, many of them will administratively restrict you from doing it or they'll only let you go to certain things, but for example, uh, uh, you can say, okay, well I'm gonna try to forward to this particular host, or I'm gonna try to forward to a local host and do a loopback, 219 00:15:28,880 --> 00:15:45,740 um, and we actually found, uh, this is an ION, yeah, okay, good, the chip's playing, uh, this is, uh, an ION network's access point, and you can see that it's trying to, uh, forward to google.com, and it, it gets rejected, and then it's gonna try, oh, 220 00:15:45,740 --> 00:15:48,440 and by the way, this is the shambles shell, uh, which I love. 221 00:15:48,740 --> 00:16:03,440 Um, and it'd say, oh, I'm gonna try to get to 88888, but then you can actually forward back to local host, so you can actually use that to get around restrictions and things like that once you're in this sort of, uh, uh, mystery, uh, uh, post-auth shell. 222 00:16:03,580 --> 00:16:09,280 But, the big, the big one is shell injection, I'm gonna let you take this one, cause this is super cool. 223 00:16:10,080 --> 00:16:14,040 So one thing that was kind of fun about this is that we found bugs that, like, we shouldn't have found. 224 00:16:14,040 --> 00:16:22,040 Like, because of this post-auth sequence, effectively you SH to the machine, and instead of asking for a password, you just, it drops you straight in, but it drops you straight into a secondary shell. 225 00:16:22,040 --> 00:16:23,960 And that secondary shell has its own bugs. 226 00:16:23,960 --> 00:16:28,720 So we kept finding these vulnerabilities in these secondary shells that no one had found before, even though they were, like, stupid. 227 00:16:28,720 --> 00:16:32,740 Like, we found so many dumb bugs just because no one really tested that level of the protocol. 228 00:16:32,860 --> 00:16:46,160 So in this case, um, we're right across these, like, ruckus access points, and you SH them, there's about 36,000 of these suckers exposed to the internet, about 900 are vulnerable to this particular attack, still right now, today, and it asks you for a username, 229 00:16:46,160 --> 00:16:51,400 you type in root, you type in, you start entering your password, and for your password, you just type in, like, dollar, parenthesis, whatever command you want to run, right? 230 00:16:51,440 --> 00:16:55,800 And just redirect it back out to standard error so you can see the result, and it just runs this root, pre-auth, it's great. 231 00:16:56,100 --> 00:16:59,040 Um, so we'll, we reached out to ruckus, of course, like, hey, what's up? 232 00:16:59,040 --> 00:17:00,440 Like, you guys, is this a new bug? 233 00:17:00,440 --> 00:17:01,220 Is this a fixed bug? 234 00:17:01,220 --> 00:17:02,700 We can't really tell what's patched. 235 00:17:02,700 --> 00:17:03,840 Like, oh yeah, we patched that already. 236 00:17:03,840 --> 00:17:05,200 I'm like, did you tell anyone? 237 00:17:05,220 --> 00:17:06,300 Nope, they didn't tell anyone. 238 00:17:06,300 --> 00:17:08,080 There's no CV, no security note whatsoever. 239 00:17:08,240 --> 00:17:11,220 So of course no one's applying patches because they didn't know they had to apply a patch. 240 00:17:11,560 --> 00:17:18,920 Um, so they've got two different tracks, the 521 and the 621, those both fix it, but there's, you know, still about, you know, almost a thousand folks out there still running unpatched up. 241 00:17:18,920 --> 00:17:21,180 But the question was, like, why did this bug live so long? 242 00:17:21,180 --> 00:17:28,640 How did we end up with this, like, a stupid login prompt, like, password character injection, and it's because it was behind this SSH auth layer that no one really bothered to test it. 243 00:17:28,640 --> 00:17:34,240 Like, all your folks who normally hit a telnet prompt, something like that, just hadn't tried this SSH post auth attack. 244 00:17:34,240 --> 00:17:40,420 So we uncovered this whole, like, layer of bugs that really should have been found 20 years ago, but they were just hiding behind this extra SSH layer. 245 00:17:40,500 --> 00:17:43,040 Uh, and that's one of the interesting kind of side effects of this work. 246 00:17:43,040 --> 00:17:46,620 So here's an example of us, uh, rooting one of these random ruckus boxes. 247 00:17:46,820 --> 00:17:56,360 SSH in with all the, I don't care about my cipher stuff, please log in, R-O-O-O-O-T, and then for the password, we're just typing in $PSAOX-W and getting a big process listing. 248 00:17:56,500 --> 00:18:03,800 And the funny thing about it is you can actually see the echo command in the PS listing showing that it's going to shop 256 sum, that's how they check your password. 249 00:18:03,820 --> 00:18:06,880 So they fixed it just by putting in proper quotes, but the whole thing is ridiculous. 250 00:18:06,880 --> 00:18:11,560 So it's amazing, like, how many dumb bugs are out there if you just go a little bit further into the protocol stack. 251 00:18:11,660 --> 00:18:13,680 And back to Rob for the permit. 252 00:18:15,500 --> 00:18:24,560 So SSH, you know, is the secure shell, it's designed to talk as your shell, it replaces Telnet and RSH and all that, and it lets you set environment variables. 253 00:18:24,660 --> 00:18:30,380 Um, environment variables are used to control the execution of things and, you know, keep track of the environment and all that. 254 00:18:30,380 --> 00:18:35,660 And a lot of, uh, SSH implementations will limit what you can send, but a lot won't. 255 00:18:35,660 --> 00:18:41,920 Um, there's been a, uh, and it's configurable, of course, some will, uh, accept these environment variables, some don't accept these. 256 00:18:41,960 --> 00:18:54,140 So there's been this renaissance in, uh, Gitforges lately, there's a ton, there's, there's GITI, there's GOGS, there's, uh, I always pronounce this wrong, FORGEHO, tell me if I'm saying that right, GARET, things like that. 257 00:18:54,440 --> 00:19:07,320 And they are using these embedded SSH libraries that speak the SSH protocol, and these libraries, because they're, you know, designed for general use, they will accept, you know, any environment variable you send, and they rely on the client, the user of the library, 258 00:19:07,320 --> 00:19:09,840 to, uh, limit what is going on. 259 00:19:10,380 --> 00:19:24,820 Um, and so that's generally okay, like a lot of them do it correctly, uh, for example, GitLab, GITI, FORGEHO, they will only accept Git protocol as, uh, an environment variable, and that's, uh, something that's looked at by Git to negotiate protocol versions, 260 00:19:24,820 --> 00:19:27,120 so you can say, oh, I want to use Git protocol version 2 or whatever. 261 00:19:27,160 --> 00:19:40,840 But, for example, there's still some vulnerabilities there, if you were using a version of one of these, these are all written in Go, and it was compiled using a version of Go prior to 1.19.3, which is a year or two old, um, on Windows systems, they don't properly sanitize the, 262 00:19:40,840 --> 00:19:47,180 uh, the value of the environment variable, so if you put a null in there, you can actually just inject arbitrary environment variables, which is, uh, super fun. 263 00:19:47,500 --> 00:20:02,060 But, um, there was another one that was really interesting in, uh, GOGS, where whenever it gets an environment variable, it actually runs the env command, and so the point of the env command is to start a new process, um, with a new environment, with, 264 00:20:02,060 --> 00:20:04,320 you know, setting certain environment variables or whatever. 265 00:20:04,760 --> 00:20:09,700 And it starts a new process, it doesn't affect the environment that you're in, right? 266 00:20:09,700 --> 00:20:12,280 It, it, that's not how POSIX works. 267 00:20:12,360 --> 00:20:26,460 So you could just say, okay, well, I want to set an environment variable with, you know, dash, dash S A equals B, and then, you know, bash, or, you know, touch temp foo, or whatever, and you are just executing arbitrary commands. 268 00:20:26,460 --> 00:20:32,840 And we, we did reach out, there's, there's no patch for this, uh, it's, seems moribund, so maybe don't use it. 269 00:20:33,960 --> 00:20:34,520 Um. 270 00:20:34,680 --> 00:20:47,880 This is a great example of, like, parallel discovery, so, not in, not in the court sense, but in the, uh, we reported this vulnerability on, like, April 24th, and Sonar Research had reported the same bug to the same maintainer on the 22nd, and they scooped us on the advisory, 271 00:20:47,880 --> 00:20:55,360 and we both had our own separate GitHub advisories, but it's just hilarious that we both managed to look at the same bug at the same time, so, it's funny, like, how often that happens, and this is a great example. 272 00:20:55,360 --> 00:21:06,500 So props to the Sonar source folks for beating us by two days, uh, and they did a really great blog post about how the bug works, but it, it almost looks like a backdoor, because it doesn't actually influence the environment of the subprocess, it's just a straight command exec pre-auth, 273 00:21:06,500 --> 00:21:08,160 so it's a, it's a funky bug. 274 00:21:08,180 --> 00:21:08,740 Yeah. 275 00:21:09,060 --> 00:21:10,700 Yeah, exactly, thank you, HG. 276 00:21:10,920 --> 00:21:26,500 Um, so going back to these, uh, these libraries, so, for example, uh, Apache Nino, which is a Java, uh, implementation of SSH, will accept any variable you want, um, and most of the time, uh, it doesn't really run into anything, but this is, this is maybe my whole, 277 00:21:26,500 --> 00:21:29,280 this is maybe my favorite thing that we found, uh, personally. 278 00:21:29,420 --> 00:21:44,280 Uh, so there's this piece of software called SoftServe, and it's designed to build, um, Git repos, and it gives you this beautiful, uh, SSH, or, you know, CLI, you SSH in, you control it, you can do whatever, and it uses, um, the Charm Bracelet SSH, uh, 279 00:21:44,280 --> 00:21:58,860 library, which is built on top of Go's SSH, um, and it will accept any environment variable, or it did, we reported it, they fixed it, this is our CVE, Go us, um, but what's fun is you can, first off, watch how slow I am when I'm typing in, uh, in GIF form, 280 00:21:58,860 --> 00:22:12,320 but, um, you can, uh, we just basically created some shellcode, and we checked it into LFS, and you can actually do this in lots of different ways, LFS just, uh, Git LFS is large file storage, it, it just makes it to where it's not compressed, and, uh, 281 00:22:12,320 --> 00:22:26,240 the file name is predictable, so we don't have to worry about it too much, uh, makes it easier to exploit, we push it up to, uh, to SoftServe, and then, uh, doing the SHA 256 sum of our shellcode, because that gives us the, uh, the file name that we can, 282 00:22:26,240 --> 00:22:33,280 you know, guess, and then we just set LD preload to our shellcode, and we now have, you know, shell on that system. 283 00:22:33,280 --> 00:22:44,120 So, that was super fun, uh, I, I always love when I get a shell, and I'm just like, oh, this is great, you know, uh, so that made me really happy, and these, uh, these folks were really super cool to work with, um, we, uh, we disclosed that, they were very, 284 00:22:44,120 --> 00:22:45,000 very nice. 285 00:22:45,180 --> 00:22:52,020 Um, but now moving on to, uh, Broken States, which is the SSH state machine to HD. 286 00:22:52,040 --> 00:23:02,020 Thanks, um, another fun thing about the, the SoftServe side, so that particular exploit, um, because it's using git LFS, you can, you can reference a raw file on disk, and you don't have to know your file location, you can use relative paths and stuff, 287 00:23:02,020 --> 00:23:13,600 but this works just fine for unauthenticated git access too, so if you're running SoftServe for read-only access, you can still exploit it, it just requires jumping through more hoops, because you can specify LD preload, LD load library, you can set LD library debug out in the past, 288 00:23:13,600 --> 00:23:24,360 there's a million ways you can, like, eventually get a file onto disk to then load, or to trigger a shell script, but just LFS was the quickest way, but like, yes, we're loading arbitrary code, so, it, write access to the repo is not a requirement to exploit SoftServe, 289 00:23:24,360 --> 00:23:33,060 and there's still about ten of those suckers hanging out on the internet right now that are exploitable, so, if you're quick, they're yours, um, kidding, but, um, so, I'll talk a little bit about the SSH state engine. 290 00:23:33,300 --> 00:23:38,720 So, SSH is like, incredibly complicated in terms of how it makes you go through these different states to get to each phase of the protocol. 291 00:23:38,900 --> 00:23:45,540 The stuff you're mostly familiar with is like, when you first connect to the port 22, you'll see like, SSH-2.0, uh, server banner, things like that. 292 00:23:45,540 --> 00:23:53,740 If you happen to send the same manner back to it, or you connect to dropper, then you'll get this big blob of stuff with null delimited strings, which have like, ciphers, and max, and algorithms, things like that inside of it. 293 00:23:53,820 --> 00:24:02,840 So, all that's kind of during the, uh, server version exchange, and the key exchange, um, the SSH daemons are very clear that they will only accept a certain range of message values for each state. 294 00:24:02,860 --> 00:24:10,760 So, before you've done the, uh, version exchange, you can't do the key exchange, before you do the key exchange, you can't do authentication exchange, and this is enforced two ways. 295 00:24:10,760 --> 00:24:13,760 The protocol itself has a range of values allowed for each state. 296 00:24:13,760 --> 00:24:18,560 So, values 1 through 49 are allowed in state 1, 0 to 49 in state 2, and so on. 297 00:24:18,560 --> 00:24:25,920 So, if you're trying to like, just open a channel, or open a shell, technically there's no even message handler for it, because it hasn't even configured the state handler to even accept that type of message yet. 298 00:24:25,920 --> 00:24:27,900 But that depends very much on the implementation. 299 00:24:28,280 --> 00:24:35,100 Uh, DropBear and OpenSH are really good at keeping a big command table, and when they go to another state, they just remove that command table handler for the previous state. 300 00:24:35,100 --> 00:24:37,860 So, there's really no way to like, accidentally call the wrong function pointer. 301 00:24:37,940 --> 00:24:40,280 Um, and that mostly works the way you expect. 302 00:24:40,640 --> 00:24:43,840 What's also interesting here is everything after the key exchange, of course, is encrypted. 303 00:24:44,160 --> 00:24:53,960 So, SH is kind of like TLS in a lot of ways, in that you have your normal, like, version exchange, key exchange, algorithm, Diffie-Hellman type thing, and then you have, like, your encrypted transport, and that's where all the fun stuff happens, like authentication, 304 00:24:53,960 --> 00:24:55,140 your banner, if you will. 305 00:24:55,140 --> 00:24:56,700 Like, have you ever seen a pre-auth banner in SH? 306 00:24:56,700 --> 00:24:59,960 It's actually being sent over the encrypted connection, not over the unauth connection. 307 00:25:00,160 --> 00:25:06,180 So, typically when you're talking about an SH banner, you're not talking about the version string, you're talking about the pre-auth big blob of data that it sends you when you try to authenticate. 308 00:25:06,460 --> 00:25:09,800 Um, so lots of cool stuff happening there, but you can see the state engine is pretty complicated. 309 00:25:10,260 --> 00:25:13,260 Um, what's also worth pointing out here is there's something called a larval session. 310 00:25:13,460 --> 00:25:19,320 So, that means you've successfully authenticated, or maybe not, and it's the state of your shell before there's a shell . 311 00:25:19,440 --> 00:25:24,520 So, effectively, if you haven't created a sub-process yet, you're in this kind of, like , larval state, and that's how the code generally references it. 312 00:25:24,520 --> 00:25:27,000 And that's important when we start getting into some of these other exploits. 313 00:25:27,440 --> 00:25:30,620 So, a historic example of where this has gone wrong is libsh. 314 00:25:30,740 --> 00:25:39,380 In 2018, uh, someone reported vulnerability where this library is used for both client and server side, same with OpenSH, same with DropBear, they kind of share the same code base for both halves of the protocol. 315 00:25:39,520 --> 00:25:45,780 Um, and if you sent the user-authenticated succeeded message from the client to the server, the server's like, oh, okay, cool, you're in, and that's fine. 316 00:25:46,080 --> 00:25:53,300 Um, there's still a bunch of these libsh informations out there that'll just drop you to a shell if you send user auth success, and of course, you know, shamble test for that and makes it easy for you to use it. 317 00:25:53,600 --> 00:25:56,260 Um, so we decided to take this up another level. 318 00:25:56,260 --> 00:26:00,600 Instead of just saying, let's just send a fake success message, let's just try to get a shell everywhere. 319 00:26:00,600 --> 00:26:12,040 Let's take every single part of the protocol transition and say, let's do half auth, let's do full auth, let's do a fake pubkey, let's do a password, let's do a password none, let's do, even before sh user auth command at all, and between every one of those attempts, 320 00:26:12,040 --> 00:26:13,200 we're going to ask you for a shell . 321 00:26:13,380 --> 00:26:14,480 We're just going to be like, how about a shell now? 322 00:26:14,480 --> 00:26:15,120 How about a shell now? 323 00:26:15,120 --> 00:26:15,600 How about a shell now? 324 00:26:15,600 --> 00:26:16,380 And how about now? 325 00:26:16,520 --> 00:26:17,520 Um, and it worked. 326 00:26:17,520 --> 00:26:21,580 Like, we got crap loads of shells from random devices because we asked them in weird states to give us a shell. 327 00:26:21,720 --> 00:26:25,840 So there's some out there where you don't even bother even starting the authentication process and it gives you a shell. 328 00:26:25,840 --> 00:26:28,840 There's some out there where you start the authentication process but don't finish, it gives you a shell. 329 00:26:28,840 --> 00:26:30,000 Like, it's all over the map. 330 00:26:30,000 --> 00:26:32,480 So, um, there's three good examples we talk about here. 331 00:26:32,480 --> 00:26:35,480 The first one is the digi transport, uh, gateways. 332 00:26:35,480 --> 00:26:39,240 They're mostly using like ICS environments, they're kind of like out in the field with hardened stuff. 333 00:26:39,240 --> 00:26:44,460 They act as like kind of the VPN router, if you will, for all the, all the juicy OT stuff you want to hack behind it. 334 00:26:44,600 --> 00:26:49,280 Um, so having remote admin to these means you basically have serial port access to all the stuff behind it, which is great. 335 00:26:49,280 --> 00:26:51,920 So if you want to like blow up pipelines, things like that, that's how you do it. 336 00:26:52,100 --> 00:26:53,840 Um, so the digi team was really cool. 337 00:26:53,840 --> 00:26:54,920 They were great to work with. 338 00:26:54,920 --> 00:27:00,120 Um, this device had already been like basically effectively legacy and retired, but it's still up for maintenance on screen patches. 339 00:27:00,160 --> 00:27:06,080 But they had to go find like the one developer who hadn't looked at this thing in five years and dust off their compiler and try to figure out how to build the damn thing and all that. 340 00:27:06,080 --> 00:27:10,380 And the funny thing about this is it ended up being an un, uh, an uninitialized variable in the SH engine. 341 00:27:10,900 --> 00:27:15,860 So it took us forever to repro, because we'd say, hey, we can get shells in like all these machines on the internet. 342 00:27:15,860 --> 00:27:18,560 Like here's a bunch of them, here's the serial numbers, like it's bad, go fix it. 343 00:27:18,560 --> 00:27:19,540 Like we can't repro it. 344 00:27:19,540 --> 00:27:20,600 I'm like , you got to be kidding me. 345 00:27:20,600 --> 00:27:21,660 Like just run the command. 346 00:27:21,660 --> 00:27:22,780 Like what are you doing wrong? 347 00:27:22,780 --> 00:27:25,840 Like it's run command, what's doing, it was not their fault of course. 348 00:27:25,840 --> 00:27:30,980 It's that when they were setting up the machine to test, they were logging in for the rest of the H first and setting up their monitoring on it. 349 00:27:30,980 --> 00:27:35,200 And then they'd run our exploit and it wouldn't work because the uninitialized variable had been set. 350 00:27:35,340 --> 00:27:37,440 So just one of those things was like freaking Heisenbug to repro. 351 00:27:37,440 --> 00:27:38,080 It took forever to fix. 352 00:27:38,080 --> 00:27:40,320 Anyways, so we finally got to the end of it, but the team was really cool. 353 00:27:40,320 --> 00:27:40,920 They're great to work with. 354 00:27:40,920 --> 00:27:42,780 They got a patch out even for this legacy hardware. 355 00:27:42,780 --> 00:27:45,140 So awesome to see them actually supporting older systems. 356 00:27:45,440 --> 00:27:48,560 Uh, then we found these real tech devices that are like branded all kinds of things. 357 00:27:48,740 --> 00:27:55,540 Netterbit, um, Netis, there's probably a good dozen vendors out there and they all have like different flavors of firmware from 2018 to 2023. 358 00:27:55,840 --> 00:27:57,240 And it's just like free shells everywhere. 359 00:27:57,240 --> 00:27:58,200 We don't even know who to report it to. 360 00:27:58,200 --> 00:27:59,480 So that's, there's a bunch out there. 361 00:27:59,620 --> 00:28:01,180 Um, yeah, have fun with that. 362 00:28:01,340 --> 00:28:05,340 Uh, we also ran across a bunch of Panasonic switches, but also a really weird set. 363 00:28:05,340 --> 00:28:07,060 And we had no idea who to report that one to either. 364 00:28:07,060 --> 00:28:09,000 Like the normal Panasonic thing wasn't the right fit. 365 00:28:09,000 --> 00:28:10,680 And so all the docs were in Japanese. 366 00:28:10,680 --> 00:28:11,740 We kind of gave up on that too. 367 00:28:11,740 --> 00:28:13,580 So we'll eventually figure out how to disclose that one. 368 00:28:13,580 --> 00:28:17,720 But there's a bunch of random Panasonic switches that'll just give you a shell pre-op as well through the same mechanism. 369 00:28:17,940 --> 00:28:19,400 Um, and this is just kind of the tip of the iceberg. 370 00:28:19,400 --> 00:28:21,240 We found another like 70 odd devices. 371 00:28:21,240 --> 00:28:22,540 We just haven't figured out where they are yet. 372 00:28:22,760 --> 00:28:29,140 Um, so, you know, basically take Shamble, throw it in your home network, throw it in your work network and you might just get random free shells out of crap through this stage transition. 373 00:28:29,280 --> 00:28:33,000 The only tricky bit here is you may have to specify a username that's not the default username. 374 00:28:33,000 --> 00:28:40,720 So if the device typically has like an admin or manager username, specify all the default admin usernames for the products and you'll be more likely to shake out some shells. 375 00:28:41,960 --> 00:28:44,780 So here's an example of the Netterbit NSL224s. 376 00:28:44,780 --> 00:28:46,320 These are really popular in Iran. 377 00:28:46,320 --> 00:28:51,120 So a huge portion of Iran uses these things and you just basically log in as, you know, whatever you like. 378 00:28:51,380 --> 00:28:54,600 Um, so in this case we're using the Shamble shell for it. 379 00:28:54,600 --> 00:29:01,900 We're just saying like brute force all the different session states and it logs us directly into it and it shows data, here's the firmware, all the info, things like that. 380 00:29:01,960 --> 00:29:03,000 So super straightforward. 381 00:29:03,420 --> 00:29:06,540 And here's an example of the Digitransport ICS gateways. 382 00:29:06,580 --> 00:29:07,220 Same thing. 383 00:29:07,220 --> 00:29:10,880 What I love about this is when you log in it says, welcome, your access is super. 384 00:29:11,060 --> 00:29:14,280 So I also have the, you know, the South Park voice in my head when I see that. 385 00:29:14,280 --> 00:29:15,260 So it's amazing. 386 00:29:15,960 --> 00:29:19,640 Um, with that, I would like to talk a little bit about the OpenSH landscape. 387 00:29:19,760 --> 00:29:28,980 So, you know, typically we think about like SSH being OpenSH and sure it's like 90% of us, it's 87% of all SSH in the world, but OpenSH isn't just OpenSH either. 388 00:29:28,980 --> 00:29:31,100 There's a lot of different flavors of OpenSH. 389 00:29:31,340 --> 00:29:41,840 So for folks who aren't super familiar, uh, OpenSH was forked from OSSH, which was forked from the original V1, um, you know, tattoo, um, version of SH back in the day. 390 00:29:41,980 --> 00:29:44,860 Um, but OpenSH wasn't designed for Linux. 391 00:29:44,860 --> 00:29:47,300 OpenSH was hardcoded for OpenBSD. 392 00:29:47,300 --> 00:29:50,840 Like they didn't want our dirty Linux paws all over their beautiful SH daemon. 393 00:29:50,840 --> 00:29:59,160 So eventually they conceded and said, you know what, you guys can, all you plebs can actually touch our beautiful SH code, but we're going to create a version of OpenSH just for you called OpenSH portable. 394 00:29:59,360 --> 00:30:09,960 So when you talk about OpenSH, you're really talking about the portable version of OpenSH, which has a compatibility layer that makes, um, all of us heathens be able to use the nice functions of VSD basically, uh, without all the pledge and cool things like that. 395 00:30:10,000 --> 00:30:13,240 But if you look at OpenSH portable, there's actually a bunch of variants of that too. 396 00:30:13,420 --> 00:30:17,860 So if you look at like who is molested OpenSH the most, we're going to start off with Apple. 397 00:30:17,880 --> 00:30:19,260 Apple was just light touch. 398 00:30:19,260 --> 00:30:20,120 They just gave a little hug. 399 00:30:20,120 --> 00:30:21,360 They didn't really do much to it. 400 00:30:21,420 --> 00:30:23,440 Uh, they did not do terrible things to OpenSH. 401 00:30:23,440 --> 00:30:31,240 They, um, added some changes for, um, let's see the key login, the endpoint event logging, uh, PKCS helper and keychain, things like that. 402 00:30:31,240 --> 00:30:33,040 Really straightforward, not terrible at all. 403 00:30:33,040 --> 00:30:35,920 Very happy that they did not destroy OpenSH. 404 00:30:36,080 --> 00:30:38,300 Um, they start looking at Debian and Ubuntu. 405 00:30:38,300 --> 00:30:41,740 They've got about 36 different patches on top of the core OpenSH code. 406 00:30:41,900 --> 00:30:45,260 Uh, and those patches make it libXE utils backdoor compatible. 407 00:30:45,620 --> 00:30:46,940 Um, among other things, right? 408 00:30:46,940 --> 00:30:51,040 But there's a lot of changes and those changes aren't getting the same scrutiny that let's say the rest of OpenSH code is getting. 409 00:30:51,040 --> 00:30:53,100 It's, it's basically linking it to all kinds of other libraries. 410 00:30:53,160 --> 00:30:54,820 It's the reason why it linked to system D. 411 00:30:54,940 --> 00:30:59,580 Um, there's a lot more attack service because of all those changes they put into the, those system patches. 412 00:30:59,840 --> 00:31:02,920 Now moving up to Red Hat, now you're like 60 plus different patches. 413 00:31:02,920 --> 00:31:05,020 So even, even bigger attack service. 414 00:31:05,020 --> 00:31:12,600 And, you know, hopefully they're auditing this stuff and everyone's looking at it because it's important because if you're hacking a Linux server, it's probably going to be either Debian, Ubuntu, or Red Hat based these days, right? 415 00:31:12,600 --> 00:31:15,800 Unless you're like, I use ARC, you know, you know, there's only a few of those out there. 416 00:31:15,920 --> 00:31:25,900 Um, so, um, if you're using, uh, you know, Debian, Ubuntu, Red Hat, Linux, et cetera, um, you probably have a ton of different patches on top of OpenSH that are not pure OpenSH, if you will. 417 00:31:26,060 --> 00:31:27,280 Uh, you may go pretty well. 418 00:31:27,280 --> 00:31:31,240 And then there's a thing called PKIX SSH, which I think probably a lot of folks haven't heard about. 419 00:31:31,240 --> 00:31:36,240 It was forked from OpenSH back in 2002 to support X.509 certificates and then FIPS code. 420 00:31:36,400 --> 00:31:46,480 So because it supports X.509 and FIPS, a lot of the networking vendors decided to use that instead of regular SSH, uh, to build out their products because they want to sell to the federal government and they want to use crusty old crypto protocols. 421 00:31:46,740 --> 00:31:48,520 Um, so there's a thing called PKI SSH. 422 00:31:48,520 --> 00:31:49,580 It forked in 2002. 423 00:31:49,620 --> 00:31:51,760 It mostly, it's almost like they hate each other. 424 00:31:51,760 --> 00:31:54,360 If you do, like, so, put it this way, we diffed all of it. 425 00:31:54,360 --> 00:31:59,580 We looked at, like, OpenSH mainline to every one of these forks and just read every single line of code for days and weeks. 426 00:31:59,580 --> 00:32:00,700 Well, that was my vacation. 427 00:32:00,700 --> 00:32:02,300 I just did that for hours a day. 428 00:32:02,460 --> 00:32:11,440 Um, but PKIX one is really funny because you'll see a change in OpenSH and then a change is written slightly differently in PKIX SSH and they oftentimes disagree. 429 00:32:11,640 --> 00:32:15,080 Like, once in a while they mostly match, like, if one equal this, if that equal that. 430 00:32:15,080 --> 00:32:17,120 But occasionally it's like, if not, one equal this. 431 00:32:17,120 --> 00:32:21,960 And it's like, so, there's probably some weird compatibility bugs because the changes weren't followed entirely. 432 00:32:22,020 --> 00:32:26,100 They obviously don't want to look like they're copying OpenSH, but they also can't not copy it and stay compatible. 433 00:32:26,100 --> 00:32:28,660 So, you can just, you can feel the rage between the two teams there. 434 00:32:28,660 --> 00:32:29,340 It's great. 435 00:32:29,420 --> 00:32:32,660 Um, I've never felt so much, like, animosity in a code diff before. 436 00:32:32,900 --> 00:32:36,220 Um, but finally, the, the really fun one here is Windows. 437 00:32:36,440 --> 00:32:39,700 So, Microsoft Windows, um, shipped OpenSH on Windows 10. 438 00:32:39,700 --> 00:32:41,980 Everyone's like, oh my god, I can actually type SSH and curl. 439 00:32:41,980 --> 00:32:44,580 I don't have to do all these stupid commands anymore to back to my Windows box. 440 00:32:44,580 --> 00:32:48,000 I can use the built-in, I did nice native Linux commands to back to my, my Linux boxes. 441 00:32:48,020 --> 00:32:48,940 And that was great. 442 00:32:48,940 --> 00:32:51,920 So, we love the fact that SSH clients on Windows, we can use them on all kinds of stuff. 443 00:32:52,120 --> 00:32:53,840 Um, there's also SSH server for Windows. 444 00:32:53,840 --> 00:32:59,800 And so, there's a fork for, uh, of OpenSH portable called OpenSH, um, under the PowerShell GitHub repo. 445 00:32:59,980 --> 00:33:01,740 And they just massacred it. 446 00:33:01,740 --> 00:33:03,660 There's like 350 files were changed. 447 00:33:03,660 --> 00:33:04,600 They ripped out everything. 448 00:33:04,600 --> 00:33:09,220 All those secure parts of SSH kind of just got put into the corner over there, uh, and, and deleted. 449 00:33:09,220 --> 00:33:11,460 And then it's like, if Windows do something totally different. 450 00:33:11,480 --> 00:33:12,940 So, they ripped out your support. 451 00:33:12,940 --> 00:33:18,040 They ripped out, um, the PrivSep stuff works totally different through a sub-process versus the fork, because there's no forks on Windows. 452 00:33:18,040 --> 00:33:21,180 Um, they, uh, logged to Windows Event Viewer. 453 00:33:21,180 --> 00:33:24,220 They logged, uh, they sent telemetry back to Microsoft for everything you do. 454 00:33:24,640 --> 00:33:26,900 Um, they still haven't bothered fixing Terrapin. 455 00:33:26,940 --> 00:33:28,780 Like, it just, it's a very different fork. 456 00:33:28,780 --> 00:33:35,340 So, if you're using Windows and SSH, either a client or a server , you probably want to pay attention to this next slide, which is, uh, let's see, this is what it looks like. 457 00:33:35,340 --> 00:33:36,400 Not super exciting. 458 00:33:36,460 --> 00:33:40,400 But, if you start looking through the OpenSH for Windows code, you can start looking at the telemetry callback. 459 00:33:40,400 --> 00:33:44,580 You can't disable this crap, unless you disable telemetry total on your machine. 460 00:33:44,640 --> 00:33:51,480 Every single connection going to your Windows, your SSH server on Windows, is sending your client version and server version back to Microsoft in the telemetry. 461 00:33:51,580 --> 00:33:56,260 So, every time you port scan your system, every time you run a Nessus scan against your Windows server, it's sending that info back. 462 00:33:56,260 --> 00:34:01,540 Every time you SSH directly from your Mac OS client or whatever it is to a Windows server, it's sending your version string back to them. 463 00:34:01,580 --> 00:34:06,560 So, Microsoft knows who you talk to, who knows who you shell into, it collects all those craps for default telemetry. 464 00:34:06,700 --> 00:34:14,920 It even collects telemetry for things that are part of an encrypted session, like things like authentication methods that are negotiated over the secure channel, that's also shipped off to telemetry. 465 00:34:15,120 --> 00:34:20,920 So, uh, you know, I know we're all good, you know, cool kids here and we disable telemetry in VS code, but like, have you done so in OpenSH? 466 00:34:20,920 --> 00:34:21,940 Probably not, right? 467 00:34:22,100 --> 00:34:28,480 Um, so it's worth digging out the diagnostics viewer where you can look at the telemetry data on Windows and seeing like all your SH stuff being shipped off to the cloud. 468 00:34:28,560 --> 00:34:29,880 Um, so, yeah. 469 00:34:30,420 --> 00:34:32,720 But the next thing we'll talk about is even worse. 470 00:34:32,860 --> 00:34:41,220 Uh, so there's this really key function, we talked about OpenSH portal being a, a compatibility layer to make it, um, work not on OpenBSD. 471 00:34:41,360 --> 00:34:44,680 So the pure OpenBSD people, you know, can, can give us their code. 472 00:34:44,860 --> 00:34:49,120 Um, one of the functions that they implemented was timing safe B comp, which is like you expect. 473 00:34:49,120 --> 00:34:55,120 It compares two binary blobs, are these identical, in a way that doesn't change based on how long the strings are, what contents they have. 474 00:34:55,120 --> 00:34:56,780 They, it can be consistent either way. 475 00:34:56,800 --> 00:35:00,960 This is to prevent side channel attacks, it's really clean, really code, it's only like four lines of code. 476 00:35:00,960 --> 00:35:04,520 Maybe take out the return in the int, in the variable, it's only three lines of code. 477 00:35:04,560 --> 00:35:06,500 It's really hard to, to break this, right? 478 00:35:06,500 --> 00:35:10,600 This is a super nice, great piece of code by, uh, you know, Damian, uh, Miller. 479 00:35:10,600 --> 00:35:12,000 It's great, it's perfect, it's beautiful. 480 00:35:12,100 --> 00:35:13,960 And then OpenSH for Windows comes along. 481 00:35:13,960 --> 00:35:15,760 And they made it Windows compatible. 482 00:35:16,860 --> 00:35:29,040 So, uh, Windows compatible means, uh, first they look for a back R and a back N, and they scrub out the back R, and so they said, they allied the fact that there's a back R back N, they treated it as if it was equal to a back N. 483 00:35:29,060 --> 00:35:31,060 But you can probably see there's some problems here. 484 00:35:31,600 --> 00:35:33,580 Um, we'll kind of highlight those real quick. 485 00:35:33,580 --> 00:35:37,120 First off, there's only two lines of code they added, and they introduced a ton of bugs. 486 00:35:37,120 --> 00:35:39,680 It's no longer timing safe, because they look one byte ahead. 487 00:35:39,920 --> 00:35:44,140 It's no longer, uh, secure, because they read one byte out of, out of band memory. 488 00:35:44,140 --> 00:35:48,640 They're actually reading the, the pointer plus one, not the pointer, which could be beyond the end of that particular variable. 489 00:35:48,680 --> 00:35:55,520 So for every back R back N sequence you have in the source buffer called by this function, you're actually going one byte out of the memory buffer and moving forward. 490 00:35:55,740 --> 00:35:59,240 And that, and then that value's being compared for your byte comparison. 491 00:35:59,420 --> 00:36:08,140 So if you know there's a lot of data at the end of your buffer, you can now just tell SH to not compare the bytes you thought you were comparing and now compare the bytes at the end of the buffer, which are typically a bunch of nulls or something more predictable. 492 00:36:08,340 --> 00:36:15,140 So there's a bunch of like really gnarly bugs that happen just because somebody decided their config parser didn't work with this function that wasn't designed to parse configs in the first place. 493 00:36:15,420 --> 00:36:17,240 Um, so it's, it's about as bad as it gets. 494 00:36:17,620 --> 00:36:21,060 So this function's used in every single packet that gets processed by SH. 495 00:36:21,140 --> 00:36:25,500 So every crypto buffer coming into it gets the SH comp or comp buff check on it. 496 00:36:25,620 --> 00:36:28,520 And, and basically it, it gets buggy really quick. 497 00:36:28,740 --> 00:36:30,960 Um, it's used for RSA signature validation, all this stuff. 498 00:36:30,960 --> 00:36:32,820 But the question was like, can we actually exploit it? 499 00:36:32,820 --> 00:36:33,600 And that's where it gets tricky. 500 00:36:33,600 --> 00:36:40,020 It's like the buffer that you can, that triggers the bug is the first buffer, first parameter, and the attacker doesn't control it directly. 501 00:36:40,160 --> 00:36:44,540 But if you do enough signing operations, you know, packets, eventually you get a buffer that has at least one back or back end in it. 502 00:36:44,540 --> 00:36:47,980 If you get to two, you get a little more interesting, but it's been really tough to actually get an exploit out of it. 503 00:36:47,980 --> 00:36:59,160 So of course, when we report to Microsoft, uh, their take is, you know, even though we've got $1 billion annual security budget, we've got 3,500 security professionals, and we backdoor your timing safe B comp code, you do not get a banana. 504 00:36:59,480 --> 00:37:00,560 So, we got nothing. 505 00:37:00,560 --> 00:37:02,220 They said, no, no, you guys don't get anything. 506 00:37:02,220 --> 00:37:02,880 We're not going to fix it. 507 00:37:02,880 --> 00:37:03,360 Have fun. 508 00:37:03,360 --> 00:37:04,960 Like, all right, well, we're going to talk about it at DEF CON. 509 00:37:04,960 --> 00:37:05,640 See you guys. 510 00:37:05,880 --> 00:37:06,680 Uh, so we did. 511 00:37:07,300 --> 00:37:07,800 Cool. 512 00:37:08,100 --> 00:37:10,920 Um, so that's the end of the, most of the content about SH. 513 00:37:10,920 --> 00:37:12,340 We're getting a little close to time. 514 00:37:12,340 --> 00:37:14,000 I want to make sure you have time for a little bit of questions here. 515 00:37:14,200 --> 00:37:16,640 Uh, we're going to talk a little about the shamble tool. 516 00:37:16,640 --> 00:37:19,820 So, uh, this tool is a research tool for SH limitations. 517 00:37:19,820 --> 00:37:26,020 It's a combination of like, a thing you can use today to scan your network, but a thing you can extend to find even more horrible bugs in SH and then share them with the world. 518 00:37:26,020 --> 00:37:31,620 So, uh, we, we'd like you to, uh, play with it, make it better, and, and rain hell upon vendors that do it wrong. 519 00:37:31,760 --> 00:37:46,180 Um, there's a lot of really cool interesting attacks against authentication, off-bypass, null-bytes, uh, ends up when you send a, uh, uh, SH password authentication, there's a, if you send a second parameter in addition to your password, that tells SH server that you want to change your password to that new value. 520 00:37:46,280 --> 00:37:49,940 So, you can imagine that when we're developing this tool, we might have accidentally changed a lot of passwords. 521 00:37:50,160 --> 00:37:52,560 Uh, so, be careful about that part. 522 00:37:52,560 --> 00:37:58,700 Uh, other than that, and it's kind of funny, it's like, oh, I got into all these machines, and then you scan them again, like, now I can't get into all those machines, what happened? 523 00:37:58,700 --> 00:38:00,820 Well, we accidentally sent all the passwords to a null-byte. 524 00:38:01,040 --> 00:38:06,620 Uh, there's also a lot of systems out there that will, uh, accept a null-byte as a password, and specifically a lot of honeypots. 525 00:38:06,620 --> 00:38:10,560 So, we doxed like 5,000 honeypots by accident because they accept null-byte passwords where nothing else does. 526 00:38:10,560 --> 00:38:12,840 It's like, oh, here's all the honeypots, that makes our lives a lot easier. 527 00:38:13,060 --> 00:38:16,300 Uh, a lot of the pre-auth state transition stuff, so you can extend those, make your own. 528 00:38:16,300 --> 00:38:17,000 It's kind of modular. 529 00:38:17,000 --> 00:38:18,980 It's not as cool as menisplate, but it does a lot of stuff like that. 530 00:38:18,980 --> 00:38:20,500 You can kind of add your own checks to register them. 531 00:38:20,860 --> 00:38:22,340 Uh, and then all the post session stuff, too. 532 00:38:22,340 --> 00:38:31,660 If you get a session, but you don't get a shell, you can use shamble to, like , bang on that session, try signals, jam keystrokes into it, generally do all the crap you don't want to do by hand that's really annoying, and eventually, um, do that. 533 00:38:31,660 --> 00:38:33,160 Plus, we added some timing analysis stuff, too. 534 00:38:33,160 --> 00:38:42,200 So, if you think there's, like, timing leak in a username , we've got some built-in functions that'll tell you, like, what's the, what's the statistical probability of this username being different than this other one based on a timing tag with really tight, 535 00:38:42,200 --> 00:38:43,340 uh, timing. 536 00:38:43,360 --> 00:38:47,000 So, shamble.com gets you all that stuff, and there's a whole bunch of stuff it does. 537 00:38:47,000 --> 00:38:50,300 So, I think, first off, I'll hand it to Rob to talk about all the vulnerability checks we do. 538 00:38:50,880 --> 00:39:03,340 So, uh, shamble will actually check for all the vulnerabilities we talked about, uh, over this, and they will not only check for you, it will give you proof, so you can run through, uh, it'll check for TCP forwarding, see if it can forward anywhere, it'll try different, 539 00:39:03,340 --> 00:39:07,760 uh, destinations, see what it can find, see if it's, uh , administratively prohibited for some. 540 00:39:07,940 --> 00:39:17,360 Uh, it will do generic environment injection, so it'll take, uh, environment variables, it'll control execution of processes, and we'll check to see if the output changes and things like that, uh, LD preload, stuff like that. 541 00:39:17,360 --> 00:39:21,900 Super useful, we'll say, oh, this is actually how it's vulnerable, this is what it can do, it'll tell you what to do next. 542 00:39:21,960 --> 00:39:29,700 Um, the software vulnerability that we talked about, it will, uh, it will give you the exact, uh, version and exactly the repo that it used and everything to get into there. 543 00:39:29,860 --> 00:39:40,040 Um, it will check the GOGS thing, that's the, uh, that's the, uh, ENV thing that looks vaguely like a backdoor, um, where it's executing ENV, and it'll try to give you commands, uh, command execution there. 544 00:39:40,460 --> 00:39:52,620 And, uh, it will check the ruckus password escape, that's the one where you can, uh, you can put backticks or, uh, dollar parens in the password, and, uh, it'll just give that to you and it'll say, and the report, you can actually see, uh, in the report, 545 00:39:52,620 --> 00:39:57,340 it'll say, okay, here's what I found, here's the references, and here's the proof, it'll actually give you the output that it found. 546 00:39:57,480 --> 00:40:07,960 Um, and you can just run that, they're automatically, it will automatically detect it, and it will continue, we're continually adding more vulnerabilities here, so, uh, stay tuned and run that on all your systems and tell us what you find. 547 00:40:08,580 --> 00:40:09,440 Well, thanks, Rob. 548 00:40:09,520 --> 00:40:19,760 And even in the last 24 hours since the code's gone live, we've got a lot of great feedback, feature requests, things like that, so we're really excited to keep expanding it, adding things like the, you know, keystroke masher, where it just, like, hits every possible keystroke trying to break out of the shell, 549 00:40:19,760 --> 00:40:25,380 like, the things you usually put your toddler in front of to make them give you shells, like, we'll just do that for you here, so, uh, who needs AI, right? 550 00:40:25,380 --> 00:40:39,020 Um, but in that sense, um, lots of cool stuff's already built in today, uh, to get started, you just run shamblescan-o, it generates a gigantic JSON file, um, if you run this across the whole internet, you get about 60 gigs of data, I don't know why I know that, 551 00:40:39,020 --> 00:40:48,640 but it's a lot of fun and you have millions of shells to go play with, uh, and then you can run the analyze command, it'll try to, like, bucket your results based on what cool things you found, so if it, if it's, like, a known backdoor, a known, uh, bug, 552 00:40:48,640 --> 00:40:51,260 it'll hopefully stick into its own little file and you can track them that way. 553 00:40:51,280 --> 00:41:00,940 We also report, like, vulnerabilities in the JSON, you can scrape out and import, uh, of course all this stuff's been, a lot of this has been linked into the run zero tool that we work on at, at our day job, and so it does a lot of these checks for you automatically, 554 00:41:00,940 --> 00:41:02,780 including grabbing all your keys, stuff like that. 555 00:41:02,800 --> 00:41:13,880 We're also looking at integrating it with, uh, honobox, a bad keys project to automatically identify host keys that have been compromised, and shambles is unique in that it's one of the very few tools that test all of your host keys, not just your first host key. 556 00:41:14,000 --> 00:41:22,900 So if your machine has an RSA key, an ECDSA, an ED25519, et cetera, we'll actually grab all the different host keys by grabbing them all and then test all those keys for weak keys and, uh, things like that. 557 00:41:22,900 --> 00:41:26,380 So we're still a little bit early for the bad key stuff, but we're, we're making progress. 558 00:41:26,580 --> 00:41:35,580 Uh, so an example, one of the neat things about shamble is that you can tell it to get into that larval session state without actually opening the process, which is a pain in the butt to do otherwise with the message client. 559 00:41:35,780 --> 00:41:39,700 So essentially you say, um, you know, shamble scan dash dash interact equal first. 560 00:41:39,700 --> 00:41:43,020 So interact with the first session you get and the interact auto equal nothing. 561 00:41:43,020 --> 00:41:46,920 Do not do any, do not do anything at all and just drop you straight to the interpreter shell instead. 562 00:41:47,000 --> 00:41:49,980 And then from that interpreter shell, you can like set any environment variables you want. 563 00:41:49,980 --> 00:41:52,580 LD debug equal all, LD preload, whatever you like. 564 00:41:52,600 --> 00:41:55,400 Uh, you can start sending signals to it even pre shell. 565 00:41:55,440 --> 00:42:00,100 And then when you want to drop a shell, you either type exec to run a command or you can do shell to get interactive shell. 566 00:42:00,100 --> 00:42:01,860 And at that point you can then mess with the shell itself. 567 00:42:01,860 --> 00:42:07,400 So it gives you kind of all the tools you need to manually mess with it and control E is how you open the shamble shell, uh, from the prompt there. 568 00:42:07,400 --> 00:42:09,420 Just so we don't conflict with SSH escape codes. 569 00:42:09,540 --> 00:42:12,740 And there's a million other things we can talk about, but we're going to keep kind of hammering on the code a little bit. 570 00:42:12,740 --> 00:42:14,600 And of course, happy scanning. 571 00:42:14,640 --> 00:42:18,340 And, uh, here's us just throwing out a slash 24 real quick, but it is pretty fast too. 572 00:42:18,340 --> 00:42:21,900 It'll just, it'll eat all your CPU and RAM just grinding away all your things. 573 00:42:22,200 --> 00:42:24,380 Um, and yeah, here's a bunch of bones we found. 574 00:42:24,420 --> 00:42:24,940 Thanks. 575 00:42:26,460 --> 00:42:28,880 We've got a couple of minutes, I think for questions, looks like. 576 00:42:29,100 --> 00:42:34,540 Uh, if you have a question, please come up to the middle standy thing and the mic so that everyone else can hear you 577 00:42:46,950 --> 00:42:46,990 . 578 00:42:48,850 --> 00:42:51,510 Um, the mic may not be on, I'm not sure. 579 00:42:51,810 --> 00:42:52,630 You want to grab this one instead? 580 00:42:52,630 --> 00:42:53,090 Yeah. 581 00:42:56,810 --> 00:42:57,730 Oh, sorry. 582 00:42:57,730 --> 00:42:58,510 You're still on mic. 583 00:42:59,270 --> 00:42:59,810 All right. 584 00:42:59,810 --> 00:43:06,870 So out of all the implementations that you have, that you've scanned, what is in your opinion, the most secure? 585 00:43:08,090 --> 00:43:10,490 Uh, the most seeker or the most insecure? 586 00:43:10,610 --> 00:43:11,830 The most secure. 587 00:43:11,830 --> 00:43:12,250 Okay. 588 00:43:12,250 --> 00:43:12,550 Yeah. 589 00:43:12,550 --> 00:43:18,770 The, yeah, two, you know, the, the TLDR of this entire talk is just use openness H98P1 and don't do anything else. 590 00:43:18,770 --> 00:43:20,130 Just don't roll your own. 591 00:43:20,130 --> 00:43:21,030 That's basically all you found. 592 00:43:21,030 --> 00:43:21,930 Just like any other crypto. 593 00:43:21,930 --> 00:43:23,610 Anytime you try to mess with it, you break it. 594 00:43:24,390 --> 00:43:25,110 Oh, thank you. 595 00:43:25,890 --> 00:43:27,190 Uh, any other questions? 596 00:43:29,190 --> 00:43:31,090 Does anybody recognize my shirt? 597 00:43:31,090 --> 00:43:33,210 It's, it's particularly nerdy. 598 00:43:34,710 --> 00:43:36,230 I'll be your friend if you know. 599 00:43:36,230 --> 00:43:37,010 Okay. 600 00:43:39,650 --> 00:43:40,370 Anybody? 601 00:43:40,710 --> 00:43:41,830 One more question? 602 00:43:42,250 --> 00:43:42,670 Yes. 603 00:43:42,670 --> 00:43:44,710 Did you guys try anything with Putty? 604 00:43:45,350 --> 00:43:48,070 Putty, P-U-T-T-Y client? 605 00:43:49,210 --> 00:43:49,890 Sorry. 606 00:43:49,890 --> 00:43:50,330 Yeah. 607 00:43:50,470 --> 00:43:57,470 It's a TTY client for windows called Putty SSH. 608 00:43:57,490 --> 00:43:57,670 Yeah. 609 00:43:57,670 --> 00:43:59,670 We didn't look at the code for it, but it's mostly client side. 610 00:43:59,670 --> 00:44:01,990 We really focused on all the, just the server side of invitations. 611 00:44:02,090 --> 00:44:03,990 I know Putty does a bunch of weird things with the keys. 612 00:44:03,990 --> 00:44:08,370 Like it has a weird preferences in which E-D-S-A keys uses, but we didn't get the chance to test Putty itself. 613 00:44:08,810 --> 00:44:13,810 There, there was an interesting, uh, not volume per se, but there was an interesting, uh, key generation issue with Putty this year. 614 00:44:13,810 --> 00:44:14,870 I need to go back and look at that. 615 00:44:14,870 --> 00:44:14,930 Yeah. 616 00:44:14,930 --> 00:44:15,150 Sorry. 617 00:44:15,150 --> 00:44:15,890 Another question? 618 00:44:15,930 --> 00:44:17,770 Does Shamble detects honeypots? 619 00:44:17,770 --> 00:44:20,210 Like how do you guys are detecting honeypots? 620 00:44:20,210 --> 00:44:24,370 And like, how Shamble detects honeypots? 621 00:44:28,130 --> 00:44:28,770 Okay. 622 00:44:29,370 --> 00:44:29,570 Yeah. 623 00:44:29,570 --> 00:44:33,910 So the short version is you, it just makes the TCP connection to whatever port and range you tell it to. 624 00:44:33,910 --> 00:44:36,190 And then it looks for that stage version, does the handshake, all that. 625 00:44:36,190 --> 00:44:37,850 So , um, that's about it. 626 00:44:37,850 --> 00:44:38,890 Unless I missed your question. 627 00:44:39,450 --> 00:44:41,510 How is it detecting honeypots? 628 00:44:41,530 --> 00:44:42,590 Oh, honeypots. 629 00:44:42,650 --> 00:44:43,030 Yeah. 630 00:44:43,030 --> 00:44:51,230 Um, so the funny thing is most honeypots, uh, have a bug where they accept a null-byte password and they just drop and they accept that where a real machine will never accept the null-byte password. 631 00:44:51,310 --> 00:44:56,390 So in a, in a, in an open-stage implementation, by default, if you put a null into the password field, it'll kick you back out. 632 00:44:56,490 --> 00:44:59,410 But most honeypots will accept you with a null-byte password. 633 00:44:59,410 --> 00:45:01,350 And that's an easy way to find like 5,000 of them. 634 00:45:01,350 --> 00:45:05,910 Um, we found a bunch of other ones through, uh, some of them accept any public key, no matter what key you give it. 635 00:45:05,910 --> 00:45:11,090 Other ones will take, uh, passwords that are, uh, outside the spec otherwise or m-mangled password requests. 636 00:45:11,150 --> 00:45:12,770 So you just throw a garbage item and it accepts it. 637 00:45:12,770 --> 00:45:14,270 You know it's not open-stage. 638 00:45:15,990 --> 00:45:16,630 Cool. 639 00:45:16,690 --> 00:45:16,950 All right. 640 00:45:16,950 --> 00:45:17,470 And that's it. 641 00:45:17,470 --> 00:45:18,270 Thank you very much. 642 00:45:18,290 --> 00:45:19,010 Thanks everybody. 643 00:45:19,310 --> 00:45:20,510 Look for us if you have any questions. 644 00:45:20,510 --> 00:45:21,490 We're happy to talk to y'all.