Advertisement
Guest User

Untitled

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