Advanced Footprinting with Maltego (Part V)

To conclude this series of posts on Maltego, let´s see how we can use it to investigate several possible threats and their underlying infrastructure.

Using Maltego to investigate Indicators of Compromise (IoC)

One of the latest trends in the cybercrime arena is the use of DNSpionage. Imagine you fell victim to such an attack last year. Upon analysis, you have identified two strange domains:

  • hr-wipro.com
  • 0ffice36o.com

Investigating suspicious domains with Maltego

Let’s investigate the first one to see what’s going on:

Using PassiveTotal’s (PT) “Get Passive DNS” and VirusTotal’s (VT) “Domain Resolutions” transforms, Maltego identifies five IP addresses associated with the domain, two of them returned by both transforms.

IP address resolution

Next, the “Detected URLs” transform (from VT) returns eight URLs either because they were detected by a vendor’s URL scanner or because they are listed in some InfoSec community blocklist.

URLs hosted in the hr-wipro.com domain

Selecting each of these URLs will give access to a report where you can see why the URL is listed.

Maltego listing a report on a suspicious URL

And this is the report:

Virus Total report for the selected URL

Now you can check for the existence of subdomains (VT), their IP addresses and URLs.

Subdomains and IP address

Are there any malware samples associated with this domain? Was the domain tagged?

If we run the PT Get Malware and the Get Tags transforms, we will get some answers; 3 malware SHA-256 hashes, a DNSpionage tag and a Maltego phrase: Emerging Threats: Proofpoint.

If we run HybridAnalysis on the domain we will get an additional hash.

Malware samples and tags for the domain

How are the domains classified? Are any reports available for the URLs?

The PT Get Classification transform will tell us the URLs are suspicious and the VT Check URL Report will give access to any available vendor reports.

Domain classification and URL reports

At any time, you can also run the ThreatMiner transforms that will give you pretty much the same info with some extra details.

Link to ThreatMiner report

In the report you can see the legitimate domain the malware was trying to mimic.

ThreatMiner report

Following a similar approach for 0ffice36o.com, I got these results after investigating a bit further on one of the hashes using ThreatMiner transforms:

  • Malware to Filename
  • Malware to Other Hashes
  • Malware to Hosts

image

Investigating malware samples with Maltego

A few months ago, a new wave of attacks plagued the Internet with an updated version of trojan previously named BondUpdater.

It was a spearfishing campaign spreading a malicious Word document containing a macro that would attempt to install the trojan.

Using Maltego to research the SHA256 hash of the file, this is what I got:

  • ThreatMiner provide links to full reports on the malware, links to related hashes, to several vendors who have detected the malware and reports on the malware variants.
  • VirusTotal corroborated this information and added their own links to other reports.

Researching the BondUpdater hash

Quite recently, the same threat actor was involved in a similar attack. Using only VirusTotal I created this simple graph just to show something else; sometimes different vendors give completely different names to the same malware. It would be very confusing if we had just a partial view of the big picture. But Maltego compiles everything for us so we know that in the end all these names refer exactly to the same thing:

Researching Turla malware


Exporting Maltego results

Remember what we did in recon-ng to gather network infrastructure information? Well, we can do something similar in Maltego:

Subdomain researching in Maltego CE

But how are we going to use this information?

We will have to export it to a useable format, like CSV.

In order to do that, all we have to do is go to the Import | Export tab and select Export Graph as Table

Exporting Maltego information

Now all we have to do is select the desired format.

Exporting Maltego information


Final conclusions:

  • Maltego is a wonderful tool, but the CE edition is very limited.
  • Get as many APIs as you can, otherwise the results will be very poor.
  • Pay attention to the limitations enforced on the free APIs
  • Keep in mind that you will get a lot more results using other tools, like Recon-ng


Next post: Advanced Reconnaissance with theHarvester

Advanced Footprinting with Maltego (Part IV)

So far I have showing you how to get information about individuals, persons of interest. But Maltego can also be used to get information about companies/enterprises.

Your goal might be to get information about the company’s online presence and organization, about the network infrastructure or even about the attack surface. Maltego can be useful for any of these scenarios.

Footprinting a company using Maltego machines

If you have been reading my posts, you’ve probably guessed by now that I’m not a big fan of using Maltego’s machines. But it’s always a good idea to explain and demonstrate why.

In Maltego CE there are five machines designed to automatically get information about companies and they all start with a domain names as an input but they all use different transforms so the output will be completely different.

Maltego machines to get company information

Remember what I did with Recon-ng? I was able to put together a lot of information on United Airlines only from open source origins. Let’s use that same company in Maltego to see what we discover.

This is the output of the Company Stalker machine:

Company Stalker machine results for United Airlines

And this is the output of the Footprint L1 machine:

Footprint L1 machine results for United Airlines

Just for your reference, here is a sum of all the results:

  • Company Stalker: 14 entities + 13 links
  • Footprint L1: 66 entities + 74 links
  • Footprint L2: 121 entities + 135 links
  • Footprint L3: 147 entities + 164 links
  • Footprint XXL: 205 entities + 217 links

However, as we have previously seen most of these entities are of no interest to us because their relationship with the target is not relevant.

Footprinting a company using Maltego entities

Starting with an entity is not a guarantee for success. If you just run all transforms without any criteria, you’ll end up with a huge number of information to analyze which will result in a huge waste of time.

Running all transforms

Let’s took a look at an example; starting with the company The New York Times and then running all transforms in the nytimes.com domain.

Results for the New York Times

The result is a collection of 338 entities and 395 links:

Overview of the results for the New York Times

But this graph has something we haven’t seen so far: results in the shape of squares? Let’s take a closer look.

Maltego entities grouped as collections of results

By default, Maltego will create collections to clean up the graph by grouping 'similar' entities, making it easier to view portions of the graph and find the key relationships you are looking for.

The minimum number of entities needed to create a collection can be adjusted in the Collections tab.

The Collections tab

Thus, our collections were formed because there were more than 25 similar entities in the results.

Detailed view of the Domain collection

In my humble opinion, this is too messy because we have too many results at once. Therefore, my favorite approach is always to start with an entity in an empty graph and then run just some of the transforms, selecting the relevant information as I move along.

Running selected transforms

So, when running this kind of tasks I always take the time to filter and process the information immediately as it is delivered to me.

Let’s try and see what kind of results we can get by following this slow method.

  • Create a new graph
  • Search for “company” on the entities search box
  • Drag the Company entity to the empty graph
  • Rename it
  • Run all the transforms

Initial information for United Airlines

Before we go any further, let’s take a moment to analyze what we’ve got so far.

  • We have three entities for united-airlines-flights; one company, one image and one domain
  • We have exactly the same for United Airlines Deals; one company, one image and one domain
  • We have two entities for United Airlines; one company and one image (empty)
  • We have two entities for mileageplusupdates; one domain and one image (check the properties)
  • And we have one domain; united.com

Merging similar Maltego entities

Maltego allows for these closely related entities to be merged into a single one, simplifying the graph and creating more complete entities.

Let’s start with united-airlines-flights.com.

  • Select the three entities by clicking each one of them while holding the Shift key
  • Right click
  • Press the merge button

Merging Maltego entities

Now you have to choose the primary entity. Choose wisely keeping in mind that the outcome will be a new entity with the combined properties of the individual parts.

Choosing the Primary entity

In this case, I’m going to choose as primary entity the domain because that is the one, I will eventually want to explore further. While the regular Maltego.domain entity has these properties:

Maltego regular domain properties

The resulting entity has these properties:

Merged entity properties

  • Repeat a similar procedure for United Airlines Deals.
  • Merge the two entities with the United logo as they are both related to the mileageplusupdates
  • Merge the two United Airlines entities
  • Just for fun, hijack the logo from the mileageplusupdates entity and apply it to the company by replacing the image URL

Replacing the company logo

This is the current situation; one company and four domains.

United Airlines ready for further footprinting

After a while, this is what I’ve got:

united.com final results

I have 204 entities and 276 links in a clean graph. Notice I’ve reduced the minimum size of the collections so now I have the Name Servers all nicely grouped together.

From here there are still many possibilities;

  • I have three more full domains to explore
  • I can drill down on the united.com website

But I don’t want to mess up this nice graph. Therefore, I copy the relevant entity to another graph and proceed from there:

Copying an entity to a new graph

And then I get something like this:

image

Conclusion: Even with all the limitations, Maltego’s Community Edition can be a very powerful tool for OSINT as long as you know how to take full advantage of all the available features.

In the next post I’ll show you how to footprint malware or suspicious sites.



Advanced Footprinting with Maltego (Part III)

In the previous post, we saw how to use Maltego’s machines and entities to gather information using as a starting point the name or alias associated with that individual.

But there are many other possibilities and one of the most effective is to start with a valid e-mail address.

Footprinting a person using an e-mail address

Let’s try to find info on a journalist.

  • Create a new graph
  • Search for “email” on the entities search box
  • Drag the Email Address entity to the empty graph
  • Rename it
  • Run the transforms according to your needs or goals

Results for Mathew Rosenberg

Another example: a politician

Results for Anne-Christine Lang

Another possible approach is to focus on the security breaches associated with a specific address

Security breaches associated with an e-mail address

Footprinting a website to find people

Imagine you want to get information on someone but you have nothing to star with and your only clue is a supposed relationship with a certain website. Can Maltego help you? Let’s find out, shall we?

Getting personal information from websites

  • Create a new graph
  • Search for “domain” on the entities search box
  • Drag the Domain entity to the empty graph
  • Rename it
  • Run the transforms according to your needs or goals

I used a test domain (sitiodepruebas.org) and I wanted to find out who the owner/webmaster was. The first step was to get additional info on the domain itself and that revealed the addresses of four websites.

These websites are related to a Twitter profile. Digging into that profile I’ve found a Linkedin profile and a relationship to another set of websites (sombreroblanco) and some of their social profiles.

Finding Diego Muñoz

Opening these profiles on the Internet gave me the final answer:

Both websites sitiodepruebas and sombreroblanco are run by someone named Diego Muñoz, a Chilean cybersecurity professional.

Getting personal information from companies

One other possible situation might occur when the only thing you know about someone is where that person works. In that scenario, Maltego can be very useful in getting additional info using the company as a starting point.

Finding personal information from a company

As you can see, Maltego will find the domain associated with the company and then it will find a number of e-mail addresses, persons and phone numbers.

Conclusion:

As you can see, Maltego is an excellent tool to conduct open source data mining across the Internet in spite of the obvious limitation of the Community Edition. Still, it can automate the process of gathering crucial reconnaissance on a potential target and save ourselves many hours of tedious work and potential missed links. But remember that a lot of the info won’t be relevant so double check everything.

In the next post I will show you how to get network related information.