当前位置:网站首页>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
思路理清了还是很简单的。
边栏推荐
- PWN attack and defense world int_ overflow
- go通用动态重试机制解决方案的实现与封装
- Kickback -- find the first palindrome character in a group of characters
- 【编程强训3】字符串中找出连续最长的数字串+数组中出现次数超过一半的数字
- Long way to go with technology
- Apple account password auto fill
- Browser local storage
- 如何让两融交易更极速
- Li Kou daily question - day 31 -1790 Can a string exchange be performed only once to make two strings equal
- [skill] create Bat quick open web page
猜你喜欢
Browser local storage
How to create an exclusive vs Code theme
Introduction to kubernetes resource objects and common commands (II)
Thesis learning -- Analysis and Research on similarity query of hydrological time series
凸印的印刷原理及工艺介绍
2022 test questions and mock examinations for main principals of hazardous chemicals business units
2022年茶艺师(中级)复训题库及答案
C # read and write customized config file
I bet on performance and won the CTO of the company. I want to build Devops platform!
2022茶艺师(初级)操作证考试题库及模拟考试
随机推荐
IMDB practice of emotion classification (simplernn, LSTM, Gru)
Li Kou daily question - day 31 -1790 Can a string exchange be performed only once to make two strings equal
Félicitations pour l'inscription réussie de wuxinghe
Apple account password auto fill
How to create an exclusive vs Code theme
TCP/UDP 通信问题整理
Todolist classic case ①
Caesar
下载Xshell和Xftp
MATLAB之基础知识
Sorting out tcp/udp communication problems
Saving db4i depth camera pictures with MATLAB
redisson使用全解——redisson官方文档+注释(下篇)
[MySQL learning notes 26] view
Apple账号密码自动填充
十大劵商如何开户?另外,手机开户安全么?
奥迪AUDI EDI 项目中供应商需要了解哪些信息?
2022广东省安全员A证第三批(主要负责人)特种作业证考试题库模拟考试平台操作
Huawei modelarts training alexnet model
【批处理DOS-CMD命令-汇总和小结】-Cmd窗口中常用操作符(<、<<、&<、>、>>、&>、&、&&、||、|、()、;、@)