首页 > 其他分享 >NewStarCTF-thirdweek

NewStarCTF-thirdweek

时间:2024-03-31 10:34:22浏览次数:22  
标签:__ NewStarCTF url thirdweek 3A% public flag 22%

一、阳光开朗大男孩

1.题目给出了secret.txt和flag.txt两个文件,secret.txt内容如下:

法治自由公正爱国公正敬业法治和谐平等友善敬业法治富强公正民主法治和谐法治和谐法治法治公正友善敬业法治文明公正自由平等诚信平等公正敬业法治和谐平等友善敬业法治和谐和谐富强和谐富强和谐富强平等友善敬业公正爱国和谐自由法治文明公正自由平等友善敬业法治富强和谐自由法治和谐法治和谐法治和谐法治法治和谐富强法治文明公正自由公正自由公正自由公正自由

http://www.atoolbox.net/Tool.php?Id=850 进行社会主义核心价值观解密后可以得到:

this_password_is_s000_h4rd_p4sssw0rdddd

得到一个Key,结合flag.txt中的emoji表情可以推断出flag.txt使用了emoji-AES加密。

image-20231022214041502

https://aghorler.github.io/emoji-aes/ 进行emoji-AES解密,key为s000_h4rd_p4sssw0rdddd,得到Flag:

image-20231022214139857

二、大怨种

1.题目给出gif图片,编写一个脚本提取出gif的每一帧图片:

from PIL import Image
import os

def extract_frames(gif_path, output_dir):    
    gif = Image.open(gif_path)    
    os.makedirs(output_dir, exist_ok=True)    
    try:        
        while True:            
            current_frame = gif.tell()            
            output_path = os.path.join(output_dir, f"frame_{current_frame}.png")            				             gif.save(output_path, "PNG")            
            gif.seek(current_frame + 1)    
        except EOFError:        
            pass    

        print("提取完成!")

gif_path = "1.gif"
output_dir = "./res/"
extract_frames(gif_path, output_dir)

其中有一帧图像是这样的:

image-20231022214549641

左上角的是汉信码,可以在 https://tuzim.net/hxdecode/ 在线扫描,扫描后得到Flag:

image-20231022214653743

三、2-分析

题目描述如下:

image-20231022214820134

1.Flag由三个信息构成:登录用户名、存在漏洞的文件名、写入的WebShell文件名。

根据我们的常识,一般登录请求都是POST方式的请求,因此可以先过滤出所有的POST请求:

http && http.request.method == POST

可以看到有一个发送给/api/action/login.php的POST请求中有username和password字段:

image-20231022214957883

由此推断出登录的用户名为best_admin。

2.其次是存在漏洞的文件名和WebShell文件名,可以看到有大量的目录扫描流量,先使用WireShark过滤器过滤掉响应状态码为404的响应:

http && http.response.code != 404

对剩下的流量进行分析,关注到1267号流量响应比较奇怪:

image-20231022215120768

很明显存在WebShell,追踪该流。

image-20231022215306514

由此可以得到剩下的两个信息,index.php文件的page参数存在任意文件包含漏洞,攻击者通过这个漏洞包含pearcmd.php向服务器中写入了名为wh1t3g0d.php的WebShell。

而后续的流量也可以看到攻击者是利用wh1t3g0d.php这个Shell执行了一些系统命令:

image-20231022215407810

由此得到Flag明文:best_admin_index.php_wh1t3g0d.php

整体md5后包裹flag{}得到最终flag:flag{4069afd7089f7363198d899385ad688b}

四、键盘侠

1.打开题目发现是USB流量,结合题目名猜测是键盘流量,使用WireShark过滤器过滤出所有的键盘流量,然后导出保存为res.pcapng:

usb.src =="1.15.1"

使用tshark命令对流量数据进行提取并去除空行:

tshark -r res.pcapng -T fields -e usb.capdata | sed '/^\s*$/d' > usbdata.txt

导出后使用以下脚本进行按键信息提取:

normalKeys = {"04":"a", "05":"b", "06":"c", "07":"d", "08":"e", "09":"f", "0a":"g", "0b":"h", "0c":"i", "0d":"j", "0e":"k", "0f":"l", "10":"m", "11":"n", "12":"o", "13":"p", "14":"q", "15":"r", "16":"s", "17":"t", "18":"u", "19":"v", "1a":"w", "1b":"x", "1c":"y", "1d":"z","1e":"1", "1f":"2", "20":"3", "21":"4", "22":"5", "23":"6","24":"7","25":"8","26":"9","27":"0","28":"<RET>","29":"<ESC>","2a":"<DEL>", "2b":"t","2c":"<SPACE>","2d":"-","2e":"=","2f":"[","30":"]","31":"\\","32":"<NON>","33":";","34":"'","35":"<GA>","36":",","37":".","38":"/","39":"<CAP>","3a":"<F1>","3b":"<F2>", "3c":"<F3>","3d":"<F4>","3e":"<F5>","3f":"<F6>","40":"<F7>","41":"<F8>","42":"<F9>","43":"<F10>","44":"<F11>","45":"<F12>"}
shiftKeys = {"04":"A", "05":"B", "06":"C", "07":"D", "08":"E", "09":"F", "0a":"G", "0b":"H", "0c":"I", "0d":"J", "0e":"K", "0f":"L", "10":"M", "11":"N", "12":"O", "13":"P", "14":"Q", "15":"R", "16":"S", "17":"T", "18":"U", "19":"V", "1a":"W", "1b":"X", "1c":"Y", "1d":"Z","1e":"!", "1f":"@", "20":"#", "21":"$", "22":"%", "23":"^","24":"&","25":"*","26":"(","27":")","28":"<RET>","29":"<ESC>","2a":"<DEL>", "2b":"t","2c":"<SPACE>","2d":"_","2e":"+","2f":"{","30":"}","31":"|","32":"<NON>","33":"\"","34":":","35":"<GA>","36":"<","37":">","38":"?","39":"<CAP>","3a":"<F1>","3b":"<F2>", "3c":"<F3>","3d":"<F4>","3e":"<F5>","3f":"<F6>","40":"<F7>","41":"<F8>","42":"<F9>","43":"<F10>","44":"<F11>","45":"<F12>"}
nums = []
keys = open('usbdata.txt')
for line in keys:
    if len(line)!=17:
        continue
    nums.append(line[0:2]+line[4:6])
keys.close()
output = ""
for n in nums:
    if n[2:4] == "00" :
        continue
    if n[2:4] in normalKeys:
        if n[0:2]=="02":
            output += shiftKeys [n[2:4]]
        else :
            output += normalKeys [n[2:4]]
    else:
        output += '[unknown]'
print('output :n' + output)

得到如下结果:

nw3lc0m3<SPACE>to<SPACE>newstar<SPACE>ctf<SPACE>2023<SPACE>flag<SPACE>is<SPACE>here<SPACE>vvvvbaaaasffjjwwwwrrissgggjjaaasdddduuwwwwwwwwiiihhddddddgggjjjjjaa1112333888888<ESC><ESC>2hhxgbffffbbbnnat<CAP><CAP>ff<DEL>lll<DEL><DEL>aaa<DEL><DEL>gggg<DEL><DEL><DEL>{999<DEL><DEL>999<DEL><DEL>11<DEL>9aaa<DEL><DEL><SPACE><SPACE><DEL><DEL>eb2---<DEL><DEL>a450---<DEL><DEL>2f5f<SPACE><SPACE><SPACE><DEL><DEL><DEL>--<DEL>7bfc[unknown][unknown][unknown]-8989<DEL><DEL>dfdf<DEL><DEL>4bfa4bfa<DEL><DEL><DEL><DEL>85848584}}}<DEL><DEL><DEL><DEL><DEL><DEL><DEL>}]<SPACE><SPACE><SPACE><SPACE>nice<SPACE>work!1yyoou<SPACE>ggot<SPACE>tthhis<SPACE>fllag

<DEL>表示删除,<SPACE>表示空格,根据这个按键顺序对数据进行处理后得到flag:

flag{9919aeb2-a450-2f5f-7bfc-89df4bfa8584}

五、滴滴滴

1.题目给出一个wav文件和一个jpg文件,其中wav文件听起来像是拨号音,利用dtmf2num工具进行拨号音识别:

image-20231022220751366

得到拨号音的内容为:

52563319066

结合题目简介的提示,这串数字应该是某处使用的密码,因此可以尝试steghide工具来对jpg图片进行隐写内容提取:

image-20231022221008112

得到一个txt文件,打开即是Flag:

image-20231022221032514

六、Include

标签:__,NewStarCTF,url,thirdweek,3A%,public,flag,22%
From: https://www.cnblogs.com/sbhglqy/p/18106467

相关文章

  • NewStarCTF-secondweek
    一、新建Word文档1.doc文档隐写,将如图所示的设置打开,即可看到文字。2.新佛曰加密,在线网站解密。(http://hi.pcmoe.net/buddha.html)二、永不消逝的电波1.附件是个音频,audacity打开,可以看到明显的长短波。2.莫斯密码解密即可。源报文:..-./.-../.-/--./-/...././-..././.../......
  • NewStarCTF-fourthweek
    一、R通大残下载附件后发现图片最上面有一行色块:编写脚本提取出第一行像素色块的RGB值:fromPILimportImageimage=Image.open('secret.png')pixels=image.load()width,height=image.sizeforxinrange(width):r,g,b=pixels[x,0]print(f"......
  • NewStarCTF-firstweek
    一、Crypto-brainfuck1.附件内容如下。++++++++[>>++>++++>++++++>++++++++>++++++++++>++++++++++++>++++++++++++++>++++++++++++++++>++++++++++++++++++>++++++++++++++++++++>++++++++++++++++++++++>++++++++++++++++++++++++>+++++......
  • NewStarCTF-fifthweek
    一、隐秘的图片给出了两张图片,像是二维码,但是其中一张图片是损坏的,因此想到使用Stegsolve对两张图片进行异或:异或得到一张新的二维码,扫描获得Flag:二、ezhard拿到文件之后发现是硬盘格式文件新建目录挂载flag在hint.png三、新建Python文件pyc文件隐写很容易就能找......
  • NewStarCTF 2023 公开赛道 做题随笔(WEEK1|MISC部分)
    第一题下载打开得到TXT文件好的看样子应该是base32,复制到base在线转换看看得到这玩意 base58转换得到 出了flag  第二题 下载得到一张二维码用隐写软件试试得到一张这个以为是摩斯密码,试试得到有个这玩意,嘶,好像不是试试LSB 得到flag 第三题......
  • [newstarctf2023] --RE wp
    AndroGenshin:rc4加密表,base64换表:脚本梭就行username=b"genshinimpact"base64_table=[125,239,101,151,77,163,163,110,58,230,186,206,84,84,189,193,30,63,104,178,130,211,        164,94,75,16,32,33,193,160,120,......
  • NewStarCTF 2023 WEEK2|REVERSE SMC 使用IDApython静态解决SMC
    先来一篇IDApyhotn的指令教程https://www.cnblogs.com/zydt10/p/17676018.html*自己编的这题对应的expa=[0x11,0x22,0x33,0x44]foriinrange(38):result=a[i&3]ida_bytes.patch_byte(0x403040+i,get_wide_byte(0x403040+i)^result)在IDA中运行完exp之后,......
  • newstarctf2023 reverse 题解汇总
    newstarctf2023reverse题解汇总week1easy_REdie查无壳64直接IDA启动跟到main函数找到两部分flag拼起来就行了。flag{we1c0me_to_rev3rse!!}ELFdie查64ELFIDA启动稍微读一下写个py逆一下它的加密就行了flag{D0_4ou_7now_wha7_ELF_1s?}importbase64a="VlxRV......
  • [NewStarCTF WEEK5] pwn-planet 详解
    这道题目更多是考pwner的逆向功底(虽然程序逻辑也不是非常复杂=_=)老规矩,先checksec查看程序保护全开看一下main函数__int64__fastcallmain(inta1,char**a2,char**a3){unsignedintv4;//eaxchars1[88];//[rsp+20h][rbp-60h]BYREFunsigned__int64v6;......
  • NewStarCTF 2023 公开赛道 WEEK4|MISC 部分WP
    R通大残1、题目信息R通大残,打了99,补!2、解题方法仔细分析题目,联想到隐写的R通道。首先解释一下:R是储存红色的通道,通道里常见有R(红)、G(绿)、B(蓝)三个通道,如果关闭了R通道图片就没有红色的部分,G、B同理。因此我们想到R大残应该是不显示红色了,猜测结果就在R通道里,所以使用Stegsolv......