Hello everyone. For our last talk of the day, we have Anthony Kava, who is a lifelong hacker and works for the sheriff office in Iowa, doing digital forensics, investigating the geekier aspects of crime and fighting with vendors, convince them to improve security of their products. And one, another thing that seems interesting, is that he has no police powers in Nevada, so no problems. He's going to talk about how bad could it be inside law enforcement and local government APSEC. Give him a round of applause please. Alright, I think this is working. Good afternoon. Thank you for choosing this, or maybe there were no other seats available at other ones, that's cool too. I'll take it either way. Let's get, you can see all that right? Good. In a step I probably should have taken earlier, we didn't test the audio. Don't worry about that. It was supposed to be the final countdown, so if anyone could sing that, or at least... Oh, right, there might be an audio plug. We won't worry, we won't worry about that. It'll be alright, probably. Alright, so you saw in the front slide, you've got my name and my handle Carver, so that's kind of a self-dox, you know who I am now. I've got my picture on here too, I look like this. The most important thing I want to stress as we begin this, is that I am off-duty at this time. It's actually 1800 back where I am, I'm off-duty, so... Yeah, hang on. Oh, in order to make it official though, I'm going to do something real quick. Let's see if we can point this out. County 7875, 10-42. I don't know if you heard that or not. I had to get a dispatcher to do that, so I feel like I have to play it even if I screwed up the audio here. I'm off-duty, I have effective limits on my freedom of speech. So we'll try to stay within those, because I happen to love my job and my employer, especially since this is recorded. Here's the disclaimer, these are my views, they don't belong to my employer or anyone else. I'm not going to BS you, I will tell you the truth even if it hurts me or anyone else. Please don't get me fired or sued. That's my request. Full disclosure, in the interest of full disclosure, since there will be a lot of disclosure here, this talk, or a version of it, was rejected by Black Hat, and DefCon, and RomCon. So, you know what you're getting. This slide is just as a reminder to myself, if you're familiar with the lyrics of Drake, it's because I need a picture for our local paper. So I don't know, are you taking still photos during this or anything? If not, if you take one and send it to my, send me that on Twitter, I can send it to my paper and then that'll make them happy. And they're 500 readers. Oh, they'll see that recording too. I really like the idea, the theme this year versus last year. Last year was kind of a downer. This year it's technology's promise. And I kind of, I guess, tried to imbibe that theme over the last six months. I've listened to nothing but Kraftwerk. And, you know, I've been to Vegas a few times. I want to remind you, stay hydrated. This is my safety slide. This is my fourth DefCon. So we already had the poll question earlier. I went to 13, 14. I took 12 years off. Came here last year. And I'm just really thankful to be part of the inaugural AppSec village. This is kind of amazing. I thought it was a joke when I got the acceptance email. So I had to check the headers and all that. Here's our agenda. You're experiencing the intro right now. We're going to get into the things you see here. Let's get into them. I usually have a lot of detours and tangents in my talks. I can't do that because they're going to flash signs at me and tell me I have to get off. So I'll be careful about that. Again, full disclosure, I'll tell you, I work in law enforcement and I'm a hacker. I am a hacker and I carry a badge. And so I know that there are some of you who probably subscribe to our gatekeeping that will say that's impossible. You can't be a hacker and a cop. Or you can't be a cop who's a hacker. And I say, well, I think you can. And we already made it clear, I don't have any police powers here in Nevada, so do what you need to do. The idea for this talk kind of came to me last year. I was at the loft panel, I was listening to them, and they were talking about ways that we can engage with the government and engage with authorities, which is kind of like, you know, that's a big difference after missing DEF CON for a dozen years. It felt a little bit different to hear that. I've got a quote up here from Space Rogue and I won't read it to you verbatim, but the idea is he was calling you to get involved in the legislative process, talk to your lawmakers at the state level, at the federal level, and try to give them the hacker's perspective on some of these things that they're enacting. I think that was important work. At DC21, and I wasn't there, but I saw it on YouTube, Mudge actually spoke about being a hacker in the federal government and had some experiences there. And he quoted this tweet that was sent to him. He kind of tweeted asking the Twitterverse about whether I should do this talk or not. And I thought this was great. I think communication, understanding, this is going to join communities together. You can join hacking and law enforcement together. I think it's possible. It's going to be a heck of a struggle. But I think we can do it. For those of you who don't know who Mudge is, this is a recent photo. I thought that would get more laughs. Did you not see this on Twitter? In any case, he's not actually at Thunderdown ARPA over at the Excalibur. I'm going to give you some reasons to hate me so we can get him out of the way. I do work in law enforcement. It's been established. Yeah, this is a bit cyberpunk for this year's theme, so I have an alternate version. How many of you in here work in law enforcement? Is there anyone in here? All right, you. Oh, wonderful. This is amazing. How many of you work in UC? No? You cowards. You can tell by the cruddy facial hair because they haven't had a lot of practice with it. If you do work in law enforcement, or you're somebody who wants, who's interested in the dialogue with law enforcement, there's a website, hackers.blue, go there. There's a form you can fill out. I'm trying to get people talking to each other. If you're interested in that, go for it. If you're not, ignore. And this slide is because there are literally dozens of us here. And so I'm going to talk a little bit more about that stuff on Sunday at Sky Talks. I'm a Perlmonger. I have been for years. I know that's an old person's language. You're developers in here, right? I mean, everybody knows PCRE, but you don't actually do Perl, I hope. I hold some of those certifications that you hate. I've actually been on Dateline once. It's my claim to fame, I guess. But Dateline has a weird relationship with DEF CON, as you know. I did not try to infiltrate DEF CON. I'm here, you know. I also didn't realize that the guy interviewing me is the popcorn meme guy. So I wasn't star struck. I'm not a Fed asterisk. I do work federal cases. And the coolest part of federal testimony I've ever given was this one where I was on the stand being cross-examined. And the defense attorney started saying, Deputy Cava, you're an expert in pornography. And before he could finish his question, I just said, thank you. Because then it goes in the transcript. And now it's on my CV. So you know where I'm coming from. I'm not going to get super political here come Sunday. But I'm not going to get super political here, but I am firmly against cryptographic back doors. I would love it if I could dump every phone that I get in the lab, but I don't want to give up our privacies for that. I also don't think this should be a political statement, but all people deserve to feel safe, to be fed, to be taken care of. So that's where I'm coming from in this. I'm trying to convince you I'm not a jerk, but we'll see. I work for a county sheriff. So I work for a sheriff's office in a certain state. Not shown here, it's redacted. In that state, I'm part of the Internet Crimes Against Children Task Force. We'll have to redact that part. And so when I go and talk to kids at schools, I tell them that we go after people who go after bad guys on the Internet. I go after kids. So we're the good guys. Sneakers reference for those of you of a certain age. So anyway, I spent, in our county's IT department, I spent about 15 years working in the IT department. I did some security type stuff there towards the last half of that. And then the last eight years of that, I moonlighted as a special deputy. It's a reserve deputy in our sheriff's office. So for a dollar a year, in addition to my day job, I did digital forensics. And then for the last two years, I've done that full time as my day job. And then I go out and do some special deputy stuff on the side. Yeah, I redacted the county, but even the most cursory Internet search. This isn't the S.E. Village. I still do a little bit of light IT work. Digital forensics, though, is my day job. I've dumped a lot of Nexus phones. I do not retire replicants. So this is all introductory because I feel like it's, there is a natural animosity between the hacking community and law enforcement community, sometimes for good reason. And I'm hoping that we can get past that because I think that we can be the same community, or some of us are thinking that way anyway. It'll take some winning over of the others. But we're really not that different, you and I. We have a lot in common. I think first game console was an Atari 2600. I started out with Commodore 64, Apple II. My first computer that I could actually call my own was a PC Junior. And if you haven't heard of that, it's crap. I ended up with three of them a few years ago, and I gave two of them to a local high school, and it's in their computer lab now. And the first thing we hooked up, the kids asked, where's the mouse? And the third one went to Foon. So if you are into retro computing stuff, this is my Friday follow. Follow Foon on the Twitter. Yeah, so this kid spent a lot of time on computers, probably wasted. This kid, this is how bad security was back in the 80s and 90s, like late 80s, early 90s, is that this kid got rude on a lot of stuff. Spent a lot of time on bulletin board systems, read anarchist text files. Aren't they all? The Jolly Rogers cookbook was the knockoff anarchist's cookbook, and all that I had available to me. Ended up on some bulletin boards, underground ones, the ones where there's a door game that looks like a door game, but it's actually taken to the real bulletin board, until I got busted because I didn't realize how phone traces worked, and resulted in a ban for a couple of years. Then I got my first paper out so that I could buy a 486 so I could run Cracker Jack, crack hashes. Spent more time doing LAN parties than doing homework, which explains why I barely graduated. And all that led to the ability to do the job that I love today. So I think now that we've got the common ground laid out here, there's only 10 minutes left, right? I want to give you some of the commonalities, some of the general principles in local.gov appsec. That's my fun name for local government until somebody actually registers the domain, then I'll screw that up. Your local governments, everybody's got one, right? You live in a city or a town or a county somewhere, and they vary in size. So you've got the small ones, a population of like 1,000 people or 500 or something like that. You've got big ones at Los Angeles County, you've got populations of millions. And so the thing is that the smallest organizations, they can get by on Excel spreadsheets and access databases for their information systems, sometimes pen and paper, even today. And the largest ones, they're true enterprises. So they might have something developed in-house or they've got some really expensive thing. And there's people stuck in the middle. My county's stuck in the middle. We're a population of 90,000. And so we're too big to get by on Excel spreadsheets. Not that you should do that anyway. But we're too small to use the really cool enterprise stuff. We can't afford it. So you end up in this weird... you get this niche software that's made just for these size organizations. And the problem is there's not a lot of incentive on the vendors to look at application security. By the way, imposter syndrome, I don't actually know what AppSec means. I'm talking about vulnerabilities in applications. Does that qualify? You're the professionals? Okay, you're gonna let it go? All right, good. The rest of this will be... anyway. Midsize governments, the applications don't get looked at because it's not like it's Microsoft Office where there's thousands and thousands of installs out there and there's people actively looking for it. And there's bug bounty programs or whatever else. There's none of that. People don't look at what's under the hood. A lot of these governments, even if they have an IT department, they don't have a security function. There's no one there that's looking into security actively. And in our state, we're lucky. Our state actually will come in and give you an IDS and will come in and do vulnerability scanning for you and stuff like that. They'll help you out if you ask. But the problem is that the places that are lucky enough to have IT, that's great. Some places their IT person is like there's an auditor's clerk who happens to have a copy of Norton Utilities. And so... true story. And so that person ends up being your IT person, being your go-to person. And that person is also, at the same time, trying to run elections and finances and real estate stuff. And in their spare time, they try to hold off nation-state actors. So it's a losing battle. All these organizations need help and need advice with technology because they don't have the internal resources for it. And the reality is that a lot of the advice that they do get is going to come from vendors. Does anyone here sell stuff for a living? Okay. In one way or another... man, I didn't... this isn't ethics or philosophy, is it? But yeah, you're right. In one way or another... but the vendors that are giving a sales pitch oftentimes recommend a product. Sometimes it's their own. That's where they get most of their advice. And that can be kind of a trap. So in terms of the technology's promise, imagine if citizens were providing that kind of advice. Just food for thought. And here's another one. And I'll answer this, I guess, for you in a minute. How many vulnerabilities could you find if you were looking for them in your local government software if you spent like a day or two with it? Just looked at the cursory stuff. We're gonna find out. So I'm not a professional at this. And it's not even a major part of my job. So the things I'll show you, if I could do them, then anybody could find it. But I want to go over why this is important. You paid for it. Your tax dollars paid for all the software. They pay for the services. They pay for these things. If there is a ransomware infection or some other problem with the system, your tax dollars will also pay for the fix for that. They're gonna pay for the ransom. They're gonna pay for the incident response. Yeah. These are systems that handle things like 911 calls, dispatching firefighters and medics and police to emergencies. This is life and death stuff. They also record the worst days of people's lives. I mean, this is where a police report goes that's gonna have a narrative that describes bad stuff that happens. People call 911. It's not usually just to say hello. It's because something's going on. And if you think about it, there's crime scene photos, all sorts of stuff that you wouldn't want it to get out. It doesn't need to be on pastebin. And I know that those of you who read those anarchist text files might consider that blowing all that up would be kind of cool because then you can't prosecute people. But you know, you would throw out the good with the bad. And there are people that actually really need prison. So anyway, I think this is important stuff to watch. Every vendor that you work with in this space, and probably all spaces, they tell us that we need to have a secure environment. And what that is code for is that like, hey, we didn't do anything with security on this. So you better be watching everything for us. If they have cryptography, it's going to be zero to bad somewhere in there. There's a lot of hard coded credentials. There's a client-side enforcement of privileges, stuff like that. And client-side vulnerabilities are not considered to be a problem because, well, as we know, in 2019, all attacks are straight at the firewall towards the internet. Everything's, you know, a direct attack. There's no phishing, anything like that. The thing is that they tell you that if an attacker got to your client, and I've heard this from multiple people, that that's your fault. You didn't, your client got, you know, somebody's on there and now they're looking at our software and they find the hole. Well, it's your fault for letting them on there. So no reason to secure the application. Who's in charge of security? There are some places when we ask, they say, we can't tell you. Like it's some sort of secret. It's a trade secret. We can't tell you who's in charge of security. I'll get into that. And yeah, we take security seriously. If I took a drink every time, I wouldn't have made it to the talk today. Let's talk about the dangers. So we've already kind of established these local governments. If you've got one IT person, if you've got one IT person, no IT person, they can't look under the hood. They just don't have the capabilities, don't have the skill set, they don't have the resources to do it, even if they want to. They're too small. Yeah, and a lot of these places are lucky to even have an IT person. So we need people that can and will look under the hood. And I'll give you some particular cases to try to show that. I've redacted the names because I love my job. And I love not being sued. These vulnerabilities have all been reported one to five years ago. So some of these are pretty ancient. They've either been addressed, notice it doesn't say fixed, it says addressed. Either addressed, sometimes they decided we should accept the risk, they just tell us that. But they've either been addressed or the products have been retired, assume that. Yeah, how bad could it be? Oh, and by the way, this is what I was getting at. I'm not an AppSec professional. I had to look it up on Wikipedia to know what it was before I put the CFP in. But I did this in my spare time. For the last, I guess, 17 years, I've worked on a salary, so I get to work as many hours as I want. And so after I... So after I've done all the stuff that's supposed to be my primary part of my job, this is where I was like, I'd really like to know what the heck is going on on these things and started looking into them. So if you did this as a job, imagine what you'd find. I didn't do any real reverse engineering. A, because I'm not smart enough. B, because it might violate our EULAs. And I didn't want to do that because I'm a good student, I love my job. And the people of my county. So the tools I used were really advanced stuff like Strings, Grep, some Perl, obviously. I spied on some API calls, which I think is okay. I used Wireshark and Burp Suite and looked at some traffic, but didn't do any real reverse engineering stuff. So now part three, a tale of three vendors. Notice the Triforce. Start off with Vendor A. Vendor A sells a suite of software to local governments and it runs all sorts of stuff. It'll do your finances, so your accounts payable, accounts receivable, your direct deposit for banking, human resources stuff, payroll, your real estate taxes, all that stuff's in there. And they will sell you law enforcement management stuff too, so your records and everything else. So when we start looking at this, the immediate things that pop out are the SQL creds that are baked into the client install. So there's an XML, there's an XML config file and it has a username and password for SQL. The password is not plain text, the password is encrypted, but to use it, it's got to be reversible encryption, right? And it turns out that the username, well the password is a leet speak version of the username, so you could probably pretty well guess it. And it has SA on the SQL server. So every client that's installed includes a free login to your SQL server with SA. And this is the bonus part, it's the same at every customer site. I verified this, I was a little bit afraid to do it, but I slacked somebody at a different county and I said, hey, just real quick, do you think your password is this? And they said, holy crap. That wasn't me, that was the computer. The API traffic, this thing has a client server infrastructure, which is more than I can say for some of these apps. It's also had authentication tokens. When you log in, you get a token that never expires. I can't say never, but I tried it for weeks. So six weeks later, that auth token still worked. Another nice thing is that there's rules-based permissions, but they're not enforced at the API level, they're only enforced at the client. So if you get that token, which is sent in the clear, you can reuse it for weeks and weeks, maybe years, and do anything you want on the system. So I can get into that system and I can go look at my payroll and see what my pay stub is going to look like, but once I get the token, I can look at everyone's payroll and maybe pull their bank account numbers. That's a problem. But wait, there's more. What about their payroll website? So this company also hosts a payroll website where you can turn in your time sheet, an internet-facing website, and there's an API that connects between your local app server and their website. And that API traffic, when I went to go look at it, turned out to be in the clear, they were doing HTTP and XML that was not encrypted. It has all sorts of PII in there, and I'll tell you a little bit more about that in a second. And it was that way for weeks. Now what happened was when we first implemented it, I did check, and it was HTTPS, and you know, I felt okay about that. And then when I went to check back on it to look at the API traffic, I thought I'd have to intercept it, I didn't. I mean, I thought I'd have to man in the middle of it, but in any case, they turned it off for debugging. They were debugging one site, and they turned it off for every customer, as far as I can tell. And forgot to turn it back on. And so I brought it to their attention, and they did turn it back on. Also there's cross-site scripting, because there's like announcements in there. I can go put an announcement in for all employees when you log into your time sheet, and it was vulnerable to cross-site scripting. They said those aren't security vulnerabilities, even though it pops up when you log in. So I made some requests that this particular vendor asked them, would you please tell customers about that time when their stuff was not encrypted, and I think they deserve to know. And I got, that's a locus, but it's supposed to be a grasshopper. That was what I heard, grasshoppers after that. Or sorry, crickets, crickets. I also asked them if they would stop using Google Analytics in the inside of this website. I don't know, does this feel weird to you? I need a professional opinion, but when you log into this payroll thing, the internal parts of Google Analytics, so they're bringing in JavaScript from an outside site. It's Google, and you can trust Google. But they said no, because they use it to decide what pages you're looking at, and I thought, couldn't you parse the logs or do something that didn't require that? But anyway, I didn't get any motion on that. They did have our social security numbers on there, and dates of birth. So when you log into your time sheet, you can also click a little button that says profile, and it'll show me my full name, my home address, my emergency contact, my date of birth, my social security number, my ethnicity, my race. It's like, I don't know what they didn't have on there. And we asked, could we please at least get the social security number, full social security number, by the way, not just last four. And at first they said, eh, some people like it, so no. And then eventually they gave us a little checkbox so we could say, no, we don't want to show that. So we suppressed that, but they didn't let us take off the date of birth and all the other stuff. My argument was that if I don't know my date of birth, I don't go to the website to check it. We brought that thing about the hard-coded login that's the same everywhere with an SA account. We asked them to change that, and they did change that. They revamped their software updater, their client updater, and they pushed out a big update to every site that broke some of them, and I told them that's my fault. And they changed the passwords at every site for this account, and they took away SA. The account still exists and still does some stuff that I guess they needed to do. They need to re-architect the whole thing to get rid of it. But at least it's not SA, at least the password is different at different sites. The payroll website with the timesheets did not support password complexity, expiry, or lockouts. And when they come out to your place and they set you up, they give you four digit pins. And without lockouts, if you can guess my first initial last name, you can try 10,000 combinations and you'll get into my payroll account. So that's cool too. With all my social security number and all that stuff. The last thing I ask, and this is the biggest ask, is put somebody in charge of security and audit your stuff. And believe it or not, this story, Vendor A, has a happy ending. This is the timeline for this story. I first reported the vulnerabilities back in March of 2014. And I gave them, here's what I have so far, and I think there's going to be more. And they said, okay, we'll look into it, it doesn't sound very serious. And they said, why don't you just give us a list of every vulnerability you find? Why don't you do a free audit of our software? And so I did, in a time frame that worked for me, which was about a year. And I didn't do it on purpose, I really wanted to get it done quicker, but about a year. So July of 2015 is when I came back to them and said, here's a list of like two dozen things. And some of them are really bad. And they, again, weren't super excited about it. What I thought was funny is I went back to my emails to look at this to see what happened, but I sent that, they weren't super excited about it, and then a month later I started getting automated emails from them telling me to do Microsoft patches as new CVEs were released and stuff. So I thought they were taunting me. And then a year goes on, every few months I'm pestering them, I'm trying to go up the chain, I'm going to LinkedIn and looking up the boss of the boss of the boss. And I'm reaching out to anybody I can, and I didn't think anything was really going to happen at that point, we weren't getting a lot of traction. Until a month later, August 2016, this was great, we found the one person in their organization, this is a big company, Fortune, whatever, one person that cared about the software and the security of it. And they weren't even in that side of it, they were in the operations IT side running this website, and they started looking at all these things, and they started actually doing stuff with it, and they were able to get an actual audit started a few months later. So by December 2016, still two and a half years after the initial reports, they started auditing their stuff. They even found vulnerabilities I couldn't find because they got access to the source code and the logs and everything. And then the real happy ending to this is that the next year, that one person who cared, Paul Harvey voice, was promoted into their first security position auditing this stuff regularly. And so, good outcome. It took three years, but good outcome. A lot of these things were fixed, and they put somebody in charge who will actually make sure that they don't happen again in the future. That's a good story. Let's do some other stories. How am I on time? I think I'm okay. I don't. Oh, all right. We're going to speed up. I drank a lot of coffee, so we should be good. Vendor B, they do a 911 dispatch system. It's called CAD, computer aided dispatch. It's where you take your 911 calls, you send out police, firefighters, medics, that sort of thing, records management, jail management, all your inmate information, including medical information, and mobile CAD stuff and communications. So that's in your car, you've got this computer in there, usually a Passock Toughbook they've cloned at the market. But anyway, that thing interfaces with the CAD system where your dispatchers are. I'd say it's 90% serverless, way ahead of its time since the 90s, because they didn't do a client-server architecture. All the clients do direct SQL, direct SQL, and every user has to have a SQL account. This was a management nightmare. We already gave them AD accounts, why do we also have to have a SQL user for them, local SQL user? But we did, and each one of those SQL users gets DBO on all their stuff. Database owner can delete everything, whatever. So if you use the GUI, it doesn't let you do stuff you're not supposed to do. But if you open up Microsoft Access and make an ODBC connection, you can do whatever the hell you want. They have one component in this suite that has its own users table, it doesn't rely on the SQL users, and of that particular component is a web-based records management interface. It's for you to go log in, they said put it on the internet, we did not put it on the internet. And they said you have your people log in, you can look at reports, you can look at in-main information, all that stuff, it's really cool. Plain text passwords, we complained about that, they upgraded to XOR. Trivial SQL injection, I mean like single quote or one and you're in to bypass the authentication on this thing. Cross-site scripting is not a vulnerability, we know that. Bonus, ampersands break your system. So because they were displaying it in HTML, if you put an ampersand in a record field, it broke the display on the page. So I did write a Perl script that every five minutes checked for ampersands and changed them to the word AND. True story. Their mobile CAD software in the cars, it goes over a radio network so you want it to be secured, right? So they said don't worry about VPN, we rolled our own crypto. So we used OpenVPN on top of theirs. Their crypto is based on 64 bit blocks, I know that much. And there's some questionable padding stuff going on, I'll tell you a little more about that in the next slide, because they also use it for passwords. And here's what's interesting about, I mean it's all interesting to me anyway, but the key that they use for this mobile communication is hard-coded in the install. I shouldn't say hard-coded, you can change it, but most people don't. And so we asked to change it and it was a big pain in the neck to hit every client after the deployment to do this, but we changed ours. And I know they have hundreds of other customers that did not, so if you know the password that comes with the client installer, you can read all their traffic. So the passwords for the mobile login, they're stored with this reversible encryption, not hashed. And it's based on 64 bit blocks, which you know, 8 characters. So if you, and they give you up to 12 for a password. I think they did VARCHAR12 back in the 90s and they just stuck with it for 20 years. But anyway, if your password's longer than 8 characters, the last 4 characters are in plain text. It's padded with spaces, but those are plain text too. So we wanted help, we wanted a tool, this is related to this, we wanted a tool in our IT department so that our IT people could go to an intranet page and reset passwords, unlock accounts in the system, but we didn't know how the encryption worked. So I went to them and I said, well, you should know, this thing has a console application that stays up all the time. We had to lock the screen and use VNC to get to this thing. And that's how you set passwords. And so we went to them and said, hey, could you give us something to help us make this intranet feature? They just updated their password expiry feature and all of our users' passwords expired the same day. So that first 90-day cycle, 3 shifts, law enforcement usually works 24 hours, they're supposed to, 3 shifts of lockouts and on-call IT stuff. So wanted to give our guys something, guys and gals, something to change those. I asked the vendor, can we get a recipe? Just tell us, how does encryption work? What's the cipher mode? Give us the parameters, we'll do it ourselves. Or give us a little bit of code. I know they aren't going to do that, but give us a little bit of code, we'll redevelop it. Or give us a tool, a command line tool that we can use. That would work. They said, okay, we can't do the first two. We can develop the tool. We're doing a feasibility study now. We're going to have a project manager assigned. Estimate 6 months development, $10,000, give or take, probably give. So I got to thinking, I looked at it, they have a DLL that does all this stuff, right? So what would it cost is $10,000 or about $1,000 per line of Python. We can do it in a dozen lines of Python and just use their DLL. I still to this day don't know how their encryption works, but I don't need to because I'll just use their library to do it. And you can see the hard-coded key up there with the B. I obfuscated some of the other stuff, but that's the actual key. Good news is they retired this product. This is a football reference. I'm not a sports person, but I understand this guy's retired. Vendor C, our final vendor, does the same kind of stuff. I own dispatch, mobile, everything. We were shopping for vendors and I asked the sales engineer dude, I said, how are the creds stored? And he said, we're not dumb, but he said it a different, more demeaning way. I thought it was terrible. But then I went to look because I thought, okay, let's see what they do. Unsalted MD5 hashes in 20-something. At least they could do Active Directory, right? So we don't have to worry too much about that. Oops. We turned on Active Directory. They said, okay, Active Directory is now enabled. Log in with your AD accounts. And I didn't. But I did ask our IT department. At this point, I didn't work in our IT department anymore, so I couldn't do the Wireshark stuff myself. So I said, could you guys look at the LDAP traffic and just make sure that they encrypted that? And sure enough, it was not. They forgot the S in LDAPs. So plain text passwords going across. Our IT department did better disclosure on some of these vendors because I said, hey, could you go look at the logs and see which users have logged in since they turned this on and let them know to change their password? And they did. So AD works. And that mitigates some of the problems. Once you put the S in LDAPs, at least it's encrypted on the wire. But for some reason, they started storing our passwords in MD5 hashes anyway. I went and looked at the database after that, and I found mine in there, and I started cracking some of them, and I found something in common. They were all lower case. I'm like, what the heck's happening here? My password's mixed case. It has to be for the AD rules, but it's stored in this hash that's all lower case. Well, it turns out they're doing std lower, MD5, no salt, and throwing it in the database. This dog looks so sad, so I actually, I got a happier dog for this. But I also found out that they don't validate the TLS certs. So when they do that after direct connection, or when you do an API connection, they take any cert. That's why I can look at their stuff. They have this messaging system built in, this messaging platform in case you don't want to do email. And it's, it's rich text. If you put a hyperlink in there, you put the mouse over it, it does not show you the URL you're about to go to. It's blind. So I thought that was kind of dangerous. They took it under advisement. AD auth's only done once. Well, any auth if you log into the thing. So if my account's locked out or expires or something while I'm logged in, as long as I never log out of their software, I'm good. I've been logged in for three years now. Um, their updater doesn't need admin rights. That's good. And they have a really decent updater actually for their system. But the reason it works is because everyone is given full control on a program files directory for their clients. So any, you know, you get into a shared computer with 20 users, any of them could infect your EXE and then you run it under your profile. They use rsync, which is kind of cool. They use some open source stuff. Um, but they only check the size and the modify time of the file. And also rsync was statically linked, uh, which would upset, uh, Stallman. Uh, but they fixed that. Uh, client, surprise, surprise, does direct SQL for auth. This surprised the heck out of me because they didn't need to. They have a server component and API. Why does it have to do this? Well, it was some sort of backwards compatibility or something, whatever. Um, the, the SQL user is ROT13 protected, so we, we weren't too worried. And the client not only does its own authentication, it also makes its own inserts for the audit trail, uh, to log your login. So if you're a Perl-ish or you're into PCRE, as you know I am, uh, you can write a Perl script that, uh, patches a DLL with this regex. And this will get you in with any password you want. Um, you don't need admin rights because everybody can write to that DLL. I'm a 10? Oh, we, we're gonna be good. There's gonna be question time and everything. I'm gonna slow down. Um, you can do this by hand with a hex editor. The first time I did it that way, or you can use the Perl script. Um, you're just changing that SQL query. Uh, the size of the file has to be the same, so pad it out with nulls. And the modify time has to be the same, or rsync will override it so you can just change the mod time. Um, then you can bypass authentication, you can bypass auditing, and I have a redacted demo for you. It's about a minute and five seconds. The music may be difficult to hear. But it doesn't add to the, thanks. So this is when you first, this is when you first start the program and it starts updating. Bye bye music. Um, it starts doing its update. This is rsync running and getting my client up to date except for the DLL. It's not gonna overwrite that I modified. You're right, I probably could have edited this to make it shorter. But, there we go, it takes about half a minute or whatever and then I'm gonna get this cool login prompt with logos for all of the agencies that use it. Because it's a multi-agency system. And my login's there, first name, first initial last, my password is not A and yet, I'm in. So that's cool, but, there is a super user used by the vendor whose password's also not A and it can do things I can't do with my account and now I'm in as the super user. Yeah. So here's the, that video was, I hope you liked it and I know some people that hated it because all these things have been reported but nobody was doing anything about it, nobody was really interested at the vendor until I sent that video out to them and copied all of our commanders from these various agencies. I love, this is, you're my people and I love being here, I don't have to explain what SQL means and stuff like that, but to our commanders in that, until they saw this, you know, that video, it was hard to understand all the stupid nerd stuff I was saying. Soon thereafter, stuff starts getting fixed. I did a presentation to our commanders and the first slide was this. There's some other stuff they did, they decided not to resolve or whatever. I was impressed. I reported to them that all lowercase md5 hash that was in the database was also in memory and I said, hey, I can proc dump this process and get that hash out of it and crack it pretty easily. They got rid of that, that doesn't get in the dump anymore, so pretty cool. The downside to this vendor is that I ask who's in charge of security and they, initially they say all the product managers for all these different products, they're in charge of their own security. They're QA people do it. And then I say, well, is there one person, you know, who's a CSO or whatever? They said, we cannot tell you. Like, it's a trade secret. And I kept bugging them. I said, you got to have somebody, who's in charge of this stuff? Is it the president? And then they said, we've convened a special committee. So after all the vulnerabilities, they convened a committee and it's a secret committee because I asked, who's on it? I cannot tell you. I said, okay, how often do they meet? Can't tell you that. Can you give me any concrete initiatives that they've undertaken, this secret committee? And he said, no, trade secrets. So, this committee, as you might have figured out, probably doesn't exist. But every time I send an email now, I say, please forward this to the secret committee members. I also asked them to audit their software. I said, if I, I'm not, am I five? Five, five-ish. All right. So, I told them, I'm not, this isn't what I do for a living. If I can find this stuff in my spare time, what could somebody who is actually good at this do? What could everybody in this room do? Time to conclude, because I've got five minutes left and part four is that. So anyway, niche software doesn't get a lot of eyes on it. You could put your eyes on this stuff, I think. Because the thing is that these, your local government, if they're, you know, if they don't have the resources internally, there's no reason you couldn't reach out to an elected official. And if you don't want to look at this stuff directly, you're afraid of getting sued or whatever, asking them questions or giving them questions to ask their people and their vendors and that might help out. And the leverage that we have, we don't, we're not a big place, we're not a big customer. We're one of a lot of customers and we don't put a lot of money in for them. So we didn't have a lot of leverage on this vendor, but the bulldogging worked. They wanted to ignore it and stop responding to stuff and they went a year to that one vendor. If you keep on them, eventually they either have to do something or they get tired of listening to you and they do. The magic part of this is the herd immunity. Because if you can fix these vulnerabilities, just like anywhere else, you fix the vulnerability at one of these governments, there's a thousand other customers out there running the same software. They're going to get the update that fixes it, too. You fix stuff across the country. This is, personally, if you were interested in this stuff and you were looking for, you know, want to run ideas by anybody or you're looking for anybody to help you with an intro or something like that, non-monetary, because I work in government my whole life. I don't know how to make money or what to do with it. So I can't help you there. But I would love to talk to you about it if you're into this sort of thing. And there we go. The special thanks to the people that gave me notes or encouragement on CFPs that got rejected and got accepted. So thank you to all of them. And here's my contact info. And thank you for listening. Transcribed by https://otter.ai