Go Back   vBulletin Setup > vBulletinSetup Information > vBulletin Questions


Please Register to get full access to the forums.
Post New Thread  Reply



#1   03-06-2007, 09:09 PM
harmor has a spectacular aura about Join Date: Oct 2006 Posts: 144
execute php from your browser


I mess up a lot when writing a script and it get's tiresome uploading a php file over and over again just to test one little thing.
I wrote this simple but highly insecure script that'll execute php that you typed into a texarea.
I did use a conditional to check if the user's user ID is 1.

PHP Code:
// ########################## REQUIRE BACK-END ############################
require_once('./global.php');

// #################### HARD CODE JAVASCRIPT PATHS ########################
$headinclude str_replace('clientscript'$vbulletin->options['bburl'] . '/clientscript'$headinclude);

// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################

if($vbulletin->userinfo['userid'] != 1)
{
    
print_no_permission();
}

if(empty(
$_REQUEST['do']))
{
    
$_REQUEST['do'] = "main";
}

if(
$_REQUEST['do'] == "main")
{
    echo 
"<form action='?do=run' method='post'>
    <textarea cols='88' rows='33' name='phpcode'></textarea><br />
    <input type='submit' value='Submit' />
    </form>"
;
}

if(
$_REQUEST['do'] == "run")
{
    
$vbulletin->input->clean_array_gpc('p', array(
    
'phpcode' => TYPE_STR
    
));
    
    eval(
$vbulletin->GPC['phpcode']);


--------------------
vHosting Pro
Manage you hosting requests easier

Xen Web Hosting
Offering ad-free hosting with features such as, cpanel, fantastico, PHP and MySQL support, and more
Quote   |  
Post New Thread  Reply
vBulletin Setup > vBulletinSetup Information > vBulletin Questions


Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser Icon? El Fuego vBulletin Questions 15 11-21-2006 01:35 PM
Final Firefox 2.0 browser to be released Tuesday Brandon General Discussion 7 11-01-2006 04:20 PM


All times are GMT -6. The time now is 07:15 PM.

vBulletin Setup, vBulletin Setup Forums, vBulletin Services, vBulletin Blogs, vBulletin SEO, vBulletin Questions, vBulletin Skins, Styles, Templates
vBulletin Hacks / Modifications, vBulletin Monetization, Blogs, vBulletin Link Directory,Quality Link Directory