1
Discussion & Troubleshooting / error the <IMG SRC=javascript:alert('XSS')>
« on: June 20, 2009, 03:45:39 PM »
one member with the nick site was <IMG SRC=javascript:alert('XSS')> please help with corrections.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: keyword_cloud.php *
* Autor: mawenzi ... thanks to ch?ri{Bi}² ... *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.7.x *
*************************************************************************/
$main_template = 'keyword_cloud';
define('GET_CACHES', 1);
define('ROOT_PATH', './');
define('GET_USER_ONLINE', 1);
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
if (isset($HTTP_GET_VARS['template']) || isset($HTTP_POST_VARS['template'])) {
$template = (isset($HTTP_POST_VARS['template'])) ? basename(stripslashes($HTTP_POST_VARS['template'])) : basename(stripslashes($HTTP_GET_VARS['template']));
if (!file_exists(TEMPLATE_PATH."/".$template.".".$site_template->template_extension)) {
$template = "";
}
else {
$main_template = $template;
}
}
else {
$template = "";
}
include(ROOT_PATH.'includes/page_header.php');
//--- Language Tags -----------------------------------
$lang_keyword_cloud = "Elemegim.info*Anahtar Kelimeler*";
//--- Clickstream -------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator']."".$lang_keyword_cloud."</span>";
//--- Keyword Cloud -----------------------------------
function get_keyword_cloud() {
global $site_db, $lang, $site_sess, $mode;
$output = "";
$sql = "SELECT i.word_id, i.word_text, COUNT(c.word_id) AS quantity
FROM ".WORDLIST_TABLE." i
LEFT JOIN ".WORDMATCH_TABLE." c ON i.word_id = c.word_id
WHERE keys_match > 0
GROUP BY i.word_text
ORDER BY RAND()
LIMIT 200";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
$tags[$row['word_text']] = $row['quantity'];
}
$max_size = 500; // max font size in %
$min_size = 100; // min font size in %
$max_qty = max(array_values($tags));
$min_qty = min(array_values($tags));
$spread = $max_qty - $min_qty;
if ($spread == 0) {
$spread = 1;
}
$step = ($max_size - $min_size) / ($spread);
foreach ($tags as $key => $value) {
$size = round($min_size + (($value - $min_qty) * $step));
$output .= ' <b><a href="'.$site_sess->url(ROOT_PATH."search.php?search_keywords=".$key.((!empty($mode)) ? "&mode=".$mode : "")).'" style="font-size:'.$size.'%;color:rgb('.mt_rand(0, 255).', '.mt_rand(0, 255).', '.mt_rand(0, 255).');font-family:Verdana, Arial, Helvetica, sans-serif;" title="'.$value.' '.$lang['tagged_with'].' '.$key.'">'.$key.'</b> ['.$value.']</a> ';
}
return $output;
}
//--- Ende Keyword Cloud ------------------------------
//--- Print Out ---------------------------------------
$site_template->register_vars(array(
"clickstream" => $clickstream,
"lang_keyword_cloud" => $lang_keyword_cloud,
"show_keyword_cloud" => get_keyword_cloud(),
"keyword_cloud_descr_tr" => $keyword_cloud_descr_tr,
));
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
?>
b class="title">{lang_error}</b>
<hr size="1" />
<p>{error_msg}</p>
ve bu kodla değiştiriniz.<b class="title">{lang_keyword_cloud}</b>
<hr size="1" />
{keyword_cloud_descr_deu}<hr size="1" />{keyword_cloud_descr_eng}
<br><br>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr><td class="head1">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr><td class="head1" height="20" valign="middle" align="left" >{lang_keyword_cloud}</td></tr>
</td></tr></table>
</td></tr>
<tr><td class="head1">
<table width="100%" border="0" cellspacing="0" cellpadding="20">
<tr><td align="center" valign="middle" bgcolor="#ffffff">
{show_keyword_cloud}
</td></tr></table>
</td></tr></table>
3-includes/page_header.php yi açınız"url_home" => $site_sess->url(ROOT_PATH."index.php"),
bu kodu bulup altına bu kodu ekleyiniz."url_keyword_cloud" => $site_sess->url(ROOT_PATH."keyword_cloud.php"),
"lang_200_keyword_cloud" => $lang['200_keyword_cloud'],
4-/lang/turkce/main.php yi açınız//-----------------------------------------------------
//--- [MOD] Keyword Cloud -------------
//-----------------------------------------------------
$lang['200_keyword_cloud'] = "200 Keyword Cloud";
5-Templates/sizintema/user_logininfo.html , user_loginform.html yi bilgisayarınıza indirip»<a href="{url_keyword_cloud}">{lang_200_keyword_cloud}</a>
//-----------------------------------------------------
//--- Start Configuration -----------------------------
//-----------------------------------------------------
/*
MOD VISITORS COUNTRY FLAGS
START INSERT
*/
if (!class_exists("GeoIP"))
{
include(ROOT_PATH."includes/geoip.inc");
}
$gi = geoip_open(ROOT_PATH."includes/GeoIP.dat",GEOIP_STANDARD);
$countries = array();
/*
MOD VISITORS COUNTRY FLAGS
END INSERT
*/
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$row['session_user_id'];
/*
MOD VISITORS COUNTRY FLAGS
START INSERT
*/
$cid = geoip_country_code_by_addr($gi, $row['session_ip']);
if (empty($cid)) $cid = "lan";
$countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
$username = "<img src=\"".ROOT_PATH."flags/".strtolower($cid).".gif"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$username;
/*
MOD VISITORS COUNTRY FLAGS
END INSERT
*/
$num_guests_online++;
/*
MOD VISITORS COUNTRY FLAGS
START INSERT
*/
$cid = geoip_country_code_by_addr($gi, $row['session_ip']);
if (empty($cid)) $cid = "lan";
$countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
$invitado_online_list = "<font color=\"#00FFFF\">".$num_guests_online."</font><img src=\"".ROOT_PATH."flags/".strtolower($cid).".gif"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$invitado_online_list ;
/*
MOD VISITORS COUNTRY FLAGS
END INSERT
*/
if ($num_guests_online > 1){
$invitado_online_list .= " , ";
}
"num_guests_online" => $num_guests_online,
"invitado_online_list" => $invitado_online_list,
{invitado_online_list}
bu kodu ekleyin sonra ana sayfaya bakınız;) if (!$error) {
// Start Upload
include(ROOT_PATH.'includes/upload.php');
/*
MOD CHECK FOR DUPLICATE IMAGES
START INSERT
*/
##########
# CONFIG #
##########
$check_admin = true; //do check when administrator is uploading? (true/false)
$show_image = true; //show link to the image that was previously uploaded? (true/false)
$show_member = true; //show name and link to profile page of the member who previously uploaded that file? (true/false)
##############
# END CONFIG #
##############
$md5 = "";
unset($HTTP_POST_VARS['image_md5']);
if ($user_info['user_level'] != ADMIN || $check_admin)
{
if (!empty($HTTP_POST_FILES['media_file']['tmp_name']) && $HTTP_POST_FILES['media_file']['tmp_name'] != "none")
{
$md5 = md5_file($HTTP_POST_FILES['media_file']['tmp_name']);
$file = $HTTP_POST_FILES['media_file']['filename'];
}
elseif ($remote_media_file)
{
$md5 = md5($remote_media_file);
$file = $remote_media_file;
}
if ($md5)
{
$sql = "SELECT image_id, image_name, cat_id, user_id
FROM ".IMAGES_TABLE."
WHERE image_md5 = '".$md5."'
LIMIT 1";
if ($row = $site_db->query_firstrow($sql))
{
$row['image_name'] = stripslashes($row['image_name']);
if (function_exists('multilang')) $row['image_name'] = multilang($row['image_name']);
$user_row = get_user_info($row['user_id']);
// $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$file."</b><br />";
$msg .= (($msg != "") ? "<br />" : "").(($user_info['user_level'] > GUEST && $user_info['user_id'] == $user_row['user_id']) ? $lang['image_md5_duplicate_self'] : sprintf(($show_member ? $lang['image_md5_duplicate_more'] : $lang['image_md5_duplicate_simple']), "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$user_row['user_id'])."\">".$user_row['user_name']."</a>"));
if ($show_image && (($user_info['user_level'] > GUEST && $user_info['user_id'] != $user_row['user_id']) || (check_permission("auth_viewcat", $row['cat_id'] && check_permission("auth_viewimage", $row['cat_id'])))))
{
$msg .= ": <a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$row['image_id'])."\">".$row['image_name']."</a>";
}
$error = 1;
}
else
{
$sql = "SELECT image_id, image_name, user_id
FROM ".IMAGES_TEMP_TABLE."
WHERE image_md5 = '".$md5."'
LIMIT 1";
if ($row = $site_db->query_firstrow($sql))
{
$user_row = get_user_info($row['user_id']);
// $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$file."</b><br />";
$msg .= (($msg != "") ? "<br />" : "").(($user_info['user_level'] > GUEST && $user_info['user_id'] == $row['user_id']) ? $lang['image_md5_duplicate_validation_self'] : sprintf(($show_member ? $lang['image_md5_duplicate_validation_more'] : $lang['image_md5_duplicate_validation_simple']), "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$user_row['user_id'])."\">".$user_row['user_name']."</a>"));
$error = 1;
}
}
$HTTP_POST_VARS['image_md5'] = $md5;
}
}
/*
MOD CHECK FOR DUPLICATE IMAGES
END INSERT
*/
$lang['image_md5'] = "Image MD5 hash";
$lang['image_md5_duplicate_self'] = "You have submitted this file before";
$lang['image_md5_duplicate_more'] = "This file has been previously submitted by %s";
$lang['image_md5_duplicate_simple'] = "This file has been previously submitted";
$lang['image_md5_duplicate_validation_self'] = "You have submitted this file before and awaiting validation.";
$lang['image_md5_duplicate_validation_more'] = "This file has been previously submitted by %s and awaiting validation.";
$lang['image_md5_duplicate_validation_simple'] = "This file has been previously submitted and awaiting validation.";
$additional_image_fields['image_md5'] = array($lang['image_md5'], "text", 0);
"media_url" => MEDIA_PATH,
"url_sitemap" => $site_sess->url(ROOT_PATH."sitemap.php"),
"lang_sitemap" => $lang['sitemap'],
/*
MOD SITEMAP
START INSERT
*/
$lang['sitemap'] = "Sitemap";
$lang['sitemap_legend'] = "Legend";
$lang['sitemap_viewimages_yes'] = "Allowed view images";
$lang['sitemap_viewimages_no'] = "Not allowed view images";
$lang['sitemap_viewimages_new_yes'] = "With new images and you are allowed view images";
$lang['sitemap_viewimages_new_no'] = "With new images but you are not allowed view images";
$lang['sitemap_cat_info'] = "<span class=\"sitemapinfo\">{lang_images}{lang_new_images}{lang_hits}{lang_description}</span>";
$lang['sitemap_images'] = "Images: {images}";
$lang['sitemap_new_images'] = " (New: {new_images})";
$lang['sitemap_hits'] = " Hits: {hits}";
$lang['sitemap_description'] = " Description: {description}";
$lang['sitemap_hidden'] = "< hidden >";
/*
MOD SITEMAP
END INSERT
» <a href="{url_sitemap}">{lang_sitemap}</a>
/*
MOD SITEMAP
START INSERT
*/
.sitemapinfo
{
font-size: 9px;
padding: 2px 2px 2px 2px;
margin: 2px 2px 2px 2px;
color: #8794A7;
}
.sitemaprow1
{
background-color: #e1e1e1;
color: #004c75;
}
.sitemaprow2
{
background-color: #efefef;
color: #004c75;
}
/*
MOD SITEMAP
END INSERT
*/
$lang['user_online_detail'] =
kodunu aıyoruz ve burayı$lang['user_online_detail'] = "Sitemizde, <b>{num_registered_online}</b> kayıtlı üyemiz, <b>{num_invisible_online}</b> Gizli, <b>{num_guests_online}</b> ziyaretçimiz aktif.";
şeklinde değiştiriyoruz.