-
Notifications
You must be signed in to change notification settings - Fork 0
/
kharon.py
143 lines (128 loc) · 5.5 KB
/
kharon.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
from src.enum.web_enum import web_enum
from src.tool_check import get_list, check_if_exist
from src.scan_loop import is_scan_complete
from src.utils.ascii import get_ascii
from src.utils.colors import colors
import time
import os
import sys
""" Settings """
# terminal_type = "gnome" | set this var to your OS' terminal
terminal_type = "mate" # I'm on parrotsec thus I use mate-terminal
""" Settings """
intensity_lev = None
complete = False
n = 1
report_asking = True
def main():
global intensity_lev, complete, n, terminal_type, report_asking
display_menu()
list = get_list()
sys.stdout.write('\33]0;Kharon - CTF Website Scanner\a')
sys.stdout.flush()
for tool in list:
if check_if_exist(tool) == False:
display_menu()
addr = str(input("└──────⮞ IP-Address : "))
display_menu()
print("├─" + colors.FAIL + "⮞" + colors.WARNING + " IP-Address : {}".format(addr))
print("│")
intensity_lev = int(input("└──────⮞ Scan intensity (1-3) : "))
enum = web_enum(addr, intensity_lev, terminal_type)
os.system(f"mkdir ressources/output/{addr}-{intensity_lev}/")
enum.nmap_scan()
enum.ffuf_scan()
enum.nikto_scan()
while complete != True:
display_menu()
do_graphic_loop(addr)
scan = is_scan_complete(addr, intensity_lev)
if scan[0]:
complete = True
elif len(scan[1]) != 0 and len(scan[1]) < 3:
display_menu()
print("├─" + colors.FAIL + "⮞" + colors.WARNING + " IP-Address : {}".format(addr))
print("│")
print("├─" + colors.FAIL + "⮞" + colors.WARNING + " Scan intensity : {}".format(intensity_lev))
print("│")
print("├─" + colors.FAIL + "⮞" + colors.WARNING + " Scan still running...")
print("│")
report = input("└──────⮞ Choose report ({}, q) : ".format(", ".join(scan[1])))
if report in scan[1]:
display_menu()
print("├─" + colors.FAIL + "⮞" + colors.WARNING + " IP-Address : {}".format(addr))
print("│")
print("├─" + colors.FAIL + "⮞" + colors.WARNING + " Scan intensity : {}".format(intensity_lev))
print("│")
print("├─" + colors.FAIL + "⮞" + colors.WARNING + " App report : {}".format(report))
print("│")
file = open(f"ressources/output/{addr}-{intensity_lev}/{report}.txt", "r")
for file_line in file.readlines():
print("│ " + file_line, end='')
file.close()
print("│")
quit = input("└──────⮞ Press (q) to quit : ")
continue
elif report == 'q':
print("")
print(colors.FAIL + "💀" + colors.WARNING + " Closing Kharon... Bye !")
report_asking = False
else:
continue
elif len(scan[1]) == 3:
break
time.sleep(1)
while report_asking:
display_menu()
print("├─" + colors.FAIL + "⮞" + colors.WARNING + " IP-Address : {}".format(addr))
print("│")
print("├─" + colors.FAIL + "⮞" + colors.WARNING + " Scan intensity : {}".format(intensity_lev))
print("│")
report = input("└──────⮞ Choose report (nmap, ffuf, nikto, q) : ")
if report in ("nmap", "ffuf", "nikto"):
display_menu()
print("├─" + colors.FAIL + "⮞" + colors.WARNING + " IP-Address : {}".format(addr))
print("│")
print("├─" + colors.FAIL + "⮞" + colors.WARNING + " Scan intensity : {}".format(intensity_lev))
print("│")
print("├─" + colors.FAIL + "⮞" + colors.WARNING + " App report : {}".format(report))
print("│")
file = open(f"ressources/output/{addr}-{intensity_lev}/{report}.txt", "r")
for file_line in file.readlines():
print("│ " + file_line, end='')
file.close()
print("│")
quit = input("└──────⮞ Press (q) to quit : ")
elif report == 'q':
print("")
print(colors.FAIL + "💀" + colors.WARNING + " Closing Kharon... Bye !")
report_asking = False
else:
continue
def display_menu():
os.system("clear")
print(colors.FAIL+ "💀" + colors.WARNING + " Starting Kharon...")
print(colors.OKORANGE + get_ascii())
print(colors.FAIL + "💀" + colors.WARNING + " Basic & automated Web-Server CTF enumeration.")
print("┌──────────────────────────────────────────────────")
print("│")
def do_graphic_loop(addr):
global intensity_lev, n
print("├─" + colors.FAIL + "⮞" + colors.WARNING + " IP-Address : {}".format(addr))
print("│")
print("├─" + colors.FAIL + "⮞" + colors.WARNING + " Scan intensity : {}".format(intensity_lev))
print("│")
if n == 1:
print("└──────⮞ Scan Started ...")
n += 1
elif n == 2:
print("└──────⮞ Scan Started #..")
n += 1
elif n == 3:
print("└──────⮞ Scan Started .#.")
n += 1
elif n == 4:
print("└──────⮞ Scan Started ..#")
n = 1
if __name__ == "__main__":
main()