Journal entry and trying to fix no-proc-kill-bug.

This commit is contained in:
Sebastian Lenzlinger 2023-06-06 22:03:58 +02:00
parent 96461ca78c
commit ebfeaf84ae
2 changed files with 8 additions and 3 deletions

View File

@ -120,6 +120,11 @@ Test in VM and finnishing touches to smooth things out.
Did a first test in a Fedora 37 VM. At first it didn't work. Then I tested it on my normal machine and it also stopped working. It turned out that it was just not getting the root priviledges right, even tho it passed the root check. Testing on the VM was then succesfull in that it found the pids. Killing the process wasn't succesfull and will need further testing and fixes. Did a first test in a Fedora 37 VM. At first it didn't work. Then I tested it on my normal machine and it also stopped working. It turned out that it was just not getting the root priviledges right, even tho it passed the root check. Testing on the VM was then succesfull in that it found the pids. Killing the process wasn't succesfull and will need further testing and fixes.
#### TODO: #### TODO:
1. Fix the bug where the killing of the process doesn't work. 1. Fix the bug where the killing of the process doesn't work.
2. Build config files, maybe check if there is a better way to to do configs than with .txt files. ~~2. Build config files, maybe check if there is a better way to to do configs than with .txt files.~~ (finnished 6.06.23)
3. Keep testing. Goal is that if run as '''$ sudo ./kldetect.py -v''' one is prompted to kill the keylogger, and then rerunning the programm would give the output '''[+] No suspicious programms found''' 3. Keep testing. Goal is that if run as '''$ sudo ./kldetect.py -v''' one is prompted to kill the keylogger, and then rerunning the programm would give the output '''[+] No suspicious programms found'''
4. Note to self: Problem with killing is that not using pids-program dict to choose which program to kill. ~~4. Note to self: Problem with killing is that not using pids-program dict to choose which program to kill.~~
#### Later that same say
Configuration is now done with json to keep it all central.
Test with json configuration works.
Killing a process still doesn't work:
''' TypeError: 'str' object cannot be interpreted as integer '''

View File

@ -201,7 +201,7 @@ def detect_keyloggers():
# Get program names # Get program names
for pid in pids: for pid in pids:
program_name = get_program_name(pid) program_name = get_program_name(pid)
program_pid_dict[program_name] = pid program_pid_dict[program_name] = int(pid)
if auto_kill_option and program_name in auto_kill_programs: if auto_kill_option and program_name in auto_kill_programs:
os.kill(pid, signal.SIGKILL) os.kill(pid, signal.SIGKILL)
if verbose_option: if verbose_option: