Another important tool/framework for reconnaissance is Recon-ng. Recon-ng is a full-featured reconnaissance framework designed with the goal of providing a powerful environment to conduct open source web-based reconnaissance quickly and thoroughly.
When invoking recon-ng you are presented with an welcome screen, where you can do a set of commands. First, lets look at the help of the tool, by entering the command "help".
[*] Version check disabled.
_/_/_/ _/_/_/_/ _/_/_/ _/_/_/ _/ _/ _/ _/ _/_/_/
_/ _/ _/ _/ _/ _/ _/_/ _/ _/_/ _/ _/
_/_/_/ _/_/_/ _/ _/ _/ _/ _/ _/ _/_/_/_/ _/ _/ _/ _/ _/_/_/
_/ _/ _/ _/ _/ _/ _/ _/_/ _/ _/_/ _/ _/
_/ _/ _/_/_/_/ _/_/_/ _/_/_/ _/ _/ _/ _/ _/_/_/
/\
/ \\ /\
Sponsored by... /\ /\/ \\V \/\
/ \\/ // \\\\\ \\ \/\
// // BLACK HILLS \/ \\
www.blackhillsinfosec.com
____ ____ ____ ____ _____ _ ____ ____ ____
|____] | ___/ |____| | | | |____ |____ |
| | \_ | | |____ | | ____| |____ |____
www.practisec.com
[recon-ng v5.1.2, Tim Tomes (@lanmaster53)]
[1] Recon modules
[recon-ng][default] > help
Commands (type [help|?] <topic>):
---------------------------------
back Exits the current context
dashboard Displays a summary of activity
db Interfaces with the workspace's database
exit Exits the framework
help Displays this menu
index Creates a module index (dev only)
keys Manages third party resource credentials
marketplace Interfaces with the module marketplace
modules Interfaces with installed modules
options Manages the current context options
pdb Starts a Python Debugger session (dev only)
script Records and executes command scripts
shell Executes shell commands
show Shows various framework items
snapshots Manages workspace snapshots
spool Spools output to a file
workspaces Manages workspaces
[recon-ng][default] >
We can create a new workspace for a reconnaissance project.
workspaces create PROJECTNAME
Next, we can add domains to test in our project workspace.
We can search for a specific module to use in recon-ng.
marketplace search hackertarget
And we can see is the module exists and the information about it.
[*] Searching module index for 'hackertarget'...
+-----------------------------------------------------------------------------+
| Path | Version | Status | Updated | D | K |
+-----------------------------------------------------------------------------+
| recon/domains-hosts/hackertarget | 1.1 | installed | 2020-05-17 | | |
+-----------------------------------------------------------------------------+
D = Has dependencies. See info for details.
K = Requires keys. See info for details.
After selecting anf loading a module, we can run it. We can discover which are the options of the module.
info
And we receive all the information of the module.
[recon-ng][PROJECTNAME][hackertarget] > info
Name: HackerTarget Lookup
Author: Michael Henriksen (@michenriksen)
Version: 1.1
Description:
Uses the HackerTarget.com API to find host names. Updates the 'hosts' table with the results.
Options:
Name Current Value Required Description
------ ------------- -------- -----------
SOURCE default yes source of input (see 'info' for details)
Source Options:
default SELECT DISTINCT domain FROM domains WHERE domain IS NOT NULL
<string> string representing a single input
<path> path to a file containing a list of inputs
query <sql> database query returning one column of inputs
[recon-ng][PROJECTNAME][hackertarget] >
From the information, we see that we need to set a "SOURCE" for the module. So lets do that.
[recon-ng][PROJECT-PERSONAL][whois_pocs] > info
Name: Whois POC Harvester
Author: Tim Tomes (@lanmaster53)
Version: 1.0
Description:
Uses the ARIN Whois RWS to harvest POC data from whois queries for the given domain. Updates the
'contacts' table with the results.
Options:
Name Current Value Required Description
------ ------------- -------- -----------
SOURCE default yes source of input (see 'info' for details)
Source Options:
default SELECT DISTINCT domain FROM domains WHERE domain IS NOT NULL
<string> string representing a single input
<path> path to a file containing a list of inputs
query <sql> database query returning one column of inputs
It is necessary to set the "SOURCE".
options set SOURCE gmail.com
And run the module.
[recon-ng][PROJECT-PERSONAL][whois_pocs] > run
---------
GMAIL.COM
---------
[*] URL: http://whois.arin.net/rest/pocs;domain=gmail.com
[*] URL: http://whois.arin.net/rest/poc/XXXX
[*] Country: United States
[*] Email: XXXX@gmail.com
[*] First_Name: XXXXX
[*] Last_Name: XXXXX
[*] Middle_Name: None
[*] Notes: None
[*] Phone: None
[*] Region: Columbus, OH
[*] Title: Whois contact
[*] --------------------------------------------------
[*] URL: http://whois.arin.net/rest/poc/XXXX
[*] Country: Taiwan, Province Of China
[*] Email: XXXX@gmail.com
[*] First_Name: XXXX
[*] Last_Name: XXXX
[*] Middle_Name: None
[*] Notes: None
[*] Phone: None
[*] Region: New Taipei City
[*] Title: Whois contact
Explore the multiple options and modules of recon-ng.