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
1.89k stars 62 forks source link

Resolve EPD.init argument error for Waveshare v3 #22

Closed jbohack closed 2 days ago

jbohack commented 2 days ago

This PR addresses the Waveshare v3 crashing loop. After applying this merge, the screen will refresh as expected. Crash logs prior listed below: Nov 11 15:05:33 bjorn python3[9918]: TERM environment variable not set. Nov 11 15:05:33 bjorn python3[9913]: 2024-11-11 15:05:33 - shared.py - INFO - Loading configuration... Nov 11 15:05:35 bjorn systemd[1]: Stopping bjorn.service - Bjorn Service... Nov 11 15:05:35 bjorn systemd[1]: bjorn.service: Deactivated successfully. Nov 11 15:05:35 bjorn systemd[1]: Stopped bjorn.service - Bjorn Service. Nov 11 15:05:35 bjorn systemd[1]: bjorn.service: Consumed 3.058s CPU time. Nov 11 15:05:35 bjorn systemd[1]: Starting bjorn.service - Bjorn Service... Nov 11 15:05:35 bjorn systemd[1]: Started bjorn.service - Bjorn Service. Nov 11 15:05:36 bjorn python3[9986]: TERM environment variable not set. Nov 11 15:05:36 bjorn python3[9942]: 2024-11-11 15:05:36 - shared.py - INFO - Loading configuration... Nov 11 15:05:40 bjorn python3[9942]: 2024-11-11 15:05:39 - shared.py - INFO - Web console log file not found at Nov 11 15:05:40 bjorn python3[9942]: /home/bjorn/Bjorn/data/logs/temp_log.txt ... Nov 11 15:05:40 bjorn python3[9942]: 2024-11-11 15:05:40 - shared.py - INFO - Initializing the network knowledge base Nov 11 15:05:40 bjorn python3[9942]: CSV file with headers Nov 11 15:05:40 bjorn python3[9942]: 2024-11-11 15:05:40 - shared.py - INFO - Network knowledge base CSV file already Nov 11 15:05:40 bjorn python3[9942]: exists at /home/bjorn/Bjorn/data/netkb.csv Nov 11 15:05:40 bjorn python3[9942]: 2024-11-11 15:05:40 - shared.py - INFO - Initializing EPD display... Nov 11 15:05:41 bjorn python3[9942]: 2024-11-11 15:05:41 - shared.py - INFO - EPD type: epd2in13_V3 screen reversed Nov 11 15:05:41 bjorn python3[9942]: Error initializing EPD for full update: EPD.init() takes 1 positional argument but 2 were given Nov 11 15:05:41 bjorn python3[9942]: 2024-11-11 15:05:41 - shared.py - ERROR - Error initializing EPD display: Nov 11 15:05:41 bjorn python3[9942]: EPD.init() takes 1 positional argument but 2 were given Nov 11 15:05:41 bjorn python3[9942]: Traceback (most recent call last): Nov 11 15:05:41 bjorn python3[9942]: File "/home/bjorn/Bjorn/Bjorn.py", line 24, in Nov 11 15:05:41 bjorn python3[9942]: from init_shared import shared_data Nov 11 15:05:41 bjorn python3[9942]: File "/home/bjorn/Bjorn/init_shared.py", line 13, in Nov 11 15:05:41 bjorn python3[9942]: shared_data = SharedData() Nov 11 15:05:41 bjorn python3[9942]: ^^^^^^^^^^^^ Nov 11 15:05:41 bjorn python3[9942]: File "/home/bjorn/Bjorn/shared.py", line 38, in init Nov 11 15:05:41 bjorn python3[9942]: self.setup_environment() # Setup the environment Nov 11 15:05:41 bjorn python3[9942]: ^^^^^^^^^^^^^^^^^^^^^^^^ Nov 11 15:05:41 bjorn python3[9942]: File "/home/bjorn/Bjorn/shared.py", line 170, in setup_environment Nov 11 15:05:41 bjorn python3[9942]: self.initialize_epd_display() Nov 11 15:05:41 bjorn python3[9942]: File "/home/bjorn/Bjorn/shared.py", line 192, in initialize_epd_display Nov 11 15:05:41 bjorn python3[9942]: self.epd_helper.init_full_update() Nov 11 15:05:41 bjorn python3[9942]: File "/home/bjorn/Bjorn/epd_helper.py", line 30, in init_full_update Nov 11 15:05:41 bjorn python3[9942]: self.epd.init(self.epd.lut_full_update) Nov 11 15:05:41 bjorn python3[9942]: TypeError: EPD.init() takes 1 positional argument but 2 were given Nov 11 15:05:42 bjorn systemd[1]: bjorn.service: Main process exited, code=exited, status=1/FAILURE Nov 11 15:05:42 bjorn systemd[1]: bjorn.service: Failed with result 'exit-code'.

jbohack commented 2 days ago

All errors for the Waveshare V3 should now be resolved following the two commits in this PR.

infinition commented 2 days ago

Thanks mate, have you tried it ?

jbohack commented 2 days ago

Yup, this does work. @ZeroCool-Dade was also able to confirm under the issues page: https://github.com/infinition/Bjorn/issues/7#issuecomment-2469043834