CTF-33解题思路

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

源码分析:

  1. <h3>挑战VIP会员的第一天<h3/>
  2. <?php
  3. error_reporting(0);
  4. highlight_file(__FILE__);
  5. include('flag.php');
  6. class ctfShowUser
  7. {
  8. public $username='xxxxxx';
  9. public $password='xxxxxx';
  10. public $isVip=false;
  11. public function checkVip()
  12. {
  13. return $this->isVip;
  14. }
  15. public function login($u,$p)
  16. {
  17. if($this->username===$u&&$this->password===$p)
  18. {
  19. $this->isVip=true;
  20. }
  21. return $this->isVip;
  22. }
  23. public function vipOneKeyGetFlag()
  24. {
  25. if($this->isVip)
  26. {
  27. global $flag;
  28. echo "your flag is ".$flag;
  29. }
  30. else
  31. {
  32. echo "no vip, no flag";
  33. }
  34. }
  35. }
  36. $username=$_GET['username'];
  37. $password=$_GET['password'];
  38. if(isset($username) && isset($password))
  39. {
  40. $user = new ctfShowUser();
  41. if($user->login($username,$password))
  42. {
  43. if($user->checkVip())
  44. {
  45. $user->vipOneKeyGetFlag();
  46. }
  47. }
  48. else
  49. {
  50. echo "no vip,no flag";
  51. }
  52. }

考点:

主要进行代码审计,理解类的以及函数的调用。

payload:

  1. ?username=xxxxxx&password=xxxxxx

打赏我,让我更有动力~

1 条回复   |  直到 2021-11-19 | 768 次浏览

十二梦
发表于 2021-11-19

这是哪里的CTF呀,有链接不

评论列表

  • 加载数据中...

编写评论内容
登录后才可发表内容
返回顶部 投诉反馈

© 2016 - 2024 掌控者 All Rights Reserved.