Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 14 of 14
  1. #1
    Member
    Join Date
    May 2004
    Posts
    58

    Default I am Hacked... just found vadimII on my server

    Suddenly I checked the processed and found that there are few malicious codes on my server under /var/spool/samba

    I am running Redhat 9 + apache 1.33 + PHPSuexec. I have checked and found that 1 or 2 of them are IRC Bots and other I don't know but there name seem suspicious.

    Please tell me that How do I prevent users to access these types of folders ?


    I just found an vadimII under /var/spool/samba and I don't know whether I am hacked or not. I have suspended the user.

    Please tell me how do I checked that whether my server is hacked or not

  2. #2
    Member
    Join Date
    Feb 2005
    Posts
    5

    Default

    You should really get a professional too look at the server and diagnose it, you may have to have the server restored, there is alot of server administration companies out there that have reasonable rates and can help you out.
    AdminWAY Administration Services
    Providing top notch server administration services.
    -
    adam@adminway.net

  3. #3
    Member
    Join Date
    May 2004
    Posts
    58

    Default

    I have resolved it.................my server is not compromised anymore.

    but I still have a question that I found VadimII at 2 locations : /dev/shm and /var/spool/samba and one place it was created with some user and at second location it belongs to some other user. I mean that one place the owner user was different and at the second place the ownser was different.

    Both the users belongs to our 2 different clients and I am really wondering that who was the culprit

  4. #4
    Member
    Join Date
    Mar 2002
    Location
    San Francisco
    Posts
    257

    Default

    Check their passwords, we had a client who created users and passwords the same and he was cracked by a brute force.

    Also, check into good mod security rules to prevent folks who do hack from doing bad things.

    Here is a good rule I saw during the phpworm issues:

    SecFilterSelective "THE_REQUEST" "(system|exec|passthru|popen|shell_exec|proc_open|fopen|fwrite)\s*\("

    This tends to make it hard for scripties to do shell stuff. It also kills the phpBB google worm

    Another thing you should look into are rootkits. rkhunter and chkrootkit. Run those just in case

    HTH

  5. #5
    Member
    Join Date
    Oct 2002
    Posts
    751

    Default

    Quote Originally Posted by denisdekat09
    SecFilterSelective "THE_REQUEST" "(system|exec|passthru|popen|shell_exec|proc_open|fopen|fwrite)\s*\("
    I've seen that rule a lot also, but it doesn't work exactly like you would expect, because \s* is not recognized properly.

    \s*\( should mean 0 or more whitespace characters followed by a (

    While this rule blocks system(..) , it does NOT block system (..).
    At least not when I tried it

    Using [[:space:]]* is what worked for me

  6. #6
    Member
    Join Date
    Mar 2002
    Location
    San Francisco
    Posts
    257

    Default

    so use this:

    SecFilterSelective "THE_REQUEST" "(system|exec|passthru|popen|shell_exec|proc_open|f open|fwrite)\s*\("

    and this:

    SecFilterSelective "THE_REQUEST" "(system|exec|passthru|popen|shell_exec|proc_open|f open|fwrite)\s *\("

    ?


    What does your rule look like to prevent this?

  7. #7
    Member
    Join Date
    May 2004
    Posts
    58

    Default

    Are you talking about having mod_security Apache Module ?

    unfortunately I am not having it

  8. #8
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Then install it. As was already recommended above, if you don't know how to do these things, you should hire someone who does. there's little point in cleaning up a successful exploitation and nothing more as it will simply happen again.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  9. #9
    Member
    Join Date
    Oct 2002
    Posts
    751

    Default

    Just use [[:space:]]* instead of s* like this:

    SecFilterSelective "THE_REQUEST" "(system|exec|passthru|popen|shell_exec|proc_open|f open|fwrite))([[:space:]]*)\("

    This blocks the commands regardless of the number of spaces used. The ( ) around [[:space:]]* are probably not necessary.


    You could also also add ARGS_VALUES like this :

    SecFilterSelective "THE_REQUEST|ARGS_VALUES" "(system|exec|passthru|popen|shell_exec|proc_open|f open|fwrite))([[:space:]]*)\("

    You could consider using SecFilter instead of SecFilterSelective with this rule though, since you want to block POST requests as well, not only GET requests.
    I haven't had any false positives using SecFilter with this rule, it just depends on the type of sites you have on the server.
    Last edited by jamesbond; 02-15-2005 at 10:39 AM.

  10. #10
    Member
    Join Date
    Mar 2002
    Location
    San Francisco
    Posts
    257

    Default

    Thanks double o' seven Great ideas!

  11. #11
    Member
    Join Date
    May 2004
    Posts
    58

    Default

    Can anyone please explain a little bit that what does this following directive meant for......I mean what does it do ?

    SecFilterSelective "THE_REQUEST|ARGS_VALUES" "(system|exec|passthru|popen|shell_exec|proc_open|f open|fwrite))([[:space:]]*)\("
    Last edited by checked; 02-23-2005 at 10:08 AM.

  12. #12
    Member
    Join Date
    Mar 2002
    Location
    San Francisco
    Posts
    257

    Default

    Check out modsecurity.org for a good explanation.

    http://modsecurity.org/documentation/index.html is good too.

    good article I found on their page:

    http://www.hackinthebox.org/article.php?sid=12867

    The idea is to watch for these patterns in url injections (be they post or get) so as to prevent kiddies from running unix like or php commands or injecting php commands into your code or client's code.

  13. #13
    Member
    Join Date
    May 2004
    Posts
    58

    Default

    thanks denis that is really helpful

  14. #14
    Member
    Join Date
    Mar 2002
    Location
    San Francisco
    Posts
    257

    Default

    I just found that this got through somehow:

    %252esystem(chr(101)%252echr(99)%25
    Do you think adding esystem in there woudl help? I am tring to figure out how come it did not catch it....

    I am thinking of using this now:

    SecFilter "(system|esystem|exec|passthru|popen|shell_exec|proc_open|fopen|fwrite))([[:space:]]*)\("
    Last edited by denisdekat09; 05-30-2005 at 12:17 PM.

Similar Threads & Tags
Similar threads

  1. Server Hacked - Found out how
    By ramzex in forum cPanel and WHM Discussions
    Replies: 14
    Last Post: 08-14-2009, 07:46 AM
  2. hacked server
    By sphost in forum cPanel and WHM Discussions
    Replies: 17
    Last Post: 07-11-2009, 09:52 PM
  3. Server get hacked
    By vishwas in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 12-02-2005, 04:49 AM
  4. vadimII on my box after switch proftpd with pure-ftpd ?
    By cybernux in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-25-2004, 08:39 AM
  5. server hacked....
    By mitul in forum cPanel and WHM Discussions
    Replies: 18
    Last Post: 06-18-2003, 05:19 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube