Open Source Intelligence (OSINT) with Maltego
Duff Jones - March 15, 2021
What is intelligence?
The dominant conception of intelligence, developed by R. B. Cattell and J. L. Horn, in the cognitive science literature is focused on problem solving and split into two types :
- Fluid intelligence
- this is how we solve problems when we’re kids
- eventually, we form “habits of thought,” leading to
- Crystallized intelligence
- the ability to “create schemes about the way the world works”
As crystallized intelligence strengthens, fluid intelligence tends to become less used.
What is Open Source intelligence (OSINT)?
OSINT and the open source movement
It is important to note up front that OSINT is not the same thing as the open source software movement. The software movement is focused on the rights to:
- access source code;
- run a program without restriction;
- modify source code, etc. 
A definition for OSINT
OSINT is about access to open information (i.e., publicly available information). Essentially, OSINT is the collection of data from publicly available material.
OSINT doesn’t require computers, as it was around prior to the existence of computers. In fact, the act of gathering information from newspapers or gossip is OSINT. Modern OSINT, however, recognizes the power of computers and three key aspects of open information :
- Available information
- information is available freely online
- information should not have to go through experts before being accessible
- Unlimited collaboration
- anyone can solve a problem, so anyone should be able to work on the problem
- Anyone can co-develop
- we learn from each other, so our intelligence will remain more fluid if we are constantly working with others
The OSINT Framework  lists a series of information sources and tools that can be used for OSINT investigations. One of the tools identified in the framework is Paterva’s Maltego, and it is one of the most popular tools for a variety of use cases.
What is Maltego?
Maltego is proprietary software created by Paterva Ltd , a company based in South Africa. It is currently managed by Maltego Technologies, which is a German company.
According to its homepage , “Maltego is an open source intelligence (OSINT) and graphical link analysis tool for gathering and connecting information for investigative tasks.”
How does Maltego work?
Maltego is used to map the relationships between pieces of information. It uses Entities and Transforms, both are described in the fourth video  in the Maltego Essentials series. The definitions used in the video are summarized below.
Entities are “bits of information” that we have obtained from a data source.
The above example from Maltego’s docs shows some basic Entity types available in Maltego: a physical location, a website, a company name, an email address, a person’s name and a telephone number. It is possible to create custom Entities .
A Transform is “the bit of code that generates some information based on a bit of information we already have… [T]he process of executing the code that generates more Entities [is known] as ‘Running a Transform’ .
The example above shows a website Entity having a Transform run on it in order to reveal the IP address Entities associated with the website Entity.
More technically, a Transform “is a small piece of code that fetches related information for a given input and formats the results to be returned as Entities to Maltego” .
Both the Entity and Transform examples can be found in Maltego’s doc, “Introduction to Maltego Standard Entities.” 
Transforms are important because they allow us to see information about, and relationships between, Entities that we may not otherwise detect. This is discussed more after we consider how Maltego works.
Required software for Maltego
Maltego is available as a desktop app with a free, Community Edition (CE). The CE is limited to twelve Transforms per Entity. This video  describes the different versions of Maltego.
Maltego is Java-based, so you need Java 8 or higher in order for it to function. This video  explains how to get Maltego working on Linux, Windows and macOS.
The technology behind Transforms in Maltego
Transforms are generally written in Python, but there is no restriction on which programming language can be used. Queries that generate Transforms from Entities are XML-based, so the Python code converts the queries and responses into Python objects .
This is an example, from the Maltego docs , of what a Transform looks like in Python:
import socket from maltego_trx.maltego import UIM_TYPES from maltego_trx.entities import IPAddress from maltego_trx.transform import DiscoverableTransform class DNSToIP(DiscoverableTransform): """ Receive DNS name from the client, and resolve to IP address. """ @classmethod def create_entities(cls, request, response): dns_name = request.Value try: ip_address = socket.gethostbyname(dns_name) response.addEntity(IPAddress, ip_address) except socket.error as e: response.addUIMessage("Error: " + str(e), UIM_TYPES["partial"]) response.addUIMessage("Slider value is at: " + str(request.Slider), UIM_TYPES["inform"])
The above is a
DNSToIP TDS Transform. The Transform gets the DNS name from the Desktop Client and returns the IP address associated with that DNS name. There are more steps in getting this to actually work with Maltego, but they are beyond the scope of this document. You can read more about those steps here .
Transforms run on Transform servers that can interact with data necessary for performing Transforms . A Maltego Desktop Client doesn’t connect directly to this server, however. Maltego uses servers called Transform Distribution Servers (TDS)  for making connections:
- When the client runs a Transform, it forwards a request to the TDS.
- The TDS forwards Transform requests to the correct Transform server and sends the results to users via their client.
The following image shows the basic architecture:
Let’s explore what’s going on.
XML-based requests and responses
The following XML request and response examples come from the Maltego doc, “Writing Transforms” .
When a Desktop Client runs a Transform, it sends an XML-based request (in this case, a
DNSToIP request) to the TDS, which has been configured through a web interface. The TDS forwards the request to the appropriate Transform server.
<MaltegoMessage> <MaltegoTransformRequestMessage> <Entities> <Entity Type="DNSName"> <Genealogy> <Type Name="maltego.DNSName" OldName="DNSName"/> </Genealogy> <AdditionalFields> <Field Name="fqdn" DisplayName="DNSName"> alpine.paterva.com</Field> </AdditionalFields> <Value>alpine.paterva.com</Value> <Weight>0</Weight> </Entity> </Entities> <Limits SoftLimit="256" HardLimit="256"/> </MaltegoTransformRequestMessage> </MaltegoMessage>
The server performs the Transform, and the TDS sends the following response XML to the client:
<MaltegoMessage> <MaltegoTransformResponseMessage> <Entities> <Entity Type="maltego.IPv4Address"> <Value> <![CDATA[18.104.22.168]]> </Value> <Weight>100</Weight> </Entity> </Entities> <UIMessages> <UIMessage MessageType="Inform"> Slider value is at: 256 </UIMessage> </UIMessages> </MaltegoTransformResponseMessage> </MaltegoMessage>
The user then sees this in the Maltego Client:
Note that the Java-based client also prints messages to a console beneath the Transform in order to let the user know what is happening.
How is Maltego used for OSINT?
There are two approaches to OSINT using Maltego :
- direct contact with target in real-time
- pro: provides more accurate data
- con: higher risk of detection
- example: scanning a target website
- no direct contact with target
- based on historical or third-party records
- pro: lower risk of detection
- con: information may be outdated
- example: looking up historical DNS records
One of the major advantages of Maltego for OSINT is that it is reasonably private, even when running more active OSINT measures . As discussed above, when you run a Transform, your Maltego Client is interacting with a TDS, which, in turn, interacts with a Transform server that actually handles the Transform. This means that, if the target detects that it is being scanned, it would be the Transform server that would be detected. So, while the target would know it had been scanned, it wouldn’t know that you were the one who scanned it. Unfortunately, this means that Maltego is not exclusively used by ethical hackers.
With the two approaches above, Maltego can be used for a variety of investigations, some of which are discussed below.
What types of investigations can Maltego be used for?
What is the point of all of this? How do Transforms help with OSINT investigations? The key thing here is that Maltego can be used to identify relationships that might otherwise not be obvious. When we have a huge amount of information, it can be really difficult to identify connections between apparently disparate pieces of that information.
By visualizing relationships within data, Maltego makes it easier to see connections that could otherwise go unnoticed. Aspects of Maltego not explored here (like Layouts and Views ), can help identify clusters of information that may have been missed without a visualization tool.
This infographic  identifies many of the data sources and use cases for Maltego. Here are some examples that can be explored:
This is also called reconnaissance.
A variety of actors make use of this technique, and this is probably the most obvious use case for someone interested in cybersecurity.
A pen-tester would run this type of investigation in order to identify potential weak points in a company’s network infrastructure. The lecture on “Network Exploitation - nmap and Metasploit”  showed us the technical aspects of such analysis, using tools like
whois to to discover information about a domain and
nmap to scan ports.
Maltego provides a good guide to performing the same activity through Transforms: “How to Use Maltego Transforms to Map Network Infrastructure: An In-Depth Guide” .
You can examine someone’s social media footprint and connect your findings to open source tools like Have I Been Pwned . You can even start with your own. Here is a brief example of how to do it: “Beginner’s Guide: Examining Your Digital Profile and Social Media Footprint” .
Imagine you are tasked with brand monitoring  for a company. Maltego can be used to see if people are spoofing your brand for phishing attempts. The “Tracking Typosquatting and Brand Monitoring With Maltego”  describes how you could monitor this problem with Maltego.
While police and security forces have their own intelligence sources, many of which do not fall under the umbrella of OSINT, OSINT does allow for analysis of threat actors, as outlined in the “Investigate TA505 Threat Actor Group Using Maltego”  case study. In this study, domains associated with a threat group are analyzed to identify the threats from Malware and to allow an organization to block IPs associated with the threat group.
Police forces do make use of Maltego, as it can also be used for things like Person of Interest investigations.
Analyzing Web Content
We can analyze content on the web with Maltego. The “Investigating Covid-19 Domains with Maltego”  case study shows that it’s possible to examine the likelihood that a domain purporting to be related to Covid-19 is actually a scam website housing viruses or ransomware.
Finally, we can analyze documents, like Wikipedia pages. In the seventh video  in the Maltego Essentials series, detailed information about Wikipedia edits is returned and examined. This isn’t a full-fledged investigation, but it gives you an idea of some of the things Maltego is capable of.
It is easy to get started with Maltego, and there are many things that you can do with it that aren’t listed here. If you explore the “Case Studies & Whitepapers”  section of the website, you will find many other ways to use Maltego.
This introduction didn’t even begin to explore all of the OSINT tools that Maltego connects to via APIs, but there are a significant number of them.
Visualizing information can lead to the discovery of relationships that weren’t previously apparent, and Maltego is a great tool for creating such data visualizations.
 M. Glassman and M. J. Kang, “Intelligence in the internet age: The emergence and evolution of Open Source Intelligence (OSINT),” Computers in Human Behavior, vol. 28, no. 2, pp. 673–682, Mar. 2012, doi: 10.1016/j.chb.2011.11.014
 K. Carillo and C. Okoli, “The Open Source Movement: A Revolution in Software Development,” The Journal of computer information systems, vol. 49, no. 2, pp. 1–9, 2008, doi: 10.1080/08874417.2009.11646043.
 OSINT Framework. https://osintframework.com (Accessed Mar. 13, 2021)
 Paterva. https://www.paterva.com/about/company.php (Accessed Mar. 13, 2021)
 Maltego. https://www.maltego.com (Accessed Mar. 13, 2021)
 Maltego. Maltego Essentials 4: Running Your First Transform - Official Tutorial Series for Beginners. (May 21, 2020). Accessed: Mar. 13, 2021. [Online Video]. Available: https://www.youtube.com/watch?time_continue=2&v=GwBiJqa_nEc&feature=emb_logo
 Entities. Accessed: Mar. 13, 2021 [Online Image] Available: https://s3-eu-central-1.amazonaws.com/euc-cdn.freshdesk.com/data/helpdesk/attachments/production/2015041625201/original/8pBXCXWk4ePXy6k_bzbMR7yGK2DZzn1JTw.png?1603333955
 Maltego. “Create New Entity.” https://docs.maltego.com/support/solutions/articles/15000010462-create-new-entity#basic-information-0-0 (Accessed Mar. 13, 2021)
 Transform. Accessed: Mar. 13, 2021 [Online Image] Available: https://s3-eu-central-1.amazonaws.com/euc-cdn.freshdesk.com/data/helpdesk/attachments/production/2015041625192/original/oP8T3NmPG-eM9gslz11e4_AqpR2Rng0n3Q.gif?1603333846
 Maltego. “What is a Transform?” https://docs.maltego.com/support/solutions/articles/15000034010-what-is-a-transform- (Accessed Mar. 13, 2021)
 Maltego. “Introduction to Maltego Standard Entities.” https://docs.maltego.com/support/solutions/articles/15000035722-introduction-to-maltego-standard-entities#overview-0-0 (Accessed Mar. 13, 2021)
 Maltego. Maltego Essentials 2: Editions of Maltego - Official Tutorial Series for Beginners. (May 21, 2020). Accessed: Mar. 13, 2021. [Online Video]. Available: https://www.youtube.com/watch?v=k-bL6cHBsFY&feature=emb_logo
 Maltego. Maltego Essentials 3: How to Install and Activate Maltego - Official Tutorial Series for Beginners. (May 21, 2020). Accessed: Mar. 13, 2021. [Online Video]. Available: https://www.youtube.com/watch?v=6ZJ_4zjeZ7k&t=68s
 Maltego. “Example 1: DNSToIP TDS Transform.” https://docs.maltego.com/support/solutions/articles/15000034183-example-1-dnstoip-tds-transform#create-new-transform-dnstoip-py-0-1 (Accessed Mar. 13, 2021)
 Maltego, “Transform Servers.” https://docs.maltego.com/support/solutions/articles/15000034014-what-is-a-transform-server- (Accessed Mar. 13, 2021
 Maltego, “Transform Distribution Servers.” https://docs.maltego.com/support/solutions/articles/15000034015-what-is-a-transform-distribution-server-tds- (Accessed Mar. 13, 2021)
 Maltego. “System Architecture.” https://s3-eu-central-1.amazonaws.com/euc-cdn.freshdesk.com/data/helpdesk/attachments/production/2015033607743/original/RdI-ZEovN7ZsdMe-PJmcBY6dTggq6jK_zw.png?1591343289 (Accessed Mar. 13, 2021)
 Maltego. “Writing Transforms.” https://docs.maltego.com/support/solutions/articles/15000015758-writing-transforms (Accessed Mar. 13, 2021)
DNSToIP Output in Desktop Client. Accessed: Mar. 13, 2021 [Online Image] Available: https://s3-eu-central-1.amazonaws.com/euc-cdn.freshdesk.com/data/helpdesk/attachments/production/2015033778810/original/xLWEzdYJHLr77VzMlsjLdaSz3fExNrxzkA.png?1591678290
 Maltego. “Open Source Intelligence (OSINT): What It is & How to Conduct Investigations with It.” https://static.maltego.com/cdn/Infographics/Infographic%20-%20OSINT.pdf (Accessed Mar. 13, 2021)
 Maltego. “What is Open Source Intelligence (OSINT) & How to Conduct OSINT Investigations in Maltego.” [Infographic.] Available: https://www.maltego.com/blog/what-is-open-source-intelligence-and-how-to-conduct-osint-investigations/ (Accessed Mar. 13, 2021)
 Maltego. Maltego Essentials 6: Layouts and Views of Maltego Graph - Official Tutorial Series for Beginners. (June 8, 2020). Accessed: Mar. 13, 2021. [Online Video]. Available: https://www.youtube.com/watch?v=YUrZMco9SS4&feature=emb_logo
 Essex, Aleksander. “Network Exploitation - nmap and Metasploit” Available: https://whisperlab.org/introduction-to-hacking/lectures/network-exploitation (Accessed Mar. 13, 2021)
 Maltego. “How to Use Maltego Transforms to Map Network Infrastructure: An In-Depth Guide.” https://www.maltego.com/blog/how-to-use-maltego-transforms-to-map-network-infrastructure-an-in-depth-guide/ (Accessed Mar. 13, 2021)
 Hunt, Troy. “’;–have I been pwned?” https://haveibeenpwned.com (Accessed Mar. 13, 2021)
 Maltego. “Beginner’s Guide: Examining Your Digital Profile and Social Media Footprint.” https://www.maltego.com/blog/beginners-guide-examining-your-digital-profile/ (Accessed Mar. 13, 2021)
 Boyd, Josh. “Brand Monitoring Explained: Tips and Tools. (May 10, 2018). https://www.brandwatch.com/blog/brand-monitoring/ (Accessed Mar. 13, 2021)
 Kornev, Andrei. “Tracking Typosquatting and Brand Monitoring With Maltego.” (Feb. 9, 2021) https://www.maltego.com/blog/tracking-typosquatting-and-brand-monitoring-with-maltego/ (Accessed Mar. 13, 2021)
 Erdemir, Ata Sahan. “Investigate TA505 Threat Actor Group Using Maltego.” (Nov. 30, 2020) https://www.maltego.com/blog/investigate-ta505-threat-actor-group-using-maltego/ (Accessed Mar. 13, 2021)
 Maltego. “Investigating Covid-19 Domains with Maltego.” (Apr. 14, 2020) https://www.maltego.com/blog/investigating-covid-19-domains-with-maltego/ (Accessed Mar. 13, 2021)
 Maltego. Maltego Essentials 7: What You Should Know About Entities - Official Tutorial Series for Beginners. (June 15, 2020). Accessed: Mar. 13, 2021. [Online Video]. Available: https://www.youtube.com/watch?time_continue=435&v=uYoYsLm7-vY&feature=emb_logo
 Maltego, “Case Studies & Whitepapers.” Available: https://www.maltego.com/categories/case-studies-whitepapers/ (Accessed Mar. 13, 2021)