ToKeiChun

Mass Aliases Domain Cpanel

Sep 6th, 2020 (edited)
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.76 KB | None | 0 0
  1. <?php
  2. // source : https://github.com/umamgans/mass-aliases
  3. // coded by s4dness | Vengeful Ghost
  4. // php file.php cp=http://cpanel user=user pass=pass list=list.txt
  5.  
  6. namespace Umam {
  7.     class AliasesDomain {
  8.         public $cp, $user, $pass, $lists;
  9.         public $color = [];
  10.        
  11.         function __construct() {
  12.             $this->color["r"] = "\033[0;31m";
  13.             $this->color["g"] = "\033[0;32m";
  14.             $this->color["w"] = "\033[0m";
  15.             $this->cp = @$_GET["cp"];
  16.             $this->user = @$_GET["user"];
  17.             $this->pass = @$_GET["pass"];
  18.             $this->lists = explode("\n", file_get_contents(@$_GET["list"]));
  19.             $this->aliases();
  20.         }
  21.        
  22.         function aliases() {
  23.             $login = $this->curl($this->cp . ":2082/login", [
  24.                 "user" => $this->user,
  25.                 "pass" => $this->pass
  26.             ]);
  27.             if($login["head"] == 200) {
  28.                 echo "{$this->color["g"]}  [ info ] loged in cpanel{$this->color["w"]}\n";
  29.                 preg_match("/\/(.*?)\/(.*?)\/(.*?)\//", $login["body"], $path);
  30.                 foreach($this->lists as $u) {
  31.                     if(!preg_match("/error|Error/", $this->curl($this->cp . ":2082/" . $path[0] . "/park/doaddparked.html", [
  32.                         "domain" => $u,
  33.                         "go"         => "Add Domain"
  34.                     ])["body"])) {
  35.                         echo "{$this->color['g']} [+] $u ~> aliased{$this->color['w']}\n";
  36.                         system("echo '$u' >> aliased.txt");
  37.                     } else {
  38.                         echo "{$this->color['r']} [-] $u ~> error{$this->color['w']}\n";
  39.                     }
  40.                 } echo "\n{$this->color["g"]} [ info ] project complited{$this->color["w"]}\n\n";
  41.             } else echo "{$this->color["r"]}  [ info ] failed login to cpanel{$this->color["w"]}\n";
  42.         }
  43.        
  44.         function curl($url, $post){
  45.             $ch = curl_init();
  46.             curl_setopt($ch, CURLOPT_URL, $url);
  47.             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  48.             curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  49.             curl_setopt($ch, CURLOPT_HEADER, 1);
  50.             curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0");
  51.             curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  52.             curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  53.             curl_setopt($ch, CURLOPT_TIMEOUT, 17);
  54.             curl_setopt($ch, CURLOPT_POST, 1);
  55.             curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  56.             curl_setopt($ch, CURLOPT_COOKIEJAR, "session_log");
  57.             curl_setopt($ch, CURLOPT_COOKIEFILE, "session_log");
  58.             $x = curl_exec($ch);
  59.             return [
  60.                 "head" => curl_getinfo($ch, CURLINFO_HTTP_CODE),
  61.                 "body" => $x
  62.             ];
  63.         }
  64.     }
  65.     parse_str(implode("&", array_slice($argv, 1)), $_GET);
  66.     if(empty(@$_GET["cp"]) || empty(@$_GET["user"]) ||
  67.     empty(@$_GET["pass"]) || empty(@$_GET["list"])) {
  68.         echo "\033[0;34m [!] usage: php $argv[0] cp=http://cpanel user=user pass=pass list=list.txt\n";
  69.         echo " [!] note: you must delete http/s from list.\033[0m\n";
  70.         die;
  71.     } elseif(!file_exists(@$_GET["list"])) {
  72.         die("\033[0;34m [!] list not found\033[0m\n");
  73.     } new \Umam\AliasesDomain();
  74. }
Add Comment
Please, Sign In to add comment