-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathp4p-toolkit.py
More file actions
176 lines (114 loc) · 4.45 KB
/
p4p-toolkit.py
File metadata and controls
176 lines (114 loc) · 4.45 KB
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# @AUTHOR: 4N4NRCH0
# This toolkit contains any code of the mentioned THM room as fully automated python application.
# The code demonstrates the automation of python code snippets to make tasks and procedures more efficient.
# In a security engagement it can be a big advantage to prepare useful scripts all together in one toolkit.
# This application is a demonstration, based on the "Python for Pentesters" room.
import os
import sys
import pyfiglet
from colorama import init, Fore, Back
def banner(titel):
init()
print(Fore.RED+"*"*65+Fore.RESET)
print(17*"-"+"\tCREATED BY 4N4RCH0\t"+"-"*17)
print(Back.BLACK+Fore.RED+pyfiglet.figlet_format(titel, font="avatar")+Back.RESET+Fore.RESET)
print(Fore.RED+"*"*65+Fore.RESET)
class Webattacks:
def __init__(self):
pass
def subdir_enumerate(self):
target_domain = input("[?] Enter target domain: ")
os.system(f"python sub3num.py {target_domain}")
def directory_enumerate(self):
target_domain = input("[?] Enter target domain: ")
os.system(f"python dir3num.py {target_domain}")
def download_file(self):
os.system(f"python downloader.py")
class Networkattacks:
def __init__(self):
pass
def arp_scan(self):
os.system("python 4rpsc4n.py")
def port_scan(self):
os.system("python p0rtsc4n.py")
class Passwordattacks:
def __init__(self):
pass
def hash_crack(self):
os.system("python h4shcr4ck.py")
def ssh_brute_force(self):
os.system("python ssh_cr4ck3r.py")
class Postexploitation:
def __init__(self):
pass
def key_log(self):
os.system("python k3yl0g.py")
class p4p_menu:
def __init__(self):
pass
def user_menu(self):
menu_sections = ["Webattacks", "Networkattacks", "Passwordattacks", "Postexploitation", "Exit"]
for n in range(0, len(menu_sections)):
print(f"[{str(n+1)}] {menu_sections[n]}")
user_input = input("[ > ] ")
tools_menu = menu_sections[int(user_input)-1]
os.system("cls")
banner(" P4P-Toolkit ")
if tools_menu == "Webattacks":
webattack_toolbelt = ["sub3num", "dir3num", "downloader"]
for n in range(0, len(webattack_toolbelt)):
print(f"[{str(n+1)}] {webattack_toolbelt[n]}")
tool_input = input("[ > ] ")
if tool_input == "1":
os.system("cls")
Webattacks().subdir_enumerate()
if tool_input == "2":
os.system("cls")
Webattacks().directory_enumerate()
if tool_input == "3":
os.system("cls")
Webattacks().download_file()
if tools_menu == "Networkattacks":
networkattack_toolbelt = ["4rpsc4n", "p0rtsc4n"]
for n in range(0, len(networkattack_toolbelt)):
print(f"[{str(n+1)}] {networkattack_toolbelt[n]}")
tool_input = input("[ > ] ")
if tool_input == "1":
os.system("cls")
Networkattacks().arp_scan()
if tool_input == "2":
os.system("cls")
Networkattacks().port_scan()
if tools_menu == "Passwordattacks":
passwordattack_toolbelt = ["h4shcr4ck", "ssh_cr4ck3r"]
for n in range(0, len(passwordattack_toolbelt)):
print(f"[{str(n+1)}] {passwordattack_toolbelt[n]}")
tool_input = input("[ > ] ")
if tool_input == "1":
os.system("cls")
Passwordattacks().hash_crack()
if tool_input == "2":
os.system("cls")
Passwordattacks().ssh_brute_force()
if tools_menu == "Postexploitation":
postexploit_toolbelt = ["k3yl0g"]
for n in range(0, len(postexploit_toolbelt)):
print(f"[{str(n+1)}] {postexploit_toolbelt[n]}")
tool_input = input("[ > ] ")
if tool_input == "1":
os.system("cls")
Postexploitation().key_log()
if tools_menu == "Exit":
sys.exit()
def main():
os.system("cls")
try:
banner(" P4P-Toolkit ")
p4p_menu().user_menu()
except KeyboardInterrupt:
sys.exit()
except Exception as e:
print(e)
sys.exit()
if __name__ == '__main__':
main()