Shodan Honeyscore Client - Metasploit
This page contains detailed information about how to use the auxiliary/gather/shodan_honeyscore metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Shodan Honeyscore Client
Module: auxiliary/gather/shodan_honeyscore
Source code: modules/auxiliary/gather/shodan_honeyscore.rb
Disclosure date: -
Last modification time: 2020-06-17 14:22:07 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): -
List of CVEs: -
This module uses the shodan API to check if a server is a honeypot or not. The api returns a score from 0.0 to 1.0. 1.0 being a honeypot. A shodan API key is needed for this module to work properly. If you don't have an account, go here to register: https://account.shodan.io/register For more info on how their honeyscore system works, go here: https://honeyscore.shodan.io/
Module Ranking and Traits
Module Ranking:
- normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.
Basic Usage
msf > use auxiliary/gather/shodan_honeyscore
msf auxiliary(shodan_honeyscore) > show targets
... a list of targets ...
msf auxiliary(shodan_honeyscore) > set TARGET target-id
msf auxiliary(shodan_honeyscore) > show options
... show and set options ...
msf auxiliary(shodan_honeyscore) > exploit
Required Options
TARGET: The target to get the score of
SHODAN_APIKEY: The SHODAN API key
Knowledge Base
Introduction
The shodan_honeyscore
module utilizes the Shodan API to determine whether or not a server is a honeypot.
When setting the module options, we aren't directly requesting TARGET
, we are requesting the Shodan API to analyze TARGET
and return a honeyscore from 0.0 to 1.0. 0.0 being not a honeypot
and 1.0 being a honeypot
. The original website for the honeypot system can be found here: https://honeyscore.shodan.io/.
NOTE:
In order for this module to function properly, a Shodan API key is needed. You can register for a free account here: https://account.shodan.io/register
Verification Steps
- Start
msfconsole
- Do:
use auxiliary/gather/shodan_honeyscore
- Do:
set TARGET <targetip>
- Do:
set SHODAN_APIKEY <your apikey>
- Do:
run
- If the API is up, you should receive a score from 0.0 to 1.0. (1.0 being a honeypot)
Options
TARGET
The remote host to request the API to scan.
SHODAN_APIKEY
This is the API key you receive when signing up for a Shodan account. It should be a 32 character string of random letters and numbers.
Scenarios
Running the module against a real system (in this case, the Google DNS server):
msf > use auxiliary/gather/shodan_honeyscore
msf auxiliary(shodan_honeyscore) > options
Module options (auxiliary/gather/shodan_honeyscore):
Name Current Setting Required Description
---- --------------- -------- -----------
SHODAN_APIKEY yes The SHODAN API key
TARGET yes The target to get the score of
msf auxiliary(shodan_honeyscore) > set TARGET 8.8.8.8
TARGET => 8.8.8.8
msf auxiliary(shodan_honeyscore) > set SHODAN_APIKEY [redacted]
SHODAN_APIKEY => [redacted]
msf auxiliary(shodan_honeyscore) > run
[*] Scanning 8.8.8.8
[-] 8.8.8.8 is not a honeypot
[*] 8.8.8.8 honeyscore: 0.0/1.0
[*] Auxiliary module execution completed
Go back to menu.
Msfconsole Usage
Here is how the gather/shodan_honeyscore auxiliary module looks in the msfconsole:
msf6 > use auxiliary/gather/shodan_honeyscore
msf6 auxiliary(gather/shodan_honeyscore) > show info
Name: Shodan Honeyscore Client
Module: auxiliary/gather/shodan_honeyscore
License: Metasploit Framework License (BSD)
Rank: Normal
Provided by:
thecarterb
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
SHODAN_APIKEY yes The SHODAN API key
TARGET yes The target to get the score of
Description:
This module uses the shodan API to check if a server is a honeypot
or not. The api returns a score from 0.0 to 1.0. 1.0 being a
honeypot. A shodan API key is needed for this module to work
properly. If you don't have an account, go here to register:
https://account.shodan.io/register For more info on how their
honeyscore system works, go here: https://honeyscore.shodan.io/
References:
https://honeyscore.shodan.io/
Module Options
This is a complete list of options available in the gather/shodan_honeyscore auxiliary module:
msf6 auxiliary(gather/shodan_honeyscore) > show options
Module options (auxiliary/gather/shodan_honeyscore):
Name Current Setting Required Description
---- --------------- -------- -----------
SHODAN_APIKEY yes The SHODAN API key
TARGET yes The target to get the score of
Advanced Options
Here is a complete list of advanced options supported by the gather/shodan_honeyscore auxiliary module:
msf6 auxiliary(gather/shodan_honeyscore) > show advanced
Module advanced options (auxiliary/gather/shodan_honeyscore):
Name Current Setting Required Description
---- --------------- -------- -----------
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Auxiliary Actions
This is a list of all auxiliary actions that the gather/shodan_honeyscore module can do:
msf6 auxiliary(gather/shodan_honeyscore) > show actions
Auxiliary actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the gather/shodan_honeyscore auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(gather/shodan_honeyscore) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
Go back to menu.
Error Messages
This module may fail with the following error messages:
Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.
Shodan API key should be 32 characters a-z,A-Z,0-9.
Here is a relevant code snippet related to the "Shodan API key should be 32 characters a-z,A-Z,0-9." error message:
42: end
43:
44: def run
45: # check our API key is somewhat sane
46: unless /^[a-z\d]{32}$/i.match?(datastore['SHODAN_APIKEY'])
47: fail_with(Failure::BadConfig, 'Shodan API key should be 32 characters a-z,A-Z,0-9.')
48: end
49:
50: key = datastore['SHODAN_APIKEY']
51:
52: # Check the length of the key (should be 32 chars)
Invalid API key (Not long enough)
Here is a relevant code snippet related to the "Invalid API key (Not long enough)" error message:
49:
50: key = datastore['SHODAN_APIKEY']
51:
52: # Check the length of the key (should be 32 chars)
53: if key.length != 32
54: print_error('Invalid API key (Not long enough)')
55: return
56: end
57:
58: tgt = datastore['TARGET']
59: print_status("Scanning #{tgt}")
Unable to connect to shodan
Here is a relevant code snippet related to the "Unable to connect to shodan" error message:
64: 'method' => 'GET'
65: })
66: res = cli.send_recv(req)
67: cli.close
68: if res.nil?
69: fail_with(Failure::Unknown, 'Unable to connect to shodan')
70: end
71:
72: if res.code != 200
73: print_error('Shodan did not respond in an expected way. Check your api key')
74: return
Shodan did not respond in an expected way. Check your api key
Here is a relevant code snippet related to the "Shodan did not respond in an expected way. Check your api key" error message:
68: if res.nil?
69: fail_with(Failure::Unknown, 'Unable to connect to shodan')
70: end
71:
72: if res.code != 200
73: print_error('Shodan did not respond in an expected way. Check your api key')
74: return
75: end
76:
77: score = res.body.to_f # Change the score to a float to be able to determine value in the checks
78:
<TGT> is not a honeypot
Here is a relevant code snippet related to the "<TGT> is not a honeypot" error message:
75: end
76:
77: score = res.body.to_f # Change the score to a float to be able to determine value in the checks
78:
79: if score == 0
80: print_error("#{tgt} is not a honeypot")
81: elsif score < 0.4 && score != 0.0
82: print_error("#{tgt} is probably not a honeypot")
83: elsif score > 0.4 && score < 0.6
84: print_status("#{tgt} might be a honeypot")
85: elsif score > 0.6 && score < 1.0
<TGT> is probably not a honeypot
Here is a relevant code snippet related to the "<TGT> is probably not a honeypot" error message:
77: score = res.body.to_f # Change the score to a float to be able to determine value in the checks
78:
79: if score == 0
80: print_error("#{tgt} is not a honeypot")
81: elsif score < 0.4 && score != 0.0
82: print_error("#{tgt} is probably not a honeypot")
83: elsif score > 0.4 && score < 0.6
84: print_status("#{tgt} might be a honeypot")
85: elsif score > 0.6 && score < 1.0
86: print_good("#{tgt} is probably a honeypot")
87: elsif score == 1.0
An unexpected error occurred.
Here is a relevant code snippet related to the "An unexpected error occurred." error message:
85: elsif score > 0.6 && score < 1.0
86: print_good("#{tgt} is probably a honeypot")
87: elsif score == 1.0
88: print_good("#{tgt} is definitely a honeypot")
89: else # We shouldn't ever get here as the previous checks should catch an unexpected response
90: print_error('An unexpected error occurred.')
91: return
92: end
93: print_score(score)
94: end
95: end
Go back to menu.
Related Pull Requests
- #13734 Merged Pull Request: check shodan API key
- #11524 Merged Pull Request: remove some random deregister_options from modules
- #8716 Merged Pull Request: Print_Status -> Print_Good (And OCD bits 'n bobs)
- #8338 Merged Pull Request: Fix msf/core and self.class msftidy warnings
- #8137 Merged Pull Request: Add Shodan honeyscore auxiliary module
References
See Also
Check also the following modules related to this module:
- exploit/windows/browser/adobe_flash_otf_font
- exploit/windows/browser/apple_quicktime_texml_font_table
- exploit/windows/fileformat/ibm_forms_viewer_fontname
- auxiliary/gather/shodan_host
- auxiliary/gather/shodan_search
Authors
- thecarterb
Version
This page has been produced using Metasploit Framework version 6.1.27-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.