From e1fe526803e82770b242a741b95bdf06f8f4bb6a Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 Apr 2023 23:07:45 +0530 Subject: [PATCH 1/7] utils --- ipdrone.py | 79 ++++++++++++++++++------------------------------------ utils.py | 41 ++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 53 deletions(-) create mode 100644 utils.py diff --git a/ipdrone.py b/ipdrone.py index eb0ea90..9622653 100644 --- a/ipdrone.py +++ b/ipdrone.py @@ -1,74 +1,47 @@ -#coded by N17RO (noob hackers) +#!/usr/bin/env python +# -*- coding: utf-8 -*- -#modules required +# coded by N17RO (noob hackers) + +# modules required import argparse import requests, json import sys from sys import argv import os -#arguments and parser +from utils import API +from utils import printA, printB, printBanner -parser = argparse.ArgumentParser() +# 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 -api = "http://ip-api.com/json/" + +# banner +printBanner() try: - data = requests.get(api+ip).json() + 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) + + 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) + print('Terminating, Bye'+LGREEN) sys.exit(0) except requests.exceptions.ConnectionError as e: - print (red+"[~]"+" check your internet connection!"+clear) + print(RED+"[~]"+" check your internet connection!"+CLEAR) + sys.exit(1) diff --git a/utils.py b/utils.py new file mode 100644 index 0000000..ac743a3 --- /dev/null +++ b/utils.py @@ -0,0 +1,41 @@ +# utilities for ipdrone.py (helper functions and constants) + +# 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' + +# 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(LGREENb+ BOLD+ "[$]", text) + print(RED + "<--------------->" + RED) + +def printB(text): + print(CYAN + BOLD + "[$]", text) + print(RED + "<--------------->" + RED) + From 72474520a9f0663589093c3fcfc5e414080dcda5 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 Apr 2023 23:12:01 +0530 Subject: [PATCH 2/7] mknc --- ipdrone.py | 16 +++++----------- utils.py | 12 ++++++++++++ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/ipdrone.py b/ipdrone.py index 9622653..79698a8 100644 --- a/ipdrone.py +++ b/ipdrone.py @@ -6,13 +6,9 @@ # modules required import argparse import requests, json -import sys from sys import argv -import os - -from utils import API -from utils import printA, printB, printBanner +from utils import * # arguments and parser parser = argparse.ArgumentParser() @@ -26,7 +22,7 @@ try: data = requests.get(API+ip).json() - sys.stdout.flush() + flush() printA("[Victim]:", data['query']) printB("[ISP]:", data['isp']) @@ -39,9 +35,7 @@ printA("[Zip code]:", data['zip']) except KeyboardInterrupt: - print('Terminating, Bye'+LGREEN) - sys.exit(0) + terminate() + except requests.exceptions.ConnectionError as e: - print(RED+"[~]"+" check your internet connection!"+CLEAR) - -sys.exit(1) + error() diff --git a/utils.py b/utils.py index ac743a3..d66d4ac 100644 --- a/utils.py +++ b/utils.py @@ -1,5 +1,7 @@ # utilities for ipdrone.py (helper functions and constants) +import sys + # URL of the API API = "http://ip-api.com/json/" @@ -39,3 +41,13 @@ def printB(text): print(CYAN + BOLD + "[$]", text) print(RED + "<--------------->" + RED) +def terminate(): + print('Terminating, Bye'+LGREEN) + sys.exit(0) + +def error(): + print(RED+"[~]"+" check your internet connection!"+CLEAR) + sys.exit(0) + +def flush(): + sys.stdout.flush() \ No newline at end of file From dd0ebc5a8356e4be0e7a5a6484531199e16da866 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 Apr 2023 23:26:35 +0530 Subject: [PATCH 3/7] public IP --- ipdrone.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ipdrone.py b/ipdrone.py index 79698a8..5c9d381 100644 --- a/ipdrone.py +++ b/ipdrone.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +# NOTE: if you don't know your public ip use the publicIP.py script + # coded by N17RO (noob hackers) # modules required From 69ddb2dcf6f09d1ea172625d47ff84f70969603d Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 Apr 2023 23:29:47 +0530 Subject: [PATCH 4/7] public ip --- publicIP.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 publicIP.py 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 From cfc29859065ed519bb7e4c5b2c0feb0f551bb2f9 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 Apr 2023 23:32:24 +0530 Subject: [PATCH 5/7] fixed errors --- utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils.py b/utils.py index d66d4ac..beaa55a 100644 --- a/utils.py +++ b/utils.py @@ -33,12 +33,12 @@ def printBanner(): {CLEAR} """) -def printA(text): - print(LGREENb+ BOLD+ "[$]", text) +def printA(*text): + print(LGREEN + BOLD+ "[$]", *text) print(RED + "<--------------->" + RED) -def printB(text): - print(CYAN + BOLD + "[$]", text) +def printB(*text): + print(CYAN + BOLD + "[$]", *text) print(RED + "<--------------->" + RED) def terminate(): From 17c8fcf2e9c9e06153af76ab617f7dbe3f9437a5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Apr 2023 17:41:05 +0530 Subject: [PATCH 6/7] error message of invalid IP Addresses --- __pycache__/utils.cpython-39.pyc | Bin 0 -> 2052 bytes ipdrone.py | 12 ++++++++++-- requirements.txt | 2 ++ utils.py | 9 +-------- 4 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 __pycache__/utils.cpython-39.pyc create mode 100644 requirements.txt diff --git a/__pycache__/utils.cpython-39.pyc b/__pycache__/utils.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c6e529f12320b895b04043e4a1da7814d85d7034 GIT binary patch literal 2052 zcmb_d%}*0S6rbtNE@h#7X##=E9yDPS%ZDTy2@s()K&-`}31JI|(y36S-DY-br17SS zo{S_`5>4aBjd=9GnIoP&Ydm<-H`DI6*am}f+IjQdo43FBn>Ul0bR=RTXrG?V(RT(y zU!>98LSWp4?j=A_MDady5Dht)YEFm}N29t!sNv|e!!c;s>7boXn3}ZfDRMe#H;uq( z(jM9iV;AkC{V;Y@d>7dRUjY#%%Y(a|7pKR^bH!-7m>bKu`SCr^EsU4-k<`>=UJf^= zYQxohnT(_+lrd4Cx~8nD>-mg?Yi>PY#GrfAAUIIx_$^RZ67vw(1`*gACm=D`>o!rg zUX47#7#0jfjikV4>9dBAdGh+X{8x_ZO3n10)_J^t4XzwnmLJqMp&}AcI`p}{I;p&r zf1j1F{Hwne%13U{Ye`uy`i z>CA&H^DNtrM&Xmr0Npl(USzof7us5UQ5cD(wRk)!$iix3QRuNme11(B8}US9b^REz zPPmek_&K~dy$N)3g`Le@kutZC-7N9kzBg7p5M2szAzdhB*?_#shCv`qaOjunrtyPx zhrW}D@lB4b3uaGUgBToeZ=ogV-W3oWak%;h;ldk4JNPmBh}X~ygr#4j;Fp)6fAJk_ z$+DKZv{mkxC24MRHenK$=~BS6ffxaCj0NG@N4&8*CLb4JsAbGw2Hlf!2oGV_3*-Oe z%DMrr&PtHj#(c6ti$!3rJ*Nd5rW&03|KtQVk}qHkx+mWgj`r~T&xeG`}-wtw<(+2X;}t#5kyo1NkoK|ZAa9`3T^(*imD+C!(6Sd9a2-p?E_8d v>&q+m;%bjo@t9<*K-y&!;hDTkOZ(Y5xl!H_h_FU90*5E~Y2gcD5+=U^eYFh1 literal 0 HcmV?d00001 diff --git a/ipdrone.py b/ipdrone.py index 5c9d381..f6fa510 100644 --- a/ipdrone.py +++ b/ipdrone.py @@ -9,6 +9,7 @@ import argparse import requests, json from sys import argv +import ipaddress from utils import * @@ -22,6 +23,10 @@ # banner printBanner() +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() flush() @@ -37,7 +42,10 @@ printA("[Zip code]:", data['zip']) except KeyboardInterrupt: - terminate() + print('Terminating, Bye' + LGREEN) except requests.exceptions.ConnectionError as e: - error() + print(RED + "[~] check your internet connection!" + CLEAR) + +print(WHITE) + 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 index beaa55a..d252f43 100644 --- a/utils.py +++ b/utils.py @@ -12,6 +12,7 @@ CLEAR = '\033[0m' BOLD = '\033[01m' CYAN = '\033[96m' +WHITE = "\u001b[37m" # banner def printBanner(): @@ -41,13 +42,5 @@ def printB(*text): print(CYAN + BOLD + "[$]", *text) print(RED + "<--------------->" + RED) -def terminate(): - print('Terminating, Bye'+LGREEN) - sys.exit(0) - -def error(): - print(RED+"[~]"+" check your internet connection!"+CLEAR) - sys.exit(0) - def flush(): sys.stdout.flush() \ No newline at end of file From 11f5753349ef2cf251f26dad2c616fd7f30c1a76 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Apr 2023 17:43:26 +0530 Subject: [PATCH 7/7] valid ip address --- ipdrone.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipdrone.py b/ipdrone.py index f6fa510..787585f 100644 --- a/ipdrone.py +++ b/ipdrone.py @@ -42,10 +42,13 @@ printA("[Zip code]:", data['zip']) except KeyboardInterrupt: - print('Terminating, Bye' + LGREEN) + print(LGREEN + 'Terminating, Bye') except requests.exceptions.ConnectionError as e: print(RED + "[~] check your internet connection!" + CLEAR) +except ValueError: + print(RED + "[!] The Given IP Address does not seem to be valid") + print(WHITE)