LinuxQuestions.org
Help answer threads with 0 replies.
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 09-13-2010, 10:10 AM   #1
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Rep: Reputation: 60
Centos 5.4 Root Password Changed and or System Comprimised


I made a attempt to access my Centos 5.4 system this morning and need to modify a file that required su access. When I attempted to "su" I could not get in with the password that I set. I rebooted the server which made no difference. Either I have been comprimised or I had forgotten my password. How can one reset the admin password to a system and where would I begin looking to see if the system was comprimised?

Last edited by metallica1973; 09-15-2010 at 11:22 PM.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 09-13-2010, 10:29 AM   #2
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
I figured out how to change my root password after you forget it but I need to figure out of this was a comprimise. Where to begin?
 
Old 09-13-2010, 10:30 AM   #3
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 101Reputation: 101
If your server was compromised, nothing to ensure that you can make it clean. Do you have any monitoring tools, IDS, ... installed on the server?

Last edited by quanta; 09-13-2010 at 10:37 AM.
 
0 members found this post helpful.
Old 09-13-2010, 11:24 AM   #4
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
No,

I was thinking about installing tripwire and IDS like snort. Would that be the bare essentials?
 
Old 09-13-2010, 11:26 AM   #5
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
One starting point is to start looking for unusual programs running/listening:

lsof -Pwn
netstat -pane
ps -axfwwwe


I'd also have a good look at the log files and root's .bash_history file. The CERT Checklist is always a good place to start as well. And as quanta suggested, if you have any monitoring tools running, now would be a good time to bring them into the picture.
 
Old 09-13-2010, 11:29 AM   #6
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
Originally Posted by metallica1973 View Post
No,

I was thinking about installing tripwire and IDS like snort. Would that be the bare essentials?

Installing these now would be pretty pointless. Neither of those is going to work particularly well if the machine has been compromised.

As far as tripwire alternatives, take a look at Aide or Samhain. You also might want to think about SELinux since you're running CentOS. Other measures like mod_security might be worth a look, but we'd probably need to have a better idea of what this box is used for and what is currently running.
 
3 members found this post helpful.
Old 09-13-2010, 12:08 PM   #7
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
I am running a chkrootkit on the server as I type this message. I appreciate the advice and you are right that once the system has been compromised what is the worth of putting and IDS and tripwire. I am wondering if an update could have done this. This has never happened to me before so I am very suspicious.

Last edited by metallica1973; 09-13-2010 at 12:13 PM.
 
Old 09-13-2010, 12:40 PM   #8
frndrfoe
Member
 
Registered: Jan 2008
Distribution: RHEL, CentOS, Ubuntu
Posts: 379

Rep: Reputation: 38
I think auditd would be running by default, perhaps if you were compromised by a script it would forget about sanitizing auditd.
 
Old 09-13-2010, 10:18 PM   #9
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 101Reputation: 101
Quote:
Originally Posted by Hangdog42 View Post
As far as tripwire alternatives, take a look at Aide or Samhain.
I want to suggest another IDS: OSSEC.
 
Old 09-14-2010, 02:08 AM   #10
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
also " su " VS. " su -"????
is the system $PATH 100% the same for the normal user as for root ?
most of the time they are NOT the same -- for security reasons
/sbin & /usr/sbin and NOT normally in the normal user's $PATH

as to the system cracked
did you leave the SEinux default setting set to "enforcing " ? or set it to "permissive" or OFF
SE is not 100% but it will stop 95%+
 
Old 09-15-2010, 08:20 PM   #11
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
I looked at the /var/log/secure and I see a gap in entry log that is unusual:

PHP Code:
Sep  9 14:00:45 Aphrodite sshd[15805]: Accepted password for aris from XXX.XXX.XXX.XX port 1678 ssh2
Sep  9 14
:00:45 Aphrodite sshd[15805]: pam_unix(sshd:session): session opened for user aris by (uid=0)
Sep  9 15:16:32 Aphrodite sshd[15805]: pam_unix(sshd:session): session closed for user aris
Sep 11 11
:12:06 Aphrodite gdm[2980]: pam_unix(gdm:auth): check passuser unknown
Sep 11 11
:12:06 Aphrodite gdm[2980]: pam_unix(gdm:auth): authentication failurelognameuid=0 euid=0 tty=:0 ruserrhost=
Sep 11 11:12:06 Aphrodite gdm[2980]: pam_succeed_if(gdm:auth): error retrieving information about user hhhmy_friends_daughter_name 
and as you can see there is no data for the tenth! Take a look at the line before that:

PHP Code:
Sep 11 11:12:06 Aphrodite gdm[2980]: pam_unix(gdm:auth): authentication failurelognameuid=0 euid=0 tty=:0 ruserrhost
I dont like what I am seeing and also auditd is running. Let me dig deeper.

Last edited by metallica1973; 09-15-2010 at 08:36 PM.
 
Old 09-15-2010, 08:27 PM   #12
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
when looking at the audit.log how can one tell the date and time. I dont specifically see anything that specifies that. Also SEliux is not running. I also ran

PHP Code:
[root@Aphrodite ~]# find / -user root -perm -4000 -print
/usr/lib/news/bin/startinnfeed
/usr/lib/news/bin/inndstart
/usr/lib/squid/pam_auth
/usr/lib/squid/ncsa_auth
/usr/sbin/mtr
/usr/sbin/suexec
/usr/sbin/userisdnctl
/usr/sbin/usernetctl
/usr/sbin/userhelper
/usr/sbin/ccreds_validate
/usr/bin/kpac_dhcp_helper
/usr/bin/sudo
/usr/bin/crontab
/usr/bin/newgrp
/usr/bin/rsh
/usr/bin/sudoedit
/usr/bin/Xorg
/usr/bin/passwd
/usr/bin/chage
/usr/bin/at
/usr/bin/rcp
/usr/bin/chsh
/usr/bin/gpasswd
/usr/bin/chfn
/usr/bin/kgrantpty
/usr/bin/rlogin
/usr/kerberos/bin/ksu
/usr/libexec/openssh/ssh-keysign
find
: /proc/15833/task/15833/fd/4No such file or directory
find
: /proc/15833/fd/4No such file or directory
 
/bin/mount
/bin/su
/bin/umount
/bin/ping6
/bin/ping
/lib/dbus-1/dbus-daemon-launch-helper
/sbin/unix_chkpwd
/sbin/pam_timestamp_check
/sbin/umount.nfs4
/sbin/umount.nfs
/sbin/mount.nfs4
/sbin/mount.nfs 
and

PHP Code:
[root@Aphrodite ~]# find / -group kmem -perm -2000 -print
find: /proc/15839/task/15839/fd/4No such file or directory
find
: /proc/15839/fd/4No such file or directory
[root@Aphrodite ~]
here is the root directory on the system. Do these files and directories look normal?

PHP Code:
[root@Aphrodite ~]# ls -la|more
total 16424
-rw-r--r--  1 root root        0 Mar  1  2010 --
-
rw-r--r--  1 root root        0 Mar  1  2010 ---
drwxr-x--- 12 root root     4096 Sep 13 12:39 .
drwxr-xr-x 27 root root     4096 Sep 13 10:55 ..
-
rw-r--r--  1 root root      853 Jun 16 00:47 1
-rw-------  1 root root        0 Mar  1  2010 anaconda-ks.cfg
-rw-r--r--  1 root root        0 Mar  1  2010 Bad
-rw-------  1 root root    20142 Sep 14 20:49 .bash_history
-rw-r--r--  1 root root        0 Mar  1  2010 .bash_logout
-rw-r--r--  1 root root      191 Jan  6  2007 .bash_profile
-rw-r--r--  1 root root      176 Jan  6  2007 .bashrc
drwxr
-xr-x  2 1000 1000     4096 Jul 30  2009 chkrootkit-0.49
-rw-r--r--  1 root root    39421 Sep 13 12:38 chkrootkit.tar.gz
-rw-r--r--  1 root root        0 Mar  1  2010 Creating
-rw-r--r--  1 root root      100 Jan  6  2007 .cshrc
drwx
------  3 root root     4096 Jun 15 12:49 .dbus
-rw-r--r--  1 root root        0 Mar  1  2010 ...done
-rw-r--r--  1 root root        0 Mar  1  2010 drwx------
-
rw-r--r--  1 root root        0 Mar  1  2010 drwxr-x---
-
rw-r--r--  1 root root        0 Mar  1  2010 drwxr-xr-x
-rw-r--r--  1 root root        0 Mar  1  2010 Fe
-rw-r--r--  1 root root        0 Mar  1  2010 Feb
drwx
------  3 root root     4096 Jun 15 12:49 .gconf
drwx
------  2 root root     4096 Jul 25 15:16 .gconfd
drwx
------  3 root root     4096 Jun 15 12:49 .gnome2
drwx
------  2 root root     4096 Jun 15 12:49 .gnome2_private
-rw-r--r--  1 root root        0 Mar  1  2010 Implementing
-rw-r--r--  1 root root    32903 Feb 27  2010 install.log
-rw-r--r--  1 root root     5320 Feb 27  2010 install.log.syslog
-rw-r--r--  1 root root        0 Mar  1  2010 IPTABLES
-rw-------  1 root root       35 May  1 14:09 .lesshst
-rw-r--r--  1 root root        0 Mar  1  2010 Loading
drwxr
-xr-x  2 root root     4096 Apr 12 14:43 Machines
-rw-r--r--  1 root root       35 Mar  3  2010 minicom.log
-rw-r--r--  1 root root 16542064 Feb  7  2010 otrs-2.4.7-01.noarch.rpm
-rw-------  1 root root     1024 Aug  9 01:21 .rnd
-rw-r--r--  1 root root        0 Mar  1  2010 [root@c-98-231-171-220
-rw-r--r--  1 root root        0 Mar  1  2010 -rw-------
-
rw-r--r--  1 root root        0 Mar  1  2010 -rw-r--r--
-
rw-r--r--  1 root root      195 Feb 27  2010 scsrun.log
-rw-r--r--  1 root root        0 Mar  1  2010 Setting
-rw-r--r--  1 root root        0 Mar  1  2010 Shutting
drwx
------  2 root root     4096 Mar  3  2010 .ssh
-rw-r--r--  1 root root        0 Mar  1  2010 Starting
-rw-r--r--  1 root root        0 Mar  1  2010 Stopping
-rw-r--r--  1 root root      129 Jan  6  2007 .tcshrc
-rw-r--r--  1 root root        0 Mar  1  2010 total
drwxr
-xr-x  2 root root     4096 Apr 12 15:00 .vmware
drwxr
-xr-x  2 root root     4096 Apr 21 20:44 .vnc
-rw-------  1 root root       81 Mar  7  2010 .xauthsb4zBu 
After thinking about it, why would a smart hacker change the root password and instantly give him or her away? It doesnt make sense.

Last edited by metallica1973; 09-15-2010 at 11:23 PM.
 
Old 09-15-2010, 11:25 PM   #13
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
here is the output of my firewall on the box:

PHP Code:
[root@Aphrodite ~]# iptables -nvL
Chain INPUT (policy DROP 0 packets0 bytes)
 
pkts bytes target     prot opt in     out     source               destination
   52  2284 LINVALID   all  
--  *      *       0.0.0.0/0            0.0.0.0/0           state INVALID
12702 2145K CHECKBADFLAG  tcp  
--  *      *       0.0.0.0/0            0.0.0.0/0
    6   252 ACCEPT     all  
--  lo     *       0.0.0.0/0            0.0.0.0/0
    0     0 LREJECT    all  
--  *      *       0.0.0.0/0            127.0.0.0
 8363  609K ACCEPT     all  
--  eth1   *       192.168.3.0/27       0.0.0.0/0
  275 65265 ACCEPT     all  
--  eth2   *       0.0.0.0/0            192.168.2.0/27
    0     0 ACCEPT     all  
--  eth2   *       192.168.3.0/27       0.0.0.0/0
 5677 1788K ACCEPT     all  
--  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
    0     0 ACCEPT     tcp  
--  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:12022 state NEW
    
0     0 ACCEPT     udp  --  eth0   *       0.0.0.0/0            0.0.0.0/0           udp dpt:1723
    0     0 ACCEPT     all  
--  tun0   *       0.0.0.0/0            0.0.0.0/0
    0     0 DROP       all  
--  tun0   *       0.0.0.0/0            0.0.0.0/0
    6   192 LDROP      udp  
--  *      *       0.0.0.0/0            0.0.0.0/0           udp dpts:33434:33523
 5559 1652K SMB        all  
--  eth0   *       0.0.0.0/0            0.0.0.0/0
    0     0 REJECT     tcp  
--  eth0   *       0.0.0.0/0            0.0.0.0/0           tcp dpt:113 reject-with tcp-reset
 5289 1588K SPECIALPORTS  all  
--  eth0   *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  
--  eth0   *       0.0.0.0/0            0.0.0.0/0           state ESTABLISHED
    0     0 TCPACCEPT  tcp  
--  eth0   *       0.0.0.0/0            0.0.0.0/0           tcp dpts:1024:65535 state RELATED,ESTABLISHED
 7939 2457K LDROP      all  
--  *      *       0.0.0.0/0            0.0.0.0/0

Chain FORWARD 
(policy DROP 15 packets2299 bytes)
 
pkts bytes target     prot opt in     out     source               destination
    0     0 LINVALID   all  
--  *      *       0.0.0.0/0            0.0.0.0/0           state INVALID
 117K   17M CHECKBADFLAG  tcp  
--  *      *       0.0.0.0/0            0.0.0.0/0
 994K  159M SMB        all  
--  *      eth0    0.0.0.0/0            0.0.0.0/0
56357 3956K ACCEPT     tcp  
--  eth1   eth0    192.168.3.0/27       0.0.0.0/0           tcp spts:1024:65535
 874K  132M ACCEPT     udp  
--  eth1   eth0    192.168.3.0/27       0.0.0.0/0           udp spts:1024:65535
    0     0 ACCEPT     icmp 
--  eth1   eth0    192.168.3.0/27       0.0.0.0/0
    0     0 ACCEPT     all  
--  tun0   *       0.0.0.0/0            0.0.0.0/0           state NEW
    
0     0 ACCEPT     all  --  tun0   *       192.168.4.0/27       0.0.0.0/0
    0     0 ACCEPT     all  
--  *      tun0    192.168.3.0/27       0.0.0.0/0
    0     0 ACCEPT     all  
--  tun0   *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  
--  *      tun0    0.0.0.0/0            0.0.0.0/0
 595K  123M SMB        all  
--  eth0   *       0.0.0.0/0            0.0.0.0/0
 595K  123M ACCEPT     all  
--  eth0   *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
    0     0 TCPACCEPT  tcp  
--  eth0   *       0.0.0.0/0            0.0.0.0/0           tcp dpts:1024:65535 state RELATED
    0     0 ACCEPT     udp  
--  eth0   *       0.0.0.0/0            0.0.0.0/0           udp dpts:1024:65535 state RELATED
63459   24M ACCEPT     all  
--  eth2   eth0    0.0.0.0/0            0.0.0.0/0
  113 23803 ACCEPT     all  
--  eth0   eth2    0.0.0.0/0            0.0.0.0/0           state NEW
    
0     0 ACCEPT     all  --  eth1   eth2    0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  
--  eth2   eth1    0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
    0     0 ACCEPT     tcp  
--  eth1   eth2    0.0.0.0/0            192.168.2.2         tcp dpt:12444 state NEW
    
0     0 ACCEPT     udp  --  eth0   eth2    0.0.0.0/0            192.168.2.2         udp dpts:5050:5065 state NEW
    
0     0 ACCEPT     udp  --  eth0   eth2    0.0.0.0/0            192.168.2.2         udp dpts:10000:20000 state NEW
    
0     0 ACCEPT     udp  --  eth0   eth2    0.0.0.0/0            192.168.2.20        udp dpts:5050:5065 state NEW
    
0     0 ACCEPT     udp  --  eth0   eth2    0.0.0.0/0            192.168.2.20        udp dpts:10000:20000 state NEW
   
20  1520 LDROP      all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain OUTPUT 
(policy DROP 5 packets1140 bytes)
 
pkts bytes target     prot opt in     out     source               destination
    6   252 ACCEPT     all  
--  *      lo      0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  
--  *      eth0    192.168.2.0/27       0.0.0.0/0
  275 65225 ACCEPT     all  
--  *      eth2    0.0.0.0/0            0.0.0.0/0
 7171  431K ACCEPT     all  
--  *      eth0    0.0.0.0/0            0.0.0.0/0
 6729 3914K ACCEPT     all  
--  *      eth1    0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  
--  *      eth0    192.168.3.0/27       0.0.0.0/0
    0     0 ACCEPT     all  
--  *      eth0    192.168.4.0/27       0.0.0.0/0
    0     0 ACCEPT     all  
--  *      tun0    192.168.4.0/27       0.0.0.0/0
    0     0 ACCEPT     all  
--  *      tun0    0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  
--  *      eth0    0.0.0.0/0            0.0.0.0/0
    0     0 LDROP      all  
--  *      *       0.0.0.0/0            0.0.0.0/0

Chain CHECKBADFLAG 
(2 references)
 
pkts bytes target     prot opt in     out     source               destination
    0     0 LBADFLAG   tcp  
--  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x3F/0x29
    0     0 LBADFLAG   tcp  
--  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x3F/0x37
    0     0 LBADFLAG   tcp  
--  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x3F/0x3F
    0     0 LBADFLAG   tcp  
--  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x3F/0x00
    0     0 LBADFLAG   tcp  
--  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x06/0x06
    0     0 LBADFLAG   tcp  
--  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x03/0x03

Chain ICMPINBOUND 
(0 references)
 
pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     icmp 
--  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 8 limitavg 5/sec burst 10
    0     0 LPINGFLOOD  icmp 
--  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 8
    0     0 LDROP      icmp 
--  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 5
    0     0 LDROP      icmp 
--  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 13
    0     0 LDROP      icmp 
--  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 14
    0     0 LDROP      icmp 
--  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 17
    0     0 LDROP      icmp 
--  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 18
    0     0 ACCEPT     icmp 
--  *      *       0.0.0.0/0            0.0.0.0/0

Chain ICMPOUTBOUND 
(0 references)
 
pkts bytes target     prot opt in     out     source               destination
    0     0 LDROP      icmp 
--  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 5
    0     0 LDROP      icmp 
--  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 11 code 0
    0     0 LDROP      icmp 
--  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 11 code 1
    0     0 LDROP      icmp 
--  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 12
    0     0 LDROP      icmp 
--  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 13
    0     0 LDROP      icmp 
--  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 14
    0     0 LDROP      icmp 
--  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 17
    0     0 LDROP      icmp 
--  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 18
    0     0 ACCEPT     icmp 
--  *      *       0.0.0.0/0            0.0.0.0/0

Chain LBADFLAG 
(6 references)
 
pkts bytes target     prot opt in     out     source               destination
    0     0 LOG        all  
--  *      *       0.0.0.0/0            0.0.0.0/0           limitavg 2/sec burst 10 LOG flags 0 level 4 prefix `fp=BADFLAG:1 a=DROP '
    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain LDROP (17 references)
 pkts bytes target     prot opt in     out     source               destination
  629 25980 LOG        tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 2/sec burst 10 LOG flags 0 level 4 prefix 
`fp=TCP:1 a=DROP '
 7321 2432K LOG        udp  --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 2/sec burst 10 LOG flags 0 level 4 prefix `fp=UDP:2 a=DROP '
   
15   915 LOG        icmp --  *      *       0.0.0.0/0            0.0.0.0/0           limitavg 2/sec burst 10 LOG flags 0 level 4 prefix `fp=ICMP:3 a=DROP '
    0     0 LOG        all  -f  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 2/sec burst 10 LOG flags 0 level 4 prefix 
`fp=FRAGMENT:4 a=DROP '
 7965 2459K DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain LINVALID (2 references)
 pkts bytes target     prot opt in     out     source               destination
   52  2284 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 2/sec burst 10 LOG flags 0 level 4 prefix `fp=INVALID:1 a=DROP '
   
52  2284 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain LPINGFLOOD 
(1 references)
 
pkts bytes target     prot opt in     out     source               destination
    0     0 LOG        all  
--  *      *       0.0.0.0/0            0.0.0.0/0           limitavg 2/sec burst 10 LOG flags 0 level 4 prefix `fp=PINGFLOOD:1 a=DROP '
    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain LREJECT (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 LOG        tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 2/sec burst 10 LOG flags 0 level 4 prefix 
`fp=TCP:1 a=REJECT '
    0     0 LOG        udp  --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 2/sec burst 10 LOG flags 0 level 4 prefix `fp=UDP:2 a=REJECT '
    
0     0 LOG        icmp --  *      *       0.0.0.0/0            0.0.0.0/0           limitavg 2/sec burst 10 LOG flags 0 level 4 prefix `fp=ICMP:3 a=REJECT '
    0     0 LOG        all  -f  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 2/sec burst 10 LOG flags 0 level 4 prefix 
`fp=FRAGMENT:4 a=REJECT '
    0     0 REJECT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with tcp-reset
    0     0 REJECT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable
    0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable

Chain LSPECIALPORT (10 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 2/sec burst 10 LOG flags 0 level 4 prefix `fp=SPECIALPORT:1 a=DROP '
    
0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain LSYNFLOOD 
(1 references)
 
pkts bytes target     prot opt in     out     source               destination
    0     0 LOG        all  
--  *      *       0.0.0.0/0            0.0.0.0/0           limitavg 2/sec burst 10 LOG flags 0 level 4 prefix `fp=SYNFLOOD:1 a=DROP '
    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain SMB (3 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:137
    0     0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:138
    0     0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:139
    0     0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:445
    0     0 DROP       udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:137
  270 63585 DROP       udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:138
    0     0 DROP       udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:139
    0     0 DROP       udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:445
    0     0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp spt:137
    0     0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp spt:138
    0     0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp spt:139
    0     0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp spt:445
    0     0 DROP       udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp spt:137
    0     0 DROP       udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp spt:138
    0     0 DROP       udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp spt:139
    0     0 DROP       udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp spt:445

Chain SPECIALPORTS (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 LSPECIALPORT  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:6670
    0     0 LSPECIALPORT  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:1243
    0     0 LSPECIALPORT  udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:1243
    0     0 LSPECIALPORT  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:27374
    0     0 LSPECIALPORT  udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:27374
    0     0 LSPECIALPORT  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpts:6711:6713
    0     0 LSPECIALPORT  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpts:12345:12346
    0     0 LSPECIALPORT  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:20034
    0     0 LSPECIALPORT  udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpts:31337:31338
    0     0 LSPECIALPORT  udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:28431

Chain TCPACCEPT (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x17/0x02 limit: avg 5/sec burst 10
    0     0 LSYNFLOOD  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x17/0x02
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:!0x17/0x02 
Is this acceptable?
 
Old 09-16-2010, 07:06 AM   #14
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
Originally Posted by metallica1973
and as you can see there is no data for the tenth!
I'm assuming the innocent explanations for that have been ruled out (i.e. someone turned off the computer). If so, then yeah, this is starting to stink.

Quote:
Originally Posted by metallica1973
After thinking about it, why would a smart hacker change the root password and instantly give him or her away? It doesnt make sense.
I agree it doesn't make sense, but there are a couple of explanations. First, maybe this isn't a smart cracker and second, maybe they put themselves into a situation where they needed to change it if they wanted to continue root access. Depending on the machine, it might be some time before someone discovers that the password has changed and depending on the situation, it may take longer to determine it was changed by someone unauthorized. What this does highlight though is the need to spend some quality time developing some facts on the machine.

Quote:
Originally Posted by metallica197
here is the root directory on the system. Do these files and directories look normal?
You would be the better judge of that. Are there things that look out of place? One thing that does strike me is that none of those files have been modified since the 10th. However, if someone is installing stuff, it is probably more likely that they put it someone much less obvious than in /root.

I think at this point it would be useful to do a few things. First, look to see if there is anything unusual running on the box. The ps, lsof and netstat commands I posted earlier would be a good place to start. If there are unusual services, that is not a good sign. If the normal complement of stuff is there, it would be good to verify that the binaries are what is expected using rpm -Vv. Second, since you do have a date, I would examine the machine for files that have been altered or added since the 10th. Since the root password changed, I would also have a good look at root's .bash_history and see if anything jumps out as bizarre. If they have managed to alter the logs, they have probably also altered .bash_history, but it probably doesn't hurt to take a look. Look at your last output and see if any new users crop up or if old users are logging in at unusual times (particularly root).

By the way, feel free to email me any output too big to post here.

Last edited by Hangdog42; 09-16-2010 at 07:10 AM.
 
1 members found this post helpful.
Old 09-16-2010, 11:52 AM   #15
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
Many thanks for all the responses. How is my firewall looking?
 
  


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
root password changed lemon09 Linux - Newbie 8 08-18-2009 04:50 AM
My root password has changed?!!! defa0009 Linux - Security 35 05-18-2005 04:49 PM
system changed my root-password supersucker Linux - Software 2 01-16-2005 01:12 PM
Help Root password changed!!! UmneyDurak Fedora 4 09-28-2004 01:47 PM
someone changed my root password. what do i do? budds Linux - Security 4 09-12-2004 12:09 AM

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

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