TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 04-20-2008, 09:54 PM   #1 (permalink)
The Addict
 
Join Date: Nov 2007
Posts: 264
Thanks: 2
TlcAndres is on a distinguished road
Default eval remake

A bit of a challenge to storm up the head I suppose.

PHP Code:
<?php

 rep_eval
('
     $i = 0;
      for($v = $i;$v < 100;++$v){
       echo($v);
      }
'
);
?>
Basically is to get this code or any other php code to run WITHOUT using eval() or any built in php functions to run php code (though I think eval() is the only one);
__________________
"What everyone seems to forget is that while knowledge certainly is something - it's the implementation of knowledge that brings power" - Andres Galindo.
TlcAndres is offline  
Reply With Quote
Old 04-21-2008, 06:13 AM   #2 (permalink)
The Acquainted
 
sjaq's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 113
Thanks: 11
sjaq is on a distinguished road
Default

PHP Code:
<?php 

    
function rep_eval($str) {
        
$f fopen('./tmp.php''w');
        
fwrite($f'<?php '$str ' ?>');
        
fclose($f);
        
        require 
'./tmp.php';
        
        
unlink('./tmp.php');
    }

    
rep_eval('
         $i = 0;
        for($v = $i;$v < 100;++$v){ 
           echo($v); 
        }
    '
);
    
?>
sjaq is offline  
Reply With Quote
Old 05-23-2008, 10:41 AM   #3 (permalink)
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
Kalle is on a distinguished road
Default

If not using sjag's example by temp files then the only thing I really can think of is to use the tokenizer extension for PHP and then make your own executor which could be big ;)
__________________
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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


All times are GMT. The time now is 02:48 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design