start	end	text
0	11740	Hello everyone. For our last talk of the day, we have Anthony Kava, who is a
11740	17420	lifelong hacker and works for the sheriff office in Iowa, doing digital forensics,
17420	21340	investigating the geekier aspects of crime and fighting with vendors, convince
21340	27360	them to improve security of their products. And one, another thing that seems
27360	36600	interesting, is that he has no police powers in Nevada, so no problems. He's
36600	41180	going to talk about how bad could it be inside law enforcement and local
41180	45220	government APSEC. Give him a round of applause please.
50630	56950	Alright, I think this is working. Good afternoon. Thank you for choosing this, or
56950	60610	maybe there were no other seats available at other ones, that's cool too. I'll
60610	71390	take it either way. Let's get, you can see all that right? Good. In a step I
71390	74230	probably should have taken earlier, we didn't test the audio. Don't worry about
74230	78050	that. It was supposed to be the final countdown, so if anyone could sing that, or
78050	86310	at least... Oh, right, there might be an audio plug. We won't worry, we won't worry
86310	91130	about that. It'll be alright, probably. Alright, so you saw in the front slide,
91130	98890	you've got my name and my handle Carver, so that's kind of a self-dox, you know
98890	102750	who I am now. I've got my picture on here too, I look like this. The most
102750	107030	important thing I want to stress as we begin this, is that I am off-duty at this
107030	121110	time. It's actually 1800 back where I am, I'm off-duty, so... Yeah, hang on. Oh,
121110	124650	in order to make it official though, I'm going to do something real quick. Let's
124650	138050	see if we can point this out. County 7875, 10-42. I don't know if you heard that or
138050	144750	not. I had to get a dispatcher to do that, so I feel like I have to play it even if I
144750	150610	screwed up the audio here. I'm off-duty, I have effective limits on my freedom of
150610	154710	speech. So we'll try to stay within those, because I happen to love my job and my
154710	161290	employer, especially since this is recorded. Here's the disclaimer, these are my views,
161290	164410	they don't belong to my employer or anyone else. I'm not going to BS you, I will tell you
164410	169950	the truth even if it hurts me or anyone else. Please don't get me fired or sued. That's my
169950	173510	request. Full disclosure, in the interest of full disclosure, since there will be a lot of
173510	179070	disclosure here, this talk, or a version of it, was rejected by Black Hat, and DefCon, and
179070	187790	RomCon. So, you know what you're getting. This slide is just as a reminder to myself, if
187790	192250	you're familiar with the lyrics of Drake, it's because I need a picture for our local paper. So
192250	195930	I don't know, are you taking still photos during this or anything? If not, if you take one
195930	200030	and send it to my, send me that on Twitter, I can send it to my paper and then that'll make
200030	207570	them happy. And they're 500 readers. Oh, they'll see that recording too. I really like the
207570	211430	idea, the theme this year versus last year. Last year was kind of a downer. This year it's
211430	218650	technology's promise. And I kind of, I guess, tried to imbibe that theme over the last six
218650	224510	months. I've listened to nothing but Kraftwerk. And, you know, I've been to Vegas a few
224510	230830	times. I want to remind you, stay hydrated. This is my safety slide. This is my fourth DefCon.
230830	235830	So we already had the poll question earlier. I went to 13, 14. I took 12 years off. Came here
235830	242270	last year. And I'm just really thankful to be part of the inaugural AppSec village. This is
242270	248010	kind of amazing. I thought it was a joke when I got the acceptance email. So I had to check
248010	252670	the headers and all that. Here's our agenda. You're experiencing the intro right now. We're
252670	257650	going to get into the things you see here. Let's get into them. I usually have a lot of
257650	261950	detours and tangents in my talks. I can't do that because they're going to flash signs at me
261950	266070	and tell me I have to get off. So I'll be careful about that. Again, full disclosure, I'll
266070	272590	tell you, I work in law enforcement and I'm a hacker. I am a hacker and I carry a badge. And
272590	277410	so I know that there are some of you who probably subscribe to our gatekeeping that will say
277410	281590	that's impossible. You can't be a hacker and a cop. Or you can't be a cop who's a hacker. And
281590	287590	I say, well, I think you can. And we already made it clear, I don't have any police powers
287590	294930	here in Nevada, so do what you need to do. The idea for this talk kind of came to me last
294930	300090	year. I was at the loft panel, I was listening to them, and they were talking about ways that
300090	305510	we can engage with the government and engage with authorities, which is kind of like, you
305510	308950	know, that's a big difference after missing DEF CON for a dozen years. It felt a little bit
308950	314090	different to hear that. I've got a quote up here from Space Rogue and I won't read it to you
314090	319530	verbatim, but the idea is he was calling you to get involved in the legislative process, talk
319530	324690	to your lawmakers at the state level, at the federal level, and try to give them the hacker's
324690	330250	perspective on some of these things that they're enacting. I think that was important work. At
330250	337030	DC21, and I wasn't there, but I saw it on YouTube, Mudge actually spoke about being a hacker
337030	341590	in the federal government and had some experiences there. And he quoted this tweet that was
341590	346130	sent to him. He kind of tweeted asking the Twitterverse about whether I should do this talk or not.
346130	349710	And I thought this was great. I think communication, understanding, this is going to join
349710	353590	communities together. You can join hacking and law enforcement together. I think it's
353590	357450	possible. It's going to be a heck of a struggle. But I think we can do it. For those of you who
357450	362790	don't know who Mudge is, this is a recent photo. I thought that would get more laughs. Did you
362790	367710	not see this on Twitter? In any case, he's not actually at Thunderdown ARPA over at the
367710	373110	Excalibur. I'm going to give you some reasons to hate me so we can get him out of the way. I do
373110	377170	work in law enforcement. It's been established. Yeah, this is a bit cyberpunk for this year's
377170	382730	theme, so I have an alternate version. How many of you in here work in law enforcement? Is there
382730	387810	anyone in here? All right, you. Oh, wonderful. This is amazing. How many of you work in UC?
389130	397510	No? You cowards. You can tell by the cruddy facial hair because they haven't had a lot of
397510	403450	practice with it. If you do work in law enforcement, or you're somebody who wants, who's
403450	406970	interested in the dialogue with law enforcement, there's a website, hackers.blue, go there.
406970	410630	There's a form you can fill out. I'm trying to get people talking to each other. If you're
410630	415830	interested in that, go for it. If you're not, ignore. And this slide is because there are
416290	421050	literally dozens of us here. And so I'm going to talk a little bit more about that stuff on
421050	426570	Sunday at Sky Talks. I'm a Perlmonger. I have been for years. I know that's an old person's
426570	430510	language. You're developers in here, right? I mean, everybody knows PCRE, but you don't
430510	436950	actually do Perl, I hope. I hold some of those certifications that you hate. I've actually
436950	442190	been on Dateline once. It's my claim to fame, I guess. But Dateline has a weird relationship
442190	447170	with DEF CON, as you know. I did not try to infiltrate DEF CON. I'm here, you know. I also
447170	450930	didn't realize that the guy interviewing me is the popcorn meme guy. So I wasn't star
450930	456910	struck. I'm not a Fed asterisk. I do work federal cases. And the coolest part of federal
456910	460690	testimony I've ever given was this one where I was on the stand being cross-examined. And
461150	465830	the defense attorney started saying, Deputy Cava, you're an expert in pornography. And
465830	469770	before he could finish his question, I just said, thank you. Because then it goes in the
469770	484840	transcript. And now it's on my CV. So you know where I'm coming from. I'm not going
484840	488020	to get super political here come Sunday. But I'm not going to get super political here,
488020	491580	but I am firmly against cryptographic back doors. I would love it if I could dump every
491580	495880	phone that I get in the lab, but I don't want to give up our privacies for that. I also
495880	501100	don't think this should be a political statement, but all people deserve to feel safe, to be
501100	505960	fed, to be taken care of. So that's where I'm coming from in this. I'm trying to convince
505960	511240	you I'm not a jerk, but we'll see. I work for a county sheriff. So I work for a sheriff's
511240	516780	office in a certain state. Not shown here, it's redacted. In that state, I'm part of
516780	523640	the Internet Crimes Against Children Task Force. We'll have to redact that part. And
523640	527100	so when I go and talk to kids at schools, I tell them that we go after people who go
527100	533040	after bad guys on the Internet. I go after kids. So we're the good guys. Sneakers reference
533040	538220	for those of you of a certain age. So anyway, I spent, in our county's IT department, I
538220	541860	spent about 15 years working in the IT department. I did some security type stuff there towards
541860	545740	the last half of that. And then the last eight years of that, I moonlighted as a special
545740	548940	deputy. It's a reserve deputy in our sheriff's office. So for a dollar a year, in addition
548940	553600	to my day job, I did digital forensics. And then for the last two years, I've done that
553600	557220	full time as my day job. And then I go out and do some special deputy stuff on the side.
558120	561900	Yeah, I redacted the county, but even the most cursory Internet search. This isn't the
561900	568420	S.E. Village. I still do a little bit of light IT work. Digital forensics, though, is my
568420	574460	day job. I've dumped a lot of Nexus phones. I do not retire replicants. So this is all
574460	579980	introductory because I feel like it's, there is a natural animosity between the hacking
579980	584480	community and law enforcement community, sometimes for good reason. And I'm hoping
584480	587780	that we can get past that because I think that we can be the same community, or some
587780	592160	of us are thinking that way anyway. It'll take some winning over of the others. But
592700	595960	we're really not that different, you and I. We have a lot in common. I think first game
595960	601020	console was an Atari 2600. I started out with Commodore 64, Apple II. My first computer
601020	603720	that I could actually call my own was a PC Junior. And if you haven't heard of that,
603720	610620	it's crap. I ended up with three of them a few years ago, and I gave two of them to
610760	613680	a local high school, and it's in their computer lab now. And the first thing we hooked up,
613680	621100	the kids asked, where's the mouse? And the third one went to Foon. So if you are into
621100	626540	retro computing stuff, this is my Friday follow. Follow Foon on the Twitter. Yeah, so this
626540	631140	kid spent a lot of time on computers, probably wasted. This kid, this is how bad security
631140	635380	was back in the 80s and 90s, like late 80s, early 90s, is that this kid got rude on a lot of
635380	642840	stuff. Spent a lot of time on bulletin board systems, read anarchist text files. Aren't
642840	649200	they all? The Jolly Rogers cookbook was the knockoff anarchist's cookbook, and all that I
649200	653340	had available to me. Ended up on some bulletin boards, underground ones, the ones where
653340	657200	there's a door game that looks like a door game, but it's actually taken to the real
657200	662060	bulletin board, until I got busted because I didn't realize how phone traces worked, and
663700	668800	resulted in a ban for a couple of years. Then I got my first paper out so that I could buy a
668800	674040	486 so I could run Cracker Jack, crack hashes. Spent more time doing LAN parties than
674040	680920	doing homework, which explains why I barely graduated. And all that led to the ability to do
680920	684980	the job that I love today. So I think now that we've got the common ground laid out here,
684980	689760	there's only 10 minutes left, right? I want to give you some of the commonalities, some of the
689760	696020	general principles in local.gov appsec. That's my fun name for local government until somebody
696020	700660	actually registers the domain, then I'll screw that up. Your local governments, everybody's
700660	706840	got one, right? You live in a city or a town or a county somewhere, and they vary in size.
706840	710300	So you've got the small ones, a population of like 1,000 people or 500 or something like
710300	714220	that. You've got big ones at Los Angeles County, you've got populations of millions. And so
714220	719640	the thing is that the smallest organizations, they can get by on Excel spreadsheets and
719640	723720	access databases for their information systems, sometimes pen and paper, even today.
724820	729220	And the largest ones, they're true enterprises. So they might have something developed in-house
729220	732240	or they've got some really expensive thing. And there's people stuck in the middle. My county's
732240	737340	stuck in the middle. We're a population of 90,000. And so we're too big to get by on Excel
737340	742860	spreadsheets. Not that you should do that anyway. But we're too small to use the really cool
742860	747040	enterprise stuff. We can't afford it. So you end up in this weird... you get this niche
747040	752420	software that's made just for these size organizations. And the problem is there's not a
752420	756620	lot of incentive on the vendors to look at application security. By the way, imposter
756620	761700	syndrome, I don't actually know what AppSec means. I'm talking about vulnerabilities in
761700	765900	applications. Does that qualify? You're the professionals? Okay, you're gonna let it go?
765900	771500	All right, good. The rest of this will be... anyway. Midsize governments, the applications
771500	777280	don't get looked at because it's not like it's Microsoft Office where there's thousands and
777280	780300	thousands of installs out there and there's people actively looking for it. And there's
780300	784400	bug bounty programs or whatever else. There's none of that. People don't look at what's under
784400	788860	the hood. A lot of these governments, even if they have an IT department, they don't have a
788860	793100	security function. There's no one there that's looking into security actively. And in our state,
793100	797140	we're lucky. Our state actually will come in and give you an IDS and will come in and do
797140	803580	vulnerability scanning for you and stuff like that. They'll help you out if you ask. But the
803580	808180	problem is that the places that are lucky enough to have IT, that's great. Some places their IT
808180	813360	person is like there's an auditor's clerk who happens to have a copy of Norton Utilities.
813840	821880	And so... true story. And so that person ends up being your IT person, being your go-to person.
821880	826300	And that person is also, at the same time, trying to run elections and finances and real estate
826300	833080	stuff. And in their spare time, they try to hold off nation-state actors. So it's a losing battle.
833480	838520	All these organizations need help and need advice with technology because they don't have the
838520	844260	internal resources for it. And the reality is that a lot of the advice that they do get
844260	852320	is going to come from vendors. Does anyone here sell stuff for a living? Okay. In one way or
852320	858640	another... man, I didn't... this isn't ethics or philosophy, is it? But yeah, you're right. In one
858640	863820	way or another... but the vendors that are giving a sales pitch oftentimes recommend a product.
863820	868460	Sometimes it's their own. That's where they get most of their advice. And that can be kind of a
868460	873200	trap. So in terms of the technology's promise, imagine if citizens were providing that kind of
873200	879240	advice. Just food for thought. And here's another one. And I'll answer this, I guess, for you in a
879240	883140	minute. How many vulnerabilities could you find if you were looking for them in your local
883140	887120	government software if you spent like a day or two with it? Just looked at the cursory stuff.
888060	893720	We're gonna find out. So I'm not a professional at this. And it's not even a major part of my
893720	898520	job. So the things I'll show you, if I could do them, then anybody could find it.
898600	904920	But I want to go over why this is important. You paid for it. Your tax dollars paid for all
904920	912160	the software. They pay for the services. They pay for these things. If there is a ransomware
912760	917360	infection or some other problem with the system, your tax dollars will also pay for the fix for
917360	920080	that. They're gonna pay for the ransom. They're gonna pay for the incident response.
922000	929100	Yeah. These are systems that handle things like 911 calls, dispatching firefighters and medics
929100	934260	and police to emergencies. This is life and death stuff. They also record the worst days
934260	938380	of people's lives. I mean, this is where a police report goes that's gonna have a narrative that
938380	942420	describes bad stuff that happens. People call 911. It's not usually just to say hello. It's
942420	948460	because something's going on. And if you think about it, there's crime scene photos, all sorts
948460	952500	of stuff that you wouldn't want it to get out. It doesn't need to be on pastebin.
953700	956980	And I know that those of you who read those anarchist text files
958020	962900	might consider that blowing all that up would be kind of cool because then you can't prosecute
962900	965640	people. But you know, you would throw out the good with the bad. And there are people that
965640	970980	actually really need prison. So anyway, I think this is important stuff to watch. Every vendor
970980	975760	that you work with in this space, and probably all spaces, they tell us that we need to have
975860	981180	a secure environment. And what that is code for is that like, hey, we didn't do anything with
981180	986920	security on this. So you better be watching everything for us. If they have cryptography,
986920	992660	it's going to be zero to bad somewhere in there. There's a lot of hard coded credentials. There's a
992660	997540	client-side enforcement of privileges, stuff like that. And client-side vulnerabilities are
997540	1004140	not considered to be a problem because, well, as we know, in 2019, all attacks are straight at the
1004140	1008840	firewall towards the internet. Everything's, you know, a direct attack. There's no phishing,
1008840	1013660	anything like that. The thing is that they tell you that if an attacker got to your client, and
1013660	1018360	I've heard this from multiple people, that that's your fault. You didn't, your client got, you know,
1018360	1021180	somebody's on there and now they're looking at our software and they find the hole. Well, it's
1021180	1026420	your fault for letting them on there. So no reason to secure the application. Who's in charge of
1026420	1031200	security? There are some places when we ask, they say, we can't tell you. Like it's some sort of
1031200	1034540	secret. It's a trade secret. We can't tell you who's in charge of security. I'll get into that.
1038760	1043120	And yeah, we take security seriously. If I took a drink every time, I wouldn't have made it to
1043120	1050080	the talk today. Let's talk about the dangers.
1051200	1055720	So we've already kind of established these local governments. If you've got one IT person,
1055720	1061020	if you've got one IT person, no IT person, they can't look under the hood. They just don't have
1061020	1063840	the capabilities, don't have the skill set, they don't have the resources to do it, even if they
1063840	1069980	want to. They're too small. Yeah, and a lot of these places are lucky to even have an IT person.
1073520	1077560	So we need people that can and will look under the hood. And I'll give you some
1077560	1084040	particular cases to try to show that. I've redacted the names because I love my job.
1084080	1089260	And I love not being sued. These vulnerabilities have all been reported one to five years ago.
1089260	1092720	So some of these are pretty ancient. They've either been addressed, notice it doesn't say
1092720	1097660	fixed, it says addressed. Either addressed, sometimes they decided we should accept the
1097660	1103260	risk, they just tell us that. But they've either been addressed or the products have been retired,
1103260	1109580	assume that. Yeah, how bad could it be? Oh, and by the way, this is what I was getting at. I'm
1109580	1114200	not an AppSec professional. I had to look it up on Wikipedia to know what it was before I put the CFP
1114200	1122780	in. But I did this in my spare time. For the last, I guess, 17 years, I've worked on a salary, so I
1122780	1130960	get to work as many hours as I want. And so after I... So after I've done all the stuff that's
1130960	1134620	supposed to be my primary part of my job, this is where I was like, I'd really like to know what the
1134620	1138360	heck is going on on these things and started looking into them. So if you did this as a job,
1138360	1142540	imagine what you'd find. I didn't do any real reverse engineering. A, because I'm not smart
1142540	1147740	enough. B, because it might violate our EULAs. And I didn't want to do that because I'm a good
1147740	1154260	student, I love my job. And the people of my county. So the tools I used were really advanced
1154260	1161800	stuff like Strings, Grep, some Perl, obviously. I spied on some API calls, which I think is okay.
1161800	1166080	I used Wireshark and Burp Suite and looked at some traffic, but didn't do any real reverse
1166080	1174080	engineering stuff. So now part three, a tale of three vendors. Notice the Triforce. Start off
1174080	1179940	with Vendor A. Vendor A sells a suite of software to local governments and it runs all sorts of
1179940	1184180	stuff. It'll do your finances, so your accounts payable, accounts receivable, your direct
1184180	1189760	deposit for banking, human resources stuff, payroll, your real estate taxes, all that stuff's
1189760	1193280	in there. And they will sell you law enforcement management stuff too, so your records and
1193280	1199840	everything else. So when we start looking at this, the immediate things that pop out are the
1199840	1205880	SQL creds that are baked into the client install. So there's an XML, there's an XML config file
1205880	1210420	and it has a username and password for SQL. The password is not plain text, the password is
1210420	1215600	encrypted, but to use it, it's got to be reversible encryption, right? And it turns out that
1215600	1222200	the username, well the password is a leet speak version of the username, so you could probably
1222200	1228520	pretty well guess it. And it has SA on the SQL server. So every client that's installed
1228520	1236360	includes a free login to your SQL server with SA. And this is the bonus part, it's the same at
1236360	1241480	every customer site. I verified this, I was a little bit afraid to do it, but I slacked
1241480	1246500	somebody at a different county and I said, hey, just real quick, do you think your password is
1246500	1258840	this? And they said, holy crap. That wasn't me, that was the computer. The API traffic, this thing
1258840	1266320	has a client server infrastructure, which is more than I can say for some of these apps. It's
1266320	1272420	also had authentication tokens. When you log in, you get a token that never expires. I can't say
1272420	1278620	never, but I tried it for weeks. So six weeks later, that auth token still worked. Another
1278620	1285620	nice thing is that there's rules-based permissions, but they're not enforced at the API level,
1285620	1289780	they're only enforced at the client. So if you get that token, which is sent in the clear,
1289780	1294840	you can reuse it for weeks and weeks, maybe years, and do anything you want on the system. So I can
1294840	1298980	get into that system and I can go look at my payroll and see what my pay stub is going to look
1298980	1302800	like, but once I get the token, I can look at everyone's payroll and maybe pull their bank
1302800	1310000	account numbers. That's a problem. But wait, there's more. What about their payroll website?
1310080	1315560	So this company also hosts a payroll website where you can turn in your time sheet,
1315560	1322260	an internet-facing website, and there's an API that connects between your local app server and
1322260	1327440	their website. And that API traffic, when I went to go look at it, turned out to be in the clear,
1327440	1333300	they were doing HTTP and XML that was not encrypted. It has all sorts of PII in there, and I'll tell
1333300	1336880	you a little bit more about that in a second. And it was that way for weeks. Now what happened was
1336880	1342000	when we first implemented it, I did check, and it was HTTPS, and you know, I felt okay about that.
1342080	1346080	And then when I went to check back on it to look at the API traffic, I thought I'd have to
1346080	1350580	intercept it, I didn't. I mean, I thought I'd have to man in the middle of it, but in any case,
1350580	1354480	they turned it off for debugging. They were debugging one site, and they turned it off for
1354480	1360760	every customer, as far as I can tell. And forgot to turn it back on. And so I brought it to their
1360760	1365120	attention, and they did turn it back on. Also there's cross-site scripting, because there's
1365120	1368700	like announcements in there. I can go put an announcement in for all employees when you log
1368700	1372960	into your time sheet, and it was vulnerable to cross-site scripting. They said those aren't
1372960	1380440	security vulnerabilities, even though it pops up when you log in. So I made some requests
1380440	1383920	that this particular vendor asked them, would you please tell customers about that time when
1383920	1388780	their stuff was not encrypted, and I think they deserve to know. And I got, that's a locus, but
1388780	1392180	it's supposed to be a grasshopper. That was what I heard, grasshoppers after that. Or sorry,
1392180	1398220	crickets, crickets. I also asked them if they would stop using Google Analytics in the inside
1398220	1401840	of this website. I don't know, does this feel weird to you? I need a professional opinion, but
1401840	1406360	when you log into this payroll thing, the internal parts of Google Analytics, so they're bringing in
1406360	1412760	JavaScript from an outside site. It's Google, and you can trust Google. But they said no,
1412760	1416700	because they use it to decide what pages you're looking at, and I thought, couldn't you parse the
1416700	1420840	logs or do something that didn't require that? But anyway, I didn't get any motion on that.
1421840	1426080	They did have our social security numbers on there, and dates of birth. So when you log into
1426080	1429540	your time sheet, you can also click a little button that says profile, and it'll show me my
1429540	1434180	full name, my home address, my emergency contact, my date of birth, my social security number,
1434180	1440200	my ethnicity, my race. It's like, I don't know what they didn't have on there. And we asked,
1440200	1442820	could we please at least get the social security number, full social security number, by the way,
1442820	1447060	not just last four. And at first they said, eh, some people like it, so no. And then eventually
1447060	1450500	they gave us a little checkbox so we could say, no, we don't want to show that. So we suppressed
1450500	1455540	that, but they didn't let us take off the date of birth and all the other stuff. My argument was
1455540	1460400	that if I don't know my date of birth, I don't go to the website to check it.
1464990	1470310	We brought that thing about the hard-coded login that's the same everywhere with an SA account. We
1470310	1474350	asked them to change that, and they did change that. They revamped their software updater,
1474350	1478470	their client updater, and they pushed out a big update to every site that broke some of them,
1478470	1483650	and I told them that's my fault. And they changed the passwords at every site for this account,
1483650	1487670	and they took away SA. The account still exists and still does some stuff that I guess they needed
1487670	1492130	to do. They need to re-architect the whole thing to get rid of it. But at least it's not SA,
1492130	1498690	at least the password is different at different sites. The payroll website with the timesheets
1498690	1505430	did not support password complexity, expiry, or lockouts. And when they come out to your place
1505430	1510850	and they set you up, they give you four digit pins. And without lockouts, if you can guess my
1510850	1516190	first initial last name, you can try 10,000 combinations and you'll get into my payroll
1516190	1520850	account. So that's cool too. With all my social security number and all that stuff. The last
1520850	1526510	thing I ask, and this is the biggest ask, is put somebody in charge of security and audit your
1526510	1534190	stuff. And believe it or not, this story, Vendor A, has a happy ending. This is the timeline for
1534190	1544710	this story. I first reported the vulnerabilities back in March of 2014. And I gave them, here's
1544710	1549030	what I have so far, and I think there's going to be more. And they said, okay, we'll look into it,
1549030	1553510	it doesn't sound very serious. And they said, why don't you just give us a list of every
1553510	1558290	vulnerability you find? Why don't you do a free audit of our software? And so I did, in a time
1558290	1563070	frame that worked for me, which was about a year. And I didn't do it on purpose, I really wanted to
1563070	1567130	get it done quicker, but about a year. So July of 2015 is when I came back to them and said, here's
1567250	1573210	a list of like two dozen things. And some of them are really bad. And they, again, weren't super
1573210	1577090	excited about it. What I thought was funny is I went back to my emails to look at this to see
1577090	1581110	what happened, but I sent that, they weren't super excited about it, and then a month later I
1581110	1586570	started getting automated emails from them telling me to do Microsoft patches as new CVEs were
1586570	1592730	released and stuff. So I thought they were taunting me. And then a year goes on, every few
1592730	1596190	months I'm pestering them, I'm trying to go up the chain, I'm going to LinkedIn and looking up the
1596190	1601110	boss of the boss of the boss. And I'm reaching out to anybody I can, and I didn't think anything
1601110	1605230	was really going to happen at that point, we weren't getting a lot of traction. Until a month
1605230	1609870	later, August 2016, this was great, we found the one person in their organization, this is a big
1609870	1614910	company, Fortune, whatever, one person that cared about the software and the security of it. And
1614910	1619330	they weren't even in that side of it, they were in the operations IT side running this website,
1619330	1622830	and they started looking at all these things, and they started actually doing stuff with it,
1622830	1628510	and they were able to get an actual audit started a few months later. So by December 2016,
1628510	1632350	still two and a half years after the initial reports, they started auditing their stuff.
1632350	1635450	They even found vulnerabilities I couldn't find because they got access to the source code and
1635450	1640610	the logs and everything. And then the real happy ending to this is that the next year,
1640610	1647510	that one person who cared, Paul Harvey voice, was promoted into their first security position
1648290	1653790	auditing this stuff regularly. And so, good outcome. It took three years, but good outcome.
1653970	1657730	A lot of these things were fixed, and they put somebody in charge who will actually make sure
1657730	1661110	that they don't happen again in the future. That's a good story. Let's do some other stories.
1661110	1669350	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
1669350	1675130	of coffee, so we should be good. Vendor B, they do a 911 dispatch system. It's called CAD, computer
1675130	1679430	aided dispatch. It's where you take your 911 calls, you send out police, firefighters, medics,
1679430	1682990	that sort of thing, records management, jail management, all your inmate information,
1682990	1688690	including medical information, and mobile CAD stuff and communications. So that's in your car,
1688690	1692330	you've got this computer in there, usually a Passock Toughbook they've cloned at the market.
1692670	1697110	But anyway, that thing interfaces with the CAD system where your dispatchers are.
1698050	1702870	I'd say it's 90% serverless, way ahead of its time since the 90s, because they didn't do a
1702870	1712960	client-server architecture. All the clients do direct SQL, direct SQL, and every user has to
1713100	1716500	have a SQL account. This was a management nightmare. We already gave them AD accounts,
1716500	1721120	why do we also have to have a SQL user for them, local SQL user? But we did, and each one of those
1721120	1727620	SQL users gets DBO on all their stuff. Database owner can delete everything, whatever. So if you
1727620	1731320	use the GUI, it doesn't let you do stuff you're not supposed to do. But if you open up Microsoft
1731320	1736100	Access and make an ODBC connection, you can do whatever the hell you want. They have one
1736100	1744720	component in this suite that has its own users table, it doesn't rely on the SQL users, and of
1744720	1750020	that particular component is a web-based records management interface. It's for you to go log in,
1750020	1754820	they said put it on the internet, we did not put it on the internet. And they said you have your
1754820	1758840	people log in, you can look at reports, you can look at in-main information, all that stuff, it's
1758840	1765360	really cool. Plain text passwords, we complained about that, they upgraded to XOR. Trivial SQL
1765360	1770640	injection, I mean like single quote or one and you're in to bypass the authentication on this
1770640	1776440	thing. Cross-site scripting is not a vulnerability, we know that. Bonus, ampersands break your
1776440	1781460	system. So because they were displaying it in HTML, if you put an ampersand in a record field, it
1781460	1785680	broke the display on the page. So I did write a Perl script that every five minutes checked for
1785680	1794660	ampersands and changed them to the word AND. True story. Their mobile CAD software in the cars, it
1794660	1798980	goes over a radio network so you want it to be secured, right? So they said don't worry about VPN,
1798980	1806220	we rolled our own crypto. So we used OpenVPN on top of theirs. Their crypto is based on 64 bit
1806220	1810260	blocks, I know that much. And there's some questionable padding stuff going on, I'll tell you
1810400	1814240	a little more about that in the next slide, because they also use it for passwords. And here's
1814240	1819700	what's interesting about, I mean it's all interesting to me anyway, but the key that they use for
1819700	1823480	this mobile communication is hard-coded in the install. I shouldn't say hard-coded, you can
1823480	1828680	change it, but most people don't. And so we asked to change it and it was a big pain in the neck to
1828680	1833120	hit every client after the deployment to do this, but we changed ours. And I know they have
1833120	1836620	hundreds of other customers that did not, so if you know the password that comes with the
1836620	1842320	client installer, you can read all their traffic. So the passwords for the mobile login, they're
1842320	1848340	stored with this reversible encryption, not hashed. And it's based on 64 bit blocks, which
1848340	1851940	you know, 8 characters. So if you, and they give you up to 12 for a password. I think they did
1851940	1857260	VARCHAR12 back in the 90s and they just stuck with it for 20 years. But anyway, if your
1857260	1863040	password's longer than 8 characters, the last 4 characters are in plain text. It's padded
1863040	1869180	with spaces, but those are plain text too. So we wanted help, we wanted a tool, this is related
1869180	1872780	to this, we wanted a tool in our IT department so that our IT people could go to an intranet
1872780	1876460	page and reset passwords, unlock accounts in the system, but we didn't know how the encryption
1876460	1881500	worked. So I went to them and I said, well, you should know, this thing has a console
1881500	1884600	application that stays up all the time. We had to lock the screen and use VNC to get to this
1884600	1889640	thing. And that's how you set passwords. And so we went to them and said, hey, could you give
1889640	1893220	us something to help us make this intranet feature? They just updated their password
1893220	1898980	expiry feature and all of our users' passwords expired the same day. So that first 90-day
1898980	1904900	cycle, 3 shifts, law enforcement usually works 24 hours, they're supposed to, 3 shifts of
1904900	1909560	lockouts and on-call IT stuff. So wanted to give our guys something, guys and gals,
1909560	1914120	something to change those. I asked the vendor, can we get a recipe? Just tell us, how does
1914120	1918340	encryption work? What's the cipher mode? Give us the parameters, we'll do it ourselves.
1918440	1921080	Or give us a little bit of code. I know they aren't going to do that, but give us a little
1921080	1924840	bit of code, we'll redevelop it. Or give us a tool, a command line tool that we can use.
1924840	1928940	That would work. They said, okay, we can't do the first two. We can develop the tool.
1928940	1933500	We're doing a feasibility study now. We're going to have a project manager assigned.
1933740	1941680	Estimate 6 months development, $10,000, give or take, probably give. So I got to thinking,
1941680	1946960	I looked at it, they have a DLL that does all this stuff, right? So what would it cost
1946960	1953440	is $10,000 or about $1,000 per line of Python. We can do it in a dozen lines of Python and
1953440	1956500	just use their DLL. I still to this day don't know how their encryption works, but I don't
1956500	1960340	need to because I'll just use their library to do it. And you can see the hard-coded key
1960340	1967680	up there with the B. I obfuscated some of the other stuff, but that's the actual key.
1968600	1973060	Good news is they retired this product. This is a football reference. I'm not a sports
1973060	1979600	person, but I understand this guy's retired. Vendor C, our final vendor, does the same
1979600	1985120	kind of stuff. I own dispatch, mobile, everything. We were shopping for vendors and I asked the
1985120	1992560	sales engineer dude, I said, how are the creds stored? And he said, we're not dumb, but he
1992560	1997200	said it a different, more demeaning way. I thought it was terrible. But then I went to
1997200	2003540	look because I thought, okay, let's see what they do. Unsalted MD5 hashes in 20-something.
2005000	2008680	At least they could do Active Directory, right? So we don't have to worry too much about that.
2008980	2013780	Oops. We turned on Active Directory. They said, okay, Active Directory is now enabled.
2013780	2018000	Log in with your AD accounts. And I didn't. But I did ask our IT department. At this point,
2018000	2021800	I didn't work in our IT department anymore, so I couldn't do the Wireshark stuff myself.
2021800	2025620	So I said, could you guys look at the LDAP traffic and just make sure that they encrypted
2025620	2031220	that? And sure enough, it was not. They forgot the S in LDAPs. So plain text passwords going
2031220	2034400	across. Our IT department did better disclosure on some of these vendors because I said, hey,
2034400	2037480	could you go look at the logs and see which users have logged in since they turned this on
2037480	2042840	and let them know to change their password? And they did. So AD works. And that mitigates some
2042840	2047720	of the problems. Once you put the S in LDAPs, at least it's encrypted on the wire. But for
2047720	2051960	some reason, they started storing our passwords in MD5 hashes anyway. I went and looked at the
2051960	2055780	database after that, and I found mine in there, and I started cracking some of them, and I found
2055780	2060540	something in common. They were all lower case. I'm like, what the heck's happening here? My
2060540	2064400	password's mixed case. It has to be for the AD rules, but it's stored in this hash that's all
2064400	2069320	lower case. Well, it turns out they're doing std lower, MD5, no salt, and throwing it in the
2069320	2078440	database. This dog looks so sad, so I actually, I got a happier dog for this. But I also found
2078440	2081960	out that they don't validate the TLS certs. So when they do that after direct connection, or
2081960	2086840	when you do an API connection, they take any cert. That's why I can look at their stuff. They
2086840	2089980	have this messaging system built in, this messaging platform in case you don't want to do
2089980	2095140	email. And it's, it's rich text. If you put a hyperlink in there, you put the mouse over it, it
2095140	2099340	does not show you the URL you're about to go to. It's blind. So I thought that was kind of
2099340	2104080	dangerous. They took it under advisement. AD auth's only done once. Well, any auth if you log
2104080	2108540	into the thing. So if my account's locked out or expires or something while I'm logged in, as
2108540	2111980	long as I never log out of their software, I'm good. I've been logged in for three years now.
2112300	2117300	Um, their updater doesn't need admin rights. That's good. And they have a really decent
2117300	2121940	updater actually for their system. But the reason it works is because everyone is given full
2121940	2126160	control on a program files directory for their clients. So any, you know, you get into a shared
2126160	2129760	computer with 20 users, any of them could infect your EXE and then you run it under your
2129760	2135340	profile. They use rsync, which is kind of cool. They use some open source stuff. Um, but they
2135340	2141260	only check the size and the modify time of the file. And also rsync was statically linked,
2141260	2147640	uh, which would upset, uh, Stallman. Uh, but they fixed that. Uh, client, surprise, surprise,
2147640	2151220	does direct SQL for auth. This surprised the heck out of me because they didn't need to. They
2151220	2154560	have a server component and API. Why does it have to do this? Well, it was some sort of
2154560	2161340	backwards compatibility or something, whatever. Um, the, the SQL user is ROT13 protected, so
2161340	2166840	we, we weren't too worried. And the client not only does its own authentication, it also makes
2166840	2174520	its own inserts for the audit trail, uh, to log your login. So if you're a Perl-ish or you're
2174520	2180440	into PCRE, as you know I am, uh, you can write a Perl script that, uh, patches a DLL with this
2180900	2186840	regex. And this will get you in with any password you want. Um, you don't need admin rights
2186840	2191080	because everybody can write to that DLL. I'm a 10? Oh, we, we're gonna be good. There's gonna
2191080	2196720	be question time and everything. I'm gonna slow down. Um, you can do this by hand with a
2196720	2200660	hex editor. The first time I did it that way, or you can use the Perl script. Um, you're just
2200660	2206600	changing that SQL query. Uh, the size of the file has to be the same, so pad it out with nulls.
2206600	2210180	And the modify time has to be the same, or rsync will override it so you can just change the
2210180	2215440	mod time. Um, then you can bypass authentication, you can bypass auditing, and I have a
2215440	2221340	redacted demo for you. It's about a minute and five seconds. The music may be difficult to
2221340	2229800	hear. But it doesn't add to the, thanks. So this is when you first, this is when you first
2229800	2235280	start the program and it starts updating. Bye bye music. Um, it starts doing its update.
2235280	2238360	This is rsync running and getting my client up to date except for the DLL. It's not gonna
2238360	2244180	overwrite that I modified. You're right, I probably could have edited this to make it
2244180	2249220	shorter. But, there we go, it takes about half a minute or whatever and then I'm gonna get
2249220	2254880	this cool login prompt with logos for all of the agencies that use it. Because it's a
2254880	2260680	multi-agency system. And my login's there, first name, first initial last, my password is
2260680	2274830	not A and yet, I'm in. So that's cool, but, there is a super user used by the vendor whose
2274830	2279930	password's also not A and it can do things I can't do with my account and now I'm in as the
2279930	2287610	super user. Yeah. So here's the, that video was, I hope you liked it and I know some people
2287610	2291190	that hated it because all these things have been reported but nobody was doing anything
2291190	2294930	about it, nobody was really interested at the vendor until I sent that video out to them and
2294930	2306580	copied all of our commanders from these various agencies. I love, this is, you're my people and I
2306580	2310160	love being here, I don't have to explain what SQL means and stuff like that, but to our
2310160	2314040	commanders in that, until they saw this, you know, that video, it was hard to understand all
2314040	2320140	the stupid nerd stuff I was saying. Soon thereafter, stuff starts getting fixed. I did a
2320140	2327440	presentation to our commanders and the first slide was this. There's some other stuff they
2327440	2331840	did, they decided not to resolve or whatever. I was impressed. I reported to them that all
2331840	2335340	lowercase md5 hash that was in the database was also in memory and I said, hey, I can proc
2335340	2339920	dump this process and get that hash out of it and crack it pretty easily. They got rid of
2339920	2345540	that, that doesn't get in the dump anymore, so pretty cool. The downside to this vendor is that
2345540	2349960	I ask who's in charge of security and they, initially they say all the product managers for
2349960	2353000	all these different products, they're in charge of their own security. They're QA people do it.
2354460	2357920	And then I say, well, is there one person, you know, who's a CSO or whatever? They said, we
2357920	2362600	cannot tell you. Like, it's a trade secret. And I kept bugging them. I said, you got to have
2362600	2366940	somebody, who's in charge of this stuff? Is it the president? And then they said, we've
2367900	2374940	convened a special committee. So after all the vulnerabilities, they convened a committee and
2374940	2379420	it's a secret committee because I asked, who's on it? I cannot tell you. I said, okay, how
2379420	2384000	often do they meet? Can't tell you that. Can you give me any concrete initiatives that they've
2384000	2388840	undertaken, this secret committee? And he said, no, trade secrets. So, this committee, as you
2388840	2392740	might have figured out, probably doesn't exist. But every time I send an email now, I say,
2392740	2399540	please forward this to the secret committee members. I also asked them to audit their
2399540	2407400	software. I said, if I, I'm not, am I five? Five, five-ish. All right. So, I told them, I'm not,
2407400	2410860	this isn't what I do for a living. If I can find this stuff in my spare time, what could somebody
2410860	2415640	who is actually good at this do? What could everybody in this room do? Time to conclude,
2415640	2421640	because I've got five minutes left and part four is that. So anyway, niche software doesn't get a
2421640	2427440	lot of eyes on it. You could put your eyes on this stuff, I think. Because the thing is that
2427440	2431240	these, your local government, if they're, you know, if they don't have the resources internally,
2431240	2435280	there's no reason you couldn't reach out to an elected official. And if you don't want to look
2435280	2440940	at this stuff directly, you're afraid of getting sued or whatever, asking them questions or
2440940	2446920	giving them questions to ask their people and their vendors and that might help out. And the
2446920	2450840	leverage that we have, we don't, we're not a big place, we're not a big customer. We're one of a
2450840	2454060	lot of customers and we don't put a lot of money in for them. So we didn't have a lot of leverage
2454060	2458480	on this vendor, but the bulldogging worked. They wanted to ignore it and stop responding to
2458480	2462360	stuff and they went a year to that one vendor. If you keep on them, eventually they either have
2462360	2466380	to do something or they get tired of listening to you and they do. The magic part of this is the
2466380	2469660	herd immunity. Because if you can fix these vulnerabilities, just like anywhere else, you fix
2469660	2473300	the vulnerability at one of these governments, there's a thousand other customers out there
2473300	2476460	running the same software. They're going to get the update that fixes it, too. You fix stuff
2476460	2481260	across the country. This is, personally, if you were interested in this stuff and you were
2481260	2484600	looking for, you know, want to run ideas by anybody or you're looking for anybody to help you
2484600	2488340	with an intro or something like that, non-monetary, because I work in government my whole
2488340	2494420	life. I don't know how to make money or what to do with it. So I can't help you there. But I
2494420	2498960	would love to talk to you about it if you're into this sort of thing. And there we go. The
2498960	2503780	special thanks to the people that gave me notes or encouragement on CFPs that got rejected
2503780	2507560	and got accepted. So thank you to all of them. And here's my contact info. And thank you for
2507560	2508100	listening.
2508100	2509260	Transcribed by https://otter.ai
