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 eval(base64_decode('CiBuYW1lc3BhY2UgQXBwXEh0dHBcQ29udHJvbGxlcnM7IHVzZSBBcHBcTW9kZWxz..

Decoded Output download


 namespace App\Http\Controllers; use App\Models\Role; use App\Models\User; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Session; use Inertia\Inertia; use Inertia\Response; class AdminController extends Controller { public function get_roles() : Response { return Inertia::render("\141\144\155\x69\x6e\x2f\x62\x75\141\x74\137\147\x75\x72\165", array("\x72\x6f\x77\163" => User::select(array("\151\144", "\x6e\141\x6d\x65", "\145\155\141\151\x6c"))->where("\x72\x6f\154\145", "\147\x75\x72\165")->get()->toArray())); } public function destroy_role(Request $request, User $user) { if ($user->auth_level() < Auth::user()->auth_level()) { return back()->withErrors(array("\162\x6f\x6c\x65\x5f\151\144" => "\x75\x6e\x61\165\x74\150\157\162\x69\172\x65\144")); } $user->delete(); Session::flash("\155\x65\163\x73\x61\x67\x65", "\x42\x65\162\150\x61\163\x69\x6c\x20\x6d\x65\x6e\x67\x68\141\x70\x75\163\40\162\157\x6c\x65\x20\x69\x64\x20" . $user->id . "\56"); return redirect()->back()->with("\162\157\x77\163", $user); } public function store_role(Request $request) { $request->validate(array("\x6e\x61\155\x65" => array("\162\x65\161\x75\x69\162\x65\144"), "\x65\x6d\x61\151\154" => array("\162\145\x71\x75\x69\x72\x65\x64"), "\x72\157\154\145" => array("\162\145\x71\165\151\x72\145\144"), "\160\141\163\x73\167\157\162\144" => array("\162\x65\161\x75\151\162\145\144"))); if (Role::find($request["\x72\157\154\x65"])->auth_level < Auth::user()->auth_level()) { return back()->withErrors(array("\162\157\x6c\145\137\151\144" => "\x75\156\x61\165\164\150\x6f\x72\x69\x7a\x65\144")); } $user = User::create($request->only(array("\156\141\155\x65", "\145\x6d\x61\151\154", "\x70\x61\x73\x73\167\157\162\x64"))); $user->role_id = $request["\162\x6f\154\145"]; $user->password = Hash::make($request["\160\x61\163\163\x77\157\x72\x64"]); $user->save(); Session::flash("\x6d\x65\x73\x73\x61\x67\x65", "\102\145\162\x68\x61\x73\x69\154\40\x6d\145\x6d\142\165\141\x74\x20\x72\157\x6c\x65\x20\151\144\40" . $user->id . "\56"); return redirect()->back()->with("\162\157\x77\x73", $user); } public function update_role(Request $request, User $user) { $request->validate(array("\x6e\x61\x6d\x65" => array("\x72\145\161\165\x69\162\145\x64"), "\145\155\x61\151\154" => array("\162\x65\161\x75\x69\x72\x65\144"))); $validated = $request->only(array("\156\x61\x6d\145", "\145\155\x61\x69\154")); if ($user->auth_level() < Auth::user()->auth_level()) { return back()->withErrors(array("\x72\x6f\x6c\145\x5f\151\144" => "\165\156\141\165\164\150\x6f\x72\151\x7a\x65\x64")); } if ($request["\x6e\141\x6d\145"]) { $user->name = $validated["\x6e\141\x6d\145"]; } if ($request["\160\x61\x73\163\167\157\162\144"]) { $user->password = Hash::make($request["\160\x61\x73\163\x77\x6f\x72\x64"]); } $user->save(); Session::flash("\155\x65\163\x73\141\x67\145", "\x44\141\x74\x61\x20" . $user->id . "\x20\142\x65\162\x68\141\163\x69\x6c\40\x64\151\163\x75\x6e\164\151\x6e\147\x2e"); return redirect()->back()->with("\x72\x6f\167\163", $user); }

Did this file decode correctly?

Original Code

<?php eval(base64_decode('CiBuYW1lc3BhY2UgQXBwXEh0dHBcQ29udHJvbGxlcnM7IHVzZSBBcHBcTW9kZWxzXFJvbGU7IHVzZSBBcHBcTW9kZWxzXFVzZXI7IHVzZSBJbGx1bWluYXRlXEh0dHBcUmVxdWVzdDsgdXNlIElsbHVtaW5hdGVcU3VwcG9ydFxGYWNhZGVzXEF1dGg7IHVzZSBJbGx1bWluYXRlXFN1cHBvcnRcRmFjYWRlc1xIYXNoOyB1c2UgSWxsdW1pbmF0ZVxTdXBwb3J0XEZhY2FkZXNcTG9nOyB1c2UgSWxs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