vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Administrative and Maintenance Tools - Fix-it: Template Edition (https://vborg.vbsupport.ru/showthread.php?t=220967)

GeekyDesigns 08-14-2009 10:00 PM

Fix-it: Template Edition
 
1 Attachment(s)
A common method of defacing vBulletin sites is to edit the parsed template html directly via the database. It makes it harder for administrators to find the issue, and can be a pain in the ass to cleanup if you're not familiar with working with the database.

This tool will make it easier to clean your defaced site.

What it does:
Checks all of the templates in the database:
- Makes a new compiled version from the uncompiled template.
- Compares the current compiled template to the new compiled template
- If they differ, it updates the template, then rebuilds all of the styles.

How do you use it?
- Upload to your admincp, modcp, install, or root forums folder
- Browse to it
- Let it run
- Delete tool_recompiler.php after you are done using it.

This tool now works on vB3 and vB4.

vB4 Thread

BigDog56 08-15-2009 08:46 PM

Ok, but how does someone without access the the database able to do this to begin with? (Forgive me here, I don't mean to be stupid. But If I don't ask, I won't learn. :o)

Zachery 08-15-2009 08:55 PM

Quote:

Originally Posted by BigDog56 (Post 1868132)
Ok, but how does someone without access the the database able to do this to begin with? (Forgive me here, I don't mean to be stupid. But If I don't ask, I won't learn. :o)

They gain access on the server level, either though another account, or an exploit on a server.

RTMdotORG 08-15-2009 09:29 PM

Quote:

Originally Posted by Zachery (Post 1868136)
They gain access on the server level, either though another account, or an exploit on a server.

Will this mod tell us if we have exploits then? im confused...

Zachery 08-15-2009 09:33 PM

Quote:

Originally Posted by RTMdotORG (Post 1868149)
Will this mod tell us if we have exploits then? im confused...

No, it will repair the templates for you if you've been defaced by some random hacker group. I released the tool here because I thought people would like to have a tool to help them fix things.

RTMdotORG 08-15-2009 09:39 PM

But if it repairs templates, does it save previous template? basically...

Can it destroy a template just as easy as fix one?

Link14716 08-15-2009 09:49 PM

Here is the explanation behind how the template system and this tool works.

Templates are stored in two ways. There is the unparsed template, which you edit in the Admin CP. It is the template as you know it. Then, there is the parsed template, which is the template after it has been ran through a function to convert things like <if> tags into valid PHP parsable code.

A common method of defacing vBulletin forums is for a hacker to directly edit the parsed version of the template in the database, leaving the unparsed template alone. When you go to edit the template in the Admin CP, you won't see anything different, but the parsed version of the template has changed.

What this tool does is it takes all of the unparsed templates from the database and creates a new parsed version from it. If the newly generated parse is different than the parsed version currently in the database, it will update the template, overwriting the old, probably compromised, parsed template. This process is not "dangerous" in any way. If you run it on a normal, uncompromised forum, you won't see it updating any templates.

Zachery 08-15-2009 09:50 PM

No, it doesn't destory templates.

As explained already in the description, it checks the unprased template agasint the parsed template table. If the two don't match like they should, it takes your unparsed template and re-parses it and inserts it back into the database and removes the defacement.

RTMdotORG 08-15-2009 10:13 PM

Thanks to both of you...

erel34 08-15-2009 10:48 PM

thanks

RTMdotORG 08-16-2009 03:43 AM

Question: If it just rebuilds styles, it didn't find any issues?

testebr 08-16-2009 03:55 AM

Can you make a diagnostic edition where alert user instead to fix?

Link14716 08-16-2009 08:54 AM

Quote:

Originally Posted by RTMdotORG (Post 1868308)
Question: If it just rebuilds styles, it didn't find any issues?

Correct.

Link14716 08-16-2009 08:58 AM

Quote:

Originally Posted by testebr (Post 1868313)
Can you make a diagnostic edition where alert user instead to fix?

I don't see any reason to. All this does is fix parsed versions of templates that are different than the unparsed version. There is no reason not to ever fix this problem, as it would only happen if the parsed template was directly edited in the database. All a diagnostic version would do is not run the update query, which doesn't help any.

If you run this and no problems are found, it will simply rebuild the styles. If there is a problem found, it will tell you which template it updates.

SandmaninDubai 08-16-2009 12:28 PM

Great fix Zachery!
My Forum was hacked twice & defaced in July & August (hosted by Hostmonster) - you fixed it manually twice (a HUGE thanks from all of here in the UAE) and now, if the nasty extreme muslims try it again this fix will wipe them.
Well done! :D

princeedward 09-15-2009 08:36 PM

looks really interesting and useful this one...thanks...where should i upload this and how can i run it and where?...sorry for the dumb question but a bit confused here...

:p

Link14716 09-15-2009 09:15 PM

You upload it to the admincp folder and run it directly in your browser. http://www.yoursite.com/forum/admincp/tool_reparse.php

Manic Mechanic 09-16-2009 01:23 AM

Installed and thank you. I navigated to it and it ran all my styles. Now is it automatic from now on, or do I run it every now and then or if I see a problem on forum?

Link14716 09-16-2009 01:43 AM

You run it when you see that there's a problem. It's not a preventative measure, just a tool to use to help get your forums back under control.

TimberFloorAu 09-16-2009 02:01 AM

Ok this seems brilliant... but a little help for us novices.

Just ran this:

And results back are:

Code:

Template updated: USERCP_SHELL (id: 1285, styleid: 4)
Template updated: postbit (id: 544, styleid: 1)
Template updated: USERCP_SHELL (id: 580, styleid: 1)
Template updated: USERCP_SHELL (id: 6481, styleid: 12)
Template updated: USERCP_SHELL (id: 8124, styleid: 18)
Template updated: USERCP_SHELL (id: 8125, styleid: 17)

Does that mean there were issues ? in the above files?

Are they fixed ? have they been repaired... what was the issue ??

Link14716 09-16-2009 03:05 AM

Quote:

Originally Posted by TimberFloorAu (Post 1885526)
Ok this seems brilliant... but a little help for us novices.

Just ran this:

And results back are:

Code:

Template updated: USERCP_SHELL (id: 1285, styleid: 4)
Template updated: postbit (id: 544, styleid: 1)
Template updated: USERCP_SHELL (id: 580, styleid: 1)
Template updated: USERCP_SHELL (id: 6481, styleid: 12)
Template updated: USERCP_SHELL (id: 8124, styleid: 18)
Template updated: USERCP_SHELL (id: 8125, styleid: 17)

Does that mean there were issues ? in the above files?

Are they fixed ? have they been repaired... what was the issue ??

It means that there was a difference between the unparsed version of the template and the parsed version of the template and those templates have been re-compiled from the unparsed version.

What the exact differences were is not something that is checked. This isn't a script to test for the errors, it's a simple script to fix them.

princeedward 09-16-2009 08:04 AM

Quote:

Originally Posted by Link14716 (Post 1885427)
You upload it to the admincp folder and run it directly in your browser. http://www.yoursite.com/forum/admincp/tool_reparse.php

well thanks for the reply...really nice thing to have this mod...great idea...:p:up:

EidolonAH 09-16-2009 08:14 AM

Absolutely brilliant idea, just ran it and it nicely just rebuilt the styles, nice to know this back-up is now available, thank you for this.

synseal 09-16-2009 08:42 AM

Thanks very much for this, a very handy tool :up:

prabhgrewal 09-18-2009 02:10 PM

Great Mod thanks :)

valdet 10-06-2009 10:01 AM

I stumbled upon this and its priceless to keep it in hand.

Thank you

Allan 10-12-2009 07:49 AM

If I edit one template for example "header" and run "tool_reparse.php", witch template will be rebuild ?

Original template or my template edited just before the defaced ?

Zachery 10-13-2009 06:21 PM

No, it should match both database values and be ignored.

Allan 10-13-2009 06:40 PM

Quote:

Originally Posted by Zachery (Post 1899216)
No, it should match both database values and be ignored.

Ignored, which one ?

XtremeOffroad 10-13-2009 08:49 PM

Nice.

I ran this and it showed.
Updating style information for each style

(Default Style ... (Templates) (StyleVars) (Replacement Variables) (CSS) (Controls) Done.)

Does that mean there were no errors?

choccyclaire 10-13-2009 09:11 PM

So if no results came back, this means everything was fine?

EDIT: Nvm this was answered on page one. Thanks. :)

linuxututs 10-13-2009 11:40 PM

Isn't this tool good for refreshing all templates to ?
Sorta like purging the cache ?

Thank You,

Zachery 10-16-2009 07:15 AM

Quote:

Originally Posted by linuxututs (Post 1899403)
Isn't this tool good for refreshing all templates to ?
Sorta like purging the cache ?

Thank You,

No, its designed to fix defaced websites.

Skydiver10 10-27-2009 06:50 PM

This fixed the malicious code that was put on my forumhome template by a hacker! This is a great tool!! Thank you so much! The hacker redirected my forum page to some stupid Turkish, Israel forum....my home page is back!!! :):):)

Simon Lloyd 10-28-2009 08:24 AM

This might seem like an inane question but, if i have changed one of my vbulletin php files like functions_databuild.php (i added a small amount of code to parse VBA code tags) if i run this file will it reset any edits ive made to these files?

Link14716 10-28-2009 08:28 AM

This doesn't touch files. It simply recompiles templates from the code you see in the Admin CP into the code that is actually ran when it is displayed in the forums.

Simon Lloyd 10-28-2009 09:21 AM

Wow, speedy response! thanks for that.

Matthew if you do paid work or Zachery for that matter then please PM me or email simonDOTlloydATthecodecage.com

imedic 10-31-2009 08:25 AM

I guess it should be included in vb script, as you never can be secure enough.
A good idea would be to run on a regular basis as a cron job ...
Many thanks

Harley D 10-31-2009 08:58 AM

Thank You!
I hope I wont need it, but I have it just in case.

Gav-n-Tn 11-12-2009 09:09 PM

Will this still allow you to revert templates back to vB stock as you currently can? Even if you've changed them? Not that I would want to but........... (reserved.waiting on reply)


All times are GMT. The time now is 06:27 PM.

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.01281 seconds
  • Memory Usage 1,818KB
  • 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
  • (2)bbcode_code_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete