34 |
35 | formats = li.text.strip()
36 | possible_formats.append(formats) # added all formats
37 |
38 | print(f"{utils.Green}[{utils.Yellow}~{utils.Green}] {utils.White}Possible phone number formats :\n")
39 | for formats in possible_formats:
40 | print(f"[{utils.Green}+{utils.White}] " + formats)
41 |
42 | except:
43 | return None
--------------------------------------------------------------------------------
/core/modules/lookup.py:
--------------------------------------------------------------------------------
1 | import re
2 | import phonenumbers
3 | from phonenumbers import carrier, timezone, geocoder
4 |
5 | import utils
6 |
7 | class Look:
8 | def __init__(self, phone):
9 |
10 | try:
11 | self.phone_number = phone
12 |
13 | # checking with phonenumbers
14 | numbers = phonenumbers.parse(phone)
15 | valid = phonenumbers.is_valid_number(numbers)
16 | timezones = timezone.time_zones_for_number(numbers)
17 | carriers = carrier.name_for_number(numbers, None)
18 | country = geocoder.description_for_number(numbers, 'fr')
19 | international = phonenumbers.format_number(numbers, phonenumbers.PhoneNumberFormat.INTERNATIONAL)
20 | national = phonenumbers.format_number(numbers, phonenumbers.PhoneNumberFormat.NATIONAL)
21 | prefix = phonenumbers.format_number(numbers, phonenumbers.PhoneNumberFormat.INTERNATIONAL).split(" ")[0]
22 | country_code = phonenumbers.region_code_for_country_code(int(prefix))
23 |
24 | # checing surcharged or not
25 | taxed = phone.replace("+33", "")
26 | if re.match(r"^8\d{8}$", taxed) or re.match(r"^0 8\d{8}$", taxed):
27 | taxed = f"[{utils.Yellow}?{utils.White}] Phone number certainly surcharged"
28 |
29 | elif re.match(r"^9\d{8}$", taxed) or re.match(r"^0 9\d{8}$", taxed):
30 | taxed = f"[{utils.Red}!{utils.White}] Phone number surcharged"
31 |
32 | else:
33 | taxed = f"[{utils.Green}*{utils.White}] Phone number not surcharged"
34 |
35 |
36 | # checking mobile or line
37 | mobile = phonenumbers.number_type(numbers)
38 |
39 | if mobile == phonenumbers.PhoneNumberType.MOBILE:
40 | types = f"[{utils.Green}*{utils.White}] Type {utils.Green}->{utils.White} Mobile"
41 |
42 | else:
43 | types = f"[{utils.Green}*{utils.White}] Type {utils.Green}->{utils.White} Line fixed "
44 |
45 | print(f"""
46 | {utils.Green}> {utils.White}LookUp{utils.Green}
47 | ---------------------------------------------------{utils.White}
48 |
49 | [{utils.Green}*{utils.White}] Valid {utils.Green}->{utils.White} {valid}
50 | {types}
51 | {taxed}
52 |
53 | [{utils.Green}+{utils.White}] International phone number {utils.Green}->{utils.White} {international}
54 | [{utils.Green}+{utils.White}] National phone number {utils.Green}->{utils.White} {national}
55 | [{utils.Green}+{utils.White}] Country prefix {utils.Green}->{utils.White} {prefix}
56 | [{utils.Green}+{utils.White}] Country code {utils.Green}->{utils.White} {country_code}
57 | [{utils.Green}+{utils.White}] Country {utils.Green}->{utils.White} {country}
58 | [{utils.Green}+{utils.White}] TimeZone {utils.Green}->{utils.White} {timezones}
59 | [{utils.Green}+{utils.White}] Carrier {utils.Green}->{utils.White} {carriers}
60 | """)
61 |
62 | except:
63 | return None
64 |
--------------------------------------------------------------------------------
/core/modules/reputation.py:
--------------------------------------------------------------------------------
1 | from bs4 import BeautifulSoup
2 | import requests
3 |
4 |
5 | import utils
6 |
7 |
8 | class Main:
9 |
10 | def __init__(self, phone):
11 |
12 | """
13 | Multi-step function :
14 |
15 | -> scrape the html code of the site
16 | -> look for the 1st tag that has the class: "col-lg-9"
17 | -> retrieve the
tag
18 | -> put in text and display in strip()
19 | """
20 |
21 | try:
22 | self.phone_numbers = phone
23 |
24 | response = requests.get(utils.tellows(phone=phone), headers=utils.headers)
25 |
26 | html = BeautifulSoup(response.text, "html.parser")
27 | html_cs = html.find("div", {"class": "col-lg-9"}).findAll("h1")
28 |
29 |
30 | try:
31 | infos = html_cs[0].text.strip()
32 | info = f"[{utils.Green}+{utils.White}] Phone number reputed for {utils.Green}->{utils.White} {infos}"
33 |
34 | except:
35 | info = f"[{utils.Red}-{utils.White}] Phone number not reputation"
36 |
37 | print(f"""
38 | \n{utils.Green}> {utils.White}Reputation{utils.Green}
39 | ---------------------------------------------------{utils.White}
40 |
41 | {info}
42 | """)
43 |
44 | except:
45 | return None
--------------------------------------------------------------------------------
/core/utils.py:
--------------------------------------------------------------------------------
1 | from colorama import *
2 |
3 | """
4 | Here you will find everything used to make the tool work properly like :
5 | - All colors
6 | - Logo in ascii art
7 | - Website used
8 | - Headers
9 | """
10 |
11 |
12 |
13 |
14 | # List all colors used
15 | """
16 | Colors palette used -> https://www.webucator.com/article/python-color-constants-module/
17 | Color rgb example (205,102,0) => Functional rgb color in python scripts example (\033[38;2;205;102;0m)
18 | """
19 |
20 |
21 | Red = Fore.RED
22 | White = Fore.WHITE
23 | Green = Fore.GREEN
24 | Black = Fore.BLACK
25 | Yellow = Fore.YELLOW
26 |
27 |
28 | # Banner
29 | """
30 | Logo used in ascii art
31 | """
32 | Banner = f"""
33 | (@@@@@@@@@@@@@@@@@@@@@)
34 | (@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
35 | (@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
36 | (@@@@@@@@@@@@@@@@@@@@%%%%%@@@@@@@@@@@@@@@@@@@@)
37 | (@@@@@@@@@@@@@@@@@@@@@%%%%%%%%%@@@@@@@@@@@@@@@@@@@@@)
38 | (@@@@@@@@@@@@@@@@@@@@@@@%%%%/-\%%%%%@@@@@@@@@@@@@@@@@@@@@@) By Norze (@N0rz3)
39 | (@@@@@@@@@@@@@@@@@@@@@@@%%%%\-/%%%%%@@@@@@@@@@@@@@@@@@@@@@) Inspect{Red}0{White}r v1.1
40 | (@@@@@@@@@@@@@@@@@@@@@%%%%%%%%%@@@@@@@@@@@@@@@@@@@@@)
41 | (@@@@@@@@@@@@@@@@@@@@%%%%%@@@@@@@@@@@@@@@@@@@@)
42 | (@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
43 | (@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
44 | (@@@@@@@@@@@@@@@@@@@@@)
45 |
46 |
47 | """.replace("(", Black + "(" + White).replace(")", Black + ")" + White).replace("@", White + "@").replace("%", Red + "%" + White).replace("/", Black + "/" + White).replace("\\", Black + "\\" + White).replace("-", Black + "-" + White)
48 |
49 |
50 | # website for the different variations of phone number
51 | def free_lookup(phone) -> None:
52 | url = "https://free-lookup.net/{}".format(phone)
53 |
54 | return url
55 |
56 | def tellows(phone) -> None:
57 | url = "https://www.tellows.fr/num/{}".format(phone)
58 |
59 | return url
60 |
61 |
62 | # headers for requests
63 | headers = {
64 | "User-Agent": "Mozilla/4.0 (compatible; MSIE 5.0; SunOS 5.9 sun4u; X11)"
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | argparse
2 | phonenumbers
3 | tqdm
4 | bs4
5 | requests
6 | trio
7 | httpx
8 | ignorant
9 | colorama
10 |
--------------------------------------------------------------------------------