当前位置:网站首页>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思路理清了还是很简单的。
边栏推荐
- Apple account password auto fill
- Jax's deep learning and scientific computing
- Wang Yingqi, founder of ones, talks to fortune (Chinese version): is there any excellent software in China?
- [软件] phantomjs屏幕截图
- AUTOSAR learning record (1) – ECUM_ Init
- [skill] create Bat quick open web page
- ONES 创始人王颖奇对话《财富》(中文版):中国有没有优秀的软件?
- [MySQL learning notes27] stored procedure
- Redisson utilise la solution complète - redisson Documents officiels + commentaires (Partie 1)
- 力扣每日一题-第31天-202.快乐数
猜你喜欢

Browser local storage

2022茶艺师(初级)操作证考试题库及模拟考试
![[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](/img/8d/cf259b9bb8574aa1842280c9661d1e.jpg)
[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

【无标题】

She is the "HR of others" | ones character

I bet on performance and won the CTO of the company. I want to build Devops platform!
![[batch dos-cmd command - summary and summary] - Common operators in the CMD window (<, < <, & <,>, > >, & >, & >, & &, ||, (),;, @)](/img/48/de19e8cc007b93a027a906d4d423b2.png)
[batch dos-cmd command - summary and summary] - Common operators in the CMD window (<, < <, & <,>, > >, & >, & >, & &, ||, (),;, @)

The database is locked. Is there a solution

2022 electrician (intermediate) recurrent training question bank and answers

TodoList经典案例①
随机推荐
Saving db4i depth camera pictures with MATLAB
Redisson uses the complete solution - redisson official documents + Notes (Part 1)
[MySQL learning notes 26] view
The database is locked. Is there a solution
长路漫漫、技术作伴
力扣每日一题-第31天-1790.仅执行一次字符串交换能否使两个字符串相等
【mysql学习笔记28】存储函数
Microsoft announces open source (Godel) language model chat robot
Rk3399 platform development series explanation (network debugging) 7.30. What will affect the sending process of TCP packets?
2022电工(中级)复训题库及答案
【编程强训2】排序子序列+倒置字符串
weback5基础配置详解
Cyclic neural network
浏览器本地存储
下载Xshell和Xftp
力扣每日一题-第31天-1502.判断能否形成等差数列
2022 mobile crane driver test exercises and online simulation test
【技能】创建.bat快速打开网页
Illusory and simple screen raindrop post-processing effect
The triode is a great invention