Advertisement
Guest User

hahahihi.php

a guest
Dec 24th, 2017
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.02 KB | None | 0 0
  1. <?php
  2. namespace Flock\Console\Command;
  3.  
  4. use Symfony\Component\Config\Definition\Exception\Exception;
  5. use Symfony\Component\Console\Command\Command;
  6. use Symfony\Component\Console\Input\InputArgument;
  7. use Symfony\Component\Console\Input\InputInterface;
  8. use Symfony\Component\Console\Output\OutputInterface;
  9. use Symfony\Component\Templating\Loader\FilesystemLoader;
  10. use Symfony\Component\Templating\PhpEngine;
  11. use Symfony\Component\Templating\TemplateNameParser;
  12. use Symfony\Component\Yaml\Yaml;
  13.  
  14.  
  15. class MailerCommand extends Command {
  16.  
  17. /**
  18. * @var OutputInterface
  19. */
  20. private $output;
  21.  
  22. /**
  23. * Configures the current command.
  24. */
  25. protected function configure()
  26. {
  27. $this
  28. ->setName('notification:mailer')
  29. ->setDescription('send an email to someone.')
  30. ->addArgument(
  31. 'email',
  32. InputArgument::REQUIRED,
  33. 'What is the e-mail address of the receiver?'
  34. )
  35. ->addArgument(
  36. 'body',
  37. InputArgument::REQUIRED,
  38. 'Information about the machine and dataset in which the experiment was running.'
  39. )
  40. ->addArgument(
  41. 'subject',
  42. InputArgument::OPTIONAL,
  43. 'What is the subject of the conversation?'
  44. );
  45. }
  46.  
  47. /**
  48. * Executes the current command.
  49. *
  50. * This method is not abstract because you can use this class
  51. * as a concrete class. In this case, instead of defining the
  52. * execute() method, you set the code to execute by passing
  53. * a Closure to the setCode() method.
  54. *
  55. * @param InputInterface $input An InputInterface instance
  56. * @param OutputInterface $output An OutputInterface instance
  57. *
  58. * @return null|int null or 0 if everything went fine, or an error code
  59. *
  60. * @throws \LogicException When this abstract method is not implemented
  61. *
  62. * @see setCode()
  63. */
  64. protected function execute(InputInterface $input, OutputInterface $output)
  65. {
  66. $email = $input->getArgument('email');
  67. $subject = $input->getArgument('subject') ? $input->getArgument('subject') : "Sent by flock-mailer";
  68. $body = $input->getArgument('body');
  69.  
  70. $this->output = $output;
  71.  
  72. $mailer = new \PHPMailer;
  73.  
  74. $this->configureMailer($mailer);
  75.  
  76. $this->sendMail($mailer, $email, $subject, $body);
  77.  
  78. }
  79.  
  80. /**
  81. * @param $mailer \PHPMailer
  82. */
  83. private function configureMailer($mailer)
  84. {
  85.  
  86. $configFile = ROOT . '/config/email.yml';
  87. $configValues = [];
  88.  
  89. try {
  90. $configValues = Yaml::parse($configFile);
  91. } catch (Exception $e) {
  92. $this->output->writeln("There was a error while parsing the configuration file. Check the error below:");
  93. $this->output->writeln($e->getMessage());
  94. exit(1);
  95. }
  96.  
  97. if (!empty($configValues)) {
  98. $mailer->isSMTP(); // Set mailer to use SMTP
  99. $mailer->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
  100. $mailer->Port = 587; // TCP port to connect to
  101. $mailer->SMTPAuth = true; // Enable SMTP authentication
  102. $mailer->Username = $configValues['from']; // SMTP username
  103. $mailer->Password = $configValues['passwd']; // SMTP password
  104. $mailer->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
  105. $mailer->setFrom($configValues['from'], $configValues['name']);
  106. if ($configValues['debug'] && $configValues['debug'] > 0) {
  107. $mailer->SMTPDebug = 2;
  108. $mailer->Debugoutput = 'html';
  109. }
  110. }
  111. }
  112.  
  113. /**
  114. * @param $mailer \PHPMailer
  115. * @param $to string
  116. * @param $subject string
  117. * @param $body string
  118. */
  119. private function sendMail($mailer, $to, $subject, $body)
  120. {
  121. $addresses = $this->parseEmails($to);
  122. //$kontolers = $this->txtemail($to);
  123.  
  124. if (is_array($addresses)) {
  125. foreach ($addresses as $address) {
  126. $mailer->addAddress($address);
  127. }
  128. } else {
  129. $mailer->addAddress($to);
  130. }
  131.  
  132.  
  133. $mailer->Subject = $subject;
  134.  
  135. $loader = new FilesystemLoader(ROOT . '/src/Flock/Templates/%name%');
  136.  
  137.  
  138. $templating = new PhpEngine(new TemplateNameParser(), $loader);
  139. $mailer->msgHTML($templating->render('message.php', array('custom' => $body)));
  140.  
  141. if ( $mailer->send() ) {
  142. echo "[".date("H:i:s")."] Finished for sending : {$to}\n";
  143. } else {
  144. echo "The message could not be delivered.";
  145. echo "Mailer error: " . $mailer->ErrorInfo;
  146. }
  147.  
  148. }
  149.  
  150. /**
  151. * Parse the email passed to see if is multiple email.
  152. * @param $to string String with multiple emails or not.
  153. * @return array|string If the email contains string return an array with all the emails
  154. * passed as parameter, return the $to parameter itself otherwise.
  155. */
  156. /*private function parseEmails($to)
  157. {
  158. if (strpos($to, ",") !== false) {
  159. return explode(',', $to);
  160. }
  161.  
  162. return $to;
  163. }
  164.  
  165.  
  166. }*/
  167. $Logo = "
  168. ___. __ ________
  169. /$$$$$$$ /$$ /$$ /$$ /$$
  170. | $$__ $$ | $$ | $$ | $$ | $$
  171. | $$ \ $$/$$ /$| $$/$$ /$$ | $$ | $$ /$$$$$$| $$/$$ /$$ /$$$$$$$
  172. | $$$$$$$| $$ | $| $| $$ | $$ | $$$$$$$$|____ $| $| $$ | $$/$$_____/
  173. | $$__ $| $$ | $| $| $$ | $$ | $$__ $$ /$$$$$$| $| $$ | $| $$$$$$
  174. | $$ \ $| $$ | $| $| $$ | $$ | $$ | $$/$$__ $| $| $$ | $$\____ $$
  175. | $$$$$$$| $$$$$$| $| $$$$$$/ | $$ | $| $$$$$$| $| $$$$$$//$$$$$$$/
  176. |_______/ \______/|__/\______/ |__/ |__/\_______|__/\______/|_______/
  177. -------------- Email Sender CLI - V1.0.0----------------------
  178. thanks to : Allah SWT . - Bejog , - pedro-stanaka, - Symfony, - PHPMailer
  179. ";
  180. //$kontolers = $this->txtemail($to);
  181. private function parseEmails ($to){
  182. if(isset($argv[1]) !== false){
  183. $get = file_get_contents($argv[1]) or die("\n[Warning] Mail List Gak Ada GBLK !!!\n");
  184. $listmail = explode("\r\n",$get);
  185. echo "\n[".date("H:i:s")."] Sending.. ".count($listmail)." email. Please wait ... \n";
  186. //foreach($listmail as $to){
  187. echo "[".date("H:i:s")."] Sending email to : {$to}\n";
  188. $f1 = fopen("latest-maillist.txt","w");
  189. fwrite($f1,$to."\r\n");
  190. fclose($f1);
  191. //$Exploiter->Dork($dork);
  192. //for($i=1;$i<18;$i++){
  193. //for($i=1;$i<17;$i++){
  194. //$kontolers->SearchEngine($i);
  195. }
  196.  
  197. //echo "[".date("H:i:s")."] Finished for sending : {$to}\n";
  198.  
  199. } else {
  200. echo $Logo."\n";
  201. echo "[=] Usage : php $argv[0] listdork.txt\n";
  202. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement