vlachoudis / bCNC

GRBL CNC command sender, autoleveler and g-code editor
GNU General Public License v2.0
1.58k stars 538 forks source link

Exceptions when hacked #1869

Open garyemiller opened 10 months ago

garyemiller commented 10 months ago

Some haxor scanned my box, and found the pendant port. Hilarity ensued:

Job done. Purging the controller. (Running: False)
----------------------------------------
Exception occurred during processing of request from ('45.128.232.152', 39896)
Traceback (most recent call last):
  File "/usr/lib/python3.11/socketserver.py", line 317, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.11/socketserver.py", line 348, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python3.11/socketserver.py", line 361, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.11/socketserver.py", line 755, in __init__
    self.handle()
  File "/usr/lib/python3.11/http/server.py", line 436, in handle
    self.handle_one_request()
  File "/usr/lib/python3.11/http/server.py", line 419, in handle_one_request
    self.send_error(
  File "/usr/lib/python3.11/http/server.py", line 466, in send_error
    self.log_error("code %d, message %s", code, message)
  File "/usr/lib/python3.11/http/server.py", line 568, in log_error
    self.log_message(format, *args)
  File "/home/gem/src/venv/lib/python3.11/site-packages/bCNC/Pendant.py", line 44, in log_message
    if args[0].startswith("GET / ") or args[0].startswith("GET /send"):
       ^^^^^^^^^^^^^^^^^^
AttributeError: 'HTTPStatus' object has no attribute 'startswith'
----------------------------------------
----------------------------------------
Exception occurred during processing of request from ('146.190.19.206', 38000)
Traceback (most recent call last):
  File "/usr/lib/python3.11/http/server.py", line 292, in parse_request
    raise ValueError
ValueError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/socketserver.py", line 317, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.11/socketserver.py", line 348, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python3.11/socketserver.py", line 361, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.11/socketserver.py", line 755, in __init__
    self.handle()
  File "/usr/lib/python3.11/http/server.py", line 436, in handle
    self.handle_one_request()
  File "/usr/lib/python3.11/http/server.py", line 414, in handle_one_request
    if not self.parse_request():
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/http/server.py", line 309, in parse_request
    self.send_error(
  File "/usr/lib/python3.11/http/server.py", line 466, in send_error
    self.log_error("code %d, message %s", code, message)
  File "/usr/lib/python3.11/http/server.py", line 568, in log_error
    self.log_message(format, *args)
  File "/home/gem/src/venv/lib/python3.11/site-packages/bCNC/Pendant.py", line 44, in log_message
    if args[0].startswith("GET / ") or args[0].startswith("GET /send"):
       ^^^^^^^^^^^^^^^^^^
AttributeError: 'HTTPStatus' object has no attribute 'startswith'
----------------------------------------
----------------------------------------
Exception occurred during processing of request from ('146.190.19.206', 38002)
Traceback (most recent call last):
  File "/usr/lib/python3.11/socketserver.py", line 317, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.11/socketserver.py", line 348, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python3.11/socketserver.py", line 361, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.11/socketserver.py", line 755, in __init__
    self.handle()
  File "/usr/lib/python3.11/http/server.py", line 436, in handle
    self.handle_one_request()
  File "/usr/lib/python3.11/http/server.py", line 414, in handle_one_request
    if not self.parse_request():
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/http/server.py", line 331, in parse_request
    self.send_error(
  File "/usr/lib/python3.11/http/server.py", line 466, in send_error
    self.log_error("code %d, message %s", code, message)
  File "/usr/lib/python3.11/http/server.py", line 568, in log_error
    self.log_message(format, *args)
  File "/home/gem/src/venv/lib/python3.11/site-packages/bCNC/Pendant.py", line 44, in log_message
    if args[0].startswith("GET / ") or args[0].startswith("GET /send"):
       ^^^^^^^^^^^^^^^^^^
AttributeError: 'HTTPStatus' object has no attribute 'startswith'
----------------------------------------
146.190.19.206 - - [12/Jan/2024 13:35:31] "146.190.19.206" : "GET / HTTP/1.1" 200 -
----------------------------------------
Exception occurred during processing of request from ('146.190.19.206', 38028)
Traceback (most recent call last):
  File "/usr/lib/python3.11/http/server.py", line 292, in parse_request
    raise ValueError
ValueError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/socketserver.py", line 317, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.11/socketserver.py", line 348, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python3.11/socketserver.py", line 361, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.11/socketserver.py", line 755, in __init__
    self.handle()
  File "/usr/lib/python3.11/http/server.py", line 436, in handle
    self.handle_one_request()
  File "/usr/lib/python3.11/http/server.py", line 414, in handle_one_request
    if not self.parse_request():
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/http/server.py", line 309, in parse_request
    self.send_error(
  File "/usr/lib/python3.11/http/server.py", line 466, in send_error
    self.log_error("code %d, message %s", code, message)
  File "/usr/lib/python3.11/http/server.py", line 568, in log_error
    self.log_message(format, *args)
  File "/home/gem/src/venv/lib/python3.11/site-packages/bCNC/Pendant.py", line 44, in log_message
    if args[0].startswith("GET / ") or args[0].startswith("GET /send"):
       ^^^^^^^^^^^^^^^^^^
AttributeError: 'HTTPStatus' object has no attribute 'startswith'
----------------------------------------

The main bCNC program kept running fine.