LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-05-2011, 03:40 PM   #1
Peufelon
Member
 
Registered: Jul 2005
Posts: 164
Blog Entries: 1

Rep: Reputation: Disabled
Some questions relating to output of tripwire, chkrootkit, rkhunter


Some possible issues on my mind, regarding my moribund Debian oldstable desktop, mostly relating to smarter interpretation of tripwire, chkrootkit, rkhunter output:
  • Is chkrookit being updated to include latest linux rootkits?
  • @unspawn (rkhunter developer): is rkhunter being updated to include the latest linux rootkits? And any linux-applicable zero-day exploits included in the HBGary leakfest? (I hear that inside the NSA, Aaron Barr is regarded as the biggest boob since Col. Bonner Fellers and Mr. Robert Murphy, whose maladroit cryptographic blunders while serving in Cairo c. 1940-2 provided the Germans with reams of operational intelligence on British capabilities, plans, and operations, thus greatly prolonging the North Africa campaign. Whatever you think about HBGary's missteps, it makes sense to look over their zero-day exploits, I think, to make sure rkhunter protects against anything which might be cross-platform.)
  • I have some empty files, names beginning with period, which chkrootkit considers "suspicious":
    Code:
    /usr/lib/iceweasel/.autoreg
    /usr/lib/icedove/.autoreg 
    /usr/lib/xulrunner-1.9/.autoreg 
    /lib/init/rw/.ramfs
    I believe that the first three are just the way iceweasel does things, and that the last is due to fact I installed from live-CD, too long ago to recall details. If I delete them, I think they are regenerated upon reboot. Even so, I guess that the only reason chkrookit is suspicious is that the names begin with a period. Is that correct?
  • In my ordinary user's home directory I have a directory ~/.mozilla/extensions which contains an empty directory with a long name. Is this some kind of undeletable cookie?
  • When running
    Code:
    tripwire --check --interactive
    I always see listed many files in /var/run, /var/log, /proc, and /dev which I think should change, but by default tripwire looks in these directories because rootkit authors like to try to hide their logs and malware there. Is that right? So that we would be wise to look over these results daily to see if anything looks obviously wrong? And what is obviously wrong, anyway. I think I'd recognize that a file newly added to /var/run with a name like ".pwnd_u" doesn't belong, but can anyone offer some further rules of thumb?
  • Every time I reboot, when I run Tripwire I see files like
    Code:
    Added:
    [x] "/dev/.udev/failed/\\x2fdevices\\x2fplatform\\x2fvesafb.0"
    [x] "/dev/.udev/failed/\\x2fdevices\\x2fplatform\\x2ffloppy.0"
    [x] "/dev/.udev/failed/\\x2fdevices\\x2fpci0000:00\\x2f0000:00:0b.0"
    [x]
    "/dev/.udev/failed/\\x2fdevices\\x2fLNXSYSTM:00\\x2fdevice:00\\x2fPNP0A03:00\\x2fPNP0F13:00"
    [x] "/dev/.udev/failed/\\x2fdevices\\x2fLNXSYSTM:00\\x2fdevice:00\\x2fPNP0A03:00\\x2fPNP0C04:00"
    [x] "/dev/.udev/failed/\\x2fdevices\\x2fLNXSYSTM:00
    These files are broken symbolic links to nonexistent devices such as
    Code:
    /devices/LNXSYSTM:00/device:00/PNP0A03:00/PNP0C04:00
    I have been assuming this is due to some kind of misconfiguration, or some aspect of DHCP, avahi, dirmngr I have broken by setting up a possibly overly restrictive firewall, or something to do with the despicably insecure dsl modem/router my telecome forces customers to buy in order to get on the internet, but now I am starting to wonder. I guess some of the above might be related to doing something slightly tricky in past few days involving a live CD and floppy disks which might have confused my system.
  • Since I install patches as soon as they become available from the Debian repos, I often see many modified binaries. Usually I can recognize most of them as changes expected due to upgrading avahi, cups, sambda, or other packages with many dependencies. But sometimes I see some which are not obviously related, like /etc/logrotate.d (what does that have to do with yesterday's security patches?) What do experienced sysadmins do to check what libraries and binaries should be modified when they upgrade, for example, cups? Isn't there a command I can run as root which will tell me what all the dependencies are?
  • When I boot, the messages which rapidly scroll by mention some kind of code for Tor which looks like a unique identifier. I can't reproduce it here because it goes by too quickly. Anyone know more?

Last edited by Peufelon; 03-05-2011 at 04:00 PM.
 
Old 03-06-2011, 05:44 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Peufelon View Post
Is chkrookit being updated to include latest linux rootkits?
Use your favorite search engine to locate the developers website (and CVS repo and user mailing list if any). Check its release date and those of currently known rootkits.


Quote:
Originally Posted by Peufelon View Post
@unspawn (rkhunter developer): is rkhunter being updated to include the latest linux rootkits?
No. There will be modified rootkits and new rootkits I don't have access to. Regardless of that the amount of rootkit infestations has been dwindling since the turn of the millennium: unpatched vulnerabilities and misconfigured machines are easy to find on which to use way easier methods. BTW there's rarely any need to ask for me specifically: most regulars here know as much as I do if not more.


Quote:
Originally Posted by Peufelon View Post
And any linux-applicable zero-day exploits included in the HBGary leakfest?
And which ones would that be exactly?


Quote:
Originally Posted by Peufelon View Post
I hear that inside the NSA
Either you have information from somebody inside the NSA which is highly unlikely or you should re-evaluate how much an opinion based solely on hearsay is worth.


Quote:
Originally Posted by Peufelon View Post
the only reason chkrookit is suspicious is that the names begin with a period.
In ye aulden days filenames starting with a dot where thought useful for hiding names because you need to use the "-a" switch to list them so most of the time there'll be false positives. For non-empty files the file name and location may hold clues as would examining them using the package manager as would using common tools like 'ls -al', 'stat' and 'strings' as would feeding names into LQ search or your favorite search engine.


Quote:
Originally Posted by Peufelon View Post
In my ordinary user's home directory I have a directory ~/.mozilla/extensions which contains an empty directory with a long name. Is this some kind of undeletable cookie?
As you haven't provided any information (stat, ls) the only think comes to mind is it might be an uninstalled extension. And it's not a security-related question BTW.


Quote:
Originally Posted by Peufelon View Post
I always see listed many files in /var/run, /var/log, /proc, and /dev which I think should change, but by default tripwire looks in these directories because rootkit authors like to try to hide their logs and malware there. Is that right?
Tripwire has no concept of "rootkits" or "malware". It simply records changes because items appear or disappear, have ownership, access rights, inode or content changed. In the case of these standard directories you should reference the FSSTND/LFS docs to know which directory holds what volatile or growing files. Also see the tools under the previous dot files reply.



Quote:
Originally Posted by Peufelon View Post
I have been assuming this is due to some kind of misconfiguration, or some aspect of DHCP, avahi, dirmngr I have broken by setting up a possibly overly restrictive firewall, or something to do with the (..) dsl modem/router (..), but now I am starting to wonder. I guess some of the above might be related to doing something slightly tricky in past few days involving a live CD and floppy disks which might have confused my system.
Paraphrasing one of the standard mantra's: "do not attribute to malice what can be attributed to standard system activity". I suggest you get to know your system better.


Quote:
Originally Posted by Peufelon View Post
Since I install patches as soon as they become available from the Debian repos, I often see many modified binaries. Usually I can recognize most of them as changes expected due to upgrading avahi, cups, sambda, or other packages with many dependencies. But sometimes I see some which are not obviously related, like /etc/logrotate.d (what does that have to do with yesterday's security patches?) What do experienced sysadmins do to check what libraries and binaries should be modified when they upgrade, for example, cups? Isn't there a command I can run as root which will tell me what all the dependencies are?
0) My distributions package management allows me to peek into packages, list dependencies and examine any scripts run before or after a package is installed, 1) I keep a backup scheme that allows me to compare and restore files at will, 2) all /etc configuration is loaded in CVS, again allowing me to compare changes and restore at will, 3) Samhain tracks changes and so does 4) the audit service and 5) all sudo sessions are wrapped in 'rootsh' as extra audit layer. Once you have a fix on MAC times it's just a question of grepping back logs.


Quote:
Originally Posted by Peufelon View Post
When I boot, the messages which rapidly scroll by mention some kind of code for Tor which looks like a unique identifier. I can't reproduce it here because it goes by too quickly.
Check your system and or daemon logs?
 
1 members found this post helpful.
Old 03-07-2011, 12:31 PM   #3
Peufelon
Member
 
Registered: Jul 2005
Posts: 164

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
hanks, unspawn, for your quick response. Some of what you wrote was helpful:

Quote:
Originally Posted by unspawn
Regardless of that the amount of rootkit infestations has been dwindling since the turn of the millennium:
That's good to know, but is it possible that with growing sophistication, modern rootkits are simply better at hiding from view?

And thanks for all your work on Rkhunter--- I and many others use it because we find it useful!

Quote:
Originally Posted by unspawn
I suggest you get to know your system better.
Exactly what I am trying to do in this thread.

Computers are complicated. Mine has something like
  • 250000 files (3000 open during normal operations)
  • 2300 binaries in the usual four directories
  • 2000 .ko files
  • 1200 packages installed from debs
  • 100 running user space processes
  • 70 kernel modules
  • ...
Not even to mention the hardware. That's a lot to understand, and the challenge is all the greater for those who lack the neccessary background in computing. But as we both know, it is essential to try, so we all have to do the best we can with what we have.

I think you would be amazed at (or scornful of?) the lengths to which I have gone to try to systematically benchmark "normal behavior" on my system. But that's exhausting work, and I've found that over time, as more software is installed and user behavior evolves, the benchmark can become quite outdated. So trying to understand a system, and to distinguish normal or otherwise innocuous behavior from things which should raise an alarm, is an ongoing process, and from time to time, I seek help and advice here.

Quote:
Originally Posted by unspawn
Check your system and or daemon logs?
Perhaps I did not express myself clearly. Of course I checked all the logs before asking. The problem is that there is no log (at least, not in /var/log) which contains all the notices I see scrolling past at boot time. I probably should have said that this is something I have been trying to chase down by poking around in my system, looking around on the internet, etc., for almost a year.

I was hoping that someone here would have seen a similar notice at boot time on their own system, and would know what the identifier means. It seems too long to simply identify the version of tor which I have.

So, back to the point. Can anyone offer some answers, educated guesses, or links to relevant information? For example, about the /dev files I don't understand?

Last edited by Peufelon; 03-07-2011 at 12:33 PM.
 
Old 03-08-2011, 12:11 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Peufelon View Post
is it possible that with growing sophistication, modern rootkits are simply better at hiding from view?
That could be possible albeit remotely (or should I say infinitesimal?). The most simple explanation I think is that the "threatscape", to borrow large security vendors marketoid speek, has changed: longterm stealth isn't as much an issue as working fast and providing "services" in the right volume is what certain "markets" want.


Quote:
Originally Posted by Peufelon View Post
And thanks for all your work on Rkhunter--- I and many others use it because we find it useful!
Thanks, but the last years you shoul mainly thank John. He's the one who improved RKH greatly, I try to add rootkit details and such.


Quote:
Originally Posted by Peufelon View Post
the challenge is all the greater for those who lack the neccessary background in computing.
IMHO it isn't as much hiatus in computing as it is grokking concepts: once you dig the framework then details follow naturally from that.


Quote:
Originally Posted by Peufelon View Post
The problem is that there is no log (at least, not in /var/log) which contains all the notices I see scrolling past at boot time. I probably should have said that this is something I have been trying to chase down by poking around in my system, looking around on the internet, etc., for almost a year.
The kernel maintains a buffer storing messages at boot time. Once userland (r)syslog(-ng) is up those and every other message, apart from what you could call "vanity status messages", end up in whatever /etc/(r)syslog(-ng).conf is configuring (r)syslog(-ng) to log to.


Quote:
Originally Posted by Peufelon View Post
I was hoping that someone here would have seen a similar notice at boot time on their own system, and would know what the identifier means. It seems too long to simply identify the version of tor which I have.
TOR by default logs as little as possible. Starting TOR logging more verbosely could yield clues.
 
Old 03-08-2011, 11:18 PM   #5
Peufelon
Member
 
Registered: Jul 2005
Posts: 164

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by unspawn
but the last years you shoul mainly thank John. He's the one who improved RKH greatly, I try to add rootkit details and such
Thank you, John!

Quote:
Originally Posted by unspawn
the "threatscape" has changed
Agreed. (Not to imply that I think I know more than you do about the current threatscape, of course.)

We probably also agree that one constant is the principle that users are the single biggest threat to themselves.

Quote:
Originally Posted by unspawn
grokking concepts: once you dig the framework then details follow naturally from that.
Agreed: once you (somehow) acquire sufficient background knowledge, you can teach yourself efficiently. What some people call a steep learning curve: hard to get out of the weeds, but once you do, you can easily climb high under your own power.

If you will indulge me by answering a stupid question: in /etc/rsyslog.conf, what does a hyphen mean? For example:
Code:
-/var/log/xxx.log
And you are right, I found the Tor notice I was asking about in one of the obvious log files. I don't know why I didn't find it when I grepped weeks ago, but anyway, it goes something like this:
Code:
Tor 0.2.1.xx (r21k769l91471p1a3)
Question: what is that string in parentheses?

The iceweasel engine: I am curious to learn more about what exactly is stored in place like ~/.mozilla/firefox/xxx.default. For example: I can tell from viewing the file that
extensions.rdf
appears to store information about add-ons which iceweasel uses to check for updates. But I'd like to know for sure. I know that
XPC.mfasl
is something XUL does to "speedload" pages. But what exactly? I suspect that if I knew, I'd want to disable it since my connection is too slow and flaky to benefit. The file
xpti.dat
seems to contain lots of things which might be hidden cookies. More mysterious to me are the files in database formats I can't even read. I do know that sqlite and db files should be readable if I knew how to not only fire up those database engines but to actually read the files. Of course, for security reasons, iceweasel probably doesn't want to make that too easy for curious persons.

Last edited by Peufelon; 03-08-2011 at 11:30 PM.
 
Old 03-09-2011, 11:39 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Peufelon View Post
Agreed: once you (somehow) acquire sufficient background knowledge, you can teach yourself efficiently. What some people call a steep learning curve: hard to get out of the weeds, but once you do, you can easily climb high under your own power.
I disagree but we're getting OT here. Studying a subject will always start with "just accepting" the ground rules, how things are done, and in some cases un-learning how one did things in the Other OS.


Quote:
Originally Posted by Peufelon View Post
If you will indulge me by answering a stupid question: in /etc/rsyslog.conf, what does a hyphen mean?
Not a security question: 'man 5 syslog.conf' (omit sync after every log action).


Quote:
Originally Posted by Peufelon View Post
Question: what is that string in parentheses?
Not a security question. I don't know. Might be some version-related hash. You have to check the application source for that.


Quote:
Originally Posted by Peufelon View Post
The iceweasel engine: I am curious to learn more about what exactly is stored in place like ~/.mozilla/firefox/xxx.default. For example: I can tell from viewing the file that extensions.rdf appears to store information about add-ons which iceweasel uses to check for updates. But I'd like to know for sure. I know that
XPC.mfasl is something XUL does to "speedload" pages. But what exactly? I suspect that if I knew, I'd want to disable it since my connection is too slow and flaky to benefit. The file xpti.dat seems to contain lots of things which might be hidden cookies. More mysterious to me are the files in database formats I can't even read. I do know that sqlite and db files should be readable if I knew how to not only fire up those database engines but to actually read the files. Of course, for security reasons, iceweasel probably doesn't want to make that too easy for curious persons.
Not security questions or related to the problem in your OP either AFAIK but you got that by now.
Best create new threads per topic in the most relevant forum.
For everything Mozilla see http://kb.mozillazine.org/.
For SQLite see 'sqlitebrowser' or 'sqlite' CLI commands.

Last edited by unSpawn; 03-09-2011 at 11:46 AM.
 
Old 03-09-2011, 02:32 PM   #7
Peufelon
Member
 
Registered: Jul 2005
Posts: 164

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Back to the OP, then. I was asking for help interpreting output of Tripwire, and of course my goal in asking that arises from my goal of improving my system security. No-one has yet said anything about this possible issue:
Quote:
Every time I reboot, when I run Tripwire I see files like
Code:

Added:
[x] "/dev/.udev/failed/\\x2fdevices\\x2fplatform\\x2fvesafb.0"
[x] "/dev/.udev/failed/\\x2fdevices\\x2fplatform\\x2ffloppy.0"
[x] "/dev/.udev/failed/\\x2fdevices\\x2fpci0000:00\\x2f0000:00:0b.0"
[x]
"/dev/.udev/failed/\\x2fdevices\\x2fLNXSYSTM:00\\x2fdevice:00\\x2fPNP0A03:00\\x2fPNP0F13:00"
[x] "/dev/.udev/failed/\\x2fdevices\\x2fLNXSYSTM:00\\x2fdevice:00\\x2fPNP0A03:00\\x2fPNP0C04:00"
[x] "/dev/.udev/failed/\\x2fdevices\\x2fLNXSYSTM:00

These files are broken symbolic links to nonexistent devices such as
Code:

/devices/LNXSYSTM:00/device:00/PNP0A03:00/PNP0C04:00

I have been assuming this is due to some kind of misconfiguration, or some aspect of DHCP, avahi, dirmngr I have broken by setting up a possibly overly restrictive firewall, or something to do with the despicably insecure dsl modem/router my telecome forces customers to buy in order to get on the internet, but now I am starting to wonder. I guess some of the above might be related to doing something slightly tricky in past few days involving a live CD and floppy disks which might have confused my system.
So is that highly unusual, and if so, it is innocuous or suspicious?

Last edited by Peufelon; 03-09-2011 at 02:34 PM.
 
Old 03-09-2011, 08:13 PM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
You can determine yourself if something is innocous or not: read for instance this (old: 2006) thread to gain understanding the reason why Udev device probes may end up in /dev/.udev/failed/ and how you could try and mitigate that.

Last edited by unSpawn; 03-09-2011 at 08:15 PM.
 
Old 03-10-2011, 09:06 AM   #9
Peufelon
Member
 
Registered: Jul 2005
Posts: 164

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Thanks, unspawn, this information is helpful:
Quote:
When udev tries to create entries in some cases it uses modprobe, and if
this fails it causes an entry to be created in /dev/.udev/failed/
Returning to interpreting output of tripwire --check --interactive, I frequently reboot my PC and thus (?) always see many changes in /proc, dev/, /var/log/, /var/run which should be accepted as innocuous. It is possible to configure tripwire to ignore /proc, /dev but I understand that is a bad idea since many old-style rootkits like to try to "hide" files in these places. Thus, as I understand it, one should let tripwire flag any changes in /dev et cetera and simply look for obviously suspicious entries like "added: /proc/.aufero". Is that correct?

Last edited by Peufelon; 03-10-2011 at 09:20 AM.
 
Old 03-10-2011, 09:46 AM   #10
orgcandman
Member
 
Registered: May 2002
Location: new hampshire
Distribution: Fedora, RHEL
Posts: 600

Rep: Reputation: 110Reputation: 110
Quote:
Originally Posted by Peufelon View Post
It is possible to configure tripwire to ignore /proc, /dev but I understand that is a bad idea since many old-style rootkits like to try to "hide" files in these places. Thus, as I understand it, one should let tripwire flag any changes in /dev et cetera and simply look for obviously suspicious entries like "added: /proc/.aufero". Is that correct?
One thing to mention about /proc - it doesn't exist anywhere but memory. As such, you can't just decide to create a file in /proc/. In order to do so, you will need to invoke a kernel specific function (create_proc_entry). If a rootkit is at the point where it's adding entries to /proc, you've already lost and are unlikely to detect it (unless it is poorly written), since it has control over the kernel, and thus your OS as a whole. I think it's probably safe to just ignore /proc for the average user, but you'll have to judge for yourself how much paranoia you have.
 
Old 03-10-2011, 09:55 AM   #11
Peufelon
Member
 
Registered: Jul 2005
Posts: 164

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
You make a good point.

My views are rapidly evolving, but my current "common sense summary" is:
  • "state of the art" rootkits are becoming far more sophisticated,
  • it is no longer sensible to assume that state-sponsored or otherwise well-funded and capable attackers will not attack your "small fry" network, "politically inoffensive" bulletin board, or "innocent citizen" PC,
  • nevertheless, old (and sometimes badly written) rootkits remain a threat, and tools like Tripwire and Rkhunter which can be (apparently) easily evaded by some modern rootkits are probably worth using for that reason,
  • complaints about computer intrusions to "the authorities", which have never been of much use, are even more pointless at a time when it appears to have become common practice for "law enforcement agencies" to break the law to engage in the same activities as the criminals, targeting "small fry" networks et cetera,
  • these days, there are no "small fry", anything can be "politically offensive" (to someone somewhere), and governments presume all citizens are guilty of something,
  • the only one looking out for your network is yourself, so we all need to pay more attention to doing that.

Last edited by Peufelon; 03-10-2011 at 10:21 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
av in addition to rkhunter and chkrootkit qwertyjjj Linux - Security 2 02-12-2011 08:51 AM
rkhunter vs. chkrootkit, which is better? abefroman Linux - Security 3 09-09-2009 04:47 AM
rkhunter & chkrootkit vs tripwire hank43 Linux - Security 3 04-30-2007 04:41 AM
Which one is better, Chkrootkit or Rkhunter? ComputerHermit_ Linux - Security 7 04-16-2007 10:17 PM
rkhunter or chkrootkit? marlor Linux - Security 2 08-28-2004 08:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration