• Stars
    star
    835
  • Rank 52,375 (Top 2 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created over 8 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Retrieve IP Geolocation information

IPGeoLocation

====

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

Requirements

  • Python 3.x
  • termcolor
  • colorama

Download/Installation

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

More Repositories

1

EmailHarvester

Email addresses harvester
Python
747
star
2

PenTestKit

Tools, scripts and tips useful during Penetration Testing engagements.
Shell
589
star
3

gdog

A fully featured Windows backdoor that uses Gmail as a C&C server
Python
479
star
4

canisrufus

A stealthy Python based Windows backdoor that uses Github as a command and control server
Python
259
star
5

blue-team

Blue Team Scripts
Shell
239
star
6

intelspy

Perform automated network reconnaissance scans
Python
211
star
7

driver-loader

Load a Windows Kernel Driver
C++
91
star
8

clearlogs

Clear All Windows System Logs - AntiForensics
C#
52
star
9

gophish

GoPhish automation
Python
36
star
10

RSA2048

RSA 2048 encryption using CryptoAPI and C
C
31
star
11

PEdumper

Dump Windows PE file information in C
C
23
star
12

OverTheWire

OverTheWire Wargames write-ups
Python
19
star
13

AES256

AES 256 CBC encryption and Base64 encoding with CryptoAPI and C
C
18
star
14

WinRC4

RC4 Encryption with CryptoAPI and C
C
15
star
15

training

Notes on offensive training
15
star
16

dicerosbicornis

A fully featured Windows backdoor that uses email as a C&C server
Python
14
star
17

exploitation

Software exploitation training material
Python
14
star
18

osint

Tools, scripts and tips useful during OSINT investigations and reconnaissance.
11
star
19

email-providers

Free Email Providers
10
star
20

exploits

Various exploits
Python
10
star
21

RSA2048Sharp

RSA 2048 encryption using CryptoAPI and C#
C#
9
star
22

RC4

RC4 Encryption with OpenSSL RC4 in C
C
8
star
23

youtube-video-image

Download youtube video cover image.
Python
6
star
24

nsl00kup

Query the Domain Name System (DNS)
Python
6
star
25

AES256CBC

OpenSSL AES 256 CBC encryption and Base64 Encoding
C
5
star
26

SHA256

Calculate SHA 256 with CryptoAPI and C
C++
5
star
27

ServiceInstaller

Creates a service to load a driver (.sys) into kernel.
C
5
star
28

AES256Sharp

AES 256 CBC encryption and Base64 encoding with CryptoAPI and C#
C#
5
star
29

HashSHA512

Calculate SHA 512 with CryptoAPI and C
C
4
star
30

MetaScrub

Remove personal metadata from files.
C
4
star
31

maldevel.github.io

me
HTML
3
star
32

Peteb

Access Windows 8.1 TEB/PEB (x86 process)
C
3
star
33

misc

Miscellaneous scripts, code and other random stuff
Shell
3
star
34

SG2015

SG2015 Conference Material
2
star
35

zlibCompression

Compress and uncompress data buffers with zlib in C.
C
2
star
36

HashSHA256

Calculate SHA 256 with OpenSSL and C
C
1
star