forked from TeamDefronix/Cyberonix
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcyberonix.py
executable file
·298 lines (279 loc) · 11 KB
/
cyberonix.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
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
#!/usr/bin/python3
import os
import subprocess
from main import *
from main.tools import colors, banner
import time, argparse
def exit_program():
os.system("clear")
banner.main()
print("\033[38;5;105m", "[+] Thanks visit again".title())
exit()
try:
def update():
os.system("clear")
banner.main()
banner.attack("Update")
print("[+] Checking for updates....".title())
process = subprocess.Popen(
"git checkout . && git pull ",
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
(use, nouse) = process.communicate()
if not nouse:
if "Already up to date" in use.decode():
print("[+] it is updated".title())
elif "not a git repository" in use.decode():
print("[-] IT is not a github repository".title())
elif "Updating" in use.decode():
print("[+] updating.....".title())
print(use.decode())
print("\u001b[32m[+] Cyberonix is UPDATED To Latest Version")
os.system("sudo python3 setup.py")
exit()
else:
print("[-] Something went wrong....".title())
print(use.decode())
else:
print("[-] something went wrong".title())
print(nouse)
for i in range(3):
print(f"[!] Redirecting in ...{3-i}sec\r".title(), end="")
time.sleep(i)
def starting():
parser = argparse.ArgumentParser(
description="Cyberonix is a complete resource hub for Cyber Security Community. Our aim is to make this tool an 1 stop solution for all the Hackers out there to get resources of various topics in Cyber Security. We will keep updating this tool & adding new & updated resources on the go.",
)
main_args = parser.add_argument_group('Main Arguments')
main_args.add_argument(
"--tools", "-t", action="store_true", help="Run Tools Function"
)
main_args.add_argument(
"--cheatsheet", "-c", action="store_true", help="Run Cheatsheet Function"
)
main_args.add_argument(
"--news",
"-n",
nargs="?",
metavar="Date",
const="",
type=str,
help="Date In The Format yyyy-mm-dd",
)
ip_args = parser.add_argument_group('IP')
ip_args.add_argument(
"--getip", "-gip", help="Get Ip Of A Domain", metavar="Domain"
)
ip_args.add_argument("--ipinfo", "-ipi", metavar="IP", help="Get IP Infomation")
dns_Args = parser.add_argument_group('DNS Records')
parser.add_argument("--domain", "-D", dest='domain',
help='Specify the domain', option_strings=['--domain'])
dns_Args.add_argument(
"--dnsrecord", "-dns", action="store_true", help="To Get DNS Records(options: --domain) and use --record to specify record name"
)
dns_Args.add_argument(
"--record", "-r", help="To Give Record For DNSrecord(Like: A,TXT,MX)"
)
screenshot_Args = parser.add_argument_group('Screenshoting')
screenshot_Args.add_argument(
"--screenshot",
"-s",
action="store_true",
help="To Get Screenshot Of Websites(options: --file,--domain)",
)
parser.add_argument("--output", "-o", help="Specify An Input File (-f path/to/file.txt)")
parser.add_argument("--file", "-f", help="Specify An Output File (-o path/to/location)")
asn_Args = parser.add_argument_group('ASN Record')
parser.add_argument("--ip", "-ip", help="Specify IP Address")
asn_Args.add_argument(
"--asnrecord", "-asn", action="store_true", help="To Get ASN Record(Options: --ip,--file,--output)"
)
password_Args = parser.add_argument_group("Password Generation")
password_Args.add_argument(
"--passwordgen", "-P", action="store_true", help="To Generate Password"
)
password_Args.add_argument(
"--default-password-gen",
"-pass",
action="store_true",
help="To Generate Random Password (Recommended)(You can only use --length,--checkpassword)",
)
password_Args.add_argument(
"--upper", "-u", action="store_true", help="For Uppercase"
)
password_Args.add_argument(
"--lower", "-l", action="store_true", help="For Lowercase"
)
password_Args.add_argument(
"--digits", "-d", action="store_true", help="For Digits"
)
password_Args.add_argument(
"--punctuation", "-p", action="store_true", help="For Punctuation"
)
password_Args.add_argument(
"--length", "-L", help="To Specify Length Of Password (Default=8)"
)
password_Args.add_argument(
"--checkpassword",
"-C",
action="store_true",
help="To Check Your Generated Password",
)
hstatus_Args = parser.add_argument_group('HTTP Status')
hstatus_Args.add_argument(
"--http-status",
"-S",
action="store_true",
help="To Get Http Status Code Of A Domain(Options: --domain,--file,--output)",
)
remove_dub_Args = parser.add_argument_group('remove duplicate')
remove_dub_Args.add_argument(
"--remove-duplicate",
"-rd",
action="store_true",
help="To Remove Dublicates From a File(Options: --file,--output)",
)
args = parser.parse_args()
if args.tools:
tool.main()
elif args.getip:
arguments.getip(args.getip)
elif args.cheatsheet:
Cheat_sheet.main()
elif args.news:
if args.news == "":
news.main()
else:
news.main(args.news)
elif args.cheatsheet:
Cheat_sheet.main()
elif args.screenshot:
if args.file:
arguments.screenshot(path=args.file)
elif args.domain:
arguments.screenshot(url=args.domain)
else:
print(
f"{colors.red}[!] Please file with --file path/to/file or pass a single domain with --domain https://example.com{colors.reset}"
)
elif args.remove_duplicate:
if args.file:
if args.output:
arguments.remove_dublicates(location=args.file, output=args.output)
else:
arguments.remove_dublicates(location=args.file)
else:
print(
f"{colors.red}[!] Please file with --file path/to/file or pass a single domain with --domain https://example.com{colors.reset}"
)
elif args.asnrecord:
if args.file:
if args.output:
arguments.asnrecord(path=args.file, output=args.output)
else:
arguments.asnrecord(path=args.file)
elif args.ip:
if args.output:
arguments.asnrecord(url=args.ip, output=args.output)
else:
arguments.asnrecord(url=args.ip)
else:
print(
f"{colors.red}[!] Please file with --file path/to/file or pass a single ip with --ip 8.8.8.8{colors.reset}"
)
elif args.http_status:
if args.file:
if args.output:
arguments.http_status_code(path=args.file, output=args.output)
else:
arguments.http_status_code(path=args.file)
elif args.domain:
if args.output:
arguments.http_status_code(path=args.domain, output=args.output)
else:
arguments.http_status_code(url=args.domain)
else:
print(
f"{colors.red}[!] Please file with --file path/to/file or pass a single domain with --domain https://example.com{colors.reset}"
)
elif args.ipinfo:
arguments.ipinformation(args.ipinfo)
elif args.passwordgen:
if args.length:
arguments.password_gen(
args.upper,
args.lower,
args.digits,
args.punctuation,
args.length,
args.checkpassword,
)
else:
arguments.password_gen(
args.upper,
args.lower,
args.digits,
args.punctuation,
check=args.checkpassword,
)
elif args.default_password_gen:
if args.length:
arguments.password_gen(length=args.length, check=args.checkpassword)
else:
arguments.password_gen(check=args.checkpassword)
elif args.dnsrecord:
if args.domain:
if args.record:
arguments.dnsrecords(args.domain, args.record)
else:
print("please give --record also")
elif args.record:
if args.domain:
arguments.dnsrecords(args.domain, args.record)
else:
print("please give --domain also")
else:
main()
def main():
update()
os.system("chmod +x *")
proc = subprocess.Popen([f"id"], stdout=subprocess.PIPE, shell=True)
# there keyfor success output and noththere for error output
(there, notthere) = proc.communicate()
there = there.decode()
if "root" not in there:
try:
subprocess.run("sudo cyberonix", shell=True, check=True)
except Exception as err:
os.system("sudo python3 cyberonix.py")
exit()
while True:
os.system("clear")
banner.main()
list_attacks = ["TOOLS", "CHEATSHEET", "NEWS", "exit"]
for i in range(len(list_attacks)):
print(colors.options, f"{i}) {list_attacks[i]}".title(), colors.reset)
option = input(f"\n {colors.select}Select An Option ->{colors.reset} ")
if option == "0":
os.system("clear")
tool.main()
elif option == "1":
os.system("clear")
Cheat_sheet.main()
elif option == "2":
os.system("clear")
news.main()
else:
exit_program()
# to run file separately
if __name__ == "__main__":
starting()
except KeyboardInterrupt:
exit_program()
except Exception as err:
os.system("clear")
banner.main()
banner.attack(f"{colors.red}ERROR{colors.reset}")
banner.description(f"{colors.red}{err}{colors.reset}")