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

Remove __manual_scan checks that were mistakenly added #21

Merged
merged 1 commit into from
Jun 17, 2019

Conversation

felddy
Copy link
Member

@felddy felddy commented Jun 17, 2019

We added __manual_scan checks outside of the VulnTicketManager. This was a mistake. This PR removes those checks.

This caused errors in the commander's log that looked like:

2019-06-17 14:16:22,795 INFO cyhy_commander.commander - Processing done/PORTSCAN-20190617T125738.655688+0000 with <NmapSink PORTSCAN Database(MongoClient('database1.cyhy', 27017), u'cyhy')>
2019-06-17 14:16:22,883 CRITICAL cyhy_commander.commander - 'IPPortTicketManager' object has no attribute '_IPPortTicketManager__manual_scan'
2019-06-17 14:16:22,883 CRITICAL cyhy_commander.commander - Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/cyhy_commander/commander.py", line 451, in do_work
    execute(self.__done_jobs, self, hosts=hosts)
  File "/usr/local/lib/python2.7/dist-packages/fabric/tasks.py", line 386, in execute
    multiprocessing
  File "/usr/local/lib/python2.7/dist-packages/fabric/tasks.py", line 276, in _execute
    return task.run(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/fabric/tasks.py", line 173, in run
    return self.wrapped(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/cyhy_commander/commander.py", line 216, in __done_jobs
    self.__process_successful_job(local_job_path)
  File "/usr/local/lib/python2.7/dist-packages/cyhy_commander/commander.py", line 312, in __process_successful_job
    sink.handle(job_path)
  File "/usr/local/lib/python2.7/dist-packages/cyhy_commander/job_sink.py", line 31, in handle
    importer.process(nmap_output_file, target_file)
  File "/usr/local/lib/python2.7/dist-packages/cyhy_commander/nmap/nmap_importer.py", line 48, in process
    parse(f, self.handler)
  File "/usr/lib/python2.7/xml/sax/__init__.py", line 33, in parse
    parser.parse(source)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 110, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 213, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 320, in end_element
    self._cont_handler.endElement(name)
  File "/usr/local/lib/python2.7/dist-packages/cyhy_commander/nmap/nmap_handler.py", line 85, in endElement
    self.end_callback()
  File "/usr/local/lib/python2.7/dist-packages/cyhy_commander/nmap/nmap_importer.py", line 131, in __end_callback
    self.__ticket_manager.close_tickets()
  File "/usr/local/lib/python2.7/dist-packages/cyhy/db/ticket_manager.py", line 445, in close_tickets
    self.__handle_ticket_port_closed(ticket, closing_time)
  File "/usr/local/lib/python2.7/dist-packages/cyhy/db/ticket_manager.py", line 393, in __handle_ticket_port_closed
    if self.__manual_scan:
AttributeError: 'IPPortTicketManager' object has no attribute '_IPPortTicketManager__manual_scan'```

@felddy felddy requested review from jsf9k and dav3r June 17, 2019 14:48
@felddy
Copy link
Member Author

felddy commented Jun 17, 2019

Too many men
Too many boys
Too many misters
Not enough sisters
Too much time on, too many hands
Not enough ladies, too many mans

Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup yup - this is the fix we need, thanks! 🤕

@felddy felddy merged commit 7b44cea into develop Jun 17, 2019
@felddy felddy deleted the bugfix/too-many-mans branch June 17, 2019 14:53
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.

2 participants