GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 29-Mar-2007, 13:21
Dave101 Dave101 is offline
New Member
 
Join Date: Feb 2007
Posts: 2
Dave101 is on a distinguished road
Thumbs up

decryption in PHP


Here is a program in PHP that has the hidden text. When you run this program it displays "BOOKMARK". Could anyone tell me why is this BOOKMARK being displayed. Like which part of the code has made this or from where the hidden word came?


The program is:

PHP Code:

<?php
  eval(base64_decode("JGZpbGVuYW1lPSRfU0VSVkVSWydTQ1JJUFRfTkFNRSddOw=="));
   $file = basename($filename); 
   $fp = fopen ($file, "r")
      or die("can't open file");
 
   if($fp)
     {
       while (!feof ($fp))
         { 
           $buffer = fgets($fp, 4096);
 
           for ($i=0; $i < strlen($buffer); $i++)
             { 
               if ($buffer[$i] == '?' && $buffer[$i+1] == '>')
                 {
                   $i+=2;
                   $cc = $n = 0;
                   while ($i < strlen($buffer))
                     {
                       while ($buffer[$i] == '\r')$i++;
                       while ($buffer[$i] == '\n')$i++; 
                       $n = ($n << 1) | (ord($buffer[$i])&1); 
                       if (++$cc%8==0)
                         { 
                           print chr($n);
                           $n = 0;
                         } 
                       $i++;
                     }
                 }
             }
         }
       fclose($fp);
     }
 ?>

Last edited by admin : 29-Mar-2007 at 17:46. Reason: Please insert your PHP code between [php] & [/php] tags
  #2  
Old 29-Mar-2007, 17:55
admin's Avatar
admin admin is offline
Administrator
 
Join Date: Sep 2002
Posts: 858
admin will become famous soon enough

Re: decryption in PHP


You can echo any variable to see what it's supposed to be storing/doing.

For example, take this line for instance:

PHP Code:

eval(base64_decode("JGZpbGVuYW1lPSRfU0VSVkVSWydTQ1JJUFRfTkFNRSddOw==")); 



You can insert a line to that like this:

PHP Code:

eval(base64_decode("JGZpbGVuYW1lPSRfU0VSVkVSWydTQ1JJUFRfTkFNRSddOw=="));
//*
echo base64_decode("JGZpbGVuYW1lPSRfU0VSVkVSWydTQ1JJUFRfTkFNRSddOw==");
//*/ 



That will reveal that the eval function is being fed:

Code:
$filename=$_SERVER['SCRIPT_NAME'];
__________________
Custom BB codes you can use here:
[HTML] | [C++] | [CSS] | [JAVA] | [PY] | [VB]
 
 

Recent GIDBlogInstall Adobe Flash - Without Administrator Rights by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Alternative PHP Cache (APC) admin Web Hosting Forum 0 04-May-2006 23:41
PHP - sizes and generation times cable_guy_67 MySQL / PHP Forum 3 29-Sep-2005 08:26
Help ! I need help starting up on Php ! onauc MySQL / PHP Forum 11 04-Jan-2005 23:57
[Linux] Installing PHP --with-mcrypt JdS Web Hosting Forum 0 20-Aug-2003 08:40
All the big PHP script collections that matter jrobbio MySQL / PHP Forum 5 06-Jun-2003 16:14

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 06:56.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.