Guest User

Untitled

a guest
Nov 22nd, 2017
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.15 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.  
  83. $output = array();
  84. $ch = curl_init();
  85. curl_setopt($ch, CURLOPT_URL, "https://api.kyup.com/client/v1");
  86. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  87. curl_setopt($ch, CURLOPT_POSTFIELDS, "request={\"action\":\"cloudList\",\"authorization_key\":\"$apikey\",\n\"data\":{\"offset\":0}}");
  88. curl_setopt($ch, CURLOPT_POST, 1);
  89. $headers = array();
  90. $headers[] = "Content-Type: application/x-www-form-urlencoded";
  91. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  92. $result = curl_exec($ch);
  93. curl_close ($ch);
  94. $arr = json_decode($result, true);
  95. $format = trim($_POST['format']);
  96.  
  97. $msgS = 'Success!';
  98. foreach($arr AS $servers)
  99. {
  100. foreach($servers['list'] AS $server)
  101. {
  102. $serverIP = $server['ip'];
  103. list($ip, $block) = explode("/", $serverIP);
  104. $output[] = "$ip".$format;
  105. }
  106. }
  107.  
  108. }
  109.  
  110.  
  111.  
  112. if(isset($_POST['del'])) {
  113.  
  114. $ch1 = curl_init();
  115. curl_setopt($ch1, CURLOPT_URL, "https://api.kyup.com/client/v1");
  116. curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
  117. curl_setopt($ch1, CURLOPT_POSTFIELDS, "request={\"action\":\"cloudList\",\"authorization_key\":\"$apikey\",\n\"data\":{\"offset\":0}}");
  118. curl_setopt($ch1, CURLOPT_POST, 1);
  119. $headers = array();
  120. $headers[] = "Content-Type: application/x-www-form-urlencoded";
  121. curl_setopt($ch1, CURLOPT_HTTPHEADER, $headers);
  122. $result = curl_exec($ch1);
  123. curl_close ($ch1);
  124. $arr = json_decode($result, true);
  125.  
  126. $l = 0;
  127. while($l < count($arr["data"]["list"])) {
  128. $ch2 = curl_init();
  129. curl_setopt($ch2, CURLOPT_URL, "https://api.kyup.com/client/v1");
  130. curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
  131. $cid = $arr["data"]["list"]["$l"]["id"];
  132. curl_setopt($ch2, CURLOPT_POSTFIELDS, "request={\"action\":\"cloudDestroy\",\"authorization_key\":\"$apikey\",\"data\":{\"container_id\":\"$cid\"}}");
  133. curl_setopt($ch2, CURLOPT_POST, 1);
  134. $headers = array();
  135. $headers[] = "Content-Type: application/x-www-form-urlencoded";
  136. curl_setopt($ch2, CURLOPT_HTTPHEADER, $headers);
  137. $result = curl_exec($ch2);
  138. curl_close ($ch2);
  139. $l++;
  140. }
  141. }
  142.  
  143. $ph_a = (empty($apikey)) ? 'API KEY' : $apikey;
  144. $ph_b = ($custom_image_id == 0) ? 'Script ID' : $custom_image_id;
  145. $ph_c = (empty($enckey)) ? 'ENC KEY' : $enckey;
  146.  
  147. $v_a = (empty($apikey)) ? '' : $apikey;
  148. $v_b = ($custom_image_id == 0) ? '' : $custom_image_id;
  149. $v_c = (empty($enckey)) ? '' : $enckey;
  150. ?>
  151. <!DOCTYPE html>
  152. <html lang="en">
  153. <head>
  154. <meta charset="utf-8">
  155. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  156. <meta name="viewport" content="width=device-width, initial-scale=1">
  157. <meta name="robots" content="none">
  158. <title>TheProxyGuru - API Manager</title>
  159. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
  160. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/cyborg/bootstrap.min.css">
  161. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  162. <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
  163. <!--[if lt IE 9]>
  164. <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
  165. <script src="https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
  166. <![endif]-->
  167. <style>
  168. * {
  169.  
  170. }
  171. html {
  172.  
  173. }
  174. body {
  175. padding-top: 50px;
  176. }
  177. a, a:link, a:active, a:hover {
  178. text-decoration: none;
  179. }
  180. </style>
  181. </head>
  182. <body>
  183. <div style="display: block; margin: 0 auto; width: 100%;">
  184. <!-- -->
  185. <div class="col-lg-3 text-center">
  186. <div class="row">
  187. <h6><a href=".">KYUP</a></h6>
  188. <hr>
  189. </div>
  190. </div>
  191. <!-- -->
  192. <?php if (!empty($msgS)): ?>
  193. <div class="container-fluid">
  194. <div class="row">
  195. <div class="alert alert-success">
  196. <?= $msgS ?>
  197. </div>
  198. </div>
  199. </div>
  200. <?= PHP_EOL ?>
  201. <?php endif; ?>
  202. <!-- -->
  203. <?php if (!empty($msgE)): ?>
  204. <div class="container-fluid">
  205. <div class="row">
  206. <div class="alert alert-danger">
  207. <?= $msgE ?>
  208. </div>
  209. </div>
  210. </div>
  211. <?= PHP_EOL ?>
  212. <?php endif; ?>
  213. <!-- -->
  214. <div class="container-fluid">
  215. <div class="row">
  216. <div class="col-lg-3">
  217. <div class="well">
  218. <?php if (!empty($output)): ?>
  219. <?php foreach ($output as $o): ?>
  220. <?= $o ?>
  221. <br>
  222. <?php endforeach; ?>
  223. <?= PHP_EOL ?>
  224. <?php endif; ?>
  225. </div>
  226. </div>
  227. </div>
  228. </div>
  229. <!-- -->
  230.  
  231.  
  232.  
  233.  
  234.  
  235. <div class="container-fluid">
  236.  
  237. <div class="row">
  238. <div class="panel panel-default">
  239. <div class="panel-body">
  240.  
  241. </div>
  242.  
  243.  
  244. <div class="panel-heading">List</div>
  245. <div class="panel-body">
  246. <form class="form" method="post">
  247. <input type="text" class="form-control" name="format" placeholder="port:user:pass"></p>
  248. <button class="btn btn-info btn-lg btn-block" id="list" type="submit" name="list">List Proxies</button>
  249. </form>
  250. </div>
  251. </div>
  252. </div>
  253. </div>
  254. <!-- -->
  255. <div class="container-fluid">
  256. <div class="row">
  257. <div class="panel panel-default">
  258. <div class="panel-heading">Create</div>
  259. <div class="panel-body">
  260. <form class="form" method="POST" action="">
  261. <div class="form-group">
  262. <input class="form-control" id="quantity" type="text" name="quantity" placeholder="Quantity ..." required>
  263. </div>
  264. <div class="form-group">
  265. <select class="form-control" id="location" name="location">
  266. <option value="1">North America - Chicago</option>
  267. <option value="4">Europe - Amsterdam</option>
  268. <option value="6">Europe - London</option>
  269. <option value="3">Asia Pacific - Singapore</option>
  270. </select>
  271. </div>
  272. <button class="btn btn-success btn-lg btn-block" id="create" type="submit" name="create">CREATE <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></button>
  273. </form>
  274. </div>
  275. </div>
  276. </div>
  277. </div>
  278. <!-- -->
  279. <div class="container-fluid">
  280. <div class="row">
  281. <div class="col-lg-3">
  282. <div class="panel panel-default">
  283. <div class="panel-heading">API Settings
  284. <button data-toggle="collapse" data-target="#apiContent" type="button" class="btn btn-default" aria-label="Left Align">
  285. <span class="glyphicon glyphicon glyphicon-cog" aria-hidden="true"></span>
  286. </button>
  287.  
  288. </div>
  289. <div class="panel-body collapse" id="apiContent">
  290. <form class="form" method="post">
  291. <div class="form-group">
  292. <input class="form-control" id="apikey" type="text" name="apikey" value="<?php echo $v_a;?>" placeholder="<?php echo $ph_a;?>" required>
  293. </div>
  294. <div class="form-group">
  295. <input class="form-control" id="enckey" type="text" name="enckey" value="<?php echo $v_c;?>" placeholder="<?php echo $ph_c;?>" required>
  296. </div>
  297. <div class="form-group">
  298. <input class="form-control" id="scriptid" type="text" name="scriptid" value="<?php echo $v_b?>" placeholder="<?php echo $ph_b;?>" required>
  299. </div>
  300. <button class="btn btn-warning btn-lg btn-block" id="create" type="submit" name="create2">SAVE <span class="glyphicon glyphicon-save" aria-hidden="true"></span></button>
  301. <button class="btn btn-danger btn-lg btn-block" id="delete2" type="submit" name="delete2">CLEAR API INFO <span class="glyphicon glyphicon-trash" aria-hidden="true"></button>
  302. </form>
  303.  
  304. <br/>
  305.  
  306. <form class="form" method="post">
  307.  
  308. </form>
  309. </div>
  310. </div>
  311. </div>
  312. </div>
  313. </div>
  314. <!-- -->
  315.  
  316. </form>
  317. </div>
  318. </div>
  319. </div>
  320. </div>
  321. </div>
  322. <div class="container-fluid">
  323. <div class="row">
  324. <div class="panel panel-default">
  325. <div class="panel-heading">Delete</div>
  326. <div class="panel-body">
  327. <form class="form" method="post">
  328. <button class="btn btn-danger btn-lg btn-block" id="list" type="submit" name="del">DESTROY PROXIES <span class="glyphicon glyphicon-trash"</button>
  329. </form>
  330. </div>
  331. </div>
  332. </div>
  333. </div>
  334. <?php if(isset($_POST['list'])) {
  335. if(count($arr["data"]["list"]) > 0) { ?>
  336. <div class="container-fluid">
  337. <div class="row">
  338. <div class="panel panel-default">
  339. </div>
  340. </div>
  341. </div>
  342. <?php
  343. }
  344. }
  345. ?>
  346. <!-- -->
  347. <div class="container-fluid">
  348. <div class="row">
  349. <div style="text-align: center;">
  350. <hr>
  351. <p><small>&copy; <?= date('Y') ?> <a href="https://TheProxyGuru.com" target="_blank">TheProxyGuru</a></small></p>
  352. </div>
  353. </div>
  354. </div>
  355. </div>
  356. </body>
  357. </html>
  358.  
  359. </html>
Add Comment
Please, Sign In to add comment