Sharecode quét shell đơn giản

7 bài đăng
23.10.2017 / 18:35
Binzz
Bài đăng: 98
Member

các bạn up lleen và chạy :)

PHP
  1. <?php
  2.  
  3. /*********************************************************
  4. - Tool Scan shell vesion 1.0
  5.  
  6. **********************************************************/
  7. error_reporting (E_ALL);// Mở báo lỗi
  8. ini_set("memory_limit","2000M");
  9. ini_set("safe_mode","off");
  10. $safe_mode = @ini_get('safe_mode');
  11. if (!$safe_mode)
  12. set_time_limit(0);
  13. if (@!isset($_POST['key']))
  14. {
  15. ?>
  16. <html>
  17. <head>
  18. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  19. <title>Scan Shell v2.6</title>
  20. <style>
  21. body {
  22. font-family:arial;
  23. }
  24. </style>
  25. </head>
  26. <body bgcolor=black text=blue size=2><center>
  27. <form method='post' action=''>
  28. <div style="border-style: solid; border-width: 1px; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px">
  29. <h1>Scan Shell - v2.6</h1>
  30. <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Folder: <input type='text' size=70 name='folder' value='<?echo $_SERVER['DOCUMENT_ROOT']?>/'/></div>
  31. &nbsp;<div>&nbsp; KeyWord:&nbsp; <input type='text' size=70 name='key' value='base64_decode'/></div>
  32. <p><input type='submit' name='submit' value='Tìm kiếm' /></p> </div>
  33. <div align=left><br>Step 1: Nhập đường dẫn thư mục cần scan</div>
  34. <div align=left>Step 2: Nhập từ khóa cần tìm</div>
  35. </form>
  36.  
  37. <br><br>
  38. ---------------------------------------------------------------------------------
  39. <br><br><i>Power By <a href=""><font color=red>Binzz</font></a><br>Copyright 2017<a href="#"><font color=yellow>[email protected]</font></a><br/>
  40. <br>---------------------------------------------------------------------------------
  41. </center>
  42.  
  43. </body>
  44. </html>
  45. <?
  46. }
  47. else
  48. {
  49. if ($_POST['folder']) $folder = $_POST['folder']; else $folder = $_SERVER['DOCUMENT_ROOT'];
  50. define('Keyword',$_POST['key']);// Tìm kiếm từ khóa
  51. define('TAB',"&nbsp;&nbsp;&nbsp;&nbsp;");
  52. define('IGNORE_EXTENSIONS',"jpg pdf zip psd doc gif swf xls gz txt");// Không tìm những file
  53. define("MAX_SIZE",1024*1024*1024);// Size tối đa
  54. define("IGNORE_BEFORE", strtotime('2009-08-01') );// Tìm File trước ngày
  55. $shell = $_SERVER["PHP_SELF"];
  56.  
  57. function findexts($filename)
  58. {
  59. $filename = strtolower($filename) ;
  60. $exts = split("[/\\.]", $filename) ;
  61. $n = count($exts)-1;
  62. $exts = $exts[$n];
  63. return strtolower($exts);
  64. }
  65.  
  66. function check_dir($directory,$level) {
  67. global $virus_detected, $all, $detect_errors_only, $detected_Keyword_in_test_script;
  68.  
  69. $indent='';
  70. for ($count=0;$count<$level;$count++) {
  71. $indent.=TAB;
  72. }
  73. $level++;
  74. $read_dir=opendir($directory);// Mở thư mục hiện tại
  75. while ($file=readdir($read_dir)) {
  76. $filepath=$directory.'/'.$file;
  77. if ($detect_errors_only && $virus_detected) {
  78. exit;
  79. }
  80. if (is_dir($filepath)) {
  81. // Thư mục
  82. if ( ($file<>'.') && ($file<>'..') ) {
  83. check_dir($filepath,$level);
  84. }
  85. }
  86. else {
  87. if (is_file($filepath)) {
  88. // Tập
  89. if ( (is_readable($filepath) ) && (!stristr(IGNORE_EXTENSIONS, findexts($file))) ) {
  90. if ((filesize($filepath)< MAX_SIZE) && (filemtime($filepath)>IGNORE_BEFORE) ){
  91. $fileentry=$directory.'/'.$file.' - '.date('j F Y H:i',filemtime($filepath));
  92. $filestring=file_get_contents($filepath);
  93. $found=stripos($filestring,Keyword); // PHP 5 ONLY
  94. $found=stristr($filestring,Keyword);flush();
  95. if ($found==false) {
  96. if ( (!$detect_errors_only) && (!$all) ) {
  97. echo($filepath.' <font color=#FFFFFF>OK</font><br/>');
  98. }
  99. }
  100. else {
  101. if ($file=='scan_file.php'){
  102. $detected_Keyword_in_test_script=true;
  103. }
  104. else {
  105. $virus_detected=true;
  106. if ($detect_errors_only) {
  107. echo('<b style="color:#F00">Tập tin đề nghị phát hiện</b><br/>');
  108. }
  109. else {
  110. echo(TAB.'<b style="color:#F00">'.$fileentry.'</b> - <b style="color:#FFFFF0">Phát hiện</b><br/>');
  111. }
  112. }
  113. }
  114. $found='';
  115. }
  116. else {
  117. if ( (!$detect_errors_only) && (!$all) ) {
  118. echo($filepath.' <b style="color:yellow">NOT CHECKED - File quá lớn</b><br/>');
  119. }
  120. }
  121. }
  122. else {
  123. if ( (!$detect_errors_only) && (!$all) ) {
  124. echo($filepath.' <b style="color:yellow">NOT CHECKED - Không thuộc kiểu tìm kiếm</b><br/>');
  125. }
  126. }
  127. }
  128. else {
  129. }
  130. }
  131. }
  132. closedir($read_dir);
  133. }
  134.  
  135. $virus_detected=false;
  136. $all=true;
  137. $detect_errors_only=false;
  138. $detected_Keyword_in_test_script=false;
  139. if (isset($_GET['all'])) {
  140. $all=false;
  141. }
  142. if (isset($_GET['detect_errors_only'])) {
  143. $detect_errors_only=true;
  144. }
  145.  
  146. echo<<<END1
  147. <html>
  148. <head>
  149. <title>Scan Shell v1.1</title>
  150. <style>
  151. body {
  152. font-family:arial;
  153. }
  154. </style>
  155. </head>
  156. <body bgcolor=black text=blue size=2>
  157. END1;
  158. ?>
  159. <div style="border-style: solid; border-width: 1px; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px">
  160. <h1>Truy xuất từ khóa "<?echo Keyword?>" trong hệ thống !</h1>
  161. Bỏ qua lỗi file : <font color=yellow><?echo IGNORE_EXTENSIONS?>.</font><br/>
  162. Bỏ qua file vượt quá : <font color=yellow><?echo MAX_SIZE?> bytes.</font><br/>
  163. Tìm kiếm file trước ngày :<font color=yellow> <?echo date('j F Y',IGNORE_BEFORE)?>.</font><br/><br></div>
  164. <br/><br>[<a href="<?echo $shell?>?all">Hiển thị tất cả?</a>]
  165. <br/><br/>&nbsp;<br/>
  166. <?
  167.  
  168. if ($all) {
  169. echo('<font color=yellow>List File</font><br/>');
  170. }
  171. check_dir($folder,0);
  172.  
  173.  
  174.  
  175. if ($virus_detected) {
  176. echo('<br/><b style="color:#f00">Tìm kiếm thành công!</b><br>&nbsp;<br/>');
  177. }
  178. else {
  179. echo('<br/><b style="color:#f00">Không có file chứa Key Word!</b><br>&nbsp;<br/>');
  180. }
  181.  
  182. ?>
  183. </body>
  184. </html>
  185. <?
  186. }
  187. ?><?
23.10.2017 / 19:24
PMTpro
Bài đăng: 464
Member
@ngatngay

Lần sau share code thì up thêm zip nhá :)

ngại copy vc :yao1:

23.10.2017 / 19:27
tnit2510
Bài đăng: 970
Member
PMTpro đã viết

Lần sau share code thì up thêm zip nhá :)

ngại copy vc :yao1:

qoute để copy nhanh hơn :yao:

23.10.2017 / 19:29
PMTpro
Bài đăng: 464
Member
@ngatngay
chuotiube đã viết

qoute để copy nhanh hơn :yao:

Vẫn thích zip hơn @@

23.10.2017 / 19:37
mad
Bài đăng: 2434
Member
Nhào vô cắn tao đi, tao sợ mày à cắn bừa.

Shell gì đây. Hay code lấy từ trên mạng rùi thay copyright

23.10.2017 / 19:42
PMTpro
Bài đăng: 464
Member
@ngatngay
mad đã viết

Shell gì đây. Hay code lấy từ trên mạng rùi thay copyright

Copyright by "MrT"

23.10.2017 / 19:55
Binzz
Bài đăng: 98
Member

chán mấy đứa con nít nhãy vào cmt quá