How many of you are using FOCA right now? How many of you love FOCA? How many of you love the guys who are presenting FOCA? No, no, no. How many girls of you, please? Well, let's start with the presentation. First of all, a quick introduction about us. Here is Palako. He is a friend of mine a long time ago. He is working as a software architect in Yahoo. And I'm Chema Alonso. I work in a Spanish company called i64. And I'm also a Microsoft MVP in enterprise security since five years ago. But Microsoft has nothing to do in this presentation. It's just life. So let's start from the beginning. For the new people, how many of you don't know anything about FOCA? Okay. For you, a quick introduction about what is FOCA. Well, first a quick introduction about what FOCA is not. FOCA doesn't have anything to do with freedom of choice. FOCA doesn't have anything to do with fellowship of Orthodox Christians in America. FOCA is not religious, so she doesn't understand. This is a FOCA. That's a FOCA. That's a FOCA. That's a FOCA. That's a lovely animal, Cecil. And we, of course, it's two. And you guys have been asking us for the last year, FOCA only runs in Windows when it's going to be running on Linux. But FOCA eats penguins. We cannot port this to Linux. She will eat it. Exactly. So, now for the people who is new in this talk, a quick introduction about previously on FOCA. So, this whole thing is started in our company, well, in his company when he, but these guys do penetration testing all year long. And one day they saw how important the stuff there is in documents, like metadata, how that, how important is that as a first step in a penetration testing? There's like users, network shares, all the stuff that we're going to see in a minute. it. So it all started with this tool called meta structure that then become FOCA. And as you can see it's in Spanish because in Spanish it's better. So what FOCA does is basically analyze a whole bunch of different file types. It's going to look inside every possible kind of office document like doc, PDFs, PPT, Excel. It's going to look inside EPS, images and so on and so on. So we've done more stuff in the second version but overall it just analyzes all these kind of documents that have information inside. So what kind of information? Everybody knows what metadata is. You usually have like a properties dialogue and there it says like the owner of the document or stuff like that. So yeah, that is metadata. That is useful. But there's a whole bunch of stuff in the document itself that in last year we categorized as lost information and hidden information. We're not going to go over that. We're going to do that again. But basically there's all over the document there is information that is useful. You can find who created the document, who has modified the document. So those are users that we might use. There's paths, there's over which operating system was this document created, using which software. If it was printed, what printer was it used? So you can discover if the printer is either local or remote. If the printer is remote you have an IP maybe and you have an ACL to know that that computer has access to that IP. There's paths. If the document was stored either locally or remote, if it was stored remote, then you have the share. So again, you have either an IP or name with paths. If the document was combined with information from a database, you have the metadata about the database, like the name of the database, the schema like tables, columns, all that kind of stuff. And so on and so on. So there's a lot of stuff that we've been using for that. One example is pictures. Like pictures they have GPS information in pictures. So not only office documents. Graphical documents has also information. So. And of course the GPS information. Yeah. So let's with the first demo. This demo is about FOCA as a desktop tool. A tool that you can use to extract metadata to analyze documents and so on. A quick demo. First of all, I'm going to use this version. Not this. This one. And if you want to use the FOCA as a tool for your desktop to analyze documents, you only have to drag and drop the file and just click on the right button to extract metadata. And the first demo I'm going to do is with a PDF document. This document is the installation guide. It's going to show you how to install Linux. It's a Linux distribution in Spain called Wada Linux. It's based on Debian. And of course you can see a lot of information about how to install Linux. Linux is good. It's a very good operating system which can be used for a lot of things. And in Dixo sample that we are going to do And the guide is in Spanish because Linux in Spanish is better. Exactly. And the only thing that we are going to do is drag and drop the file into the FOCA and extract metadata. And of course you obtain a lot of information about this document. And in Dixo sample it's quite funny because Linux is perfect for everything but for writing documents. So they are using Microsoft Word in a Windows machine. So it's quite nice. Because this line of distribution is supposed to be for the end users. So it's quite nice. And the second one demo is about a picture because with FOCA you cannot download picture from the internet. But you can drag and drop any document that you have on your desktop machine just like this. In Dixo sample it's a picture that you probably can use in any of your social network that you are connected to. This is well as you can see there is a lot of white space on the picture. You can see here white space, white space, white space. Are you seeing the white space? White space, white space, white space. Well maybe this can be the picture of your profile. And of course you can drag and drop the picture to the FOCA and just right button, extract metadata and with FOCA you can access to the existing information. In Dixo sample it's quite nice because there is the thumbnail is complete. You can see the foot, the guy, the foot of the guy. And of course the face is reflected on the TV screen and of course you can see here, no. And of course the GPS information or the place where the picture was taken, don't do that in your Facebook or Twitter or that can be very bad. So go back to the slides. And let's start with more things. So what we just seen is you take one single document, you extract information for that. You can either do funny stuff or you can get in trouble like that Tony Blair famous affair with the mastermind. You can either do funny stuff or you can get in trouble. That's how the whole metadata thing got famous. But FOCA is not really about that. What FOCA does is it takes, so what FOCA does is instead of taking one document, we're going to take as many documents as we can. So we're going to go to a web search engine. We're going to download as many documents as we can. And we're going to look at this information in all those documents. When you have one single document then you're going to have like one user, one path, one printer. That's not very useful from a penetration testing unless you want to do some social engineering. When you have a thousand files like with the missile defense agency, then you start putting this all together and you get a whole bunch of information. If you get the FBI with almost 5,000 files, you put all this information together and you saw last year what's happened. So you can get a fairly accurate and very complete map of the network. So what FOCA used to do last year was we went to Google and Bing. We explained why we did this. Like Google is not very good with file type extensions and there was missing a lot of documents. So we're combining the results from Google and Bing downloading the documents, extracting all the information that we think is useful. And then what FOCA is really good for is it takes all that information, clusters everything together and prints a nice diagram of the network, user list. For those that weren't here last year, we're going to see it again in some demos. After the demos of the last year, we are not going to do any demo with the FBI or with the missile defense agency just because some legal issues. So other than looking at the information that is inside the documents, what we do is let's say that there's a server called web one. Then there's probably a server called web two, web three. So we're going to try those. We're going to use Google sets also. We're going to see if there's a server called, I don't know, Poland.devcon.com. Then maybe there's another called Germany.devcon.com. So we're going to be trying all those. And then in the next slide, you can see I think this is from novel. There's some novel information. This is looking for these are printer shares from a search in ODF documents. So you can see things like gamma. So then we're going to try alpha, beta, all that stuff. You can see SRV2. We're going to try SRV1. All right? So this year we are going to do the demos with the White House. Wait a second. Wait a second. How many of you were here last year? Can we do this with the White House? Yes. Well, it's a tough task to do it. Manually. So we did the project before. This is all the documents that we were able to download from the White House. As you can see, there are more than 2,000 documents. As you can see in the new version of FOCA, there is a tree with different file types. So there are 1,700 PDF files, PPT, PPTX, WordPerfect documents, Excel files, . And so on. And of course, as you can imagine, they are not cleaning the documents. So just clicking on any document, you can discover a lot of information. This edition time is scary to me. Also with the presentations, with the slides, index sample, a lot of information. This is the executive office of president with the Microsoft office, the mail. This is an internal domain which is not public on the internet. You only can ping this. So you can see the information. It's not mine. If you are inside the network, it's impossible to obtain any information from it. And of course, more data, exit files, some pictures. I don't know. One of these maybe with the thumbnail. In this case, it's not naked. And with FOCA, with FOCA 1, you got some lists with the user names of the guys who are not cleaning the document. You can trace the documents from which data was taken. Just clicking on it and FOCA takes you to the document. You can analyze the documents and so on. An Excel file with a lot of servers that you can see, printers and so on. Well, scary. Of course, all the information that you can extract, you can discover, you can export it to a text file and so on. And in the end, just clicking on this file, and you can see the magic button which is analyze metadata. Oh, it's working again. I'm going to stop. Which is metadata, analyze metadata, you are going to be able to receive this information which is the internal map of the network that you can describe with the metadata. As you can see there are people using Windows machines, XP, of course, people using Windows Vista. All that is without even pinging the White House. This is just from the metadata on the public documents. And the public documents. And of course there are 19 servers which are Windows servers. This is one with the internal domain which is the 03, probably there are an 02 and 04 and so on. This is an internal domain. It's impossible to resolve the IP address and so on and in any of these servers you can discover which will users are working on it remotely, operating system and so on. That's what FOCA 1 was doing until one week ago. So let's see what's new in the new version of FOCA. So today we start the new version of FOCA, FOCA 2, which is bigger than the first one so it's more bigger. This is basically a summary of what we're going to be talking for the rest of the session. This is what is new in FOCA. So main, the main characteristic of FOCA 2 is that when we were doing FOCA before, it was all about the documents. It was all about what was inside the documents and all that data. And then we realized that we were missing a really big thing that was right in front of us, which is the URL from where you're downloading the documents. So just by looking at HTTP slash slash, whatever, wherever, and the path and that, all that URL contains a lot of information that we're going to be examining on. So that's the main thing of FOCA 2 and we're going to go over how just from a URL we could take this to the next level. We've created a recursive algorithm that analyzes that URL and every URL that you find in the documents to what you're going to see. We've improved the ways of gathering information. We've improved the ways of gathering information. We've improved the ways of gathering information. We have a new search engine. We, and the other big thing of FOCA version 2 is that it's been, this tool has been the first step in every penetration testing that we've done for the last year. And then we just thought that it was so convenient that we could kind of improve it a bit and get more stuff into the same framework so that you can continue your work without leaving the platform. So we've started to do some software recognition and some other interesting stuff. And of course, at the end, a reporting tool to generate, you know, the information that we're going to be able to use. So that's what we're going to be able to do. So in a minute, you're going to see, well, you've already seen more or less how the tool looks like. You've seen that it's pretty easy to use. You're going to learn all the new stuff. And it's just a very quick session. You're going to be able to generate nice reports and kind of a pretty complete job. So the, one of the biggest things that we've done for FOCA in this new version is we've added a new search engine. Before, we were using just Google and Bing. In this slide, you can see that we've added a new search engine. We've added, even in the White House, if you just use Google, you have 332 documents. If you were using just Bing, you have a bit more, 375. Now we have a new guy called Exalid. And this guy is discovering more than 2,000 documents. So we are combining the data from all these three sources. And we have a whole bunch of documents to look at, almost 3,000 for the White House. And with what we've been telling you so far, you understand how important it is, the volume. So one document, that's fine. A few thousand documents, we can do a lot of stuff. So these guys have really nice addition to FOCA. Another feature that we add to FOCA is the PTR scanning. The idea is once you are able to discover an internal IP address of the, of an internal network, it's possible to connect against the internal DNS, change the query type to a PTR, and scanning the internal network segment. So in this example with my university, they did a very good job of scanning the internal DNS. They love me. We change, we look for the internal DNS. We change the DNS to Neptuno. And we change the PTR, the query type to PTR. Since that moment, we can throw queries to that DNS like this. In this example, as you can see, it's an internal IP address. It's the 192.168.4621. And the internal server is responding to us. We change the IP address. And we change the query type to 192.168.4621. And the internal IP address is the 192.168.4621. And the internal server is just an IP address. We can get the, the name server and ask for the internal IP address. And of course, with, with the whole segment. Now this is included in FOCA 2.5. And talking about IP addresses, once we have an IP address, we would like to know how many domains are being served from that IP address. So there's a nice feature in Bing, where you do IP colon and then IP. And then you got every virtual domain or alias that you're serving. So there's a nice feature in serving from that. So for shared hostings and stuff, that's how we do it. Shodan is something that we really love. I guess most of you if not all of you will know Shodan by now. It is a search engine for banners. Like when you go to HTTP and you do like a get or a head you get information about the server or an FTP or every possible thing that you can imagine is there. So when you're doing penetration testing and you want to go to this first stage of gathering information, you don't even have to run a vulnerability scanner against the organization. You just go to Shodan and they have everything indexed for you. If you're not targeting anything specific, you just go to Shodan and say I want an IES version 5 or I want an Apache 2, 0, whichever. Because you know there's a vulnerability in there, then you have it. We started using Shodan in FOCA kind of parsing the web results. But we were FOCA was becoming pretty popular. We were increasing the traffic. So we actually contacted John, the guy who wrote Shodan. We asked for permission basically to keep using the service. And not only he was pleased with the idea, but he created a JSON feed for us. So now it's even nicer, an even nicer integration and there you can see that we have all the information that we want. Like IP addresses and software. All the stuff that we've been talking about. So what's the day out with FOCA? We're starting with FOCA. The idea with FOCA is that before download the file and extract the metadata, we can do a lot of things with the URL. In this example, there is a URL with a document on it. As you can see, it's a Microsoft document. But the URL is giving us a lot of information that we can use. So let's use it. First of all, it's an HTTP. So it's a server. So let's get the banner and extract information from that server. Then we got a domain. That domain, we can use it to discover in which part of the network is one of those servers that we weren't able to allocate into the network map. So it's good for us to discover all the domains that we can. So domain. com is a domain. Of course, if we got the domain, we can also get the name server, the mail changer, and the information in the SPF record about IP address of internal servers. Of course, we can do the same with the subdomain. We can try to discover more IP address of the internal server and try to verify all the non-allocated servers that we discover with the metadata. So we can try server if we discover that there is a printer in slash slash server 01 slash printer 1, we can try to discover if server 1 is server 1 domain.com or server 1 subdomain.com. Of course, Apple 1 is a host name and Apple 1 is the name of a server. So we can try to DNS prediction, looking for Apple 1 to Apple 10 and so on. And we can do the same with the Google sets. We can ask to Google a list of related words to Apple and try to discover more servers. And there's not only the information that you can see in the URL. It's also the information that you cannot see. There is an IP address associated to that. So we're going to try to discover more servers. We're going to resolve, reverse resolve the IP address. We're going to get the banner of the server by using the IP address and not the domain that we were using before. Once we have the IP, we're going to use Bing IP to get the information and all the domains that are sharing that server. And we're going to repeat that for every domain that we just found. We're going to connect to the internal network servers with all the information that we just got, all those IPs, and kind of do all the things, all the things again. PTRs can do all the things that we just found. We can do all the things that we just discovered. And for every thing, absolutely everything that we've just discovered and all those steps, we're going to try for every new URL that appears, we're going to repeat the algorithm. Then more stuff that there's there is we're going to look for patterns in the URL itself. We've been doing this for the data. So we're going to do it in the URL. You have a possible user name there. So we're going to use that. And of course, also we have path in the URL. So we got three paths. So we're going to use the path in the URL that we can try the directory listing. That is good if you are doing a penetration test. Of course, we can search for unsecured methods. We can try to discover if put, delete, or trace methods are available on every path. We can fingerprint the web server using 404 error messages. We can try to fingerprint the software looking for application error messages. We can try a dictionary attack with a list of names on all of the domains that we discover. We can try the sound transfer. And we can search for any URL indexed on Google related to this host name and do the same. And of course, then we can try to download the file, extract the metadata, hidden info, and lost data, sort all this information in a nicely way. So the problem with this is that we've just converted FOCA into something massively difficult. It's like, there's 30 steps there that you have to know how to do. There's hardcore hacker stuff here. I mean, I guess the interface of FOCA now is really complicated to do this, right? As you know, I'm a Microsoft guy, so there is a big button on FOCA. You only have to click on it. And FOCA does everything for you. That's all. All right. So since we just saw that analyzing the URL from the, so the document is coming from this URL and we've been analyzing this URL, we've been analyzing the URL and see how powerful was that. We just thought that every possible URL is going to be interesting. So we've had FOCA the possibility of just crawling more and more URLs. We've added a couple of set up and properties panels. And then this is a screenshot of one panel where you can set up a few of the options that you want to use for pretty much everything that we've been describing so far. So like web search and DNS search and all that stuff. And of course, the algorithm is going to work by itself. So we're going to be able to do a lot of stuff with that search all button. But then there's stuff that might be time consuming. There's stuff that you know that you're not interested in for some reason in this particular penetration testing. Or even stuff that is illegal in your country like a sound transfer. So there's these panels of properties where you can basically customize everything. So let's do a demo with the White House. You know we can get in trouble. Yes, we can. Well, let's do a quick demo with the White House. This is the, this is the girl. This is the demo that we did before with the metadata extracting from the documents. As you can see, all documents are locally stored. So it's on my laptop. I'm going to delete everything after this talk. And we are going to create a new project with the White House. This is the White House. .gov. WhiteHouse.gov. And then we are going to create the project. And just clicking this magic button which says search all. So we only have to click the button, search all. FOCA is now searching for the documents on the internet using Google, Bing, Exalit. And as you can see, there is a big list of links. We didn't even download the documents. As you can see, we didn't even download the documents. As you can see, the documents are still on the web server. But FOCA is analyzing the URLs. So if we go to this new panel, network data, we can see that there are a lot of information that FOCA had been collecting from the URLs. So for instance, we got that White House is using two IP address. And there are another server called MQM. I like it. Which is using two IP address. There is a special server called APP2. And of course, FOCA had been analyzing a lot of information at the same time. So if we click in this domain, as you can see, there is a bottom panel which is being used to collect all the information. And FOCA is looking for all the paths in the URL, looking for all the documents related to this web server, looking for directory listing and looking for secure methods. This is automatically. So we just click in and search all. And in this example in the White House, in APP2, there is four unsecured methods in one path. So you can put a file. We can upload a website. A file on the server and so on. Just click in the bottom. That's all. So. Let's stop this project and let's go to the next one. We are going to do another one with the Spanish Linux. Linux.org. And we are going to do the same. In this example, there are only a few documents. 60 or 70 documents. And this is quite nice because FOCA is working. And at the same time, FOCA is analyzing the information. And this is the whole document. And this is Guadalinas. As you can see, there are directory listing that you can open automatically and search for all. There are 33 unsecured methods on the server. You can do a lot of things. You can do it manually, but FOCA does for you. You don't have to worry at all. And of course, if you want to do this, but not only searching documents, you can go to the DNS search panel, search for the options, and just click this other big button which says start. Start. So start. And now FOCA is working. FOCA is working. Let's see the options. I would like to fingerprinting. Okay. As you can see, FOCA is trying right now Google Sets inside the algorithm. And if you have a look to the log, you can see what FOCA is doing. Basically, FOCA is doing all the things that we've been presenting five minutes ago. It's looking on Bing. It's trying to resolve all the internal IP address with the PTR scanner. It's using . It's resolving. FOCA is working. FOCA is working. And that's all. And you got three different views. One for the internal network, for the network, not only the internal. Another one only for the domains. Another one for the IP address. And once you finish, in this example, this is a hosting server. As you can see, with a lot of domains, we can skip this IP address because I don't want to spend more time on it. So just clicking this another big button, skip to next IP, FOCA will change to another one. And so on. So once you finish, you can try the software recognition, which is the same. Fingerprinting HTTP, fingerprinting SMTP in mail servers, fingerprinting using SODAN. And technology recognition, looking for ASP files, PHP files, JSP files, and so on, with this third big button. So go ahead. This is yours. Ah. Another tool that is added to FOCA is just the DNS cache snooping. The idea is just to discover where the internal user are browsing to. So what FOCA does is only connect to the internal DNS, just set the query to no recurse. That means that this DNS is going to respond only if the domain name is on the cache. So we are going to try a big list of domains, and we are able to know if that domain is on the cache or not. So you can do it along a day, and in the end, you are able to discover what are the users doing in the company. So let's do a quick demo. A new project, and it's here, tools, DNS, snooping, and in this case we are going to use the national Spanish train service, because Spanish is better. So just the domain name, click in the obtain DNS server, just click on the server, just load the file, in this example, a big list, and a snoop DNS. So in Spain, right now should be, oh, no, it's not working. Let's do it again. Don't worry. There are a lot of demos. Don't worry. Tools, DNS, snooping, a domain, renfe. That is obtain DNS server, just load the file, and click on snoop DNS. And, oh, here it is. This is the places where the people are browsing right now, Facebook, of course, because it's the most important in their work. And it's 3 a.m. in Spain. They are using Microsoft score. They are reading the newspapers, the Spanish newspaper. They are... . They are collecting money from one bank to another, banking, and so on. And you can use a monitor service that every 60 seconds is going to repeat the search, so you can surveillance what they are doing internally. So that's not bad. And another option that we added, but to FOCA is a reporting module. The idea is that, okay, you got a lot of information, but you want this information to be in a document. So now we got... We are working on this. This is a module in which you only have three different reports. First one is about documents. The second one is about metadata. And the third one is about the domains. And you only have to select the data in which you are interested. Oh. For example, if you grab this pop-up, then you can select different kind of graphics and you obtain this very nice report. I got one here of the White House... About the White House which has 478 pages with a lot of information. No, I don't want to help Adobe. Well, and this is the... How it looks for every document. You got a PDF, a doc. Excel file and so on and in the end of the document you got the graphics. Very nice graphics. Graphics, that's all. So I want to do the last demo, a big one. Not that one, a big one. So a couple of slides and then let me do the last demo. So there's a FOCA online tool just to try it out if you don't want to download it. But it's only going to allow you to try it with one document. So you're not going to be able to do the whole network map and that's just extracting the information from one document. But it's online. So you can try it. And this is how you, this is one of the ways you can protect your organization from a tool like FOCA. This is a plug-in that you install in internet information server and what this plug-in is going to do is every time that your server is serving a document, it's going to clean it. So in the hard drive of the server or whichever you're storing it, like SharePoint or something, it's going to, the document is going to remain intact. So it's not modifying the document but it's cleaning it on the go. So whatever you're obtaining is clean. You can either, there's a couple of options. So you can either just clean everything so there will be no metadata there or you can use like a template because you want all the documents in your organization to be like either look that they were made with the same software or same user, stuff like that. And if you want to clean individual documents, there's a couple of tools to do that. Last year we saw how the tools that were before didn't really work very well. So we created a couple of them. Metastructure is one of them. So with these two, you can clean all the information of this metadata that is in open office documents. And it's kind of hard because you have to do it manually one by one. But there's the tool. Well, before the last demo, some issues. We are going to be in the room 113 for questions, not complaints, only questions. And tomorrow at 7 o'clock in the evening in this room, we are going to deliver another talk about connection string attacks, about how to get into a control panel to manage the data. So we're going to be in the room for a few minutes. And I'm going to do a demo with the use army. No, no. It's not illegal. It is, actually. No, no. It's not illegal. So this is the free version of FOCA new project. Just army.mil. Is this the domain? Yeah. Create and focus start working, searching for documents. And as you can see we got the information of the network which is they got a lot of servers. And of course they got, hey, they got unsecure method. Can I do a demo with that? They got trace method and so on. We can be here until tomorrow. But we have to go on parties. It's over.