Information Gathering

IPGeolocation – A Comprehensive Guide To The IPGeoLocation Tool

IPGeoLocation is a powerful tool designed to fetch detailed geolocation information for any given IP address or domain.

Utilizing the comprehensive services of ip-api, this Python-based application offers extensive functionality including proxy support, multiple output formats, and integration with Google Maps.

Ideal for cybersecurity professionals and enthusiasts, IPGeoLocation streamlines the process of IP analysis and geolocation retrieval.

  • A tool to retrieve IP Geolocation information
  • Powered by ip-api

Requirements

  • Python 3.x
  • termcolor
  • colorama

Download/Installation

  • git clone
  • pip3 install -r requirements.txt –user

if pip3 is missing:

  • apt-get install python3-setuptools
  • easy_install3 pip
  • pip3 install -r requirements.txt

Features

  • Retrieve IP or Domain Geolocation.
  • Retrieve your own IP Geolocation.
  • Retrieve Geolocation for IPs or Domains loaded from file. Each target in new line.
  • Define your own custom User Agent string.
  • Select random User-Agent strings from file. Each User Agent string in new line.
  • Proxy support.
  • Select random proxy from file. Each proxy URL in new line.
  • Open IP geolocation in Google Maps using the default browser.
  • Export results to csv, xml and txt format.

Geolocation Information

  • ASN
  • City
  • Country
  • Country Code
  • ISP
  • Latitude
  • Longtitude
  • Organization
  • Region Code
  • Region Name
  • Timezone
  • Zip Code

Usage

$ ./ip2geolocation.py
usage: ipgeolocation.py [-h] [-m] [-t TARGET] [-T file] [-u User-Agent]
                        [-U file] [-g] [--noprint] [-v] [--nolog] [-x PROXY]
                        [-X file] [-e file] [-ec file] [-ex file]

IPGeolocation 2.0.4

--[ Retrieve IP Geolocation information from ip-api.com
--[ Copyright (c) 2015-2016 maldevel (@maldevel)
--[ ip-api.com service will automatically ban any IP addresses doing over 150 requests per minute.

optional arguments:
  -h, --help            show this help message and exit
  -m, --my-ip           Get Geolocation info for my IP address.
  -t TARGET, --target TARGET
                        IP Address or Domain to be analyzed.
  -T file, --tlist file
                        A list of IPs/Domains targets, each target in new line.
  -u User-Agent, --user-agent User-Agent
                        Set the User-Agent request header (default: IP2GeoLocation 2.0.3).
  -U file, --ulist file
                        A list of User-Agent strings, each string in new line.
  -g                    Open IP location in Google maps with default browser.
  --noprint             IPGeolocation will print IP Geolocation info to terminal. It is possible to tell IPGeolocation n
ot to print results to terminal with this option.
  -v, --verbose         Enable verbose output.
  --nolog               IPGeolocation will save a .log file. It is possible to tell IPGeolocation not to save those log
files with this option.
  -x PROXY, --proxy PROXY
                        Setup proxy server (example: http://127.0.0.1:8080)
  -X file, --xlist file
                        A list of proxies, each proxy url in new line.
  -e file, --txt file   Export results.
  -ec file, --csv file  Export results in CSV format.
  -ex file, --xml file  Export results in XML format.

Examples

Retrieve your IP Geolocation

  • ./ip2geolocation.py -m

Retrieve IP Geolocation

  • ./ip2geolocation.py -t x.x.x.x

Retrieve Domain Geolocation

  • ./ip2geolocation.py -t example.com

Do not save .log files

  • ./ip2geolocation.py -t example.com –nolog

Custom User Agent string

  • ./ip2geolocation.py -t x.x.x.x -u “Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko”

Using Proxy

Using random Proxy

  • ./ip2geolocation.py -t x.x.x.x -X /path/to/proxies/filename.txt

Pick User-Agent string randomly

  • ./ip2geolocation.py -t x.x.x.x -U /path/to/user/agent/strings/filename.txt

Retrieve IP geolocation and open location in Google maps with default browser

  • ./ip2geolocation.py -t x.x.x.x -g

Export results to CSV file

  • ./ip2geolocation.py -t x.x.x.x –csv /path/to/results.csv

Export results to XML file

  • ./ip2geolocation.py -t x.x.x.x –xml /path/to/results.xml

Export results to TXT file

  • ./ip2geolocation.py -t x.x.x.x -e /path/to/results.txt

Retrieve IP Geolocation for many targets

  • ./ip2geolocation.py -T /path/to/targets/targets.txt

Retrieve IP Geolocation for many targets and export results to xml

  • ./ip2geolocation.py -T /path/to/targets/targets.txt –xml /path/to/results.xml

Do not print results to terminal

  • ./ip2geolocation.py -m -e /path/to/results.txt –noprint

Varshini

Tamil has a great interest in the fields of Cyber Security, OSINT, and CTF projects. Currently, he is deeply involved in researching and publishing various security tools with Kali Linux Tutorials, which is quite fascinating.

Recent Posts

Kali Linux 2024.4 Released, What’s New?

Kali Linux 2024.4, the final release of 2024, brings a wide range of updates and…

21 hours ago

Lifetime-Amsi-EtwPatch : Disabling PowerShell’s AMSI And ETW Protections

This Go program applies a lifetime patch to PowerShell to disable ETW (Event Tracing for…

21 hours ago

GPOHunter – Active Directory Group Policy Security Analyzer

GPOHunter is a comprehensive tool designed to analyze and identify security misconfigurations in Active Directory…

3 days ago

2024 MITRE ATT&CK Evaluation Results – Cynet Became a Leader With 100% Detection & Protection

Across small-to-medium enterprises (SMEs) and managed service providers (MSPs), the top priority for cybersecurity leaders…

5 days ago

SecHub : Streamlining Security Across Software Development Lifecycles

The free and open-source security platform SecHub, provides a central API to test software with…

1 week ago

Hawker : The Comprehensive OSINT Toolkit For Cybersecurity Professionals

Don't worry if there are any bugs in the tool, we will try to fix…

1 week ago