From 268787dce8d2294fef0a023b955f9798c3de0422 Mon Sep 17 00:00:00 2001 From: sundowndev Date: Fri, 14 Dec 2018 12:57:55 +0100 Subject: [PATCH 1/7] [Fix #11] Fix OpenSSL bug & colorama --- phoneinfoga.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/phoneinfoga.py b/phoneinfoga.py index 587a56c..7276ef6 100644 --- a/phoneinfoga.py +++ b/phoneinfoga.py @@ -13,7 +13,9 @@ def banner(): print(" Coded by Sundowndev") print("\n") -print("\n \033[92m") +from colorama import Fore, Style + +print("\n " + Fore.GREEN + Style.NORMAL) banner() import sys @@ -59,6 +61,7 @@ try: import json import re import requests + import urllib3 from bs4 import BeautifulSoup import html5lib import phonenumbers @@ -72,6 +75,14 @@ except: print('\033[91m[!] Missing requirements. Try running pip install -r requirements.txt') sys.exit() +requests.packages.urllib3.disable_warnings() +requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS += 'HIGH:!DH:!aNULL' +try: + requests.packages.urllib3.contrib.pyopenssl.DEFAULT_SSL_CIPHER_LIST += 'HIGH:!DH:!aNULL' +except AttributeError: + # no pyopenssl support used / needed / available + pass + if args.update: def download_file(url, target_path): response = requests.get(url, stream=True) @@ -512,7 +523,7 @@ def scanNumber(InputNumber): print(code_info + "Scan finished.") - print('\n') + print('\n' + Style.RESET_ALL) try: if args.output: @@ -529,11 +540,11 @@ try: sys.stdout = args.output banner() else: - code_info = '\033[97m[*] ' - code_warning = '\033[93m(!) ' - code_result = '\033[1;32m[+] ' - code_error = '\033[91m[!] ' - code_title = '\033[1m\033[93m' + code_info = Fore.RESET + Style.BRIGHT + '[*] ' + code_warning = Fore.YELLOW + Style.BRIGHT + '(!) ' + code_result = Fore.GREEN + Style.BRIGHT + '[+] ' + code_error = Fore.RED + Style.BRIGHT + '[!] ' + code_title = Fore.YELLOW + Style.BRIGHT # Verify scanner option if not args.scanner in scanners: From 79c89e2dd7ee5151e1db54849ea9e02d049e2f13 Mon Sep 17 00:00:00 2001 From: sundowndev Date: Fri, 14 Dec 2018 12:58:20 +0100 Subject: [PATCH 2/7] Requirements --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirements.txt b/requirements.txt index 7969552..c99f0c1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,5 @@ bs4 html5lib phonenumbers argparse +urllib3 +colorama From c7029aca687f401d3e3e8269a781970a8f0e685a Mon Sep 17 00:00:00 2001 From: sundowndev Date: Fri, 14 Dec 2018 12:58:34 +0100 Subject: [PATCH 3/7] README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0f2934b..f553061 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Use `any` to disable this feature. Default value: `all` ```bash git clone https://github.com/sundowndev/PhoneInfoga cd ./PhoneInfoga -pip3 install -r requirements.txt +python3 -m pip install -r requirements.txt ``` ## Usage From 89e1b2b7f1b8a80bab9a710942114c02162d3da8 Mon Sep 17 00:00:00 2001 From: sundowndev Date: Fri, 14 Dec 2018 14:44:58 +0100 Subject: [PATCH 4/7] Reset colors at exit --- phoneinfoga.py | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/phoneinfoga.py b/phoneinfoga.py index 7276ef6..47d6a7b 100644 --- a/phoneinfoga.py +++ b/phoneinfoga.py @@ -1,6 +1,22 @@ #!/usr/bin/env python3 -__version__ = '1.0.0-rc1' +__version__ = 'v1.0.0-rc2' + +try: + from colorama import Fore, Style + import atexit + import sys + import argparse + import random +except KeyboardInterrupt: + print('\033[91m[!] Exiting.') + sys.exit() +except: + print('\033[91m[!] Missing requirements. Try running python3 -m pip install -r requirements.txt') + sys.exit() + +# Reset text color at exit +atexit.register(lambda: print(Style.RESET_ALL)) def banner(): print(" ___ _ _____ __ ") @@ -11,17 +27,11 @@ def banner(): print(" |___/ ") print(" PhoneInfoga Ver. {}".format(__version__)) print(" Coded by Sundowndev") - print("\n") + print("\n" + Style.RESET_ALL) -from colorama import Fore, Style - -print("\n " + Fore.GREEN + Style.NORMAL) +print("\n " + Fore.WHITE + Style.NORMAL) banner() -import sys -import argparse -import random - if sys.version_info[0] < 3: print("\033[1m\033[93m(!) Please run the tool using Python 3") sys.exit() @@ -72,7 +82,7 @@ except KeyboardInterrupt: print('\033[91m[!] Exiting.') sys.exit() except: - print('\033[91m[!] Missing requirements. Try running pip install -r requirements.txt') + print('\033[91m[!] Missing requirements. Try running python3 -m pip install -r requirements.txt') sys.exit() requests.packages.urllib3.disable_warnings() From 76eb594566ce7d9a7aaa1bd59bfea436e5d888a0 Mon Sep 17 00:00:00 2001 From: sundowndev Date: Fri, 14 Dec 2018 14:56:23 +0100 Subject: [PATCH 5/7] Fix: bug using output option --- phoneinfoga.py | 10 +++++++--- re.txt | 23 +++++++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 re.txt diff --git a/phoneinfoga.py b/phoneinfoga.py index 47d6a7b..0c379bb 100644 --- a/phoneinfoga.py +++ b/phoneinfoga.py @@ -15,9 +15,6 @@ except: print('\033[91m[!] Missing requirements. Try running python3 -m pip install -r requirements.txt') sys.exit() -# Reset text color at exit -atexit.register(lambda: print(Style.RESET_ALL)) - def banner(): print(" ___ _ _____ __ ") print(" / _ \ |__ ___ _ __ ___ \_ \_ __ / _| ___ __ _ __ _ ") @@ -60,6 +57,13 @@ parser.add_argument('-u', '--update', action='store_true', args = parser.parse_args() +def resetColors(): + if not args.output: + print(Style.RESET_ALL) + +# Reset text color at exit +atexit.register(resetColors) + # If any param is passed, execute help command if not len(sys.argv) > 1: parser.print_help() diff --git a/re.txt b/re.txt new file mode 100644 index 0000000..3df1c9e --- /dev/null +++ b/re.txt @@ -0,0 +1,23 @@ + ___ _ _____ __ + / _ \ |__ ___ _ __ ___ \_ \_ __ / _| ___ __ _ __ _ + / /_)/ '_ \ / _ \| '_ \ / _ \ / /\/ '_ \| |_ / _ \ / _` |/ _` | + / ___/| | | | (_) | | | | __/\/ /_ | | | | _| (_) | (_| | (_| | + \/ |_| |_|\___/|_| |_|\___\____/ |_| |_|_| \___/ \__, |\__,_| + |___/ + PhoneInfoga Ver. v1.0.0-rc2 + Coded by Sundowndev + + +[!] ---- Fetching informations for 33651968838 ---- [!] +[*] Running local scan... +[+] International format: +33 6 51 96 88 38 +[+] Local format: 0651968838 +[+] Country code: +33 +[+] Location: France +[+] Carrier: +[+] Area: France +[+] Timezone: Europe/Paris +[*] The number is valid and possible. +[*] Scan finished. + + From b51d475695d59081535f57e63d1814049ca9b786 Mon Sep 17 00:00:00 2001 From: sundowndev Date: Fri, 14 Dec 2018 14:59:08 +0100 Subject: [PATCH 6/7] Delete useless debug file --- re.txt | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 re.txt diff --git a/re.txt b/re.txt deleted file mode 100644 index 3df1c9e..0000000 --- a/re.txt +++ /dev/null @@ -1,23 +0,0 @@ - ___ _ _____ __ - / _ \ |__ ___ _ __ ___ \_ \_ __ / _| ___ __ _ __ _ - / /_)/ '_ \ / _ \| '_ \ / _ \ / /\/ '_ \| |_ / _ \ / _` |/ _` | - / ___/| | | | (_) | | | | __/\/ /_ | | | | _| (_) | (_| | (_| | - \/ |_| |_|\___/|_| |_|\___\____/ |_| |_|_| \___/ \__, |\__,_| - |___/ - PhoneInfoga Ver. v1.0.0-rc2 - Coded by Sundowndev - - -[!] ---- Fetching informations for 33651968838 ---- [!] -[*] Running local scan... -[+] International format: +33 6 51 96 88 38 -[+] Local format: 0651968838 -[+] Country code: +33 -[+] Location: France -[+] Carrier: -[+] Area: France -[+] Timezone: Europe/Paris -[*] The number is valid and possible. -[*] Scan finished. - - From 4e5994347cfec0852203cd5f2ee547418e438a05 Mon Sep 17 00:00:00 2001 From: sundowndev Date: Fri, 14 Dec 2018 15:07:14 +0100 Subject: [PATCH 7/7] Remove exception text colors to avoid bugs --- phoneinfoga.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/phoneinfoga.py b/phoneinfoga.py index 0c379bb..ac5a103 100644 --- a/phoneinfoga.py +++ b/phoneinfoga.py @@ -9,10 +9,10 @@ try: import argparse import random except KeyboardInterrupt: - print('\033[91m[!] Exiting.') + print('[!] Exiting.') sys.exit() except: - print('\033[91m[!] Missing requirements. Try running python3 -m pip install -r requirements.txt') + print('[!] Missing requirements. Try running python3 -m pip install -r requirements.txt') sys.exit() def banner(): @@ -24,13 +24,12 @@ def banner(): print(" |___/ ") print(" PhoneInfoga Ver. {}".format(__version__)) print(" Coded by Sundowndev") - print("\n" + Style.RESET_ALL) + print("\n") -print("\n " + Fore.WHITE + Style.NORMAL) banner() if sys.version_info[0] < 3: - print("\033[1m\033[93m(!) Please run the tool using Python 3") + print("\033[1m\033[93m(!) Please run the tool using Python 3" + Style.RESET_ALL) sys.exit() parser = argparse.ArgumentParser(description=