LinuxQuestions.org
Help answer threads with 0 replies.
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 01-22-2007, 08:06 AM   #1
merchtemeagle
Member
 
Registered: Oct 2004
Location: Belgium
Distribution: Slackware 13.37
Posts: 512

Rep: Reputation: 31
chkrootkit: tcpd


When I run chkrootkit, it reports:

Checking `tcpd'... INFECTED

I reinstalled the tcpip package from the Slackware DVD but chkrootkit still returns the same output.
 
Old 01-22-2007, 08:58 AM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
If you really have a rootkit, you'll probably need to reinstall your system.

unSpawn is our resident security expert (and maintainer of rkhunter, which you may want to try as well) and can probably tell you a lot more than I can.
 
Old 01-22-2007, 09:03 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
What version of Chkrootkit? Please run Chkrootkit with the "-x" and "-d" flags, output to file, then post the relevant part of output between BB code tags. If you have any doubt use the Intruder Detection Checklist (CERT): http://www.cert.org/tech_tips/intrud...checklist.html to get assurance. If you have more than a hunch run checks from a Live CD like Hlix, KNOPPIX-(STD), Fire or equiv.
 
Old 01-22-2007, 09:14 AM   #4
merchtemeagle
Member
 
Registered: Oct 2004
Location: Belgium
Distribution: Slackware 13.37
Posts: 512

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by unSpawn
What version of Chkrootkit? Please run Chkrootkit with the "-x" and "-d" flags, output to file, then post the relevant part of output between BB code tags. If you have any doubt use the Intruder Detection Checklist (CERT): http://www.cert.org/tech_tips/intrud...checklist.html to get assurance. If you have more than a hunch run checks from a Live CD like Hlix, KNOPPIX-(STD), Fire or equiv.
Both at the same run?
 
Old 01-22-2007, 09:39 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
"-d" basically is "set -x", which should show what it reacts on and "-x" dumps all output which could come in handy to see if it's a simple FP based on say a bad anchored grep. You'll find tcpd starting near line 20000, look for "thing=tcpd", continue until the next thing= line, aprox 300 lines of output. Posting the relevant part of the output file looks way too large to post to me so cut out the part, compress it and provide a D/L location if you can or maybe post the lines in some pastebin on teh intarweb and provide a URI?
 
Old 01-22-2007, 02:10 PM   #6
merchtemeagle
Member
 
Registered: Oct 2004
Location: Belgium
Distribution: Slackware 13.37
Posts: 512

Original Poster
Rep: Reputation: 31
My chkrootkit is version 0.46 .
Code:
# chkrootkit -x -d &> rootkitlog
$ grep -i "thing=tcpd" rootkitlog.
This last command returns nothing.
 
Old 01-22-2007, 05:11 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
This last command returns nothing.
Uh. It's not like I told you to do *that*, didn't I?
 
Old 01-22-2007, 05:17 PM   #8
merchtemeagle
Member
 
Registered: Oct 2004
Location: Belgium
Distribution: Slackware 13.37
Posts: 512

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by unSpawn
This last command returns nothing.
Uh. It's not like I told you to do *that*, didn't I?
True, what I meant is that I can't find a line "thing=tcpd" in the output of the chkrootkit run.
 
Old 01-22-2007, 06:23 PM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
OK, BTW it's at version 0.47 now. Remembering it can do separate tests, what does "chkrootkit -d tcpd" say?
 
Old 01-22-2007, 06:28 PM   #10
merchtemeagle
Member
 
Registered: Oct 2004
Location: Belgium
Distribution: Slackware 13.37
Posts: 512

Original Poster
Rep: Reputation: 31
Code:
bash-3.1# chkrootkit tcpd
ROOTDIR is `/'
Checking `tcpd'... not infected
Code:
bash-3.1# chkrootkit -d tcpd
+ '[' / '!=' / ']'
+ '[' '' '!=' t ']'
+ echo 'ROOTDIR is `/'\'''
ROOTDIR is `/'
+ for cmd in '${LIST}'
+ echo 'amd basename biff chfn chsh cron date du dirname echo egrep env find fingerd gpm grep hdparm su ifconfig inetd inetdconf identd init killall ldsopreload login ls lsof mail mingetty netstat named passwd pidof pop2 pop3 ps pstree rpcinfo rlogind rshd slogin sendmail sshd syslogd tar tcpd tcpdump top telnetd timed traceroute vdir w write'
+ /usr/bin/egrep '(^|[^A-Za-z0-9_])tcpd([^A-Za-z0-9_]|$)'
+ '[' '' '!=' t -a '' '!=' t ']'
+ printn 'Checking `tcpd'\''... '
++ /usr/bin/echo 'a\c'
++ /usr/bin/egrep c
+ /usr/bin/echo -n 'Checking `tcpd'\''... '
Checking `tcpd'... + chk_tcpd
+ STATUS=1
+ TCPD_INFECTED_LABEL='p1r0c4|hack|/dev/xmx|/dev/hdn0|/dev/xdta|/dev/tux'
+ '[' -r /etc/inetd.conf ']'
+ /usr/bin/ps auwx
+ /usr/bin/egrep xinetd
+ /usr/bin/egrep -v grep
+ '[' -z '' ']'
++ loc tcpd tcpd /usr/pkg/java/sun-1.5/bin /usr/pkg/bin /usr/pkg/xorg/bin /usr/pkg/java/sun-1.5/bin /usr/pkg/bin /usr/pkg/xorg/bin /usr/local/bin /usr/bin /bin /usr/X11R6/bin /usr/games . /sbin /usr/sbin /lib /usr/lib /usr/libexec .
++ thing=tcpd
++ shift
++ dflt=tcpd
++ shift
++ for dir in '$*'
++ case "$thing" in
++ for thisthing in '$dir/$thing'
++ :
++ test -f /usr/pkg/java/sun-1.5/bin/tcpd
++ for dir in '$*'
++ case "$thing" in
++ for thisthing in '$dir/$thing'
++ :
++ test -f /usr/pkg/bin/tcpd
++ for dir in '$*'
++ case "$thing" in
++ for thisthing in '$dir/$thing'
++ :
++ test -f /usr/pkg/xorg/bin/tcpd
++ for dir in '$*'
++ case "$thing" in
++ for thisthing in '$dir/$thing'
++ :
++ test -f /usr/pkg/java/sun-1.5/bin/tcpd
++ for dir in '$*'
++ case "$thing" in
++ for thisthing in '$dir/$thing'
++ :
++ test -f /usr/pkg/bin/tcpd
++ for dir in '$*'
++ case "$thing" in
++ for thisthing in '$dir/$thing'
++ :
++ test -f /usr/pkg/xorg/bin/tcpd
++ for dir in '$*'
++ case "$thing" in
++ for thisthing in '$dir/$thing'
++ :
++ test -f /usr/local/bin/tcpd
++ for dir in '$*'
++ case "$thing" in
++ for thisthing in '$dir/$thing'
++ :
++ test -f /usr/bin/tcpd
++ for dir in '$*'
++ case "$thing" in
++ for thisthing in '$dir/$thing'
++ :
++ test -f /bin/tcpd
++ for dir in '$*'
++ case "$thing" in
++ for thisthing in '$dir/$thing'
++ :
++ test -f /usr/X11R6/bin/tcpd
++ for dir in '$*'
++ case "$thing" in
++ for thisthing in '$dir/$thing'
++ :
++ test -f /usr/games/tcpd
++ for dir in '$*'
++ case "$thing" in
++ for thisthing in '$dir/$thing'
++ :
++ test -f ./tcpd
++ for dir in '$*'
++ case "$thing" in
++ for thisthing in '$dir/$thing'
++ :
++ test -f /sbin/tcpd
++ for dir in '$*'
++ case "$thing" in
++ for thisthing in '$dir/$thing'
++ :
++ test -f /usr/sbin/tcpd
++ echo /usr/sbin/tcpd
++ exit 0
+ CMD=/usr/sbin/tcpd
+ '[' tcpd = /usr/sbin/tcpd ']'
+ '[' '' = t ']'
+ /usr/bin/strings -a /usr/sbin/tcpd
+ /usr/bin/egrep 'p1r0c4|hack|/dev/xmx|/dev/hdn0|/dev/xdta|/dev/tux'
+ return 1
+ STATUS=1
+ '[' '' = t ']'
+ case $STATUS in
+ echo 'not infected'
not infected
 
Old 01-22-2007, 06:58 PM   #11
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Checking `tcpd'... not infected
Bummer. Opportunity gone.
 
Old 01-22-2007, 07:02 PM   #12
merchtemeagle
Member
 
Registered: Oct 2004
Location: Belgium
Distribution: Slackware 13.37
Posts: 512

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by unSpawn
Checking `tcpd'... not infected
Bummer. Opportunity gone.
I don't understand? If I run chkrootkit without the tcpd argument I still get the INFECTED warning.
 
Old 01-22-2007, 07:37 PM   #13
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
OK. Let's cut this short, then, dragging on for too long. First upgrade to version 0.47. Then run "chkrootkit -x -d 2>&1>/tmp/logfile", bzip it and post the D/L URI.
 
Old 01-22-2007, 08:05 PM   #14
merchtemeagle
Member
 
Registered: Oct 2004
Location: Belgium
Distribution: Slackware 13.37
Posts: 512

Original Poster
Rep: Reputation: 31
Did what you said:
http://wilma.vub.ac.be/~lddekeyz/logfile.bz2
 
Old 01-23-2007, 08:15 AM   #15
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
OK, I read your log:

Code:
wc -l mylog yourlog
  30242 mylog
 117019 yourlog

]# grep /tcpd mylog 
(..)
++ test -f /usr/sbin/tcpd
++ echo /usr/sbin/tcpd
+ CMD=/usr/sbin/tcpd
+ '[' -z /usr/sbin/tcpd ']'
+ '[' tcpd = /usr/sbin/tcpd ']'
+ expertmode_output '/usr/bin/strings -a /usr/sbin/tcpd'
+ echo '### Output of: /usr/bin/strings -a /usr/sbin/tcpd'
### Output of: /usr/bin/strings -a /usr/sbin/tcpd
+ eval /usr/bin/strings -a /usr/sbin/tcpd
++ /usr/bin/strings -a /usr/sbin/tcpd
/usr/include/./tcpd.h

]# grep /tcpd yourlog
/usr/include/./tcpd.h

]# egrep -n "p1r0c4|hack|/dev/xmx|/dev/hdn0|/dev/xdta|/dev/tux" mylog 
1574:+ DU_INFECTED_LABEL=/dev/ttyof|/dev/pty[pqrsx]|w0rm|^/prof|/dev/tux|file\.h
6839:+ TOP_INFECTED_LABEL=/dev/ttyop|/dev/pty[pqrs]|/dev/hda[0-7]|/dev/hdp|/dev/ptyxx|/dev/tux|proc\.h
7329:+ LS_INFECTED_LABEL=/dev/ttyof|/dev/pty[pqrs]|/dev/hdl0|\.tmp/lsfile|/dev/hdcc|/dev/ptyxx|duarawkz|^/prof|/dev/tux|/security|file\.h
9272:+ NETSTAT_I_L=/dev/hdl0/dev/xdta|/dev/ttyoa|/dev/pty[pqrsx]|/dev/cui|/dev/hdn0|/dev/cui221|/dev/dszy|/dev/ddth3|/dev/caca|^/prof|/dev/tux|grep|addr\.h
10876:+ PS_I_L=/dev/xmx|\.1proc|/dev/ttyop|/dev/pty[pqrsx]|/dev/cui|/dev/hda[0-7]|/dev/hdp|/dev/cui220|/dev/dsx|w0rm|/dev/hdaa|duarawkz|/dev/tux|/security|^proc\.h
11139:uid_hack
11466:uid_hack,pid,ppid,c,stime,tname,time,cmd
11467:f,s,uid_hack,pid,ppid,c,opri,ni,addr,sz,wchan,stime,tname,time,cmd
11626:+ PSTREE_INFECTED_LABEL=/dev/ttyof|/dev/hda01|/dev/cui220|/dev/ptyxx|^/prof|/dev/tux|proc\.h
11961:+ RLOGIN_INFECTED_LABEL=p1r0c4|r00t
20442:+ SYSLOG_I_L=/usr/lib/pt07|/dev/pty[pqrs]|/dev/hd[als][0-7]|/dev/ddtz1|/dev/ptyxx|/dev/tux|syslogs\.h
20839:+ TCPD_INFECTED_LABEL=p1r0c4|hack|/dev/xmx|/dev/hdn0|/dev/xdta|/dev/tux
21168:+ TOP_INFECTED_LABEL=/dev/xmx|/dev/ttyop|/dev/pty[pqrsx]|/dev/hdp|/dev/dsx|^/prof/|/dev/tux|^/proc\.h
28858:/usr/include/./openssl/symhacks.h

]# egrep -n "p1r0c4|hack|/dev/xmx|/dev/hdn0|/dev/xdta|/dev/tux" yourlog
58125:uid_hack
58209:uid_hack,pid,ppid,c,stime,tname,time,cmd
58210:f,s,uid_hack,pid,ppid,c,opri,ni,addr,sz,wchan,stime,tname,time,cmd
105136:gnu_hack_len
105166:gnu_hack_string
105631:gnu_hack_len
105632:gnu_hack_string
Then checked yourlog to see if they where related to /usr/sbin/tcpd. None where. Also no "infected" status found for tcpd. Besides, there's way too many output differences. Did you upgrade to version 0.47 (just to make sure)? Now I think I'm pretty comfortable with Chkrootkit in many aspects, but this got me baffled.
To summarise:
- you replaced the binary from a "known good" source (or so I hope),
- running only "tcpd" test does not return INFECTED status,
- running with debug and expert flags does not show INFECTED status for tcpd,
- Chkrootkit mailing list archives show no relevant threads on this subject,
- a diff between version 0.46a and 0.47 shows no differences I can relate to tcpd.

I suggest you first make certain (not guess or "assume") your system is clean. If unsure run test from a Live CD like Helix, KNOPPIX(-STD) or equivalent. If it is clean, attach your bzipped log and get on their mailing list or send it to Nelson directly with as much details as you can. I would appreciate it if you post back their findings.

Sorry I couldn't be of more help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
msec, tcpd, tcp_wrappers and hosts.allow RomanG Mandriva 5 04-13-2005 09:20 AM
xinetd, tcpd and libwrap on RH9 and 7.2 haylingchrist Linux - Security 3 08-14-2003 04:42 PM
tcpd And Mandrake 9 knightmare Linux - Software 3 03-03-2003 10:40 AM
tcpd -> FreeBSD morbo *BSD 1 01-30-2003 02:02 AM
tcpd on freebsd morbo Linux - Software 1 01-17-2003 03:47 AM

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

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