Iframe Injection

Started on the old forum in October 2009 · view the original in the archive · old links redirect here

19 replies · 1,323 views · started 17 years ago · 1 min read

7 participants
ewanz Developer · 187 posts #1

hello.. my site just got iframe injection... who know to how to prevent it happen from hacker? 8)

our lfe is simple words.... 😌 http://mygenkz.net ewanz06@yahoo.com

$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file); 
subzero Super moderator Fellow · 3,954 posts #2
if(preg_match("(<script|<about|<applet|<iframe|<activex|<chrome|<object|>|<|<a|<img|/>|;|')", $message)) {  
$message = 'Contains illegal tags.';  
} 

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Mysterio Lead · 630 posts #3

How to use this code, SubZero (may i call you UnderZero 😛 ) ?

mysterio.al - programming is a functional art

subzero Super moderator Fellow · 3,954 posts #4

change $message with your text or main script

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

CreativityKills Lead · 833 posts #5

Gud stuff sub bt in reality those regular expression can be bypassd easy by a lil sense. Just use htmlentities or htmlspecialchars or to be completely sure strip_tags. If u must use regex or sumtin wateva, specify whitelist NEVER blacklist.

ewanz Developer · 187 posts #6

subzero wrote:

if(preg_match("(<script|<about|<applet|<iframe|<activex|<chrome|<object|>|<|<a|<img|/>|;|')", $message)) {  
$message = 'Contains illegal tags.';  
} 

Just put these codes in part for shout, chat, pm, and post forum.. is it true? 😊

our lfe is simple words.... 😌 http://mygenkz.net ewanz06@yahoo.com

$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file); 
ewanz Developer · 187 posts #7

mobileGIGS wrote: Gud stuff sub bt in reality those regular expression can be bypassd easy by a lil sense. Just use htmlentities or htmlspecialchars or to be completely sure strip_tags. If u must use regex or sumtin wateva, specify whitelist NEVER blacklist.

This iframe injection were posted by some malwares or malicious codes bypass ftp from the pc.. is it true?8)

our lfe is simple words.... 😌 http://mygenkz.net ewanz06@yahoo.com

$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file); 
ewanz Developer · 187 posts #8

i clear all my scripts in file manager.. then i changed the ftp, database n cpanel password, that iframe not come again in my script...

our lfe is simple words.... 😌 http://mygenkz.net ewanz06@yahoo.com

$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file); 
subzero Super moderator Fellow · 3,954 posts #9

you can use it for file host or anything to do with input

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

ewanz Developer · 187 posts #10

you mean put anywhere in part of text post?

our lfe is simple words.... 😌 http://mygenkz.net ewanz06@yahoo.com

$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file); 
subzero Super moderator Fellow · 3,954 posts #11

as long you change $message to you want it to be

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

ewanz Developer · 187 posts #12

$shtxt = $shtxt; if(preg_match("(<script|<about|<applet|<iframe|<activex|<chrome|<object|>|<|<a|<img|/>|;|')", $shtxt)) {
$shtxt = 'Contains illegal tags.';
} //$uid = getuid_sid($sid); $shtm = time(); $res = mysql_query("INSERT INTO ibwf_shouts SET shout='".$shtxt."', shouter='".$uid."', shtime='".$shtm."'"); if($res)

i change it... is it right?

our lfe is simple words.... 😌 http://mygenkz.net ewanz06@yahoo.com

$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file); 
blackhowk Senior · 411 posts #13

Preventing SQL Injection with PHP

When you start working with dynamic websites, and therefore the use of data retreaved from a database, you always want to make sure your script is safe. $_POST and $_GET variables are simply to adjust in scripts and url's. Prevent SQL Injection by using a script like thisone. It checks whether the magic_quotes_gpc is enabled or not. If it is, it won't have to add the escaping slashes in front of each qoute or double quote. You don't want 2 slashes in front of it when it is enabled.

function:
[COLOR=#000000][COLOR=#0000BB]?php 
    [/COLOR][COLOR=#007700]function [/COLOR][COLOR=#0000BB]mysql_prepare[/COLOR][COLOR=#007700]( [/COLOR][COLOR=#0000BB]$value [/COLOR][COLOR=#007700]) { 
        [/COLOR][COLOR=#0000BB]$magic_quotes_active [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]get_magic_quotes_gpc[/COLOR][COLOR=#007700](); 
        [/COLOR][COLOR=#0000BB]$new_enough_php [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]function_exists[/COLOR][COLOR=#007700]( [/COLOR][COLOR=#DD0000]"mysql_real_escape_string" [/COLOR][COLOR=#007700]);  
        if( [/COLOR][COLOR=#0000BB]$new_enough_php [/COLOR][COLOR=#007700]) { [/COLOR][COLOR=#FF8000]// PHP v4.3.0 or higher 
            [/COLOR][COLOR=#007700]if( [/COLOR][COLOR=#0000BB]$magic_quotes_active [/COLOR][COLOR=#007700]) { [/COLOR][COLOR=#0000BB]$value [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]stripslashes[/COLOR][COLOR=#007700]( [/COLOR][COLOR=#0000BB]$value [/COLOR][COLOR=#007700]); } 
            [/COLOR][COLOR=#0000BB]$value [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]mysql_real_escape_string[/COLOR][COLOR=#007700]( [/COLOR][COLOR=#0000BB]$value [/COLOR][COLOR=#007700]); 
        } else { [/COLOR][COLOR=#FF8000]// before PHP v4.3.0 
            [/COLOR][COLOR=#007700]if( ![/COLOR][COLOR=#0000BB]$magic_quotes_active [/COLOR][COLOR=#007700]) { [/COLOR][COLOR=#0000BB]$value [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]addslashes[/COLOR][COLOR=#007700]( [/COLOR][COLOR=#0000BB]$value [/COLOR][COLOR=#007700]); } 
        } 
        return [/COLOR][COLOR=#0000BB]$value[/COLOR][COLOR=#007700];  
    } 
[/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]
 example:
[COLOR=#000000][COLOR=#0000BB]<?php 
$id [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]mysql_prepare[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'id'[/COLOR][COLOR=#007700]]); 
[/COLOR][COLOR=#0000BB]$query [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]"SELECT * FROM pages WHERE id = "[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$id[/COLOR][COLOR=#007700]; 
[/COLOR][COLOR=#0000BB]mysql_query[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$query[/COLOR][COLOR=#007700]); 
[/COLOR][COLOR=#0000BB]?>[/COLOR][/COLOR]

use this idea, works fine.

CreativityKills Lead · 833 posts #14

ewanz wrote: i clear all my scripts in file manager.. then i changed the ftp, database n cpanel password, that iframe not come again in my script...

check ur db, myt have bin injected ages ago. And blackhowk ure wrng to use magic quotes in place of mysql escape. Magic q is by all means bypassable. Magic should be last resort. Check dis.

function dbParse($input){
if(magic_quotes_gpc())$input=stripslashes($input);
if(function_exists('mysql_real_escape_string')){
$input=mysql_real_escape_string($input);
}elseif(function_exists('mysql_escape_string')){
$input=mysql_escape_string($input);
}else{
$input=addslashes($input);
}
return $input;
}
cs.spot123 Junior · 27 posts #16

The simplest way to avoid iframe injection is CHMOD all files to 644... and folders to 755

ewanz Developer · 187 posts #18

well.. i dont know how to use with my scripts.. how to use it for lavalair?

our lfe is simple words.... 😌 http://mygenkz.net ewanz06@yahoo.com

$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file); 
ewanz Developer · 187 posts #19

kiLLeR-eyEd_14 wrote: Someone upload this iframe injector in my downloads but i just rofl at him..:p

how you make it? 8)

our lfe is simple words.... 😌 http://mygenkz.net ewanz06@yahoo.com

$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file); 
ewanz Developer · 187 posts #20

cs.spot123 wrote: The simplest way to avoid iframe injection is CHMOD all files to 644... and folders to 755

but some folder in my script need to chmood 777 😊...

our lfe is simple words.... 😌 http://mygenkz.net ewanz06@yahoo.com

$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file); 

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close