Advertisement
Guest User

Untitled

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