Skip to content
ImagineWorld

From Recon-ng to Trace Labs – A Tour of the Best Open Source Intelligence Tools

node_idnode-book_osint-handbook_chapter-05-from-recon-ng-to-trace-labs-a-tour-of-the-best-open-source-intelligence-tools
node_typechapter-node
schema_profileworld.chapter_node.v1
statusactive
entropyhigh
manifoldworld
domainimagineworld.net
authorityinforms
layercorpus
chapter_num5
chapter_titleFrom Recon-ng to Trace Labs – A Tour of the Best Open Source Intelligence Tools
governed_byCORPUS
constitutional_citationCONSTITUTION
local graph

Chapter 5 — From Recon-ng to Trace Labs – A Tour of the Best Open Source Intelligence Tools

Section titled “Chapter 5 — From Recon-ng to Trace Labs – A Tour of the Best Open Source Intelligence Tools”

This chapter is designed to be your companion in navigating the rich ecosystem of some additional Open Source Intelligence (OSINT) tools that can unlock vast troves of data hidden in plain sight on the internet. From cybersecurity professionals to investigative journalists, understanding and utilizing these tools is crucial for sifting through the digital expanse to collect relevant information.

In this chapter, we’ll discuss the following:

  • Recon-ng – A powerful OSINT framework
  • Maltego – Visualizing OSINT data and connections
  • Shodan – The search engine for the Internet of Things (IoT)
  • Trace Labs – A powerful OS designed just for OSINT
  • Overview of the Aircrack-ng suite
  • Additional open source OSINT tools
  • Keeping up with the open source OSINT landscape

By the end of this chapter, you’ll be familiar with even more OSINT tools that can enhance your research capabilities. You’ll also gain a little hands-on experience with these popular tools.

Recon-ng is a slick web reconnaissance framework that has some seriously useful features to improve your intel game. It’s built using a modular architecture, so you can easily expand its capabilities by installing new modules from the built-in marketplace. The community keeps developing fresh modules to keep Recon-ng on the cutting edge.

It also uses an interactive command-line interface that makes the tool a breeze to use, even for newbies. But don’t let the easy interface fool you – Recon-ng has some powerful data management abilities, automatically storing scraped information in a structured database for easy retrieval and exporting.

The bottom line is that Recon-ng combines a flexible modular architecture, community-driven marketplace, intuitive interface, robust data management, and API expandability to make it a seriously powerful framework for open source web reconnaissance.

Here’s how to install and set up Recon-ng on Kali Linux:

  1. Open your Terminal.
  2. Clone the Recon-ng repository with the
    git clone https://github.com/lanmaster53/recon-ng.git
  3. Navigate to the
    cd recon-ng
  4. Install the
    pip3 install -r REQUIREMENTS
  5. ./recon-ng

If you want to install it on Windows, well, that’s easy too:

  1. First, you need Python in your arsenal. Recon-ng is developed in Python, and it’s best compatible with Python 2.7.x. You can download it from the official Python website. During installation, check the Add Python to PATH option, which is like setting up a map for your system to locate Python easily.
  2. Once installed, open your Command Prompt (you can search for cmd in the Start menu) and type python --version. This step is like checking your gear before a mission. You should see the Python version displayed, confirming that Python is ready for action.
  3. With Python set up, it’s time to install Recon-ng. In the same Command Prompt window, enter the
    pip install recon-ng
  4. This is akin to loading your digital toolbox with a specialized tool. Python’s package manager, pip, will handle the installation, fetching all necessary components like a skilled quartermaster. Now, you’re ready to launch:
    recon-ng

Now, I didn’t forget the macOS folks. Installing Recon-ng on macOS involves a slightly different set of steps compared to Windows. It’s akin to preparing for a different kind of cybersecurity expedition, where the terrain (operating system) requires a unique set of tools and preparations.

Here’s how to install Recon-ng on macOS:

  1. First, you’ll need Homebrew, the package manager for macOS. It’s like a Swiss Army knife for software installation on a Mac. Open the Terminal (you can find it in Applications | Utilities) and run the
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    This command downloads and runs the Homebrew installation script, setting up Homebrew on your system.
  2. macOS usually comes with Python pre-installed; it’s usually an older version. You’ll need Python 2.7 for Recon-ng. Install it using Homebrew by typing the
    brew install python@2
  3. To ensure Python is installed correctly, type python2 --version in the Terminal. This should display the Python version, confirming that the right tool is in place.
  4. Now, with Python ready, install Recon-ng using pip, Python’s package manager. In the Terminal, enter the
    pip2 install recon-ng
    This command tells pip to fetch Recon-ng and install it, much like how you’d download the latest security patches for your systems.

After the installation, it’s time to launch Recon-ng. Simply type recon-ng in your Terminal. This is akin to booting up a sophisticated security program, ready to delve into the depths of cyber reconnaissance.

After the installation is complete, you’re almost ready to dive into the digital reconnaissance field.

Running modules and gathering information with Recon-ng

Section titled “Running modules and gathering information with Recon-ng”

The framework combines a plethora of tools and techniques, streamlining them into an organized system of modules. Each module, ranging from domain profiling to social media scraping, is crafted to provide specific information about a target.

After installing Recon-ng, we want to make sure you understand the workspaces; these are essential.

To create a new workspace, use the following command:

workspaces create [workspace_name]

The output is as follows:

Figure 5.1 – Loading a workspace called gotham

Figure 5.1 – Loading a workspace called gotham

Utilizing a workspace in Recon-ng is akin to setting up a dedicated project folder on your computer. Recon-ng’s workspace functionality allows users to separate the data and configurations of different projects. This compartmentalization is crucial for several reasons:

  • Isolation of projects: Each workspace in Recon-ng acts as an isolated container for a project’s data. This means that when you’re working on multiple investigations or tasks, each one can have its own workspace with its respective data, modules, and configurations. There’s no risk of cross-contamination between projects, which is a cardinal rule for any good investigation.
  • Maintaining focus: By segmenting data into workspaces, you can maintain a clear focus on the task at hand without distraction from unrelated data. This is especially important when working with large amounts of information, as it helps avoid confusion and ensures that you’re only seeing what’s relevant to your current inquiry.
  • Data integrity and non-interference: Using separate workspaces helps preserve the integrity of your data. For example, if you need to revisit a previous project for additional analysis or to verify findings, you can be confident that the data has remained untouched by other activities.
  • Efficient reporting: When it’s time to compile findings into a report, having all relevant data within a single workspace streamlines the process. There’s no need to sift through unrelated information, and you can export or reference the findings from that workspace directly.
  • Collaborative flexibility: If you work in a team, workspaces can be shared among team members, allowing for collaboration without risking the alteration of personal or other project data. Each member can switch between workspaces as needed, working in parallel on different aspects of the same project or on entirely separate projects.

Then, we have modules. The built-in marketplace has tons of modules available covering a wide range of reconnaissance tactics. Finding what you need is a cinch with the search feature, and installing new modules is as simple as typing marketplace install [module].

Note

Adding API keys is a snap too. Just use the keys add [name] [value] command to start leveraging services such as Shodan. Powerful!

Understanding and effectively using module commands is like knowing how to navigate through a complex security system, each command serving a specific purpose in your cybersecurity toolkit. Let’s take a closer look at this:

  • Searching To search the marketplace for a module, you can type the following:
    marketplace search
  • Viewing The following command will display categories and modules. You’ll see domain-based, location-based, and several other modules, each serving a unique purpose:
    show modules
  • Choosing and using a module: To download and install a module from the marketplace, type the following:
    marketplace install [name of the module]
    Then, to load the modules load hackertarget module type (or whatever the module name is you installed): Figure 5.2 – Commands that install and load a module from the marketplace

Figure 5.2 – Commands that install and load a module from the marketplace

  • Setting the necessary options for the module: First, to see what options are available, you can type the following:
    options lists
    Each module has specific options you’ll need to configure. Commonly, this will involve setting a target such as a domain name or IP address. So, I’m going to type the following:
    options set SOURCE example.com
  • Running the module: With options set, you’re ready to execute, so type the following command. The module will then do its magic, pulling the information it was designed to retrieve:
    run
    Once the module completes its operation, you can view the stored results with this command:
    show [table_name]
    For example, to view hosts you’ve discovered, type the following:
    show hosts
    The output would be something like this: Figure 5.3 – Output of Recon-ng against packtpub.com

Figure 5.3 – Output of Recon-ng against packtpub.com

The beauty of Recon-ng lies in this iterative approach, where each cycle of reconnaissance potentially unveils more details about your target. Recon-ng’s vast module library is its core asset. While the preceding steps provide a generic overview, each module may have its unique nuances. Regularly explore the available modules and stay updated with the Recon-ng marketplace for new additions.

Maltego – Visualizing OSINT data and connections

Section titled “Maltego – Visualizing OSINT data and connections”

Maltego is a tool used in cybersecurity to visualize and link data, helping experts uncover and understand online relationships and networks. It’s handy for tracking digital activities and analyzing cyber threats.

What sets Maltego apart is its ability to aggregate multiple reconnaissance tasks into a cohesive interface. Moreover, Kali Linux users have the added advantage of accessing a community edition, which offers an array of scans without any initial cost.

With Maltego, users can extract a wide range of information: personal details such as names, emails, and aliases; organizational data, including companies and websites; internet infrastructure details such as domains, IP addresses, and associated networks; documentation and files.

Major government agencies, including the United States National Security Agency (NSA), also employ tools such as Maltego to map out connections and monitor potential threats effectively.

Getting started with Maltego for OSINT investigations

Section titled “Getting started with Maltego for OSINT investigations”

Maltego is a pivotal tool in the OSINT sphere, designed primarily for data visualization. By presenting complex data in a more tangible and interconnected manner, Maltego offers clarity amid the digital chaos.

Maltego comes pre-installed on Kali; however, if you need to set it up, you can simply use apt-get to install it by typing the following:

sudo apt-get install maltego

Upon the first launch, Maltego will guide you through a setup wizard. This will include creating or logging into a Paterva account, which is essential for accessing certain features and transforms.

Once you’ve registered and logged in to Maltego, it’s time to determine the specific machine for your analysis. In the context of Maltego, a machine defines the depth and type of footprinting you aim to perform on your target.

Now, in order to get the full benefit of Maltego, you’ll need to add in transforms, which are basically plugins to third-party services to pull data from. Some transforms are free, and some of the better ones charge for their connections. I’m going to try to keep with just the freebies for this demo.

From the main dashboard, you can filter out all the pay-to-play transforms by selecting the Free (with API key) option. Here, you can see which transforms I’ve installed on my Kali system:

Figure 5.4 – The transforms I’ve installed on my system

Figure 5.4 – The transforms I’ve installed on my system

Next, we’ll create a new graph by clicking on the New icon in the menu bar. Now, we want to add an entity, which is an object that our transforms are providing us. I’m going to scroll down and select a person entity and drag that icon over onto the graph like I’m showing you here:

Figure 5.5 – Here, I’ve dragged a person entity over onto the graph

Figure 5.5 – Here, I’ve dragged a person entity over onto the graph

You’ll notice right away that the default name is John Doe. Now, that’s not really who I want to search for, so let’s change the name to someone who might be kind of cool to gather intel about. Double-click on the person icon, and let’s change it to Elon Musk for giggles. Click OK. Now, let’s right-click the icon, and you’ll see the different transforms you can run:

Figure 5.6 – By right-clicking on the object, you can see which transforms you can run

Figure 5.6 – By right-clicking on the object, you can see which transforms you can run

Let’s go ahead and run them all and see what happens.

So, we start off seeing several email addresses. Some might be Elon’s real email address (such as [email protected]) while others could be someone else or even a spammer’s email address). Let’s right-click on [email protected] and run all the transforms here:

Figure 5.7 – Interesting info after running transforms for elon.musk@spacex.com

Figure 5.7 – Interesting info after running transforms for [email protected]

If you select the Leaked icon, you’ll see on the left side that this email address was associated with a database leak:

Figure 5.8 – Details about the object show the email was involved in a breach

Figure 5.8 – Details about the object show the email was involved in a breach

You can continue to dive deeper into each object that you discover to increase your knowledge of the target. For example, you can run the transforms for the domain of spacex.com, as I did here. You’ll notice that so many objects came back that it zoomed out to where all we see are dots that represent additional objects. You can zoom up and navigate around to continue your search for intel:

Figure 5.9 – Results for the spacex.com domain

Figure 5.9 – Results for the spacex.com domain

Notice as I zoom in that I’m starting to see other names of people as well as phone numbers starting to appear; this could lead me down another rabbit hole of research and investigations:

Figure 5.10 – Notice the names and even phone numbers that are populating

Figure 5.10 – Notice the names and even phone numbers that are populating

To start, select a domain and explore the available transforms, which are essentially different functionalities or tasks you can perform. For instance, let’s begin with DNS to get some DNS information. We can also look at other transforms to enumerate information such as the mail server and the name service, and find other top-level domains or websites.

First, let’s perform a transform to websites, which gives us the website associated with the domain. Next, by right-clicking on the domain icon, we can select the name service, which will provide us with the name service information. From there, we can enumerate subdomains and explore the mail service to understand where the mail is being handled, revealing various mail servers.

Now, let’s examine other top-level domains associated with yahoo.com. This process uncovers domains such as yahoo.au, yahoo.email, tokyo, and so on:

Figure 5.11 – Output of top-level domains, name servers, and websites

Figure 5.11 – Output of top-level domains, name servers, and websites

The next step is to see if we can resolve some emails. We can try using WHOIS information, PGP, or search engines for this purpose. However, if we don’t find any emails from the search engine, that’s okay.

Let’s see if we can get any IP addresses from the name servers. We can also explore shared websites or domains running on these name servers. By resolving these to various IPs, we can then confirm the owner of these IPs and look for their email addresses, which might come from various sources.

For example, we find emails such as [email protected], which are quite useful. If we resolve these domains, we can group them together and check which name servers they point to, typically the standard Yahoo servers. By grouping all the name servers, we can discover all other domains currently hosted on these servers:

Figure 5.12 – More intel such as emails, IP addresses, and websites

Figure 5.12 – More intel such as emails, IP addresses, and websites

This process might take a while as it runs the transforms, but it eventually provides a comprehensive overview of the structure, including sites such as Yahoo, yahoologins.com, yahoochatrooms, rocketmail.ru, and more:

Figure 5.13 – This is a small overview of yahoo.com’s infrastructure

Figure 5.13 – This is a small overview of yahoo.com’s infrastructure

This gives us a good representation of all the information we’ve gathered and how it relates to each other in terms of domains, name servers, mail servers, and so on. Crazy, huh?

Shodan isn’t your typical search engine. Instead of searching for websites, Shodan scans the internet for devices. From webcams to traffic lights, if it’s connected to the internet, Shodan aims to find it. Given the explosive growth of IoT devices, understanding and leveraging Shodan becomes pivotal for anyone in the cybersecurity and OSINT domain.

While Google helps you find websites, Shodan helps you find devices. It’s designed to see the internet from a device’s perspective. Whether it’s a smart fridge, an Industrial Control System (ICS), or even a city’s power grid, if these are improperly secured and connected online, they’ll likely show up on Shodan.

To harness the capabilities of Shodan, do the following:

  1. Head to the Shodan website (https://www.shodan.io/) and create an account.
  2. Once registered, you’ll gain access to the search interface. Here, you can input specific terms, IP addresses, or filters to begin your search.
  3. A simple search for webcam on Shodan can reveal countless cameras connected across the globe. But the real fun begins when you start playing with Shodan’s filters. For instance, if you’re looking for webcams specifically in Chicago, just type country: US city:Chicago webcam, and voilà, you’re there.

Shodan’s capabilities go beyond just geographical searches. Say you’re interested in a pi-hole device. Just type in dnsmasq-pi-hole" "Recursion: enabled, and Shodan will show you where these devices are located globally:

Figure 5.14 – What Shodan found when searching for a pi-hole device

Figure 5.14 – What Shodan found when searching for a pi-hole device

This tool is incredibly useful for security professionals, especially when conducting company security assessments. For example, if you want to see all the devices owned by a company such as Microsoft, just use the org filter with org: Microsoft, and you’ll get a comprehensive list.

But what about finding servers running specific services or software? Shodan makes this easy too. If you’re looking for servers running SSH (which typically uses port 22), just type port:22 in Shodan. Or, if you’re interested in finding servers running a vulnerable version of software, such as Apache version 2.2.15, use the version filter. This feature is particularly useful for identifying potential security risks:

Figure 5.15 – Over 319,000 vulnerable Apache servers still online

Figure 5.15 – Over 319,000 vulnerable Apache servers still online

Shodan isn’t just about finding webcams and servers; it’s also a gateway to exploring ICS. By using the tag:ics filter, you can delve into the world of industrial controls. And for those concerned about security, Shodan can help find devices that still use default passwords – a common vulnerability in many systems.

One of the more intriguing aspects of Shodan is its ability to expose internet-facing databases. A simple search for MongoDB, for instance, can reveal thousands of MongoDB databases accessible online. This is a significant concern from a data security perspective. As ethical security professionals, our goal is to secure these systems, not exploit them. Remember my motto, “ Just because you can doesn’t mean you should!” If you come across an exposed database, it’s always a good practice to inform the owner organization about the vulnerability.

Shodan even allows us to monitor real-time data, such as NetWave IP camera feeds, which can be filtered geographically.

If you want more information, you just click on the name of the device in the results, and bam! You are presented with a plethora of intel:

Figure 5.16 – Here, I’ve clicked on an IP camera to expose more intel

Figure 5.16 – Here, I’ve clicked on an IP camera to expose more intel

Another remarkable feature of Shodan is its ability to locate smart devices and IoT systems. Using the iot search, you can get an overview of connected smart devices in a specific area, highlighting the ubiquity and vulnerability of these devices.

But Shodan’s capabilities don’t end there. It can even find specific types of errors on web servers, such as those returning a hacked header, which is incredibly useful for web developers and system administrators

Shodan also reveals devices you might not typically consider, such as online-accessible printers. This can be crucial for companies looking to prevent confidential information leaks. For cybersecurity enthusiasts, Shodan is a treasure trove of information on server configurations, firewall settings, and security measures, offering a real-time snapshot of the state of internet security.

For those looking to integrate Shodan’s capabilities into their applications or automate tasks, Shodan offers an API.

Access your API key from the Shodan dashboard after registration.

This key allows you to automate searches, integrate Shodan into custom tools such as Maltego, or even build new applications harnessing its device-scanning prowess.

Trace Labs – A powerful OS designed just for OSINT

Section titled “Trace Labs – A powerful OS designed just for OSINT”

Get ready to immerse yourself in the wonderful world of OSINT with Trace Labs! This brilliant platform is like a funhouse designed just for intel-savvy folks such as us. The moment you log in, you’ll see everything is centered on making your investigative life easier. Trace Labs is built on a stripped-down version of Kali Linux, so the interface is extremely familiar. The interface is intuitive and simple to use, letting you focus on searches rather than fumbling with tools. All the essential gear for tracking down details is right at your fingertips, prepped and ready to uncover insights:

Figure 5.17 – Trace Labs desktop

Figure 5.17 – Trace Labs desktop

But wait – there’s more! This supercharged tool for your utility belt has everything you need to take your online inquiries to the max. The developers really covered all the bases, anticipating the customized workflows of different professionals.

And talk about a supportive community! A team of expert users is there every step of the way to collaborate, give pointers, and make sure you get the most out of the platform. With this all-star crew behind you, you’ll be amazed at how quickly your skills improve.

Trace Labs has developed a model to use crowdsourcing to help with missing persons cases that law enforcement has requested public assistance with. They bring together hundreds of skilled investigators through our Capture The Flag (CTF) events and ongoing operations to crowdsource any new leads that might be out there on the internet, using only OSINT.

You can download an already prepared virtual machine directly from Trace Labs’ website (https://www.tracelabs.org/initiatives/osint-vm) and get involved with their initiatives and have access to some cool tools.

Aircrack-ng is not just a toolbox for testing Wi-Fi security; it’s also a powerful tool used in OSINT. This means it helps gather information from publicly available sources, such as Wi-Fi networks, to learn more about them.

In OSINT, finding weak spots in networks is crucial. Aircrack-ng helps identify these weaknesses, showing us which networks might be easy targets for hackers. This way, we can learn about potential risks and how to protect against them.

By observing how these networks operate, Aircrack-ng helps us learn patterns. For example, we can find out when a network is most active or see if any unusual signals stand out.

Aircrack-ng can be used to map out Wi-Fi networks in an area. This is really useful for understanding how networks are spread out in different places, such as in a city or a neighborhood.

For people studying cybersecurity, Aircrack-ng offers a wealth of real-world data. By collecting information from various networks, researchers can understand better how to build stronger and safer Wi-Fi networks.

Note

It’s important to remember that while Aircrack-ng can be used to gather lots of information, it should always be used responsibly and ethically. Just as with any powerful tool, it must be used for learning and improving security, not for doing anything harmful or illegal.

When using Aircrack-ng, there are different tools available for specific jobs. Each tool has its own purpose and can be used either alone or with others in the suite to perform wireless network security tasks. The suite includes tools such as the following:

  • Airmon-ng enables monitor mode on your wireless adapter to start capturing network traffic
  • Airodump-ng captures network traffic and then finds wireless networks and data packets
  • Airgraph-ng makes graphical representations of the network traffic
  • Aireplay-ng creates network traffic and performs attacks such as deauthentication and packet injection to alter network behavior
  • Aircrack-ng is the main tool that cracks Wired Equivalent Privacy (WEP) and Wi-Fi Protected Access (WPA)/WPA2 encryption keys to assess network security
  • Airbase-ng makes fake Wi-Fi Access Points (APs) for Man-in-the-Middle (MitM) attacks or social engineering attacks

There are also other tools such as airdecap-ng, airdecloak-ng, and airtun-ng, but we won’t be focusing on them in this book.

Note

It’s important to note the difference between Aircrack-ng (the suite) and aircrack-ng (the tool). As of the writing of this text, Kali includes Aircrack-ng, but this may change in the future.

If you need to install Aircrack-ng on either Kali or another Linux distribution, here’s the command to do so:

sudo apt-get install aircrack-ng

Now that we have Aircrack-ng installed, let’s jump in.

So, what does Airmon-ng do? It’s like a switch that turns your Wi-Fi adapter (the thing in your computer that connects to Wi-Fi) into a super listener. Normally, your Wi-Fi adapter just pays attention to the internet stuff meant for your computer. But with Airmon-ng, it starts listening to all Wi-Fi signals around it, even ones not meant for you. This is called monitor mode.

Why is monitor mode important? Well, imagine you’re a cybersecurity expert or someone who needs to check if a Wi-Fi network is safe. By using Airmon-ng to listen to everything in the air, you can figure out if there are any weak spots in the network or if someone is trying to break in.

Using Airmon-ng is pretty straightforward. First, you need to find out the name of your Wi-Fi adapter (it’s usually something such as wlan0). You can do this with some simple computer commands. Once you know the name, you use Airmon-ng to switch your adapter into this all-listening mode. Managed mode is the default mode for Wi-Fi adapters, where your adapter only receives packets addressed to your specific MAC address, while monitor mode enables your adapter to receive any packets in range, even if not addressed to your MAC address. Let me show you how we get our Wi-Fi cards into monitor mode:

  1. To check the interface name, you can run the
    ifconfig
  2. Next, you’ll want to check to find conflicting processes that could interfere with
    sudo airmon-ng
    Make a note of the interface name as you’ll need that here in a second.
  3. Next, you’ll want to find out if anything is running that will interfere with the Aircrack-ng suite. We do this by typing
    sudo airmon-ng check
  4. If anything shows up here, you’ll want to shut it down by typing
    sudo airmon-ng check ki
  5. Then, to actively start monitoring and seeing the magic of Wi-Fi, you’ll type
    sudo airmon-ng start <the adaptername you saw above>
  6. Now, type
    ifconfig
    You’ll see that your adapter has changed its name from wlan0 to wlan0mon: Figure 5.18 – Airmon-ng has changed the name of our adapter

Figure 5.18 – Airmon-ng has changed the name of our adapter

Here, you’ll see that in monitor mode, your interface name will change to wlan0won.

In addition to the previously mentioned airmon-ng commands, there are a few more that are helpful. The airmon-ng stop command can be used to disable monitor mode on the interface. Similarly, airmon-ng --channel can be used to set the default channel when enabling monitor mode.

Once we have our Network Interface Card (NIC) in monitoring mode, we can proceed with capturing the necessary data and performing wireless security checks. This is the first key step that sets the stage for Aircrack-ng.

Airodump-ng is another tool in the Aircrack-ng suite, and it’s super useful for anyone interested in wireless network security. It’s designed to help you gather information about Wi-Fi networks around you.

This is what Airodump-ng does:

  • Captures Wi-Fi data: Airodump-ng listens to and captures data from Wi-Fi networks. It can see all the Wi-Fi traffic flying around in the air, not just the stuff meant for your device.
  • Sees network details: It shows you a list of all the Wi-Fi networks it can find, along with important info such as how strong the signal is, what channel they’re on, and what kind of security they use.
  • Tracks devices: Airodump-ng can also see which devices (such as phones or laptops) are connected to each Wi-Fi network.

You run airodump-ng after you get airmon-ng up and running (that’s the process we just showed you how to do in the previous section). You then simply type the following:

sudo airodump-ng wlan0mon

The output is shown in the following screenshot:

Figure 5.19 – Airodump-ng identifying Wi-Fi signals

Figure 5.19 – Airodump-ng identifying Wi-Fi signals

To narrow down your capturing using airodump-ng, there are several common commands you can use. These include the following:

  • --channel: Select a specific channel to listen on
  • --bssid: Filter to a specific Basic Service Set Identifier (BSSID)
  • -w: Specify an output file prefix
  • --encrypt: Filter by encryption type
  • --showack: Show ACK stats for clients to identify injection vulnerabilities

Here is an example of how to capture using these commands:

sudo airodump-ng wlan0mon --channel 6 --bssid <AA:BB:CC:DD:EE:FF> -w output

With airodump-ng, you can gather information such as MAC addresses for APs and clients’ systems for further analysis and setup for advanced attacks with Aircrack-ng.

Deauthentication attacks, executed through Aireplay-ng, form a critical component in the arsenal of network security testing. These attacks disrupt the wireless communication between a client and the AP, forcibly disconnecting them. The technique leverages deauthentication packets, which are part of the Wi-Fi protocol but are exploited to sever connections. This process is instrumental in testing network resilience against Denial-of-Service (DoS) attacks and in facilitating the capture of WPA/WPA2 handshakes.

To use aireplay-ng, you need to provide the following information:

  • The type of attack, using –deauth as an example
  • The target network, using the -a switch along with the BSSID of the target
  • You should also provide the monitoring interface, such as wlan0mon, as well as the MAC addresses of the target AP/client

Here’s an example of what a command would look like with aireplay-ng:

sudo aireplay-ng --deauth 100 -a <AA:BB:CC:DD:EE:FF> -c <11:22:33:44:55:66> wlan0mon

Some common aireplay-ng commands are the following:

  • --deauth: This is used for deauthentication attacks
  • --fakeauth: This command is used for fake authentication attacks
  • --arpreplay: This command is used for Address Resolution Protocol (ARP) request replay attacks
  • -a: This is used to specify the target AP BSSID
  • -c: This is used to specify the target client’s MAC address

Aireplay-ng’s capabilities extend to a broad spectrum of testing scenarios. By simulating various attack vectors, from basic deauthentication to complex ARP injections, it provides an in-depth analysis of a network’s security. This tool is instrumental in identifying weaknesses, testing network response to hostile activities, and validating the effectiveness of security measures in place.

Aircrack-ng is crucial for testing network security by breaking encryption keys. It’s important to know how to crack WEP and WPA/WPA2 encryptions. WEP, being older and less secure, is easier to crack due to its weaknesses. WPA and WPA2 are tougher, but they can still be cracked, especially with weak passwords, using more advanced techniques.

To crack WPA/WPA2, Aircrack-ng mainly uses two methods: dictionary and brute-force attacks. Dictionary attacks try passwords from a pre-made list, while brute-force attacks test all character combinations until the right one is found. The success of these methods depends on the password’s strength and the wordlist’s quality.

In addition to dictionary and brute-force attacks, when cracking WPA/WPA2 with Aircrack-ng, using a .cap file is crucial. This file contains captured data packets from the network. By analyzing these packets, particularly the ones involved in the handshake process, Aircrack-ng attempts to decrypt the network key. The success of cracking the password depends on the information captured in the .cap file, which includes the handshake data necessary for deciphering the network’s encryption key.

Some common aircrack-ng commands include the following:

  • -w: To specify the wordlist or dictionary file
  • -b: To specify the target AP BSSID
  • -e: To specify the target network Extended SSID (ESSID)
  • -a: To specify the attack mode (2 for WPA/ WPA2-Pre-Shared Key (WPA2 PSK)

To crack hidden WPA/WPA2-PSK networks, you need to tag the ESSID with -e like this:

sudo aircrack-ng -w dictionary.txt -b <AA:BB:CC:DD:E:FF> output-01.cap

After finding a possible key, Aircrack-ng checks if it can decrypt the network’s data. This is crucial to see how strong the encryption is and to identify weak spots. It also helps understand what kinds of passwords are easier to crack, which is useful for creating stronger password policies.

Airbase-ng is another cool tool that is a part of the Aircrack-ng suite. It allows you to create fake APs. Setting up pretend Wi-Fi spots with Airbase-ng is like laying a clever trap to see how tough our networks are and if people can spot the trick. Picture Airbase-ng as a toolbox in the Aircrack-ng kit, letting tech pros build these decoy Wi-Fi spots. It’s like putting up a stage and seeing how gadgets and folks react, teaching us heaps about keeping our Wi-Fi safe and sound.

Creating these fake spots is pretty simple. You just pick a channel and a Wi-Fi name (that’s the ESSID) that looks legit. Then, you decide if you want this mock Wi-Fi to ask for a password or not. It’s all about making it look real.

But there’s more! These fake Wi-Fi spots aren’t just for show. They’re the starting point for something called MitM attacks. It’s a sneaky move where a hacker secretly messes with messages between people who think they’re talking directly to each other. By setting up a fake Wi-Fi, the hacker gets in the middle, listens in, or even changes the data.

Setting up a fake AP with airbase-ng requires specific details. You choose an ESSID (the Wi-Fi name), a channel, and whether it’s encrypted or not. You also need to set your computer to monitor Wi-Fi traffic using the wlan0mon interface that you created with airmon-ng. Then, you tweak your settings so that your fake Wi-Fi looks just like the real deal, using a command like this:

sudo airbase-ng -a <AA:BB:CC:DD:EE:FF> --essid <FakeAPName> --channel <#> wlan0mon

Here are some common airbase-ng commands that you can use to customize your fake AP:

  • -a: Sets the fake AP BSSID
  • --essid: Sets the fake AP ESSID
  • --channel: Sets the channel
  • -W 1: Enables WEP
  • -z: Enables WPA/WPA2

With airbase-ng ’s flexibility and range of options, it becomes a valuable tool in Aircrack-ng for anyone looking to test network security.

Airgraph-ng is a key part of the Aircrack-ng suite that helps you understand your wireless network better. It turns complex network data into graphs that are easy to read. These graphs show a lot of important things about your network, such as how much data is moving through it, which devices are connected, and possible security issues.

The first step in using Airgraph-ng is to collect network data with Airodump-ng. This data is what you’ll use to create your graphs. Using airgraph-ng requires an input CSV file from airodump-ng and specifying an output file for the graph. For example, if want a Client to AP Relationship (CAPR) graph that would show you connections and data packets, you’d use this command:

sudo airgraph-ng -i output-01.csv -o output.png -g CAPR

Some common airgraph-ng commands to gather more intel include the following:

  • -i: Input CSV file
  • -o: Output graph file
  • -g: Graph type
  • -c: Channel filter
  • --essid: Filter by ESSID

The graphs you make with Airgraph-ng are helpful for understanding your network. They take complex data and make it simpler to see patterns and spot problems. For example, you can see if there’s a lot of data moving at certain times or if there are devices on your network that shouldn’t be there. These graphs are especially useful for finding unusual activities that could be security threats.

Understanding the basics of Aircrack-ng is a crucial step in uncovering hidden networks. It is important to realize that although a network may be hidden, it is not completely invisible. It is similar to a bad magician at a children’s party who pretends to make something disappear but can be easily spotted by a careful observer. Likewise, the name or SSID of a hidden network is not openly broadcasted, but with the right tools, we can reveal what is trying to stay concealed. So, it is important to remember that finding a hidden network is not impossible, and with the right approach, it can be easily achieved.

First things first, you’ll want to switch your wireless card into monitor mode so that it will show you all the secret Wi-Fi signals flying through the air:

airmon-ng start wlan0

You are now all set to begin monitoring all networks in close proximity with this command:

airodump-ng wlan0mon

In the list that pops up, hidden networks will show the SSID as just <length: x>. But here’s where the magic happens – anyone connected to that hidden network is constantly shouting out probe requests asking to reconnect. And these requests conveniently reveal the hidden SSID every time!

Figure 5.20 – Notice that airodump-ng identifies this AP’s ESSID as length:6:

Figure 5.20 – Notice that airodump-ng identifies this AP’s ESSID as length:6:

So, we just have to force a connected device to send out a probe request by briefly disconnecting it with the following command:

aireplay-ng -0 30 -a [AP MAC] -c [Client MAC] wlan0mon

The -0 flag sends the disconnect signal, and 30 identifies the number of packets to send.

Once we deauth the client, switch back over to airodump-ng, and you’ll see the hidden SSID magically appear! Easy peasy lemon squeezy:

Figure 5.21 – Airodump-ng reveals the SSID as SkyNet

Figure 5.21 – Airodump-ng reveals the SSID as SkyNet

While hiding your SSID seems sneaky, it’s child’s play for a hacker to uncover. Don’t let it give you a false sense of security! Be sure to use strong encryption, passwords, and other protections as well.

Speaking of deauth attacks, we can use these to create MitM attacks, which can lead to data interception. This can be a serious issue that needs to be addressed.

Firstly, a hacker sends deauth messages to force you off the real Wi-Fi network. This can be really frustrating!

The next step involves the hacker setting up a router with the same network name as the real one (we call this an Evil Twin). Your device, thinking it has reconnected to the real network, has actually connected to the fake one.

Now comes the MitM part – any data you send on the fake network gets intercepted by the hacker. This includes sensitive information such as passwords, messages, and emails. It’s a scary thought, isn’t it?

OSINT tools span a broad spectrum, offering capabilities that range from domain information extraction to social media monitoring. These tools, accessible to anyone, can often be modified to suit specific needs due to their open source nature. Next is a selection of standout open source OSINT tools, their features, and their utilization within Kali Linux.

SpiderFoot is an incredibly powerful OSINT automation tool that integrates various data sources to gather and centralize information about a specific target. This can be an IP address, domain name, email address, or even a username. With more than 200 modules, SpiderFoot consolidates a broad swath of digital intelligence, making it easier for investigators to analyze and interpret.

To install SpiderFoot, you would open a Terminal and type the following:

sudo apt install spiderfoot

SpiderFoot can be started by executing sf.py from its directory, but ensure Python 3 is being used. Many Linux distributions default to 2.7:

python3 sf.py -l 127.0.0.1:5001

The output is shown in the following screenshot:

Figure 5.22 – Starting up SpiderFoot using the sf.py command

Figure 5.22 – Starting up SpiderFoot using the sf.py command

After starting the SpiderFoot service, open a browser and enter the following URL:

127.0.0.1:5001

You should see a web interface like the one shown next. Let’s click the New Scan tab and fill out the information that is needed to identify the target. I’ll use hackthissite.org in this example:

Figure 5.23 – Configuring a new scan in SpiderFoot

Figure 5.23 – Configuring a new scan in SpiderFoot

Click on the Run Scan Now button and wait for the scan to complete. It may take some time, but eventually, you will be able to see a lot of information about the site. Please note that my favorite word – plethora – might be used to describe the amount of intel you’ll receive:

Figure 5.24 – Output from SpiderFoot

Figure 5.24 – Output from SpiderFoot

SpiderFoot has a really cool feature where you can zoom in on any column to get more information. This means you can easily explore and analyze the data in greater detail. Simply click on any column that catches your attention, and the tool will automatically zoom in and display all the relevant information. It’s a powerful and user-friendly feature that makes analyzing data a breeze!

Twint stands for Twitter Intelligence Tool. It’s an advanced X, formerly Twitter scraping tool that allows for the extraction of tweets from Twitter profiles without using Twitter’s API. This is a significant advantage because it bypasses the limitations imposed by the Twitter API, such as rate limits and the inability to access older tweets.

Some of its key features include no Twitter API required, which collects a wide range of data from tweets, including date, time, and content, as well as information about likes and retweets, and gathers data from Twitter user profiles, including followers, followings, number of tweets, and location information.

You can add Twint to your Kali or Trace Labs OS by opening a Terminal and typing each of the following commands:

git clone --depth=1 https://github.com/twintproject/twint.git
cd twint
pip3 install . -r requirements.txt
pip3 install twint

The main command for fetching tweets is shown here:

twint -u username

This collects all tweets from a user’s timeline. To search tweets for a keyword, use the following:

twint -u username -s batman

The -s flag looks for batman in the target user’s tweets. You can also search all tweets globally:

twint -s batman

Here are some other examples:

twint -u username --year 2023 # Tweets before 2023
twint -u username --since 2020-12-20 # Tweets after Dec 20, 2020
twint -u username -o tweets.csv --csv # Save Tweets to a CSV

Here’s the command to get a user’s profile info:

twint -u username --user-full

To gather a user’s followers or follows, use these commands:

twint -u username --followers
twint -u username --following

Here are the commands for fetching full user details on connections:

twint -u username --followers --user-full
twint -u username --following --user-full

You can also save tweets in various formats:

twint -u username -o tweets.json --json
twint -u username -o tweets.db --database
twint -u username -o file.txt

You can also output to Elasticsearch and SQLite. And if you import Twint as a module, you can fully customize the output.

As you can see, Twint gives you access to the tweets and metadata Twitter keeps locked down. Learn its query language, and an ocean of vital Twitter data is at your fingertips.

I know we’ve talked about lots of tools up to now, but the one thing that makes the hair on the back of my neck stand up is the amount of intel we expose unwittingly, either through social media or by registering for apps or any online service. Our information is everywhere. This intel can be easily accessed without tools, but rather just using some deduction skills and command sense.

One of the most prominent TikTok investigators is Shay, known as @shay.nanigans87. With over 360,000 followers as of November 2023, Shay has garnered fame for her ability to track down strangers on the internet using only the smallest clues. Her videos show her zooming in on tiny details in photos, deciphering blurred-out details, and piecing together information to identify random people who’ve challenged her to find them:

Figure 5.25 – TikToker @shay.nanigans87 uses no tools to find targets

Figure 5.25 – TikToker @shay.nanigans87 uses no tools to find targets

In one video, Shay demonstrates how she can take a partial shipping label from a box in someone’s photo and figure out their address. In another, she enhances a blurry store receipt to read the purchaser’s name. Her videos are a captivating display of digital detective work.

While Shay maintains she only uses her abilities ethically, her videos serve as a reminder that our privacy may be more fragile than we realize in the digital age.

Another question after playing with all these tools is: How do you keep up with OSINT tools and techniques? Well, let’s talk about that next.

Keeping up with the open source OSINT landscape

Section titled “Keeping up with the open source OSINT landscape”

As technology progresses, the tools and techniques used in the field adapt to stay relevant and effective. Whether it’s the introduction of new platforms or the emergence of cutting-edge tools, staying updated with the latest developments is crucial for OSINT professionals.

Many cybersecurity researchers, intelligence professionals, and hobbyists maintain blogs and websites where they discuss the latest OSINT techniques, tools, and case studies. Regularly reading these can provide insights into the newest trends and best practices. Websites such as Bellingcat, OSINT Essentials, and OSINT Techniques are gold mines of information:

  • Bellingcat (https://www.bellingcat.com/): An investigative journalism website that specializes in fact-checking and OSINT. They often publish detailed methodologies behind their investigations, which serve as excellent learning material.
  • OSINT Curious (https://www.osintcurio.us/): A project focused on OSINT news and resources. They offer webcasts, blogs, tools, and tips for the OSINT community.
  • Sector035’s Week in OSINT (https://sector035.nl/): A weekly roundup of interesting links and news around the OSINT community.
  • IntelTechniques (https://inteltechniques.com/): Maintained by Michael Bazzell, a former FBI cybercrime investigator. The website provides a plethora of tools, training, and resources related to OSINT.
  • OSINT Essentials (https://www.osintessentials.com/): A resource-rich site that provides numerous tools, references, and guides for OSINT professionals and enthusiasts.
  • OSINT Techniques (https://www.osinttechniques.com/): A handy resource site with categorized OSINT tools and instructional content.

Every year, big cybersecurity conferences such as DEF CON, Black Hat, and Bsides have special sessions on OSINT. These events are great for learning about OSINT by actually doing it. The instructors are often some of the best in this area. Plus, these conferences are a great place to meet other people who work in cybersecurity, which can help you learn more and grow in your career.

When checking out new OSINT tools, you should think about a few important things to make sure they’re good for you:

  • Who made it: Check who created the tool. Look up the name of the developer or company online to see if they are known and trusted in the OSINT community.
  • How it helps you: Ask yourself questions such as: Does this tool do something that I can’t do with my current tools? Is it faster or more accurate? If it just does the same things as your other tools, it might not be worth using.
  • What other users say: Look for reviews or comments from people who have used the tool. You can find these on online forums, social media, or websites that talk about OSINT tools. Pay attention to what they say about how easy the tool is to use, how well it works, and if they have had any problems with it.
  • Updates and improvements: Good tools are updated regularly by their creators. This means they get better over time, fix any problems, and adapt to new challenges in OSINT work. Check the tool’s website or online forums to see how often it gets updated and if the updates really improve it.

By thinking about these things, you can pick the best OSINT tools that are safe and useful and keep up with the latest changes in the world of cybersecurity.

The OSINT community is vast and diverse, with professionals from various backgrounds and expertise levels. Engaging with this community can provide the following benefits:

  • Collaborative learning: Sharing experiences, challenges, and solutions can lead to collective growth.
  • New perspectives: Different individuals might approach a problem differently. Engaging with others can provide fresh viewpoints and techniques.
  • Networking: Building relationships within the community can open up opportunities for collaboration, mentorship, and even job prospects.

In this chapter, we looked at some really useful OSINT tools such as Recon-ng, Maltego, Shodan, and Tracelabs-OS. Each of these tools helps us in different ways to understand and use OSINT better. For example, Maltego helps us see how different pieces of data are connected, and Shodan lets us explore IoT. We also talked about other tools such as Aircrack-ng, SpiderFoot, and Twint, and how important it is to keep learning and sharing in the OSINT community.

Next up, we’ll learn how smart uses of OSINT can help spot and stop cyber risks, keeping both people and companies safe online.