Best Blackhat Forum

Full Version: [HELP] [PHP] How to null this?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
app_verify.php
PHP Code:
<?php include("includes/header.php");

    require(
"includes/function.php");
    
$kwallpaper=new  k_wallpaper;
    include(
'purchase.php');
   
   
    if(isset(
$_POST['submit']))
    {
       
         if(
verify_purchase($_POST['buyer'],$_POST['purchase_code']) == false)
         {
           
            
$_SESSION['msg']="Sorry, we are unable to verify your purchase.";
            
header"Location:app_verify.php");
            exit;
        }
        else
        {
             
$data = array(
            
'buyer'  =>  $_POST['buyer'],
            
'purchase_code' => $_POST['purchase_code'],
            
'status' => '1'
            
);
         
            
$app_edit=Update('app_verify'$data"WHERE id = '1'");
           
            if (
$app_edit 0){
               
                
$_SESSION['msg']="Save successfully...";
                
header"Location:app_verify.php");
                exit;
            }    
        }
       
       
       
    }
    
//Get Data
    
$app_qry="SELECT * FROM app_verify WHERE id='1'";
    
$app_result=mysql_query($app_qry);
    
$app_row=mysql_fetch_assoc($app_result);
   
?>
   
   
<script src="js/category.js" type="text/javascript"></script>
               
                <div id="main">
                <h2><a href="home.php">Dashboard</a> &raquo; <a href="#" class="active"></a></h2>
                <?php if(isset($_SESSION['msg'])!= '')
                {
                echo 
'<p style="color:white">'.$_SESSION['msg'].'</p>';
                
$_SESSION['msg'] = '';  
                }
                
?>
                    <form action="" name="addeditcategory" method="post" class="jNice" onsubmit="return checkValidation(this);" enctype="multipart/form-data">
                   
                                           
                    <h3>App Verify</h3>
                        <fieldset>
                       
<label>Buyer:</label>
                               
     
                               
                             <input type="text" name="buyer" id="buyer" value="<?php echo $app_row['buyer'];?>" >
                            <label style="padding-top:20px;">Purchase Code</label>
                         <input type="text" name="purchase_code" id="purchase_code" value="<?php echo $app_row['purchase_code'];?>" >
                         <p></p>
           <input type="submit" name="submit" value="Save" />
                       
                        </fieldset>
                    </form>
                </div>
                <!-- // #main -->
               
                <div class="clear"></div>
            </div>
            <!-- // #container -->
        </div>  
        <!-- // #containerHolder -->
       
<?php include("includes/footer.php");?>

purchase.php

PHP Code:
<?php error_reporting(0);
/*
     * Item purchase verification by envato api
     */
    
function verify_purchase($buyer_name,$p_code)
    {
       
       
        
$envato_username "viaviwebtech";
        
$envato_api_key  "2uw51mxa55u4dsxh8m8a4i7bqp4ux1p0";
       
        
$buyer                =    $buyer_name;
        
$purchase_code        =    $p_code;
       
        
$curl                 =    curl_init('http://marketplace.envato.com/api/edge/'.$envato_username.'/'.$envato_api_key.'/verify-purchase:'.$purchase_code.'.xml');
       
        
curl_setopt($curlCURLOPT_USERAGENT$_SERVER['HTTP_USER_AGENT'] );
        
curl_setopt($curlCURLOPT_RETURNTRANSFER1);
        
curl_setopt($curlCURLOPT_TIMEOUT30);
        
curl_setopt($curlCURLOPT_FOLLOWLOCATION1);
       
        
$purchase_data        =    curl_exec($curl);
        
curl_close($curl);
       
       
        
$purchase_data        =    json_decode(json_encode((array) simplexml_load_string($purchase_data)),1);

        if ( isset(
$purchase_data['verify-purchase']['buyer']) and& $purchase_data['verify-purchase']['buyer'] == $buyer)
        {
            return 
true;
        }
        else
        {
            return 
false;
        }
    }
   
    function 
purchase_status()
    {
        
$app_qry="SELECT * FROM app_verify WHERE id='1'";
        
$app_result=mysql_query($app_qry);
        
$app_row=mysql_fetch_assoc($app_result);
       
        if(
$app_row['status']=='1')
        {
            return 
true;
        }
        else
        {
            return 
false;
        }
    }
 
?>
give me script and i will try to null
(10-01-2016 08:28 AM)ledz Wrote: [ -> ]give me script and i will try to null

Code:
http://www.blackhatworld.com/seo/help-php-how-to-null-this.881249/
Try to change:

Code:
function verify_purchase($buyer_name,$p_code)
    {
      
      
        $envato_username = "viaviwebtech";
        $envato_api_key  = "2uw51mxa55u4dsxh8m8a4i7bqp4ux1p0";
      
        $buyer                =    $buyer_name;
        $purchase_code        =    $p_code;
      
        $curl                 =    curl_init('http://marketplace.envato.com/api/edge/'.$envato_username.'/'.$envato_api_key.'/verify-purchase:'.$purchase_code.'.xml');
      
        curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT'] );
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
      
        $purchase_data        =    curl_exec($curl);
        curl_close($curl);
      
      
        $purchase_data        =    json_decode(json_encode((array) simplexml_load_string($purchase_data)),1);

        if ( isset($purchase_data['verify-purchase']['buyer']) and& $purchase_data['verify-purchase']['buyer'] == $buyer)
        {
            return true;
        }
        else
        {
            return false;
        }
    }

into this:

Code:
function verify_purchase($buyer_name,$p_code)
    {
       return true;
    }

Did not test, but should work :-)
(10-01-2016 09:06 AM)bl4ckhat Wrote: [ -> ]Try to change:

Code:
function verify_purchase($buyer_name,$p_code)
    {
      
      
        $envato_username = "viaviwebtech";
        $envato_api_key  = "2uw51mxa55u4dsxh8m8a4i7bqp4ux1p0";
      
        $buyer                =    $buyer_name;
        $purchase_code        =    $p_code;
      
        $curl                 =    curl_init('http://marketplace.envato.com/api/edge/'.$envato_username.'/'.$envato_api_key.'/verify-purchase:'.$purchase_code.'.xml');
      
        curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT'] );
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
      
        $purchase_data        =    curl_exec($curl);
        curl_close($curl);
      
      
        $purchase_data        =    json_decode(json_encode((array) simplexml_load_string($purchase_data)),1);

        if ( isset($purchase_data['verify-purchase']['buyer']) and& $purchase_data['verify-purchase']['buyer'] == $buyer)
        {
            return true;
        }
        else
        {
            return false;
        }
    }

into this:

Code:
function verify_purchase($buyer_name,$p_code)
    {
       return true;
    }

Did not test, but should work :-)

+5 rep, this seems so obvious lol
@bl4ckhat just got your PM and had a quick look, yes that should work! :)
i can't say for sure without auditing the rest of the code as there might be additional checks, but judging by that snippet, just returning true should do the trick.
Thanks to both of you :-)
So Mr. DollarLover, did it work? You ask for help and get it free then don´t even say thank you :-P
(10-09-2016 06:56 AM)bl4ckhat Wrote: [ -> ]So Mr. DollarLover, did it work? You ask for help and get it free then don´t even say thank you :-P

That's what BBHF gets for people bending over backwards to help SPAMMERS.

This ain't the place for begging, as if so - Why Not Have EVERYONE Beg for [HELP] in EVERY FORUM??????????????/

Oh, that's right - cuz it's against the Rules and against Omni Potent and turns BBHF into a dumping ground for beggers and spammers.

Great work guys! (NOT!)

Just goes to show, while some people can pay for VIP - it doesn't make them V - I or much of a P.

ALWAYS REPORT SPAMMERS - Don't Bend-over for them. LOVE BBHF - Don't Sell out BBHF.
How do you know the OP is a "spammer"? besides everyone on this forum is, this is a spam forum after all lol :-D But asking for help and then not replying is rude.
Pages: 1 2
Reference URL's