2

I know how to scan subnets in c++...I also know how to find geo location (altough it's not 100%)...But does anyone have an idea how can i find the closest ip addresses to mine ?

Ex one neighbor is 100 meters from me and another one is 50 and if they are both connected to the internet, i should get the ip of the second which is 50 meters away from me.

Is there any possible way to implement this via programming language ?

Jørgen R
  • 10,568
  • 7
  • 42
  • 59
qweqwe
  • 95
  • 1
  • 1
  • 4
  • 1
    No, there is no way to do this. You might listen for wifi packets and identify computers nearby in that way, or scan bluetooth. But generally speaking you can't use TCP/IP itself for the purpose you describe. – Heath Hunnicutt Feb 13 '10 at 23:33
  • Maybe i just watch movies too much lol – qweqwe Feb 13 '10 at 23:36
  • 1
    Go on...share with us...what movies were you watching? :) – t0mm13b Feb 14 '10 at 00:03
  • CSI? :) http://globalnerdy.com/wordpress/wp-content/uploads/2007/10/fake_ip_address_on_csi.jpg – Pekka Feb 14 '10 at 00:07
  • @Pekka: Hmmm...that's a funny one....too overrated and imho a bit O.T.T.... :P Tom Cruise's 'Minority Report' UI kinda, wiping hands on air as if cleaning windows...now there's an interesting SO question... :) – t0mm13b Feb 14 '10 at 00:10
  • @tommieb I *love* the user interface from minority report! That's why I've got a touch screen in front of me. I just don't use it to its full extent because the programs aren't there yet. – Pekka Feb 14 '10 at 00:15
  • @pekka: have a look here on my blog...http://blog.tbits.ie/2009/10/new-gui-concept/ and here http://blog.tbits.ie/2009/10/cheap-multitouch-pad/ You can actually download code for that on the first one...from 10gui – t0mm13b Feb 14 '10 at 00:19
  • @tommieb very, very interesting links, cheers! I'll take a closer look at them tomorrow. – Pekka Feb 14 '10 at 00:25
  • You can only know your nearest neighbors on the same local network (if you are physically connected to your neighbors). In that case Linux command `arp` will do the trick. Otherwise all odds are lost as long as you and your neighbors are behind ISP's gateway and no other way around to reach them – Agnius Vasiliauskas Jan 13 '19 at 15:36

5 Answers5

6

Forget it. The structure of how ISPs work and allocate their IP's will make this entirely impossible in 99.999999999% of all cases.

The kind of geolocation by IP address you mention - by checking against databases of IP addresses, and by analyzing the route points of the IP - will work on a city level if you're lucky.

The only reliable means of geo-location down to a city borough or even block is a new set of technologies that for example query Wi-Fi hotspots around the user's computer, and compare them with a list of known Wi-Fi hotspots and their locations. See for example yesterday's question about Geolocation in HTML 5.

There is no way to triangulate other users' positions from that, and thank god for that!

Community
  • 1
  • 1
Pekka
  • 442,112
  • 142
  • 972
  • 1,088
0

IP geolocation only locates the ISP. It cannot locate the actual host.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
0

The answer is no, you cannot find out what your neighbour's IP address is! How would you know if your neighbour is connected to the same ISP as yours? Again, a dangerous assumption, sure, geolocation may work but not 100% reliable...

They may be connected to Mars Inc ISP for all I care, as there is something fishy about your question - why do you want to know? for D-o-S attacks, hacking...

Hope this helps, Best regards, Tom.

t0mm13b
  • 34,087
  • 8
  • 78
  • 110
  • DoS attacks - hell no...Why would i target my neighbors? They are such a nice people lol. I just got inspiration from watching some movies, that's all. – qweqwe Feb 13 '10 at 23:51
0

If you're on cable, the bandwidth is shared by everyone using the cable. If you could tap the cable on the other side of your modem, you could see traffic of other people on the same segment. This is changing as DOCSIS 2 and 3 are rolled out, which provide PKI-based AES encryption.

If you're on wireless (WiFi, WiMax, Cellular), you may be able to pull the signals of other people. Limiting factors include 1. encryption (some have been broken) 2. Signal strength (Some technologies use directional antennas)

Obviously neither of these work if your neighbour is not using the same ISP.

Dark Falcon
  • 43,592
  • 5
  • 83
  • 98
0

yes there is..

1) You should measure distance in hops on routers.. So for example person on your subnet is one hop away, and person on your isp is 2 hops away..

if you are on windows you can measure hops by lines produced by traceroute app (through cmd in win+R) on unix you can run tracert app

2) If your geoip can give you approx geo location, you can measure distance between two gps locations. This will however not be very reliable as they cannot know exact location. But it might help if the IPs are more than 3 hops away..

Hops in traceroute program are measurement of TTL property in IGMP protocol. If TTL (Time to live) exceeds some point, router sends back answer that the destination has not been reached. This way you try first with TTL = 1, than TTL = 2, than TTL = 3, and so on.. If you dont want to program tracert program again, just use the command line execution function in your favorite programming language :)

Note that this is not not reliable on measure of distance between IPs as if your neighbor has different ISP than is yours, the distance to neighbor after him will be smaller than to him.

3) To measure distance of the closest networks, you might detect strength of wifi networks. if you know which wifi network belongs to whom, you might know the distance.

Note that if you already know IPs of your neighbors, you probably know also how far they are :)

If you are doing just network scan on the college campus or something like that you might detect more useful information about computers using nmap, but use it on your risk as you might get expelled, or you might get some sanctions from your ISP.

user2718285
  • 600
  • 6
  • 6
  • No. Ping time is not precise enough to measure distances on the order of tens of meters (and it would be signal path length anyway, not "as the crow flies"). – nobody Aug 02 '14 at 07:27
  • I did not recommend any ping time. I recommended to measure distance in measure of hops rather of distance in meters. i dont understand why my comment is taken negative – user2718285 Aug 05 '14 at 07:21
  • 1
    Hops won't tell you anything about physical distance either. – nobody Aug 05 '14 at 12:34
  • well.. as i said in my reply ;) it can tel if you are on the same subnet, local ISP, or if the other side is very very far away.. – user2718285 Aug 07 '14 at 08:11