News for hackers. Stuff that matters.
Re:Ask HN: Anonymous person sent proof of SSH access to our ... by eonw on Wednesday July 27, 2016 @04:42PM (#12176363)
just a note: intelligent exploiters hide their files inside of yours, so the -mtime is useless in many cases, they will set the mtime of their upload to match the rest of the folder they hide in.

command history is also easy to alter if you know what you are doing.

Re:Ask HN: Anonymous person sent proof of SSH access to our ... by porker on Wednesday July 27, 2016 @05:34PM (#12176682)
So the only way to detect exploits is to scan the server regularly and log the mtime and the file size, and look for changed files that shouldn't have changed?

Re the command history, is there any way around them wiping it - e.g. piping all .bash_history entries to an append-only store?

Re:Ask HN: Anonymous person sent proof of SSH access to our ... by spdustin on Wednesday July 27, 2016 @05:45PM (#12176743)
RootKit Hunter [0] works pretty well on most distros to check hashes on files and other potential problems.

You can also use a global bash configuration that would log all commands [1] entered into any bash shell to a central log, which could be shipped off-server simultaneously.

[0]: http://rkhunter.sourceforge.net

[1]: http://askubuntu.com/questions/93566/how-to-log-all-bash-com...

Re:Ask HN: Anonymous person sent proof of SSH access to our ... by uxp on Wednesday July 27, 2016 @05:56PM (#12176804)
Does RKHunter scan userspace for mtimes? I haven't used it in years, so I'm honestly curious. Back when I did, it was customary to install it side-by-side with Tripwire, which essentially does only that; scan userspace and categorically log changed files based on a configurable severity depending on location (eg, /root/ is high, /var/log/messages is low)
Re:Ask HN: Anonymous person sent proof of SSH access to our ... by spdustin on Wednesday July 27, 2016 @07:17PM (#12177221)
They really serve two different functions. Tripwire and similar tools like aide (I use aide now rather than tripwire, but that's my personal preference, I'm not an infosec domain expert) are file integrity checkers that check files for property changes (including mtime). Tuning out false alarms can result in an admin just turning off the reporting functions of the tools, that's the downside as I understand it.

However, rkhunter has additional logic to specifically seek out rootkits and malware-like behavior, and is more specifically targeted to system file modifications. Combining it with unhide (to compare actual processes running with those visible from userspace) provides a reasonable assurance that nothing nefarious is going on.

They're all part of a spectrum, however. I use scanners like aide alongside rkhunter as well, but I'm the sort of guy that will spend a day tuning the config of aide to avoid constant false alarms.

Re:Ask HN: Anonymous person sent proof of SSH access to our ... by emcrazyone on Thursday July 28, 2016 @01:10AM (#12178427)
yes, excellent point, agree. I run the scan regardless in case I'm dealing with the non-intelligent exploiter type ;)
Re:Ask HN: Anonymous person sent proof of SSH access to our ... by eonw on Thursday July 28, 2016 @05:06PM (#12183166)
good point as well. might as well run every bit of security you can, helps stop the "script kiddies" and lower quality automated stuff.