Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Shodan Analyzer: Inconsistent Key References #748

Closed
serene972 opened this issue Apr 20, 2020 · 1 comment
Closed

[Bug] Shodan Analyzer: Inconsistent Key References #748

serene972 opened this issue Apr 20, 2020 · 1 comment
Labels
category:bug Issue is related to a bug
Milestone

Comments

@serene972
Copy link

Describe the bug
No long or short reports from the Shodan analyzer (Shodan_InfoDomain_1_0).

To Reproduce
Steps to reproduce the behavior:

  1. Enable and configure the Shodan_InfoDomain_1_0 analyzer
  2. Create a test case with a domain observable for "google.com"
  3. Run the Shodan_InfoDomain_1_0 analyzer on the google.com observable. No short report appears, and the long report is empty.
  4. Click on the observable and show the raw report. The raw report is not empty.

Expected behavior
Long and short reports display the correct information.

Complementary information
The problem occurs because of inconsistent references to the results object. When self.service == 'info_domain', line 41 in shodan_analyzer.py sets results to a dictionary with a single key, 'info_domain':

            results = {'info_domain': self.shodan_client.info_domains(data)}

A few lines later, in the summary() function, there are multiple references to raw['infos_domain'] on lines 60-70. There is no 'infos_domain' key; only 'info_domain'. Most likely an exception occurs, and no taxonomy objects are created.

The corresponding long.html template (thehive-templates/Shodan_InfoDomain_1_0/long.html) also references content.infos_domain. Since this name doesn't match the actual JSON the report is empty.

Work environment

  • Client OS: Windows
  • Server OS: RHEL 7.8
  • Browse type and version: Version 81.0.4044.113 (Official Build) (64-bit)
  • Cortex version: 3.3.1-1
  • Cortex Analyzer/Responder name: Shodan_InfoDomain_1_0
  • Cortex Analyzer/Responder version: 1.0

Possible solutions
The simplest fix is to change 'info_domain' on line 41 of shodan_analyzer.py to 'infos_domain', but whatever the solution, the code needs to be consistent.

Additional context
None.

@serene972 serene972 added the category:bug Issue is related to a bug label Apr 20, 2020
@garanews garanews added this to the 2.7.0 milestone Apr 24, 2020
@garanews
Copy link
Contributor

fixed in 2.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bug Issue is related to a bug
Projects
None yet
Development

No branches or pull requests

2 participants