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 07-26-2005, 11:18 PM   #1
Charles Daniel
Member
 
Registered: Aug 2004
Location: Missouri City, Tx
Posts: 39

Rep: Reputation: 15
Could have been hacked! Help!


I recently shutdown and restarted my server which is part of my regular maintenance routine. However, the X server gave me "Login Failed" when I attempted to log back in as root. So I attempted to login to my user account and I was successful. My user account doesn't have superuser access however. It seems that the root password has been changed somehow. Thats the only way I can see how the root login would fail.

The root login fails across the board. That means that no matter where the login is attempted from (X server, failsafe mode or a su command from an existing session. etc) it always fails.

So I got my installation disk and ran "Rescue". Rescue logged me in as root without the need for password authentication. So through Rescue I was able to access the root account. Once I was in, I ran the "passwd" command at the "#" prompt. I figured that I had repaired the password problem so I logged out and tried to start the X server again. I got "Login Failed" once again. Root logins continue to fail in the other places I've mentioned as well,

It's as if my password reset didn't take. What must I do? Please help.

Thanks
 
Old 07-27-2005, 12:05 AM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Well, I'm not sure how your rescue works, but it's possible you needed to 'chroot' into your installation. From rescue, can you see /etc/passwd with all the proper accounts?

Also, why are you logging in to X as root?
 
Old 07-27-2005, 12:29 AM   #3
aikidoist72
Member
 
Registered: Jan 2005
Location: Australia
Distribution: Slackware Archlinux FreeBSD
Posts: 218

Rep: Reputation: 30
The rescue disk would only deal with the cd unless as mentioned above you chrooted to your installation. You can boot up in single mode which loads up the root prompt straight away, which from there you could
Code:
passwd
I think you do this by adding the work 'single' to your bootup line
eg


Code:
# (2) Slackware 10.1
title Slackware 10.1 single
root	(hd0,0)
kernel	(hd0,0)/vmlinuz-2.6.11.10-ev1 vga=0x317 root=/dev/hda5 devfs=nomount ro splash=verbose single
fantastic instructions for chrooting are within the Gentoo installation guide.

Last edited by aikidoist72; 07-27-2005 at 12:30 AM.
 
Old 07-27-2005, 12:31 AM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
'single' very often requires the root password (at least on my boxes it does)
 
Old 07-27-2005, 12:39 AM   #5
aikidoist72
Member
 
Registered: Jan 2005
Location: Australia
Distribution: Slackware Archlinux FreeBSD
Posts: 218

Rep: Reputation: 30
Hi Matir, I think you are right. I was about to try it then. Do you know of what needs to go into that line to start as root without logging in? I have read this previously, but when I need to find the reference........
 
Old 07-27-2005, 12:43 AM   #6
aikidoist72
Member
 
Registered: Jan 2005
Location: Australia
Distribution: Slackware Archlinux FreeBSD
Posts: 218

Rep: Reputation: 30
Here is a quick one. May help you out!

Bootloader Recovery
 
Old 07-27-2005, 12:43 AM   #7
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
In a well-secured box, you should not be able to get in without the root password.

Try the rescue cd again and try chrooting in if it does not automatically do so.
 
Old 07-27-2005, 12:45 AM   #8
Charles Daniel
Member
 
Registered: Aug 2004
Location: Missouri City, Tx
Posts: 39

Original Poster
Rep: Reputation: 15
Yes /etc/password is there with the accounts inside. My rescue is on the OS installation CD. It simply lets me login through a shell in character mode. Once rescue is initialized it prompts me to login. If I use the userid root then rescue skips the password prompt and lets me in. From there I can do root level maintenance.

I normally close all my ports except for http on port 80 and 8080. I have 443 open for an SSL secure server. The DNS port is open as well. Other services are turned off to reduce the exposure of the server to malicious usage. I guess I should not be using root in X. Naughty me!

Nevertheless, I should think that once rescue allowed me to login as root, that I should be able to reset the password. Since the password reset didn't work, this leads me to think that there is something wrong with the OS. So what should I try next?

SUSE 8.0

Thanks
 
Old 07-27-2005, 12:46 AM   #9
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
It could be an issue with pam or something like that.

To make sure the password change works, try "cat /etc/shadow | grep root" before and after doing a 'passwd' and make sure it is different.
 
Old 07-27-2005, 01:45 AM   #10
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
This should be easy with a rescue CD, for example when I've had to do it with the Redhat machines here it mounts their / paritions under /mnt/sysimage, so:

Code:
vi /mnt/sysimage/etc/shadow
Now copy the password hash from your working user's login to the root login, reboot and login as root with your users password.

or

Code:
chroot /mnt/sysimage /bin/bash
passwd root
 
Old 07-27-2005, 11:07 AM   #11
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Right now it feels like a malfunction, not a hack. What does /var/log/messages say?
 
Old 07-27-2005, 04:43 PM   #12
Charles Daniel
Member
 
Registered: Aug 2004
Location: Missouri City, Tx
Posts: 39

Original Poster
Rep: Reputation: 15
/var/log/messages says the following:

[current date] Rescue Syslogd 1.4.1: Restart.
[current date] Rescue Kernel: klogd 1.4.1, log source = /proc/kmsg started
[current date] Rescue Kernel: Cannot find map file
[current date] Rescur Kernel: Loaded 260 symbols from 13 modules


Line three is the only thing that look interesting to me. Does this suggest the problem?

Thanks
 
Old 07-27-2005, 06:02 PM   #13
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
I'm not familiar with that particular message, but the sound of it isn't making me shriek in terror. A quick advanced-search of Google for the phrase says, e.g...
Quote:
You should expect "ls -l /boot" to show the file, System.map, as a symbolic link to some other file that exists. For example, on my computer I see "... System.map -> System.map-2.4.9-21smp". Perhaps you either lack an analogous link, or the file to which the symbolic link points doesn't exist.
(citation: https://www.redhat.com/archives/redh.../msg00286.html)
This does not sound like an issue that is terribly earth-shattering, nor one that has direct relevance to your immediate problem.

You should find several previous "messages" files in /var/log and you should review them all. When the system started "going south," log-file entries should have been created at that time which should suggest the nature of the problem.

Last edited by sundialsvcs; 07-27-2005 at 06:04 PM.
 
Old 07-27-2005, 06:44 PM   #14
Charles Daniel
Member
 
Registered: Aug 2004
Location: Missouri City, Tx
Posts: 39

Original Poster
Rep: Reputation: 15
You know what? I think I should just take my application and user acct backups and reinstall the OS. The OS resides on its own device. It mostly contains my user acct and software that I have installed like the JDK. I can download that stuff any time. My server apps reside on a separate physical device (IDE RAID 5).

If I reinstall the OS then that should not impact the RAID device right? I mean after the reinstall the OS should still be able to mount the RAID if it was untouched right? The RAID is where most of the important stuff resides. Not on the boot partition.

Thanks
 
Old 07-27-2005, 07:10 PM   #15
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
I think you'd be better off trying to figure out what's wrong. "Reinstalling the operating system" seems like a knee-jerk sort of response, and one that may not actually work if the problem turns out to be some glitch, either in the filesystem or in some configuration-file that a "reinstall" won't replace.
 
  


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
Have I been hacked? Please help linuxboy69 Linux - Security 11 09-07-2005 07:20 AM
Hacked? mikeshn Linux - Security 2 03-12-2004 01:57 PM
Help! Have I been hacked? Tenover Linux - Security 1 11-19-2003 03:24 PM
Did we just get hacked? vous Linux - Security 4 11-17-2003 08:11 AM
am i being hacked? tearinox Linux - Security 5 11-13-2003 06:00 PM

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

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