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.

Change permissions via PHP is possible?

Discussion in 'General Discussion' started by srh124, Sep 11, 2014.

  1. srh124

    srh124 Member

    Joined:
    Sep 11, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hi all.
    My question - though a beginner question- is simple. Is it possible to change permission via PHP code - or any other PL- ?

    More Info: I have a wordpress site in a shared host. A hacker was using my site for sending mass spam emails, and host provider suspended my account (changed some folder permission to 000). Although i removed infected files, i couldn't find backdoor created by hacker. Now, i got to the point of restoring a healthy backup of 1 month ago. Also, i wanna change permission of nearly all folders to only readable/excutable (555). Does it prevents hacker from uploading new files /injecting malicious codes or it is still available via PHP coding?

    Thanks in advance
    (and sorry for bad english. I'm in emergency state now to keep my site alive)
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Changing permissions will not always address a vulnerability with a script. Is the script updated to the latest version? Is it a custom PHP script or a CMS such as WordPress?

    Thank you.
     
  3. srh124

    srh124 Member

    Joined:
    Sep 11, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Yes. it is wordpress with lastest version. I wanted to restrict folders which not changing frequently and hence preventing hackers from uploading new files /injecting malicious codes into those folder. If he still can change permissions via PHP code (in other unrestricted folders), so changing permissions to 555 in cPanel is useless.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Do you have root access to this server? If not, please report the issue to your web hosting provider, as typically this needs to be addressed by someone with root access.

    Thank you.
     
Loading...

Share This Page