JIS-CTF-VulnUpload靶机共有5个Flag,找到它们!
0x01初步探测
靶机导入虚拟机后,先找到靶机IP,使用netdiscover命令扫描即可。扫到靶机ip192.168.1.107
![点击查看原图 点击查看原图](https://itho.cn/content/uploadfile/202002/9c9a1582721859.png)
nmap扫描了下靶机端口,只有80端口跟22端口开着
![点击查看原图 点击查看原图](https://itho.cn/content/uploadfile/202002/dc441582721989.png)
0x02账号爆破
那就访问http://192.168.1.107先看看吧,跳转到了login.php页面
![点击查看原图 点击查看原图](https://itho.cn/content/uploadfile/202002/cfa51582722139.png)
看到了登陆界面,那就先爆破下呗,可能账号密码就出来了呢,但事实证明爆破无果。
![点击查看原图 点击查看原图](https://itho.cn/content/uploadfile/202002/81371582722936.png)
0x03第一个flag
去dirb扫了下,扫到了个http://192.168.1.107/flag/,直接访问,拿到了第一个flag
The 1st flag is : {8734509128730458630012095}
0x04第二个flag
继续看dirb扫出来的铭感链接,有个链接引起了我的注意http://192.168.1.107/admin_area/,访问一下却显示The admin area not work :),查看了网页源代码,拿到了第二个flag,而且还有也直接拿到了
username : admin password : 3v1l_H@ck3r密码这么复杂怪不得爆破出来了...
The 2nd flag is : {7412574125871236547895214}
![点击查看原图 点击查看原图](https://itho.cn/content/uploadfile/202002/181f1582723590.png)
0x05文件上传漏洞利用
我们继续寻找flag,拿到账号密码,去login.php登陆看看,登陆成功,一个文件上传的页面,应该是个文件上传漏洞
![点击查看原图 点击查看原图](https://itho.cn/content/uploadfile/202002/ebe81582723954.png)
直接上传个一句话试试看,<?php eval($_REQUEST['a'])?> 上传后提示Success 成功!那么问题来了,路径不知道。
刚刚dirb还扫出来个robots.txt,访问http://192.168.1.107/robots.txt看看有啥收获,看到/uploaded_files,应该就是这个。
![点击查看原图 点击查看原图](https://itho.cn/content/uploadfile/202002/05801582724344.png)
拼接下我刚刚上传的php一句话,http://192.168.1.107/uploaded_files/a.php,能够访问,构造phpinfo也成功执行。
OK有了php一句话,一切都变的好办起来了~
![点击查看原图 点击查看原图](https://itho.cn/content/uploadfile/202002/e04b1582724692.png)
0x06第三个flag
查看/var/www/html/目录下有个flag.txt权限不够看不了,查看hint.txt成功拿到了第三个flag,The 3rd flag is : {7645110034526579012345670},而且有提示try to find user technawi password to read the flag.txt file, you can find it in a hidden file ;)尝试查找用户technawi密码以读取flag.txt文件,您可以在隐藏文件中找到它;)
![点击查看原图 点击查看原图](https://itho.cn/content/uploadfile/202002/ff301582727095.png)
0x07第四个flag
使用grep命令查找目录中包含
technawi的文件,语法grep -rs "technawi" /etc/
参数-r为当指定要查找的是目录而非文件时,必须使用这项参数,否则grep指令将回报信息并停止动作。 -s为不显示错误信息。
![点击查看原图 点击查看原图](https://itho.cn/content/uploadfile/202002/61651582728562.png)
看到有个包含username:technawi的文件引起了我的注意,cat /etc/mysql/conf.d/credentials.txt进去看看。查看文件后成功拿到了第四个flag,The 4th flag is : {7845658974123568974185412},而且还包含了账号密码。username : technawi password : 3vilH@ksor
![点击查看原图 点击查看原图](https://itho.cn/content/uploadfile/202002/e5871582728666.png)
0x08第五个flag
利用上面的账号密码,登陆ssh,进入/var/www/html查看前面我们没权限查看的flag.txt文件,拿到了第五个flagThe 5th flag is : {5473215946785213456975249} 到此,5个flag已经全部拿到了。
![点击查看原图 点击查看原图](https://itho.cn/content/uploadfile/202002/937c1582728985.png)
0x09总结
靶机难度不算很高,文件上传地方也没有限制直接能上传php一句话。最后使用
grep命令查找目录文件中的内容,还是可以的。需要了解grep语法的一些参数。
![点击查看原图 flag2.png](https://itho.cn/content/uploadfile/202002/181f1582723590.png)
The admin area not work :)http://192.168.1.107/admin_area/http://192.168.1.107/admin_area/http://192.168.1.107/admin_area/http://192.168.1.107/admin_area/http://192.168.1.107/admin_area/![点击查看原图 baopo.png](https://itho.cn/content/uploadfile/202002/81371582722936.png)
![点击查看原图 baopo.png](https://itho.cn/content/uploadfile/202002/81371582722936.png)
![点击查看原图 baopo.png](https://itho.cn/content/uploadfile/202002/81371582722936.png)
![点击查看原图 baopo.png](https://itho.cn/content/uploadfile/202002/81371582722936.png)
![点击查看原图 baopo.png](https://itho.cn/content/uploadfile/202002/81371582722936.png)
![点击查看原图 baopo.png](https://itho.cn/content/uploadfile/202002/81371582722936.png)
![点击查看原图 index.png](https://itho.cn/content/uploadfile/202002/cfa51582722139.png)
发表评论