Just like where the ip of the victim is logged once he clicks the generated link sent to him.
How can I make an IP grabber from scratch? It can be a script, program or website.
I want to know the languages, tools and approach that are used to grab IP of someone far away.
Atlast ,I found something in PHP to get the work done
$ip = $_SERVER['REMOTE_ADDR'];
file_put_contents('logs.txt', $ip, FILE_APPEND);
This ip can be used to trace the location and fetch other details using http://ipinfo.io APIs or https://wtfismyip.com/ APIs There are many other APIs though but available the above don't need registeration.
$details = json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"));
Hope this helps you as well.