当前位置:网站首页>web254
web254
2022-07-01 07:51:00 【姜小孩.】
附代码:
<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date: 2020-12-02 17:44:47
# @Last Modified by: h1xa
# @Last Modified time: 2020-12-02 19:29:02
# @email: [email protected]
# @link: https://ctfer.com
*/
error_reporting(0);
highlight_file(__FILE__);
include('flag.php');
class ctfShowUser{
public $username='xxxxxx';
public $password='xxxxxx';
public $isVip=false;
public function checkVip(){
return $this->isVip;
}
public function login($u,$p){
if($this->username===$u&&$this->password===$p){
$this->isVip=true;
}
return $this->isVip;
}
public function vipOneKeyGetFlag(){
if($this->isVip){
global $flag;
echo "your flag is ".$flag;
}else{
echo "no vip, no flag";
}
}
}
$username=$_GET['username'];
$password=$_GET['password'];
if(isset($username) && isset($password)){
$user = new ctfShowUser();
if($user->login($username,$password)){
if($user->checkVip()){
$user->vipOneKeyGetFlag();
}
}else{
echo "no vip,no flag";
}
}
这道题很简单,大概思路就是让你Get传参一个username和password,下面的if是检查是否为空,不为空就调用ctfShowUser里面的login方法,传入的username变成了$u,传入的password变成了$p。下面的if就是在判断isVip是否为ture,可以看到一开始

这里的的isVip是false的,所以如果username和password的值和ctfShowUser里面的username和password的值分别相同,那么就让isVip变成Ture,我们就可以跳到vipOneKeyGetFlag()中去。得到flag
payload:
?username=xxxxxx&password=xxxxxx思路理清了还是很简单的。
边栏推荐
- Saving db4i depth camera pictures with MATLAB
- 奥迪AUDI EDI 项目中供应商需要了解哪些信息?
- atguigu----脚手架--02-使用脚手架(2)
- Vhost kick & call principle
- Jax's deep learning and scientific computing
- redisson使用全解——redisson官方文檔+注釋(上篇)
- PWN attack and defense world int_ overflow
- 2022 tea master (intermediate) recurrent training question bank and answers
- How do the top ten securities firms open accounts? In addition, is it safe to open a mobile account?
- LM08丨网格系列之网格反转(精)
猜你喜欢

2022制冷与空调设备运行操作国家题库模拟考试平台操作

【编程强训3】字符串中找出连续最长的数字串+数组中出现次数超过一半的数字

Redisson uses the full solution - redisson official document + comments (Part 2)
![[Shenzhen IO] precise Food Scale (some understanding of assembly language)](/img/8c/1e64401e812538d8606df557054355.png)
[Shenzhen IO] precise Food Scale (some understanding of assembly language)

Alibaba OSS postman invalid according to policy: policy condition failed: ["starts with", "key", "test/"]

Discussion on several research hotspots of cvpr2022

Browser local storage

如何让两融交易更极速

2022 test question bank and simulation test of tea master (primary) operation certificate

ONES 创始人王颖奇对话《财富》(中文版):中国有没有优秀的软件?
随机推荐
[MySQL learning notes27] stored procedure
[MySQL learning notes 28] storage function
[target detection] yolov5, the shoulder of target detection (detailed principle + Training Guide)
【网站架构】一招搞定90%的分布式事务,实打实介绍数据库事务、分布式事务的工作原理应用场景
Jax's deep learning and scientific computing
下载Xshell和Xftp
漏刻有时API接口实战开发系列(14):身份证实名鉴权验证
Apple账号密码自动填充
2022 operation of refrigeration and air conditioning equipment operation of national question bank simulated examination platform
华为ModelArts训练Alexnet模型
Illusory and simple screen raindrop post-processing effect
长路漫漫、技术作伴
2022电工(中级)复训题库及答案
The triode is a great invention
2022 mobile crane driver test exercises and online simulation test
奥迪AUDI EDI 项目中供应商需要了解哪些信息?
Android screen adaptation (using constraintlayout), kotlin array sorting
base64
Introduction to kubernetes resource objects and common commands (II)
2022 electrician (intermediate) recurrent training question bank and answers