The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

hackcheck immutable

Discussion in 'General Discussion' started by aramazan, Mar 25, 2007.

  1. aramazan

    aramazan Registered

    Joined:
    Mar 17, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    Daily /scripts/upcp contains the messages below:

    ...
    Fetching http://httpupdate.cpanel.net/cpanelsync/RELEASE-x86_64/scripts/hackcheck.bz2 (0)....@69.90.250.35......connected......receiving...100%......Done
    Got file ./hackcheck ok (md5 matches)
    mv: cannot move `/scripts/./hackcheck' to `/scripts/./hackcheck.unlink': Operation not permitted
    mv: cannot move `/scripts/./hackcheck-cpanelsync' to `/scripts/./hackcheck': Operation not permitted
    Done updating /scripts
    ...

    I checked /scripts/hackcheck with lsattr and it is set immutable. Looked at the diff between the freshly downloaded one (hackcheck-cpanelsync) and the frozen one (hackcheck) and here is the diff output:

    # diff hackcheck hackcheck-cpanelsync
    88c88
    < if ( $uid == 0 && $user ne "root" && $user ne "admin" ) {
    ---
    > if ( $uid == 0 && $user ne "root" && $user ne "toor" ) {

    Appears that someone hacked the hackcheck script, changed the check for "toor" to "admin" to cover himself, and then set the script immutable so daily updates won't revert his changes back.

    Now the interesting part is, supposedly hacked script (hackcheck) contains correct user checks (admin is given root privileges so that our host operator can locally intervene upon our request), and supposedly fresh update (hackcheck-cpanelsync) has check for bogus user "toor".

    Is there something that I'm missing here? (Definitely there is, but what...) Or do I have grounds to suspect that my server might be compromised?

    Thanks a lot
     
  2. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    It is rather difficult to say whether your system has been compromised. Scan your OS with rkhunter and chkrootkit applications.

    A rootkit may replace 'ps' with a version of the command that will not display information about particular processes, and may replace 'md5sum' with a version of the command that reports the expected --- though not accurate --- checksums for compromised system binaries. Other frequently-compromised binaries include ls, netstat, top; a relatively complete rootkit may include two dozen or more binaries, most of which are trojaned versions of standard system commands.

    Hope this helps!
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    No, that's perfectly normal and is simply an update to that script. You should not use the immutable flag on any of the files in /scripts otherwise you're risking the stability of cPanel and the OS on your server.
     
  4. aramazan

    aramazan Registered

    Joined:
    Mar 17, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Thank you ServerTune and chirpy. It's turned out that my dedicated hoster has set hackcheck immutable so that daily cpanel updates wouldn't revert their custom (and minuscule) change to this script.

    BTW, while the change itself is minuscule with no security concerns, I wonder what happens if cpanel makes some rather substantial changes to system management that mandates upgrading hackcheck in sync with several other files. All the files involved would be upgraded except hackcheck. Could it render the system unusable, or worse, open some unnoticed security holes? I guess I'll periodically check the diff between the immutable hackcheck and the latest version.

    Thanks and best regards
     
Loading...
Similar Threads - hackcheck immutable
  1. movielad
    Replies:
    1
    Views:
    145

Share This Page