wecahll_writeup

题目:Anderson Application Auditing

描述:You are in the role of a secret hacker. As always.
Your next job is the following:
VSA (Very Secret Agency) has followed very strict security policies for years, it is almost impossible to break into their network.
Unfortunately, that’s what your boss wants from you.
After some social engineering you gathered, that VSA wants to order some simple programs from SoftMicro software development corporation.
SoftMicro is the old partner for VSA, and he has implemented lots of backdoors for a commercial operating system named “Doors” for VSA.
SoftMicro’s software is usually crappy, but their network is very well defended - thanks to the very often attacks against SoftMicro’s network.
But VSA doesn’t accept any code from SoftMicro directly, because they hired a well known company named Anderson to audit every piece of code that are used at VSA.
Your plan is to hijack the communication between Anderson and SoftMicro, so you can analyse the program, and after Anderson audited the program, you will hijack the traffic between Anderson and VSA, exchange the program with your evil one, and the job is done.
The plan is great, but maybe not everything goes as planned…
Your first task is to hijack the communication between Anderson’s and SoftMicro’s network.
Here is the information you have already gathered:
The SoftMicro’s network is 207.46.197.0
Your public IP is 17.149.160.49
Anderson’s main page is Anderson
As you make progress on the challenge, you will get six pieces of a secret code, which is the proof that you have solved the challenge.
So, don’t forget to write down those secret code pieces.
解析你的角色是一个黑客,目的是入侵 vsa,而vsa想要从sorfMrcro外包程序,ms对一个叫做door的程序留下了许多后门。但是vsa并不是直接接受ms的代码,他们雇用了一个anderson的审计机构来审计所有的代码。计划劫持ms和anderson之间的通信,这样可以分析程序,当Anderson 审计结束之后,你将劫持Anderson和vsa之间的通信,留下恶意代码,我们劫持双方的通信,做一个man-in-middle,是当anderson审查结束之后,将正确的代码发过去的时候,先经过我们,然后我门留下好的代码,发送恶意代码给vsa
题目的第一部分目的是劫持双方的通信,给了两个ip地址和anderson的主页
注意题目总共有六部分,每解决一个部分会给出一个keyword,最后的keyword合起来就是本题的答案。
我们首先在anderson主页寻找隐藏信息,各个链接都点一下,发现parnter链接里又一个文档,打开如下关键信息
文档里不仅给出了用户名和密码,还给出了三个网站,分别是

  • The web server config page is here:
    www.example.com/webserver_config.html

  • The firewall config page is here:
    www.example.com/firewall_config.html

  • The router config page is here:
    www.example.com/router_config.html

三个网站都试一下,其实分析一下就可以知道是router_config.html,因为需要窃听通信,所以需要添加路由规则。
题目的网址是https://www.wechall.net/challenge/Z/aaa/index.php,所以路由网址是
https://www.wechall.net/challenge/Z/aaa/router_config.html在这里插入图片描述
输入用户名密码,这个用户名和密码是在文档里边被泄漏的。输入之后添加路由。
在这里插入图片描述
route add -net 207.46.197.0 netmask 255.255.255.0 gw 17.149.160.49,进入下一部分
在这里插入图片描述
第二部分分析题干中提示andersion通过pki加密,对文件进行数字签名,通过md5来验证文件,保证文件的完整性和信任性。所以如果我们需要用恶意程序替换正确程序,就需要将恶意程序的md5边成跟正确程序一样。点击链接,进入下一部分
在这里插入图片描述
这个全选之后会有提示,这个提示非常有用,一开始做的时候没有发现走了很多弯路但不发现也能做出来。其实界面有变化本身就是一个提示,这个也是ctf的魅力之一。
谷歌搜索md5 collision,打开网址网址
按照指令,使用evilizi来解决。在这里插入图片描述
这个耗费的时间比较长,但是最终会生成两个程序 good和evil,正确程序和恶意程序按照如下写

#include <stdio.h>
#include <unistd.h>

int main_good(int ac,char *av[]){
	fprintf(stdout,"Hello VSA employee");
	return 0;
}

int main_evil(int ac,char *av[]){
	fprintf(stdout,"I am a super VIRUS,game over.");
	return 0;

}

上传之后得到第二部分的密钥:evilmd5在这里插入图片描述
得到提示:Your next task is to hijack the traffic between Anderson and VSA.
VSA’s IP network is 12.110.110.0 You know what to do…

我们再次重复,添加路由规则,得到在这里插入图片描述
第三部分密钥get,进入下一部分。在这里插入图片描述
题目解析题目的意思就是想要提交恶意程序,先要发送密钥到ssh端口。但是ssh端口的人工会进行md5审查,使用fuzzy fingerprinting可以一定程度上迷惑端口的审查人,同时提出一些要求,当然,最后一部分仍用黑色字体写了小彩蛋。
https://bl4ckh47.wordpress.com/2009/10/25/fuzzy-fingerprinting/
关于fuzzy fingerprinting的背景,原理以及安装和使用都在上边的链接,但是关于安装,其链接和资源都有问题,安装耽误了我大概一天的时间,详细步骤在我另一篇博客中给出。ffp安装过程链接
上传私钥之后,提示要回去配置路由在这里插入图片描述
主要就是删除路由规则,防止泄漏身份。
将路由的规则配置时候的命令中的add改成del就行
具体:
route del -net 207.46.197.0 netmask 255.255.255.0 gw 17.149.160.49
route del -net 12.110.110.0 netmask 255.255.255.0 gw 17.149.160.49
得到最后两个密钥,将所有密钥连起来为:
routeevilmd5mitmfingerprintgameover
就是题目最后的答案。

首先,我们需要分析题目所提供的代码: ```php <?php error_reporting(0); if ($_FILES["upload"]["error"] > 0) { echo "Error: " . $_FILES["upload"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["upload"]["name"] . "<br />"; echo "Type: " . $_FILES["upload"]["type"] . "<br />"; echo "Size: " . ($_FILES["upload"]["size"] / 1024) . " Kb<br />"; move_uploaded_file($_FILES["upload"]["tmp_name"], "upload/" . $_FILES["upload"]["name"]); echo "Stored in: " . "upload/" . $_FILES["upload"]["name"]; } ?> ``` 从上述代码中我们可以发现,这是一个文件上传的代码,该代码运行后会将用户上传的文件存储到 `upload` 目录下。 但是,该代码没有对上传的文件类型进行限制,这意味着我们可以上传任何类型的文件,甚至是一些恶意的文件。我们可以尝试上传一些常见的恶意文件,比如 `webshell`。 我们可以在本地创建一个 `webshell.php` 文件,然后上传到服务器上的 `upload` 目录。上传完成后,我们可以访问 `http://xxx.xxx.xxx.xxx/upload/webshell.php` 来执行我们上传的 `webshell`。 最后,我们需要注意的是,该上传脚本没有做任何安全性检查,这意味着我们可以上传任意大小的文件,这可能会影响服务器的性能,甚至导致服务器崩溃。因此,在实际应用中,我们应该对上传的文件大小进行限制,同时对上传的文件类型进行检查,从而确保服务器的安全性。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值