start	end	text
0	7320	Welcome. Thank you for coming. So it turns out these are our presentation screens or whatever.
7760	12220	This is a pretty graphically heavy talk. So if you want to actually see what we're talking about,
12220	16500	you might want to move up. If you don't want to get too close to us, that's okay. This is
16500	21560	being recorded. It's being live streamed. Also, hello, internet. But a lot of we're
21560	25720	showing some code and we're showing some stuff on there, and it's basically going to be impossible.
26060	29980	I don't even know what we're going to see on here. So anyway, thank you for coming.
30000	33780	Yeah, move up. Move up. Come on. I feel like I'm like a rock star. It's like,
33780	41780	come on, move up. Come on. Close the pit. Yeah. Cool. Oh, is this? Okay. This is actually water.
41780	46300	So DEF CON is not going to poison me. Are we doing this now? Like while?
47460	54620	Is this recording? Yeah, this better be. No, it's all. Is this recording? Yeah. Okay.
54660	59500	Can we do it anyway? Okay. Not allowed to drink on camera or something. Okay.
59500	67620	Here, you do your thing. I haven't done it. Okay. So you don't want to explain the whole like.
67900	74680	So DEF CON has a history of new people doing speakers and doing a shot when they do that.
74960	81240	So this is a new speaker. So we're going to do a shot. Yes. Shots. We can we can turn that down
81240	86580	too. Yeah. So this is water, by the way. So you don't have to be pressured into actually drinking
86580	91380	whatever that is. So it's actually all water. Oh, I mean, it's all water. Right. So this is
91380	95260	Bruno's first talk at DEF CON, which is awesome. And I think it's, I don't know, my 21st talk,
95260	107550	but I've never gotten to do this. So very cool. Cheers. Refreshing. All right. Now we can start.
108170	114150	Yeah. So thank you for coming to the talk. My name is Joe Grand and I am a hardware hacker
114950	123930	and I like hacking on things. And yeah, I love going to DEF CON. So that's me.
124210	131030	Yeah. And I'm Bruno. I'm from Germany. Was the first time to went to DEF CON two years ago.
131190	136990	And now I'm first time on the stage, as you have seen. And yeah, really excited about it.
137190	142750	Yeah. So this this presentation is about a project that we did together to reverse engineer the
142750	147270	Roboform password generator. And we'll get into all of the details. But the the presentation is
147270	152570	is about hacking time. And this is not a sensational talk. We don't have a name for our
152570	160430	discovery. But it really kind of shows the problems that we face. I guess the the advantages that we
160430	165470	face if we're hackers. But kind of the problems of systems and security flaws and how they are
165470	171370	going to kind of persist even if things have been fixed. So we're not the first to hack time,
171370	176390	even though we would like to think that we are. So we have some examples. I don't even remember.
176390	179930	Which one is this? Oh, yeah, the time machine. Has anyone read this? I know DeathVeggie has probably
179930	185530	read the time machine. Yes, okay. Has anybody else read this? Yeah, it was sort of like the first
185530	190930	mention, right, of like traveling back in time to change something else. Of course, there are so
190930	196670	many things of people hacking time. I chose a couple. I probably missed some. Anybody guess
196670	202830	what? Is that even playing? I can't I can't see from here. Oh, it's playing now. Anybody guess
202830	208870	what it is before the words come up? Did did you cheat? Is it already? Oh, no, it's already up
208870	215270	there. Okay, Doctor Who, yeah. So, um, Time Lords, of course. Put this one in for for LeapBunny of
215270	219870	the hardware hacking village. So back to the future, of course, right? Hacking time. And my
219870	224150	personal favorite, which is why I'm wearing the T-shirt, is Hacker Man. Has anybody seen Kung
224150	231270	Fury? Woo, yeah, like ten people. Yeah, awesome. Oh, there's Jesse back there. Um, yes, Kung
231270	236130	Fury, Hacker Man is the star of the show. So, hacking time to go back and do all sorts of stuff
236130	244230	that needed to be properly completed. Um, what have I missed? Am I like are we grossly misrepresenting
244230	254130	hacking time? Is there any other? What was it? The what? The tenant? The tenant. Okay.
254150	259970	Star Trek? Star Wars? I don't know. Nobody's? No Star Wars? Star Trek is, yeah. So, okay, so
259970	265750	there's a lot of hacking time, right? We're not the first. Um, this thing that we found is kind
265750	269630	of related to random number generators. Pseudo random number generators were also not the first
269630	274830	people to discover a poorly seeded pseudo random number generator. Um, we've known about this as
275010	280990	a security problem for a long time. But it still persists over and over again. And we'll explain
280990	284470	if you're not familiar with different types of random number generators, we'll explain that and
284470	290650	then sort of go into the details of why this is a problem in this particular situation. Yeah, so
290650	299770	the generating random numbers is a complex problem for programmers. And to really generate true
299770	307970	random numbers, you will need some type of entropy source. So, for example, from the environment,
307970	314470	people using lever lamps, for example, or some diodes, which are creating noise to then really
314470	321490	create this random stream of data. And on the opposite of that, there's these pseudo random
321490	330610	number generators. And even they work with a seed. So with the seed in place, you will always
331630	342430	generate the same sequence of random bytes with the same seed. And this is exactly where we can
342430	349930	attack if we know the same seed at some point, as it was used in the past, and we can also generate
349930	359850	the same randomness today. Yeah, and I guess this is a known kind of issue with security and
359850	366330	cryptography and generating random numbers being hard. It hasn't really been solved, besides
366330	369750	using some of those entropy sources that are better. But that's not really a practical thing.
369750	375090	So this is even like a CWE, you know, a commonly known vulnerability. If you're designing systems
375090	379550	that have some sort of secure element, you would probably want to study some of this stuff,
379550	383610	right? So it's sort of, I feel like everybody in the security community probably knows these
383610	391390	things, but maybe not. But if you're selling a piece of software that is sold as a secure thing,
391390	396350	you would probably want to know these things. So here is like with CWE, this is one of many about
396350	400670	pseudorandom number generators being these deterministic generators, right? Like what
400670	404110	Bruno said, if you know what's coming in, you know all the numbers coming out, which maybe
404110	409210	isn't always a problem depending on how it's implemented. So here, I can't even see it on
409210	412310	here. So yeah, it's just sort of highlighting the main things about pseudorandom number generators
412310	420270	being deterministic. We recommend maybe like, don't use time as a seed, because time is a known
420270	424890	value. And if you're able to know what time is, even if you don't know exactly the time of how
424890	429250	the random number generator is being seeded, you know a range of the numbers that are going to come
429250	433390	out of the random number generator. And that's what we can take advantage of as we're hacking on things.
436610	442030	So even though many programmers know it's a really bad thing to do, it still happens.
442030	451450	And here are some examples like where it happens. One is the Netscape Navigator, which I think I
451450	460710	used the time and then the process ID plus the process ID of the parent process. So really
460710	469030	reducing the entropy so you can easily guess the seed. Same with the router from D-Link.
469030	480990	This one actually used just the time and then generated the VWPS pin via time, which basically
480990	488770	would allow you if you listen to the network and wait for some VWPS to exactly know what pin it
488770	497890	will be. Then there's QTPath. I think it's the default Unix password manager. And this one was
497890	505050	actually really bad because it not even used the time but the milliseconds. So in the end,
505050	511010	it came down to 1000 possible seeds, which were then used to generate these passwords.
512350	517270	Another example, the Kaspersky password manager also using the time.
517270	524430	Telnod Compass X is actually a German company which is doing alert systems and they had the
524430	530910	management software to write to this FID chips, which you can then unlock doors and everything
530910	538890	and to generate the AES key, they also just use time. So you could go to the door and then brute
538890	549150	force the key just in a couple of seconds. And Milksat, I think this one was also...
550490	556690	there was a fallback for some operating systems which also use time. And then this one was used
556690	564910	to generate private keys for Bitcoin, Bitcoin privacy keys. And then, yeah, they got generated
564910	573130	and I think swiped the wallets like two years ago or one year ago. So yeah, really, really bad.
573130	578330	And yeah, then there's RoboForm, where we talk about today.
578330	582310	Yeah, and this is just a sampling, but you can see the years go back to 1995.
582370	586970	And it's not just software, it's not hardware, it's web stuff. And that's what's really
586970	592210	interesting about this. So this particular project where we're picking on RoboForm,
592210	597510	and I mentioned I'm traditionally a hardware hacker, I normally hack on, you know, embedded
597510	601450	systems and electronics. And that's sort of what I love to do. But I also in that same time,
601450	605910	have dabbled in reverse engineering software, usually firmware related to hardware. But it
605910	610230	was fun to do a project like this, where we're looking purely at hardware and seeing these
610230	617350	implementation problems. RoboForm is a password generator and password manager. It's claimed,
617350	623330	they claim to be the first, so maybe around 2002, not only to generate random passwords,
623330	627110	random passwords, but also to store them, you know, so you can go back to them. And there's
627210	631130	a lot of different password generators that are out there now. I'm just quoting directly from
631130	635250	their website. Because I didn't want to say anything that was incorrect and get in trouble.
635330	640630	So used by millions of people worldwide, individual users and small businesses to government agencies
641830	647330	and leading fortune 500 companies made by a company called cyber systems, I think in Virginia,
647330	652770	Washington, DC. So yeah, one type of password generator. And the reason that we started looking
652770	657310	at this is Bruno and I had been working on some projects of recovering cryptocurrency for people
657310	662430	in various ways, hardware and software stuff. And somebody had contacted us and said, Hey,
662430	669050	I have a lot of Bitcoin locked. And I had used the RoboForm password generator to generate my
669050	675610	passwords that I then encrypted. Or did they encrypt the private key with? Yes.
675610	680490	They had a truecrypt container and there they saved the password for the wallet.
680490	683430	That they had used with RoboForm, right. So they generated the RoboForm password,
683430	688030	saved it in a text file, encrypted it with truecrypt. That partition got corrupted. So he
688030	695850	lost his password to the wallet. So that's sort of how we got into this. And at first, when he
695850	700290	emailed, it was like, what are we going to brute force a 20 character? He thought it was 20
700290	706070	character special characters, numbers, letters, like computationally infeasible to brute force,
706070	710610	right? We're just not going to do that. So I remember turning them down. And then Bruno was
710610	714190	like, well, wait a second. Like it was a year later, I think he contacted us again. And Bruno
714190	718710	was like, well, I had worked on this other project. Maybe we should take a look at it.
718710	723570	Do you want to tell that? Yeah. So it was a password generator, not very popular. It was
723570	728550	called Wireless Key Generator. And like the name suggested, it was to create a password for your
728550	734930	Wi-Fi. And we had a customer before who used exactly that one and also encrypted his wallet
734930	739770	with it. So we had a look back then and it just looked so crappy that I thought, OK,
739770	747650	this can't be secure. And it turned out it wasn't. So it was, I think, using Visual Basic 6. And
747650	754390	this was like the worst randomness I ever saw in a coding language because it was not even like
754390	759890	that you need to guess the seed, but it was the way they implemented it. You have just an
759890	766990	array of two million values that are pre-computed random. And then the seed only defines like the
766990	775790	start position of that list. So it will just, after two million generations, no matter what
775790	781350	seed, you will always have the generated all possible values. So this one was really, really
781350	786730	bad. Yeah. And this, and this, even though like we got into this because of cryptocurrency,
786730	792730	like this is by no means a cryptocurrency singular problem. Anybody that has used this version of
792730	796830	RoboForm and prior versions of RoboForm are susceptible to this type of attack. Actually,
796830	803930	how many of you have even heard of RoboForm? Okay. Like maybe a quarter. How many of you
803930	813310	actually use RoboForm? One, two, three, four, five. That's pretty good. Okay. Um, did you use
813310	820190	it in 2015 or earlier? Now we're like really good. One. Okay. Have you changed your passwords?
820410	825290	Okay. Yeah. Cool. I guess maybe you will after the talk, but yeah, cool. Okay. Um, right. So
825290	829650	it really is, it's something where you could pre-compute, you know, every possible password
829650	834190	that had been generated and that's what we're going to show you. So we started getting into
834190	840150	this project and, um, Bruno started digging through the changelog where, where this is a
840150	846470	closed source piece of software. So all we have really is the changelog, anything that the vendor
846470	851250	decides to make public changelog and, and the binaries. Um, but Bruno had noticed this change
851250	859330	here. Yeah. So we looked at the time and then said, okay, it needs to be version, I think 7.9
859330	866950	or something. And then, um, we saw after that version, um, there was an entry which says
866950	872250	increase randomness of generated passwords, which is pretty weird. That's pretty weird for a
872250	876650	password generator to say, wouldn't you imagine all of them would be, but that was the clue. So
876650	883510	we basically knew from the person we were dealing with, Michael, uh, when his last access to the
883510	889170	wallet was, which was like 2013, I think. So we kind of looked and seen like, okay, what did
889170	892610	anything change? And that's when we saw this increased randomness of generated password. We
892610	898310	go, wait, are all of the prior versions doing something that is not random or less random or
898310	902950	weaker? And it just happened that the version that we were looking at fell into that. So this
902950	906930	applies to everything up to this version. Uh, and then we'll talk about sort of what has
906930	914650	happened since this version, which we don't actually know is the TLDR of that. Um, okay. So
914650	920050	let's get into the process of what we did. Um, Bruno lives in Germany. I live in Portland,
920050	926270	Oregon. Uh, and we did a lot of remote work, which was super fun. And for those who know me,
926270	930830	like I don't normally work with a lot of people at one time. I like to sort of hole up and just
930830	935630	hack on stuff alone. So it's like finding people to work with is really cool. Um, and it was a lot
935630	940730	of fun, like these late night zoom sessions, sharing screens, like hacking on stuff. We did
940730	945530	end up doing some stuff together in person at a conference. Um, it was like, I don't know,
945530	950010	24 or 30 hours straight or something. And then I got on the airplane and fell asleep the entire
950010	956550	time. So it was really like a fun example of like true hacking together. It was really cool. So the
956550	961270	we basically started with some memory analysis and we'll explain each of these steps. Uh, memory
961270	966670	analysis first, static analysis, uh, dynamic analysis, and then we built some custom wrapper
966670	970210	to handle all of that. So if you're from the software world, you're probably like, oh, this
970210	975270	is like a totally normal thing to do. But from a hardware world, it's like it, it, it was interesting
975270	979670	to be able to do it in like a full process. Kind of go through everything instead of just dabbling
979670	983490	with like, you know, one, one tool or the other. So that's, you know, we kind of go through this
983490	990930	process and then, um, hopefully we profit. Okay. So let's go into the demo of things. Um, we were
990930	995270	going to do live demos, but Defcon really was like, you should just record your demos. And we
995270	1000550	know the demo gods, blah, blah, blah. But I like to live on the edge. Um, but I finally gave in
1000550	1005070	and said, okay, we're just recording these. So these are videos, um, and you can play along at
1005070	1009930	home, you know, afterwards and, and see that we're not lying or anything. So Bruno is going to talk
1009930	1014510	about Cheat Engine and we'll go into all the other steps. Yeah. So first we used Cheat Engine
1014510	1022090	and it's originally made for games. I personally use it as a kit for, um, cheating my favorite
1022090	1028290	single player game. So I didn't have to grind hundreds of hours to get my gear and you can
1028290	1037070	actually also use it for hacking. So, um, I hope the video is playing now. Is it playing? We can't
1037070	1042250	see that it's playing. So yes. Okay. Dean is going to be our video, our video thumbs upper for every
1042250	1047330	video. Is that okay? Perfect. Okay. Dean says, okay. So what we did here is a very simple. So
1047330	1052830	with Cheat Engine, you can scan, edit, um, even you can freeze some parts of the memory so it
1052830	1059030	can't be modified by the program anymore. And here we just searched for the generated password
1059570	1066870	and we found it. And which means that, um, other password generators, for example, try to
1067550	1073730	decrypt it in some way that you can't extract it from the memory or, um, try to hide it or remove
1073730	1078550	it after a certain amount of time. Um, because there's a risk involved if you have plain text
1078550	1085570	passwords in the memory, but, um, RoboForm doesn't. And that's already good. And you can actually see
1085570	1094210	that it's, um, found twice. That's one time for the GUI. So what is displayed and one time is, um,
1094210	1099850	the, in the memory of the internal logic, um, we found it. Yeah. And right when we saw that,
1099850	1103470	we're like, oh wait, it's in the clear. Perfect. And then I think we were even,
1103470	1106710	there was a couple of different, there was like a DLL and an executable and we're trying to figure
1106710	1111090	out which piece of the code was plopping that into memory. But knowing that was there, we're
1111090	1116270	like, all right, now it's in memory. Let's try to find out what routine is actually putting it in
1116270	1120070	the memory and then kind of working backwards. So we could then figure out where the actual
1120070	1126610	password generator routine was happening within this entire blob of stuff. Because RoboForm,
1126610	1130010	again, does not just generate passwords. There's all this other stuff that we had to kind of
1130010	1135110	dig through to find the right thing. So we use Ghidra. Thank you NSA. I'll continue to
1135110	1139670	thank the NSA for that. One of the few things I'll thank them for. Or maybe the only thing,
1139670	1146690	actually. Um, so this is, uh, kind of, it's going to show, let's see, I can't see it again,
1146690	1150230	but this is like, this should be a time lapse. Okay. Dean says, yeah. So there's, you know,
1150230	1153630	we're not going to show the whole process, but we basically started with this giant binary
1154090	1158990	and we dug down little by little, starting to, to label things of what we thought it was,
1158990	1163430	of, oh, that looks like this. And we would change parameters and look again. And like,
1163430	1167030	uh, oh, sorry, with Ghidra, we didn't, we were just looking at the, at the static, static side.
1167030	1171750	So things weren't changing. Um, but we basically narrowed it down to a point and Bruno found this
1171750	1176870	first of like, that called a system time, right? It was like, get time. I think it's time 64.
1177110	1182070	And, um, that was like, wait, this piece of code is calling time and then it's doing some stuff
1182070	1186790	and then it's calling SRand. So seeding the, the pseudorandom number generator. That was a pretty
1186790	1192030	big giveaway. And there was a couple other places where there was the pseudorandom number generator
1192030	1196350	being seeded, but there was no other call to time. And we basically figured out that
1197770	1201810	this section was the section that we were actually interested in. Of this whole piece of code,
1201810	1206710	like these couple lines where it's calling the system time, manipulating it, which basically
1206710	1211450	what it was doing, because you can press the, every time you press the generate password button,
1211450	1216770	it hits this code. If you press the button more than one time a second, if there was no
1216770	1221050	manipulation of that time, the time wouldn't increase because this call system time is just
1221050	1227730	returning time and Unix time since 1970, January 1st, 1970 in seconds. So if you hit the button
1227730	1231310	multiple times, they basically added some additional manipulation in there. So you can
1231310	1236190	press the button multiple times within a second and not get the same password. And they basically
1236190	1242510	are just adding a fixed constant or are they subtracting? Are they subtracting a subtraction?
1242510	1246110	Yeah, something like that. Yeah, they were subtracting. No, they were, it was something
1246110	1249230	that messed us up and we'll actually talk about that, but they're doing a manipulation and
1249230	1254750	it basically is just jumping either ahead or backwards in time. So you can still generate
1254750	1259430	the password if you know all of the time. It was just so they couldn't, you know, duplicate the
1259430	1264510	same time in that same button press. So a pretty weak type of manipulation. Then it calls SRAND
1264510	1269310	and then it goes into the actual password generation routine. I guess what we could have
1269310	1273330	done and what we were originally thinking is like, oh, we can just pull out that password generating
1273330	1277670	block, put it into our own code and then just sort of build the wrapper around it.
1277670	1281690	Um, but it was so complicated when we started digging into the function that gets called
1281690	1285730	after that was just ridiculous. And we didn't really want to go through that process.
1286150	1290990	So we eventually thought like, okay, if we could confirm this, we'll just build some, a wrapper
1290990	1295570	that will go and touch those values and then just let the rest of the code that's in the DLL do its
1295570	1304210	thing. So once we could identify the, the static portion of code where we knew that that pseudorandom
1304210	1308930	generator was being seeded with time, then we went to X64 debug and we were actually using X32
1308930	1314330	debug. Uh, and this is our dynamic analysis to be able to debug the system as it's running in
1314330	1319890	real time and see what was happening with the registers and with other low level CPU stuff. So
1319890	1324550	then we could see if we could manipulate it. And this is going to be interesting because again,
1324550	1332690	I can't see stuff here. So, we're going to start it. And I'm pretty sure what I'm showing first
1332690	1337430	is, uh, there's a bunch of break points that we set. So we can actually, you know, run the code
1337430	1341630	and then it's going to hit the break point at certain times when certain pieces of code are run.
1341630	1346770	We basically set the break point that we care about at that same spot that I just showed. So
1346770	1355000	when the system time is being called. And then I'm probably running the, running the, the, the
1355000	1360100	debugger. Eventually the password generator is going to start. The GUI is going to start. And
1360480	1363580	even when you first start the GUI, there's already one password that's in there. So it
1363580	1368200	actually already runs the password generator once. Uh, so that, that manipulation has already
1368200	1374260	happened once. Which for us, threw us off again a little bit. And I think it's eventually going
1374260	1378420	to stop. But I'm generating passwords and if you look, which you probably can't see, the EAX
1378420	1385640	register is directly correlated to the system time. Plus, like, whatever manipulation maybe
1385640	1392300	there was from the, from the call before. And has it stopped yet? Is it just sitting still?
1393140	1399860	Still going. Okay. So, um, I'm going to generate a couple passwords and then at one point I'm
1399860	1403900	going to write down, there was one value that I don't have on this slide, it's on the next slide,
1403900	1411320	I think it's like 66 CF 6550 in hex for EAX corresponds to one particular password. And
1411320	1417300	that's the one that we're going to end up redoing once we let the system generate some more. Has it
1417300	1422980	stopped? Okay. So this is what we care about out of all of that. The two arrows. There's one
1422980	1427760	arrow pointing to EAX and then there's one arrow pointing to the password that's been generated.
1427760	1433620	So those two things are completely intertwined. Anytime we enter the EAX value of that particular
1433620	1441060	time, manipulated time value, it's going to generate that particular password. So let's
1441060	1445560	continue on with that part of the demo and now I'm going to generate another password just to
1445560	1450660	show again that EAX continues to increment because time is incrementing. And then once we get it
1450660	1455620	sort of cleared the EAX value with the new one, then we'll go back and replace it with one we
1455620	1460440	know to show that we can, you know, regenerate passwords that have already been generated from
1460440	1467020	the past. I'm just going to watch your reactions so I'll know when it actually happens. When it
1467020	1488260	does go ooh or something. The tension. Ooh, right? So now we have regenerated a password. In theory
1488260	1493800	with a properly, you know, computationally cryptographically secure system, that shouldn't
1493800	1498560	happen. But this proved to us with the debugger of like, nice, now we can basically feed in whatever
1498560	1502960	EAX value we want for time and the manipulation doesn't really matter because that just changes
1502960	1507540	kind of the date range a little bit. But we could precompute everything if we were able to tap
1507540	1512860	right into that part, hook into that part of the DLL, add our wrapper code around it to get to that
1512860	1518300	part. And this was, this was pretty cool. Oh and this is the hacking time, right? So now do you
1518300	1523600	get it? Right? We're hacking time to change that. So that was, yeah. Um, okay so then the wrapper
1523600	1527240	code, this was something just to put it all together, give us a way that we could precompute
1527240	1532720	all the passwords that we wanted to for the date range that mattered for us. And we did it in I
1532720	1537320	think just, what was it? Visual, I don't even remember. It was in Visual Studio, yeah Visual
1537320	1542940	Studio. And we did it in C, which I know is like taboo now, can't use C, but I use C. And I use
1542940	1547480	assembly language. And it actually was, it was cool because we had to tap into some of the, we
1547480	1551940	had to do some assembly language to, to move some things around to get it properly executing in
1551940	1556880	the DLL. Um, and seeing assembly language really for sort of hardware hackers, that's like, that's
1556880	1561640	what you want to see. Um, because that's the type of level that we work with. So here's the
1561640	1566640	wrapper code. Um, I have a couple slides sort of scrolling through the code. This is all open
1566640	1571500	source by the way, it's on my website, there's a link in the slides and these slides will be up on
1571500	1576940	the Defcon server after the session, whenever Defcon puts them up. Uh, they're also on my
1576940	1583180	website which is grandideastudio.com. I put them on my, that's like my formal website. But
1583180	1587740	everything is there so you could um, already work with it and somebody already has, which we'll
1587740	1593380	talk about. So yeah, this code basically is um, let's see. The video's kind of showing different
1593380	1596840	sections but this first section we're just setting the time values that we want, the time range
1596840	1602000	that matters. And then it should be scrolling down a little bit but kind of showing some
1602000	1605800	functions as we're, as we're getting ready. We're basically, we need to have code that's gonna
1605800	1613060	hook into the DLL so it has to search through the DLL. This is not an exported function. Is that
1613060	1616800	the right terminology? It's not a function that you're normally supposed to access from the
1616800	1620400	outside world, right? I see nodding. Okay, so it's something where we know the code is there
1620400	1624360	but it's not given to the, you know, to the other executable to normally be able to, to work
1624360	1628620	with. So we had to search for a known signature string that we found just by looking in the
1628620	1633740	debugger. Uh, to say okay, let's just look for these kind of op codes and uh, and hope that's
1633740	1641060	the right section in the DLL. So we're kind of searching through for that. And let's see,
1641060	1644840	what else? We're gonna look for the, yeah, so these are all the functions and set system time.
1644840	1649100	I think here's the real code. So yeah, this code here where, you know, we're calling system
1649100	1659870	time and we're basically setting our computer at whatever system time we want. And then, oh,
1659870	1663670	there's also, there's some other constants I'll get into. There's like a bunch of weird stuff
1663670	1666950	that we had to end up doing to make it work. It seems, it seemed easy in theory of like, oh,
1666950	1671850	let's just hook into this DLL and like call the code. But things have to be prepared before
1671850	1678910	that to actually make it work. So where we are in here, is it still scrolling or can you,
1678910	1684870	still scrolling and now it stopped? Okay. So yeah, this is the part that should be searching
1684870	1690670	through the DLL, finding that portion, finding the address of the DLL with the, that, those op
1690670	1695710	codes that we want. And that's the exact same stuff that we saw um, in x64 debug and in
1695710	1699830	Ghidra. Uh, the upper memory is gonna change though, right? Because we don't know where the
1699830	1703230	DLL is gonna be loaded in memory, so we kinda know. But being able to search through it,
1703230	1707430	uh, automatically seemed to make sense. Then there's a whole bunch of different parameters. I
1707430	1710790	don't know if you noticed on that RoboForm screen, but there's one for, do you want to use
1710790	1714750	uppercase, lowercase? Do you want to use letters? Do you want to use numbers? Do you want
1714750	1719110	special characters? Those are all individual settings that get fed into that password
1719110	1723330	generator routine after the pseudorandom number is generated. So we had to figure out how
1723330	1727430	those parameters were configured before we could actually call the, the function that was
1727430	1732250	generating the password. And that took a lot of trial and error and a lot of debugging and um,
1732250	1735950	as it should be, right? If it was too easy, it wouldn't be that much fun. Um, but it was
1735950	1740150	really interesting to kind of see that a lot of those values were, had to be placed in
1740150	1743710	certain memory locations and specific things and that's what that array at the beginning was
1743710	1747890	of like, we just happened to see that oh, this setting was in this one and then we have a
1747890	1752230	couple bytes that we don't care about and then we add another one. And then we get to the
1752230	1759510	cool stuff. Which we're basically looping and we're calling system time, setting all the
1759510	1762490	values the right way and then we get into the assembly language which is my favorite part and
1762490	1766210	I don't really know, I think it's maybe this part that shows the rest of it. But we're
1766210	1769410	moving the parameters into the right spot, we're moving everything into the right spot and
1769410	1775130	normally what was happening is we were getting crashes for days, right? Or over and over
1775130	1777790	again and then finally it's like we're going to try another thing, try another thing. And
1777790	1781630	then it finally worked and we generated a password, we're like holy crap. Um, then we built
1781630	1785570	the loop around it so we're just doing this over and over again, setting the time, calling
1785570	1789290	the DLL, you know, getting the password out. Because the password gets set into some
1789290	1793950	register that, you know, that's where it was that we saw in cheat engine, then we push that
1793950	1797650	into a variable in C and then we print that out. And uh, turns out it wasn't the most
1797650	1803610	efficient way to do it but it definitely like was enough to generate the passwords. So we
1803610	1807370	had all of our passwords, is this, is this actually showing the password generator? Oh it
1807370	1811690	is. Okay, right. So we actually got it working. Um, this is generating all of the passwords
1811690	1817410	starting from whatever 2013 date range we wanted. Uh, at about a hundred passwords per
1817410	1821590	second. Which for us was fine because we only had, it was like a couple months worth so it
1821590	1826330	wasn't a huge amount and it took, on my machine I think it took like 20 hours or something
1826330	1828030	but yours was like super long.
1828030	1834210	Yeah, I think you had the M2 SSD so Windows really limits the, the amount of time.
1834210	1835690	Yeah, there was like disk access, right?
1835690	1836390	Yeah.
1836390	1839290	So I, I needed like three or four days.
1839290	1842710	Yeah, to do the list, right? And that got really frustrating when it's like we tried
1842710	1846810	different password lists that we were generating, plopped them into the password cracker, you
1846810	1852750	know, tried, tried to unlock this, this Bitcoin wallet and um, we kept failing. And we're
1852750	1856850	like, oh my God, is this like, is this our coding problem? Are the parameters wrong?
1856850	1861270	Are the dates wrong? Uh, we kept calling this guy, Michael and um...
1861270	1867350	Yeah. And he was getting like pretty annoyed. I was talking to him and he was like, in the
1867350	1869570	end he was like, oh no, not again, this guy.
1869570	1873110	Yeah, he's like, oh, they're bugging us again. And like he, and then at one point he was
1873110	1877570	like, I'm going to see if I can remember it through hypnosis. Uh, and we're like, oh boy,
1877570	1881850	now we're in trouble. Um, but it turned out, so he had sent us a list of passwords that
1881850	1889050	he had used for other things and all of them except one were 20 characters with specials
1889050	1892130	or without, I think. I think some...
1892130	1896590	He told us he used specials as his original password, but there were some which didn't
1896590	1896990	use specials.
1896990	1899730	Which didn't, right. So he was so sure it had special characters, but it turns out there
1899730	1903730	was a couple that didn't. So we're like, let's just regenerate without special characters
1903730	1909830	because that changes the entire password that comes out. So we finally did that. And Bruno
1909830	1914950	sends me a message like maybe like 20 minutes after we started running that list.
1914950	1915390	Yeah.
1915410	1917470	It's very exciting.
1917470	1922390	Yeah. I also didn't thought it would happen because he was so sure. He said like, nah,
1922390	1927670	it was special characters, like 99%. And then we got it.
1927670	1938240	And then we got it. Yeah. So here we had to block out all this. Thank you. We had to block
1938240	1942480	out all of the transaction history because I know that some of you, if not all of you
1942480	1946220	would go and try to track it down and now like, you know, see what this guy's doing
1946220	1951700	and spy on the blockchain and whatever else hackers do these days. But we can see the
1951700	1957980	password is actually generated May 15th, 2013. And that was actually a little earlier than
1957980	1960600	we thought also based on the transaction history.
1960600	1964740	But it could also be that he pressed the button twice, right?
1964740	1968880	Yeah, right. He could have pressed the button enough to like change where that manipulation
1968880	1969700	was happening.
1969700	1975040	Because like how they did it, they, I think increased then the time by a fixed amount,
1975040	1977680	which was like around eight or nine days.
1977800	1981660	Yes. And it right. So it was subtracting a negative number and that's what threw us off.
1981660	1986460	We thought it was adding or we thought it was just subtracting the number, but it was
1986460	1991680	subtracting a negative number, which is adding. So we were going the wrong way in time to
1991680	1994980	try to create our list, but ultimately it ended up working. But it was pretty dark for
1995080	1997900	a while. There was a couple of days when it was like, we just went through all this reverse
1997900	2001420	engineering work. We can generate all these passwords. And it was like, is all of this
2001420	2005100	work going to go wasted? Uh, I mean, I guess it wouldn't be wasted anyway because other
2005100	2008560	people could use it. But like from our perspective, it would have been a bummer.
2009160	2018080	Um, as part of this process, uh, sometimes I make YouTube videos and this was a project
2018080	2021580	where we were like, this would be super fun to film this process and make a fun video
2021580	2026280	out of it to kind of show, you know, the story and the drama. Um, so how many of you have
2026280	2031760	seen our, our video on this? Oh wow. That's like, that's impressive. That gets like a
2031760	2036320	quarter maybe. That's good. Um, everyone else, hopefully you watch it. And uh, these are
2036320	2042840	just some behind the scenes of what it takes to film videos like without just using your,
2042840	2048700	you know, iPhone. Um, but this particular project, the, the customer who had this wallet
2048700	2054680	is from Germany, but he was in Barcelona on vacation and Bruno's in Germany. So we started
2054680	2061900	kind of our, our process in the video in Germany. We did interviews, um, and then flew. Oh,
2061900	2069240	here's our film crew by the way. And then we flew over to Barcelona and Michael, the,
2069240	2073160	this guy thought that we were just going to ask him more questions and interview him again.
2073160	2077820	Like he didn't know that by that point we had done it. Um, so he was like, Oh God, now
2077820	2081760	they're just going to ask more things. Um, so it was actually pretty funny. We're not
2081760	2084780	going to reveal like the full thing cause that's why you should watch the video. It's
2084780	2089420	way more exciting when you watch it there instead of on a tiny screen here. Um, but
2089420	2093920	we basically set up this whole environment like, um, you know, publishers clearing house
2093920	2100480	style kind of reveal, uh, which was totally ridiculous and yeah, very, very fun. Um, and
2100480	2104000	that's part of it is like being able to share this information and, and, you know, share
2104000	2109060	some technological stuff is super fun and being able to make videos and like get creative
2109060	2113460	with things that we're doing otherwise equally as fun. So this stuff is really cool. And
2113460	2117920	also you can see how, you know, safety third, um, for those who actually can see the picture,
2117920	2122240	there's two guys holding a gigantic ladder as one guy's like fiddling with some lamps
2122240	2128460	and electrical stuff. Uh, I probably shouldn't have documented that, but definitely not safe.
2132080	2139800	So yeah, um, once we found this issue and we solved our problem, we're like, awesome.
2139800	2144500	Okay. Michael's taken care of. We recovered his Bitcoin. Yay. But part of the process of
2144500	2149620	hacking, in my opinion, is sharing that information with other people so they can learn from it
2149620	2154700	and use it. And that's equally as important as that's equally as important as the success
2154700	2159220	of the project, right? If you just hoard all your information and not share it with anybody
2159220	2163980	else, what's the point of hacking? I think that's, that's something I feel very strongly
2163980	2169700	about and something that, that has been sort of ingrained in me since my younger days of
2169700	2173160	being a hacker. So we solved this problem and we're like, all right, how are we going
2173160	2177820	to disclose this? You know, there's responsible disclosure, um, which I don't really like
2177820	2183340	that term because it implies that not doing that is irresponsible. Um, and there's all
2183340	2189500	sorts of things. Like when I was at the loft back in a long time ago, uh, we would kind
2189500	2194360	of tell the vendor like, Hey, we're going to release this in a week or whatever and
2194360	2198060	really force them to fix things. And now there's a little more kind of ethical dilemma about
2198060	2203580	like how much time do you give a vendor? Do you tell the vendor? We looked up and, and
2203580	2207840	went to the RoboForm website, looked around online, looked at different bug bounty platforms
2207840	2212220	and couldn't find any indication that this company had worked with hackers before or
2212220	2216280	worked with good faith researchers. So we got really worried because in this day and
2216280	2222140	age you sort of expect software companies will have a security at whatever contact or
2222140	2228420	something, right? Like it was scary to not see that. So we couldn't find it. We start
2228420	2232580	discussing like what's the, what's the reality of the situation? Are we going to get sued?
2232580	2236560	We know from DEF CON history there was even a talk actually, I think was it supposed to
2236560	2241600	be today, that received a cease and desist letter. And now they're working with lawyers
2241600	2245540	and maybe they're going to be able to give the talk on Sunday. Like it's a real risk for,
2245540	2249380	for researchers. And nobody wants to get sued, especially when it's a company that has lots
2249380	2253840	of lawyers and we're like individual people that don't want to deal with that. Um, but if it
2253840	2258460	came down to it, we would. Uh, and I remember also talking to my wife about this of like,
2258460	2261580	should we release this information? Like I really want to talk about it at DEF CON and do
2261580	2266380	something with Bruno like on stage. And she's like, like hell of course. Like you're a hacker.
2266380	2270640	Like you need to go against these companies and do it. And if you get sued, at least you'll
2270640	2282040	have given the talk first. Which I agree with. So that, that's my little rant. So um, we
2282040	2287500	reached out to, to Kim Zetter who is a fantastic journalist with cyber security. Um, and has
2287500	2290980	really been pushing, you know, the good of what hackers can do. And also has written some
2290980	2296520	books about some like wild state sponsored adversary type of stuff. Um, and she wants to
2296520	2300800	write about the story. So we're like, great. She can reach out to the company and kind of get a
2300800	2305940	sense of how litigious they are, like what's going on. So she wrote the story, reached out to
2305940	2309260	them to get some comment about our work. And they basically were like, oh we fixed the
2309260	2313100	problem, not a big deal. And then she wrote back and was like, well how did you fix the
2313100	2321320	problem? Nothing. Crickets. Um, and I thought that was a really, also another kind of
2321320	2325020	indicative thing. Right? Of like, okay, if they're not responding, like, it should be very
2325020	2328780	clear if you may, if you fix a security problem, first of all you should notify all your
2328780	2333140	customers if you make a, a significant change like that. Um, which didn't happen. But you
2333140	2337100	would also want to be very proud of your changes and say, this is what we did to fix it so
2337100	2341980	you can trust our software that you're running. None of that. This is, it almost feels
2341980	2347300	like I'm in the 90s again, talking about this stuff. Um, so she didn't get any, any
2347300	2351800	meaningful comment. Article came out, no, no comment. You know, a lot of journalists
2351800	2356040	reached out, nothing. Um, maybe this is, maybe this is more typical than I think. But I
2356040	2361200	was really surprised of not getting any sort of feedback. Uh, and then we decided, okay,
2361200	2365260	article came out, same time, let's release the video and then let's do our Defcon talk.
2365260	2370320	And I think it's, you know, it's, it's, it's a concern. I guess I also want to ask, how
2370320	2374560	many of you have been in the same situation of like finding some vulnerability and being
2374560	2379580	worried about talking to the vendor and, and getting sued? That's a lot of people. That's
2379580	2386620	probably 25, 30 people just in this room. Um, multiply that by the number of people at
2386620	2390760	Defcon, multiply that by the number of people outside who are also hacking. Like, is this
2391300	2397920	a significant enough problem? And vendors know that. Um, but it is, it is a real thing. So
2397920	2402080	anyway, yeah, we released all of the information and uh, and I think that's the important way
2402080	2407540	to go and, and hopefully, hopefully I, I don't, uh, make my next video from jail or
2407540	2412800	something like that. Um, so some future work, right? So we don't know how they fixed the
2412800	2416740	problem. Maybe future versions, you know, they say they increased the randomness of
2416740	2421500	generated passwords. Maybe they did. We searched through the code, we couldn't find any
2421500	2426620	direct calls to system time. It could have been obfuscated, we don't know. Maybe that's
2426620	2430680	future work. Maybe, maybe not for us, maybe for one of you who go, ooh, let's go dig into
2430680	2436440	this, right? And see what they fixed. Um, already since we released our code, uh, my
2436440	2442840	friend, our friend Dean Pierce from Portland, whoo, 503, um, has already taken our code and
2442840	2448060	optimized it to be over 600 times faster. Almost probably a thousand times faster
2448060	2453380	depending on the machine where we were generating a hundred passwords a second. Dean was
2453380	2461220	generating 68,000 passwords a second. Uh, per core. So he made it multi-core and he removed the
2461220	2465940	need to directly set system time, which requires administrator access, by getting rid of
2465940	2471620	that whole call to system time and just putting a value into that register. So you don't
2471620	2475580	have to call system time, you just plop whatever Unix time you want into there. And then what
2475580	2479240	else did you do? You did one other thing, um, oh, you don't need to, uh, to call the DLL
2479240	2483640	each time, which in our code we're calling the DLL because it's like resetting some things
2483640	2488900	that we're not exactly sure about, which takes a lot of time. You're just reseeding the
2488900	2499140	random number generator directly. Oh, okay, so it's knopping out part of, so you're
2499140	2503000	patching a different part of the DLL, knopping out some parts that's reseeding something
2503000	2507800	so you don't have to keep calling the, the DLL, which is a huge time savings. Um, and then he
2507800	2512140	made a command line. Our code you had to like change the parameters, recompile it, run it.
2512140	2516160	His is now command line, you put in your start time, your end time, your parameters, and you
2516160	2520540	let it run and now you can create your rainbow, you know, rainbow tables of all of your
2521100	2526200	passwords with the RoboForm password generator, uh, that have been computed prior to
2526200	2532620	apparently their fix in, uh, in 2015 for 7.9.14. And maybe, maybe other stuff. Who knows
2532620	2539490	what's going to come out of this? Uh, and a couple of resources. Again, this, these slides
2539490	2543410	will be available. These are clickable links, um, but all the code is available. All of
2543410	2547870	Dean's code is also available, um, on GitHub and also linked to from the website and then
2547870	2554190	the original Wired article and then the video, uh, that is, um, is on YouTube. So that's our
2554190	2562790	story about hacking RoboForm. Any last words? I mean, this should also really put in the
2562790	2568890	perspective that, uh, I showed you the examples of the, um, poor seeded random number
2569390	2576750	generators and there was like you standard Unix password manager and Kaspersky. So it is
2576750	2581830	probably in many things we haven't checked yet just because we thought, okay, this must be
2581830	2587250	secure. So yes, widespread, right? This is not the only thing it's still happening. Go out
2587250	2592970	there and, and find random number generators and you too can also hack time. So thank you
2592970	2593810	for coming.
