当前位置:网站首页>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思路理清了还是很简单的。
边栏推荐
- 十大劵商如何开户?另外,手机开户安全么?
- 下载Xshell和Xftp
- Félicitations pour l'inscription réussie de wuxinghe
- The database is locked. Is there a solution
- Download xshell and xftp
- LSTM of RNN
- Sorting out tcp/udp communication problems
- Cyclic neural network
- Alibaba OSS postman invalid according to policy: policy condition failed: ["starts with", "key", "test/"]
- Custom events of components ②
猜你喜欢

三极管是一项伟大的发明

2022 Guangdong Provincial Safety Officer a certificate third batch (main person in charge) special operation certificate examination question bank simulated examination platform operation

Minecraft 1.16.5模组开发(五十一) 方块实体 (Tile Entity)

华为ModelArts训练Alexnet模型

Wang Yingqi, founder of ones, talks to fortune (Chinese version): is there any excellent software in China?

She is the "HR of others" | ones character

How relational databases work

组件的自定义事件②

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

如何使用layui将数据库中的数据以表格的形式展现出来
随机推荐
2022危险化学品经营单位主要负责人试题及模拟考试
论文学习——水文时间序列相似性查询的分析与研究
redisson使用全解——redisson官方文档+注释(上篇)
Vhost kick & call principle
她就是那个「别人家的HR」|ONES 人物
The database is locked. Is there a solution
Redisson utilise la solution complète - redisson Documents officiels + commentaires (Partie 1)
[recommendation system] breakthrough and imagination of deep location interactive network dpin for meituan takeout recommendation scenario
浅谈CVPR2022的几个研究热点
MATLAB之基础知识
Cadence OrCAD capture "network name" is the same, but it is not connected or connected incorrectly. The usage of nodeName of liberation scheme
【mysql学习笔记26】视图
Detailed explanation of weback5 basic configuration
Missing API interface actual development series (14): ID card real name authentication verification
Sorting out tcp/udp communication problems
atguigu----脚手架--02-使用脚手架(2)
2022 mobile crane driver test exercises and online simulation test
Minecraft 1.16.5 module development (51) tile entity
[MySQL learning notes 26] view
LSTM of RNN