Advertisement
Guest User

Untitled

a guest
Aug 29th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.14 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 = "Proxy" . $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\":951,\"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. var_dump($result);
  45. $i++;
  46. sleep(60);
  47. }
  48. $msgS = "Successfuly created " . $_POST['quantity'] . " server(s).";
  49. }
  50.  
  51. if(isset($_POST['list'])) {
  52. $ch = curl_init();
  53. curl_setopt($ch, CURLOPT_URL, "https://api.kyup.com/client/v1");
  54. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  55. curl_setopt($ch, CURLOPT_POSTFIELDS, "request={\"action\":\"cloudList\",\"authorization_key\":\"$apikey\",\n\"data\":{\"offset\":0}}");
  56. curl_setopt($ch, CURLOPT_POST, 1);
  57. $headers = array();
  58. $headers[] = "Content-Type: application/x-www-form-urlencoded";
  59. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  60. $result = curl_exec($ch);
  61. curl_close ($ch);
  62. $arr = json_decode($result, true);
  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. var_dump($result);
  93. $l++;
  94. }
  95. }
  96. ?>
  97. <!DOCTYPE html>
  98. <html lang="en">
  99. <head>
  100. <meta charset="utf-8">
  101. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  102. <meta name="viewport" content="width=device-width, initial-scale=1">
  103. <meta name="robots" content="none">
  104. <title>TheProxyGuru - API Manager</title>
  105. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
  106. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/cyborg/bootstrap.min.css">
  107. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  108. <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
  109. <!--[if lt IE 9]>
  110. <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
  111. <script src="https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
  112. <![endif]-->
  113. <style>
  114. * {
  115.  
  116. }
  117. html {
  118.  
  119. }
  120. body {
  121. padding-top: 50px;
  122. }
  123. a, a:link, a:active, a:hover {
  124. text-decoration: none;
  125. }
  126. </style>
  127. </head>
  128. <body>
  129. <div style="display: block; margin: 0 auto; width: 100%;">
  130. <!-- -->
  131. <div class="col-lg-3 text-center">
  132. <div class="row">
  133. <h6><a href=".">KYUP</a></h6>
  134. <hr>
  135. </div>
  136. </div>
  137. <!-- -->
  138. <?php if (!empty($msgS)): ?>
  139. <div class="container-fluid">
  140. <div class="row">
  141. <div class="alert alert-success">
  142. <?= $msgS ?>
  143. </div>
  144. </div>
  145. </div>
  146. <?= PHP_EOL ?>
  147. <?php endif; ?>
  148. <!-- -->
  149. <?php if (!empty($msgE)): ?>
  150. <div class="container-fluid">
  151. <div class="row">
  152. <div class="alert alert-danger">
  153. <?= $msgE ?>
  154. </div>
  155. </div>
  156. </div>
  157. <?= PHP_EOL ?>
  158. <?php endif; ?>
  159. <!-- -->
  160. <div class="container-fluid">
  161. <div class="row">
  162. <div class="well">
  163. <?php if (!empty($output)): ?>
  164. <?php foreach ($output as $o): ?>
  165. <?= $o ?>
  166. <br>
  167. <?php endforeach; ?>
  168. <?= PHP_EOL ?>
  169. <?php endif; ?>
  170. </div>
  171. </div>
  172. </div>
  173. <!-- -->
  174.  
  175. <div class="container-fluid">
  176.  
  177. <div class="row">
  178. <div class="panel panel-default">
  179. <div class="panel-body">
  180. <?php
  181. $j = 0;
  182. $xip = $arr["data"]["list"]["$j"]["ip"];
  183. $eip = explode("/", $xip);
  184. while($j < count($arr["data"]["list"])) {
  185. if(!empty($_POST['format'])) {
  186. echo $eip["0"] . ":" . $_POST['format'] . "</br>";
  187. }
  188. else {
  189. echo $eip["0"] . "</br>";
  190. }
  191. $j++;
  192. }
  193. ?>
  194. </div>
  195.  
  196. <div class="panel-heading">List</div>
  197. <div class="panel-body">
  198. <form class="form" method="post">
  199. <input type="text" class="form-control" name="format" placeholder="port:user:pass"></p>
  200. <button class="btn btn-info btn-lg btn-block" id="list" type="submit" name="list">List Proxies</button>
  201. </form>
  202. </div>
  203. </div>
  204. </div>
  205. </div>
  206. <!-- -->
  207. <div class="container-fluid">
  208. <div class="row">
  209. <div class="panel panel-default">
  210. <div class="panel-heading">Create</div>
  211. <div class="panel-body">
  212. <form class="form" method="POST" action="">
  213. <div class="form-group">
  214. <input class="form-control" id="quantity" type="text" name="quantity" placeholder="Quantity ..." required>
  215. </div>
  216. <div class="form-group">
  217. <select class="form-control" id="location" name="location">
  218. <option value="1">North America - Chicago</option>
  219. <option value="4">Europe - Amsterdam</option>
  220. <option value="6">Europe - London</option>
  221. <option value="3">Asia Pacific - Singapore</option>
  222. </select>
  223. </div>
  224. <button class="btn btn-success btn-lg btn-block" id="create" type="submit" name="create">Create</button>
  225. </form>
  226. </div>
  227. </div>
  228. </div>
  229. </div>
  230. <div class="container-fluid">
  231. <div class="row">
  232. <div class="panel panel-default">
  233. <div class="panel-heading">Delete</div>
  234. <div class="panel-body">
  235. <form class="form" method="post">
  236. <button class="btn btn-danger btn-lg btn-block" id="list" type="submit" name="del">Delete All</button>
  237. </form>
  238. </div>
  239. </div>
  240. </div>
  241. </div>
  242. <?php if(isset($_POST['list'])) {
  243. if(count($arr["data"]["list"]) > 0) { ?>
  244. <div class="container-fluid">
  245. <div class="row">
  246. <div class="panel panel-default">
  247. </div>
  248. </div>
  249. </div>
  250. <?php
  251. }
  252. }
  253. ?>
  254. <!-- -->
  255. <div class="container-fluid">
  256. <div class="row">
  257. <div style="text-align: center;">
  258. <hr>
  259. <p><small>&copy; <?= date('Y') ?> <a href="https://TheProxyGuru.com" target="_blank">TheProxyGuru</a></small></p>
  260. </div>
  261. </div>
  262. </div>
  263. </div>
  264. </body>
  265. </html>
  266.  
  267. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement