View Full Version : PHP in BBCODE
Karthick
03-17-2004, 03:22 PM
Hi,
I tried to add php to bbcode with no luck.
E.g I have [test] bbcode and in the bbcode replacement I want a php script to run. I want to use sessions to store information but just for example, lets say I need to include a file:
test.php Is it possible to actually run php code and make it execute: <?php include("test.php"); ?>
Thanks,
Karthick
Zero Tolerance
03-17-2004, 03:35 PM
Possible yes but it would be a HUGE security flaw id say in your forums and i wouldn't advise it at all
- Zero Tolerance
Karthick
03-17-2004, 03:38 PM
I dont understand, how is it even a slight security flaw?
Zachery
03-17-2004, 03:40 PM
I dont understand, how is it even a slight security flaw?
If you allow php to be executed anywhere, you are allowing anything to be run, which means someone could drop your database, specific tables, even get passwords or other viatal info :)
Karthick
03-17-2004, 03:43 PM
No, I dont want others to be able to run PHP code. I want to run my own php code in bbcode. For example, someone types this I want to be able to type php code in the bbcode replacement variable so that I can use php to store "this" as a session variable.
I hope I am making sense :S
Zero Tolerance
03-17-2004, 03:53 PM
Why exactly would you want to make session vars in a post?
Im a little un-certain why such a thing would be needed
Karthick
03-17-2004, 03:57 PM
5 AM here, so ill try and make this quick.
http://64.91.226.5/showthread.php?t=452&page=2
Please see the chess boards. The BB Code just currently tags a php file through Iframe, <iframe src=blah.php?chess moves etc. Now Apache GET limit is 8kb max, and to change that, I would have to recompile apache, which is not advisable. I want to allow up to 200kb.
So I need to get PHP to store a session variable with that name, or do ANYTHING with php to store the information somewhere, instead of tagging it onto iframe.
Karthick
03-17-2004, 10:46 PM
Can someone give me a hint on how to do this?
Alternatively, How can I make a template into bbcode? E.G how are all the standard bbcodes as templates? How does it know that template is bbcode?
Karthick
03-19-2004, 08:07 AM
bump
Zachery
03-19-2004, 08:07 AM
bump
I dont think anyone is going to code an open security risk.
You can take a service request but most of these are paid.
Karthick
03-19-2004, 10:03 AM
What the?
You still haven't explained to me how its a security risk..!!!!
Karthick
03-19-2004, 10:04 AM
BtW, I already coded it in manually
Zachery
03-19-2004, 10:10 AM
BtW, I already coded it in manually
Yes, we have :) if you can run a snippet of code in this bbcode and it will recgonize it, anything and i mean ANYTHING could be done to your forum :)
Karthick
03-19-2004, 10:15 AM
That means you didn't read my posts properly.
What I wanted to do was execute MY PHP CODE in the bbcode. E.g
<?
$test = "{param}";
?>
Now if there is a flaw in that, then PHP is one big flaw. ;)
Zachery
03-19-2004, 10:24 AM
That means you didn't read my posts properly.
What I wanted to do was execute MY PHP CODE in the bbcode. E.g
<?
$test = "{param}";
?>
Now if there is a flaw in that, then PHP is one big flaw. ;)
<?
$test = "{param}";
?>
when {param} =
test"; bla bla more bad php code ";
Karthick
03-19-2004, 10:26 AM
OMG.... vBulletin and PHP escape all harmful characters...
E.G GET $test (im bla"h) = im bla\"h after escaping.....
*bangs head on brick wall*
Zachery
03-19-2004, 10:45 AM
OMG.... vBulletin and PHP escape all harmful characters...
E.G GET $test (im bla"h) = im bla\"h after escaping.....
*bangs head on brick wall*
since its php use stripslashes ;)
Karthick
03-19-2004, 10:56 AM
http://64.91.226.5/images/custom_smilies/eusa_wall.gif
Zachery
03-19-2004, 11:01 AM
removed :)
whats your forum url now?
;)
im sure i can make it work with some trys ;)
Karthick
03-19-2004, 11:39 AM
<a href="http://www.chesskit.com/community/" target="_blank">http://www.chesskit.com/community/</a>
Good Luck
Zachery
03-19-2004, 12:07 PM
Nope, considering that will empty your database :)
Karthick
03-19-2004, 12:20 PM
You mean you can't do it.
Zachery
03-19-2004, 12:36 PM
You mean you can't do it.
No, thats not what i said, i said im not going to try, as a member of the vBulletin Team it wouldnt look good if i went around emtping peoples databases now would it ;)
Floris
03-19-2004, 12:45 PM
No, thats not what i said, i said im not going to try, as a member of the vBulletin Team it wouldnt look good if i went around emtping peoples databases now would it ;)
posting the code isn't as professional either :>
Zachery
03-19-2004, 12:55 PM
posting the code isn't as professional either :>
its in install.php (removes it)
MindTrix
03-19-2004, 05:02 PM
i said im not going to try, as a member of the vBulletin Team
:o
:rolleyes:
Karthick
03-19-2004, 06:07 PM
No, thats not what i said, i said im not going to try, as a member of the vBulletin Team it wouldnt look good if i went around emtping peoples databases now would it ;)
You cant do it man. Just admit it. Or set up another BB and empty that. If vB was that vunerable, then it sucks.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.