ctrlsam / rigour

A rigorous IoT scanner based on Shodan.io
MIT License
39 stars 3 forks source link

Failure on App startup (zgrab) #1

Closed overcuriousity closed 1 month ago

overcuriousity commented 1 month ago

If I start the application with docker compose up, everything is fine until it attempts to start the zgrab service.

Docker logs:

zgrab-1     | 2024-10-21 08:04:47,993 - INFO - Connecting to MongoDB: mongodb://localhost:27017
zgrab-1     | 2024-10-21 08:04:47,995 - INFO - Starting ZGrab2 process: zgrab2 http
zgrab-1     | 2024-10-21 08:04:47,995 - INFO - Starting ZGrab output reading thread
zgrab-1     | 2024-10-21 08:04:47,995 - INFO - Starting to read ZGrab output
zgrab-1     | 2024-10-21 08:04:47,995 - INFO - Starting ZGrab input writing thread
zgrab-1     | 2024-10-21 08:04:47,996 - INFO - Starting to write IPs to ZGrab
zgrab-1     | 2024-10-21 08:04:47,996 - INFO - Connecting to RabbitMQ: amqp://localhost:5672
zgrab-1     | 2024-10-21 08:04:48,039 - ERROR - Address resolution failed: gaierror(-2, 'Name does not resolve')
zgrab-1     | 2024-10-21 08:04:48,040 - ERROR - getaddrinfo failed: gaierror(-2, 'Name does not resolve').
zgrab-1     | 2024-10-21 08:04:48,041 - ERROR - AMQP connection workflow failed: AMQPConnectionWorkflowFailed: 1 exceptions in all; last exception - gaierror(-2, 'Name does not resolve'); first exception - None.
zgrab-1     | 2024-10-21 08:04:48,042 - ERROR - AMQPConnectionWorkflow - reporting failure: AMQPConnectionWorkflowFailed: 1 exceptions in all; last exception - gaierror(-2, 'Name does not resolve'); first exception - None
zgrab-1     | 2024-10-21 08:04:48,042 - ERROR - Connection workflow failed: AMQPConnectionWorkflowFailed: 1 exceptions in all; last exception - gaierror(-2, 'Name does not resolve'); first exception - None
zgrab-1     | 2024-10-21 08:04:48,042 - ERROR - Error in _create_connection().
zgrab-1     | Traceback (most recent call last):
zgrab-1     |   File "/usr/local/lib/python3.12/site-packages/pika/adapters/blocking_connection.py", line 451, in _create_connection
zgrab-1     |     raise self._reap_last_connection_workflow_error(error)
zgrab-1     |   File "/usr/local/lib/python3.12/site-packages/pika/adapters/utils/selector_ioloop_adapter.py", line 565, in _resolve
zgrab-1     |     result = socket.getaddrinfo(self._host, self._port, self._family,
zgrab-1     |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zgrab-1     |   File "/usr/local/lib/python3.12/socket.py", line 976, in getaddrinfo
zgrab-1     |     for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
zgrab-1     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zgrab-1     | socket.gaierror: [Errno -2] Name does not resolve
zgrab-1     | Traceback (most recent call last):
zgrab-1     |   File "//process.py", line 152, in <module>
zgrab-1     |     main()
zgrab-1     |   File "//process.py", line 115, in main
zgrab-1     |     connection = pika.BlockingConnection(params)
zgrab-1     |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zgrab-1     |   File "/usr/local/lib/python3.12/site-packages/pika/adapters/blocking_connection.py", line 360, in __init__
zgrab-1     |     self._impl = self._create_connection(parameters, _impl_class)
zgrab-1     |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zgrab-1     |   File "/usr/local/lib/python3.12/site-packages/pika/adapters/blocking_connection.py", line 451, in _create_connection
zgrab-1     |     raise self._reap_last_connection_workflow_error(error)
zgrab-1     |   File "/usr/local/lib/python3.12/site-packages/pika/adapters/utils/selector_ioloop_adapter.py", line 565, in _resolve
zgrab-1     |     result = socket.getaddrinfo(self._host, self._port, self._family,
zgrab-1     |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zgrab-1     |   File "/usr/local/lib/python3.12/socket.py", line 976, in getaddrinfo
zgrab-1     |     for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
zgrab-1     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zgrab-1     | socket.gaierror: [Errno -2] Name does not resolve
zgrab-1     | 2024-10-21 08:04:50,492 - INFO - Starting main function
zgrab-1     | 2024-10-21 08:04:50,492 - INFO - Connecting to MongoDB: mongodb://localhost:27017
zgrab-1     | 2024-10-21 08:04:50,494 - INFO - Starting ZGrab2 process: zgrab2 http
zgrab-1     | 2024-10-21 08:04:50,494 - INFO - Starting ZGrab output reading thread
zgrab-1     | 2024-10-21 08:04:50,495 - INFO - Starting to read ZGrab output
zgrab-1     | 2024-10-21 08:04:50,495 - INFO - Starting ZGrab input writing thread
zgrab-1     | 2024-10-21 08:04:50,495 - INFO - Starting to write IPs to ZGrab
zgrab-1     | 2024-10-21 08:04:50,495 - INFO - Connecting to RabbitMQ: amqp://localhost:5672
zgrab-1     | 2024-10-21 08:04:50,539 - ERROR - Address resolution failed: gaierror(-2, 'Name does not resolve')
zgrab-1     | 2024-10-21 08:04:50,540 - ERROR - getaddrinfo failed: gaierror(-2, 'Name does not resolve').
zgrab-1     | 2024-10-21 08:04:50,540 - ERROR - AMQP connection workflow failed: AMQPConnectionWorkflowFailed: 1 exceptions in all; last exception - gaierror(-2, 'Name does not resolve'); first exception - None.
zgrab-1     | 2024-10-21 08:04:50,540 - ERROR - AMQPConnectionWorkflow - reporting failure: AMQPConnectionWorkflowFailed: 1 exceptions in all; last exception - gaierror(-2, 'Name does not resolve'); first exception - None
zgrab-1     | 2024-10-21 08:04:50,540 - ERROR - Connection workflow failed: AMQPConnectionWorkflowFailed: 1 exceptions in all; last exception - gaierror(-2, 'Name does not resolve'); first exception - None
zgrab-1     | 2024-10-21 08:04:50,540 - ERROR - Error in _create_connection().
zgrab-1     | Traceback (most recent call last):
zgrab-1     |   File "/usr/local/lib/python3.12/site-packages/pika/adapters/blocking_connection.py", line 451, in _create_connection
zgrab-1     |     raise self._reap_last_connection_workflow_error(error)
zgrab-1     |   File "/usr/local/lib/python3.12/site-packages/pika/adapters/utils/selector_ioloop_adapter.py", line 565, in _resolve
zgrab-1     |     result = socket.getaddrinfo(self._host, self._port, self._family,
zgrab-1     |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zgrab-1     |   File "/usr/local/lib/python3.12/socket.py", line 976, in getaddrinfo
zgrab-1     |     for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
zgrab-1     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zgrab-1     | socket.gaierror: [Errno -2] Name does not resolve
zgrab-1     | Traceback (most recent call last):
zgrab-1     |   File "//process.py", line 152, in <module>
zgrab-1     |     main()
zgrab-1     |   File "//process.py", line 115, in main
zgrab-1     |     connection = pika.BlockingConnection(params)
zgrab-1     |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zgrab-1     |   File "/usr/local/lib/python3.12/site-packages/pika/adapters/blocking_connection.py", line 360, in __init__
zgrab-1     |     self._impl = self._create_connection(parameters, _impl_class)
zgrab-1     |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zgrab-1     |   File "/usr/local/lib/python3.12/site-packages/pika/adapters/blocking_connection.py", line 451, in _create_connection
zgrab-1     |     raise self._reap_last_connection_workflow_error(error)
zgrab-1     |   File "/usr/local/lib/python3.12/site-packages/pika/adapters/utils/selector_ioloop_adapter.py", line 565, in _resolve
zgrab-1     |     result = socket.getaddrinfo(self._host, self._port, self._family,
zgrab-1     |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zgrab-1     |   File "/usr/local/lib/python3.12/socket.py", line 976, in getaddrinfo
zgrab-1     |     for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
zgrab-1     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zgrab-1     | socket.gaierror: [Errno -2] Name does not resolve
ctrlsam commented 1 month ago

@overcuriousity Thanks for checking out the project!

From your logs it seems that the zgrab can't connect to RabbitMQ. I've just done a full refactor of the project so I'd recommend giving it another try if you have time.

Thanks!

overcuriousity commented 1 month ago

Thank you for your effort. The stack seems to start up properly now. Had no time to test the CLI though - I am looking forward to the webinterface.