几天后第四十六届世赛的省选拔赛就要开幕了,赛方发了安全事件响应的样题,其实就是一道流量分析题。做了一下,记录下做题过程。文末附流量包文件。
0x00 初步分析
我把流量包重命名为practice.pcapng,扔到Kali下,使用Wireshark打开,有6k多个包。打开Statistics工具栏分析一下协议层次结构和会话。

主要有TCP包、SMB包、HTTP包和仅有一个的MySQL包。其实这是一条记录了完整攻击过程的数据包链。
再来看看题目:
- 服务器使用的cms是?版本是?
- MySQL root用户密码是?
- 功击者写入的第一个文件文件名为?
- 禁用了那些函数?
- Web攻击失败后利用了什么漏洞?
- 执行的第一条命令是什么 ?
- 计算机名是什么?
- 获取的flag是多少?
- 下载的文件中的flag是什么?
9个题目一共是120分。
0x01 服务器使用的cms以及版本
直接过滤HTTP协议,发现两种URL,一种是PhpMyAdmin的,一种是WordPress的。

识别WordPress版本,我通常会看页面中引用的css、js文件版本号。

拼接得flag:
flag{wordpress 5.2.1}
0x02 MySQL root用户密码
首先去看看MySQL包

MySQL不允许外连,那么获取密码可能是通过PhpMyAdmin了,因为PhpMyAdmin的账户密码就是MySQL的账户密码。那么去看看PhpMyAdmin相关的包,输入过滤条件:
# 从HTTP请求的URI中过滤字符串
http.request.uri contains "phpmyadmin"

可以看到攻击者对root进行了一波暴力破解,大量密码POST到/phpmyadmin/index.php。那么如何从这么多的密码中找到正确的密码呢?
很简单,我列举两种方法。
第一种:找到最后POST的包,最后的登录必定是成功的。
第二种:登录成功后,服务端会发送Set-Cookie头设置会话ID之类。
这个版本的PhpMyAdmin登录成功后会在Cookie中设置pmaPass字段(我自己对比数据包分析出来的)。但是不论登录是否成功都会设置一个pmaPass,所以直接过滤并不好找。那么先找到正确的Cookie,再去找对应的Set-Cookie头,就容易多了。
直接从后面拿一个正确的Cookie:

从HTTP响应头中过滤Cookie:
http.response.line contains "Lk8rQWafVxwp%2FcDlzSAacQ%3D%3D"

OK,精准匹配到一个包,接着去追踪HTTP流:

URL解码,得到密码:admin@12345
flag{admin@12345}
0x03 攻击者写入的第一个文件文件名
这个其实在我之前分析PhpMyAdmin流量的时候已经看到了,攻击者使用了MySQL的日志功能写了一个phpinfo。

flag{06b8dcf11e2f7adf7ea2999d235b8d84}
0x04 禁用了哪些函数
刚开始没看懂题目,不知道说的什么函数。后来一想,估计是php.ini中配置的disable_function。
直接过滤:
http contains "disable_function"

又是精准匹配,接着追踪HTTP流,Ctrl-F。

处理一下,得到flag:
flag{system,passthru,exec,shell_exec,popen,escapeshellarg,escapeshellcmd,proc_close,proc_open,dl}
0x05 Web攻击失败后利用了什么漏洞
这个题目又看懵逼了,这都拿到shell了怎么就攻击失败了,不能执行命令、不能提权就失败了吗?
HTTP的流量我就没看了,直接去看其他协议去了。其中有大量TCP异常流量:

我猜测攻击者正在进行端口扫描之类的操作,接着发现了SMB流量。

有趣,我直接盲猜用了永恒之蓝。后面的分析证实我猜对了,我在TCP流量中发现了明文的命令执行数据。而且找到了缓冲区溢出的痕迹:

flag{cve-2017-0143}
0x06 执行的第一条命令是什么
永恒之蓝攻击成功后会直接得到SYSTEM权限,工作目录是C:\Windows\System32。但是过滤System32找不到包,过滤system32找到了(后面发现直接过滤C:更方便)。
tcp contains "system32"

其中淡绿色部分是HTTP的包,phpinfo中包含的system32。下面的TCP包分为两个流。因为要找第一条执行的命令,按照顺序追踪第一条流:

可以看到这个憨憨执行了dir命令。。。
flag{dir}
0x07 计算机名是什么
我首先在SMB流量中找到了一处,但是发现攻击者执行了systeminfo命令,直接能看计算机名。


flag{WIN-H1D59GQEH0T}
0x08 获取的flag是多少
越到后越看不懂题目,什么flag,在哪?这题我昨天没做出来,今天才看到flag的。之前的命令执行数据包,分为两条TCP流,第二条流中发现了这个:

flag{3f76818f507fe7eb6422bd0703c64c88}
0x09 下载的文件中的flag是什么
在流量包的最后发现了这样几个HTTP请求:

追踪流,在PNG的数据中发现了隐藏的txt文件:

flag{d31c1d06331a95346f41ab93afca8d31}
不怎么打CTF,也没怎么做过流量分析题,本来以为会很难,最后还是拿到了所有flag。这个题目很有意思,同时也熟悉了WireShark的使用,填补了只是空白。比赛加油!
加个好友被老哥
바카라 양방 우리카지노 양방 카지노사이트게임
Thank you ever so for you article post.Thanks Again.
I will right away grab your rss as I can’t find your e-mail subscription link or newsletter service. Do you’ve any? Kindly let me know in order that I could subscribe. Thanks.
Regards for helping out, superb info.
Very neat post.
wow, awesome blog.Much thanks again. Fantastic.
Wow, great article post.Much thanks again. Great.
Say, you got a nice post.Much thanks again. Really Great.
Wow, great article post.Really thank you! Awesome.
疫情还在影响生活!唉!
Appreciate you sharing, great blog article. Keep writing.
Really informative post.Really looking forward to read more. Fantastic.
I really liked your blog post. Want more.
wow, awesome article.Really thank you! Fantastic.
I really like and appreciate your blog post.Much thanks again. Fantastic.
Awesome blog.Really thank you! Much obliged.
Great blog post.Really looking forward to read more. Really Cool.
Looking forward to reading more. Great article.Much thanks again.
Enjoyed every bit of your blog.Really thank you! Keep writing.
I really liked your article.Really thank you! Much obliged.
Great blog.Thanks Again. Fantastic.
더존카지노 샌즈카지노 코인카지노 퍼스트카지노 카지노시스템베팅
payday web site google fuck you
Card can be found and a bit more complicated than that. Adolfo Reckling
Thank you ever so for you article post.Really thank you!
Appreciate you sharing, great blog article.Much thanks again. Really Cool.
bookmarked!!, I like your site!
wow, awesome post.Really thank you! Really Great.
A big thank you for your post.Much thanks again. Really Cool.
Bunun son örneği Kanada’da görüldü. Kanada Menkul Kıymetler Yönetimi (CSA)
Looking forward to reading more. Great article post. Raul Walstad
Say, you got a nice article. Much obliged.
Very neat blog post.Really looking forward to read more.
I was able to find good information from your blog posts.
I couldn’t refrain from commenting. Perfectly written.
Advanced reading here!
Nice Post. It’s really a very good article. I noticed all your important points. Thanks.
I can’t go into details, but I have to say its a good article!
Very fine blog.
Makes sense to me.
I want to see your book when it comes out.
You write Formidable articles, keep up good work.
Good information. Lucky me I found your website by accident (stumbleupon). I have book marked it for later.
I imagine so. Very good stuff, I agree totally.
I will immediately grab your rss as I can’t find your email subscription link or e-newsletter service. Do you have any? Kindly let me know in order that I could subscribe. Thanks.
Appreciate you sharing, great blog post.Really thank you! Great.
I will immediately seize your rss feed as I can at find your email subscription hyperlink or newsletter service. Do you have any? Please let me know so that I may just subscribe. Thanks.
escort
Erkek severse tüm bölümlerini izle
It’s time for communities to rally.
Djtiva – college essay planner Xjlosz igufdc
I love your blog. It looks every informative.
bonjour I love Your Blog can not say I come here often but im liking what i c so far….
Woh I enjoy your content , saved to bookmarks!
I really like and appreciate your article post.Really looking forward to read more. Will read on…
How do I subscribe to your blog? Thanks for your help.
Bayanur.com Ankara Escort
Howdy, a helpful article for sure. Thank you.
Very fine blog.
cattle ivermectin for humans ivermectin for snake mites
Great information. Lucky me I recently found your blog by chance (stumbleupon). I have book marked it for later!
stromectol sales – purchase ivermectin ivermectin ebay
I will right away clutch your rss feed as I can’t find your e-mailsubscription hyperlink or newsletter service. Do you’ve any?Please let me realize in order that I may just subscribe.Thanks.
Thanks a lot! I value it.how to write an opinion essay essay writing service need essay written
A round of applause for your post.Thanks Again.
Advanced reading here!
Regards for helping out, superb info.
Sie können dieses Signal auf Ihre Trading-Bots auf 3Commas anwenden, das eingehende Signal bestimmt dieStartzeit des Handels für die ausgewählte Taktik und das ausgewählte Handelspaar.
I really like your writing style, excellent info , thanks for putting up : D.
Appreciate you sharing, great blog.Thanks Again. Fantastic.
Fantastic post.Much thanks again. Want more.
Thanks for sharing your thoughts about handlers.Regards
Wow, great article.Much thanks again. Cool.
best ed pill erectile dysfunction – male dysfunction
ivermectin dose calculator ivermectin mange
ankara escort
ตอนต้นผมว่าเว็บไซต์ไหนก็แบบเดียวกัน ด้วยเหตุว่าเข้าไปก็พบเกมเดิมๆแม้กระนั้นเอาเข้าจริงๆมันแตกต่างกันครับผม ยิ่งเว็บไซต์ไหนที่เวลาฝากถอนจะต้องผ่านบุคลากรอันนี้ผมชังสุดเลย เสียเวล่ำเวลา ส่วนตัวผมว่า เว็บพนัน ดีสุดเลยนะครับ เค้าใช้ระบบอัตโนมัติ
mens ed pills canadian pharmacy – online pharmacy australia free delivery
Wow, great blog article.
I will immediately clutch your rss as I can not to find your e-mail subscription link or e-newsletter service. Do you have any? Please permit me realize so that I may just subscribe. Thanks.
Fantastic blog post.Really looking forward to read more. Keep writing.
Ya tengo mi abono para el Festival Eñe, me gustaría saber que día y a qué hora va a estar Manuel Rivas. Gracias
canadian pharmacy 365 – vyvanse canadian pharmacy vyvanse canadian pharmacy
wow, awesome post.Much thanks again. Awesome.
Etimesgut escort sitesi
Sincan escort sitesi
Muchos Gracias for your article.Much thanks again. Really Great.
I loved your blog article.Thanks Again. Cool.
Wow, great blog post.Much thanks again. Fantastic.
Wow, great blog post.Much thanks again. Will read on…
I really liked your blog article.Really thank you! Want more.
petsmart ivermectin ivermectin horse wormer tractor supply
You explained that wonderfully!custom order essays essay writer speech writing service
Thank you ever so for you blog article.Thanks Again. Much obliged.
Very neat blog article.Much thanks again. Awesome.
You certainly know how to bring a problem to light and make
Very good article post.Really looking forward to read more. Keep writing.
Very informative article post.Much thanks again. Really Cool.
Looking forward to reading more. Great blog post.Thanks Again. Awesome.
Wow, great article post.Thanks Again. Great.
Thank you ever so for you post.Really looking forward to read more. Great.
Enjoyed every bit of your blog article.Thanks Again. Great.
A big thank you for your blog post.Really thank you! Cool.
Good info. Lucky me I reach on your website by accident, I bookmarked it.
Enjoyed every bit of your blog post.Thanks Again. Cool.
I really liked your post.Really thank you! Great.
Appreciate you sharing, great article. Cool.
Appreciate you sharing, great post.Much thanks again. Want more.
wow, awesome blog article.
Very informative blog post.Really looking forward to read more. Much obliged.
Muchos Gracias for your blog article.Thanks Again. Really Cool.
Thank you ever so for you blog.Much thanks again. Great.
Great blog.Really thank you! Fantastic.
Good info. Lucky me I reach on your website by accident, I bookmarked it. 現場兒童色情片 儿童色情片
Good info. Lucky me I reach on your website by accident, I bookmarked it. 現場兒童色情片 儿童色情片
Enjoyed every bit of your blog post.Really thank you! Cool.
Saved as a favorite, I love your site.
I used to be able to find good advice from your blog articles.
mersin duvar kağıdı
Very informative article.Thanks Again. Will read on…
Very nice article, totally what I was looking for.|
Good info. Lucky me I reach on your website by accident, I bookmarked it. mfajans
Enjoyed every bit of your article post.Really thank you! Will read on…
Great blog article. Keep writing.
Appreciate you sharing, great blog post.Thanks Again.
Wow, great article. Fantastic.
Appreciate you sharing, great blog article. Awesome.
Looking forward to reading more. Great article.Really thank you! Cool.
Very neat article post.Much thanks again. Cool.
Very informative blog article.Much thanks again. Fantastic.
Appreciate you sharing, great blog article.Thanks Again.
Very neat article.Thanks Again. Awesome.
Thank you for your blog article.Really thank you! Keep writing.