IPGeo – Tool To Extract IP Addresses From Captured Network Traffic File

IPGeo is a python tool to extract IP addresses from captured network traffic file (PCAP/PCAPNG) and generate csv report containing details about the geolocation of each IP in the packets.

What is IP geolocation?

IP geolocation is the mapping of an IP address to the geographic location of the internet from the connected device. By geographically mapping the IP address, it provides you with location information such as the country, state, city, zip code, latitude/longitude, ISP, area code, and other information.

What is it for?

Various systems use geolocation databases for IP addresses. The reasons for this are numerous, but it is mainly used for deducting the user’s location so that the system could give more personalized offers (products, services, etc.).

Examples

In this case, we will deduct the geolocation for the following IP address: 185.141.165.74.
The easiest way to do it is to use free online tools like iplocation.net (google IP geolocation tools).

The report contains:

  1. Country:
  2. Country Code.
  3. Region
  4. Region Name
  5. City
  6. Zip
  7. Latitude
  8. Longitude
  9. Time-zone
  10. ISP
  11. Org
  12. Ip

Installation of IPGeo

Use the package manager pip3 to install required modules.

pip3 install colorama, requests, pyshark

If you are not using Kali or Parrot OS or any other penetration distribution you need to install Tshark.

sudo apt install tshark

Usage

python3 ipGeo.py
# then you will enter captured traffic file path
 

Screenshot from the script

IPGeo

 

Download IP Geo