Skip to content

Commit c385570

Browse files
committed
More actions debugging
1 parent 3b4458d commit c385570

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

gtfonow/gtfonow.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2031,7 +2031,7 @@ def execute_privileged_command(payload, command):
20312031

20322032

20332033
def get_sudo_l_output():
2034-
"""Gets the output of sudo -l command in a python 2.* and 3.* compatible way.
2034+
"""Gets the output of sudo -l command.
20352035
20362036
Returns:
20372037
str: Output of sudo -l command.
@@ -2046,13 +2046,17 @@ def get_sudo_l_output():
20462046
break
20472047
else:
20482048
process.kill()
2049-
log.error("Command timed out. User may need to enter a password.")
2049+
print("Command timed out. User may need to enter a password.")
20502050
return
20512051

20522052
stdout, _ = process.communicate()
2053+
2054+
if sys.version_info[0] >= 3:
2055+
stdout = stdout.decode('utf-8')
2056+
20532057
return stdout
20542058
except Exception as e:
2055-
log.error("Error: " + str(e))
2059+
print("Error: " + str(e))
20562060
return
20572061

20582062

0 commit comments

Comments
 (0)