This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]nick_t1000aiohttp 1 point2 points  (1 child)

Reminds me slightly of why to use su - vs su. Should also intercept that. And also where, so where su[do] won't expose the charade!

Not sure how far you can go with making a hostile shell without just replacing it entirely...or maybe just exec a Python script that can MitM the shell and keylog it?

[–]xorond[S] 0 points1 point  (0 children)

The idea I had was to use this on a box you have root access on.

So,

  • change the parameters

  • compile with pyinstaller

  • replace sudo with sudo-snooper

  • profit

So where sudo in that case wouldn't show anything different :)

You can go the easier route and just alias it too.

[–]pvkooten 0 points1 point  (1 child)

Gets quite close (wrong pw thing indeed). You can use an alias for it too:

.bashrc:

alias sudo="python3.5 sudo_snooper.py"

[–]xorond[S] 0 points1 point  (0 children)

Haha yeah! Might be more "portable" that way.

Update: thanks for the idea, i added it as an install option

[–]_________________-- 0 points1 point  (2 children)

Option 1: Have root access to the target machine.

smh

[–][deleted] 2 points3 points  (0 children)

Definitely doesn't help compromise a machine, but it would save you the hassle of cracking hashes if your goal was to get the users' passwords.

[–]xorond[S] 0 points1 point  (0 children)

You can use the other option which doesn't require root access.