i am working on a digital forensics case study and am attempting to write a c/c++ program on how to check the date and time or dates and specific times an IP address was given access to by this program. I am wondering on what would be the best way to implement this into my program. i have already checked to see if the string entered is a valid ipv4 or ipv6 address and was wondering if there is any functions or lib's that can make this process much easier. Thanks
Asked
Active
Viewed 55 times
-3
-
Who does the watching? Program monitor's self or another process monitors program? – user4581301 Sep 14 '16 at 05:21
-
@user4581301what do you mean exactly by watching? the program will moniter the access to the specfic ip address entered by the user – chris kelly Sep 14 '16 at 05:24
-
So the program monitors accesses to itself. You could probably do this yourself with a [`std::map`](http://en.cppreference.com/w/cpp/container/map) and `getpeername`. If you want persistence look into addling a lightweight database. – user4581301 Sep 14 '16 at 05:30
-
After reading this over a dozen times or so I think I'm getting what you're after. You aren't looking for who has connected to program, you're looking for who has use the program to connect to something else. I'd rewrite the question if I were you. Currently it is requesting an implementation without any bounds--too broad--in or a request for a library, both of which are off topic here. – user4581301 Sep 14 '16 at 05:45
1 Answers
0
If I understand you correctly, you are trying to write a C++ program that takes an IP address as an input, keeps checking to see if that particular IP address is accessible by you (your program).
- You could try to monitor changes in firewall (bigger scope) 2)
- You could run a command line tool like ping and parser the output 3)
- You could do C/C++ coding to do the pinging yourself like suggested in this post
- You could try to keep connecting, at brief intervals, to the IPaddress at a particular TCP/UDP port.