Closed afreeland closed 6 days 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 ?
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
}
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).
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
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
Closing this issue since it has been resolved by: https://github.com/infinition/Bjorn/pull/49
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.
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 the192.168.30.0/24
network to192.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?