Select Page

Hack like a Pro: How to Find the Exact Location of Any IP Address

Hack like a Pro: How to Find the Exact Location of Any IP Address

Welcome back, my tenderfoot hackers!

Have you ever wondered where the physical location of an IP address is? Maybe you want to know if that proxy server you are using is actually out of your local legal jurisdiction. Or, maybe you have the IP address of someone you are corresponding with and want to make certain they are where they say they are. Or, maybe you are a forensic investigator tracking down a suspect who wrote a threatening email or hacked someone’s company.

Now you can find the location of that IP address without a subpoena or search warrant.

A company called MaxMind maintains a database of the location of every IP address on the planet complete with GPS coordinates, area code, zip code, and country. This database is not in a typical relational database format, but rather in a flat file. MaxMind charges a $370 site license and $90/month (or $1360/year) for updates to this database. Their software has a beautiful front end that makes querying the database easy enough that even Windows or Mac users can manage.

MaxMind also gives away a free developers version of this database without any software or tools to read it. Although slightly less accurate than the commercial version, the price is certainly right. All we need to find the location of the IP is a program to read this data.

Two programmers, Jennifer Ennis and T. Williams, have developed a small Python script called pygeoip and released it under the GPL license that enables us to input an IP address and output this critical information. I think this tutorial is self-explanatory, but if you want to refresh your Python skills before diving in, take a look at our Python tutorials.

MUST READ:  Hacking iPhone iOS 7 Lockscreen

Step 1Fire Up Kali & Open a Terminal

The first step, of course, is to fire up our our trusty Kali system, or in this case, any Linux distribution. Then, open a terminal.

Note: Be cautious of the formatting below for commands. The formatting of this article will create big space gaps since it stretches lines out to fit the margins. This is because of long URLs that try to fit themselves on a separate line. Large spaces equals just one space, so keep that in mind. Refer to the screenshots to see how they actually look.

Step 2Download the Database

Now we need to download the database from MaxMind, and we can get it by typing the following.

kali > wget -N -q http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz

Then we need to unzip it.

kali> gzip -d GeoLiteCity.dat.gz

Let’s now check that the database is in place by listing the directory.

kali > ls -alh GeoLiteCity.dat

Step 3Download & Install Pygeoip

Next, we need to install the Python script to read the database, pygeoip. We can download it by typing the following.

kali > wget http://pygeoip.googlecode.com/files/pygeoip-0.1.3.zip

Then, unzip it.

kali > unzip pygeoip-0.1.3.zip

We next need to download some setup tools into the pygeoip directory.

kali > cd /pygeoip-0.1.3

kali > wget http://svn.python.org/projects/sandbox/trunk/setuptools/ez_setup.py

kali > wget http://pypi.python.org/packages/2.5/s/setuptools-0.6c11-py2.5.egg

Let’s now move and then build and install the setup tools.

kali > mv setuptools-0.6c11-py2.5.egg setuptools-0.7a1-py2.5.egg

kali > python setup.py build

kali > python setup.py install

We need to move the database to the pygeoip directory so that script can access it without having to use the full path.

MUST READ:  Beware! Hackers Are Spreading Locky Ransomware Using Facebook Messenger

kali > mv GeoLiteCity.dat /pygeoip-0.1.3/GeoLiteCity.dat

Step 4Query the Database

Now that we have the database in place and the pygeoip script downloaded and installed, we can begin to query that database with pygeoip.

First, we need to start a Python shell.

kali > python

Then, you will be greeted will the triple >>> indicating you are now in an interactive python shell. Let’s import the module and instantiate the class.

>>>import pygeoip
>>>gip = pygeopip.GeoIP(‘GeoLiteCity.dat’)

Next, we are ready to begin our query. Let’s see where Google is located.

>>>rec = gip.record_by_addr(‘64.233.161.99’)
>>>for key.val in rec.items():
… print “%s: %s” %(key,val)

Please note that it is critical to indent the “print”. If not, you will throw an error.

As you can see, we were able to locate Google’s IP in Mountain View, CA at area code 650, postal code 94043, longitude -122.0574, and latitude 37.4192. Not bad! Now, let’s try to locate the IP of cnn.com.

Once again, the combination of the database and pygeoip script was able to provide us with key location information on CNN’s IP address.

This little tool is great for locating any IP address in the world, albeit, it is a bit clunky. Maybe someone here in the Null Byte community with good Python skills would like to write an interactive script with a nice user interface where the user can simply enter the IP and get the record information?

Keep coming back, my tenderfoot hackers, as we continue to explore the tools and techniques of hacking!


About The Author

He is the brain behind thenexthack.com. He started this platform as a one man army to bring news from the dark side or call it the hidden side of the Internet. He is a security researcher with an interest in cyber attacks, politics, and sport.

73 Comments

  1. Thanks for sharing this tut. Will try it out. Still struggling getting installing kali linux.

    Reply
    • Mark Strader of Struggle Manufacturer, Lancaster, California searched fairly remarkable in his first round submission triumph over
      Borayo of Combat Ugly, San Diego, CA. An instant wasnot when Strader wasnot in 90% of times from
      the top-mount and charge of the fight.

      Reply
  2. Excellent post. I was checking constantly this weblog and
    I am inspired! Very useful info specially the remaining phase :
    ) I handle such info much. I was seeking this particular information for a
    very long time. Thank you and best of luck.

    Reply
    • I savour, result in I found exactly what I used to be
      taking a look for. You’ve ended my four day long hunt!

      God Blesss you man. Have a nice day.Bye

      Reply
  3. Oceanside hosts the Marine Corps Base Camp Pendleton and comes with a number
    of the challenges associated with foundation towns that are substantial.

    Reply
  4. For hottest news you have to visit internet and on internet I found
    this website as a most excellent web page for hottest updates.

    Reply
  5. Here at Interias, floor tile setup in Annapolis is a speciality of a
    number of our experienced, extremely knowledgeable
    specialists.

    Reply
  6. Those tax breaks are expected to encourage companies to set up shop, bringing
    jobs and also income to Rio.

    Reply
  7. A seasoned accident lawyer understands how you can manage all
    the truths, whether they are negative or excellent – however, your lawyer has to have all of the realities!

    Reply
    • The further you get away from the beach, the cheaper the lodge is.

      These accommodations having a watch may still charge a fee a lot, but when you
      never mind driving it could be worth every penny.

      Reply
  8. Changing a pet’s habitat typically gives cost-efficient as well as long-term remedy
    for damage caused by annoyance wildlife.

    Reply
  9. Travis bring 14 years of wildlife control for San antonio and also Austin Tx Territories.

    Reply
  10. Along with every thing that seems to be developing inside this subject material, all your opinions are actually somewhat exciting. Nevertheless, I am sorry, because I do not subscribe to your whole suggestion, all be it exhilarating none the less. It seems to us that your remarks are actually not completely validated and in reality you are generally yourself not even thoroughly convinced of the point. In any case I did appreciate looking at it.

    Reply
  11. Hi, I check your blogs on a regular basis. Your story-telling style is awesome,
    keep up the good work!

    Reply
  12. We need to build frameworks and funding mechanisms.

    Reply
    • Visitors may also Enjoy their traditional and traditional community and in the same period,
      you’ll be able to trace the footsteps of Lewis and Clark, wander entirely through Ancient State Areas using a
      functioning Lighthouse, examine real fishing in the interface and
      cranberry bog, experience freshly prepared
      crab along with oysters coursed before you view it unloaded in the Bay, party
      at family owned advanced restaurants focusing on new regional ingredients.

      Reply
  13. Nice post. I learn something new and challenging on websites I stumbleupon on a daily basis.

    It’s always helpful to read through articles from other writers and
    practice a little something from their web sites.

    Reply
  14. Luckily, with Venus Element you don’t have to trouble concerning getting double-crossed anymore.

    Reply
  15. The golden state Paint Professional currently holds permit 256308 (General Structure Specialist,
    Paint As well as Designing), which was Energetic when we last checked.

    Reply
  16. What’s Happening i am new to this, I stumbled upon this I’ve discovered It absolutely useful and it has aided me
    out loads. I’m hoping to give a contribution & aid other customers like its
    aided me. Good job.

    Reply
  17. This article is in fact a good one it assists new the web people, who are wishing for blogging.

    Reply
  18. The night ensues with a handful of bars in the heart of
    the Old Town, sweeping between subterranean beer caverns as well as
    thumping electro joints, all which feature completely gratis entrance (component of the
    club crawl ticket) as well as with totally free shots on arrival.

    Reply
    • With havin so much content do you ever run intro any issues of plagorism or copyright infringement?
      My website has a lot of completely unique content I’ve either written myself or outsourced but it seems a lot of it is popping it up all over the internet without my
      authorization. Do you know any methods to help reduce content from being ripped off?
      I’d definitely appreciate it.

      Reply
  19. Your divorce lawyers leading and ought to be directing
    the actual estate agent while in the selling of the property and by
    maintaining both couples separate from the procedure therefore there
    is less potential for someone doing something to harm the sales.

    Reply
  20. Very shortly this website will be famous
    among all blog visitors, due to it’s good articles or reviews

    Reply
  21. Its not my first time to pay a quick visit this web page, i am browsing this web site dailly
    and take fastidious facts from here every day.

    Reply
  22. I might never love the ocean there the way and moved from Virginia Beach at one
    point in my own life used to do the Atlantic.

    Reply
  23. But i was delivered and increased in northern florida and nearly daily we venture out to yard
    or get email inside our gown and slippers and you know what?!

    Reply
  24. Many thanks for sharing your take on the most effective locations in Colorado –
    its been an excellent study!

    Reply
  25. My brother recommended I may like this web site.

    He was once entirely right. This put up truly
    made my day. You cann’t imagine simply how a lot
    time I had spent for this information! Thanks!

    Reply
  26. Howdy! I know this is kind of off topic but I was wondering if you knew where I could find a captcha plugin for my
    comment form? I’m using the same blog platform as yours
    and I’m having trouble finding one? Thanks a lot!

    Reply
  27. What’s up to all, how is everything, I think every one is getting more
    from this web site, and your views are fastidious designed for new visitors.

    Reply
  28. Ahaa, its pleasant conversation concerning this paragraph here at this blog, I have read all
    that, so at this time me also commenting at this place. https://laceydentist.wordpress.com/

    Reply
  29. Why people still use to read news papers when in this technological globe everything is
    existing on net?

    Reply
  30. First of all I want to say terrific blog! I had a quick question which
    I’d like to ask if you do not mind. I was curious to know how you center yourself and clear your thoughts before writing.
    I have had difficulty clearing my thoughts in getting my thoughts out there.
    I do take pleasure in writing however it just seems like the first
    10 to 15 minutes are wasted just trying to figure out how to begin. Any recommendations or tips?
    Appreciate it!

    Reply
    • Write more, thats all I have to say. Literally, it seems as though you relied on the video to make
      your point. You obviously know what youre talking about,
      why throw away your intelligence on just posting videos to
      your weblog when you could be giving us something enlightening to read?

      Reply
  31. What’s up friends, its fantastic piece of writing concerning cultureand
    fully explained, keep it up all the time.

    Reply
  32. Thomson-Reuters is the world’s greatest international media news organization, providing investing news, world news,
    business news, engineering news, subject news, small business news, news
    alerts, personalfinance, stockmarket, and mutual funds info on, video, mobile, and interactive television platforms.

    Reply
  33. May I just say what a relief to uncover
    someone who truly understands what they’re talking about on the web.
    You definitely understand how to bring an issue to light and make it important.
    More people should look at this and understand this side of the story.
    I was surprised you aren’t more popular because you most certainly
    have the gift.

    Reply
  34. Our painting & enhancing professionals license courses feature 100% Money-Back Guarantee.

    Reply
  35. Greate post. Keep posting such kind of information on your page.
    Im really impressed by your site.[X-N-E-W-L-I-N-S-P-I-N-X]Hey there, You have done an excellent job.
    I’ll certainly digg it and in my view recommend to my friends.
    I’m confident they’ll be benefited from this site. https://about.me/brittanyceleste

    Reply
  36. Low-quality pharmaceutical companies adding unsafe filler components to their solutions for price
    cuts are the primary reasons for garcinia cambogia negative effects.

    Reply
  37. Externally, painting a home seems to be a relatively basic,
    uncomplicated job.

    Reply
  38. I think, that you are not right. I am assured. I can defend the position. Write to me in PM, we will talk.
    [url=https://twitter.com/kolobovavaclava]cuahutemocMa[/url]

    Reply
  39. We are your relied on painter as well as paint service provider offering the Anaheim, Long Coastline, Buena Park,
    Los Angeles, Orange Area as well as All Southern The golden state area.

    Reply
  40. Helpful information. Lucky me I found your site by chance, and I am surprised why this coincidence didn’t took
    place earlier! I bookmarked it.

    Reply
  41. Katowice Flight terminal (IATA: KTW) Alternatively, you could fly
    to Katowice – Pyrzowice( KTW), which is located regarding 100km from the city of Krakow and has direct connections with over 30 destinations throughout Europe and also Asia.

    Reply
  42. Have you ever considered about including a little bit more
    than just your articles? I mean, what you say is valuable and everything.

    But think of if you added some great pictures or videos to give your posts more, “pop”!
    Your content is excellent but with images and video clips, this
    site could certainly be one of the very best in its field.
    Awesome blog!

    Reply
  43. Volunteering at our hostel really gives you the possibility to delve into every element of gloss
    culture while likewise having a fun time partying with our visitors.

    Reply
  44. The EPA’s Repair work, painting and improvement Guideline (or RRP)
    went into impact on April 22, 2010.

    Reply
  45. Search Engine Ranker includes completely automated entries including automated account registration as well as automatic e-mail verification for all submission websites making
    the promo job simpler and faster compared to with any other device in the
    marketplace.

    Reply
  46. I think this is among the most important info for
    me. And i am glad reading your article. But want to remark on few general things, The web site
    style is great, the articles is really nice : D. Good job, cheers

    Reply
  47. If you are a larger organisation wanting to increase, the specialist group at FastComet will certainly help you realise your goals, and also if you are a website developer and/or developer, they will certainly offer you the devices
    you need to build the firm you have actually always imagined.

    Reply
  48. Sweet blog! I found it while searching on Yahoo News.
    Do you have any tips on how to get listed in Yahoo News?
    I’ve been trying for a while but I never seem to get there!
    Thanks

    Reply
  49. Excellent blog post. I certainly appreciate this website.
    Thanks!

    Reply
  50. Howdy, i read your blog from time to time and
    i own a similar one and i was just wondering if you get a lot
    of spam feedback? If so how do you prevent it, any plugin or anything you can advise?
    I get so much lately it’s driving me mad so any help
    is very much appreciated.

    Reply
  51. Now I am going to do my breakfast, after having my
    breakfast coming over again to read more news.

    Reply
  52. I think what you said made a lot of sense. But, consider this, what
    if you typed a catchier post title? I am not saying your information isn’t good., but suppose you added a title
    to maybe grab a person’s attention? I mean Hack like a Pro: How to Find the Exact Location of Any IP Address • The Next Hack | Latest Cyber Crime –
    Tech – InfoSec – Hacking is kinda plain. You
    might peek at Yahoo’s front page and see how they write post titles to
    grab people to open the links. You might add a video
    or a picture or two to grab readers excited about everything’ve
    written. In my opinion, it could make your posts a little livelier.

    Reply
  53. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates.
    I’ve been looking for a plug-in like this for
    quite some time and was hoping maybe you would have some experience with something like this.

    Please let me know if you run into anything.
    I truly enjoy reading your blog and I look forward to your new updates.

    Reply
  54. Yes! Finally someone writes about ig.

    Reply
  55. Hi, i think that i saw you visited my weblog thus i got
    here to go back the prefer?.I’m trying to in finding things to enhance my web site!I guess its
    ok to make use of a few of your concepts!!

    Reply
  56. Kraków is likewise known as Cracow, or Krakow (without the
    diacritic) and goes back to at the very least the 7th century.

    Reply
  57. I’ve been browsing on-line more than 3 hours nowadays, yet I never found any attention-grabbing article like yours.
    It’s pretty value enough for me. In my view,
    if all webmasters and bloggers made good content as you did, the internet will be much more useful than ever before.

    Reply

Leave a reply

Your email address will not be published. Required fields are marked *

Sign up for premium Hacking Tutorials

ADVERTISE

Your ad can be here. Contact us: [email protected]

TNH FORUM

For more Premium Tutorials LIke