I'm thinking of building a web app which finds an IP address of all the intermediate nodes/server between two communication parties.
For example, if I want to find a IP address of one of my friend which is on Instagram, then our communication is something look-like request is gone from my device to Instagram server which further goes to my friend's device.
me -> Instagram Server -> my friend
Now my question is how to find the public IP of my friend device?
I know that how to get the IP of Instagram server. Further I know some websites claims that they will find the IP of all intermediate nodes/server and the other end user/server. But all are fake.
Can please someone help me in this that how to get all the intermediate/server and other end user public IP ?
You can't discover your friend's IP unless Instagram exposes it to you (which it wouldn't do (at least not intentionally) because it would be a significant privacy violation towards your friend).
As for picking up the IPs on the way to Instagram - look into how traceroute
works: https://2buntu.com/articles/1203/traceroute-how-does-it-work/