source.zip得到源码。开始审计
在index.php中。对所有输入进行了addslashes转义。
在login.php中
查看源代码发现
<link rel="icon" href="/uploads/favicon.ico" type="image/x-icon" />
<!-- Hint : flag in f1ag_Is_h3re -->
<!-- 趣味题,真的是为了出题而出题的,别打我。 By Virink -->
访问index.php.bak得到index.php的源码
<?php /* PHP Encode by http://Www.PHPJiaMi.Com/ */error_reporting(0);ini_set("display_errors", 0);if(!defined('jnggfmpt')){define('jnggfmpt',__FILE__);if(!function_exists("鯒仅熫")){functi.省略。。。。。。
可以看出这是个phpjiami的加密文件。得解密
这题得从github上下源码。
进入web。有两个功能。一个是判断文件类型。一个是文件上传。配合源码。分析一下
文件上传:
Ezpop
<?php
//flag is in flag.php
//And Crack It!
class Modifier {
protected $var;
public function append($value){
include($value);
}
public function __invoke(){
$this->append($this->var);
}
}
class Show{
public $source;
public $str;
public function __construct($file='index.php'){
$this->source = $file;
echo 'Welcome to '.$this->source."<br>";
}
public function __toString(){
return $this->str->source;
}
public function __wakeup(){
if(preg_match("/gopher|http|file|ftp|https|dict|\.\./i", $this->source)) {
echo "hacker";
$this->source = "index.php";
}
}
}
class Test{
public $p;
public function __construct(){
$this->p = array();
}
public function __get($key){
$function = $this->p;
return $function();
}
}
if(isset($_GET['pop'])){
@unserialize($_GET['pop']);
}
else{
$a=new Show;
highlight_file(__FILE__);
}
注一下
好像是攻防世界的原题。。
注册一个"||updatexml(1,(version()),1)#
登陆后。修改密码会报错。报错注入拿flag。用()绕过空格
"||updatexml(1,concat(0x7e,(select(flag)from(flag)),0x7e),1)#
题目给出了源码。有两个功能。一个是upload。一个是show
upload呢。是输入一个URL。然后会访问URL/avatar.gif然后保存到本地
show呢。是读取这个gif文件。
首先就一个登陆和注册。貌似没注入。
进去以后URL如下http://00f9d39c-5972-4a18-9744-2d59c6264341.node3.buuoj.cn/index.php?file=download