Hack Forums
Can force sudo? - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45)
+--- Forum: Blackhat • Red Team • Offensive Security (https://hackforums.net/forumdisplay.php?fid=447)
+---- Forum: Keyloggers (https://hackforums.net/forumdisplay.php?fid=113)
+---- Thread: Can force sudo? (/showthread.php?tid=6323135)



Can force sudo? - bl1ndm0nk - Apr 1, 2026

I developed a keylogger in Python, but it has to be used as sudo to work. Is there any chance I can "capture" any other sudo order to be able to execute it without the user intentionally doing so?✌


RE: Can force sudo? - DramaKing - Apr 1, 2026

(Apr 1, 2026 05:52 AM)bl1ndm0nk Wrote:  I developed a keylogger in Python, but it has to be used as sudo to work. Is there any chance I can "capture" any other sudo order to be able to execute it without the user intentionally doing so?✌

Use xkbcat. It doesn't need sudo. If you really want to use yours, you could use linpeas to find a misconfiguration or exploit. You could also try creating an alias to your script that the victim might run. You could also modify a .desktop file. There's also creating an alias for 'sudo su' (https://github.com/astra90x/sudo-su-phishing) or just 'sudo' (https://github.com/hak5/bashbunny-payloads/blob/master/payloads/library/phishing/fake-sudo/sudo-phishing.sh). Aliases are evaluated before $PATH.


RE: Can force sudo? - bl1ndm0nk - Apr 1, 2026

(Apr 1, 2026 06:28 AM)DramaKing Wrote:  Use xkbcat. It doesn't need sudo. If you really want to use yours, you could use linpeas to find a misconfiguration or exploit. You could also try creating an alias to your script that the victim might run. You could also modify a .desktop file. There's also creating an alias for 'sudo su' () or just 'sudo' (). Aliases are evaluated before $PATH.

Hey, thank u, yeah it's not like I wanna use mine, or any other to be honest, just investigating for the sake of it. I will take a look into the alias stuff, didn't think about it 👍


RE: Can force sudo? - DramaKing - Apr 1, 2026

(Apr 1, 2026 06:37 AM)bl1ndm0nk Wrote:  Hey, thank u, yeah it's not like I wanna use mine, or any other to be honest, just investigating for the sake of it. I will take a look into the alias stuff, didn't think about it 👍

One reason I respond to as many threads as I can, it gets the brain working.