LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-02-2012, 02:12 AM   #1
zasavage
Member
 
Registered: Sep 2010
Location: Bloemfontein , South Africa
Distribution: Slackware 13.37 and Slackware 14
Posts: 201

Rep: Reputation: 6
mempodipper exploited my slackware 13.37


Hi guys
Just did a routine check of my server and wham I was hacked and have been exploited
The one immediate one is mempodipper , its invested my tmp dir

Please need some tips to keep the ^&&@##* out of my server

and what do I do with my current system . Upgrade kernel , format redo

What ever it takes

LAwrence
 
Old 03-02-2012, 02:50 AM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Thumbs up

Hi,

Quick-n-dirty : back up the user data and re-install, but...that may not be an option.

It's an exploit, so, some "one" needs root access, I'd boot the thing up from a live CD (no infected stuff running) and manually edit the password file, possibly, one of the accounts has root privzz...

Secondly, this thing gets started up somehow, that means a look-see in the startup and cron scripts.

Is it a public server? Get it off-line for maints. Host something neutral (maintenance notice) if need be. Check the web stuff, that could (upon invocation of the HTML GET request, eg when someone calls up the infected page) start something without the hacker needing to be around...suspect PHP files calling CGI comes to mind. Real clever, but a bitch to find if there's quite some stuff around. Be suspicious of anything. A JPG file may nog even be a picture (learned that from an other GURU), that's the tripwire the "other one" dies on all the time, remember...

And, dont kill/shoot me for NOT being a Slacker , I use Arch Linux...I learned THAT kinda stuff from Arch...so...

Good luck!

Thor

Last edited by ButterflyMelissa; 03-02-2012 at 02:51 AM.
 
Old 03-02-2012, 03:37 AM   #3
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
Quote:
Originally Posted by zasavage View Post
Hi guys
Just did a routine check of my server and wham I was hacked and have been exploited
The one immediate one is mempodipper , its invested my tmp dir

Please need some tips to keep the ^&&@##* out of my server

and what do I do with my current system . Upgrade kernel , format redo

What ever it takes

LAwrence
AFAIK, 13.37 comes with 2.6.38, which is not affected by mempodipper exploits. It only affected Linux Kernel 2.6.39 and above up to the version that it has been patched (it was 3.2.2)

Last edited by willysr; 03-02-2012 at 03:41 AM. Reason: Added correct version
 
Old 03-02-2012, 04:05 AM   #4
zasavage
Member
 
Registered: Sep 2010
Location: Bloemfontein , South Africa
Distribution: Slackware 13.37 and Slackware 14
Posts: 201

Original Poster
Rep: Reputation: 6
@willysr

I am running the standard kernel

I wen t to the developer of the exploits site he just updates the source
And seem to work on

Timeline :
Vulnerability discovered by zx2c4 (Jason A. Donenfeld)
Public release of the vulnerability the 2012-01-18
Exploit provided the 2012-01-23

PoC provided by:
zx2c4 (Jason A. Donenfeld)

Reference(s) :
CVE-2012-0056
EBD-ID-18411

Affected versions :
All Linux kernel's above or equal to 2.6.39 (32 bit or 64 bit).

uname -r
2.6.37.6

I found this in /tmp

mempodipper.c
and a executable mempodipper

/*
* Mempodipper
* by zx2c4
*
* Linux Local Root Exploit
*
* Rather than put my write up here, per usual, this time I've put it
* in a rather lengthy blog post: http://blog.zx2c4.com/749
*
* Enjoy.
*
* - zx2c4
* Jan 21, 2012
*
* CVE-2012-0056
*/

Regards
Lawrence

Last edited by zasavage; 03-02-2012 at 04:17 AM.
 
Old 03-02-2012, 05:02 AM   #5
zasavage
Member
 
Registered: Sep 2010
Location: Bloemfontein , South Africa
Distribution: Slackware 13.37 and Slackware 14
Posts: 201

Original Poster
Rep: Reputation: 6
PART 2

A client password was cracked , I think that is how they got the file in the /tmp directory

I found that in my logs .. but now

Can someone help and maybe just let me know if that was possible , and do I have to format and start over

Or can I try and tighten it all up ( A bit late for me )

Regrds
Lawrence
 
Old 03-02-2012, 05:50 AM   #6
wargus
Member
 
Registered: Mar 2010
Location: Switzerland
Distribution: Slackware
Posts: 98

Rep: Reputation: 23
Quote:
Can someone help and maybe just let me know if that was possible , and do I have to format and start over
I recommend doing so, because else you will never be sure that everything is set to the original status.

I also recommend using grsecurity and RBAC. It's very easy to set up with Slackware. It logs every attempt doing things on the machine which are not "normal" behaviour, and depending on what is tried it also reacts to this. It will for sure take some time to understand how this system works and it cannot guarantee 100% security (like everything else except going offline, which is not an option) and recompiling some stuff, but the idea behind grsecurity is very interesting (at least it was for me).


Some stuff for reading:

http://grsecurity.net/
http://forums.grsecurity.net/viewtopic.php?f=7&t=2939 (blog entry on CVE-2012-0056 )

 
Old 03-02-2012, 07:00 AM   #7
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
Can someone help and maybe just let me know if that was possible , and do I have to format and start over
I'd go for the format. Let's review some stuff. You may only have to rework the file system (OS space) partition, as your user spaces are in an other partition, that should not be a problem...however...

Quote:
A client password was cracked
That could pose a big problem. You'll have to fine-tooth-comb out the user spaces...good luck with that one.

There is something I dont get (possibly still somewhat noob on that point, sorry) how can a cracked USER account gain ROOT access, unles a) security was set too weak (symlinks where there should be none, ect) or b) ... (even worse) the cracked account had Root access...
In my universe, any account with anything remotely Root-ish can only log on from the keyboard hooked to the box. Not tru the net cable...

Hmm...

Last edited by ButterflyMelissa; 03-02-2012 at 07:02 AM.
 
Old 03-02-2012, 07:22 AM   #8
wargus
Member
 
Registered: Mar 2010
Location: Switzerland
Distribution: Slackware
Posts: 98

Rep: Reputation: 23
Quote:
how can a cracked USER account gain ROOT access
Well, with an exploit for vulnerable software... for example downloaded from the Exploit database. This is probably the easiest part after user access to the box was gained. Since most of the exploits aim for root (uid/gid 0), it is essential to make the root account itself useless unless root takes up the admin role in a role based access control.
 
1 members found this post helpful.
Old 03-02-2012, 08:46 AM   #9
zasavage
Member
 
Registered: Sep 2010
Location: Bloemfontein , South Africa
Distribution: Slackware 13.37 and Slackware 14
Posts: 201

Original Poster
Rep: Reputation: 6
Thanks for the replies ..

Going for the allnighter to redo the box

But what the heck learned a lesson ( make sure a user cant change his password to john ) WTF do these users think


Anyway thanks

Lawrence
 
Old 03-02-2012, 08:56 AM   #10
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
Quote:
Originally Posted by zasavage View Post
@willysr

I am running the standard kernel

I wen t to the developer of the exploits site he just updates the source
And seem to work on

Timeline :
Vulnerability discovered by zx2c4 (Jason A. Donenfeld)
Public release of the vulnerability the 2012-01-18
Exploit provided the 2012-01-23

PoC provided by:
zx2c4 (Jason A. Donenfeld)

Reference(s) :
CVE-2012-0056
EBD-ID-18411

Affected versions :
All Linux kernel's above or equal to 2.6.39 (32 bit or 64 bit).

uname -r
2.6.37.6

I found this in /tmp

mempodipper.c
and a executable mempodipper

/*
* Mempodipper
* by zx2c4
*
* Linux Local Root Exploit
*
* Rather than put my write up here, per usual, this time I've put it
* in a rather lengthy blog post: http://blog.zx2c4.com/749
*
* Enjoy.
*
* - zx2c4
* Jan 21, 2012
*
* CVE-2012-0056
*/

Regards
Lawrence
if you have a mempodipper file, it doesn't mean that your system is hacked through that exploit. You must try to compile it and execute it by yourself to see if it's really working. AFAIK, the default kernel should not be exploited by those script, since it only affects 2.6.39 and above as i mentioned before
 
Old 03-02-2012, 09:30 AM   #11
wargus
Member
 
Registered: Mar 2010
Location: Switzerland
Distribution: Slackware
Posts: 98

Rep: Reputation: 23
And if it's not working, you can trace the IP and login time of the account you think got hacked from the wtmp or btmp logfile (don't remember now which) with

Code:
last -f wtmp or btmp
If everything is normal, you maybe need to talk to this user If the box got hacked, this logfile probably isn't a trusted source of information anymore. As long as a box isn't hacked, such information could also be retrieved from process accounting (pacct) you could see what the user did at what time from which IP. Downside of pacct is that on a busy box it creates tons of information in the logfile.

 
Old 03-02-2012, 10:10 AM   #12
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
make sure a user cant change his password to john
A humble tip? You hand out the passwords...that way you're sure about the complexity.
Or maybe a tweak in /etc/pam.d/passwd (if memory serves) to enforce passwords that meet "certain standards"...

Good luck

Thor
 
Old 03-02-2012, 10:27 AM   #13
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
Slackware doesn't include PAM Thor. However the passwd command from shadow won't let the user set it to 'john' anyway as it's too short, so I'd be interested to know how he managed to set it so in this case.
 
1 members found this post helpful.
Old 03-02-2012, 11:02 AM   #14
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
What is the evidence that your system has been hacked?

You claim to be running the stock kernel, which is not vulnerable to the mempodipper exploit. Finding files in /tmp just means that some user has downloaded and attempted the exploit.

You claim a weak password problem was the route, but the password problem cannot have occurred.

I strongly advise some calm and clear thinking before taking drastic action.
 
  


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
Apache exploited to send out spam from Mailform on site. Patric.F Linux - Security 6 10-07-2010 09:38 AM
how C++ code can be exploited in tcl script? saif_ict Programming 1 04-12-2010 07:26 AM
Hacked/Exploited - Now I need a little advice bbonifield Linux - Security 4 08-03-2007 02:47 PM
LXer: Firefox Extensions Waiting to Be Exploited LXer Syndicated Linux News 0 06-20-2007 02:01 PM
Server being exploited stefaandk Linux - Security 3 07-12-2006 05:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:02 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