Now we have Filipe Proteus, who will be going ahead and giving a talk on crushing crumbs of information to eat a whole cake, as attractive as it sounds. A little introduction about Filipe. Filipe works as a security researcher at TensorSecurity and he has graduated in information security and has a master's in systems and computing engineering from a university in Brazil. He has over 10 years of experience in information security and has an emphasis on networking, data visualization, and threat hunting. And he's also presented in a lot of conferences such as Black Hat and DEF CON, so yes, we are seeing him again at DEF CON. So welcome, Filipe. Thank you, thank you very much. Recording in progress. Hopefully everything is set up. Everything is good? Hi, everyone. Nice to have you all here. So let's start with crushing crumbs of information to eat a whole cake. It's a funny name, right? So who am I? Well, thank you for the introduction. My full name is Filipe Expósito, but I'm also known as Proteus. Ten years of experience, father of a girl. I do bug bounty when the above items allow, and I'm also a blue team instructor when the above items allow. And my main job, I'm a security researcher at TNT Security. TNT Security is a company, it's a cloud security company that works with cloud, and we also have a product that does third-party risk management. And as my job as a security researcher in focus on third-party risk management, we all think about supply chain and this kind of stuff. And as a motivation for this talk, thinking about supply chain and this kind of stuff, I just realized that we as a society, we rely not only on each other as people, as persons, but in our governments, because they have data on us. They know how much we make per month, yearly, and this kind of stuff. But also services, like electricity, gas, internet, all this kind of stuff. So that creates a huge supply chain of trust. Well, you'll see it. But also relationships. So, for instance, here we have a... I don't know if you guys know about this, but this is an electrician that works back in Brazil. So an electricity company knows about your name, where you live, how much you spend in energy, and if you're paying day by day. So they have to know all this kind of information to provide you services. By the way, if you're interested in supply chain, TNT has a newsletter called Alice in Supply Chains. So if you like the theme, just go subscribe. So coming back to our theme, that is supply chains. So this happens with a not really close friend of mine, but someone that I know. I don't know if everybody knows, but back in Brazil, marijuana is illegal. So it's illegal. So what happens is this friend of mine, he got caught by the police because someone told to the police that his electricity bill was like over 2,000 reais, like really huge electricity bill. And why he has that electricity bill? Because he's growing marijuana inside of his place. So he has a three-room place, one room for growing the marijuana and stuff with hot air and that kind of stuff, the other room just to make the flowers grow, and he controls all the weather, the humidity, and everything plus electricity, right? So someone tipped the police with his electricity bill, the police went to his home, and arrested him. So the same can occur in a lot of services that we rely on. So this can happen with internet provider, water, and gas, and so on. So I was thinking, how can we exploit those relationships? So we could hack every single company that we rely on any kind of providing services, so hack the planet, but that would be unfeasible, right? Nobody has the time to hack like 10 and 100 companies. Or wait for the company to be hacked, which will happen, and get the leak, but that's kind of boring, we have to sit and wait. So I start to wonder, what's the minimum crumb of information do I need to get, for instance, anyone's electricity bill? And just taking my example, I figured out that with just the CPF, it would be enough for me to get my electricity bill. So if I know the CPF of anyone, I would also be able to get the electricity bill for that people as well. So what is the CPF? CPF is really similar to the social security number in the United States of America. Every single Brazilian has at least one, and here I at least because there are some fraudsters, they're able to get two, three, or perhaps five. And by being unique for each Brazilian, that makes an awesome primary key for all databases. So this is the format of the CPF, it's 11 digits. The first eight digits are unique for you. The tenth digit here, the ninth digit here, it says the orange. So as I live in Rio de Janeiro, my number here is seven. If you live in Sao Paulo, it's six. The same occurs with the social security number, right? You guys have numbers splitted by regions. And the last two digits here are digits to verify if the first ones are right. So there's some sort of calculation that you sum, divide by two, do some math, and you figure out if the number is right or not. So if every single piece of information, you can get a good intel on it. Here we have an example of a bank in Brazil, that if you click on recover my password, and you put the CPF, if the CPF is not valid, or the user don't have an account on that bank, it returns an error. But if that user has an account in that bank, it returns success. So it's enough to me to know if somebody has an account in that bank, I can perhaps phishing him, or send a mission to him, or whatever. And here we have another example in another bank in Brazil, small bank, but if you know email and the CPF, you can figure it out if he has an account or not on that bank as well. So another really good source of information that we have back in Brazil, it's called PIX. And the PIX is a new system that we have like the last three years, I guess, but it's an instant payment system. Basically, you just have to know a key for someone that you want to pay, and you can have four kinds of keys. You can have the cell phone as a key, the CPF as a key, an email address as a key, and a random key that might be shared by a QR code. So these numbers are from July 2022, but we can see here that CPF has more than 100 million keys, cell phones has 98 million keys, emails around 70 million keys, and back in Brazil we are only 200 million, 214 million, and there are at least 470 million keys in CPF. So it's a really huge database. So what you can get with the CPF? If you do a PIX to pay someone, and in this example here I was getting the cab to go to the airport to come to Vegas, and I asked the guy the CPF, and he gave me the CPF, I paid him here just an example, just one cent, and it gives me the full name of him, here it is blacked out, but not only it gives me the full name, it also gives me the CPF, but I already know the CPF, right? But it gives me the bank account where the money is going to. With this bank account I would be able to go to another bank, try to recover his password, with his CPF, and then it brought me another two pieces of information, another two little breads, brought me the cell phone number and also the email number. But realize that not the full cell phone number and not the full email address, it has stars to hide information from me, right? Well, from the email we can see that the name of this guy was clever, and we can see that his email starts with C, and the other stars part here are the rest of his names, he also starts with D, so we can try to imagine what his email address is. But even if I didn't know that, we can keep searching for information. So I just saved this information on my database, and looking for his phone number, I figured it out. Well, if we have four digits here, back in Brazil all the cell phones start with nine, then have another nine digits there, but the last four numbers we already know, right? So it only gives us a thousand possibilities to try. Would it be hard to try or brute force a thousand possibilities however you want? Yeah, it would be, at least boring. But we can go to another cell phone provider and try to figure it out if he has an account on that cell phone provider, and it turns out that he has. And by checking on his CPF again as an input source, and trying to recover his password for that cell phone provider, it got me, how do you want to get your password? It's by SMS or email? Well, let's check out the SMS possibility, right? So it masks the four numbers in the middle, but I already knew the last four numbers, so I already know these two, they gave me the first two, now I only have 99 possibilities to brute force, right? But there is a catch on this. There is also another website that tells you from which cell phone operator that number is. So if I go to that site and try to brute force like 91116497, it's just a cell phone from the cloud, he would say no, it's not, this cell phone doesn't exist. But if I try another number, and it's from the cloud, it's the cell phone operator, and by doing this, I can reduce these 99 possibilities to at least 25. And now it's feasible to call 25 numbers to figure out if it's his number, right? Things are getting easier. And by the email, if we check the email here, we can see that, well, we already know the CD and a lot of stars at ho, a lot of stars.com, but when we check on the cell phone providers, we already know the TLD, now it's hotmail.com, but not only this, it gives me the last letter here, the R, but not only the R is important here in the TLD, the matching number of stars is also important, because now I know that those stars, each star represents at least a letter, or a number. So I'm reducing the space to brute force for this kind of information. And we can look for leaks on emails that match that pattern, and it would be easier to find more information about him, right? So coming back to the electricity bill, I check in another endpoint on the same website, so if I can try to recover his client code, client code is basically how the company calls you, right? And to recover his client code, the first time that I put the CPF and click on proceed, it gives me five options of address, where he lives. All right, okay, so what I did was just refresh the page, and by refreshing the page, every time that I refresh the page, it gives five different, five new positions, but just one repeats. So trivial to figure out where he lives, right? Well, we can put this on the Google Maps and find out where he lives. Actually, not the true place here, I just put some mark on the map, but it's in this region where he lives, right? So yeah, now we have the CPF, we have the cell phone, we have the email address, or partial email address, and we also know where he lives. We can use all the kind of social information that we have. So here, I don't know if it happens the same here, but when you do your taxes, and the money sometimes has money to give you back, and we have a website for this. So if you put your CPF and your birth date, and fill in this gap here, it will return, okay, you have money to receive from the government, and which bank and agents we are going to put this. So I did this, through a leak, I found the birth date of this guy, and went to this website, and figured out that the agents that he receives was a predestined agent, it's a Brazilian bank, where the bank lives, and by looking at the Google Street Maps, I figured out it's a prime bank. And by being a prime bank, that means that he makes at least 10,000 reais monthly. So now I also have some kind of idea how much money he makes, right. And fun thing is, it works not only websites. Back in Brazil, we have SMS bots, WhatsApp bots, so we can interact with those bots, and just provide some piece of information that you have, and we reply you with some information that you need. So I asked him, I asked this bot to get an energy, it's a gas company, to cook, not fuel, and I asked him, all right, can I give a second paper to pay, about his bill, and all right, give me your CPF, I already knew the CPF, and then he returns with a payment code, with the value of his account, of gas. So now I know that he, or not his wife, do not cook outside, because the value of the gas is not that much, it's enough for people to have hot water, and cook at home. So with those little pieces of information, you can start grabbing a much more bigger picture from your target, right? And sometimes, we have to look further, and this is another bank, back in Brazil, and if you provide the CPF, the website just does nothing, but if you look at the F12, and the network tools, and the return, we're going to be, not only the CPF, and if he is registered in the site, but also the full name of the people who is registered. And also there are some side effects, sometimes, yeah, some services, when you try to recover the email, you're going to send an email to your target, letting him know that he's being targeted by someone, and there's some kind of examples, but the main problem that I want to solve here, is if I only know just one piece of information about that target, how do I pivot and find other piece of information to get the whole cake, or to get the whole picture? So, when I start this, I start to catalog all those information, so the name of the website, the URL, if the URL has a capture or not, which kind of input I have to provide on this website, and which kind of returns to me. So, I decided to use YAML files because they're easy to write and to read, and one smart thing that I put here, it's input. Sometimes websites need end inputs, like you need to know the CPF, the birthdate, and the year, but sometimes you only need, like PIX, you only need to know one information of those. And so, those websites that only need one information, it's the OR thing, but you can mix both. So, this is the kind of end-to-end relationship between the input data. And this is what this website returns, right? It returns the full name, the bank, the banking agents, and the taxes result, if it has money to come back. So, with this information, I graphed this, I put this in a graph, and created a software that I'm calling Browse, it's like Brazilian open source information, but this kind of trick can be used by anyone in any place, right? Just try to recover a button, design the YAML for yourself, and use this tool to figure it out. So, here we have a show of the help here in the tools. So, you put a path on which data source you have, the "-sf", show you fields that you have as input. And what I know, what I know is basically, if I only know the CPF of someone, I put the here CPF, but if I know CPF in birthdates, I put CPF in birthdate, and we'll transverse the graph, figuring out which kind of information I have enough for OR, and get this field, or if I have to have more information about this target to get those information, right? And I also put an option to export to Neo4j, because, well, it's better to see graphics, right? And just by loading Brazilian data sources that is available right now on the GitHub, actually it's not publicized yet, I have to come back to Brazil and put my USB-C token to make the project public, but I will do on Monday. But here, I will turn available to everybody 17 sources of information, but I have at least 40 in my private database. And by just looking for which fields you have to figure out for inputs, now here we have the CPF cell phone, UF is state, father name, birthdate, full name, SNH is the driver license, mother name. I parse all those information and put it in a graph, so this is the Neo4j graph for this, for all those sources that I have. But I have a little damn time, so I record it, just because I don't want to play with the gods of the demo, right? Well, this is my fourth time speaking in Vega, so I won't try my luck. So, basically, you can run the script, you have the DS as a path for data source, SSF to show all the fields that we have, the graph, this first graph here, it's like, will pop up in image, and I created a smaller version for this demo, just to show up the capabilities of this project, right? So, this is all the Brazil data source that I have, now it's only 13 public, and I have changed for temporary, and with just five sources, so that's what's going to happen with this demo, right? So, let's take a look at those data sources that we are using in this demo. So, it's cell phone operator, PIX, company energy, recover number client, and another one that I... So, let's figure it out, which fields do we have to have inputs to make this work? So, from these five sources, the input fields are CPF, cell phone, email, year, CNPJ, and birthday. So, we can graph it, that's called PNG, we'll just split a PNG, right? And it shows the relationship between the input nodes and the return nodes, it's like really small, but you can zoom in and get this information, so, zoom out, and just checking this relationship here from two fields are the PIX, so, if I have the CPF, I have to go to the PIX to figure it out which bank it has, to get the election biometry, if the guy has biometry collected to vote, I know which fields I have to have, and this kind of stuff, right? But the most important here is with which information can I can get the rest, right? So, this is the option that I call what I know, and if I only know about the CPF of this person, of this target, these are the information that I can get back, the full name, full address, partial CPF, election status, bank account, election biometry collected, and his energy company client number. But if I only know the birth date, the only thing that I can reach is the bank agents and the full name of his, right? And if I know the CPF and the birth date, I can reach much more information, right? So, this was the first one. Here's the second one, showing the Neo4j option, so you have to pass a config for the Neo4j, and it will put on the Neo4j, and then you can carry as much information that you want. On the Neo4j, I choose map this relationship between AND and OR, just to get easier to make carries about those nodes. So, with the CPF, only the CPF, I can get the election, the election status, the full address, and this kind of stuff. And I also can get the partial CPF, and makes easier to carry information using the Neo4j stuff, right? So, with the cell phone, I can figure it out, the operator of the cell phone, or with the cell phone, I also can figure it out the bank accounts, because the peaks, that source, and things go on like this, right? So, as a future work, one thing that I felt that I have to improve on this project is to uniform the input fields. As you see, I made the code in English, but there are some fields that make more sense in Portuguese. But I have to figure out a way to uniform those input and output fields to avoid confusions. Also, I add some regex on this, add more sources, so you all are invited to contribute with this project. You can just create the sources, United States, sources of your country, whatever, and submit your mail files there. One thing that I also figured out that's kind of important is to add some context on those filters. For instance, if I know the CPF, it's from the state of Sao Paulo, I just want to look at the sources from the state of Sao Paulo. So, the electricity company back in Rio is not interested enough for this, right? And also add some browse information. So, if you remember the first email that I showed you guys has some XPath, because I already started playing with some browsing automation, but it's not done, so it's a future work in progress. And for conclusion, user interface and user experience must be taken account for security. So, basically this problem is because security teams do not interact with user experience, user interface, and there isn't some sort of norm or regulation on this. So, maybe we have to figure out a way to recall the passwords and get information from users without showing that much of information. So, until there is some kind of regulation or norm or best practice guide, anything like this, we still have room to exploit this kind of fragility, right? And the same can be applicable to several countries and different contexts. So, go for it, download the code, create your own sources, start to catalog. Like these 40 sources that I have, I took like... it's not my day-to-day job, but I do it for the last two years, cataloging, oh, just hit another website, figured it out, okay, this is the information that I need, this is from the output, save it on the EML, and then let it there. So, that's it, guys. That's all, folks. Well, thanks. If you have any questions, so, the code and data sources will be available at GitHub. And a special thanks for Corvolino, a guy who helped me to test, Borghini, Sierra, and Motoro, who also helped me with the tool, right? Thank you very much, guys.