index.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <?php
  2. /* Site Data */
  3. $site_name = "BLACK VPS";
  4. $site_description = "Premium VPN/SSH/SSL Accounts Fast And Reliable Servers";
  5. $site_template = "flatly"; // (flatly, darkly, sketchy, lumen, materia)
  6. $site_ip_address = "xxxxxxxxx"; // set site ip
  7. $site_paypal = "https://paypal.me/badboy897"; // set site paypal donate link
  8. $site_contact = "https://t.me/badboy897"; // set site contact us link
  9. $daily_limit_user = "90"; // set daily limit
  10. /* Server Data */
  11. /* Format: Server_Name, IP_Address, Root_Pass, Account_Validity */
  12. /* Example: 1=>array(1=>"DopeKid Server 1","123.456.789","DopeKid","5"), */
  13. $server_lists_array=array(
  14. 1=>array(1=>"BlackVPN","xxxxxxxxx","saC090988lanun","3"),
  15. );
  16. /* Service Variables */
  17. $port_ssh= '22, 143, 90'; // SSH Ports
  18. $port_dropbear= '109, 110, 442'; // Dropbear Ports
  19. $port_ssl= '444'; // SSL Ports
  20. $port_squid= '3128, 8080, 8000, 3128'; // Squid Ports
  21. $ovpn_client= ''.$hosts.'/black.ovpn'; // OpenVPN Client Config
  22. /* Dont Edit Anything After This Line*/
  23. for ($row = 1; $row < 101; $row++)
  24. {
  25. if ( $_POST['server'] == $server_lists_array[$row][1] )
  26. {
  27. $hosts= $server_lists_array[$row][2];
  28. $root_pass= $server_lists_array[$row][3];
  29. $expiration= $server_lists_array[$row][4];
  30. break;
  31. }
  32. }
  33. $error = false;
  34. if (isset($_POST['user']))
  35. {
  36. $username = trim($_POST['user']);
  37. $username = strip_tags($username);
  38. $username = htmlspecialchars($username);
  39. $password1 = trim($_POST['password']);
  40. $password1 = strip_tags($password1);
  41. $password1 = htmlspecialchars($password1);
  42. $nDays = $expiration;
  43. $datess = date('m/d/y', strtotime('+'.$nDays.' days'));
  44. $password = escapeshellarg( crypt($password1) );
  45. if (empty($username))
  46. {
  47. $error = true;
  48. $nameError = "Please Enter A Username";
  49. }
  50. else if (strlen($username) < 3)
  51. {
  52. $error = true;
  53. $nameError = "Name Must Have Atleast 3 Characters.";
  54. }
  55. if (empty($password1))
  56. {
  57. $error = true;
  58. $passError = "Please Enter A Password.";
  59. }
  60. else if(strlen($password1) < 3)
  61. {
  62. $error = true;
  63. $passError = "Password Must Have Atleast 3 Characters.";
  64. }
  65. if($username == $password1)
  66. {
  67. $error = true;
  68. $ConfirmError = "Username and Password Should Not Be The Same ";
  69. }
  70. if( !$error)
  71. {
  72. date_default_timezone_set('UTC');
  73. date_default_timezone_set("Asia/Kuala_Lumpur");
  74. $my_date = date("Y-m-d H:i:s");
  75. $connection = ssh2_connect($hosts, 22);
  76. if (ssh2_auth_password($connection, 'root', $root_pass))
  77. {
  78. $check_user = ssh2_exec($connection, "id -u $username");
  79. $check_user_error = ssh2_fetch_stream($check_user, SSH2_STREAM_STDERR);
  80. stream_set_blocking($check_user_error, true);
  81. stream_set_blocking($check_user, true);
  82. $stream_check_user_error = stream_get_contents($check_user_error);
  83. $stream_check_user = stream_get_contents($check_user);
  84. if ( !empty($stream_check_user))
  85. {
  86. $ServerError = "Username Already Taken";
  87. }
  88. elseif ( !empty($stream_check_user_error))
  89. {
  90. $check_daily_limit = ssh2_exec($connection, "wc -l < /home/vps/public_html/daily_user_limit.txt");
  91. $check_daily_limit_error = ssh2_fetch_stream($check_user, SSH2_STREAM_STDERR);
  92. stream_set_blocking($check_daily_limit_error, true);
  93. stream_set_blocking($check_daily_limit, true);
  94. $stream_check_daily_limit_error = stream_get_contents($check_daily_limit_error);
  95. $stream_check_daily_limit = stream_get_contents($check_daily_limit);
  96. if ($stream_check_daily_limit >= $daily_limit_user)
  97. {
  98. $ServerError = "Server Full, Try Again Tomorrow";
  99. }
  100. else
  101. {
  102. $show = true;
  103. ssh2_exec($connection, "useradd $username -m -p $password -e $datess -d /tmp/$username -s /bin/false");
  104. ssh2_exec($connection, 'echo "====================" >> /home/vps/public_html/daily_user_limit.txt');
  105. }
  106. }
  107. }
  108. else
  109. {
  110. die('Connection Failed...');
  111. }
  112. }
  113. }
  114. ?>
  115. <!DOCTYPE html>
  116. <html xmlns="http://www.w3.org/1999/xhtml">
  117. <head>
  118. <meta charset="utf-8">
  119. <meta name="viewport" content="width=device-width, initial-scale=1">
  120. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  121. <title><?php echo $site_name;?> | <?php echo $site_description;?></title>
  122. <meta name="description" content="<?php echo $site_description;?>"/>
  123. <meta property="og:type" content="website" />
  124. <meta property="og:image" content="https://raw.githubusercontent.com/dopekid30/-generate-sa-idnumbers/master/20201002_222944.jpg" />
  125. <script language='JavaScript'>
  126. var txt = ' ' + document.title + ' '
  127. var speed = 400;
  128. var refresh = null;
  129. function site_name()
  130. {
  131. document.title = txt;
  132. txt = txt.substring(1, txt.length) + txt.charAt(0);
  133. refresh = setTimeout("site_name()", speed);
  134. }
  135. site_name();
  136. </script>
  137. <link rel="shortcut icon" type="image/x-icon" href="https://raw.githubusercontent.com/lanundarat87/xxx/main/Res/Panel/logo.ico">
  138. <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootswatch/4.1.1/<?php echo $site_template;?>/bootstrap.min.css">
  139. <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css">
  140. <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
  141. <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
  142. <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" ></script>
  143. </head>
  144. <nav class="navbar navbar-expand-lg navbar-dark bg-danger">
  145. <a class="navbar-brand" href="/">
  146. <img src="https://raw.githubusercontent.com/lanundarat87/xxx/main/Res/Panel/logo.ico" width="30" height="30" class="d-inline-block align-top" alt="">
  147. <?php echo $site_name;?>
  148. </a>
  149. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
  150. <span class="navbar-toggler-icon"></span>
  151. </button>
  152. <div class="collapse navbar-collapse" id="navbarTogglerDemo02">
  153. <ul class="navbar-nav mr-auto mt-2 mt-lg-0">
  154. <li class="nav-item active">
  155. <a class="nav-link" href="http://<?php echo $site_ip_address;?>:89/">OpenVPN Monitor <span class="sr-only">(current)</span></a>
  156. </li>
  157. <li class="nav-item active">
  158. <a class="nav-link" href="<?php echo $site_paypal;?>"target="_blank">Paypal Donate <span class="sr-only">(current)</span></a>
  159. </li>
  160. <li class="nav-item active">
  161. <a class="nav-link" href="<?php echo $site_contact;?>"target="_blank">Contact Us <span class="sr-only">(current)</span></a>
  162. </li>
  163. </nav>
  164. </header>
  165. <div align="center">
  166. <img src="https://raw.githubusercontent.com/dopekid30/-generate-sa-idnumbers/master/logo.gif" alt="" height="200" width"200"/>
  167. <div class="col-md-4" align="center">
  168. <form method="post" align="center" class="softether-create">
  169. <div class="form-group">
  170. <?php
  171. if($show == true)
  172. {
  173. echo '<div class="card alert-danger">';
  174. echo '<table class="table-danger">';
  175. echo '<tr>'; echo '<td> </td>'; echo '<td> </td>'; echo '</tr>';
  176. echo '<tr>'; echo '<td>Host</td>'; echo '<td>'; echo $hosts; echo '</td>'; echo '</tr>';
  177. echo '<tr>'; echo '<td>Username</td>'; echo '<td>'; echo $username; echo '</td>'; echo '</tr>';
  178. echo '<tr>'; echo '<td>Password</td>'; echo '<td>'; echo $password1; echo '</td>'; echo '</tr>';
  179. echo '<tr>'; echo '<td>Server</td>'; echo '<td>'; echo $_POST['server']; echo '</td>'; echo '</tr>';
  180. echo '<tr>'; echo '<td>SSH Port</td>'; echo '<td>'; echo $port_ssh; echo '</td>'; echo '</tr>';
  181. echo '<tr>'; echo '<td>Dropbear Port</td>'; echo '<td>'; echo $port_dropbear; echo '</td>'; echo '</tr>';
  182. echo '<tr>'; echo '<td>SSL Port</td>'; echo '<td>'; echo $port_ssl; echo '</td>'; echo '</tr>';
  183. echo '<tr>'; echo '<td>Squid Port</td>'; echo '<td>'; echo $port_squid; echo '</td>'; echo '</tr>';
  184. echo '<tr>'; echo '<td>OpenVPN Config</td>'; echo '<td>';echo '<a href="http://';echo $hosts; echo "/"; echo "black.ovpn"; echo'">download config</a>'; echo '</td>'; echo '</tr>';
  185. echo '<tr>'; echo '<td>Expiration Date</td>'; echo '<td>'; echo $datess; echo '</td>'; echo '</tr>';
  186. echo '<tr>'; echo '<td> </td>'; echo '<td> </td>'; echo '</tr>';
  187. echo '</table>';
  188. echo '</div>';
  189. }
  190. ?>
  191. </div>
  192. <div class="form-group">
  193. <div class="alert-danger">
  194. <span class="text-light"><?php echo $ServerError; ?></span>
  195. </div>
  196. <div class="alert-danger">
  197. <span class="text-light"><?php echo $nameError; ?></span>
  198. </div>
  199. <div class="alert-danger">
  200. <span class="text-light"><?php echo $passError; ?></span>
  201. </div>
  202. <div class="alert-danger">
  203. <span class="text-light"><?php echo $ConfirmError; ?></span>
  204. </div>
  205. </div>
  206. <div class="form-group">
  207. <div class="input-group">
  208. <div class="input-group-prepend">
  209. <span class="input-group-text"><i class="fas fa-globe" style="color:red;"></i></span>
  210. </div>
  211. <select class="custom-select" name="server" required>
  212. <option disabled selected value>Select Server</option>
  213. <optgroup label="<?php echo $site_name;?>">
  214. <?php
  215. for ($row = 1; $row < 101; $row++)
  216. {
  217. if ( !empty($server_lists_array[$row][1]))
  218. {
  219. echo '<option>'; echo $server_lists_array[$row][1]; echo '</option>';
  220. }
  221. else
  222. {
  223. break;
  224. }
  225. }
  226. ?>
  227. </optgroup>
  228. </select>
  229. </div>
  230. </div>
  231. <div class="form-group">
  232. <div class="input-group">
  233. <div class="input-group-prepend">
  234. <span class="input-group-text"><i class="fas fa-user-circle" style="color:red;"></i></span>
  235. </div>
  236. <input type="text" class="form-control" id="username" placeholder="Username" name="user" autocomplete="off" >
  237. </div>
  238. </div>
  239. <div class="form-group">
  240. <div class="input-group">
  241. <div class="input-group-prepend">
  242. <span class="input-group-text"><i class="fas fa-key" style="color:red;"></i></span>
  243. </div>
  244. <input type="text" class="form-control" id="password" placeholder="Password" name="password" autocomplete="off" >
  245. </div>
  246. </div>
  247. <div class="form-group ">
  248. <button type="submit" id="button" class="btn btn-danger btn-block btn-action">CREATE ACCOUNT</button>
  249. </div>
  250. </form>
  251. </div>
  252. </div>
  253. </div>
  254. </div>
  255. </body>
  256. </html>