· 6 years ago · Dec 26, 2019, 02:32 PM
1#!/usr/bin/python
2# -*- coding: utf-8 -*-
3import sys
4import requests
5import json
6import time
7import urllib
8import os
9
10class color:
11 PURPLE = '\033[95m'
12 CYAN = '\033[96m'
13 DARKCYAN = '\033[36m'
14 BLUE = '\033[94m'
15 GREEN = '\033[92m'
16 YELLOW = '\033[93m'
17 RED = '\033[91m'
18 BOLD = '\033[1m'
19 UNDERLINE = '\033[4m'
20 END = '\033[0m'
21 HEADER = '\033[95m'
22 OKBLUE = '\033[94m'
23 OKGREEN = '\033[92m'
24 WARNING = '\033[93m'
25 FAIL = '\033[91m'
26
27class config:
28 key = "" #go to https://numverify.com/
29
30def banner():
31 os.system('clear')
32 print(color.YELLOW + """
33███████╗██╗██████╗ ███████╗███████╗██╗ ██╗ ██╗
34██╔════╝██║██╔══██╗██╔════╝██╔════╝██║ ╚██╗ ██╔╝
35█████╗ ██║██████╔╝█████╗ █████╗ ██║ ╚████╔╝
36██╔══╝ ██║██╔══██╗██╔══╝ ██╔══╝ ██║ ╚██╔╝
37██║ ██║██║ ██║███████╗██║ ███████╗██║
38╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚══════╝╚═╝
39 Version - dev-1.0
40 """ + color.END)
41
42def main():
43 banner()
44 if len(sys.argv) == 2:
45 number = sys.argv[1]
46 api = "http://apilayer.net/api/validate?access_key=" + config.key + "&number=" + number + "&country_code=&format=1"
47 output = requests.get(api)
48 content = output.text
49 obj = json.loads(content)
50 country_code = obj['country_code']
51 country_name = obj['country_name']
52 location = obj['location']
53 carrier = obj['carrier']
54 line_type = obj['line_type']
55
56 print(color.YELLOW + "[+] " + color.END + "Phone number information gathering")
57 print ("--------------------------------------")
58 time.sleep(0.2)
59
60 if country_code == "":
61 print(" - Getting Country [ " + color.RED + "FAILED " + color.END + "]")
62 else:
63 print(" - Getting Country [ " + color.GREEN + "OK " + color.END + "]")
64
65 time.sleep(0.2)
66 if country_name == "":
67 print(" - Getting Country Name [ " + color.RED + "FAILED " + color.END + "]")
68 else:
69 print(" - Getting Country Name [ " + color.GREEN + "OK " + color.END + "]")
70
71 time.sleep(0.2)
72 if location == "":
73 print(" - Getting Location [ " + color.RED + "FAILED " + color.END + "]")
74 else:
75 print(" - Getting Location [ " + color.GREEN + "OK " + color.END + "]")
76
77 time.sleep(0.2)
78 if carrier == "":
79 print(" - Getting Carrier [ " + color.RED + "FAILED " + color.END + "]")
80 else:
81 print(" - Getting Carrier [ " + color.GREEN + "OK " + color.END + "]")
82
83 time.sleep(0.2)
84 if line_type == None:
85 print(" - Getting Device [ " + color.RED + "FAILED " + color.END + "]")
86 else:
87 print(" - Getting Device [ " + color.GREEN + "OK " + color.END + "]")
88
89 print(color.YELLOW + "[+] " + color.END + "Information Output")
90 print("--------------------------------------")
91 print(" - Phone number: " + str(number))
92 print(" - Country: " + str(country_code))
93 print(" - Country Name: " + str(country_name))
94 print(" - Location: " + str(location))
95 print(" - Carrier: " + str(carrier))
96 print(" - Device: " + str(line_type))
97 else:
98 print("[?] Usage:")
99 print(" ./%s <phone-number>" % (sys.argv[0]))
100 print(" ./%s +13213707446" % (sys.argv[0]))
101
102main()