-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathphonia.py
122 lines (94 loc) · 3.35 KB
/
phonia.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/usr/bin/env python3
# MIT License
# Copyright (C) 2019, Entynetproject. All Rights Reserved.
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# dependencies
import sys
import signal
import os
import time
# 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):
os.system("clear")
os.system("cat banner/banner.txt")
print("")
time.sleep(3)
title("[!] ---- Fetching informations for {} ---- [!]".format(formatNumber(InputNumber)))
time.sleep(5)
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']
if args.update:
os.system("cd ~ && chmod +x phonia/bin/phonia && phonia/bin/phonia -u")
sys.exit()
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.info:
os.system("cat banner/banner1.txt")
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()