index.php 11 KB

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