当前位置:网站首页>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思路理清了还是很简单的。
边栏推荐
- MATLAB之基础知识
- Cyclic neural network
- Huawei modelarts training alexnet model
- Introduction to kubernetes resource objects and common commands (II)
- 2022茶艺师(初级)操作证考试题库及模拟考试
- Caesar
- 2022 mobile crane driver test exercises and online simulation test
- [MySQL learning notes 25] SQL statement optimization
- 浏览器本地存储
- Two expressions of string
猜你喜欢

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

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

LSTM of RNN

Introduction to kubernetes resource objects and common commands (II)

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

kubernetes资源对象介绍及常用命令(二)

C# Newtonsoft. Use of job in JSON

Atguigu---- scaffold --02- use scaffold (2)

base64

atguigu----脚手架--02-使用脚手架(2)
随机推荐
2022年茶艺师(中级)复训题库及答案
Vhost kick & call principle
038 network security JS
Rk3399 platform development series explanation (network debugging) 7.30. What will affect the sending process of TCP packets?
华泰证券开户是安全可靠的么?怎么开华泰证券账户
redisson使用全解——redisson官方文档+注释(中篇)
Eigen矩阵运算库快速上手
AUTOSAR learning record (1) – ECUM_ Init
【mysql学习笔记26】视图
Wang Yingqi, founder of ones, talks to fortune (Chinese version): is there any excellent software in China?
2022 Guangdong Provincial Safety Officer a certificate third batch (main person in charge) special operation certificate examination question bank simulated examination platform operation
2022 test question bank and simulation test of tea master (primary) operation certificate
Redisson uses the full solution - redisson official document + comments (Part 2)
Li Kou daily question - day 31 -1502 Judge whether an arithmetic sequence can be formed
[MySQL learning notes27] stored procedure
Redisson uses the full solution - redisson official documents + comments (Part 2)
[untitled]
[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
华为ModelArts训练Alexnet模型
Array: question brushing record