infinition / Bjorn

Bjorn is a powerful network scanning and offensive security tool for the Raspberry Pi with a 2.13-inch e-Paper HAT. It discovers network targets, identifies open ports, exposed services, and potential vulnerabilities. Bjorn can perform brute force attacks, file stealing, host zombification, and supports custom attack scripts.
MIT License
2.56k stars 106 forks source link

Service fails to start #44

Closed afreeland closed 6 days ago

afreeland commented 1 week ago

Describe the bug After switching from one WiFi network to another, it appeared to work fine for a little while and then just stopped working entirely.

Nov 17 21:11:32 bjorn systemd[1]: bjorn.service: Scheduled restart job, restart counter is at 8.
Nov 17 21:11:32 bjorn systemd[1]: Stopped bjorn.service - Bjorn Service.
Nov 17 21:11:32 bjorn systemd[1]: bjorn.service: Consumed 1.492s CPU time.
Nov 17 21:11:32 bjorn systemd[1]: Starting bjorn.service - Bjorn Service...
Nov 17 21:11:32 bjorn systemd[1]: Started bjorn.service - Bjorn Service.
Nov 17 21:11:33 bjorn python3[833]: 2024-11-17 21:11:33 - shared.py - INFO - Loading configuration...
Nov 17 21:11:33 bjorn python3[833]: Traceback (most recent call last):
Nov 17 21:11:33 bjorn python3[833]:   File "/home/bjorn/Bjorn/Bjorn.py", line 24, in <module>
Nov 17 21:11:33 bjorn python3[833]:     from init_shared import shared_data
Nov 17 21:11:33 bjorn python3[833]:   File "/home/bjorn/Bjorn/init_shared.py", line 13, in <module>
Nov 17 21:11:33 bjorn python3[833]:     shared_data = SharedData()
Nov 17 21:11:33 bjorn python3[833]:                   ^^^^^^^^^^^^
Nov 17 21:11:33 bjorn python3[833]:   File "/home/bjorn/Bjorn/shared.py", line 43, in __init__
Nov 17 21:11:33 bjorn python3[833]:     self.update_mac_blacklist()
Nov 17 21:11:33 bjorn python3[833]:   File "/home/bjorn/Bjorn/shared.py", line 176, in update_mac_blacklist
Nov 17 21:11:33 bjorn python3[833]:     if mac_address not in self.config['mac_scan_blacklist']:
Nov 17 21:11:33 bjorn python3[833]:        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 17 21:11:33 bjorn python3[833]: TypeError: argument of type 'NoneType' is not iterable
Nov 17 21:11:33 bjorn systemd[1]: bjorn.service: Main process exited, code=exited, status=1/FAILURE
Nov 17 21:11:33 bjorn systemd[1]: bjorn.service: Failed with result 'exit-code'.
Nov 17 21:11:33 bjorn systemd[1]: bjorn.service: Consumed 1.477s CPU time.
Nov 17 21:11:33 bjorn systemd[1]: bjorn.service: Scheduled restart job, restart counter is at 9.
Nov 17 21:11:33 bjorn systemd[1]: Stopped bjorn.service - Bjorn Service.
Nov 17 21:11:33 bjorn systemd[1]: bjorn.service: Consumed 1.477s CPU time.
Nov 17 21:11:33 bjorn systemd[1]: bjorn.service: Start request repeated too quickly.
Nov 17 21:11:33 bjorn systemd[1]: bjorn.service: Failed with result 'exit-code'.
Nov 17 21:11:33 bjorn systemd[1]: Failed to start bjorn.service - Bjorn Service.

To Reproduce I'm not entirely sure but perhaps changing from one WiFi network to another via the web interface and leaving it running for awhile.

Expected behavior Service should be able to restart

Screenshots n/a

Hardware (please complete the following information):

Additional context Looking further up in the logs there might be some other issues that occurred first. Anything mentions of the 192.168.40.0/24 network is when I changed it from the 192.168.30.0/24 network to 192.168.40.0/24 , not sure if its related or not but wanted to call it out.

It does look like perhaps files don't get properly closed over time?

File descriptor threshold reached: 64858 (threshold: 64535). Restarting service

Nov 17 13:38:11 bjorn python3[371781]: targets. Next scan in: 0 seconds
Nov 17 13:38:12 bjorn python3[371781]: 2024-11-17 13:38:12 - display.py - DEBUG - FD : 12587
Nov 17 13:38:12 bjorn python3[371781]: 2024-11-17 13:38:12 - shared.py - INFO - Initializing the network knowledge base
Nov 17 13:38:12 bjorn python3[371781]: CSV file with headers
Nov 17 13:38:12 bjorn python3[371781]: 2024-11-17 13:38:12 - shared.py - INFO - Network knowledge base CSV file already
Nov 17 13:38:12 bjorn python3[371781]: exists at /home/bjorn/Bjorn/data/netkb.csv
Nov 17 13:38:12 bjorn python3[371781]: 2024-11-17 13:38:12 - orchestrator.py - INFO - Executing action SSHBruteforce
Nov 17 13:38:12 bjorn python3[371781]: for 192.168.40.65:22
Nov 17 13:38:12 bjorn python3[371781]: 2024-11-17 13:38:12 - ssh_connector.py - INFO - Executing SSHBruteforce on
Nov 17 13:38:12 bjorn python3[371781]: 192.168.40.65:22...
Nov 17 13:38:12 bjorn python3[371781]: 2024-11-17 13:38:12 - ssh_connector.py - INFO - Running bruteforce_ssh on
Nov 17 13:38:12 bjorn python3[371781]: 192.168.40.65:22...
Nov 17 13:38:20 bjorn python3[371781]:   Bruteforcing SSH... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
Nov 17 13:38:21 bjorn python3[371781]: 2024-11-17 13:38:21 - orchestrator.py - INFO - Executing action SSHBruteforce
Nov 17 13:38:21 bjorn python3[371781]: for 192.168.40.66:22
Nov 17 13:38:21 bjorn python3[371781]: 2024-11-17 13:38:21 - ssh_connector.py - INFO - Executing SSHBruteforce on
Nov 17 13:38:21 bjorn python3[371781]: 192.168.40.66:22...
Nov 17 13:38:21 bjorn python3[371781]: 2024-11-17 13:38:21 - ssh_connector.py - INFO - Running bruteforce_ssh on
Nov 17 13:38:21 bjorn python3[371781]: 192.168.40.66:22...
Nov 17 13:38:25 bjorn python3[371781]:   Bruteforcing SSH... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
Nov 17 13:38:25 bjorn python3[371781]: 2024-11-17 13:38:25 - orchestrator.py - WARNING - Skipping action SMBBruteforce
Nov 17 13:38:25 bjorn python3[371781]: for 192.168.40.234:445 due to failed retry delay, retry possible in: 0:06:01
Nov 17 13:38:25 bjorn python3[371781]: 2024-11-17 13:38:25 - orchestrator.py - WARNING - Skipping action SSHBruteforce
Nov 17 13:38:25 bjorn python3[371781]: for 192.168.40.65:22 due to failed retry delay, retry possible in: 0:09:54
Nov 17 13:38:25 bjorn python3[371781]: 2024-11-17 13:38:25 - orchestrator.py - WARNING - Skipping action SSHBruteforce
Nov 17 13:38:25 bjorn python3[371781]: for 192.168.40.66:22 due to failed retry delay, retry possible in: 0:09:59
Nov 17 13:38:25 bjorn python3[371781]: 2024-11-17 13:38:25 - orchestrator.py - WARNING - Skipping action SMBBruteforce
Nov 17 13:38:25 bjorn python3[371781]: for 192.168.40.234:445 due to failed retry delay, retry possible in: 0:06:01
Nov 17 13:38:25 bjorn python3[371781]: 2024-11-17 13:38:25 - orchestrator.py - INFO - No available targets. Running
Nov 17 13:38:25 bjorn python3[371781]: network scan...
Nov 17 13:38:25 bjorn python3[371781]: 2024-11-17 13:38:25 - scanning.py - INFO - Starting Network Scanner
Nov 17 13:38:25 bjorn python3[371781]: 2024-11-17 13:38:25 - scanning.py - INFO - Network: 192.168.40.0/24
Nov 17 13:38:37 bjorn python3[371781]: 2024-11-17 13:38:37 - display.py - DEBUG - FD : 12625
Nov 17 13:39:03 bjorn python3[371781]: 2024-11-17 13:39:03 - display.py - DEBUG - FD : 12647
Nov 17 13:39:11 bjorn python3[371781]: 2024-11-17 13:39:11 - scanning.py - INFO - Maximum threads defined in the
Nov 17 13:39:11 bjorn python3[371781]: semaphore reached: can't start new thread
Nov 17 13:39:11 bjorn python3[371781]: 2024-11-17 13:39:11 - scanning.py - INFO - Maximum threads defined in the
Nov 17 13:39:11 bjorn python3[371781]: semaphore reached: can't start new thread
Nov 17 13:39:11 bjorn python3[371781]: 2024-11-17 13:39:11 - scanning.py - INFO - Maximum threads defined in the
Nov 17 13:39:11 bjorn python3[371781]: semaphore reached: can't start new thread
Nov 17 13:39:12 bjorn python3[371781]: Scanning IPs... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
Nov 17 13:39:12 bjorn python3[371781]:                                   Contents of
Nov 17 13:39:12 bjorn python3[371781]: /home/bjorn/Bjorn/data/output/scan_results/result_192.168.40.0_20241117_133825.c
Nov 17 13:39:12 bjorn python3[371781]:                                        sv
Nov 17 13:39:12 bjorn python3[371781]: ┏━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━┳━━━┳━━━┳━━━┳━━━━┳━━━┓
Nov 17 13:39:12 bjorn python3[371781]: ┃ IP           ┃ Hostn… ┃ Al… ┃ MAC Address            ┃  ┃ … ┃ … ┃ … ┃ 8… ┃ … ┃
Nov 17 13:39:12 bjorn python3[371781]: ┡━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━╇━━━╇━━━╇━━━╇━━━━╇━━━┩
Nov 17 13:39:12 bjorn python3[371781]: │ 192.168.40.1 │        │ 1   │ --      │  │   │   │   │ 8… │ … │
Nov 17 13:39:12 bjorn python3[371781]: ├──────────────┼────────┼─────┼────────────────────────┼──┼───┼───┼───┼────┼───┤
Nov 17 13:39:12 bjorn python3[371781]: │ 192.168.40.… │        │ 1   │ --     │  │   │   │   │    │ … │
Nov 17 13:39:12 bjorn python3[371781]: ├──────────────┼────────┼─────┼────────────────────────┼──┼───┼───┼───┼────┼───┤
Nov 17 13:39:12 bjorn python3[371781]: │ 192.168.40.… │        │ 1   │ --      │  │   │   │   │    │   │
Nov 17 13:39:12 bjorn python3[371781]: ├──────────────┼────────┼─────┼────────────────────────┼──┼───┼───┼───┼────┼───┤
Nov 17 13:39:12 bjorn python3[371781]: │ 192.168.40.… │        │ 1   │ --      │  │   │   │   │    │   │
Nov 17 13:39:12 bjorn python3[371781]: ├──────────────┼────────┼─────┼────────────────────────┼──┼───┼───┼───┼────┼───┤
Nov 17 13:39:12 bjorn python3[371781]: │ 192.168.40.… │        │ 1   │ --      │  │   │   │   │    │   │
Nov 17 13:39:12 bjorn python3[371781]: ├──────────────┼────────┼─────┼────────────────────────┼──┼───┼───┼───┼────┼───┤
Nov 17 13:39:12 bjorn python3[371781]: │ 192.168.40.… │        │ 1   │ --      │  │ … │ … │ … │    │   │
Nov 17 13:39:12 bjorn python3[371781]: ├──────────────┼────────┼─────┼────────────────────────┼──┼───┼───┼───┼────┼───┤
Nov 17 13:39:12 bjorn python3[371781]: │ 192.168.40.… │        │ 1   │ --      │  │   │   │   │    │   │
Nov 17 13:39:12 bjorn python3[371781]: ├──────────────┼────────┼─────┼────────────────────────┼──┼───┼───┼───┼────┼───┤
Nov 17 13:39:12 bjorn python3[371781]: │ 192.168.40.… │        │ 1   │ -- │  │   │   │   │    │   │
Nov 17 13:39:12 bjorn python3[371781]: ├──────────────┼────────┼─────┼────────────────────────┼──┼───┼───┼───┼────┼───┤
Nov 17 13:39:12 bjorn python3[371781]: │ 192.168.40.… │        │ 1   │ -- │  │   │   │   │    │   │
Nov 17 13:39:12 bjorn python3[371781]: └──────────────┴────────┴─────┴────────────────────────┴──┴───┴───┴───┴────┴───┘
Nov 17 13:39:12 bjorn python3[371781]: 2024-11-17 13:39:12 - scanning.py - INFO - Livestatus updated
Nov 17 13:39:12 bjorn python3[371781]: 2024-11-17 13:39:12 - scanning.py - INFO - Results saved to
Nov 17 13:39:12 bjorn python3[371781]: /home/bjorn/Bjorn/data/livestatus.csv
Nov 17 13:39:12 bjorn python3[371781]: 2024-11-17 13:39:12 - scanning.py - INFO - Scan results cleaned up
Nov 17 13:39:12 bjorn python3[371781]: 2024-11-17 13:39:12 - shared.py - INFO - Initializing the network knowledge base
Nov 17 13:39:12 bjorn python3[371781]: CSV file with headers
Nov 17 13:39:12 bjorn python3[371781]: 2024-11-17 13:39:12 - shared.py - INFO - Network knowledge base CSV file already
Nov 17 13:39:12 bjorn python3[371781]: exists at /home/bjorn/Bjorn/data/netkb.csv
Nov 17 13:39:12 bjorn python3[371781]: 2024-11-17 13:39:12 - orchestrator.py - WARNING - Skipping action SSHBruteforce
Nov 17 13:39:12 bjorn python3[371781]: for 192.168.40.65:22 due to failed retry delay, retry possible in: 0:09:07
Nov 17 13:39:12 bjorn python3[371781]: 2024-11-17 13:39:12 - orchestrator.py - WARNING - Skipping action SSHBruteforce
Nov 17 13:39:12 bjorn python3[371781]: for 192.168.40.66:22 due to failed retry delay, retry possible in: 0:09:12
Nov 17 13:39:12 bjorn python3[371781]: 2024-11-17 13:39:12 - orchestrator.py - WARNING - Skipping action SMBBruteforce
Nov 17 13:39:12 bjorn python3[371781]: for 192.168.40.234:445 due to failed retry delay, retry possible in: 0:05:14
Nov 17 13:39:12 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:12 bjorn python3[371781]: targets. Next scan in: 179 seconds
Nov 17 13:39:13 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:13 bjorn python3[371781]: targets. Next scan in: 178 seconds
Nov 17 13:39:14 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:14 bjorn python3[371781]: targets. Next scan in: 177 seconds
Nov 17 13:39:15 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:15 bjorn python3[371781]: targets. Next scan in: 176 seconds
Nov 17 13:39:16 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:16 bjorn python3[371781]: targets. Next scan in: 175 seconds
Nov 17 13:39:17 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:17 bjorn python3[371781]: targets. Next scan in: 174 seconds
Nov 17 13:39:18 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:18 bjorn python3[371781]: targets. Next scan in: 173 seconds
Nov 17 13:39:19 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:19 bjorn python3[371781]: targets. Next scan in: 172 seconds
Nov 17 13:39:20 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:20 bjorn python3[371781]: targets. Next scan in: 171 seconds
Nov 17 13:39:21 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:21 bjorn python3[371781]: targets. Next scan in: 170 seconds
Nov 17 13:39:22 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:22 bjorn python3[371781]: targets. Next scan in: 169 seconds
Nov 17 13:39:23 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:23 bjorn python3[371781]: targets. Next scan in: 168 seconds
Nov 17 13:39:24 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:24 bjorn python3[371781]: targets. Next scan in: 167 seconds
Nov 17 13:39:25 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:25 bjorn python3[371781]: targets. Next scan in: 166 seconds
Nov 17 13:39:26 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:26 bjorn python3[371781]: targets. Next scan in: 165 seconds
Nov 17 13:39:27 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:27 bjorn python3[371781]: targets. Next scan in: 164 seconds
Nov 17 13:39:28 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:28 bjorn python3[371781]: targets. Next scan in: 163 seconds
Nov 17 13:39:28 bjorn python3[371781]: 2024-11-17 13:39:28 - display.py - DEBUG - FD : 12680
Nov 17 13:39:29 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:29 bjorn python3[371781]: targets. Next scan in: 162 seconds
Nov 17 13:39:30 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:30 bjorn python3[371781]: targets. Next scan in: 161 seconds
Nov 17 13:39:31 bjorn python3[371781]: [86B blob data]
Nov 17 13:39:31 bjorn python3[371781]: targets. Next scan in: 160 seconds
Nov 17 13:39:31 bjorn bash[371784]: File descriptor threshold reached: 64858 (threshold: 64535). Restarting service.
Nov 17 13:39:31 bjorn systemd[1]: Stopping bjorn.service - Bjorn Service...
Nov 17 13:39:31 bjorn python3[371781]: 2024-11-17 13:39:31 - display.py - INFO - Exit signal received. Waiting for the
Nov 17 13:39:31 bjorn python3[371781]: main loop to finish...
Nov 17 13:39:32 bjorn sudo[379726]: pam_unix(sudo:session): session closed for user root
Nov 17 13:39:33 bjorn python3[371781]: 2024-11-17 13:39:33 - display.py - INFO - Main loop finished. Clean exit.
Nov 17 13:39:33 bjorn python3[371781]: Exception ignored in: <module 'threading' from '/usr/lib/python3.11/threading.py'>
Nov 17 13:39:33 bjorn python3[371781]: Traceback (most recent call last):
Nov 17 13:39:33 bjorn python3[371781]:   File "/usr/lib/python3.11/threading.py", line 1583, in _shutdown
Nov 17 13:39:33 bjorn python3[371781]:     lock.acquire()
Nov 17 13:39:33 bjorn python3[371781]:   File "/home/bjorn/Bjorn/Bjorn.py", line 153, in <lambda>
Nov 17 13:39:33 bjorn python3[371781]:     signal.signal(signal.SIGTERM, lambda sig, frame: handle_exit(sig, frame, display_thread, bjorn_thread, web_thread))
Nov 17 13:39:33 bjorn python3[371781]:                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 17 13:39:33 bjorn python3[371781]:   File "/home/bjorn/Bjorn/Bjorn.py", line 119, in handle_exit
Nov 17 13:39:33 bjorn python3[371781]:     handle_exit_display(sig, frame, display_thread)
Nov 17 13:39:33 bjorn python3[371781]:   File "/home/bjorn/Bjorn/display.py", line 373, in handle_exit_display
Nov 17 13:39:33 bjorn python3[371781]:     sys.exit(0)
Nov 17 13:39:33 bjorn python3[371781]: SystemExit: 0
Nov 17 13:39:36 bjorn systemd[1]: bjorn.service: Deactivated successfully.
Nov 17 13:39:36 bjorn systemd[1]: Stopped bjorn.service - Bjorn Service.
Nov 17 13:39:36 bjorn systemd[1]: bjorn.service: Consumed 26min 45.253s CPU time.
Nov 17 13:39:36 bjorn systemd[1]: Starting bjorn.service - Bjorn Service...
Nov 17 13:39:36 bjorn systemd[1]: Started bjorn.service - Bjorn Service.
Nov 17 13:39:37 bjorn python3[399946]: 2024-11-17 13:39:37 - shared.py - INFO - Loading configuration...
Nov 17 13:39:37 bjorn python3[399946]: Traceback (most recent call last):
Nov 17 13:39:37 bjorn python3[399946]:   File "/home/bjorn/Bjorn/Bjorn.py", line 24, in <module>
Nov 17 13:39:37 bjorn python3[399946]:     from init_shared import shared_data
Nov 17 13:39:37 bjorn python3[399946]:   File "/home/bjorn/Bjorn/init_shared.py", line 13, in <module>
Nov 17 13:39:37 bjorn python3[399946]:     shared_data = SharedData()
Nov 17 13:39:37 bjorn python3[399946]:                   ^^^^^^^^^^^^
Nov 17 13:39:37 bjorn python3[399946]:   File "/home/bjorn/Bjorn/shared.py", line 43, in __init__
Nov 17 13:39:37 bjorn python3[399946]:     self.update_mac_blacklist()
Nov 17 13:39:37 bjorn python3[399946]:   File "/home/bjorn/Bjorn/shared.py", line 176, in update_mac_blacklist
Nov 17 13:39:37 bjorn python3[399946]:     if mac_address not in self.config['mac_scan_blacklist']:
Nov 17 13:39:37 bjorn python3[399946]:        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 17 13:39:37 bjorn python3[399946]: TypeError: argument of type 'NoneType' is not iterable
Nov 17 13:39:38 bjorn systemd[1]: bjorn.service: Main process exited, code=exited, status=1/FAILURE
Nov 17 13:39:38 bjorn systemd[1]: bjorn.service: Failed with result 'exit-code'.
infinition commented 1 week ago

Try to delete the blacklisted mac adress in the file Bjorn\config\shared_config.json and restart the service or the rpi

Concerning the second message :

Nov 17 13:39:31 bjorn bash[371784]: File descriptor threshold reached: 64858 (threshold: 64535). Restarting service. This is normal as we are limited with the FD descriptor , we created a service to restart bjon once it's reached. For how many hours was Bjorn launched till the service restart ?

afreeland commented 1 week ago

I dont see any blacklisted mac addresses

cat shared_config.json  | grep black
    "blacklistcheck": true,
    "mac_scan_blacklist": null,
    "ip_scan_blacklist": null,

Here is the full shared_config.json

{
    "__title_Bjorn__": "Settings",
    "manual_mode": false,
    "websrv": true,
    "web_increment ": false,
    "debug_mode": true,
    "scan_vuln_running": false,
    "retry_success_actions": false,
    "retry_failed_actions": true,
    "blacklistcheck": true,
    "displaying_csv": true,
    "log_debug": true,
    "log_info": true,
    "log_warning": true,
    "log_error": true,
    "log_critical": true,
    "startup_delay": 10,
    "web_delay": 2,
    "screen_delay": 1,
    "comment_delaymin": 15,
    "comment_delaymax": 30,
    "livestatus_delay": 8,
    "image_display_delaymin": 2,
    "image_display_delaymax": 8,
    "scan_interval": 180,
    "scan_vuln_interval": 900,
    "failed_retry_delay": 600,
    "success_retry_delay": 900,
    "ref_width": 122,
    "ref_height": 250,
    "epd_type": "epd2in13_V4",
    "__title_lists__": "List Settings",
    "portlist": [
        20,
        21,
        22,
        23,
        25,
        53,
        69,
        80,
        110,
        111,
        135,
        137,
        139,
        143,
        161,
        162,
        389,
        443,
        445,
        512,
        513,
        514,
        587,
        636,
        993,
        995,
        1080,
        1433,
        1521,
        2049,
        3306,
        3389,
        5000,
        5001,
        5432,
        5900,
        8080,
        8443,
        9090,
        10000
    ],
    "mac_scan_blacklist": null,
    "ip_scan_blacklist": null,
    "steal_file_names": [
        "ssh.csv",
        "hack.txt"
    ],
    "steal_file_extensions": [
        ".bjorn",
        ".hack",
        ".flag"
    ],
    "__title_network__": "Network",
    "nmap_scan_aggressivity": "-T2",
    "portstart": 1,
    "portend": 2,
    "__title_timewaits__": "Time Wait Settings",
    "timewait_smb": 0,
    "timewait_ssh": 0,
    "timewait_telnet": 0,
    "timewait_ftp": 0,
    "timewait_sql": 0,
    "timewait_rdp": 0
}
afreeland commented 1 week ago

Concerning the second message :

Nov 17 13:39:31 bjorn bash[371784]: File descriptor threshold reached: 64858 (threshold: 64535). Restarting service. This is normal as we are limited with the FD descriptor , we created a service to restart bjon once it's reached. For how many hours was Bjorn launched till the service restart ?

I think this is normally caused when there are too many open files/sockets/etc from a particular process. I haven't had a chance to see exactly what resources it keeps a connection with but it feels like its not closing resources properly. Hoping to get a chance to look more into it at some point...

The restart would clear it but seems like a hacky fix for resources not being freed appropriately (assuming that is what it is).

afreeland commented 1 week ago

I did update

"mac_scan_blacklist": null,
"ip_scan_blacklist": null,

to

  "mac_scan_blacklist": [],
  "ip_scan_blacklist": [],

And it looks the service is back up and running. Haven't found where in code this could occur yet.

It appears it did at one point updates its the mac blacklist with its own:

  sudo journalctl -u bjorn | grep "blacklist"
Nov 16 21:41:03 bjorn python3[404]: xx:xx:xx:xx:xx:d8 to blacklist
Nov 16 23:18:31 bjorn python3[43745]: already in blacklist
Nov 17 00:54:46 bjorn python3[86033]: already in blacklist

Strange that the first part of the log, anything before/on the {mac_address} isn't output?

    def update_mac_blacklist(self):
        """Update the MAC blacklist without immediate save."""
        mac_address = self.get_raspberry_mac()
        if mac_address:
            if 'mac_scan_blacklist' not in self.config:
                self.config['mac_scan_blacklist'] = []

            if mac_address not in self.config['mac_scan_blacklist']:
                self.config['mac_scan_blacklist'].append(mac_address)
                logger.info(f"Added local MAC address {mac_address} to blacklist")
            else:
                logger.info(f"Local MAC address {mac_address} already in blacklist")
        else:
            logger.warning("Could not add local MAC to blacklist: MAC address not found")

I would've expected

 Nov 16 21:41:03 bjorn python3[404]: xx:xx:xx:xx:xx:d8 to blacklist

to be

  Nov 16 21:41:03 bjorn python3[404]:Added local MAC address xx:xx:xx:xx:xx:d8 to blacklist

and then

Nov 16 23:18:31 bjorn python3[43745]: already in blacklist 

to be

Nov 16 23:18:31 bjorn python3[43745]: Local MAC address xx:xx:xx:xx:xx:d8 already in blacklist 
afreeland commented 1 week ago

Looked into it real quick and determined it to be from saving from the web UI > config.js. I created a PR here: https://github.com/infinition/Bjorn/pull/49

afreeland commented 6 days ago

Closing this issue since it has been resolved by: https://github.com/infinition/Bjorn/pull/49