NewGrating
流量分析题
拿到附件,首先看到了文件为蝎子.pcapng
很显然给了我们提示,大概率是冰蝎Behinder
的流量分析
文件总体不大就4667个分组
我首先过滤了http流就在第一个流stream 0
中发现传了个webshell
1 |
|
这是很经典的冰蝎3.0加密算法特征,key
给我们了就是e46023a69f8db309
密码是DASCTF
我们也可以验证一下,冰蝎的AES
密钥key
为连接密码的md5
前16位
1 | ❯ echo -n "DASCTF" |md5sum|awk '{print substr ($0,1,16)}' |
那就尝试找到传完webshell
后执行命令的包
我们直接将请求包中的密文copy下来,拿到这加密后的文本那我们咋如何解密呢?
这就又用到经典厨师了CyberChef
,先将密文base64
解码后再进行AES 128
解密,其中的key就填入上文获取到的key,冰蝎的默认初始化向量(IV)是0123456789abcdef
也是16位和key相同
这样我们就得到了解密后的文本,不过这个文本需要再次进行``base64`解码,将括号内的文本再次解密后得到最终的内容
不过没什么价值,我们继续跟踪流,在追踪到流stream 4
时发现除了第一段的请求包,其他段的请求包内容都异常的大,很难用鼠标慢慢复制下来,我们可以使用wiresahrk
的另存为功能,单独将ip为225.1
发给225.129
的对话保存下来
这边我利用Visual Studio Code
打开,虽然还是有点卡卡的,找到第二段从第25行开始到结束
这边有个小技巧就是在行的开头按住shift
键再按两下End
键即可全部选中25行的内容,不过需要删除末尾留存的POST ....
再次copy到CyberChef
二次解密后得到内容
1 | $mode="dXBkYXRl";$mode=base64_decode($mode);$path="L3d3dy9hZG1pbi93d3cud2Vic2hlbGwuY29tXzgwL3d3d3Jvb3QvdXBsb2FkL1Bhc3N3b3JkLnBuZw==";$path=base64_decode($path);$hash="";$blockIndex="MA==";$blockIndex=base64_decode($blockIndex);$blockSize="MzA3MjA=";$blockSize=base64_decode($blockSize);$content="aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQWxnQUFBRXNDQVlBQUFBZlBjMldBQUFQcTBsRVFWUjRuTzNkMjVLck5nSUYwRDVUOC8rLzNGT25VbDNUNVdBc3BLMGJyUFdTeEdrYkxDU3hFVUwrOC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DQk13QUlBQ0JPd0FBRENCQ3dBZ0RBQkN3QWdUTUFDQUFnVHNBQUF3Z1FzQUlBd0FRc0FJRXpBQWdBSUU3QUFBTUlFTEFDQU1BRUxBQ0JNd0FJQUNCT3dBQURDQkN3QWdEQUJDd0FnVE1BQ0FBZ1RzQUFBd2dRc0FJQXdBUXNBSUV6QUFnQUlFN0FBQU1JRUxBQ0FNQUVMQUNCTXdBSUFDQk93QUFEQ0JDd0FnREFCQ3dBZ1RNQUNBQWdUc0FBQXdnUXNBSUF3QVFzQUlFekFBZ0FJRTdBQUFNSUVMQUNBTUFFTEFDQk13QUlBQ0JPd0FBRENCQ3dBZ0RBQkN3QWdUTUFDQUFnVHNBQUF3Z1FzQUlBd0FRc0FJRXpBQWdBSUU3QUFBTUlFTEFDQU1BRUxBQ0JNd0FJQUNCT3dBQURDQkN3QWdEQUJDd0FnVE1BQ0FBZ1RzQUFBd2dRc0FJQXdBUXNBSUV6QUFnQUlFN0FBQU1JRUxBQ0FNQUVMQUNCTXdBSUFDQk93QUFEQ0JDd0FnREFCQ3dBZ1RNQUNBQWdUc0FBQXdnUXNBSUF3QVFzQUlFekFBZ0FJRTdBQUFNSUVMQUNBTUFFTEFDQk13QUlBQ0JPd0FBRENCQ3dBZ0RBQkN3QWdUTUFDQUFnVHNBQUF3Z1FzQUlBd0FRc0FJRXpBQWdBSUU3QUFBTUlFTEFDQU1BRUxBQ0JNd0FJQUNCT3dBQURDQkN3QWdEQUJDd0FnVE1BQ0FBZ1RzQUFBd2dRc0FJQXdBUXNBSUV6QUFnQUlFN0FBQU1JRUxBQ0FNQUVMQUNEcDYrdnJmMDJLbTFYVlNKVmZBQUFBQUVsRlRrU3VRbUND";$content=base64_decode($content);$charset="";$newpath="";$createTimeStamp="";$accessTimeStamp="";$modifyTimeStamp=""; |
内容中有个content
我们需要再次进行base64
解码,其实其他的变量你也可以尝试base64
解码
类如我解码了path
变量得到一个关键信息,得知应该是一张含有Password
的图片
解密content
果然得到一张图片,但密码信息是隐含的
我们再次尝试跟踪流stream 4
剩余段,在Visual Studio Code
第61行中的密文解密后的内容中发现了content
解码后含有7z
有关信息,是个压缩包,大概率上图的Password
对应的就是下面压缩包的密码
1 | $content="TjNxOHJ5Y2NBQVRxLzdOWU1BQUFBQUFBQUFCcUFBQUFBQUFBQUdIOTN1SjRGaG1xUGJtb2lBOVVyblkzQjAxTU0vQkdqZFJDN2NwK0VzSTg4Uk9UZ0R0QTdpOGpXWGkzSGl4MWFpTkNpRm9CQkFZQUFRa3dBQWNMQVFBQ0pBYnhCd0VTVXcrNkZKa29NL1RPTkFPZlAxVXk3dGVmSVNFQkFBRUFEREFzQUFnS0FVSnpRYUFBQUFVQkdRRUFFUk1BWmdCc0FHRUFad0F1QUhRQWVBQjBBQUFBR1FBVUNnRUFvaENQWEM1cTJRRVZCZ0VBSUFBQUFBQUE=" |
我们利用CyberChef
保存功能,另存为zip文件,打开果然需要密码,但上文图片的Password
如何获取呢,经过搜索引擎查询得知,上方图片是个光栅图片
,何为光栅呢,这里引用群里大佬的解释
顺便在Github
上找到秒杀光栅图片
的脚本
AabyssZG/Raster-Terminator: CTF之光栅图秒杀器
感谢CTF大手子Phantom Engage
的解答,那就直接用脚本跑就完了,轻而易举拿到了Password
用密码解压压缩包,即可得到flag
DASCTF{d68b6013-d70a-4ada-926d-68fe3265360a}