· 5 years ago · Nov 29, 2020, 07:28 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 = "d6ec6b7a35577d527c05c0d3d05759eb" #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 ""
90 print color.YELLOW + "[+] " + color.END + "Information Output"
91 print "--------------------------------------"
92 print " - Phone number: " + str(number)
93 print " - Country: " + str(country_code)
94 print " - Country Name: " + str(country_name)
95 print " - Location: " + str(location)
96 print " - Carrier: " + str(carrier)
97 print " - Device: " + str(line_type)
98 else:
99 print "[?] Usage:"
100 print " ./%s <phone-number>" % (sys.argv[0])
101 print " ./%s +13213707446" % (sys.argv[0])
102
103main()
104