1

I have a pet project where I am trying to develop a small antivirus program for Linux. I have already designed the mathematical model and the heuristic approach that I plan on using, yet now I am struggling when trying to fingerprint the host machine.

In order to achieve that, I need to list all the processes and their state and output them to a text file. I did try to accomplish that via scanning the proc folder recursively yet I was wondering if there is a better way to do this. I am aware of the fact that processes with a short lifespan will slip by when doing it this way so I am trying to find the most elegant and simple solution for this in C++.

schroeder
  • 123,438
  • 55
  • 284
  • 319
Mihai
  • 35
  • 3
  • 1
    Not really a security Question... Have you tried asking over at StackOverflow? https://stackoverflow.com/ – Jens Krüger Jul 30 '19 at 13:30
  • @JensKrüger this is a security question. he needs a reliable way to get list of running processes. this is some sort of a race condition in antivirus context. – Awaaaaarghhh Jul 30 '19 at 13:38
  • @Awaaaaarghhh No its a programming question. The application he needs it for might be a security related but the process itself (getting a list of all running processes) is not a security question. – Jens Krüger Jul 30 '19 at 13:42
  • Just checked question was posted on https://stackoverflow.com/questions/57268382/get-linux-process-list-and-state-using-c allready. but got no answer. – Jens Krüger Jul 30 '19 at 13:43
  • he is clearly describing that some process with short lifespan might slip by. – Awaaaaarghhh Jul 30 '19 at 13:44
  • Please do not cross-post on StackExchange. – schroeder Jul 30 '19 at 13:51
  • 1
    "How do I programmatically (in a particular language) get data about the local machine?" This is not a security question but a pure programming question (or a Linux OS question). – schroeder Jul 30 '19 at 13:54
  • Why do you need to capture even short running processes? Why can't you gather the information over time? – schroeder Jul 30 '19 at 13:55

0 Answers0