Labwithanser
Labwithanser
Objectives
In this lab, you will explore several OSINT tools that are commonly used by
pentesters.
Background / Scenario
When performing information gathering activities, passive reconnaissance uses
open, publicly accessible data to guide active reconnaissance efforts and to gather
information about the enterprise and employees. In OSINT, it is the data that is open
source. OSINT tools may or may not be open source. Some tools are free and open,
others require registration to use free versions, and others require a fee for use.
OSINT commonly uses data sources that are available to any hacker, so part of the
PenTesting effort is to report on sensitive information that is commonly available in
order to evaluate vulnerabilities that it may cause. The objectives of OSINT are:
Required Resources
Kali VM customized for Ethical Hacker course
Internet access
Instructions
Part 1: Examine OSINT Resources
Step 1: Access the OSINT Framework
The OSINT Framework is a useful way to visualize the OSINT tools and resources
that are available. Unfortunately, it has become a bit outdated, with some resources
no longer available. It is still valuable to help you understand the types of tools
available and their uses. In many cases, the links are still good.
e. In the search box, type in a few usernames, each on a separate line. Use your
own usernames or others that you find. Try searching the internet
for common username wordlist for other potential search terms. You can
filter the results based on the category filters, but for now, just click the green
magnifying glass button to start the search.
In a pentest, you would use another tool, such as SpiderFoot (below) to find
usernames in email addresses that are associated with a company or domain.
f. Investigate the results. You can open the links to the accounts either from the
green rectangles or the table of results.
g. WhatsMyName provides a very flexible report of the results. The results table
can be sorted by column, and you can export the results as CSV or PDF for
reporting purposes. In addition, you can easily filter by username and search
within the results. Finally, you get links for the profile pages for the users at
many different sites.
Answer Area
Answers will vary. Username searching can identify accounts that important
enterprise personnel may have on various sites. Because other sites can be
vulnerable, it is possible that hackers could gain access to personnel
information from those accounts, including passwords, addresses, and
telephone numbers. The types of sites that personnel have registered for can
also provide details of their lives and interests. These details could be used in
social engineering attacks.
Hide Answer
The start.me web service is a popular bookmark manager and productivity tool. The
people at My OSINT Training (MOT) have set up a search system that finds all
OSINT-related links that people have bookmarked and shared on start.me. There
are many. You can enter OSINT-relevant search terms to find links to related
resources.
a. Go to https://smart.myosint.training/.
b. In the search box, enter the term usernames. You will see a list of username-
related OSINT tools that other people have found.
c. Open some of the links to review the resources. Be careful however, these
websites come from public sources. Some may be malicious.
d. Choose some of the categories that you saw in the OSINT Framework and
see what links appear.
e. Use this site to search for OSINT tools and resources to help you in your
pentesting work.
Domain names
IP addresses
Subnet addresses
Autonomous System Numbers (ASN)
Email addresses
Phone numbers
Personal names
SpiderFoot offers the option of choosing scans based on use case, required
data, and by SpiderFoot module. The use cases are:
All – Get every possible piece of information about the target. This use case
can take a very long time to complete.
Footprint – Understand the target’s network perimeter, associated identities
and other information that is yielded by extensive web crawling and search
engine use.
Investigate – This is or targets that you suspect of malicious behavior.
Footprinting, blacklist lookups, and other sources that report on malicious
sites will be returned.
Passive – This type of scan is used if it is undesirable for the target to suspect
that it is being scanned. This is a form of passive OSINT.
┌──(kali㉿Kali)-[~]
└─$ spiderfoot -l 127.0.0.1:5001
The command should run without errors. Open a browser and enter the IP address
and port for the SpiderFoot GUI. You will see the SpiderFoot interface appear. If this
is the first time that SpiderFoot has been opened in this VM, you will see the Scans
screen. This screen displays a list of all the scans recently run. In this example it is
empty.
a. Before we get started, look at the scanners that SpiderFoot uses to build its
reports. Go to the Settings tab.
b. The first two entries in the menu at the left are concerned with the operation of
SpiderFoot. The entries below this are for the scanners that SpiderFoot uses.
There are over 200 of them. Click the scanners to see their SpiderFoot
module name, details about the scanner, and settings that can be made, if
any. Complete the table below with some examples. The Scanner name is in
the settings menu. The module name appears in the details for the scanner.
All SpiderFoot modules are referred to as sfp_[module name].
Hint: scanners with a lock next to them indicate an API key is necessary.
Further information regarding the key requirements is provided in the details for
the scanner. Click the “?” icon next to the API Settings option.
Hint: You can interact with SpiderFoot from the terminal too. You can display
all the modules that are available in SpiderFoot and pipe the output to a text
file. Enter spiderfoot –h to view the command line options.
c. The grep command can then be used to search the file for keywords. This will
not provide information about API requirements, but it will help you to make
sense of the list of available modules.
┌──(kali㉿Kali)-[~]
└─$ spiderfoot -M | grep [search term]
d. Using the grep command and the GUI, complete the table below.
Note: Answers will vary. Some modules do the same thing or do multiple
things.
Informati
Scanner/Module Name API key requred? Free? Comments
on Type
Possible
accounts
Account Finder Over 200 sites like eBay,
associated No, N/A
sfp_accounts Redditt, slash dot
with a
domain
Links that Answer Area Answer Area Answer Area
are
associated
with the
Informati
Scanner/Module Name API key requred? Free? Comments
on Type
target
Email Answer Area Answer Area Answer Area
addresses
associated
with the
target
Domains
and URLs Answer Area Answer Area Answer Area
that are
associated
with the
target
Geolocatio Answer Area Answer Area Answer Area
n
informatio
n
Data Answer Area Answer Area Answer Area
breach
informatio
n
Scanner/
Information Type API key requred? Free? Comments
Module Name
Possible accounts Account
Over 200 sites like eBay,
associated with a Finder No, N/A
Redditt, slash dot
domain sfp_accounts
Links that are Cross-
associated with the Referencer, no Answers will vary.
target sfp_crossref
Email addresses EmailCrawlr,
associated with the sfp_emailcraw Yes, free plan Answers will vary.
target lr
Domains and URLs that
grep.app,
are associated with the Yes, free plan Answres will vary.
sfp_grep_app
target
Geolocation ipapi.com,
Yes, free plan Answers will vary.
information sfp_ipapicom
Leak-Lookup,
Data breach information Yes, free Answers will vary.
sfp_keybase
Hide Answer
Note: The All use case scan may use active scanning. Unless you have
permission to scan the target, you should avoid this setting. To be completely
safe, the Passive use case should avoid any problems with unauthorized
scanning.
a. Go back to the scan results, by clicking the Scans tab. You will see a table
with the currently running scan and any previous scans displayed.
b. Click the black square in the right-most column of the scans table to stop the
scan. Some information is not available until the scan is aborted or completed.
c. Click the name of the scan in the table to return to the scan view. You will be
taken to the Browse tab. Each row in the table represents data found by the
various modules. Some modules contribute to multiple types of data.
d. Investigate the results.
API keys will enhance the functionality of SpiderFoot. Some of these API keys
require free registration. The pentesting tools that are available are constantly
evolving. Some tools or services that were once free and open can become fee-
based over time.
Note: Some APIs may limit your results after you have reached a prescribed number
of uses.
c. Enter the API keys in the settings for each module. Be sure to save your
changes.
d. Click New Scan. Go to the By Module tab. Select only the modules for which
you have added API keys. All other modules should be unchecked.
e. Enter the target as h4cker.org and click Start Scan. Feel free to scan other
domains but be sure to observe the terms and conditions of this course.
Answer Area
sfp_intellx
Hide Answer
d. Double-click several of the entries in the table Data Element column, right
click, and select open in new tab.
Answer Area
The original leaked information.
Hide Answer
We are just scratching the surface with what this tool can do. Try other
searches and see what you can find.
Recon-ng has auto complete. Press the tab button to complete commands and
command options. Use the tab key twice to list the available commands and options
at different places in the command line. This is very handy.
a. To run Recon-ng, open a new terminal window and enter recon-ng. You can
also start the program by going to the Kali tools menu, searching for the app,
and clicking the icon.
b. Note that the terminal prompt changes to indicate that you are working within
the Recon-ng framework. Enter help to get a sense of the commands that are
available.
c. Recon-ng uses workspaces to isolate investigations from one another.
Workspaces can be created for different parts of a test or different customers
for example. Type workspaces help to view options for
the workspaces command.
Answer Area
Enter the workspaces list command.
Hide Answer
How can you remove a workspace?
Answer Area
Enter the workspaces remove [workspace_name] command.
Hide Answer
What command will exit the workspace and return to the main Recon-ng prompt?
Answer Area
The back command
Hide Answer
Return to the Recon-ng prompt. Enter the modules search command. This will
display the currently installed modules.
Answer Area
No modules are installed.
Hide Answer
Recon-ng will not function without modules. In this step, we will install modules from
the Recon-ng marketplace. The module marketplace is a GitHub public repository.
Search the web for recon-ng-marketplace to view the repository. Explore the
folders to learn more about the modules.
b. Note that the modules are organized by their category and type. This appears
as a path prepended to the name of the module. You can filter the output by
adding a search term to the marketplace search command. Try a few different
search terms that are related to OSINT information to get a sense of the
modules that are available.
The module tables have columns for D and K. Search for shodan modules. What are
the requirements for these modules?
Answer Area
They have dependencies (D) and require API keys (K). The dependencies refer
to Python modules that must be installed on your computer to run the module.
Hide Answer
c. To learn more about individual modules, use the marketplace info command
followed by the full name of the module, including its category and type. It is
easier to select the name of the module and copy and paste it into the
command line.
Recon-ng accesses modules from the Github repository and downloads them to Kali
when they are installed.
Answer Area
recon/domains-hosts/bing_domain_web
Hide Answer
e. After installation, enter the modules search command to verify that the new
module is now available.
f. Repeat the process to install the hackertarget module.
Step 5: Run the new modules
Answer Area
The name of the module, module version, name of the developer, a brief
description, and information about the options.
Hide Answer
What is the only option for this module?
Answer Area
SOURCE
Hide Answer
d. Instead of passing options at the command line, in Recon-ng you set the
options and then enter a simple command to execute the module. Use
the options set source command to set the only option for this module.
Complete the command by specifying the target as hackxor.net.
e. Verify the option setting with the info command.
f. Type run to execute the module.
g. Inspect the output of the command. The output is stored in a database so you
can refer to it later. The data that is stored is specific to the workplace in
which it was gathered.
h. Enter the dashboard command. This queries the Recon-ng database and
provides a summary of the information that has been gathered. It is specific to
this workspace.
What is the Recon-ng data label for the subdomains that have been listed? How
many were discovered?
Answer Area
Recon-ng classifies the subdomains as “hosts.” Nine were discovered.
Hide Answer
i. The show command displays the data for specific categories. Enter the show
hosts command to display the list of hosts that were discovered.
j. Now repeat the process with the bing module. Compare the results with
the hackertarget module.
How many subdomains did the module find? How does this compare to
the hackertarget module?
Answer Area
Answers may vary. At the time of this writing, they both found 6 subdomains.
Hide Answer
Recon-ng has a web interface that simplifies and improves viewing results that are
stored in Recon-ng databases. It also allows easy export of the results tables for
reporting purposes.
a. Search the marketplace for a module that will discover interesting files in a
domain. The plugin that you use should have no dependencies or key
requirements.
Answer Area
discovery/info_disclosure/interesting_files
Hide Answer
Investigate other modules. Use the commands that we have learned so far to
download, configure options, run, and view results for the module and different
targets. It also provides an easy way to export results to various text formats for use
in reports.
Reflection Questions
You have experienced the use of several OSINT tools and resources in this lab.
There are many more. The best way to learn how to use OSINT in your pentesting
practice is to experiment until you find tools and approaches that work for you.
1. What do you think about the recon-ng workspaces feature? How could you use it?
Answer Area
The workspaces feature preserves the installed module and their configured
options. Workspaces also have their own results data. Workspaces can be
configured for individual tests or for an entire PenTesting engagement.
Hide Answer
2. Recon-ng uses a modular framework architecture. Do modules simplify using the
Recon-ng tool? If so, how?
Answer Area
Modules simplify using Recon-ng because module options can be configured
with the module. Instead of needing to specify a long list of options in the
command line, execution of the module requires only one simple command.
Hide Answer