Skip to content
Browse files

Remove the sudo prompt message from the stdout stream when using sudo

  • Loading branch information...
1 parent e58a1d7 commit ba0126536098f8762d65a413f71bb017e2218a8a dhubbard committed
Showing with 10 additions and 1 deletion.
  1. +8 −0 sshmap/defaults.py
  2. +2 −1 sshmap/sshmap.py
View
8 sshmap/defaults.py
@@ -57,3 +57,11 @@
"port": "6667",
"use_ssl": False,
}
+
+sudo_message = [
+ 'We trust you have received the usual lecture from the local System',
+ 'Administrator. It usually boils down to these three things:',
+ '#1) Respect the privacy of others.',
+ '#2) Think before you type.',
+ '#3) With great power comes great responsibility.'
+]
View
3 sshmap/sshmap.py
@@ -391,7 +391,8 @@ def run_command(host, command="uname -a", username=None, password=None,
for el in result.err:
if check_prompt:
if password in el or 'assword:' in el or \
- '[sudo] password' in el or el.strip() == '':
+ '[sudo] password' in el or el.strip() == '' or \
+ el.strip() in defaults.sudo_message:
skip = True
else:
check_prompt = False

0 comments on commit ba01265

Please sign in to comment.
Something went wrong with that request. Please try again.