Advertisement
Guest User

Untitled

a guest
Oct 27th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.78 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. <div class="alert alert-success">
  180. <?= $msgS ?>
  181. </div>
  182. </div>
  183. </div>
  184. <?= PHP_EOL ?>
  185. <?php endif; ?>
  186. <!-- -->
  187. <?php if (!empty($msgE)): ?>
  188. <div class="container-fluid">
  189. <div class="row">
  190. <div class="alert alert-danger">
  191. <?= $msgE ?>
  192. </div>
  193. </div>
  194. </div>
  195. <?= PHP_EOL ?>
  196. <?php endif; ?>
  197. <!-- -->
  198. <div class="container-fluid">
  199. <div class="row">
  200. <div class="well">
  201. <?php if (!empty($output)): ?>
  202. <?php foreach ($output as $o): ?>
  203. <?= $o ?>
  204. <br>
  205. <?php endforeach; ?>
  206. <?= PHP_EOL ?>
  207. <?php endif; ?>
  208. </div>
  209. </div>
  210. </div>
  211. <!-- -->
  212.  
  213. <div class="container-fluid">
  214.  
  215. <div class="row">
  216. <div class="panel panel-default">
  217. <div class="panel-body">
  218. <?php
  219. $data = $arr["data"];
  220.  
  221. foreach($data["list"] as $server)
  222. {
  223. $ip = explode("/", $server["ip"]);
  224. $ip = $ip[0];
  225. echo $ip . '<br/>';
  226. }
  227. ?>
  228. </div>
  229.  
  230. <div class="panel-heading">List</div>
  231. <div class="panel-body">
  232. <form class="form" method="post">
  233. <input type="text" class="form-control" name="format" placeholder="port:user:pass"></p>
  234. <button class="btn btn-info btn-lg btn-block" id="list" type="submit" name="list">List Proxies</button>
  235. </form>
  236. </div>
  237. </div>
  238. </div>
  239. </div>
  240. <!-- -->
  241. <div class="container-fluid">
  242. <div class="row">
  243. <div class="panel panel-default">
  244. <div class="panel-heading">Create</div>
  245. <div class="panel-body">
  246. <form class="form" method="POST" action="">
  247. <div class="form-group">
  248. <input class="form-control" id="quantity" type="text" name="quantity" placeholder="Quantity ..." required>
  249. </div>
  250. <div class="form-group">
  251. <select class="form-control" id="location" name="location">
  252. <option value="1">North America - Chicago</option>
  253. <option value="4">Europe - Amsterdam</option>
  254. <option value="6">Europe - London</option>
  255. <option value="3">Asia Pacific - Singapore</option>
  256. </select>
  257. </div>
  258. <button class="btn btn-success btn-lg btn-block" id="create" type="submit" name="create">Create</button>
  259. </form>
  260. </div>
  261. </div>
  262. </div>
  263. </div>
  264. <!-- -->
  265. <div class="container-fluid">
  266. <div class="row">
  267. <div class="col-lg-3">
  268. <div class="panel panel-default">
  269. <div class="panel-heading">API Settings</div>
  270. <div class="panel-body">
  271. <form class="form" method="post">
  272. <div class="form-group">
  273. <input class="form-control" id="apikey" type="text" name="apikey" value="<?php echo $v_a;?>" placeholder="<?php echo $ph_a;?>" required>
  274. </div>
  275. <div class="form-group">
  276. <input class="form-control" id="enckey" type="text" name="enckey" value="<?php echo $v_c;?>" placeholder="<?php echo $ph_c;?>" required>
  277. </div>
  278. <div class="form-group">
  279. <input class="form-control" id="scriptid" type="text" name="scriptid" value="<?php echo $v_b?>" placeholder="<?php echo $ph_b;?>" required>
  280. </div>
  281. <button class="btn btn-warning btn-lg btn-block" id="create" type="submit" name="create2">Save</button>
  282. </form>
  283. </div>
  284. </div>
  285. </div>
  286. </div>
  287. </div>
  288. <!-- -->
  289. <div class="container-fluid">
  290. <div class="row">
  291. <div class="col-lg-3">
  292. <div class="panel panel-default">
  293. <div class="panel-heading">Delete Keys</div>
  294. <div class="panel-body">
  295. <form class="form" method="post">
  296. <button class="btn btn-danger btn-lg btn-block" id="delete2" type="submit" name="delete2">Delete API Info</button>
  297. </form>
  298. </div>
  299. </div>
  300. </div>
  301. </div>
  302. </div>
  303. <div class="container-fluid">
  304. <div class="row">
  305. <div class="panel panel-default">
  306. <div class="panel-heading">Delete</div>
  307. <div class="panel-body">
  308. <form class="form" method="post">
  309. <button class="btn btn-danger btn-lg btn-block" id="list" type="submit" name="del">Delete All</button>
  310. </form>
  311. </div>
  312. </div>
  313. </div>
  314. </div>
  315. <?php if(isset($_POST['list'])) {
  316. if(count($arr["data"]["list"]) > 0) { ?>
  317. <div class="container-fluid">
  318. <div class="row">
  319. <div class="panel panel-default">
  320. </div>
  321. </div>
  322. </div>
  323. <?php
  324. }
  325. }
  326. ?>
  327. <!-- -->
  328. <div class="container-fluid">
  329. <div class="row">
  330. <div style="text-align: center;">
  331. <hr>
  332. <p><small>&copy; <?= date('Y') ?> <a href="https://TheProxyGuru.com" target="_blank">TheProxyGuru</a></small></p>
  333. </div>
  334. </div>
  335. </div>
  336. </div>
  337. </body>
  338. </html>
  339.  
  340. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement