start	end	text
0	5840	Now we have Filipe Proteus, who will be going ahead and giving a talk on crushing crumbs
5840	11300	of information to eat a whole cake, as attractive as it sounds. A little introduction about
11300	18940	Filipe. Filipe works as a security researcher at TensorSecurity and he has graduated in
18940	24840	information security and has a master's in systems and computing engineering from a university
24840	31040	in Brazil. He has over 10 years of experience in information security and has an emphasis
31040	36240	on networking, data visualization, and threat hunting. And he's also presented in a lot
36240	39940	of conferences such as Black Hat and DEF CON, so yes, we are seeing him again at DEF CON.
40060	41660	So welcome, Filipe.
48130	49770	Thank you, thank you very much.
56750	58310	Recording in progress.
61550	67370	Hopefully everything is set up. Everything is good? Hi, everyone. Nice to have you all
67370	72990	here. So let's start with crushing crumbs of information to eat a whole cake. It's a
72990	81430	funny name, right? So who am I? Well, thank you for the introduction. My full name is
81970	88090	Filipe Expósito, but I'm also known as Proteus. Ten years of experience, father of a girl.
88090	92490	I do bug bounty when the above items allow, and I'm also a blue team instructor when the
92490	99970	above items allow. And my main job, I'm a security researcher at TNT Security. TNT Security
99970	107930	is a company, it's a cloud security company that works with cloud, and we also have a
107930	113770	product that does third-party risk management. And as my job as a security researcher in
113770	118050	focus on third-party risk management, we all think about supply chain and this kind of
118050	125050	stuff. And as a motivation for this talk, thinking about supply chain and this kind
125050	132350	of stuff, I just realized that we as a society, we rely not only on each other as people,
132350	137990	as persons, but in our governments, because they have data on us. They know how much we
137990	144610	make per month, yearly, and this kind of stuff. But also services, like electricity, gas,
144610	150610	internet, all this kind of stuff. So that creates a huge supply chain of trust. Well,
150610	156710	you'll see it. But also relationships. So, for instance, here we have a... I don't know
156710	163370	if you guys know about this, but this is an electrician that works back in Brazil. So
163370	170050	an electricity company knows about your name, where you live, how much you spend in energy,
170050	175650	and if you're paying day by day. So they have to know all this kind of information
175650	183590	to provide you services. By the way, if you're interested in supply chain, TNT has a newsletter
183590	191050	called Alice in Supply Chains. So if you like the theme, just go subscribe. So coming back
191050	198190	to our theme, that is supply chains. So this happens with a not really close friend of
198190	203030	mine, but someone that I know. I don't know if everybody knows, but back in Brazil, marijuana
203030	212750	is illegal. So it's illegal. So what happens is this friend of mine, he got caught by the
212750	220790	police because someone told to the police that his electricity bill was like over 2,000 reais,
220790	227030	like really huge electricity bill. And why he has that electricity bill? Because he's
227030	233490	growing marijuana inside of his place. So he has a three-room place, one room for growing
233490	241350	the marijuana and stuff with hot air and that kind of stuff, the other room just to make the
241350	248670	flowers grow, and he controls all the weather, the humidity, and everything plus electricity,
248670	253830	right? So someone tipped the police with his electricity bill, the police went to his home,
253830	260910	and arrested him. So the same can occur in a lot of services that we rely on. So this can
260910	268590	happen with internet provider, water, and gas, and so on. So I was thinking, how can we exploit
268590	277930	those relationships? So we could hack every single company that we rely on any kind of
279550	285190	providing services, so hack the planet, but that would be unfeasible, right? Nobody has the time
285190	292170	to hack like 10 and 100 companies. Or wait for the company to be hacked, which will happen,
292170	299110	and get the leak, but that's kind of boring, we have to sit and wait. So I start to wonder,
299110	307070	what's the minimum crumb of information do I need to get, for instance, anyone's electricity bill?
308570	316270	And just taking my example, I figured out that with just the CPF, it would be enough for me to
316270	321610	get my electricity bill. So if I know the CPF of anyone, I would also be able to get the electricity
321610	327490	bill for that people as well. So what is the CPF? CPF is really similar to the social security
327490	333750	number in the United States of America. Every single Brazilian has at least one, and here I
333750	341210	at least because there are some fraudsters, they're able to get two, three, or perhaps five.
342810	350150	And by being unique for each Brazilian, that makes an awesome primary key for all databases.
350150	355670	So this is the format of the CPF, it's 11 digits. The first
357750	367270	eight digits are unique for you. The tenth digit here, the ninth digit here, it says the orange.
367270	374170	So as I live in Rio de Janeiro, my number here is seven. If you live in Sao Paulo, it's six.
374170	379110	The same occurs with the social security number, right? You guys have numbers splitted by regions.
379110	386510	And the last two digits here are digits to verify if the first ones are right. So there's
386510	393130	some sort of calculation that you sum, divide by two, do some math, and you figure out if the
393130	402410	number is right or not. So if every single piece of information, you can get a good intel on it.
402410	409710	Here we have an example of a bank in Brazil, that if you click on recover my password,
409710	416010	and you put the CPF, if the CPF is not valid, or the user don't have an account on that bank,
416010	421790	it returns an error. But if that user has an account in that bank, it returns success.
422250	428130	So it's enough to me to know if somebody has an account in that bank, I can perhaps phishing him,
428130	435670	or send a mission to him, or whatever. And here we have another example in another bank in Brazil,
436050	442330	small bank, but if you know email and the CPF, you can figure it out if he has an account or not
442330	450410	on that bank as well. So another really good source of information that we have back in Brazil,
450410	457750	it's called PIX. And the PIX is a new system that we have like the last three years, I guess,
458130	465750	but it's an instant payment system. Basically, you just have to know a key for someone that you want to pay,
465750	471790	and you can have four kinds of keys. You can have the cell phone as a key, the CPF as a key,
471790	479310	an email address as a key, and a random key that might be shared by a QR code. So these numbers
479310	489170	are from July 2022, but we can see here that CPF has more than 100 million keys, cell phones has
489170	497870	98 million keys, emails around 70 million keys, and back in Brazil we are only 200 million,
497870	505250	214 million, and there are at least 470 million keys in CPF. So it's a really huge database.
505810	517270	So what you can get with the CPF? If you do a PIX to pay someone, and in this example here I was
517270	524830	getting the cab to go to the airport to come to Vegas, and I asked the guy the CPF, and he gave
524830	533650	me the CPF, I paid him here just an example, just one cent, and it gives me the full name of him,
533650	541250	here it is blacked out, but not only it gives me the full name, it also gives me the CPF,
541250	547750	but I already know the CPF, right? But it gives me the bank account where the money is going to.
548690	555530	With this bank account I would be able to go to another bank, try to recover his password,
555530	563110	with his CPF, and then it brought me another two pieces of information, another two little
563110	570730	breads, brought me the cell phone number and also the email number. But realize that not the full
571910	579150	cell phone number and not the full email address, it has stars to hide information from me, right?
579150	586670	Well, from the email we can see that the name of this guy was clever, and we can see that
587540	595930	his email starts with C, and the other stars part here are the rest of his names,
595930	601690	he also starts with D, so we can try to imagine what his email address is.
602290	610470	But even if I didn't know that, we can keep searching for information. So I just saved
610470	617270	this information on my database, and looking for his phone number, I figured it out. Well,
617270	622350	if we have four digits here, back in Brazil all the cell phones start with nine, then have
623730	629070	another nine digits there, but the last four numbers we already know, right? So it only
629770	635350	gives us a thousand possibilities to try. Would it be hard to try or brute force a thousand
635350	640750	possibilities however you want? Yeah, it would be, at least boring. But we can go to another
641650	647210	cell phone provider and try to figure it out if he has an account on that cell phone provider,
647210	654290	and it turns out that he has. And by checking on his CPF again as an input source,
654830	659930	and trying to recover his password for that cell phone provider, it got me,
659930	666430	how do you want to get your password? It's by SMS or email? Well, let's check out the SMS
666430	674350	possibility, right? So it masks the four numbers in the middle, but I already knew the last
674930	681270	four numbers, so I already know these two, they gave me the first two, now I only have
681930	689550	99 possibilities to brute force, right? But there is a catch on this. There is also another
689550	697650	website that tells you from which cell phone operator that number is. So if I go to that site
697650	705710	and try to brute force like 91116497, it's just a cell phone from the cloud, he would say no,
705710	710690	it's not, this cell phone doesn't exist. But if I try another number, and it's from
710690	720790	the cloud, it's the cell phone operator, and by doing this, I can reduce these 99 possibilities
720790	728930	to at least 25. And now it's feasible to call 25 numbers to figure out if it's his number, right?
728930	738790	Things are getting easier. And by the email, if we check the email here,
739330	747070	we can see that, well, we already know the CD and a lot of stars at ho, a lot of stars.com,
747070	755810	but when we check on the cell phone providers, we already know the TLD, now it's hotmail.com,
755810	763270	but not only this, it gives me the last letter here, the R, but not only the R is important
763270	769450	here in the TLD, the matching number of stars is also important, because now I know that
770150	777710	those stars, each star represents at least a letter, or a number. So I'm reducing the space
777710	783710	to brute force for this kind of information. And we can look for leaks on emails that match
783710	789730	that pattern, and it would be easier to find more information about him, right?
789730	798090	So coming back to the electricity bill, I check in another endpoint on the same website, so
798910	804990	if I can try to recover his client code, client code is basically how the company calls you,
804990	813130	right? And to recover his client code, the first time that I put the CPF and click on proceed,
813130	821150	it gives me five options of address, where he lives. All right, okay, so what I did was just
821150	826190	refresh the page, and by refreshing the page, every time that I refresh the page, it gives
826190	832950	five different, five new positions, but just one repeats. So trivial to figure out where he lives,
832950	838690	right? Well, we can put this on the Google Maps and find out where he lives. Actually,
838690	847130	not the true place here, I just put some mark on the map, but it's in this region where he lives,
847130	853950	right? So yeah, now we have the CPF, we have the cell phone, we have the email address,
853950	861890	or partial email address, and we also know where he lives. We can use all the kind of
861890	867270	social information that we have. So here, I don't know if it happens the same here, but
867270	875730	when you do your taxes, and the money sometimes has money to give you back, and we have a website
875730	883690	for this. So if you put your CPF and your birth date, and fill in this gap here, it will return,
883690	889610	okay, you have money to receive from the government, and which bank and agents we are
889610	901510	going to put this. So I did this, through a leak, I found the birth date of this guy, and went to
902000	909490	this website, and figured out that the agents that he receives was a predestined agent, it's a
909490	916250	Brazilian bank, where the bank lives, and by looking at the Google Street Maps, I figured
916250	922350	out it's a prime bank. And by being a prime bank, that means that he makes at least 10,000
922350	930890	reais monthly. So now I also have some kind of idea how much money he makes, right. And fun
930890	939470	thing is, it works not only websites. Back in Brazil, we have SMS bots, WhatsApp bots, so
940550	945590	we can interact with those bots, and just provide some piece of information that you have, and we
946150	952530	reply you with some information that you need. So I asked him, I asked this bot to get an
952530	960950	energy, it's a gas company, to cook, not fuel, and I asked him, all right, can I give a second
962930	969190	paper to pay, about his bill, and all right, give me your CPF, I already knew the CPF,
969190	977930	and then he returns with a payment code, with the value of his account, of gas. So now I know
977930	986870	that he, or not his wife, do not cook outside, because the value of the gas is not that much,
986870	994910	it's enough for people to have hot water, and cook at home. So with those little pieces of
994910	1001310	information, you can start grabbing a much more bigger picture from your target, right?
1001710	1009570	And sometimes, we have to look further, and this is another bank, back in Brazil, and if you provide
1009570	1016630	the CPF, the website just does nothing, but if you look at the F12, and the network tools,
1016630	1023350	and the return, we're going to be, not only the CPF, and if he is registered in the site,
1023350	1030570	but also the full name of the people who is registered. And also there are some side effects,
1030570	1035670	sometimes, yeah, some services, when you try to recover the email, you're going to send an email
1035670	1042410	to your target, letting him know that he's being targeted by someone, and there's some kind of
1042410	1049470	examples, but the main problem that I want to solve here, is if I only know just one piece of
1049470	1055230	information about that target, how do I pivot and find other piece of information to get the
1055230	1062150	whole cake, or to get the whole picture? So, when I start this, I start to catalog all those
1062150	1070150	information, so the name of the website, the URL, if the URL has a capture or not, which kind of
1070150	1076350	input I have to provide on this website, and which kind of returns to me.
1076350	1084950	So, I decided to use YAML files because they're easy to write and to read, and one smart thing
1084950	1092290	that I put here, it's input. Sometimes websites need end inputs, like you need to know the CPF,
1092290	1096950	the birthdate, and the year, but sometimes you only need, like PIX, you only need to know one
1096950	1103950	information of those. And so, those websites that only need one information, it's the OR thing,
1103950	1111250	but you can mix both. So, this is the kind of end-to-end relationship between the input data.
1111830	1116370	And this is what this website returns, right? It returns the full name, the bank,
1116370	1122610	the banking agents, and the taxes result, if it has money to come back.
1123410	1131710	So, with this information, I graphed this, I put this in a graph, and created a software that I'm
1131710	1138410	calling Browse, it's like Brazilian open source information, but this kind of trick can be used
1138410	1144950	by anyone in any place, right? Just try to recover a button, design the YAML for yourself,
1144950	1156720	and use this tool to figure it out. So, here we have a show of the help here in the tools. So,
1156720	1164200	you put a path on which data source you have, the "-sf", show you fields that you have as input.
1164920	1170860	And what I know, what I know is basically, if I only know the CPF of someone, I put the here CPF,
1170860	1177140	but if I know CPF in birthdates, I put CPF in birthdate, and we'll transverse the graph,
1177140	1183920	figuring out which kind of information I have enough for OR, and get this field, or if I have
1183920	1190080	to have more information about this target to get those information, right? And I also put an
1190080	1200380	option to export to Neo4j, because, well, it's better to see graphics, right? And just by loading
1200380	1207660	Brazilian data sources that is available right now on the GitHub, actually it's not publicized yet,
1207660	1214660	I have to come back to Brazil and put my USB-C token to make the project public, but I will do
1214660	1222740	on Monday. But here, I will turn available to everybody 17 sources of information, but I have
1222740	1228780	at least 40 in my private database. And by just looking for which fields you have to figure out
1228780	1235020	for inputs, now here we have the CPF cell phone, UF is state, father name, birthdate, full name,
1235840	1243880	SNH is the driver license, mother name. I parse all those information and put it in a graph,
1243880	1249860	so this is the Neo4j graph for this, for all those sources that I have.
1251680	1259320	But I have a little damn time, so I record it, just because I don't want to play with the gods
1259320	1267060	of the demo, right? Well, this is my fourth time speaking in Vega, so I won't try my luck.
1274180	1285460	So, basically, you can run the script, you have the DS as a path for data source,
1285460	1290380	SSF to show all the fields that we have, the graph, this first graph here, it's like,
1290380	1298020	will pop up in image, and I created a smaller version for this demo, just to show up
1298020	1308390	the capabilities of this project, right? So, this is all the Brazil data source that I have,
1308390	1317930	now it's only 13 public, and I have changed for temporary, and with just five sources,
1317930	1327450	so that's what's going to happen with this demo, right? So, let's take a look at those data sources
1327450	1340990	that we are using in this demo. So, it's cell phone operator, PIX, company energy,
1340990	1352990	recover number client, and another one that I... So, let's figure it out, which fields do we have
1352990	1359630	to have inputs to make this work? So, from these five sources, the input fields are CPF, cell phone,
1359630	1380870	email, year, CNPJ, and birthday. So, we can graph it, that's called PNG, we'll just split a PNG,
1384070	1390850	right? And it shows the relationship between the input nodes and the return nodes,
1390850	1396950	it's like really small, but you can zoom in and get this information, so,
1396950	1405090	zoom out, and just checking this relationship here from two fields are the PIX, so, if I have
1405090	1412610	the CPF, I have to go to the PIX to figure it out which bank it has, to get the election
1412610	1422630	biometry, if the guy has biometry collected to vote, I know which fields I have to have,
1422630	1430150	and this kind of stuff, right? But the most important here is with which information can I
1430150	1439250	can get the rest, right? So, this is the option that I call what I know, and if I only know
1439250	1445350	about the CPF of this person, of this target, these are the information that I can get back,
1445350	1450490	the full name, full address, partial CPF, election status, bank account, election biometry collected,
1450490	1458930	and his energy company client number. But if I only know the birth date,
1458930	1464510	the only thing that I can reach is the bank agents and the full name of his, right?
1464850	1480720	And if I know the CPF and the birth date, I can reach much more information, right?
1486080	1513290	So, this was the first one. Here's the second one, showing the Neo4j option, so you have to
1513290	1523290	pass a config for the Neo4j, and it will put on the Neo4j, and then you can carry as much
1523290	1529970	information that you want. On the Neo4j, I choose map this relationship between AND and OR,
1529970	1538070	just to get easier to make carries about those nodes. So, with the CPF, only the CPF,
1538070	1545170	I can get the election, the election status, the full address, and this kind of stuff. And
1545170	1554810	I also can get the partial CPF, and makes easier to carry information using the Neo4j stuff, right?
1557050	1561550	So, with the cell phone, I can figure it out, the operator of the cell phone,
1561550	1565130	or with the cell phone, I also can figure it out the bank accounts, because the peaks,
1565130	1581030	that source, and things go on like this, right? So, as a future work,
1581030	1587170	one thing that I felt that I have to improve on this project is to uniform the input fields.
1587230	1593550	As you see, I made the code in English, but there are some fields that make more sense in Portuguese.
1594470	1598630	But I have to figure out a way to uniform those input and output fields
1598630	1605710	to avoid confusions. Also, I add some regex on this, add more sources, so you all are
1607170	1611410	invited to contribute with this project. You can just create the sources, United States,
1611410	1618010	sources of your country, whatever, and submit your mail files there. One thing that I also
1618010	1623830	figured out that's kind of important is to add some context on those filters. For instance,
1623830	1629190	if I know the CPF, it's from the state of Sao Paulo, I just want to look at the sources from
1629190	1634470	the state of Sao Paulo. So, the electricity company back in Rio is not interested enough
1634470	1639390	for this, right? And also add some browse information. So, if you remember the first
1639390	1644390	email that I showed you guys has some XPath, because I already started playing with some
1644950	1650090	browsing automation, but it's not done, so it's a future work in progress.
1651790	1657750	And for conclusion, user interface and user experience must be taken account for security.
1657750	1664890	So, basically this problem is because security teams do not interact with user experience,
1664890	1671630	user interface, and there isn't some sort of norm or regulation on this. So, maybe we have to
1671630	1678370	figure out a way to recall the passwords and get information from users without showing that much
1678370	1684130	of information. So, until there is some kind of regulation or norm or best practice guide,
1684130	1689610	anything like this, we still have room to exploit this kind of fragility, right?
1689790	1695830	And the same can be applicable to several countries and different contexts. So, go for it,
1695830	1701670	download the code, create your own sources, start to catalog. Like these 40 sources that I have,
1701670	1709290	I took like... it's not my day-to-day job, but I do it for the last two years, cataloging,
1709290	1712930	oh, just hit another website, figured it out, okay, this is the information that I need,
1712930	1721050	this is from the output, save it on the EML, and then let it there. So, that's it, guys.
1721150	1724810	That's all, folks. Well, thanks. If you have any questions,
1733310	1739250	so, the code and data sources will be available at GitHub. And a special thanks for Corvolino,
1739330	1745210	a guy who helped me to test, Borghini, Sierra, and Motoro, who also helped me with the tool,
1745210	1747050	right? Thank you very much, guys.
