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 country_code Constraints Error #368

Closed
ssnkhan opened this issue Oct 26, 2021 · 1 comment
Closed

[BUG] Shodan country_code Constraints Error #368

ssnkhan opened this issue Oct 26, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@ssnkhan
Copy link

ssnkhan commented Oct 26, 2021

Describe the bug

Just updated to Mihari 3.10.0, and getting the following error.

[Mihari::Structs::Shodan::Location.new] nil (NilClass) has invalid type for :country_code violates constraints (type?(String, nil) failed)

*A* `Dry::Struct::Error` *occured in background*: [Mihari::Structs::Shodan::Location.new] nil (NilClass) has invalid type for :country_code violates constraints (type?(String, nil) failed)
```/var/lib/gems/2.7.0/gems/dry-types-1.5.1/lib/dry/types/schema.rb:330:in `rescue in block in resolve_unsafe'
/var/lib/gems/2.7.0/gems/dry-types-1.5.1/lib/dry/types/schema.rb:327:in `block in resolve_unsafe'
/var/lib/gems/2.7.0/gems/dry-types-1.5.1/lib/dry/types/schema.rb:322:in `each'
/var/lib/gems/2.7.0/gems/dry-types-1.5.1/lib/dry/types/schema.rb:322:in `resolve_unsafe'
/var/lib/gems/2.7.0/gems/dry-types-1.5.1/lib/dry/types/schema.rb:62:in `call_unsafe'
/var/lib/gems/2.7.0/gems/dry-types-1.5.1/lib/dry/types/constructor.rb:87:in `call_unsafe'
/var/lib/gems/2.7.0/gems/dry-struct-1.4.0/lib/dry/struct/class_interface.rb:265:in `new'
/var/lib/gems/2.7.0/gems/mihari-3.10.0/lib/mihari/structs/shodan.rb:13:in `from_dynamic!'
/var/lib/gems/2.7.0/gems/mihari-3.10.0/lib/mihari/structs/shodan.rb:32:in `from_dynamic!'
/var/lib/gems/2.7.0/gems/mihari-3.10.0/lib/mihari/structs/shodan.rb:46:in `block in from_dynamic!'```

Steps to reproduce

ssl:"MetasploitSelfSignedCA" http.favicon.hash:-127886975 -http.title:"Bam! Application Error"

Expected behavior

Should not return any errors.

Actual behavior

Returns error as above.

Screenshots

N/A.

System Information:

  • OS: Ubuntu
  • Ruby version: 2.7.0
  • Mihari version: 3.10.0

Additional context

N/A.

@ssnkhan ssnkhan added the bug Something isn't working label Oct 26, 2021
@ninoseki
Copy link
Owner

@ssnkhan Thank you for reporting.
The issue is not introduced by v3.10.0 but anyway I fixed it.
Please update to the latest version (v3.10.1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants