Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.96 KB | None | 0 0
  1. <?php
  2. $url = 'https://api.kyup.com/client/v1';
  3. $apikey = "8b97b711d6ebfdaf3351049397bfe6ad1d";
  4. $enckey = "4c608bfba1a2c16992ad8cd8ceeeba7c";
  5.  
  6. function encrypt($key, $data){
  7. if (strlen($key) != 32)
  8. throw new Exception('Invalid AES-256 key length. Key must be 32 bytes long.');
  9.  
  10. $cipher = mcrypt_module_open('rijndael-128', '', MCRYPT_MODE_CBC, '');
  11. $blockSize = mcrypt_get_block_size('rijndael-128', MCRYPT_MODE_CBC);
  12. $initVector = substr( md5( $key ), 0, mcrypt_get_iv_size( 'rijndael-128', MCRYPT_MODE_CBC ) );
  13.  
  14. mcrypt_generic_init($cipher, $key, $initVector);
  15. $padding = $blockSize - (strlen($data) % $blockSize);
  16. $pattern = chr($padding);
  17. $value2 = $data . str_repeat($pattern, $padding);
  18. $encryptedData = mcrypt_generic($cipher, $value2);
  19. mcrypt_generic_deinit($cipher);
  20. mcrypt_module_close($cipher);
  21. return base64_encode($encryptedData);
  22. }
  23.  
  24.  
  25.  
  26. if(isset($_POST['create'])) {
  27. $i = 0;
  28. $quantity = (int)$_POST["quantity"];
  29. while($i < $quantity) {
  30. $dcid = $_POST['location'];
  31. $rand = mt_rand(1,1000);
  32. $srvname = "Project" . $rand;
  33. $password = encrypt($enckey, "1garrett23");
  34. $ch = curl_init();
  35. curl_setopt($ch, CURLOPT_URL, "https://api.kyup.com/client/v1");
  36. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  37. curl_setopt($ch, CURLOPT_POSTFIELDS, "request={\"action\":\"cloudCreate\",\"authorization_key\":\"$apikey\",\"data\":{\"name\":\"$srvname\",\"password\":\"$password\",\"datacenter_id\":\"$dcid\",\"custom_image_id\":980,\"resources\":{\"mem\":1,\"hdd\":20,\"cpu\":1,\"bw\":2}}}");
  38. curl_setopt($ch, CURLOPT_POST, 1);
  39. $headers = array();
  40. $headers[] = "Content-Type: application/x-www-form-urlencoded";
  41. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  42. $result = curl_exec($ch);
  43. curl_close ($ch);
  44. $i++;
  45. sleep(60);
  46. }
  47. $msgS = "Successfuly created " . $_POST['quantity'] . " server(s).";
  48. }
  49.  
  50. if(isset($_POST['list'])) {
  51. $ch = curl_init();
  52. curl_setopt($ch, CURLOPT_URL, "https://api.kyup.com/client/v1");
  53. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  54. curl_setopt($ch, CURLOPT_POSTFIELDS, "request={\"action\":\"cloudList\",\"authorization_key\":\"$apikey\",\n\"data\":{\"offset\":0}}");
  55. curl_setopt($ch, CURLOPT_POST, 1);
  56. $headers = array();
  57. $headers[] = "Content-Type: application/x-www-form-urlencoded";
  58. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  59. $result = curl_exec($ch);
  60. curl_close ($ch);
  61. $arr = json_decode($result, true);
  62.  
  63. }
  64.  
  65. if(isset($_POST['del'])) {
  66.  
  67. $ch1 = curl_init();
  68. curl_setopt($ch1, CURLOPT_URL, "https://api.kyup.com/client/v1");
  69. curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
  70. curl_setopt($ch1, CURLOPT_POSTFIELDS, "request={\"action\":\"cloudList\",\"authorization_key\":\"$apikey\",\n\"data\":{\"offset\":0}}");
  71. curl_setopt($ch1, CURLOPT_POST, 1);
  72. $headers = array();
  73. $headers[] = "Content-Type: application/x-www-form-urlencoded";
  74. curl_setopt($ch1, CURLOPT_HTTPHEADER, $headers);
  75. $result = curl_exec($ch1);
  76. curl_close ($ch1);
  77. $arr = json_decode($result, true);
  78.  
  79. $l = 0;
  80. while($l < count($arr["data"]["list"])) {
  81. $ch2 = curl_init();
  82. curl_setopt($ch2, CURLOPT_URL, "https://api.kyup.com/client/v1");
  83. curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
  84. $cid = $arr["data"]["list"]["$l"]["id"];
  85. curl_setopt($ch2, CURLOPT_POSTFIELDS, "request={\"action\":\"cloudDestroy\",\"authorization_key\":\"$apikey\",\"data\":{\"container_id\":\"$cid\"}}");
  86. curl_setopt($ch2, CURLOPT_POST, 1);
  87. $headers = array();
  88. $headers[] = "Content-Type: application/x-www-form-urlencoded";
  89. curl_setopt($ch2, CURLOPT_HTTPHEADER, $headers);
  90. $result = curl_exec($ch2);
  91. curl_close ($ch2);
  92. $l++;
  93. }
  94. }
  95. ?>
  96. <!DOCTYPE html>
  97. <html lang="en">
  98. <head>
  99. <meta charset="utf-8">
  100. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  101. <meta name="viewport" content="width=device-width, initial-scale=1">
  102. <meta name="robots" content="none">
  103. <title>TheProxyGuru - API Manager</title>
  104. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
  105. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/cyborg/bootstrap.min.css">
  106. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  107. <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
  108. <!--[if lt IE 9]>
  109. <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
  110. <script src="https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
  111. <![endif]-->
  112. <style>
  113. * {
  114.  
  115. }
  116. html {
  117.  
  118. }
  119. body {
  120. padding-top: 50px;
  121. }
  122. a, a:link, a:active, a:hover {
  123. text-decoration: none;
  124. }
  125. </style>
  126. </head>
  127. <body>
  128. <div style="display: block; margin: 0 auto; width: 100%;">
  129. <!-- -->
  130. <div class="col-lg-3 text-center">
  131. <div class="row">
  132. <h6><a href=".">KYUP</a></h6>
  133. <hr>
  134. </div>
  135. </div>
  136. <!-- -->
  137. <?php if (!empty($msgS)): ?>
  138. <div class="container-fluid">
  139. <div class="row">
  140. <div class="alert alert-success">
  141. <?= $msgS ?>
  142. </div>
  143. </div>
  144. </div>
  145. <?= PHP_EOL ?>
  146. <?php endif; ?>
  147. <!-- -->
  148. <?php if (!empty($msgE)): ?>
  149. <div class="container-fluid">
  150. <div class="row">
  151. <div class="alert alert-danger">
  152. <?= $msgE ?>
  153. </div>
  154. </div>
  155. </div>
  156. <?= PHP_EOL ?>
  157. <?php endif; ?>
  158. <!-- -->
  159. <div class="container-fluid">
  160. <div class="row">
  161. <div class="well">
  162. <?php if (!empty($output)): ?>
  163. <?php foreach ($output as $o): ?>
  164. <?= $o ?>
  165. <br>
  166. <?php endforeach; ?>
  167. <?= PHP_EOL ?>
  168. <?php endif; ?>
  169. </div>
  170. </div>
  171. </div>
  172. <!-- -->
  173.  
  174. <div class="container-fluid">
  175.  
  176. <div class="row">
  177. <div class="panel panel-default">
  178. <div class="panel-body">
  179. <?php
  180. $data = $arr["data"];
  181.  
  182. foreach($data["list"] as $server)
  183. {
  184. $ip = explode("/", $server["ip"]);
  185. $ip = $ip[0];
  186. echo $ip . '<br/>';
  187. }
  188. ?>
  189. </div>
  190.  
  191. <div class="panel-heading">List</div>
  192. <div class="panel-body">
  193. <form class="form" method="post">
  194. <input type="text" class="form-control" name="format" placeholder="port:user:pass"></p>
  195. <button class="btn btn-info btn-lg btn-block" id="list" type="submit" name="list">List Proxies</button>
  196. </form>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. <!-- -->
  202. <div class="container-fluid">
  203. <div class="row">
  204. <div class="panel panel-default">
  205. <div class="panel-heading">Create</div>
  206. <div class="panel-body">
  207. <form class="form" method="POST" action="">
  208. <div class="form-group">
  209. <input class="form-control" id="quantity" type="text" name="quantity" placeholder="Quantity ..." required>
  210. </div>
  211. <div class="form-group">
  212. <select class="form-control" id="location" name="location">
  213. <option value="1">North America - Chicago</option>
  214. <option value="4">Europe - Amsterdam</option>
  215. <option value="6">Europe - London</option>
  216. <option value="3">Asia Pacific - Singapore</option>
  217. </select>
  218. </div>
  219. <button class="btn btn-success btn-lg btn-block" id="create" type="submit" name="create">Create</button>
  220. </form>
  221. </div>
  222. </div>
  223. </div>
  224. </div>
  225. <div class="container-fluid">
  226. <div class="row">
  227. <div class="panel panel-default">
  228. <div class="panel-heading">Delete</div>
  229. <div class="panel-body">
  230. <form class="form" method="post">
  231. <button class="btn btn-danger btn-lg btn-block" id="list" type="submit" name="del">Delete All</button>
  232. </form>
  233. </div>
  234. </div>
  235. </div>
  236. </div>
  237. <?php if(isset($_POST['list'])) {
  238. if(count($arr["data"]["list"]) > 0) { ?>
  239. <div class="container-fluid">
  240. <div class="row">
  241. <div class="panel panel-default">
  242. </div>
  243. </div>
  244. </div>
  245. <?php
  246. }
  247. }
  248. ?>
  249. <!-- -->
  250. <div class="container-fluid">
  251. <div class="row">
  252. <div style="text-align: center;">
  253. <hr>
  254. <p><small>&copy; <?= date('Y') ?> <a href="https://TheProxyGuru.com" target="_blank">TheProxyGuru</a></small></p>
  255. </div>
  256. </div>
  257. </div>
  258. </div>
  259. </body>
  260. </html>
  261.  
  262. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement