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.

Code search in all files

Discussion in 'General Discussion' started by bigskinsfan, Mar 6, 2013.

  1. bigskinsfan

    bigskinsfan Registered

    Joined:
    Mar 6, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Is there a way to search the code of all files of a site at one time? Currently using WHM/cPanel 11.34.1.
    Someone has hacked one of the sites and I need to remove the malicious code. Searching file by file is somewhat of a royal pain.

    Any help would be greatly appreciated.

    Thanks.
     
  2. Jeff Shotnik

    Jeff Shotnik Well-Known Member

    Joined:
    Oct 10, 2012
    Messages:
    61
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Denver, Colorado, United States
    cPanel Access Level:
    DataCenter Provider
    There are multiple ways to do that - the following will work:

    # grep -ilr "pattern" /files/to/search
     
  3. bigskinsfan

    bigskinsfan Registered

    Joined:
    Mar 6, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page