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

Sap Service Discovery Error Spam Fix #4242

Merged
merged 4 commits into from Nov 21, 2014

Conversation

Meatballs1
Copy link
Contributor

It looks like report_note no longer accepts a proto so the module spams the following error, also pointless begin end block cleared away.

[-] [2014.11.20-13:02:43] xxxxxxxxxxx:50013 exception ActiveRecord::RecordInvalid Validation failed: Proto is not included in the list ["/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/validations.rb:56:in `save!'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/attribute_methods/dirty.rb:33:in `save!'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:264:in `block in save!'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:208:in `transaction'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:264:in `save!'", "/root/git/metasploit-framework/lib/msf/core/db_manager/service.rb:103:in `block in report_service'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection'", "/root/git/metasploit-framework/lib/msf/core/db_manager/service.rb:49:in `report_service'", "/root/git/metasploit-framework/lib/msf/core/db_manager/note.rb:96:in `block in report_note'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection'", "/root/git/metasploit-framework/lib/msf/core/db_manager/note.rb:57:in `report_note'", "/root/git/metasploit-framework/lib/msf/core/auxiliary/report.rb:125:in `report_note'", "/root/git/metasploit-framework/modules/auxiliary/scanner/sap/sap_service_discovery.rb:238:in `block (2 levels) in run_host'", "/root/git/metasploit-framework/lib/msf/core/thread_manager.rb:100:in `call'", "/root/git/metasploit-framework/lib/msf/core/thread_manager.rb:100:in `block in spawn'"]

Verification

  • Before, module spams errors when it finds a port open.
  • After, module functions as expected

@Meatballs1 Meatballs1 closed this Nov 20, 2014
@Meatballs1 Meatballs1 reopened this Nov 20, 2014
@jvazquez-r7
Copy link
Contributor

I'm not able to reproduce this issue:

  • From master:
msf auxiliary(sap_service_discovery) > notes
msf auxiliary(sap_service_discovery) > run

[*] [SAP] Beginning service Discovery '172.16.158.1'

[+] 172.16.158.1:2000    - MDM Server (Master Data Management) OPEN
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf auxiliary(sap_service_discovery) > notes
[*] Time: 2014-11-21 16:08:04 UTC Note: host=172.16.158.1 type=SAP data="MDM Server (Master Data Management)"
msf auxiliary(sap_service_discovery) >

Indeed, there are more modules using report_note and :proto. So let me ping @limhoff-r7 in case he can give a look. If it's an issue, more module should be fixed. But while testing I've noticed this module should report notes with :update => :unique_data. I'm fixing it by myself before landing:

msf auxiliary(sap_service_discovery) > set rhosts 172.16.158.1
rhosts => 172.16.158.1
msf auxiliary(sap_service_discovery) > run

[*] [SAP] Beginning service Discovery '172.16.158.1'

[+] 172.16.158.1:3909    - ITS MM (Mapping Manager) sapvwmm00_<INST> OPEN
[+] 172.16.158.1:2000    - MDM Server (Master Data Management) OPEN
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf auxiliary(sap_service_discovery) > notes
[*] Time: 2014-11-21 16:14:20 UTC Note: host=172.16.158.1 type=SAP data="ITS MM (Mapping Manager) sapvwmm00_<INST>"
[*] Time: 2014-11-21 16:14:21 UTC Note: host=172.16.158.1 type=SAP data="MDM Server (Master Data Management)"

@jvazquez-r7 jvazquez-r7 merged commit ee15179 into rapid7:master Nov 21, 2014
jvazquez-r7 added a commit that referenced this pull request Nov 21, 2014
* I cannot reproduce @Meatballs1 issue
* But I noticed report_note should :update with :unique_data
* Fixed the :update
@Meatballs1
Copy link
Contributor Author

Hmm perhaps it was because I was hitting or duplicate ports over a range of hosts causing something to do with uniqueness?

I was also getting another error which I didn't notice (screen was spammed with large errors). Thanks a lot though :D

RecordInvalid Validation failed: Address has already been taken

[-] [2014.11.20-13:02:40] xxxxxxxxx:8000 exception ActiveRecord::RecordInvalid Validation failed: Address has already been taken ["/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/validations.rb:56:in `save!'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/attribute_methods/dirty.rb:33:in `save!'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:264:in `block in save!'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:208:in `transaction'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:264:in `save!'", "/root/git/metasploit-framework/lib/msf/core/db_manager/host.rb:205:in `block in report_host'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection'", "/root/git/metasploit-framework/lib/msf/core/db_manager/host.rb:151:in `report_host'", "/root/git/metasploit-framework/lib/msf/core/db_manager/note.rb:72:in `block in report_note'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection'", "/root/git/metasploit-framework/lib/msf/core/db_manager/note.rb:57:in `report_note'", "/root/git/metasploit-framework/lib/msf/core/auxiliary/report.rb:125:in `report_note'", "/root/git/metasploit-framework/modules/auxiliary/scanner/sap/sap_service_discovery.rb:238:in `block (2 levels) in run_host'", "/root/git/metasploit-framework/lib/msf/core/thread_manager.rb:100:in `call'", "/root/git/metasploit-framework/lib/msf/core/thread_manager.rb:100:in `block in spawn'"]
[-] [2014.11.20-13:02:40] xxxxxxx:3300 exception ActiveRecord::RecordInvalid Validation failed: Proto is not included in the list ["/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/validations.rb:56:in `save!'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/attribute_methods/dirty.rb:33:in `save!'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:264:in `block in save!'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:208:in `transaction'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:264:in `save!'", "/root/git/metasploit-framework/lib/msf/core/db_manager/service.rb:103:in `block in report_service'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection'", "/root/git/metasploit-framework/lib/msf/core/db_manager/service.rb:49:in `report_service'", "/root/git/metasploit-framework/lib/msf/core/db_manager/note.rb:96:in `block in report_note'", "/var/lib/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection'", "/root/git/metasploit-framework/lib/msf/core/db_manager/note.rb:57:in `report_note'", "/root/git/metasploit-framework/lib/msf/core/auxiliary/report.rb:125:in `report_note'", "/root/git/metasploit-framework/modules/auxiliary/scanner/sap/sap_service_discovery.rb:238:in `block (2 levels) in run_host'", "/root/git/metasploit-framework/lib/msf/core/thread_manager.rb:100:in `call'", "/root/git/metasploit-framework/lib/msf/core/thread_manager.rb:100:in `block in spawn'"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants