Skip to content

Commit

Permalink
fix sudo -i check
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessandroZ committed Aug 2, 2019
1 parent 99fbfc0 commit e0d5c1e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Linux/beroot/modules/sudo/sudo_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ class SudoList(object):

def __init__(self, password='test'):
self.sudo_cmd = 'echo "{password}" | sudo -S -ll'.format(password=password)
self.sudo_dirty_check = 'echo "{password}" | sudo -S -i'.format(password=password)
self.sudo_dirty_check = [
'echo "{password}" | sudo -S -i'.format(password=password),
'sudo -i'
]
self.users = Users()
self.all_rules = []
self.ld_preload = False
Expand All @@ -42,8 +45,9 @@ def run_cmd(self, cmd, is_ok=False):
return out

def dirty_check(self):
if self.run_cmd(self.sudo_dirty_check, is_ok=True):
return 'sudo -i possible !'
for cmd in self.sudo_dirty_check:
if self.run_cmd(cmd, is_ok=True):
return 'sudo -i possible !'

def _get_user(self, user):
"""
Expand Down

0 comments on commit e0d5c1e

Please sign in to comment.