Keyboard interrupt exception
This commit is contained in:
parent
9dc719804f
commit
d7cc63a025
|
@ -15,7 +15,6 @@ def banner():
|
||||||
|
|
||||||
print "\n \033[92m"
|
print "\n \033[92m"
|
||||||
banner()
|
banner()
|
||||||
print "\033[94m"
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
|
@ -53,12 +52,11 @@ if args.update:
|
||||||
print 'update'
|
print 'update'
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
try:
|
||||||
import time
|
import time
|
||||||
import hashlib
|
import hashlib
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
|
|
||||||
try:
|
|
||||||
import requests
|
import requests
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
import html5lib
|
import html5lib
|
||||||
|
@ -67,8 +65,12 @@ try:
|
||||||
from phonenumbers import geocoder
|
from phonenumbers import geocoder
|
||||||
from phonenumbers import timezone
|
from phonenumbers import timezone
|
||||||
from googlesearch import search
|
from googlesearch import search
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print '\033[91m[!] Exiting.'
|
||||||
|
sys.exit()
|
||||||
except:
|
except:
|
||||||
print code_error + 'Missing requirements. Try running pip install -r requirements.txt'
|
print '\033[91m[!] Missing requirements. Try running pip install -r requirements.txt'
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
scanners = ['any', 'all', 'numverify', 'ovh']
|
scanners = ['any', 'all', 'numverify', 'ovh']
|
||||||
|
|
||||||
|
@ -205,7 +207,6 @@ def osintScan(countryCode, number, internationalNumber):
|
||||||
if not args.osint:
|
if not args.osint:
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
|
|
||||||
print code_info + 'Running OSINT footprint reconnaissance...'
|
print code_info + 'Running OSINT footprint reconnaissance...'
|
||||||
|
|
||||||
# Whitepages
|
# Whitepages
|
||||||
|
@ -305,9 +306,9 @@ def osintScan(countryCode, number, internationalNumber):
|
||||||
|
|
||||||
def askForExit():
|
def askForExit():
|
||||||
if not args.output:
|
if not args.output:
|
||||||
user_input = raw_input(code_info + "Continue scanning ? (Y/n): ")
|
user_input = raw_input(code_info + "Continue scanning ? (Y/n) ")
|
||||||
|
|
||||||
if user_input.lower() == 'n':
|
if user_input.lower() == 'n' or user_input.lower() == 'no':
|
||||||
print code_info + "Good bye!"
|
print code_info + "Good bye!"
|
||||||
sys.exit()
|
sys.exit()
|
||||||
else:
|
else:
|
||||||
|
@ -328,11 +329,7 @@ def scanNumber(number):
|
||||||
|
|
||||||
print '\n'
|
print '\n'
|
||||||
|
|
||||||
# Verify scanner option
|
try:
|
||||||
if not args.scanner in scanners:
|
|
||||||
print(code_error + "Error: scanner doesn't exists.")
|
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
if args.output:
|
if args.output:
|
||||||
code_info = '[*] '
|
code_info = '[*] '
|
||||||
code_warning = '(!) '
|
code_warning = '(!) '
|
||||||
|
@ -349,6 +346,11 @@ else:
|
||||||
code_error = '\033[91m[!] '
|
code_error = '\033[91m[!] '
|
||||||
code_title = '\033[1m\033[93m'
|
code_title = '\033[1m\033[93m'
|
||||||
|
|
||||||
|
# Verify scanner option
|
||||||
|
if not args.scanner in scanners:
|
||||||
|
print(code_error + "Error: scanner doesn't exists.")
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
if args.number:
|
if args.number:
|
||||||
scanNumber(args.number)
|
scanNumber(args.number)
|
||||||
elif args.input:
|
elif args.input:
|
||||||
|
@ -357,3 +359,6 @@ elif args.input:
|
||||||
|
|
||||||
if args.output:
|
if args.output:
|
||||||
args.output.close()
|
args.output.close()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print code_info + "Scan interrupted. Good bye!"
|
||||||
|
sys.exit()
|
||||||
|
|
Loading…
Reference in New Issue