LinuxQuestions.org
Review your favorite Linux distribution.
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 02-09-2014, 12:54 PM   #1
shadowbox12
Member
 
Registered: Mar 2010
Posts: 52

Rep: Reputation: 3
tripwire reporting unusal changes to /sys


I'm used to seeing certain change in /dev and /sys mainly as USB devices get plugged and unplugged, but a recent scan showed some very unusual changes I can't account for. For example, /dev/.udev/db/block:ram0 - ram12 and ram15 show md5 changes but NOT ram12, ram13, or ram14. I have not changed any ram modules or settings in the bios.

Another example, /sys/module/8021q/sections/.data and all the other files in the "sections" dir show md5 changes. When I cat these files I see 0xfffff89e4580 and other values that looks like locations in RAM where pointers to call these drivers probably reside. Why would the memory address suddenly change on so many modules? Addresses for 8021q, acpi_cpufreq, arc4, cdrom, cfg80211, cpufreq_ondemand, eeprom_24c32, fat, freq_table, fuse, garp, i2c_i801, iTCO_vendor_support, ip6_tables, ip_tables, iptable_filter, iptable_mangle, iptable_nat, ipv6, kvm, kvm_intel, llc, mac80211, macvlan, macvtap, microcode, mperf, nf_conntrack, nf_defrag_ipv4, nf_defrag_ipv6, nf_nat, rfkill, sd_mod, snd, snd_hda_codec, snd_hwdep, snd_page_alloc, snd_pcm, snd_seq, snd_timer, sr_mod, stp, tun, vfat, vhost_net, xt_state all changed. However other module addresses such as ext4, hid, mousedev, pcmcia, and usbcore have not changed. Why would the memory address for i2c_i801 change and not i2c_core?

I'm trying not to jump to any conclusions, but it looks pretty suspicious. The only change is the system was physically relocated, ie unplugged and replugged. Other than that there have been 0 changes to the OS, no updates, no new software or hardware, nothing changed in /etc, no changes at all. It doesn't seem logical that just moving the hardware would cause all these changes.
 
Old 02-09-2014, 04:53 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
Virtual File Systems like /proc and /sys present a dynamic view of kernel internals and /dev is populated dynamically on the fly by scripts, udev and other subsystems, both to the extent that traditional monitoring will be prone to errors and false positives and therefore of limited use. If you want to get into this you best start by posting pre & post event data.
 
Old 02-09-2014, 06:13 PM   #3
shadowbox12
Member
 
Registered: Mar 2010
Posts: 52

Original Poster
Rep: Reputation: 3
Understood that monitoring /sys and /dev presents some challenges, but most stealth rootkits create parallel filesystem to hide files and the only way to discover them is to locate the altered devices pointing to alt filesystem or other shadow/rooted devices. When you say pre and post data, what do you mean?
 
Old 02-11-2014, 12:41 AM   #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 shadowbox12 View Post
Understood that monitoring /sys and /dev presents some challenges, but
That's an understatement ;-p


Quote:
Originally Posted by shadowbox12 View Post
most stealth rootkits create parallel filesystem to hide files and the only way to discover them is to locate the altered devices pointing to alt filesystem or other shadow/rooted devices.
What do you mean "parallel filesystem"?


Quote:
Originally Posted by shadowbox12 View Post
When you say pre and post data, what do you mean?
You said things changed. So what were the details like before and what after the fact?
 
Old 02-11-2014, 08:00 PM   #5
shadowbox12
Member
 
Registered: Mar 2010
Posts: 52

Original Poster
Rep: Reputation: 3
When I say parallel filesystem I mean a rootkit will commonly change the partitioning on the hard drive to reserve space for itself on a newly created encrypted partition the OS cannot read where it stores most of its active components. It needs links within the running OS to the hidden filesystem, which show up as drivers or maybe kernel modules. Often it intercepts calls from the regular filesystem to make sure that read/write operations are remapped and do not fall into the reserved space. This is why I call it a shadow filesystem, because of the remapping the OS cannot "see" into that space. No other rootkit files will be found on the regular filesystem other than those drivers for the shadow filesystem. TLD4 uses exactly this type of shadow filesystem for example.

I'm afraid I don't know exactly what changed since tripwire only reports md5 hashes encoded in base64 and apparently truncated. I've been unable to reconstruct the original files based on the tripwire hashes. For the future I will save copies of the originals so a comparison can be made, but based on other research I think this is most likely a false positive. It seems tripwire is showing its age when dealing with modern threats and a lot of additional customization is required to keep pace.

Last edited by shadowbox12; 02-11-2014 at 10:15 PM.
 
  


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
[SOLVED] Problem with compiling on unusal distribution Melbourne, FL Linux - Newbie 4 12-06-2013 01:36 AM
system not display /sys/ folder....in kernel compile how to enable sys in menuconfig dashang.trivedi Linux - Kernel 1 07-14-2011 05:00 AM
LXer: 5 unusal games for Linux LXer Syndicated Linux News 4 11-21-2010 10:59 PM
tripwire reports /usr/sbin/tripwire changed alfaalfabeta Linux - Security 5 07-22-2003 05:52 PM
unusal Modem -Motorola!! chilibowl Linux - Hardware 4 11-23-2002 11:47 PM

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

All times are GMT -5. The time now is 11:03 PM.

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