forked from sundowndev/phoneinfoga
-
Notifications
You must be signed in to change notification settings - Fork 8
/
phoneinfoga.py
95 lines (72 loc) · 2.15 KB
/
phoneinfoga.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
# @name : PhoneInfoga - Phone numbers OSINT tool
# @url : https://github.com/sundowndev
# @author : Raphael Cerveaux (sundowndev)
# dependencies
import sys
import signal
# lib
from lib.args import args,parser
from lib.banner import banner, __version__
from lib.output import *
from lib.format import *
from lib.logger import Logger
from lib.googlesearch import closeBrowser
# scanners
from scanners import numverify
from scanners import localscan
from scanners import ovh
from scanners.footprints import osintScan
from scanners import recon
def scanNumber(InputNumber):
title("[!] ---- Fetching informations for {} ---- [!]".format(formatNumber(InputNumber)))
number = localscan.scan(InputNumber)
if not number:
throw(("Error: an error occured parsing {}. Skipping.".format(
formatNumber(InputNumber))))
numverify.scan(number['default'])
ovh.scan(number['local'], number['countryIsoCode'])
recon.scan(number)
osintScan(number)
info("Scan finished.\n")
def main():
scanners = ['any', 'all', 'numverify', 'ovh', 'footprints']
banner()
# Ensure the usage of Python3
if sys.version_info[0] < 3:
print(
"(!) Please run the tool using Python 3")
sys.exit()
# If any param is passed, execute help command
if not len(sys.argv) > 1:
parser.print_help()
sys.exit()
elif args.version:
print("Version {}".format(__version__))
sys.exit()
if args.output:
sys.stdout = Logger()
# Verify scanner option
if not args.scanner in scanners:
print(("Error: scanner doesn't exists."))
sys.exit()
if args.number:
scanNumber(args.number)
elif args.input:
for line in args.input.readlines():
scanNumber(line)
else:
parser.print_help()
sys.exit()
if args.output:
args.output.close()
closeBrowser()
def signal_handler(signal, frame):
print('\n[-] You pressed Ctrl+C! Exiting.')
closeBrowser()
sys.exit()
if __name__ == '__main__':
signal.signal(signal.SIGINT, signal_handler)
main()