Skip to content

Instantly share code, notes, and snippets.

@JoyGhoshs
Created March 29, 2022 16:03
Show Gist options
  • Save JoyGhoshs/a40523d2c45eaef6b34b1b436cb83717 to your computer and use it in GitHub Desktop.
Save JoyGhoshs/a40523d2c45eaef6b34b1b436cb83717 to your computer and use it in GitHub Desktop.
import ipaddress
import random
import requests
from colorama import Fore, Back, Style
"""
Project DarkFiles ---> 0xJoyghosh [Org:system00-Security]
"""
def detection():
ip_add = str(ipaddress.IPv4Address(random.randint(0,2 ** 32)))
ip_data = requests.get('http://ip-api.com/json/' + ip_add)
ip_data = ip_data.json()
if ip_data['status'] == 'success':
print(f'[ {Fore.RED}IP{Fore.RESET} ] {Fore.BLUE}' + ip_data['query']+Fore.RED + Fore.RESET)
print(f'[ {Fore.RED}Country{Fore.RESET} ] {Fore.BLUE}' + ip_data['country'] + Fore.RESET)
print(f'[ {Fore.RED}Region{Fore.RESET} ] {Fore.BLUE}' + ip_data['regionName'] + Fore.RESET)
print(f'[ {Fore.RED}City{Fore.RESET} ] {Fore.BLUE}' + ip_data['city'] + Fore.RESET)
print("\n")
for number_of_ip in range(0,100):
detection()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment