Recon NG
Recon NG
Recon-ng Tutorial
Recon-ng is a web-based open-source reconnaissance tool used to extract information
from a target organization and its personnel.
Official repository: https://github.com/lanmaster53/recon-ng
Version: v5.0.1
Requirements:
Kali Linux virtual machine
Objectives:
How to perform network recon.
Gather hosts related to a domain.
Personal Information Gathering.
Generate a report with harvested information.
Recon-ng has a look and feel similar to the Metasploit Framework, reducing the
learning curve for leveraging the framework.
First steps
1. Open the terminal and type recon-ng
2. Type help to view all commands that allow you to add/delete records to DB,
query, etc.
https://github.com/Samsar4/Ethical-Hacking-Labs/blob/master/1-Footprinting-and-Reconnaissance/3-Recon-ng.md 1/8
2024/9/2 中午12:19 Ethical-Hacking-Labs/1-Footprinting-and-Reconnaissance/3-Recon-ng.md at master · Samsar4/Ethical-Hacking-Labs · GitHub
Note:
On your first load of recon-ng note the message below. You begin with an empty
framework (without modules pre-installed).
+--------------------------------------------+
| rowid | domain | module |
+--------------------------------------------+
| 1 | certifiedhacker.com | user_defined |
+--------------------------------------------+
https://github.com/Samsar4/Ethical-Hacking-Labs/blob/master/1-Footprinting-and-Reconnaissance/3-Recon-ng.md 2/8
2024/9/2 中午12:19 Ethical-Hacking-Labs/1-Footprinting-and-Reconnaissance/3-Recon-ng.md at master · Samsar4/Ethical-Hacking-Labs · GitHub
Dealing with modules and workspaces process is very easy as shown on the example
below:
Type info to view the SOURCE, currently set at default as show below: info
https://github.com/Samsar4/Ethical-Hacking-Labs/blob/master/1-Footprinting-and-Reconnaissance/3-Recon-ng.md 3/8
2024/9/2 中午12:19 Ethical-Hacking-Labs/1-Footprinting-and-Reconnaissance/3-Recon-ng.md at master · Samsar4/Ethical-Hacking-Labs · GitHub
input
+---------------------+
| Module Inputs |
+---------------------+
| certifiedhacker.com |
+---------------------+
run
Note: If your response is working properly but messy with a bunch of queries and
values, just type show hosts to populate a better output.
show hosts
...
(This command will show a clean summary of resources discovered)
Brute-forcing hostnames
You can use another modules to harvest more hosts, such as brute_hosts.
back
https://github.com/Samsar4/Ethical-Hacking-Labs/blob/master/1-Footprinting-and-Reconnaissance/3-Recon-ng.md 4/8
2024/9/2 中午12:19 Ethical-Hacking-Labs/1-Footprinting-and-Reconnaissance/3-Recon-ng.md at master · Samsar4/Ethical-Hacking-Labs · GitHub
By typing info you can see on this particular module, you can set your own hostnames
wordlist. I recommend to use the default one that is pretty good.
Generate a report
Now that you have harvested a number of hosts, you will prepare a report containing all
the information.
Note: You can install any of these modules below to export in different formats.
reporting/csv
reporting/html
reporting/json
reporting/list
reporting/proxifier
reporting/pushpin
reporting/xlsx
reporting/xml
https://github.com/Samsar4/Ethical-Hacking-Labs/blob/master/1-Footprinting-and-Reconnaissance/3-Recon-ng.md 5/8
2024/9/2 中午12:19 Ethical-Hacking-Labs/1-Footprinting-and-Reconnaissance/3-Recon-ng.md at master · Samsar4/Ethical-Hacking-Labs · GitHub
You will need to assign these values, CREATOR, CUSTOMER and FILENAME.
Set your name[CREATOR], customer name[CUSTOMER], path to export and the file
name[FILENAME].
run
There is not much in this report, but when you start running multiple modules and add
in geolocation reports can get very complex. Recon-ng does a great job keeping track
of everything.
Important note: The location and pushpin modules mentioned in this tutorial require a
valid API key to use and have some GDPR implications about data collection. Some
require you to pay money, which will be mentioned below. I suggest as you go along,
you save all the API keys to a file so you can use them later. To setup an API key to your
recon-ng is very simple, just follow the document below, and manage your keys inside
Recon-ng using: keys command.
https://github.com/Raikia/Recon-NG-API-Key-Creation/blob/master/README-v4.8.3.md
recon/domain-contacts
recon/companies-contacts
https://github.com/Samsar4/Ethical-Hacking-Labs/blob/master/1-Footprinting-and-Reconnaissance/3-Recon-ng.md 6/8
2024/9/2 中午12:19 Ethical-Hacking-Labs/1-Footprinting-and-Reconnaissance/3-Recon-ng.md at master · Samsar4/Ethical-Hacking-Labs · GitHub
recon/domain-contacts/namechk
The module selected to perform this technique uses the ARIN Whois RWS to harvest
POC data from whois queries for the given domain.
info
run
------------
FACEBOOK.COM
------------
[*] URL: http://whois.arin.net/rest/pocs;domain=facebook.com
[*] URL: http://whois.arin.net/rest/poc/NOL17-ARIN
[*] [contact] Lea Neteork ops ([email protected]) - Whois contact
[*] URL: http://whois.arin.net/rest/poc/OPERA82-ARIN
[*] [contact] <blank> Operations ([email protected]) - Whois contact
[*] URL: http://whois.arin.net/rest/poc/BST184-ARIN
[*] [contact] Brandon Stout ([email protected]) - Whois contact
[*] URL: http://whois.arin.net/rest/poc/DJW23-ARIN
[*] [contact] Darrell Wayne ([email protected]) - Whois
contact
https://github.com/Samsar4/Ethical-Hacking-Labs/blob/master/1-Footprinting-and-Reconnaissance/3-Recon-ng.md 7/8
2024/9/2 中午12:19 Ethical-Hacking-Labs/1-Footprinting-and-Reconnaissance/3-Recon-ng.md at master · Samsar4/Ethical-Hacking-Labs · GitHub
Profile existence
The recon/profiles-profiles/namechk module validates the username existence of a
specified contact, but unfortunately namechk charges to use their API.
We can search the existence of user profiles in various websites using the
recon/profiles-profiles/profiler.
run
The recon/profiles-profiles/profiler module searches for this username and returns the
URL of the profile in various websites (found with the matching username).
https://github.com/Samsar4/Ethical-Hacking-Labs/blob/master/1-Footprinting-and-Reconnaissance/3-Recon-ng.md 8/8