Live data from Hacker News

Linux terminal keylogger in userspace

average-coder.blogspot.com.ar

21–30 of 36 posts

Re: Linux terminal keylogger in userspace

#21

All of our deployment scripts at work use SSH to accomplish their tasks. All of the tasks are prepended with "LD_PRELOAD=", and I've always wondered why but never bothered to look it up. So when would you want to use LD_PRELOAD?

In the past I have used it to make fsync and similar a no-op. ( This allows you to explicitly turn off data-security for certain processes, in order to either get performance, or to prevent them from affecting the rest of your system)

Re: Linux terminal keylogger in userspace

#22
post #3

Here's a solid way to log actual keys from the keyboard (rather than just terminal input) using evdev. It's not good for, say, logging keys of a headless server, but it is good for logging keystrokes from a computer with a monitor and keyboard. source code: http://git.zx2c4.com/evdev-keylogger/tree/ zx2c4@Thinkpad ~ $ git clone http://git.zx2c4.com/evdev-keylogger/ Cloning into 'evdev-keylogger'... zx2c4@Thinkpad ~ $…

> remove the connection thinger

Anybody that thinks of installing/running this should still audit the code before doing that.

Re: Linux terminal keylogger in userspace

#23

All of our deployment scripts at work use SSH to accomplish their tasks. All of the tasks are prepended with "LD_PRELOAD=", and I've always wondered why but never bothered to look it up. So when would you want to use LD_PRELOAD?

I've abused it in the past when an application depended on a library that was not installed under the system path.

I'd agree with the people who warn against using it when not absolutely necessary.

Re: Linux terminal keylogger in userspace

#24
post #12

This is cool, but seems overly complex. A few friends and I played "capture the flag" with our personal systems, and a few times passwords were obtained with a simple shell function wrapping sudo. The first time the function ran (based on whether or not the output file in /tmp existed) and 1/5 times after that, it would simply use read -s, and and write the password to the output file. The other 4/5 times it ran, it…

I used a very similar approach in the mid-ninties to get full root access to all of our high-school's systems (which was technically not even illegal at this time and place). The output file used a simple single-character XOR obfuscation, to make it a little bit less obvious if someone looked at the log file.

Re: Linux terminal keylogger in userspace

#26
My old and somewhat related PoC project for screen casts, but still working. Just checked (debian wheezy with stock kernel 3.2.0-4-amd64). It requires building and loading simple kernel module, though.

Apparently nowadays debugfs is owner-only rw, so you have to change it or start it as root.

https://github.com/przemoc/kaos

Look for the top-right corner to see the effect while you're typing or clicking something.

P.S. Funny thing is that I don't know why I wrote >>Kprobe dependency can be easily removed by writing own input handler and it will be done in future<< back then, because when I evaluated this statement year or so ago, it didn't look that easy, and there would be more code in the end, I suppose.

Re: Linux terminal keylogger in userspace

#27
post #3

Here's a solid way to log actual keys from the keyboard (rather than just terminal input) using evdev. It's not good for, say, logging keys of a headless server, but it is good for logging keystrokes from a computer with a monitor and keyboard. source code: http://git.zx2c4.com/evdev-keylogger/tree/ zx2c4@Thinkpad ~ $ git clone http://git.zx2c4.com/evdev-keylogger/ Cloning into 'evdev-keylogger'... zx2c4@Thinkpad ~ $…

> remove the connection thinger Anybody that thinks of installing/running this should still audit the code before doing that.

Not a bad idea. Considering the whole codebase is super short and simple, this shouldn't be a problem for most people.

Re: Linux terminal keylogger in userspace

#28
If I recall correctly Magic SYSRQ offered the ability to kill all running processes using a shortcut impossible to bypass (along with other shortcuts, like one for killing the X server 'no question asked' and no possibility whatsoever by X to dodge the kill -9).

So basically you had to go first to a virtual console (in text mode) and then issue the Magic SYSRQ shortcut.

That would kill all processes running on that console and you'd be sure to have a stock prompt without any kind of software keylogger.

I don't know if Magic SYSRQ still exists or not for 64-bit Linuxes, it's been a while I haven't used it.

Re: Linux terminal keylogger in userspace

#29
post #14

Earlier quoted context omitted.

My gennerally approach is: 1) Download source 2) Uncompress file 3) ./configure 4) make 5) ./[name of binary] 6) Read documentation/source_code/other_stuff

Aside from the fact that that's a horrible habit, even following those steps, you couldn't have missed it. Anyway, enough of this discussion. Let's talk about the actual keylogger -- Comments? Questions? Suggestions?

Just want to add first of all that I generally read the ReadMe first. --

Besides that, what do you (zx2c4) think of Linux? Do you think it's a safe platform?

I think it still has a long way to go. _Most_ programs require root access to install; and even ones that don't need root still have access to all user files. This is a but of problem.

Contrast this with iOS, where every app has local storage and one app cannot read another's files/data. On Linux & Android the problem of data security (among others) is persistent.

Re: Linux terminal keylogger in userspace

#30
post #14

Earlier quoted context omitted.

Aside from the fact that that's a horrible habit, even following those steps, you couldn't have missed it. Anyway, enough of this discussion. Let's talk about the actual keylogger -- Comments? Questions? Suggestions?

Just want to add first of all that I generally read the ReadMe first. -- Besides that, what do you (zx2c4) think of Linux? Do you think it's a safe platform? I think it still has a long way to go. _Most_ programs require root access to install; and even ones that don't need root still have access to all user files. This is a but of problem. Contrast this with iOS, where every app has local storage and one app cannot…

[deleted]
Post reply on HN