diff --git a/__pycache__/utils.cpython-39.pyc b/__pycache__/utils.cpython-39.pyc new file mode 100644 index 0000000..c6e529f Binary files /dev/null and b/__pycache__/utils.cpython-39.pyc differ diff --git a/ipdrone.py b/ipdrone.py index eb0ea90..787585f 100644 --- a/ipdrone.py +++ b/ipdrone.py @@ -1,74 +1,54 @@ -#coded by N17RO (noob hackers) +#!/usr/bin/env python +# -*- coding: utf-8 -*- -#modules required +# NOTE: if you don't know your public ip use the publicIP.py script + +# coded by N17RO (noob hackers) + +# modules required import argparse import requests, json -import sys from sys import argv -import os +import ipaddress -#arguments and parser +from utils import * +# arguments and parser parser = argparse.ArgumentParser() - parser.add_argument ("-v", help= "target/host IP address", type=str, dest='target', required=True ) - args = parser.parse_args() - -#colours used -red = '\033[31m' -yellow = '\033[93m' -lgreen = '\033[92m' -clear = '\033[0m' -bold = '\033[01m' -cyan = '\033[96m' - -#banner of script -print (red+""" - -██╗██████╗ ██████╗ ██████╗ ██████╗ ███╗ ██╗███████╗ -██║██╔══██╗██╔══██╗██╔══██╗██╔═══██╗████╗ ██║██╔════╝ -██║██████╔╝██║ ██║██████╔╝██║ ██║██╔██╗ ██║█████╗ -██║██╔═══╝ ██║ ██║██╔══██╗██║ ██║██║╚██╗██║██╔══╝ -██║██║ ██████╔╝██║ ██║╚██████╔╝██║ ╚████║███████╗ -╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝ - v 1.0 -"""+red) -print (lgreen+bold+" <===[[ coded by N17RO ]]===> \n"+clear) -print (yellow+bold+" <---(( search on youtube Noob Hackers ))--> \n"+clear) +ip = args.target -ip = args.target +# banner +printBanner() -api = "http://ip-api.com/json/" +if ipaddress.ip_address(ip).is_private: + print(RED + "[-] Private IP Address can not be tracked, provide the Public IP Address") + exit() try: - data = requests.get(api+ip).json() - sys.stdout.flush() - a = lgreen+bold+"[$]" - b = cyan+bold+"[$]" - print (a, "[Victim]:", data['query']) - print(red+"<--------------->"+red) - print (b, "[ISP]:", data['isp']) - print(red+"<--------------->"+red) - print (a, "[Organisation]:", data['org']) - print(red+"<--------------->"+red) - print (b, "[City]:", data['city']) - print(red+"<--------------->"+red) - print (a, "[Region]:", data['region']) - print(red+"<--------------->"+red) - print (b, "[Longitude]:", data['lon']) - print(red+"<--------------->"+red) - print (a, "[Latitude]:", data['lat']) - print(red+"<--------------->"+red) - print (b, "[Time zone]:", data['timezone']) - print(red+"<--------------->"+red) - print (a, "[Zip code]:", data['zip']) - print (" "+yellow) + data = requests.get(API+ip).json() + flush() + + printA("[Victim]:", data['query']) + printB("[ISP]:", data['isp']) + printA("[Organisation]:", data['org']) + printB("[City]:", data['city']) + printA("[Region]:", data['region']) + printB("[Longitude]:", data['lon']) + printA("[Latitude]:", data['lat']) + printB("[Time zone]:", data['timezone']) + printA("[Zip code]:", data['zip']) except KeyboardInterrupt: - print ('Terminating, Bye'+lgreen) - sys.exit(0) + print(LGREEN + 'Terminating, Bye') + except requests.exceptions.ConnectionError as e: - print (red+"[~]"+" check your internet connection!"+clear) -sys.exit(1) + print(RED + "[~] check your internet connection!" + CLEAR) + +except ValueError: + print(RED + "[!] The Given IP Address does not seem to be valid") + +print(WHITE) + diff --git a/publicIP.py b/publicIP.py new file mode 100644 index 0000000..e1eddfd --- /dev/null +++ b/publicIP.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +In case if you want to know your public IP address use this script +usage: python publicIP.py +or: python3 publicIP.py +""" + +import requests, json + +API = "https://api.ipify.org/?format=json" + +IP = requests.get(API).json()['ip'] + +print("[+] Your public IP Address is:", IP) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..877bb67 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +requests +ipaddress \ No newline at end of file diff --git a/utils.py b/utils.py new file mode 100644 index 0000000..d252f43 --- /dev/null +++ b/utils.py @@ -0,0 +1,46 @@ +# utilities for ipdrone.py (helper functions and constants) + +import sys + +# URL of the API +API = "http://ip-api.com/json/" + +# colors +RED = '\033[31m' +YELLOW = '\033[93m' +LGREEN = '\033[92m' +CLEAR = '\033[0m' +BOLD = '\033[01m' +CYAN = '\033[96m' +WHITE = "\u001b[37m" + +# banner +def printBanner(): + print(f""" +{RED} +██╗██████╗ ██████╗ ██████╗ ██████╗ ███╗ ██╗███████╗ +██║██╔══██╗██╔══██╗██╔══██╗██╔═══██╗████╗ ██║██╔════╝ +██║██████╔╝██║ ██║██████╔╝██║ ██║██╔██╗ ██║█████╗ +██║██╔═══╝ ██║ ██║██╔══██╗██║ ██║██║╚██╗██║██╔══╝ +██║██║ ██████╔╝██║ ██║╚██████╔╝██║ ╚████║███████╗ +╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝ + v 1.0 +{RED} +{LGREEN+BOLD} + <===[[ coded by N17RO ]]===> +{CLEAR} +{YELLOW+BOLD} + <---(( search on youtube Noob Hackers ))--> +{CLEAR} + """) + +def printA(*text): + print(LGREEN + BOLD+ "[$]", *text) + print(RED + "<--------------->" + RED) + +def printB(*text): + print(CYAN + BOLD + "[$]", *text) + print(RED + "<--------------->" + RED) + +def flush(): + sys.stdout.flush() \ No newline at end of file