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.

Discover bad site

Discussion in 'Workarounds and Optimization' started by postcd, May 7, 2015.

  1. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    621
    Likes Received:
    6
    Trophy Points:
    18
    someone still buying hosting for a phishing site of a bank. So i think i need some automated script to lookup cpanel accounts created in last lets say 30 days and find if any file do not contain bank name, so im notiffied and can suspend account.

    the person is using different IPs, banning is not solution

    any idea on script whichc an work on WHM server?

    i know how to get cpanel usernames:
    for i in $(ls -A1 /var/cpanel/users/ | grep -v system); do
    # action for one cpanel account
    done

    i know i can use this command to search in files: grep -Ril "phrasse" /home/$cpaneluser/public_html

    but not sure how to work only with latest cpanels so system is not unnecessarilly overloaded by these searches
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,696
    Likes Received:
    656
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    There's no change in recent versions of cPanel that will make searching through files any less or more resource intensive. Note that you may want to consult with a third-party developer if you are looking for help developing a custom script.

    Thank you.
     
  3. iso99

    iso99 Well-Known Member

    Joined:
    Jan 5, 2011
    Messages:
    87
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    /var/cpanel/accounting.log will show which new accounts were created
     
  4. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    621
    Likes Received:
    6
    Trophy Points:
    18
    Thank You, it helped, the account name can be extracted from that file. Here is the script which does it.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,696
    Likes Received:
    656
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator

Share This Page