OSINT Exp 02
OSINT Exp 02
02
AIM: Using OSINT tool such as (Harverster) you can gather information like emails,
subdomains, hosts, employee names, open ports and banners from different public sources
like search engines, PGP key server.
THEORY:
1.OSINT TOOLS:-
Open-source intelligence (OSINT) tools are software applications or services designed to
gather information from publicly available sources on the internet. OSINT tools are
commonly used by researchers, investigators, cybersecurity professionals, and law
enforcement agencies to collect data and gain insights for various purposes, such as threat
hunting, reconnaissance, competitive analysis, and more.
Here are some popular OSINT tools as of my last update in September 2021:
Maltego: Maltego is a powerful OSINT and data visualization tool that helps in the discovery
and analysis of relationships between entities on the internet.
The Harvester: This tool allows you to gather email addresses, subdomains, hosts, and other
useful information from public sources like search engines and PGP key servers.
Shodan: Shodan is a search engine that lets you find internet-connected devices, such as
servers, routers, webcams, and more. It provides detailed information about these devices,
including open ports, banners, and vulnerabilities.
Censys: Censys is another search engine that focuses on finding internetconnected devices,
such as servers and IoT devices. It provides valuable information like SSL certificates,
banners, and more.
FOCA (Fingerprinting Organizations with Collected Archives): FOCA is a tool for extracting
metadata, hidden information, and data from documents and files, helping to identify
potential security risks.
SpiderFoot: SpiderFoot is an open-source footprinting tool that automates the process of
gathering intelligence from various sources, including search engines, social media platforms,
DNS records, and more.
OSINT Framework: This is not a single tool but rather a collection of various OSINT tools
organized into categories. It's a great resource for OSINT enthusiasts looking for specific
tools for different tasks.
Ghidra: Developed by the NSA, Ghidra is a powerful reverse engineering tool used to
analyze and understand the inner workings of software and malware.
Snort: Snort is an open-source intrusion detection and prevention system (IDS/IPS) used to
monitor network traffic and identify potentially malicious activities.
Metasploit: Metasploit is a penetration testing framework that helps in identifying and
exploiting vulnerabilities in networks, applications, and systems.
2.What is theHarvester tool?
theHarvester is a tool for gathering email addresses, subdomains, hosts, employee names,
open ports, and banners from different public sources (search engines, PGP key servers). It is
designed to be used in the full reconnaissance and information-gathering phases of a
penetration test. This tool is useful for finding potential targets on a network and gathering
information about a company or organization. It can also be used to verify the security of
your own email server.
3.Installing in Kali Linux to install theHarvester tool in kali Linux follow the following steps:
Steps:- Step 1
download theharvester tool from theharvester GitHub page
git clone https://github.com/laramies/theHarvester
Output:
┌──(kali㉿kali)-[~]└─$ git
Step 2
install python3-pip in theharvester directory
sudo apt install python3-pip
Output:
pip
(22.3+dfsg-1) ...Processing triggers for man-db (2.10.2-1) ...Processing
triggers for kali-menu (2022.3.1) ...
Step 4
install basic requirements from dev.txt file in theharvester directory
python3 -m pip install -r requirements/dev.txt#else:python3 -m pip install -
r requirements/base.txt
Output:
Step 5
Run theharvester tool by executing this command
python3 theHarvester.py -h
Output:
(
kali㉿kali)-[~/theHarvester]└─$ python3 theHarvester.py -h
************************************************************
******** _ _ _ ** | |_| |__ ___ /\
/\__ _ _ ____ _____ ___| |_ ___ _ __ ** | __| _ \ / _ \ / /_/ / _` | '__\ \ / /
_ \/ __| __/ _ \ '__| ** | |_| | | | __/ / __ / (_| | | \ V / __/\__ \ || __/ | **
\__|_| |_|\___| \/ /_/ \__,_|_| \_/ \___||___/\__\___|_| **
** theHarvester 4.3.0-dev ** Coded by Christian
Martorella ** Edge-Security Research **
[email protected] **
************************************************************
********usage: theHarvester.py [-h] -d DOMAIN [-l LIMIT] [-S START]
[-p] [-s] [--screenshot SCREENSHOT] [-v] [-e
DNS_SERVER] [-r] [-n] [-c] [-f FILENAME] [-b
SOURCE]theHarvester is used to gather open source intelligence (OSINT) on acompany or
domain.options: -h, --help show this help message and exit -d DOMAIN, --domain
DOMAIN Company name or domain to search. -l LIMIT, --limit LIMIT
Limit the
number of search results, default=500. -S START, --start START Start with
result number X, default=0. -p, --proxies Use proxies for requests, enter proxies in
proxies.yaml. -s, --shodan
Use Shodan to query discovered hosts. --screenshot SCREENSHOT
Take screenshots of resolved domains specify output -e to
directory: --screenshot output_directory -v, --virtual-host Verify host name via DNSlookup
resolution and search for virtual hosts.
DNS_SERVER, --dns-server DNS_SERVER DNS server use for
lookup. -r, --take-over Check for takeovers. -n, --dnsEnable DNS server lookup,
default False. -c, --dns-brute Perform a
DNS brute force on the domain. -f FILENAME, --filename FILENAME
Save the results to an XML and JSON file. -b SOURCE, --source
SOURCE anubis, baidu, bevigil, binaryedge, bing, bingapi,
bufferoverun, censys, certspotter, crtsh, dnsdumpster, duckduckgo,
fullhunt, github-code, hackertarget, hunter, intelx, otx, pentesttools,
projectdiscovery, qwant, rapiddns, rocketreach, securityTrails, sublist3r,
threatcrowd, threatminer, urlscan, virustotal, yahoo, zoomeye
Step 6 use theharvester tool feature by giving a domain name in the command
python3 theHarvester.py -d <DOMAIN NAME> -l 500 -b <SOURCE>
Output:
Step 7
On Kali Linux, run theHarvester in a terminal window to see if it's installed. If not, you'll see:
You can sometimes run apt-get theharvester and Kali will fetch this for you, but in my case, it
didn't work. So instead, clone it directly and confirm the installation by running the following
in terminal.the harvester: The objective of this program is to gather emails, subdomains,
hosts, employee names, open ports and banners from different public sources like search
engines, PGP key servers and SHODAN computer database.
Here we will use this tool to search for information about Microsoft organization
the harvester options
-d: Domain to search or company name
-b: data source: Google, GoogleCSE, Bing, Bing API, PGP, LinkedIn,
Google- profiles, people123, jigsaw, Twitter, Google+, all
-s: Start in result number X (default: 0)
-v: Verify hostname via DNS resolution and search for virtual hosts
-f: Save the results into an HTML and XML file
-n: Perform a DNS reverse query on all ranges discovered
-c: Perform a DNS brute force for the domain name
-t: Perform a DNS TLD expansion discovery
-e: Use this DNS server
-l: Limit the number of results to work with(bing goes from 50 to 50 results,
-h: use SHODAN database to query discovered hosts google 100 to 100, and PGP doesn’t use
this option)
Command: theharvester -d microsoft.com -l 500 -b google
these are the important information( host & email addresses) I got using this tool.
Another interesting feature is the capability to check for virtual hosts: through DNS
resolution, the tool verifies if a certain IP address is associated with multiple hostnames. This
is really important information because the Security for a given host on that IP depends not
only on its Security level but also from how securely are configured the others hosted on that
same IP. In fact, if an attacker compromises one of them and gains access to the underlying
server, then he can easily reach every other virtual host.
theHarves ter is also able to acquire names of persons related to the target domain by
crawling social networks such as LinkedIn; this can be done by simply using as data source
the argument “LinkedIn”
theHarvester is a valuable tool for OSINT which allows to quickly discover a good amount of
data, especially email addresses. Remember that you need to verify information: for example,
it could be that an employer is not working anymore on a certain company, but his email
address is still present on the web and so it will be returned in the results.
Conclusion:-Hence, we have used OSINT tools Theharvester to gather information like
emails, subdomains, hosts, employee names, open ports and banners from different public
sources like search engines, PGP key server