I’m making a scan server for my company, which will be used to launch scans from tools such as nessus, nmap, nikto etc. I’ve written the pages in php, so once the scan is launched it backgrounds the process and returns the PID. Part of the design spec is that once a scan has finished, the results are then emailed to the appropiate consultant. This is where I’m looking for some ideas, for I’m not sure how to go about doing this.
Would I be best making the php script feed the PID to instances of a python (my main language) script, which constantly checked to see if the process had finished, for example? I did try putting this process checking loop in the PHP page, but obviously this makes the PHP page pause whilst it waits for the scan to complete, which doesn’t work for me unfortunately as multiple scans will be being run.
Or would I be better creating a database which stored state information about the process? I have no database experience but this could be a good time to learn.
Any suggestions? Even some ideas that I can google would be much appreciated!
Thanks
When I face this kind of problem, I usually do a Python daemon that does the whole job, and have the PHP just sending messages to this Python daemon. These messages can be something very simple, like a bunch of files in a directory that is constantly checked, or registers in database.
How good this implmeentation is would depend on the scale of your application.