当前位置:网站首页>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思路理清了还是很简单的。
边栏推荐
- Inftnews | from "avalanche" to Baidu "xirang", 16 major events of the meta universe in 30 years
- 2022 mobile crane driver test exercises and online simulation test
- 华泰证券开户是安全可靠的么?怎么开华泰证券账户
- 【Flutter 问题系列第 72 篇】在 Flutter 中使用 Camera 插件拍的图片被拉伸问题的解决方案
- 力扣每日一题-第32天-1822.数组元素积的符号
- [chapter 72 of the flutter problem series] a solution to the problem that pictures taken in the flutter using the camera plug-in are stretched
- 力扣——求一组字符中的第一个回文字符
- Scala语言学习-07-构造器
- MATLAB之基础知识
- C# Newtonsoft. Use of job in JSON
猜你喜欢

Apple账号密码自动填充

组件的自定义事件②

Gru of RNN

2022广东省安全员A证第三批(主要负责人)特种作业证考试题库模拟考试平台操作

Jax's deep learning and scientific computing

The computer has a network, but all browser pages can't be opened. What's the matter?

base64

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

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

Why some people earn nearly 10billion a year, while others earn 3000 a month: the details you ignore actually make the most money
随机推荐
奥迪AUDI EDI 项目中供应商需要了解哪些信息?
下载Xshell和Xftp
赌上了绩效,赢了公司CTO,我要搭DevOps平台!
Array: question brushing record
[batch DOS CMD summary] extension variables - delay variables CMD /v:on, CMD /v:off, SETLOCAL enabledelayedexpansion, disabledelayedexpansion
Cyclic neural network
Implementation and encapsulation of go universal dynamic retry mechanism
base64
MATLAB之基础知识
Eigen矩阵运算库快速上手
kubernetes资源对象介绍及常用命令(二)
Browser local storage
Redisson uses the full solution - redisson official documents + comments (Part 2)
H5 页面设置了字体的粗细样式,但是在华为手机里微信打开访问样式不生效?
redisson使用全解——redisson官方文档+注释(下篇)
Custom events of components ②
2022 test question bank and simulation test of tea master (primary) operation certificate
redisson使用全解——redisson官方文档+注释(上篇)
华泰证券开户是安全可靠的么?怎么开华泰证券账户
【编程强训】删除公共字符(哈希映射)+组队竞赛(贪心)