forked from sundowndev/phoneinfoga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
output.py
87 lines (65 loc) · 1.86 KB
/
output.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
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
# @name : PhoneInfoga - Phone numbers OSINT tool
# @url : https://github.com/sundowndev
# @author : Raphael Cerveaux (sundowndev)
import sys
import json
from lib.colors import *
from lib.args import args
from lib.logger import Logger
def plus(string):
if not args.no_ansi and not args.output:
print("%s[+] %s%s" % (G % 0, string, E))
else:
print("[+] %s" % (string))
def warn(string):
if not args.no_ansi and not args.output:
print("%s(!) %s%s" % (Y % 0, string, E))
else:
print("(!) %s" % (string))
def error(string):
if not args.no_ansi and not args.output:
print("%s[!]%s %s%s" % (R % 0, E, string, E))
else:
print("[!] %s" % (string))
def test(string):
if not args.no_ansi and not args.output:
print("%s[*] %s%s" % (B % 0, string, E))
else:
print("[*] %s" % (string))
def info(string):
if not args.no_ansi and not args.output:
print("%s[i] %s%s" % (E, string, E))
else:
print("[i] %s" % (string))
def more(string):
if not args.no_ansi and not args.output:
print(" %s|%s %s%s" % (W % 0, string, E))
else:
print(" | %s" % (string))
def title(string):
if not args.no_ansi and not args.output:
print("%s%s%s%s" % (BOLD, Y % 0, string, E))
else:
print("%s" % (string))
def throw(string):
error(string)
sys.exit()
def askForExit():
if not args.output:
user_input = ask('Continue scanning ? (y/N) ')
if user_input.lower() == 'y' or user_input.lower() == 'yes':
return -1
else:
info("Good bye!")
sys.exit()
def ask(text):
if args.output:
sys.stdout = sys.__stdout__
res = input(text)
sys.stdout = Logger()
return res
else:
return input(text)