
Download the necessary binary and lets transfer it over to the target machine. Let’s go out to grab the tool from Github. This is where a tool like ps.py comes in handy! It will monitor the system for any commands that get executed and present them to us. So we know that cron is being used, but we don’t see anything in the crontab. Couldn’t locate anything, but we do see that there is a cron process running after executing the following command. So we have a low-level shell on the box and we’ve done our basic enumeration to try to find a path to escalate privileges. This post does not intend to serve as a walk-through or write-up of that box, but rather is a using it as an example for some of the tips I’m going to place here. There’s a box on TryHackMe called ConvertMyVideo. Subprocess.Popen(process_command, stdout=devnull, stderr=subprocess.While working through TheCyberMentor’s Linux Privesc course, I learned something new and wanted to place this here so I can refer to it later. Process_list = os.popen('tasklist /FI "STATUS eq Running"').read().strip().split('\n') Kill_list = os.popen('taskkill /F /T /PID %s' % nr).read() #Kill the process which is not responding Process_list = os.popen('tasklist /FI "STATUS eq Not Responding"').read().strip().split('\n') #Listing Processes which are not responding Putty is an SSH and telnet client.This scenario can be used with any process, just adjust the variables for the process you want to monitor in the code accordingly.This code will check the putty.exe process is running or not every 60 seconds So here I’m taking putty as an example process.


TaskList displays all running applications and services with their Process ID (PID) This can be run on either a local or a remote computer.


You have created a process in windows which needs to be run continuously without any halt when your windows is up and running.You want to check the status of the process, whether the process is running or got killed or in a not responding state, and restart the process if it is in any of the states mentioned.For doing this we can create a small python program and can use the TaskList functionality in windows.
