当前位置:网站首页>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思路理清了还是很简单的。
边栏推荐
- LM08丨网格系列之网格反转(精)
- 力扣每日一题-第31天-1502.判断能否形成等差数列
- 她就是那个「别人家的HR」|ONES 人物
- [skill] create Bat quick open web page
- redisson使用全解——redisson官方文档+注释(下篇)
- Li Kou daily question - Day 32 -1822 Symbol of array element product
- Minecraft 1.16.5模组开发(五十一) 方块实体 (Tile Entity)
- 力扣——求一组字符中的第一个回文字符
- Sorting out tcp/udp communication problems
- [软件] phantomjs屏幕截图
猜你喜欢

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

Microsoft announces open source (Godel) language model chat robot

C# Newtonsoft. Use of job in JSON

LM08丨网格系列之网格反转(精)

【编程强训】删除公共字符(哈希映射)+组队竞赛(贪心)

Atguigu---- scaffold --02- use scaffold (2)
![[kv260] generate chip temperature curve with xadc](/img/fc/e5e4648b09b1123b2d494b75a9f8f7.png)
[kv260] generate chip temperature curve with xadc

IMDB practice of emotion classification (simplernn, LSTM, Gru)

How to create an exclusive vs Code theme
![[programming training] delete public characters (hash mapping) + team competition (greedy)](/img/cd/63eb9da1e8956df0763797f079b67f.png)
[programming training] delete public characters (hash mapping) + team competition (greedy)
随机推荐
C # read and write customized config file
【mysql学习笔记26】视图
LSTM of RNN
Redisson uses the full solution - redisson official documents + comments (Part 2)
[programming training 2] sorting subsequence + inverted string
What information does the supplier need to know about Audi EDI project?
下载Xshell和Xftp
H5 页面设置了字体的粗细样式,但是在华为手机里微信打开访问样式不生效?
atguigu----脚手架--02-使用脚手架(2)
Caesar
2022 test questions and mock examinations for main principals of hazardous chemicals business units
Thesis learning -- Analysis and Research on similarity query of hydrological time series
Apple账号密码自动填充
kubernetes资源对象介绍及常用命令(二)
关系数据库如何工作
038 network security JS
2022危险化学品经营单位主要负责人试题及模拟考试
Redisson uses the full solution - redisson official document + comments (Part 2)
Subclasses call methods and properties of the parent class with the same name
Custom events of components ②