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 12-24-2003, 06:30 PM   #1
Fireice
LQ Newbie
 
Registered: Dec 2003
Location: UK
Distribution: Debian woody
Posts: 8

Rep: Reputation: 0
localhost=81.6.33.181 - WTF???


Take a look at that:

[[root@81 root]# mail root@localhost -s foo < /dev/null
Null message body; hope that's ok
[root@81 root]# mail
Mail version 8.1 6/6/93. Type ? for help.
"/var/spool/mail/root": 1 message 1 new
>N 1 MAILER-DAEMON@localh Wed Dec 24 02:43 111/3762 "Postmaster notify: see transcript for details"
& 1
Message 1:

[...]

The original message was received at Wed, 24 Dec 2003 02:43:54 GMT
from localhost
with id hBO2hs2u010464

----- The following addresses had permanent fatal errors -----
<root@81.6.33.181>
(reason: 550 Host unknown)

----- Transcript of session follows -----
550 5.1.2 <root@81.6.33.181>... Host unknown (Name server: 81.6.33.181: host not found)

--hBO2hs2v010464.1072233834/localhost.localdomain
Content-Type: message/delivery-status

Reporting-MTA: dns; localhost.localdomain
Received-From-MTA: DNS; localhost.localdomain
Arrival-Date: Wed, 24 Dec 2003 02:43:54 GMT

Final-Recipient: RFC822; root@81.6.33.181
Action: failed
Status: 5.1.2
Remote-MTA: DNS; 81.6.33.181
Diagnostic-Code: SMTP; 550 Host unknown
Last-Attempt-Date: Wed, 24 Dec 2003 02:43:54 GMT

--hBO2hs2v010464.1072233834/localhost.localdomain
Content-Type: message/rfc822

Return-Path: <MAILER-DAEMON>
Received: from localhost (localhost)
by localhost.localdomain (8.12.8/8.12.8) id hBO2hs2u010464;
Wed, 24 Dec 2003 02:43:54 GMT
Date: Wed, 24 Dec 2003 02:43:54 GMT
From: Mail Delivery Subsystem <MAILER-DAEMON>
Message-Id: <200312240243.hBO2hs2u010464@localhost.localdomain>
To: <root@81.6.33.181>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="hBO2hs2u010464.1072233834/localhost.localdomain"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)

This is a MIME-encapsulated message

--hBO2hs2u010464.1072233834/localhost.localdomain

The original message was received at Wed, 24 Dec 2003 02:43:54 GMT
from localhost.localdomain [127.0.0.1]

[...]

Received: (from root@localhost)
by 81.6.33.181 (8.12.8/8.12.8/Submit) id hBO2hslT010460
for root@localhost; Wed, 24 Dec 2003 02:43:54 GMT
Date: Wed, 24 Dec 2003 02:43:54 GMT
From: root <root@81.6.33.181>
Message-Id: <200312240243.hBO2hslT010460@81.6.33.181>
To: root@81.6.33.181
Subject: foo


--hBO2hs2u010464.1072233834/localhost.localdomain--


--hBO2hs2v010464.1072233834/localhost.localdomain--

& q
Saved 1 message in mbox
[root@81 root]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
[root@81 root]# ping localhost
PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.089 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=2 ttl=64 time=0.085 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=3 ttl=64 time=0.105 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=4 ttl=64 time=0.126 ms

--- localhost.localdomain ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3033ms
rtt min/avg/max/mdev = 0.085/0.101/0.126/0.017 ms
[root@localhost root]# nmap -sT -O -p- -PI -PT 127.0.0.1

Starting nmap 3.48 ( ) at 2003-12-24 03:04 GMT
Interesting ports on localhost.localdomain (127.0.0.1):
(The 65526 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
111/tcp open rpcbind
631/tcp open ipp
3003/tcp open unknown
5555/tcp open freeciv
6000/tcp open X11
32768/tcp open unknown <- I have no idea what this one is for
Device type: general purpose
Running: Linux 2.4.X|2.5.X
OS details: Linux Kernel 2.4.0 - 2.5.20
Uptime 0.258 days (since Tue Dec 23 20:54:04 2003)

Nmap run completed -- 1 IP address (1 host up) scanned in 7.821 seconds

[root@81 root]#

Before you ask, no it isn't my ip. I've scanned my system with chkrootkit, and it didn't find anything.
Is it a hacker or did I change something without even knowing it (it isn't very probable, but possible, Linux newb here)? And how to get my localhost back?
 
Old 12-24-2003, 06:38 PM   #2
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
I saw everything but what one would really need to check

ifconfig -a

You can also always give a go with a good grep -R ip.address.here /etc/* to see where you're getting this IP from.

Doing stuff from the perspective of localhost does just about zippy.
 
Old 12-24-2003, 08:42 PM   #3
Fireice
LQ Newbie
 
Registered: Dec 2003
Location: UK
Distribution: Debian woody
Posts: 8

Original Poster
Rep: Reputation: 0
[root@81 root]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:30:BD:297:8C
inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:385788 errors:0 dropped:0 overruns:0 frame:0
TX packets:405451 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:26503687 (25.2 Mb) TX bytes:112767957 (107.5 Mb)
Interrupt:5 Base address:0xd000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:524815 errors:0 dropped:0 overruns:0 frame:0
TX packets:524815 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:26441828 (25.2 Mb) TX bytes:26441828 (25.2 Mb)

ppp0 Link encap:Point-to-Point Protocol
inet addr:*.*.*.* P-t-P:195.149.20.11 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1501 Metric:1
RX packets:153040 errors:0 dropped:0 overruns:0 frame:0
TX packets:161092 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:95056199 (90.6 Mb) TX bytes:11539034 (11.0 Mb)

Can't see anything unusual here.

---- Edit:
Only interesting thing that grep shows is:
/etc/portsentry/portsentry.history:1072204464 - 12/23/2003 18:34:24 Host: zux006-033-181.adsl.green.ch/81.6.33.181 Port: 135 TCP Blocked



Last edited by Fireice; 12-24-2003 at 08:48 PM.
 
Old 12-27-2003, 01:38 PM   #4
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Sounds like your mailing agent is the only thing that is resolving hostnames improperly. Checkout all the files in /etc/mail the are used to resolve hostnames (local-host-names, etc) and see if any of those have localhost set to something different. Also, I find it odd that the hostname of your machine is 81, while the first octet of that ip address is 81. is that just coincidence or has your hostname been changed as well?
 
Old 12-27-2003, 01:56 PM   #5
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
As a side note, that sounds suspiciously like someone tried to redirect the system logs so that root wouldn't see them. Chkrootkit will tell you if a rootkit/trojan or sniffer is present, but there are plenty of good old fashioned ways to hack a system. Check all of your system logs (esp, security ones) for abnormal activity. Take a look at any other returned syslog messages, as those are likely to contain what, if anthing, that a potential intruder would be trying to hide. Also check and see if you have any new users or if any users now have a UID of 0. Look at things like roots bash_history, and at login activity. Check the output of netstat -al for the presence of a backdoor or listener. Could just be that something got changed by accident, but it does sound kind of suspicious.
 
Old 12-28-2003, 06:48 PM   #6
Fireice
LQ Newbie
 
Registered: Dec 2003
Location: UK
Distribution: Debian woody
Posts: 8

Original Poster
Rep: Reputation: 0
OK, I'm getting seriously worried....
The redirection disappeared.

@ Capt_Caveman
81. shouldn't have been there - I was working on the machine.
That ip also showed up in the tripwire report (which is unfortunately next to useless because I up-to-dated my system a day or so b4 the problem)

Right now my box is offline (nothing connected with the hacker, a hardware problem + loooong delivery )

As, I said I've checked my system with chkroot already, and it showed no positives. Is it possible that i've been rootkited with something that it doesn't detect?

I'm not terribly keen on reinstalling the system (it took me quite a long time to get modem drivers working). Is there any way of removing that rootkit without doing that (My bet is that it listens on 32768, but it's supposed to be confined to my local network by the firewall).
 
Old 12-28-2003, 08:44 PM   #7
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
@ Capt_Caveman
81. shouldn't have been there - I was working on the machine.

Not sure what you mean by that.

That ip also showed up in the tripwire report (which is unfortunately next to useless because I up-to-dated my system a day or so b4 the problem)
The tripwire report by itelf is probably not very helpful, but what do you mean by the "IP also showed up"? If you could post the relevent portion of the tripwire report, that might help.

Right now my box is offline (nothing connected with the hacker, a hardware problem + loooong delivery )
You should probably keep it offline until you're absolutely sure that it's clean.

As, I said I've checked my system with chkroot already, and it showed no positives. Is it possible that i've been rootkited with something that it doesn't detect?
Yes, it is possible but not very likely. As far as rootkit identification, chkrootkit looks for certain characteristic filenames, but it also looks for deleted log entries, promiscuous interfaces, hidden processes, etc. So it's not limited to certain rootkit fingerprints exclusively. And as I said before, your system could have been hacked and rooted without a rootkit being installed at all. Rootkits are just a convenient toolbox for cracking, so you shouldn't focus so much on that as you should on what's in your logs or often more importantly, what's missing from your logs.

Is there any way of removing that rootkit without doing that (My bet is that it listens on 32768, but it's supposed to be confined to my local network by the firewall).
What makes you think that port? Again if you could post any relevent info, that would help. If your system has been compromised, whether a rootkit was installed or not, you should do a full reinstall from scratch. I know that sucks, but would you rather have someone else observing what you're doing at any moment, logging every keystroke, or even worse attacking other computers from your box?

I'm not terribly keen on reinstalling the system (it took me quite a long time to get modem drivers working)
While everything is pretty suspiscious, I don't think there's proof one way or the other. Post all the stuff that leads you to believe that and hopfully we can find out what's up.
 
Old 12-29-2003, 08:13 AM   #8
Fireice
LQ Newbie
 
Registered: Dec 2003
Location: UK
Distribution: Debian woody
Posts: 8

Original Poster
Rep: Reputation: 0
81. shouldn't have been there - I was working on the machine.
Not sure what you mean by that.
Normally I get root@localhost, not root@81.

That ip also showed up in the tripwire report (which is unfortunately next to useless because I up-to-dated my system a day or so b4 the problem)
The tripwire report by itelf is probably not very helpful, but what do you mean by the "IP also showed up"? If you could post the relevent portion of the tripwire report, that might help.
Tripwire key files have names ending in loacalhost.localdomain. When I tried to do a check with defalut settings it tried to use that ip in filename.
In the header of the tripwire report there is some info about the person who started the check, it includes ip address. Normally it was localhost, but it got changed as well.


Is there any way of removing that rootkit without doing that (My bet is that it listens on 32768, but it's supposed to be confined to my local network by the firewall).
What makes you think that port? Again if you could post any relevent info, that would help.
Look at my first post - I've done nmap scan, and it shows that it's open.

Last edited by Fireice; 12-29-2003 at 08:19 AM.
 
Old 12-29-2003, 12:17 PM   #9
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Normally I get root@localhost, not root@81.
OK. Check root's .bash_history to see if it was changed from the command line:

cat /root/.bash_history | grep hostname

Also looking at the first tripwire report with 81 as the hostname or the last successful tripwire report should tell you approximately when it was changed. Also if the hostname is back to normal, do a tripwire check to see what (if anything) has changed. If the hostname is still wrong, change it back or tell tripwire which file to use as the database.

Look at my first post - I've done nmap scan, and it shows that it's open.
My bad. See what is using that port:

lsof -i
netstat -al

Any new users? Use this to look for users with root priviledges:

awk -F: '$3==0 {print $1}' /etc/passwd

It should only print out "root". Any other abnormalities in /var/log/secure or /var/log/messages? Things like error messages or application panics can be a tip off.
 
  


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
Change localhost name in username@localhost n175uj Linux - Newbie 4 07-01-2005 08:25 PM
Message from syslogd@localhost localhost kernel: Disabling IRQ #21 ylts Linux - Hardware 0 02-26-2005 08:01 AM
Can't change the computer name from dhcp-181-18 and can't start ftp because it rocketman3245 Mandriva 3 04-01-2004 02:57 PM
dns requests from localhost to localhost keex Linux - Networking 2 11-13-2003 01:47 PM
Eggdrop has quit (Ping timeout: 181 seconds) Kroppus Linux - Software 0 11-13-2003 11:32 AM

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

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