Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2008, 10:59 AM
Aleksandr
 
Posts: n/a
Default Unusual problems with Slackware 9.0 (kernel 2.4.20)

Hey all,
I am experiencing some very strange problems on two boxes running
Slackware 9.0. Here are some of the details:

System 1: generic AMD Athlon 900, Tekram SCSI card, IBM 36GB SCSI disk
System 2: generic Intel 600Mhz PIII, PIIX IDE, 16GB IDE disk

Both boxes previously ran other, older versions of Slackware on the
same hardware in the past w/o problems.

Both systems are newly reinstalled with Slack 9. Default kernel of
2.4.20, custom compiled and extremely stripped. I do not use LKMs or
compile the kernel with module support. All file systems run
ReiserFS.

System 1 runs normal "net" services--httpd, sendmail, POP3, IMAP, ssh.
It has local users.
System 2 is very stripped down. No users capable of local access
other than root. It runs sshd, syslog -r (its a log repository for
some routers), MRTG, big brother (neither of which open ports), httpd.

System 1 was installed on August 27th and has been up since then. It
has run fine until early morning of Sept 2nd.

System 2 was installed on August 26th and "went bad" (I'll explain
more later) on August 29th. I reinstalled on the 30th and it almost
immediately went bad on me while I was on the console doing
post-configuration. At the time the only thing running was sshd and
possibly httpd.

Now, what has been happening:

Various system binaries, mostly in /bin are changing in size and
thusly seg faulting and failing to operate. Nearly every binary in
/bin is affected, including mount, umount, sync, rm, gzip, cp, more,
etc. Oddly, ps has the correct file size (I am comparing with a known
good slack 9 system). A few binaries in /sbin are affected as well.
I haven't found anything in /lib, or /usr/lib that is different. I
just noticed that binaries in /usr/local/bin, all of which are custom
installed binaries, are affected as well.

Comparing the output of strings on sample binaries on an 'affected'
system versus a clean system shows that the binaries are exactly the
same for most of the file and then the bad binary begins to show ASCII
gibberish in the strings output whereas the clean file does not.

Now my first thought was immediately "hack!", but I don't think this
is the case here. I've seen many hacks of many linux boxes, and while
I am not an expert, I have done enough forensics of hacked linux boxes
to get 'gut feelings' of whether a box has been rooted.

Here are a few reasons why I don't think the boxes have been rooted:

1. I don't see a need for a hacker or rootkit to replace binaries such
as cp, more, gzip, sync, etc. Usually things like ps, ls, find,
netstat, etc., are replaced. Often an LKM is installed to further
obfuscate things, but that is not possible on these two boxes.

2. While writing this post and investigating /usr/local/bin, I noticed
that custom compiled and installed software like pngtogd and gd2topng
(part of the GD graphics library) are also affected. There is no
reason for a hacker to touch files like this.

3. System #2 "went bad" while I was on the console in the process of
configuring it. The only user capable of logging into that box is
root and I would have noticed console messages had root logged in
remotely via SSH while I was working on the system. Also, it takes at
least a little bit of time for a script-kiddie to compile their
software, clean out log files, etc., during which time they would be
naked and visible.

4. For the most part, script-kiddies and amateur hackers are extremely
careless and leave signs of their activities all over the system.
(.history files, stuff in /tmp, not noticing that my syslog.conf is
not the default and I log to different file names, etc.). Neither
system shows any evidence at all of activity, other than the
differently sized binaries.

Oddities that point to a possible hack:

1. Both boxes show the exact same file sizes on affected files. The
files are always the same ones being affected. Could be indicative of
a standard root kit, but again, why would a root kit replace gd
executables?

Something that just occurred to me is that I believe the file system
corruption occurred on each box right after I scp'ed a file from a
different system to that box.

On system #2, before it went bad, I was having a problem with
in.tftpd. After doing a little research I found that in.tftpd is
broken in slack 8.1 and 9.0. People reported success with versions
from 8.0 and earlier. I scp'ed a copy of in.tftpd from an older box.
Shortly thereafter the problems began and I had to rebuild the system.

On system #1, a user needed a copy of swish-e, which I had on another
system, so I scp'ed it to the system the night of Sept 1st. The
system 'went bad' on Sept. 2nd.

The above may be just coincidental though.

Does anyone have any thoughts on a very puzzling and frustrating
problem?

Thanks in advance for any ideas or suggestions!
Jay
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-18-2008, 10:59 AM
Alan Hicks
 
Posts: n/a
Default Re: Unusual problems with Slackware 9.0 (kernel 2.4.20)

In article <ec4082b3.0309012255.24f2e7c8@posting.google.com >, Aleksandr wrote:
>
> Now my first thought was immediately "hack!"


My first thought was "bad memory". Your symptoms seem indicative of
that, except for the part about the files becoming the same size on
each of the two boxes. Can you verify that the files are the same using
md5sum? If the files are the same, then it almost definately is not bad
memory! Having two boxes with different memory chips appending the same
random data to the same files is just too weird.

> 2. While writing this post and investigating /usr/local/bin, I noticed
> that custom compiled and installed software like pngtogd and gd2topng
> (part of the GD graphics library) are also affected. There is no
> reason for a hacker to touch files like this.


Hmm... I've never heard of anyone with your condition before, but you
are using some custom compiled software which I'm not familiar with. Is
this software common to both machines, and if so, could it be the
source of your trouble?

> 1. Both boxes show the exact same file sizes on affected files. The
> files are always the same ones being affected. Could be indicative of
> a standard root kit, but again, why would a root kit replace gd
> executables?


Again, verify that these files are identical with md5sum.

> Something that just occurred to me is that I believe the file system
> corruption occurred on each box right after I scp'ed a file from a
> different system to that box.


That doesn't make a whole lot of sense though. scp is just a simple
copy program tunneled through ssh. Why would that touch the majority of
your files in /bin? Unless possibly you scp'ed these files from the
same machine, and that machine has something very wrong with it.

> The above may be just coincidental though.


Most likely they are, but that's just too damned coincidental not to
mean something if you ask me (and you did).

> Thanks in advance for any ideas or suggestions!


Let us know when you get it fixed. I'm going to try to scp something
from another machine to a slackware 9.0 box today and see what happens.

--
It is better to hear the rebuke of the wise,
Than for a man to hear the song of fools.
Ecclesiastes 7:5
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-18-2008, 10:59 AM
Joost Kremers
 
Posts: n/a
Default Re: Unusual problems with Slackware 9.0 (kernel 2.4.20)

Alan Hicks wrote:
> In article <ec4082b3.0309012255.24f2e7c8@posting.google.com >, Aleksandr wrote:
>> 1. Both boxes show the exact same file sizes on affected files. The
>> files are always the same ones being affected. Could be indicative of
>> a standard root kit, but again, why would a root kit replace gd
>> executables?

>
> Again, verify that these files are identical with md5sum.


i cannot imagine anything but a cracker if the files are indeed
identical. perhaps someone is just messing up your boxen to watch you
squirm..

>> Something that just occurred to me is that I believe the file system
>> corruption occurred on each box right after I scp'ed a file from a
>> different system to that box.

>
> That doesn't make a whole lot of sense though. scp is just a simple
> copy program tunneled through ssh. Why would that touch the majority of
> your files in /bin? Unless possibly you scp'ed these files from the
> same machine, and that machine has something very wrong with it.


or scp (or ssh?) is compromised?

i don't really know, though. never had to deal with such issues.

--
Joost Kremers
since when is vi an editor? a discussion on vi belongs in
comp.tools.unusable or something...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-18-2008, 10:59 AM
Alan Hicks
 
Posts: n/a
Default Re: Unusual problems with Slackware 9.0 (kernel 2.4.20)

Joost Kremers wrote:
> i cannot imagine anything but a cracker if the files are indeed
> identical.


Neither can I; it's just very strange not to see any other signs.
That's why it would be helpful to do an md5sum to verify they are
indeed indentical. It could be that he used something like 'ls -lh' to
list the files and got approximations.

>> That doesn't make a whole lot of sense though. scp is just a simple
>> copy program tunneled through ssh. Why would that touch the majority of
>> your files in /bin? Unless possibly you scp'ed these files from the
>> same machine, and that machine has something very wrong with it.

>
> or scp (or ssh?) is compromised?


That would be my conclusion. It seems likely even that this could be
the case if he is scp;ing these files from the same machine. You've got
to look at what is common between these two boxes to see what is
causing the behavior, and it seems scp or ssh is our culprit. By any
chance, you wouldn't be using the same root password on all these boxes
now, would you?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-18-2008, 11:00 AM
Aleksandr
 
Posts: n/a
Default Re: Unusual problems with Slackware 9.0 (kernel 2.4.20)

Alan Hicks <someone@news4.sucknews.com> wrote in message news:<slrnbl9f0q.11p.someone@sentinel.custom-consulting.com>...
> Joost Kremers wrote:
> > i cannot imagine anything but a cracker if the files are indeed
> > identical.

>
> Neither can I; it's just very strange not to see any other signs.
> That's why it would be helpful to do an md5sum to verify they are
> indeed indentical. It could be that he used something like 'ls -lh' to
> list the files and got approximations.
>
> >> That doesn't make a whole lot of sense though. scp is just a simple
> >> copy program tunneled through ssh. Why would that touch the majority of
> >> your files in /bin? Unless possibly you scp'ed these files from the
> >> same machine, and that machine has something very wrong with it.

> >
> > or scp (or ssh?) is compromised?

>
> That would be my conclusion. It seems likely even that this could be
> the case if he is scp;ing these files from the same machine. You've got
> to look at what is common between these two boxes to see what is
> causing the behavior, and it seems scp or ssh is our culprit. By any
> chance, you wouldn't be using the same root password on all these boxes
> now, would you?


I've got a few updates from further research I did today.

I reinstalled system #2 from scratch again today, and sure enough it
"went bad" on me about 15 minutes after the reinstall. Based on what
I was doing at the time, I now highly doubt the possibility of
hacking. The only service running at the time was sshd, root was the
only user on the system, and the password had been randomly created 10
minutes earlier (8 characters, mixed case, totally random, etc.).

In order for this box to have been hacked, someone would have had to
have a remote exploit for OpenSSH 3.6.1, which I don't believe exists,
or brute-forced a random password in about 10 minutes, all while I was
on the system console. Highly unlikely set of circumstances.

So, now I am looking at the possibility that my install media may be
bad. As this is a "custom" slackware 9, this may be possible.
Basically, I took a stock slack 9 CD1, updated any security issues
with new packages from slackware.com, created custom tagfiles, and
added extra local software. An ISO was created of this and then
burned to CD.

The only thing I have against the possibility of bad install media is
that at least one of my 'good' slack 9 systems was installed from the
exact same CD and has been up and stable for more than 60 days now.
All of the systems that have become corrupted have done so within a
time frame of 10 minutes to 3 or 4 days.

This got me into thinking deeply about what may be different about the
server that is still functioning, and the ones that keep getting
corrupted. Aside from hardware differences, the only difference I can
find is that the good server is running Apache 2.0.x, while the bad
servers are running Apache 1.3.27. These versions of apache are all
custom-compiled add-on software, not the copy included in Slack 9.

I find it hard to believe that Apache could cause problems like this,
but so far this whole issue has been hard to believe. I will do a bit
more testing to try to narrow down the problem further.

Aleks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-18-2008, 11:00 AM
Jurgen Philippaerts
 
Posts: n/a
Default Re: Unusual problems with Slackware 9.0 (kernel 2.4.20)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Sep 02, 2003 at 05:17:18PM -0700, Aleksandr wrote:

> I reinstalled system #2 from scratch again today, and sure enough it
> "went bad" on me about 15 minutes after the reinstall. Based on what


try installing one, without networking it. see if it goes bad on you
like that. put all extra sources you like to compile on a cd, and use
that, if you need extra things not included on your slackware CD.

verify the source tarballs with the original files on the ftp site,
making sure signatures match. you'ge got some crazy things happening
there


Jurgen.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/VZ5z1ucXIiwNwbURArgkAJ0cfWQ5LVkzGGDW18GpfmVnMPTX5A CfeRj7
3vy/tp0AaZy9jLJT1AmLE6M=
=EUih
-----END PGP SIGNATURE-----
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-18-2008, 11:02 AM
Aleksandr
 
Posts: n/a
Default Re: Unusual problems with Slackware 9.0 (kernel 2.4.20)

Jurgen Philippaerts <jurgen@see.my.pgp.key> wrote in message news:<20030903075533.GA365@anubis.is.traumatized.o rg>...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> verify the source tarballs with the original files on the ftp site,
> making sure signatures match. you'ge got some crazy things happening
> there
>


Well, I think I have finally narrowed down and eliminated the problem.
It seems to have been caused by a particular install CD I was using.
I have two copies of my custom slack 9 CD. Both are identical (or
should be), other than the kernel used for booting. The "bad" CD uses
the stock kernels included with the Slack 9 CD1. On the good CD I
recompiled all of the kernels to use SMP and disable USB because of a
weird conflict I was having with an Adaptec SCSI card (it only works
with an SMP kernel).

I finally realized that the Slack 9 machines that were not getting
corrupted had all been installed with the SMP kernel CD, while the two
systems I was writing about here had been constantly installed and
reinstalled with the stock kernel CD. Perhaps something got munged
during the ISO creation or the CD burning, or even afterwards. At
this point, I don't even want to bother to figure out what was wrong
with it. I cracked the bad CD in half in front of my other CDs as a
lesson to them

Thanks everyone for all of the suggestions put forth!

Aleks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-18-2008, 11:02 AM
Joost Kremers
 
Posts: n/a
Default Re: Unusual problems with Slackware 9.0 (kernel 2.4.20)

Aleksandr wrote:
> with it. I cracked the bad CD in half in front of my other CDs as a
> lesson to them


well, that should teach them! ;-)

--
Joost Kremers
since when is vi an editor? a discussion on vi belongs in
comp.tools.unusable or something...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:36 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
UnixAdminTalk.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656